com.adobe.idml
Class PackageInspector

java.lang.Object
  extended by com.adobe.idml.PackageInspector

public class PackageInspector
extends java.lang.Object

PackageInspector contains a set of methods for inspecting package content. It demonstrates how to use XmlUtils and PackageXmlLocator to extract data from the package.


Constructor Summary
PackageInspector(java.io.File expandedIDMLDir)
          Instantiates a new PackageInspector object for the directory of XML files provided.
PackageInspector(java.lang.String expandedIDMLPath)
          Instantiates a new PackageInspector object for the directory path to the XML files provided.
 
Method Summary
static void dumpInfo(java.lang.String idmlFile)
          Uses PackageInspector to dump various bits of content to STDOUT.
 java.util.Hashtable<java.lang.String,java.lang.String> GetCharacterStyleIDNamePairs()
          Get a Hashtable containing all CharacterStyle Self ID/Name pairs.
 java.util.Hashtable<java.lang.String,java.lang.String> GetLayerIDNamePairs()
          Get Hashtable of all layer Self ID and Name pairs.
 java.util.ArrayList<java.lang.String> GetLayerIDs()
          Get the Self attributes for all layers in the package.
 java.util.Hashtable<java.lang.String,java.lang.String> GetLinkIDURIPairs()
          Get a Hashtable of all Link ID/LinkResourceURI pairs in the package.
 java.util.Hashtable<java.lang.String,java.lang.String> GetMasterSpreadIDNamePairs()
          Get a Hashtable of all master spread Self ID/Name pairs.
 java.util.ArrayList<java.lang.String> GetMasterSpreadIDs()
          Get the Self attributes for all master spreads in the package.
 java.util.Hashtable<java.lang.String,java.lang.String> GetObjectStyleIDNamePairs()
          Get a Hashtable of all object style Self ID/Name pairs.
 int GetPageCount()
          Get the number of pages.
 double GetPageHeight()
          Get the page height in points as a double.
 double GetPageWidth()
          Get the page width in points as a double.
 java.util.Hashtable<java.lang.String,java.lang.String> GetParagraphStyleIDNamePairs()
          Get a Hashtable containing all ParagraphStyle Self ID/Name pairs.
 int GetSpreadCount()
          Gets the number of spreads.
 java.util.ArrayList<java.lang.String> GetStoryIDs()
          Get the "Self" attribute for all stories in the package.
 java.util.Hashtable<java.lang.String,java.lang.String> GetStoryIDsAndContent()
          Get Story Self ID/ Text Content pairs for each story in the package.
static void main(java.lang.String[] args)
          Driver method for obtain information from a package.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PackageInspector

public PackageInspector(java.io.File expandedIDMLDir)
Instantiates a new PackageInspector object for the directory of XML files provided.

Parameters:
expandedIDMLDir - A directory containing an expanded IDML package.

PackageInspector

public PackageInspector(java.lang.String expandedIDMLPath)
Instantiates a new PackageInspector object for the directory path to the XML files provided.

Parameters:
expandedIDMLPath - A path to a directory containing an expanded IDML package.
Method Detail

GetPageHeight

public double GetPageHeight()
                     throws PackageException,
                            java.io.IOException,
                            javax.xml.xpath.XPathExpressionException
Get the page height in points as a double.

Returns:
The Page Height in points.
Throws:
java.io.IOException
PackageException
javax.xml.xpath.XPathExpressionException

GetPageWidth

public double GetPageWidth()
                    throws PackageException,
                           java.io.IOException,
                           javax.xml.xpath.XPathExpressionException
Get the page width in points as a double.

Returns:
The page width in points.
Throws:
java.io.IOException
PackageException
javax.xml.xpath.XPathExpressionException

GetPageCount

public int GetPageCount()
                 throws PackageException,
                        java.io.IOException,
                        javax.xml.xpath.XPathExpressionException
Get the number of pages.

Returns:
The number of pages in the document
Throws:
java.io.IOException
PackageException
javax.xml.xpath.XPathExpressionException

GetSpreadCount

public int GetSpreadCount()
                   throws PackageException,
                          java.io.IOException,
                          javax.xml.xpath.XPathExpressionException
Gets the number of spreads.

Returns:
The number of spreads in a document
Throws:
java.io.IOException
PackageException
javax.xml.xpath.XPathExpressionException

GetStoryIDs

public java.util.ArrayList<java.lang.String> GetStoryIDs()
                                                  throws PackageException,
                                                         java.io.IOException,
                                                         javax.xml.xpath.XPathExpressionException
Get the "Self" attribute for all stories in the package.

Returns:
ArrayList of Self IDs
Throws:
java.io.IOException
PackageException
javax.xml.xpath.XPathExpressionException

GetMasterSpreadIDs

public java.util.ArrayList<java.lang.String> GetMasterSpreadIDs()
                                                         throws PackageException,
                                                                java.io.IOException,
                                                                javax.xml.xpath.XPathExpressionException
Get the Self attributes for all master spreads in the package.

Returns:
ArrayList of all Self IDs
Throws:
java.io.IOException
PackageException
javax.xml.xpath.XPathExpressionException

GetLayerIDs

public java.util.ArrayList<java.lang.String> GetLayerIDs()
                                                  throws PackageException,
                                                         java.io.IOException,
                                                         javax.xml.xpath.XPathExpressionException
Get the Self attributes for all layers in the package.

Returns:
ArrayList of all Self IDs
Throws:
java.io.IOException
PackageException
javax.xml.xpath.XPathExpressionException

GetParagraphStyleIDNamePairs

public java.util.Hashtable<java.lang.String,java.lang.String> GetParagraphStyleIDNamePairs()
                                                                                    throws PackageException,
                                                                                           java.io.IOException,
                                                                                           javax.xml.xpath.XPathExpressionException
Get a Hashtable containing all ParagraphStyle Self ID/Name pairs.

Returns:
A Hashtable containing all ParagraphStyle Self ID/Name pairs.
Throws:
java.io.IOException
PackageException
javax.xml.xpath.XPathExpressionException

GetCharacterStyleIDNamePairs

public java.util.Hashtable<java.lang.String,java.lang.String> GetCharacterStyleIDNamePairs()
                                                                                    throws PackageException,
                                                                                           java.io.IOException,
                                                                                           javax.xml.xpath.XPathExpressionException
Get a Hashtable containing all CharacterStyle Self ID/Name pairs.

Returns:
A Hashtable containing all CharacterStyle Self ID/Name pairs.
Throws:
java.io.IOException
PackageException
javax.xml.xpath.XPathExpressionException

GetObjectStyleIDNamePairs

public java.util.Hashtable<java.lang.String,java.lang.String> GetObjectStyleIDNamePairs()
                                                                                 throws PackageException,
                                                                                        java.io.IOException,
                                                                                        javax.xml.xpath.XPathExpressionException
Get a Hashtable of all object style Self ID/Name pairs.

Returns:
A Hashtable containing all Self ID/Name pairs.
Throws:
java.io.IOException
PackageException
javax.xml.xpath.XPathExpressionException

GetLayerIDNamePairs

public java.util.Hashtable<java.lang.String,java.lang.String> GetLayerIDNamePairs()
                                                                           throws java.lang.Exception
Get Hashtable of all layer Self ID and Name pairs.

Returns:
A Hashtable containing all layer Self ID/Name pairs.
Throws:
java.lang.Exception

GetMasterSpreadIDNamePairs

public java.util.Hashtable<java.lang.String,java.lang.String> GetMasterSpreadIDNamePairs()
                                                                                  throws PackageException,
                                                                                         java.io.IOException,
                                                                                         javax.xml.xpath.XPathExpressionException
Get a Hashtable of all master spread Self ID/Name pairs.

Returns:
A Hashtable containing all master spread Self ID/Name pairs.
Throws:
java.io.IOException
PackageException
javax.xml.xpath.XPathExpressionException

GetLinkIDURIPairs

public java.util.Hashtable<java.lang.String,java.lang.String> GetLinkIDURIPairs()
                                                                         throws PackageException,
                                                                                java.io.IOException,
                                                                                javax.xml.xpath.XPathExpressionException
Get a Hashtable of all Link ID/LinkResourceURI pairs in the package.

Returns:
Hashtable of all Link Self ID and LinkResourceURI pairs
Throws:
java.io.IOException
PackageException
javax.xml.xpath.XPathExpressionException

GetStoryIDsAndContent

public java.util.Hashtable<java.lang.String,java.lang.String> GetStoryIDsAndContent()
                                                                             throws java.lang.Exception
Get Story Self ID/ Text Content pairs for each story in the package.

Returns:
A Hashtable mapping story Self IDs to plain text content
Throws:
java.lang.Exception

dumpInfo

public static void dumpInfo(java.lang.String idmlFile)
                     throws java.lang.Exception
Uses PackageInspector to dump various bits of content to STDOUT.

Parameters:
idmlFile - Path to an IDML file or directory containing expanded IDML file.
Throws:
java.lang.Exception

main

public static void main(java.lang.String[] args)
Driver method for obtain information from a package. Run with "-h" option for usage.

Parameters:
args -


Copyright © 2008 Adobe Systems Incorporated. All Rights Reserved.