okapi.util
Class OkapiPackage

java.lang.Object
  extended by okapi.util.OkapiPackage

public class OkapiPackage
extends java.lang.Object

A class for importing and exporting nexuses or parts of nexuses. The export format conists of a single xml manifest file at the root of a directory containing all of the files. An OkapiPackage is created and documents added to it, and then exported as a zip file. The static addPackageToNexus() method imports these packages.

Version:
$Revision: 31392 $, $Date: 2008-11-26 16:19:50 -0500 (Wed, 26 Nov 2008) $
Author:
MIT Stellar team

Field Summary
protected  java.util.HashMap stores
           
 
Constructor Summary
OkapiPackage(OkapiNexus source)
          Create a new OkapiExport which represents the nexus source
 
Method Summary
 void add(java.lang.String path)
          Add an arc or document to the package
 void addAll()
          Add all arcs and documents to the package
 void addGroups()
          Add all the groups and their members that are associated with the nexus
 void addPackageToNexus(java.io.InputStream formatFile, OkapiNexus nexus)
          Add this package to nexus.
static void addPackageToNexus(java.lang.String pathToPackage, java.lang.String pathToFormatFile, OkapiNexus nexus)
          Add the package at pathToPackage to nexus.
 void addWithChildren(java.lang.String path)
          Add an arc to the package along with all of its arc and document children
 void export(java.io.OutputStream out, java.lang.String dirName)
          Export the package to the given OutputStream in a zipped directory called dirName
 void export(java.io.OutputStream out, java.lang.String dirName, java.io.InputStream stylesheet)
          Export the package to the given OutputStream in a zipped directory called dirName with the manifest transformed by the xslt stylylesheet that can be read from stylesheet
 void export(java.io.OutputStream out, java.lang.String dirName, java.io.InputStream stylesheet, java.io.InputStream htmlStylesheet)
          Export the package to the given OutputStream in a zipped directory called dirName with the manifest transformed by the xslt stylylesheet that can be read from stylesheet, and with an html index page generated using the htmlStylesheet
 void export(java.lang.String path)
          Export the package as a zipped file at path
 void export(java.lang.String path, java.lang.String pathToStylesheet)
          Export the package as a zipped file at path with the manifest transformed by the xslt stylesheet at pathToStylesheet
 void export(java.lang.String path, java.lang.String pathToStylesheet, java.lang.String pathToIndexHtmlStylesheet)
          Export the package as a zipped file at path with the manifest transformed by the xslt stylesheet at pathToStylesheet, with the index.html file generated by the xslt stylesheet at pathToStylesheet,
 org.jdom.Document getManifest()
          Return the manifest as a JDOM document.
 void setFixNames()
          Set the package so that file names are rewritten for CDIF
 void setSkipFiles()
          Set the package so that only the manifest will exported, for testing
 void setUser(OkapiUser user)
          Set the user for whom we're exporting
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stores

protected java.util.HashMap stores
Constructor Detail

OkapiPackage

public OkapiPackage(OkapiNexus source)
Create a new OkapiExport which represents the nexus source

Method Detail

addAll

public void addAll()
            throws okapi.util.OkapiPackageException
Add all arcs and documents to the package

Throws:
okapi.util.OkapiPackageException

add

public void add(java.lang.String path)
         throws okapi.util.OkapiPackageException
Add an arc or document to the package

Throws:
okapi.util.OkapiPackageException

addWithChildren

public void addWithChildren(java.lang.String path)
                     throws okapi.util.OkapiPackageException
Add an arc to the package along with all of its arc and document children

Throws:
okapi.util.OkapiPackageException

addGroups

public void addGroups()
Add all the groups and their members that are associated with the nexus


setSkipFiles

public void setSkipFiles()
Set the package so that only the manifest will exported, for testing


setFixNames

public void setFixNames()
Set the package so that file names are rewritten for CDIF


setUser

public void setUser(OkapiUser user)
Set the user for whom we're exporting


export

public void export(java.lang.String path)
            throws okapi.util.OkapiPackageException
Export the package as a zipped file at path

Throws:
okapi.util.OkapiPackageException

export

public void export(java.lang.String path,
                   java.lang.String pathToStylesheet)
            throws okapi.util.OkapiPackageException
Export the package as a zipped file at path with the manifest transformed by the xslt stylesheet at pathToStylesheet

Throws:
okapi.util.OkapiPackageException

export

public void export(java.lang.String path,
                   java.lang.String pathToStylesheet,
                   java.lang.String pathToIndexHtmlStylesheet)
            throws okapi.util.OkapiPackageException
Export the package as a zipped file at path with the manifest transformed by the xslt stylesheet at pathToStylesheet, with the index.html file generated by the xslt stylesheet at pathToStylesheet,

Throws:
okapi.util.OkapiPackageException

export

public void export(java.io.OutputStream out,
                   java.lang.String dirName)
            throws okapi.util.OkapiPackageException
Export the package to the given OutputStream in a zipped directory called dirName

Throws:
okapi.util.OkapiPackageException

export

public void export(java.io.OutputStream out,
                   java.lang.String dirName,
                   java.io.InputStream stylesheet)
            throws okapi.util.OkapiPackageException
Export the package to the given OutputStream in a zipped directory called dirName with the manifest transformed by the xslt stylylesheet that can be read from stylesheet

Throws:
okapi.util.OkapiPackageException

export

public void export(java.io.OutputStream out,
                   java.lang.String dirName,
                   java.io.InputStream stylesheet,
                   java.io.InputStream htmlStylesheet)
            throws okapi.util.OkapiPackageException
Export the package to the given OutputStream in a zipped directory called dirName with the manifest transformed by the xslt stylylesheet that can be read from stylesheet, and with an html index page generated using the htmlStylesheet

Throws:
okapi.util.OkapiPackageException

getManifest

public org.jdom.Document getManifest()
Return the manifest as a JDOM document. This can be used to make small changes to the manifest without going through the trouble and overhead of a stylesheet transformation.


addPackageToNexus

public void addPackageToNexus(java.io.InputStream formatFile,
                              OkapiNexus nexus)
                       throws okapi.util.OkapiPackageException
Add this package to nexus. The xml file read from formatFile gives the format of the arc hierarchy being used.

Throws:
okapi.util.OkapiPackageException

addPackageToNexus

public static void addPackageToNexus(java.lang.String pathToPackage,
                                     java.lang.String pathToFormatFile,
                                     OkapiNexus nexus)
                              throws okapi.util.OkapiPackageException
Add the package at pathToPackage to nexus. The xml file at pathToFormatFile gives the format of the arc hierarchy being used.

Throws:
okapi.util.OkapiPackageException


Copyright ? 2001-2009 MIT. All Rights Reserved.