|
|
|
|
Adds resource data to the specified resource.
- Remarks:
- This uploads the data and stores it in the repository. It does not perform any necessary conversion (for example, converting a version 2 SDF file into a version 3 SDF). If the data needs to be converted into a form that can be used with the MapGuide server, you must use the Studio application or the Studio API.
.Net Syntax
|
virtual void SetResourceData(MgResourceIdentifier resource, string dataName, string dataType, MgByteReader data);
|
Java Syntax
|
virtual void SetResourceData(MgResourceIdentifier resource, String dataName, String dataType, MgByteReader data);
|
PHP Syntax
|
virtual void SetResourceData(MgResourceIdentifier resource, string dataName, string dataType, MgByteReader data);
|
- Parameters:
-
| resource | (MgResourceIdentifier) Resource to which this data is to be associated. |
| dataName | (String/string) Name for the data.
This name must match an element name within the XML content document. If the data name is UserCredentials, then MgResourceTag::Username and MgResourceTag::Password can be inserted into the XML content document to represent provider specific username and/or password. See the example below.
If resource data with the same name has already been set for this resource, the API will overwrite the old setting. No exception is generated. The data name may be any valid UTF-8 string |
| dataType | (String/string) Data type for the resource data. It must match one of the types defined in MgResourceDataType and is case sensitive. Data names must be unique. |
| data | (MgByteReader) Data to set. |
- Returns:
- Returns nothing.
Examples (PHP)
This example sets resource data and stores it as a file:
This example sets resource data and stores it as a stream:
This example sets the embedded credentials for a resource and stores it as a string. The string data type must be used for embedded credentials. The data name must be MgResourceDataName::UserCredentials.
- Exceptions:
-
- See also:
- EnumerateResourceData
GetResourceData
RenameResourceData
DeleteResourceData
|
|