void MgHttpEnumerateResources::Execute(MgHttpResponse& hResponse)
{
Ptr hResult;
hResult = hResponse.GetResult();
// 檢查HTTP請求中的參數
ValidateCommonParameters();
// 創建MgProxyResourceService實例
Ptr mgprService =
(MgResourceService*)(CreateService(MgServiceType::ResourceService));
......
// 執行枚舉資源操作
Ptr byteReader = mgprService->
EnumerateResources(&mgrIdentifier, m_depth, m_type, m_computeChildren);
// 如果需要,轉換響應請求的格式
ProcessFormatConversion(byteReader);
// 將操作結果放入響應請求中的MgHttpResult對象
hResult->SetResultObject(byteReader, byteReader->GetMimeType());
}
MgByteReader* MgProxyResourceService::EnumerateResources(
MgResourceIdentifier* resource, INT32 depth, CREFSTRING type,
INT32 properties, CREFSTRING fromDate, CREFSTRING toDate,
bool computeChildren)
{
MgCommand cmd;
cmd.ExecuteCommand(m_connProp,
MgCommand::knObject,
MgResourceService::opIdEnumerateResources,
7,
Resource_Service,
BUILD_VERSION(1,0,0),
MgCommand::knObject, resource,
MgCommand::knInt32, depth,
MgCommand::knString, &type,
MgCommand::knInt32, properties,
MgCommand::knString, &fromDate,
MgCommand::knString, &toDate,
MgCommand::knInt8, (int)computeChildren,
MgCommand::knNone);
SetWarning(cmd.GetWarningObject());
return (MgByteReader*)cmd.GetReturnValue().val.m_obj;
}
|