com.esri.arcgis.geodatabase
Interface IXmlPropertySet2

All Superinterfaces:
Serializable
All Known Implementing Classes:
XmlPropertySet

public interface IXmlPropertySet2
extends Serializable

Provides access to members that manage metadata.

Remarks

When using this interface on a newly-created XmlPropertySet, the InitGeneric method should be called. See the XmlPropertySet coclass documentation for more information.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.


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

getCountX

int getCountX(String name)
              throws IOException,
                     AutomationException
Number of occurrances of an element in the metadata.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Parameters:
name - The name (in)
Returns:
The count
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getPropertiesByAttribute

void getPropertiesByAttribute(String attribute,
                              String value,
                              boolean noValues,
                              Object[] tags,
                              Object[] values)
                              throws IOException,
                                     AutomationException
Returns the set of names and values for elements which have the specified attribute value.

Remarks

Documentation for this property can be found at the IXmlPropertySet::GetPropertiesByAttribute description.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
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)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setPropertyX

void setPropertyX(String name,
                  Object value,
                  int propType,
                  int action,
                  boolean syncing)
                  throws IOException,
                         AutomationException
Sets the value of the specified element.

Remarks

Documentation for this property can be found at the IXmlPropertySet::SetPropertyX description.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
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)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

deleteProperty

void deleteProperty(String name)
                    throws IOException,
                           AutomationException
Deletes the specified elements.

Remarks

Documentation for this property can be found at the IXmlPropertySet::DeleteProperty description.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
name - The name (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

deletePropertyByAttribute

void deletePropertyByAttribute(String attribute,
                               String value,
                               boolean deleteParent)
                               throws IOException,
                                      AutomationException
Deletes the elements which have the specified attribute value.

Remarks

Documentation for this property can be found at the IXmlPropertySet::DeletePropertyByAttribute description.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
attribute - The attribute (in)
value - The value (in)
deleteParent - The deleteParent (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

simpleGetProperty

String simpleGetProperty(String name)
                         throws IOException,
                                AutomationException
The values of the specified property.

Remarks

Documentation for this property can be found at the IXmlPropertySet::SimpleGetProperty description.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
name - The name (in)
Returns:
The value
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

saveAsFile

void saveAsFile(String xslPath,
                String header,
                boolean outputANSI,
                String[] outPath)
                throws IOException,
                       AutomationException
Transforms the metadata using an XSL stylesheet if specified, writes out the header if specified, and saves it in a file.

Remarks

Documentation for this property can be found at the IXmlPropertySet::SaveAsFile description.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
xslPath - The xslPath (in)
header - The header (in)
outputANSI - The outputANSI (in)
outPath - The outPath (in/out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isNew

boolean isNew()
              throws IOException,
                     AutomationException
Indicates if a new XmlPropertySet was created on retrieving the metadata.

Remarks

Documentation for this property can be found at the IXmlPropertySet::IsNew description.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
The isNew
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setAttribute

void setAttribute(String name,
                  String attribute,
                  Object value,
                  int action)
                  throws IOException,
                         AutomationException
Sets the attribute of the specified element.

Remarks

Documentation for this property can be found at the IXmlPropertySet::SetAttribute description.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
name - The name (in)
attribute - The attribute (in)
value - A Variant (in)
action - A com.esri.arcgis.geodatabase.esriXmlSetPropertyAction constant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

transformImages

void transformImages(String path,
                     Object[] fileNames)
                     throws IOException,
                            AutomationException
Transforms encoded thumbnail and image enclosures to files and links them into the metadata.

Remarks

Documentation for this property can be found at the IXmlPropertySet::TransformImages description.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
path - The path (in)
fileNames - A Variant (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

initExisting

void initExisting()
                  throws IOException,
                         AutomationException
Initializes an XmlPropertySet and adds the Esri group of elements.

Remarks

Documentation for this property can be found at the IXmlPropertySet::InitExisting description.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

initGeneric

void initGeneric(String rootName)
                 throws IOException,
                        AutomationException
Initializes an XmlPropertySet without adding the Esri group of elements.

Remarks

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.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
rootName - The rootName (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IXmlPropertySet2.initExisting()

getXml

String getXml(String name)
              throws IOException,
                     AutomationException
Returns the XML corresponding to the specified element as a string.

Remarks

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.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
name - The name (in)
Returns:
The xml
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IXmlPropertySet2.saveAsFile(String, String, boolean, String[]), IXmlPropertySet2.setXml(String)

setXml

void setXml(String xml)
            throws IOException,
                   AutomationException
Replaces existing metadata with the content defined in the XML.

Remarks

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.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
xml - The xml (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IXmlPropertySet2.getXml(String)

deletePropertyByNameAndAttribute

void deletePropertyByNameAndAttribute(String name,
                                      String attribute,
                                      String value,
                                      boolean deleteParent)
                                      throws IOException,
                                             AutomationException
Deletes the specified elements which have the specified attribute value.

Remarks

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.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
name - The name (in)
attribute - The attribute (in)
value - The value (in)
deleteParent - The deleteParent (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IXmlPropertySet2.deleteProperty(String), IXmlPropertySet2.deletePropertyByAttribute(String, String, boolean)

getAttribute

void getAttribute(String name,
                  String attribute,
                  Object[] value)
                  throws IOException,
                         AutomationException
Returns the set of values for the specified attribute from the specified elements.

Description

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.

Remarks

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.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
name - The name (in)
attribute - The attribute (in)
value - A Variant (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:

The Values parameter must be a Object to hold multiple values.


setOverwriteSyncAttribute

void setOverwriteSyncAttribute(boolean overwriteSyncAttributes)
                               throws IOException,
                                      AutomationException
Indicates if the Sync attribute will be ignored when setting an element's value.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
overwriteSyncAttributes - The overwriteSyncAttributes (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IXmlPropertySet2.setPropertyX(String, java.lang.Object, int, int, boolean), IXmlPropertySet2

isOverwriteSyncAttribute

boolean isOverwriteSyncAttribute()
                                 throws IOException,
                                        AutomationException
Indicates if the Sync attribute will be ignored when setting an element's value.

Remarks

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.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
The overwriteSyncAttributes
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IXmlPropertySet2.setPropertyX(String, java.lang.Object, int, int, boolean), IXmlPropertySet2