|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IXmlPropertySet2
Provides access to members that manage metadata.
When using this interface on a newly-created XmlPropertySet, the InitGeneric method should be called. See the XmlPropertySet coclass documentation for more information.
Method Summary | |
---|---|
void |
deleteProperty(String name)
Deletes the specified elements. |
void |
deletePropertyByAttribute(String attribute,
String value,
boolean deleteParent)
Deletes the elements which have the specified attribute value. |
void |
deletePropertyByNameAndAttribute(String name,
String attribute,
String value,
boolean deleteParent)
Deletes the specified elements which have the specified attribute value. |
void |
getAttribute(String name,
String attribute,
Object[] value)
Returns the set of values for the specified attribute from the specified elements. |
int |
getCountX(String name)
Number of occurrances of an element in the metadata. |
void |
getPropertiesByAttribute(String attribute,
String value,
boolean noValues,
Object[] tags,
Object[] values)
Returns the set of names and values for elements which have the specified attribute value. |
String |
getXml(String name)
Returns the XML corresponding to the specified element as a string. |
void |
initExisting()
Initializes an XmlPropertySet and adds the Esri group of elements. |
void |
initGeneric(String rootName)
Initializes an XmlPropertySet without adding the Esri group of elements. |
boolean |
isNew()
Indicates if a new XmlPropertySet was created on retrieving the metadata. |
boolean |
isOverwriteSyncAttribute()
Indicates if the Sync attribute will be ignored when setting an element's value. |
void |
saveAsFile(String xslPath,
String header,
boolean outputANSI,
String[] outPath)
Transforms the metadata using an XSL stylesheet if specified, writes out the header if specified, and saves it in a file. |
void |
setAttribute(String name,
String attribute,
Object value,
int action)
Sets the attribute of the specified element. |
void |
setOverwriteSyncAttribute(boolean overwriteSyncAttributes)
Indicates if the Sync attribute will be ignored when setting an element's value. |
void |
setPropertyX(String name,
Object value,
int propType,
int action,
boolean syncing)
Sets the value of the specified element. |
void |
setXml(String xml)
Replaces existing metadata with the content defined in the XML. |
String |
simpleGetProperty(String name)
The values of the specified property. |
void |
transformImages(String path,
Object[] fileNames)
Transforms encoded thumbnail and image enclosures to files and links them into the metadata. |
Method Detail |
---|
int getCountX(String name) throws IOException, AutomationException
name
- The name (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void getPropertiesByAttribute(String attribute, String value, boolean noValues, Object[] tags, Object[] values) throws IOException, AutomationException
Documentation for this property can be found at the IXmlPropertySet::GetPropertiesByAttribute description.
attribute
- The attribute (in)value
- The value (in)noValues
- The noValues (in)tags
- A Variant (out: use single element array)values
- A Variant (out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void setPropertyX(String name, Object value, int propType, int action, boolean syncing) throws IOException, AutomationException
Documentation for this property can be found at the IXmlPropertySet::SetPropertyX description.
name
- The name (in)value
- A Variant (in)propType
- A com.esri.arcgis.geodatabase.esriXmlPropertyType constant (in)action
- A com.esri.arcgis.geodatabase.esriXmlSetPropertyAction constant (in)syncing
- The syncing (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void deleteProperty(String name) throws IOException, AutomationException
Documentation for this property can be found at the IXmlPropertySet::DeleteProperty description.
name
- The name (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void deletePropertyByAttribute(String attribute, String value, boolean deleteParent) throws IOException, AutomationException
Documentation for this property can be found at the IXmlPropertySet::DeletePropertyByAttribute description.
attribute
- The attribute (in)value
- The value (in)deleteParent
- The deleteParent (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.String simpleGetProperty(String name) throws IOException, AutomationException
Documentation for this property can be found at the IXmlPropertySet::SimpleGetProperty description.
name
- The name (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void saveAsFile(String xslPath, String header, boolean outputANSI, String[] outPath) throws IOException, AutomationException
Documentation for this property can be found at the IXmlPropertySet::SaveAsFile description.
xslPath
- The xslPath (in)header
- The header (in)outputANSI
- The outputANSI (in)outPath
- The outPath (in/out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.boolean isNew() throws IOException, AutomationException
Documentation for this property can be found at the IXmlPropertySet::IsNew description.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void setAttribute(String name, String attribute, Object value, int action) throws IOException, AutomationException
Documentation for this property can be found at the IXmlPropertySet::SetAttribute description.
name
- The name (in)attribute
- The attribute (in)value
- A Variant (in)action
- A com.esri.arcgis.geodatabase.esriXmlSetPropertyAction constant (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void transformImages(String path, Object[] fileNames) throws IOException, AutomationException
Documentation for this property can be found at the IXmlPropertySet::TransformImages description.
path
- The path (in)fileNames
- A Variant (out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void initExisting() throws IOException, AutomationException
Documentation for this property can be found at the IXmlPropertySet::InitExisting description.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void initGeneric(String rootName) throws IOException, AutomationException
The InitGeneric method initializes an XmlPropertySet without adding the ESRI group of elements.
This method is available to the XmlProperty CoClass through the IXmlPropertySet2 Interface.
rootName
- The rootName (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IXmlPropertySet2.initExisting()
String getXml(String name) throws IOException, AutomationException
The GetXml method returns both the metadata element tag (including attributes/values pairs) and the corresponding value as string.
Specifying an XML element with children nodes will return all children elements and values also.
Because the return variable is of type string, specifying enclosures, images or pictures return the data encoded as Base64 inside of XML tags (unless TransformImages has been called).
If repeating elements are specified, i.e. "idinfo/keywords/theme/themekey", nothing will be returned. More detailed criteria are necessary when specifying the Name parameter. This can be achieved with an XPath query. More information on XPath can be found at the IXmlPropertySet documentation and through documentation below.
name
- The name (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IXmlPropertySet2.saveAsFile(String, String, boolean, String[])
,
IXmlPropertySet2.setXml(String)
void setXml(String xml) throws IOException, AutomationException
The SetXML method replaces the entire metadata document with the Xml string supplied in the XML parameter.
To target specific XML elements, the SetPropertyX method should be used.
xml
- The xml (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IXmlPropertySet2.getXml(String)
void deletePropertyByNameAndAttribute(String name, String attribute, String value, boolean deleteParent) throws IOException, AutomationException
The DeletePropertyByNameAndAttribute method provides additional parameters to delete XML elements and their corresponding values from metadata documents. Similar actions can be accomplished through other methods (DeleteProperty, DeletePropertyByAttribute) and XPath strings. For instance the following lines of pseudocode accomplish the same action;
xmlPropertySet.DeletePropertyByNameAndAttribute("idinfo/keywords/theme/themekey", "new", "yes", False)
xmlPropertySet.DeleteProperty("idinfo/keywords/theme/themekey[@new='yes']")
The Name parameter uses XPath to describe the location and condition of XML nodes in metadata. More information on XPath can be found at the IXmlPropertySet documentation.
If children elements of the specified Name parameter exist, the DeletePropertyByNameAndAttribute method will also remove them from the XML Document.
The Attribute parameter must contain a valid string character. Otherwise the DeleteProperty method should be used for deleting elements without having to specify attributes.
By setting the attribute Value parameter to "", all elements that match the Name and Attribute parameter will be deleted. The DeletePropertyByAttribute method should be used to delete elements without specifying attribute values.
The deleteParent parameter is a Boolean expression that indicates if the parent element of the Name parameter should be deleted. Special attention should be made to this parameter when deleting a Thumbnail or Binary Enclosure. The parent of the Thumbnail element is the Enclosure element, which also happens to be a parent element of the Data element that holds the Binary information. If deleteParent is set to true when specifying the Data or Thumbnail tag, all Enclosures information will be removed.
name
- The name (in)attribute
- The attribute (in)value
- The value (in)deleteParent
- The deleteParent (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IXmlPropertySet2.deleteProperty(String)
,
IXmlPropertySet2.deletePropertyByAttribute(String, String, boolean)
void getAttribute(String name, String attribute, Object[] value) throws IOException, AutomationException
The Name parameter determines the location of the XML element.
Because XML elements may contain multiple attributes/value pairs, the Attribute parameter is used to specify the attribute.
The Value argument is returned containing the attribute values.
The GetAttribute method returns the attribute value of the specified metadata element.
The Name parameter uses XPath to describe the location and condition of XML nodes in metadata. More information on XPath can be found at the IXmlPropertySet documentation.
The Attribute must contain a valid string. If no string is declared (""), a run time error will occur.
name
- The name (in)attribute
- The attribute (in)value
- A Variant (out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.The Values parameter must be a Object to hold multiple values.
void setOverwriteSyncAttribute(boolean overwriteSyncAttributes) throws IOException, AutomationException
overwriteSyncAttributes
- The overwriteSyncAttributes (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IXmlPropertySet2.setPropertyX(String, java.lang.Object, int, int, boolean)
,
IXmlPropertySet2
boolean isOverwriteSyncAttribute() throws IOException, AutomationException
By default the OverwriteSyncAttribute property is set to false. If the property is changed it remains true for the time the object is held in memory. Once the object is released, the OverwriteSyncAttribute is set back to false.
The OverwriteSyncAttribute property is set for an entire property set and not individual properties.
When the property is set to true, the syncing parameter used and the SetPropertyX methods is ignored. The SetPropertyX action, determined by the esriXmlSetPropertyAction, is then carried out. Otherwise if the OverwriteSyncAttribute property remains false, the esriXmlSetPropertyAction and value of the syncing parameter in the SetPropertyX determine the action.
A complete understanding of the syncing parameter is recommended when setting and getting the OverwriteSyncAttribute property. See the documentation for IXmlPropertySet.SetPropertyX for more information.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IXmlPropertySet2.setPropertyX(String, java.lang.Object, int, int, boolean)
,
IXmlPropertySet2
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |