|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.adobe.idml.samples.ReplaceImages
public class ReplaceImages
This class contains tools that can be used to replace images in an IDML Package. These tools can be used to replace either linked or embedded images. However, all image replacements will be linked. This tool cannot replace an image with an embedded image.
| Constructor Summary | |
|---|---|
ReplaceImages(java.lang.String xslDirPath,
java.lang.String idmlSourcePath)
This constructor requires an XSL directory to locate the transforms and an IDML Package containing the images to be replaced. |
|
| Method Summary | |
|---|---|
void |
cleanup()
Removes the temporary directory used for IDML Package extraction. |
void |
exportList(java.lang.String outputFilePath)
Writes a the image ID's and paths to an XML File. |
java.util.Hashtable<java.lang.String,java.lang.String> |
getLinksFromPackage()
Gets a the image ID's and links from the source IDML Package in a Hashtable. |
void |
importList(java.lang.String importXmlPath,
java.lang.String idmlOutputPath)
Imports an XML file with image ID's mapped to links and applies the changes to a copy of the source IDML Package. |
static void |
main(java.lang.String[] args)
The main method used to initialize the ReplaceImages class. |
void |
setSourcePackage(java.lang.String idmlSourcePath)
Set the IDML Package in which to replace images. |
void |
updatePackage(java.util.Hashtable<java.lang.String,java.lang.String> links,
java.lang.String idmlOutputPath)
Makes a copy of the source IDML Package and updates the links with the values found in the links Hashtable. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ReplaceImages(java.lang.String xslDirPath,
java.lang.String idmlSourcePath)
throws java.io.IOException
xslDirPath - The path to the XSL directory containing the XSL files used to transform Package XML files.idmlSourcePath - The path to the IDML Package file containing images to be replaced.
java.io.IOException| Method Detail |
|---|
public void setSourcePackage(java.lang.String idmlSourcePath)
throws java.io.IOException
idmlSourcePath - The path to the IDML Package.
java.io.IOException
public void exportList(java.lang.String outputFilePath)
throws java.io.IOException,
javax.xml.xpath.XPathExpressionException,
PackageException,
javax.xml.parsers.ParserConfigurationException
outputFilePath - The XML file where the image ID's and paths will be written to.
java.io.IOException
javax.xml.xpath.XPathExpressionException
PackageException
javax.xml.parsers.ParserConfigurationException
public void importList(java.lang.String importXmlPath,
java.lang.String idmlOutputPath)
throws javax.xml.xpath.XPathExpressionException,
PackageException,
java.io.IOException,
javax.xml.transform.TransformerFactoryConfigurationError,
javax.xml.transform.TransformerException
importXmlPath - The path to the XML file to be imported.idmlOutputPath - The path to the IDML file which will be created after applying the changes to the source IDML package.
javax.xml.xpath.XPathExpressionException
PackageException
java.io.IOException
javax.xml.transform.TransformerFactoryConfigurationError
javax.xml.transform.TransformerExceptionpublic void cleanup()
public java.util.Hashtable<java.lang.String,java.lang.String> getLinksFromPackage()
throws java.io.IOException,
javax.xml.xpath.XPathExpressionException,
PackageException
java.io.IOException
javax.xml.xpath.XPathExpressionException
PackageException
public void updatePackage(java.util.Hashtable<java.lang.String,java.lang.String> links,
java.lang.String idmlOutputPath)
throws java.io.IOException,
javax.xml.transform.TransformerFactoryConfigurationError,
javax.xml.transform.TransformerException
links - A Hashtable with link ID/Path Key/Value pairs.idmlOutputPath - The IDML Package file that will be created by copying the links file paths to the source IDML package.
java.io.IOException
javax.xml.transform.TransformerFactoryConfigurationError
javax.xml.transform.TransformerExceptionpublic static void main(java.lang.String[] args)
args - parameters provided by the console application.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||