Packagecom.adobe.xmp
Interfacepublic interface IXMPAccess

Provides access to and manipulation of XMP metadata within the context of a File Info dialog panel.

All methods access metadata properties using an XPath-like path into the XMP packet, such as xmp:Rating. The prefixes used are local to the panel and must be defined in an XMPNamespace tag. For example: <fi:XMPNamespace prefix="xmp" value="http://ns.adobe.com/xap/1.0/"/>

.

For details of XMP architecture and usage, see the XMP Toolkit documentation.



Public Methods
 MethodDefined by
  
appendArrayItem(arrayPath:String, itemValue:String, itemOptions:int = 0, arrayOptions:int = 0):void
Adds an item to an array, creating the array if necessary.
IXMPAccess
  
catenateArrayItems(arrayPath:String, allowCommas:Boolean = false):IXMPProperty
Converts an array of simple properties into a semicolon-separated display string.
IXMPAccess
  
countArrayItems(arrayPath:String):int
Reports the number of items currently defined in an array.
IXMPAccess
  
deleteProperty(propertyPath:String):void
Deletes an XMP subtree rooted at a given property.
IXMPAccess
  
getArrayItem(arrayPath:String, itemIndex:int):IXMPProperty
Retrieves an item from an array property.
IXMPAccess
  
getLocalizedText(altTextPath:String, locale:String = "x-default"):IXMPProperty
Retrieves a locale-specific value from an alt-text array.
IXMPAccess
  
getLocalPrefix(ns:String):String
Retrieves the registered prefix for a namespace.
IXMPAccess
  
getNamespaceForLocalPrefix(localPrefix:String):String
Retrieves the namespace for a registered prefix.
IXMPAccess
  
getProperty(propertyPath:String):IXMPProperty
Retrieves a property value.
IXMPAccess
  
getPropertyList(propName:String):Array
Retrieves child elements of a namespace or property.
IXMPAccess
  
getXMPPacket():String
Retrieves the XMPPacket as a whole, in the current modified state.
IXMPAccess
  
removeProperties(propName:String = null, options:int = 0):void
Removes properties of a given type in an XMP subtree rooted at a given property.
IXMPAccess
  
restoreProperty(propertyPath:String):void
Restores a property value.
IXMPAccess
  
separateArrayItems(arrayPath:String, catedStr:String, arrayOptions:int = 0, allowCommas:Boolean = false):void
Converts a concatenated array-item string back into array item.
IXMPAccess
  
setLocalizedText(altTextPath:String, locale:String = "x-default", itemValue:String = "", setOptions:int = 0):void
Adds or modifies a locale-specific value in an alt-text array.
IXMPAccess
  
setProperty(propertyPath:String, propValue:String, options:int = 0):void
Creates or sets a property value.
IXMPAccess
Method detail
appendArrayItem()method
public function appendArrayItem(arrayPath:String, itemValue:String, itemOptions:int = 0, arrayOptions:int = 0):void

Adds an item to an array, creating the array if necessary.

Parameters
arrayPath:String — The XPath to the array. The namespace must be registered.
 
itemValue:String — The new item value.
 
itemOptions:int (default = 0) — Option flags describing the type of item to create. A logical OR of allowed bit-flag constants:
  • ARRAY
  • STRUCT
 
arrayOptions:int (default = 0) — Option flags describing the array type to create; A logical OR of allowed bit-flag constants:
  • NO_OPTIONS
  • ARRAY_ORDERED
  • ARRAY_ALTERNATE
  • ARRAY_ALT_TEXT
catenateArrayItems()method 
public function catenateArrayItems(arrayPath:String, allowCommas:Boolean = false):IXMPProperty

Converts an array of simple properties into a semicolon-separated display string.

Parameters
arrayPath:String — The name of an array-type property containing simple values.
 
allowCommas:Boolean (default = false) — When true, allow comma in values. When false, truncate value at first comma.

Returns
IXMPProperty — The constructed string, encapsulated in an IXMPProperty object.
countArrayItems()method 
public function countArrayItems(arrayPath:String):int

Reports the number of items currently defined in an array.

Parameters
arrayPath:String — The XPath to the array. The namespace must be registered.

Returns
int — The number of items.
deleteProperty()method 
public function deleteProperty(propertyPath:String):void

Deletes an XMP subtree rooted at a given property.

Parameters
propertyPath:String — The XPath to the property. The namespace must be registered.
getArrayItem()method 
public function getArrayItem(arrayPath:String, itemIndex:int):IXMPProperty

Retrieves an item from an array property.

Parameters
arrayPath:String — The XPath to the property. The namespace must be registered.
 
itemIndex:int — The 1-based index of the desired item.

Returns
IXMPProperty — The value, encapsulated as an IXMPProperty object.
getLocalizedText()method 
public function getLocalizedText(altTextPath:String, locale:String = "x-default"):IXMPProperty

Retrieves a locale-specific value from an alt-text array.

Parameters
altTextPath:String — The XPath to the alt-text array. The namespace prefix must be registered.
 
locale:String (default = "x-default") — Optional, the locale code for the desired locale. If not specified, gets the x-default value.

Returns
IXMPProperty — The translated value, encapsulated as an IXMPProperty object.
getLocalPrefix()method 
public function getLocalPrefix(ns:String):String

Retrieves the registered prefix for a namespace.

Parameters
ns:String — The namespace string.

Returns
String — The prefix string.
getNamespaceForLocalPrefix()method 
public function getNamespaceForLocalPrefix(localPrefix:String):String

Retrieves the namespace for a registered prefix.

Parameters
localPrefix:String — The prefix string.

Returns
String — The namespace string.
getProperty()method 
public function getProperty(propertyPath:String):IXMPProperty

Retrieves a property value. This is the simplest property getter. Use it for top-level simple properties, or after composing a complex path.

Parameters
propertyPath:String — The XPath to the property. The namespace must be registered.

Returns
IXMPProperty — The value, encapsulated as an IXMPProperty object.
getPropertyList()method 
public function getPropertyList(propName:String):Array

Retrieves child elements of a namespace or property. If the property is a struct, these are the fields. If it is an array, these are the items.

Parameters
propName:String — A namespace or a property path. Can be:
  • null: Gets a list of all namespaces.
  • A registered prefix: Gets all top-level properties of the referenced namespace.
  • An XMP path: Gets the children of the property, if any.

Returns
Array — An Array containing the child properties, or null if the root property is a simple property.
getXMPPacket()method 
public function getXMPPacket():String

Retrieves the XMPPacket as a whole, in the current modified state.

Returns
String — The XMPPacket string.
removeProperties()method 
public function removeProperties(propName:String = null, options:int = 0):void

Removes properties of a given type in an XMP subtree rooted at a given property.

Parameters
propName:String (default = null) — The name of the root property.
 
options:int (default = 0) — Option flags describing properties to be removed. A logical OR of allowed bit-flag constants:
  • IXMPConst.DO_ALL_PROPERTIES - Also remove internal properties.
restoreProperty()method 
public function restoreProperty(propertyPath:String):void

Restores a property value. Reverts a single property to its state before modification. This is used for Multiple Files mode.

Parameters
propertyPath:String — The XPath to the property. The namespace must be registered.
separateArrayItems()method 
public function separateArrayItems(arrayPath:String, catedStr:String, arrayOptions:int = 0, allowCommas:Boolean = false):void

Converts a concatenated array-item string back into array item.

Parameters
arrayPath:String — The name of an array-type property containing simple values.
 
catedStr:String — The concatenated string of values.
 
arrayOptions:int (default = 0) — Option flags describing the array type to create; A logical OR of allowed bit-flag constants:
  • NO_OPTIONS - Creates a bag array.
  • ARRAY_ORDERED - Creates a seq array.
  • ARRAY_ALTERNATE - Creates an alt array.
  • ARRAY_ALT_TEXT - Creates an alt-text array.
 
allowCommas:Boolean (default = false) — When true, allow comma in values. When false, truncate value at first comma.
setLocalizedText()method 
public function setLocalizedText(altTextPath:String, locale:String = "x-default", itemValue:String = "", setOptions:int = 0):void

Adds or modifies a locale-specific value in an alt-text array.

Parameters
altTextPath:String — The path to the alt-text array. The namespace prefix must be registered.
 
locale:String (default = "x-default") — Optional, the locale code for the desired locale. If not specified, sets the x-default value.
 
itemValue:String (default = "") — The localized value.
 
setOptions:int (default = 0) — Not used.
setProperty()method 
public function setProperty(propertyPath:String, propValue:String, options:int = 0):void

Creates or sets a property value. This is the simplest property setter. Use it for top-level simple properties, or after composing a complex path.

Parameters
propertyPath:String — The XPath to the property. The namespace must be registered.
 
propValue:String — The new value.
 
options:int (default = 0) — Option flags describing the property type. Must match the type of a property that already exists. A logical OR of allowed bit-flag constants:
  • NO_OPTIONS - Clear all option flags.
  • URI- Property is a URI.
  • HAS_QUALIFIERS - Property has qualifiers attached to it.
  • QUALIFIER - Property is a qualifier.
  • HAS_LANGUAGE - Property is a part of an Alt-text array and has an xml:lang-attribute.
  • HAS_TYPE - Porperty has an rdf:type-attribute.