コード例 #1
0
CIMValue RemoteMethodProvider::invokeMethod(
    const ProviderEnvironmentIFCRef& env,
    const String& ns,
    const CIMObjectPath& path,
    const String& methodName,
    const CIMParamValueArray& in,
    CIMParamValueArray& out )
{
    LoggerRef lgr = env->getLogger(COMPONENT_NAME);
    OW_LOG_DEBUG(lgr, Format("RemoteMethodProvider::invokeMethod ns = %1, path = %2, methodName = %3", ns, path, methodName));
    String lUrl(m_url);
    ClientCIMOMHandleRef hdl = RemoteProviderUtils::getRemoteClientCIMOMHandle(lUrl, m_useConnectionCredentials, env, m_pool, m_alwaysSendCredentials);
    OW_LOG_DEBUG(lgr, Format("RemoteMethodProvider::invokeMethod got ClientCIMOMHandleRef for url: %1", lUrl));

    ClientCIMOMHandleConnectionPool::HandleReturner returner(hdl, m_pool, lUrl);

    OW_LOG_DEBUG(lgr, "RemoteMethodProvider::invokeMethod calling remote WBEM server");

    CIMValue rval(CIMNULL);
    try
    {
        rval = hdl->invokeMethod(ns, path, methodName, in, out);
    }
    catch (CIMException& e)
    {
        if (e.getErrNo() == CIMException::NOT_SUPPORTED)
        {
            e.setErrNo(CIMException::FAILED); // providers shouldn't ever throw NOT_SUPPORTED
        }
        OW_LOG_INFO(lgr, Format("RemoteMethodProvider::invokeMethod remote WBEM server threw: %1", e));
        throw;
    }
    catch (const Exception& e)
    {
        String msg = Format("RemoteMethodProvider::invokeMethod failed calling remote WBEM server: %1", e);
        OW_LOG_ERROR(lgr, msg);
        OW_THROWCIMMSG_SUBEX(CIMException::FAILED, msg.c_str(), e);
    }
    return rval;
}
コード例 #2
0
void CMainWindow::on_trvCharts_itemDoubleClicked(QTreeWidgetItem *item, int column)
{
    QString lFname(item->data(0, Qt::UserRole).toString());
    QFont fnt = item->font(0);
    fnt.setBold(false);
    fnt.setItalic(false);
    item->setFont(0, fnt);
    if(lFname.right(4).toLower() == ".pdf")
    {
        #ifdef Q_OS_WIN
            QStringList lArg(lFname);
            QProcess lReader;
            QString pdfRead(mopt->pdfExe());
            lReader.startDetached(pdfRead, lArg);
        #endif

        #ifdef Q_OS_LINUX
            lFname.insert(0, "file://");
            QUrl lUrl(lFname);
            QDesktopServices::openUrl(lUrl);
        #endif
    }
}
コード例 #3
0
void CMainWindow::on_cmdGat24_clicked()
{
    QUrl lUrl("http://www.gat24.de");
    QDesktopServices::openUrl(lUrl);
}
コード例 #4
0
void SpiderThread::ReBuildUrlIfNeed(CMyString &parentUrl,CMyString &url,CMyString &host)
{
	bool needRebuild=false;
	int len=url.GetStrLen();
	host	=CUrl::GetUrlHost(parentUrl);
	if(len>=4)
	{
		if(url[0]=='w'&&url[1]=='w'&&url[2]=='w'&&url[3]=='.')
		{
		}
		else if(url[0]=='b'&&url[1]=='b'&&url[2]=='s'&&url[3]=='.')
		{
		}
		else if(url[0]=='h'&&url[1]=='t'&&url[2]=='t'&&url[3]=='p')
		{
			if(len>=5&&url[4]==':')
			{
			}
			else
			{
				needRebuild=true;
			}
		}
		else
		{
			if(len>0&&url[0]=='.')
			{
				needRebuild=true;
			}
			else if(len>=3&&url[0]=='/'&&url[1]=='.'&&url[2]=='.')
			{
				needRebuild=true;
				len--;
				url.Erase(0,1);
			}
			else
			{
				int status=0;
				int i=0;
				for(;i<len;i++)
				{
					if(!status&&url[i]=='.')
					{
						status=1;
					}
					else if(status==1&&url[i]=='.')
					{
						break;
					}
					else if(status==1&&url[i]=='/')
					{
						break;
					}
				}
				if(i>=len)
					needRebuild=true;
			}
		}
	}
	else
	{
		needRebuild=true;
	}
	
	if(needRebuild)
	{
		CUrl lUrl(parentUrl);
		CMyString path=lUrl.GetUrlHost()+"/"+lUrl.GetUrlPath();
		int count=0;
		while(1)
		{
			if(url[0]=='.'&&url[1]=='.'&&url[2]=='/')
			{
				url.Erase(0,3);
				count++;
			}
			else
			{
				break;
			}
		}
		
		while(count)
		{
			count--;
			char *p=path.GetBuffer()+path.GetStrLen()-1;
			if(*p=='/')
			{
				path.EraseFromRight(1);
				p--;
			}
			char *e=p;
			while(p!=path.GetBuffer()&&*p!='/')p--;
			if(*p!='/')
			{
				_asm int 3;
			}
			else
			{
				if(count)
					path.EraseFromRight(e-p+1);
				else 
					path.EraseFromRight(e-p);
			}
		}