com.adobe.idml.samples
Class ReplaceStory

java.lang.Object
  extended by com.adobe.idml.samples.ReplaceStory

public class ReplaceStory
extends java.lang.Object

ReplaceStory can be used to extract and replace stories from IDML package files.


Constructor Summary
ReplaceStory(java.lang.String idmlFile)
          A ReplaceStory object is constructed with a path to an IDML file.
 
Method Summary
 void extract(java.lang.String storyID, java.lang.String outFile)
          Extracts a single story file.
 void extractAll(java.lang.String outDir)
          Extracts all the stories in an IDML file.
static void main(java.lang.String[] args)
          Program that allows you to replace stories from the command line.
 void release()
          A temporary directory is maintained on disk until this function is called signaling that we are done with these resources.
 void replace(java.lang.String storyID, java.lang.String inFile)
          Replaces a story in the working directory.
 void writeTempFiles(java.lang.String output)
          Writes the temporary working directory to an IDML package or to another working directory (if a directory is specified).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReplaceStory

public ReplaceStory(java.lang.String idmlFile)
             throws java.io.IOException
A ReplaceStory object is constructed with a path to an IDML file. The IDML file is expanded to a temporary directory on construction.

Parameters:
idmlFile - The path to the IDMLFile.
Throws:
java.io.IOException
Method Detail

release

public void release()
A temporary directory is maintained on disk until this function is called signaling that we are done with these resources.


extract

public void extract(java.lang.String storyID,
                    java.lang.String outFile)
             throws java.io.IOException,
                    java.lang.Exception
Extracts a single story file.

Parameters:
storyID - The ID of the file to be extracted.
outFile - The path to the new file.
Throws:
java.io.IOException
java.lang.Exception

extractAll

public void extractAll(java.lang.String outDir)
                throws java.lang.Exception
Extracts all the stories in an IDML file.

Parameters:
outDir - The path to the directory where the files should be saved. If the directory does not exist it is created.
Throws:
java.lang.Exception

replace

public void replace(java.lang.String storyID,
                    java.lang.String inFile)
             throws java.lang.Exception
Replaces a story in the working directory. This replace assumes all resources, such as styles and swatches are available in the destination document. The file name and Self ID of the source story is changed to what the old file was.

Parameters:
storyID - The Self ID of the story to replace.
inFile - The IDML file or expanded IDML directory.
Throws:
java.lang.Exception

writeTempFiles

public void writeTempFiles(java.lang.String output)
                    throws java.lang.Exception
Writes the temporary working directory to an IDML package or to another working directory (if a directory is specified).

Parameters:
output - The path to the new IDML file or directory.
Throws:
java.lang.Exception

main

public static void main(java.lang.String[] args)
Program that allows you to replace stories from the command line.

Parameters:
args -


Copyright © 2008 Adobe Systems Incorporated. All Rights Reserved.