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;
}
|