InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
SnpInspectXMPMetaData Class Reference

Public Member Functions

ErrorCode InspectMetaData (IPMUnknown *targetObject, const PMString &namespaceToIterate="", const PMString &pathToIterate="", const IMetaDataAccess::IteratorOptions &iterOptions=IMetaDataAccess::kIterJustChildren)
 
ErrorCode InspectNode (IMetaDataAccess *metaDataAccess, const PMString &nspace, const PMString &path, PMString &value, const IMetaDataAccess::IteratorOptions &iterOptions=IMetaDataAccess::kIterJustChildren)
 
K2Vector< PMStringGetAllXMPNameSpaces (IPMUnknown *targetObject)
 
K2Vector< PMStringGetAllXMPPaths (IPMUnknown *targetObject)
 

Detailed Description

  • Inspects XMP MetaData in a document, using the InDesign/InCopy API wrappers for the XMP ToolKit.

To find out if the code in this codesnippet will satisfy your use case, refer to the set of use cases documented in SnpPerformXMPCommands.

For XMP technical specifications, refer to the MetaDataToolkit PDF at the XMP Toolkit Download page: http://partners.adobe.com/asn/developer/xmp/download/

Member Function Documentation

K2Vector< PMString > SnpInspectXMPMetaData::GetAllXMPNameSpaces (IPMUnknowntargetObject)

Gets all XMP namespaces in the target object.

Parameters
targetObjectIN A pointer to an interface on a boss class with the MetaData model (e.g. kDocBoss, kMetaDataBoss)
Returns
A list of namespaces. If empty, there was something wrong, or there was no XMP metadata in this target object.
K2Vector< PMString > SnpInspectXMPMetaData::GetAllXMPPaths (IPMUnknowntargetObject)

Gets all XMP paths in the target object.

Parameters
targetObjectIN A pointer to an interface on a boss class with the MetaData model (e.g. kDocBoss, kMetaDataBoss)
Returns
A list of paths. If empty, there was something wrong, or there was no XMP metadata in this target object.
ErrorCode SnpInspectXMPMetaData::InspectMetaData (IPMUnknowntargetObject,
const PMStringnamespaceToIterate = "",
const PMStringpathToIterate = "",
const IMetaDataAccess::IteratorOptionsiterOptions = IMetaDataAccess::kIterJustChildren 
)

Shows how to navigate MetaData using the IMetaDataAccess interface.

This uses the following interfaces:

  • IMetaDataAccess interface, which wraps MetaXAP (XMP toolkit).
  • IMetaDataPaths interface, which wraps XAPPaths (XMP toolkit).
Parameters
[in]targetObjectA pointer to an interface on a boss class with the MetaData model (e.g. kDocBoss, kMetaDataBoss)
[in]namespaceToIterate(optional) Specifies the XMP namespace to iterate. (Default: "", which means visit all nodes)
[in]pathToIterate(optional) Specifies the XMP path to iterate. (Default: "", which means visit all nodes)
[in]iterOptions(optional) Specifies the iterator options (Default: IMetaDataAccess::kIterJustChildren) This is ignored if both namespace and path are empty.
Returns
kSuccess on success, kFailure otherwise.
ErrorCode SnpInspectXMPMetaData::InspectNode (IMetaDataAccessmetaDataAccess,
const PMStringnspace,
const PMStringpath,
PMStringvalue,
const IMetaDataAccess::IteratorOptionsiterOptions = IMetaDataAccess::kIterJustChildren 
)

Inspects a specific node, identified by a namespace and path.

Parameters
[in]metaDataAccessThe IMetaDataAcceess interface to use to access metadata.
[in]nspaceThe metadata namespace to inspect.
[in]pathThe metadata path to inspect.
[out]valueThe value at the namespace and path.
[in]iterOptionsSpecifies the iterator options.
Returns
kSuccess if success, kFailure otherwise.