/// <summary>
/// Initializes the common parameters and parameters specific to this request.
/// </summary>
/// <param name="name">Input
/// MgHttpRequest
/// This contains all the parameters of the request.
/// </param>
/// <returns>
/// nothing
/// </returns>
MgHttpCsConvertWktToCoordinateSystemCode::MgHttpCsConvertWktToCoordinateSystemCode(MgHttpRequest *hRequest)
{
    InitializeCommonParameters(hRequest);

    Ptr<MgHttpRequestParam> params = hRequest->GetRequestParam();
    m_ogcWkt = params->GetParameterValue(MgHttpResourceStrings::reqCsWkt);
}
Exemplo n.º 2
0
/// <summary>
/// Initializes the common parameters and parameters specific to this request.
/// </summary>
/// <param name="name">Input
/// MgHttpRequest
/// This contains all the parameters of the request.
/// </param>
/// <returns>
/// nothing
/// </returns>
MgHttpGetDrawing::MgHttpGetDrawing(MgHttpRequest *hRequest)
{
    InitializeCommonParameters(hRequest);

    Ptr<MgHttpRequestParam> params = hRequest->GetRequestParam();
    m_resId = params->GetParameterValue(MgHttpResourceStrings::reqDrawingResourceId);
}
Exemplo n.º 3
0
/// <summary>
/// Initializes the common parameters and parameters specific to this request.
/// </summary>
/// <param name="name">Input
/// MgHttpRequest
/// This contains all the parameters of the request.
/// </param>
/// <returns>
/// nothing
/// </returns>
MgHttpMoveResource::MgHttpMoveResource(MgHttpRequest *hRequest)
{
    InitializeCommonParameters(hRequest);

    Ptr<MgHttpRequestParam> hrParam = m_hRequest->GetRequestParam();
    assert(hrParam != 0);

    // Get Source Resource Id name
    m_sourceResourceId = hrParam->GetParameterValue(MgHttpResourceStrings::reqSourceResourceId);

    // Get Destination Resource Id name
    m_destResourceId = hrParam->GetParameterValue(MgHttpResourceStrings::reqDestinationResourceId);

    // Get the flag to determine whether or not the destination resource
    // should be overwritten if it exists.
    m_overwrite = ::atoi(MgUtil::WideCharToMultiByte(
        hrParam->GetParameterValue(
        MgHttpResourceStrings::reqOverwrite)).c_str()) != 0;

    // In order to maintain backward compatibility, the Cascade flag
    // will be set to false by default if it is not specified.
    STRING cascadeParam = hrParam->GetParameterValue(MgHttpResourceStrings::reqCascade);

    m_cascade = (!cascadeParam.empty() && 0 != MgUtil::StringToInt32(cascadeParam));
}
Exemplo n.º 4
0
/// <summary>
/// Initializes the common parameters and parameters specific to this request.
/// </summary>
/// <param name="name">Input
/// MgHttpRequest
/// This contains all the parameters of the request.
/// </param>
/// <returns>
/// nothing
/// </returns>
MgHttpGetMap::MgHttpGetMap(MgHttpRequest *hRequest)
{
    InitializeCommonParameters(hRequest);

    Ptr<MgHttpRequestParam> params = hRequest->GetRequestParam();
    m_mapDefinition = params->GetParameterValue(MgHttpResourceStrings::reqMappingMapDefinition);
    m_dwfVersion = params->GetParameterValue(MgHttpResourceStrings::reqMappingDwfVersion);
    m_emapVersion = params->GetParameterValue(MgHttpResourceStrings::reqMappingEmapVersion);
}
Exemplo n.º 5
0
/// <summary>
/// Initializes the common parameters and parameters specific to this request.
/// </summary>
/// <param name="name">Input
/// MgHttpRequest
/// This contains all the parameters of the request.
/// </param>
/// <returns>
/// nothing
/// </returns>
MgRestTask::MgRestTask(MgRestRequest *Request)
{
    InitializeCommonParameters(Request);
    
    Ptr<MgHttpRequestParam> query_params = Request->GetRequestParam();
    
    // Get any map name
    m_WebLayout = query_params->GetParameterValue(D_REST_URI_QUERY_PARAM_WEBLAYOUT);

    

}
Exemplo n.º 6
0
MgHttpCopyResource::MgHttpCopyResource(MgHttpRequest* hRequest)
{
    InitializeCommonParameters(hRequest);

    Ptr<MgHttpRequestParam> hrParam = m_hRequest->GetRequestParam();

    // Get source resource ID
    m_sourceResourceId = hrParam->GetParameterValue(MgHttpResourceStrings::reqSourceResourceId);

    // Get destination resource ID
    m_destResourceId = hrParam->GetParameterValue(MgHttpResourceStrings::reqDestinationResourceId);

    // Get the flag to determine whether or not the destination resource
    // should be overwritten if it exists.
    m_overwrite = ::atoi(MgUtil::WideCharToMultiByte(
        hrParam->GetParameterValue(
        MgHttpResourceStrings::reqOverwrite)).c_str()) != 0;
}
Exemplo n.º 7
0
/// <summary>
/// Initializes the common parameters and parameters specific to this request.
/// </summary>
/// <param name="name">Input
/// MgHttpRequest
/// This contains all the parameters of the request.
/// </param>
/// <returns>
/// nothing
/// </returns>
MgHttpGetMapLegendImage::MgHttpGetMapLegendImage(MgHttpRequest *hRequest)
{
    InitializeCommonParameters(hRequest);

    Ptr<MgHttpRequestParam> params = hRequest->GetRequestParam();

    // Get the map resource
    m_mapName = params->GetParameterValue(MgHttpResourceStrings::reqRenderingMapName);

    // Get the requested image format
    m_mapFormat = params->GetParameterValue(MgHttpResourceStrings::reqRenderingFormat);

    // Get width and convert to integer
    string widthParam = MgUtil::WideCharToMultiByte(params->GetParameterValue(MgHttpResourceStrings::reqRenderingWidth));
    m_width = atoi(widthParam.c_str());

    // Get height and convert to integer
    string heightParam = MgUtil::WideCharToMultiByte(params->GetParameterValue(MgHttpResourceStrings::reqRenderingHeight));
    m_height = atoi(heightParam.c_str());
}
Exemplo n.º 8
0
/// <summary>
/// Initializes the common parameters and parameters specific to this request.
/// </summary>
/// <param name="name">Input
/// MgHttpRequest
/// This contains all the parameters of the request.
/// </param>
/// <returns>
/// nothing
/// </returns>
MgHttpKmlGetLayer::MgHttpKmlGetLayer(MgHttpRequest *hRequest)
{
    InitializeCommonParameters(hRequest);

    Ptr<MgHttpRequestParam> params = hRequest->GetRequestParam();

    // Get the layer definition
    m_layerDefinition = params->GetParameterValue(MgHttpResourceStrings::reqKmlLayerDefinition);

    // Get the map agent Uri
    m_agentUri = hRequest->GetAgentUri();

    // Get the bounding box
    m_boundingBox = params->GetParameterValue(MgHttpResourceStrings::reqKmlBoundingBox);

    // Get the requested format
    m_format = params->GetParameterValue(MgHttpResourceStrings::reqKmlFormat);

    // Get the map image width
    STRING width = params->GetParameterValue(MgHttpResourceStrings::reqKmlWidth);
    m_width = MgUtil::StringToInt32(width);

    // Get the map image height
    STRING height = params->GetParameterValue(MgHttpResourceStrings::reqKmlHeight);
    m_height = MgUtil::StringToInt32(height);

    // Get the map resolution
    STRING dpi = params->GetParameterValue(MgHttpResourceStrings::reqKmlDpi);
    if(!dpi.empty())
    {
        m_dpi = MgUtil::StringToDouble(dpi);
    }
    else
    {
        m_dpi = 96; // default
    }

    // Get the draw order
    STRING drawOrder = params->GetParameterValue(MgHttpResourceStrings::reqKmlDrawOrder);
    m_drawOrder = drawOrder.empty() ? 0 : MgUtil::StringToInt32(drawOrder);
}
Exemplo n.º 9
0
/// <summary>
/// Initializes the common parameters and parameters specific to this request.
/// </summary>
/// <param name="name">Input
/// MgHttpRequest
/// This contains all the parameters of the request.
/// </param>
/// <returns>
/// nothing
/// </returns>
MgHttpEnumerateResources::MgHttpEnumerateResources(MgHttpRequest *hRequest)
{
    InitializeCommonParameters(hRequest);

    Ptr<MgHttpRequestParam> hrParam = m_hRequest->GetRequestParam();

    // Get resource id
    m_resourceId = hrParam->GetParameterValue(MgHttpResourceStrings::reqResourceId);

    // Get depth
    m_depth = MgUtil::StringToInt32(hrParam->GetParameterValue(MgHttpResourceStrings::reqDepth));

    // Get type
    m_type = hrParam->GetParameterValue(MgHttpResourceStrings::reqType);

    // In order to maintain backward compatibility, the Compute Children flag
    // will be set to true by default if it is not specified.
    STRING computeChildrenParam = hrParam->GetParameterValue(MgHttpResourceStrings::reqComputeChildren);

    m_computeChildren = (computeChildrenParam.empty() || 0 != MgUtil::StringToInt32(computeChildrenParam));
}
Exemplo n.º 10
0
/// <summary>
/// Initializes the common parameters and parameters specific to this request.
/// </summary>
/// <param name="name">Input
/// MgHttpRequest
/// This contains all the parameters of the request.
/// </param>
/// <returns>
/// nothing
/// </returns>
MgHttpEnumerateUnmanagedData::MgHttpEnumerateUnmanagedData(MgHttpRequest *hRequest)
{
    InitializeCommonParameters(hRequest);

    Ptr<MgHttpRequestParam> hrParam = m_hRequest->GetRequestParam();

    // Get path
    m_path = hrParam->GetParameterValue(MgHttpResourceStrings::reqPath);

    // Get the recursive flag
    STRING recursive = hrParam->GetParameterValue(MgHttpResourceStrings::reqRecursive);

    MG_HTTP_HANDLER_TRY()

    if (recursive == L"1")
        m_recursive = true;
    else if (recursive == L"0" || recursive == L"")
        m_recursive = false;
    else
    {
        MgStringCollection arguments;
        arguments.Add(MgHttpResourceStrings::reqRecursive);
        arguments.Add(recursive);

        throw new MgInvalidArgumentException(L"MgHttpEnumerateUnmanagedData.MgHttpEnumerateUnmanagedData",
            __LINE__, __WFILE__, &arguments, L"MgInvalidValueOutsideRange", NULL);
    }

    MG_HTTP_HANDLER_CATCH_AND_THROW(L"MgHttpEnumerateUnmanagedData.MgHttpEnumerateUnmanagedData")

    // Get type
    m_type = hrParam->GetParameterValue(MgHttpResourceStrings::reqType);

    // Get filter
    m_filter = hrParam->GetParameterValue(MgHttpResourceStrings::reqFilter);
}
Exemplo n.º 11
0
/// <summary>
/// Initializes the common parameters and parameters specific to this request.
/// </summary>
/// <param name="name">Input
/// MgHttpRequest
/// This contains all the parameters of the request.
/// </param>
/// <returns>
/// nothing
/// </returns>
MgHttpGetSessionTimeout::MgHttpGetSessionTimeout(MgHttpRequest *hRequest)
{
    InitializeCommonParameters(hRequest);
}
Exemplo n.º 12
0
/// <summary>
/// Initializes the common parameters and parameters specific to this request.
/// </summary>
/// <param name="name">Input
/// MgHttpRequest
/// This contains all the parameters of the request.
/// </param>
/// <returns>
/// nothing
/// </returns>
MgHttpGetLegendImage::MgHttpGetLegendImage(MgHttpRequest *hRequest)
{
    InitializeCommonParameters(hRequest);

    Ptr<MgHttpRequestParam> hrParam = hRequest->GetRequestParam();

    m_layerDefinition = hrParam->GetParameterValue(MgHttpResourceStrings::reqMappingLayerDefinition);

    // Get scale and convert to integer
    string scale_str = MgUtil::WideCharToMultiByte(hrParam->GetParameterValue(MgHttpResourceStrings::reqMappingScale));
    m_scale = atoi(scale_str.c_str());

    // The parameters below are optional

    // Get width and convert to integer
    string width_str = MgUtil::WideCharToMultiByte(hrParam->GetParameterValue(MgHttpResourceStrings::reqMappingWidth));
    if(width_str.empty())
    {
        // Use default
        m_width = DefaultWidth;
    }
    else
    {
        m_width = atoi(width_str.c_str());
    }

    // Get height and convert to integer
    string height_str = MgUtil::WideCharToMultiByte(hrParam->GetParameterValue(MgHttpResourceStrings::reqMappingHeight));
    if(height_str.empty())
    {
        // Use default
        m_height = DefaultHeight;
    }
    else
    {
        m_height = atoi(height_str.c_str());
    }

    m_format = hrParam->GetParameterValue(MgHttpResourceStrings::reqMappingFormat);
    if(m_format.empty())
    {
        // Use default
        m_format = DefaultFormat;
    }

    // Get type and convert to integer
    string type_str = MgUtil::WideCharToMultiByte(hrParam->GetParameterValue(MgHttpResourceStrings::reqMappingType));
    if(type_str.empty())
    {
        // Use default
        m_type = -1;
    }
    else
    {
        m_type = atoi(type_str.c_str());
    }

    // Get theme category and convert to integer
    string themeCategory_str = MgUtil::WideCharToMultiByte(hrParam->GetParameterValue(MgHttpResourceStrings::reqMappingThemeCategory));
    if(themeCategory_str.empty())
    {
        // Use default
        m_themeCategory = -1;
    }
    else
    {
        m_themeCategory = atoi(themeCategory_str.c_str());
    }
}
Exemplo n.º 13
0
/// <summary>
/// Initializes the common parameters and parameters specific to this request.
/// </summary>
/// <param name="name">Input
/// MgHttpRequest
/// This contains all the parameters of the request.
/// </param>
/// <returns>
/// nothing
/// </returns>
MgHttpEnumerateGroups::MgHttpEnumerateGroups(MgHttpRequest *hRequest)
{
    InitializeCommonParameters(hRequest);
}
Exemplo n.º 14
0
/// <summary>
/// Initializes the common parameters and parameters specific to this request.
/// </summary>
/// <param name="name">Input
/// MgHttpRequest
/// This contains all the parameters of the request.
/// </param>
/// <returns>
/// nothing
/// </returns>
MgHttpWfsDescribeFeatureType::MgHttpWfsDescribeFeatureType(MgHttpRequest *hRequest)
{
    InitializeCommonParameters(hRequest);
}