org.apache.jackrabbit.server.io
Class XMLExportCommand

java.lang.Object
  extended byorg.apache.jackrabbit.server.io.AbstractCommand
      extended byorg.apache.jackrabbit.server.io.AbstractExportCommand
          extended byorg.apache.jackrabbit.server.io.XMLExportCommand
All Implemented Interfaces:
org.apache.commons.chain.Command, org.apache.jackrabbit.JcrConstants

public class XMLExportCommand
extends AbstractExportCommand

This Class implements an export command that generates a docview or sysview of the node to be exported.


Field Summary
static String MODE_DOCVIEW
          the 'docview' mode contant
static String MODE_SYSVIEW
          the 'sysview' mode constant.
static String XML_CONTENT_TYPE
          the xml content type
 
Fields inherited from interface org.apache.jackrabbit.JcrConstants
JCR_AUTOCREATED, JCR_BASEVERSION, JCR_CHILD, JCR_CHILDNODEDEFINITION, JCR_CONTENT, JCR_CREATED, JCR_DATA, JCR_DEFAULTPRIMARYTYPE, JCR_DEFAULTVALUES, JCR_ENCODING, JCR_FROZENMIXINTYPES, JCR_FROZENNODE, JCR_FROZENPRIMARYTYPE, JCR_FROZENUUID, JCR_HASORDERABLECHILDNODES, JCR_ISCHECKEDOUT, JCR_ISMIXIN, JCR_LANGUAGE, JCR_LASTMODIFIED, JCR_LOCKISDEEP, JCR_LOCKOWNER, JCR_MANDATORY, JCR_MERGEFAILED, JCR_MIMETYPE, JCR_MIXINTYPES, JCR_MULTIPLE, JCR_NAME, JCR_NODETYPENAME, JCR_ONPARENTVERSION, JCR_PATH, JCR_PREDECESSORS, JCR_PRIMARYITEMNAME, JCR_PRIMARYTYPE, JCR_PROPERTYDEFINITION, JCR_PROTECTED, JCR_REQUIREDPRIMARYTYPES, JCR_REQUIREDTYPE, JCR_ROOTVERSION, JCR_SAMENAMESIBLINGS, JCR_SCORE, JCR_STATEMENT, JCR_SUCCESSORS, JCR_SUPERTYPES, JCR_SYSTEM, JCR_UUID, JCR_VALUECONSTRAINTS, JCR_VERSIONABLEUUID, JCR_VERSIONHISTORY, JCR_VERSIONLABELS, JCR_VERSIONSTORAGE, MIX_LOCKABLE, MIX_REFERENCEABLE, MIX_VERSIONABLE, NT_BASE, NT_CHILDNODEDEFINITION, NT_FILE, NT_FOLDER, NT_FROZENNODE, NT_HIERARCHYNODE, NT_LINKEDFILE, NT_NODETYPE, NT_PROPERTYDEFINITION, NT_QUERY, NT_RESOURCE, NT_UNSTRUCTURED, NT_VERSION, NT_VERSIONEDCHILD, NT_VERSIONHISTORY, NT_VERSIONLABELS
 
Constructor Summary
XMLExportCommand()
          Creats a XMLExportCommand
XMLExportCommand(String mode)
          Creates a XMLExportCommand with the given mode.
 
Method Summary
 boolean canHandle(Node node)
          Returns true
 boolean exportNode(ExportContext context, Node content)
          Creates a docview response for the given node.
 String getDefaultContentType()
          Returns XML_CONTENT_TYPE.
 String getMode()
          Returns the export mode.
 void setMode(String mode)
          Sets the export mode.
 
Methods inherited from class org.apache.jackrabbit.server.io.AbstractExportCommand
execute, execute
 
Methods inherited from class org.apache.jackrabbit.server.io.AbstractCommand
execute, getId, setEnabled, setId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XML_CONTENT_TYPE

public static final String XML_CONTENT_TYPE
the xml content type

See Also:
Constant Field Values

MODE_SYSVIEW

public static final String MODE_SYSVIEW
the 'sysview' mode constant.

See Also:
Constant Field Values

MODE_DOCVIEW

public static final String MODE_DOCVIEW
the 'docview' mode contant

See Also:
Constant Field Values
Constructor Detail

XMLExportCommand

public XMLExportCommand()
Creats a XMLExportCommand


XMLExportCommand

public XMLExportCommand(String mode)
Creates a XMLExportCommand with the given mode.

Parameters:
mode -
Method Detail

getMode

public String getMode()
Returns the export mode.

Returns:
the export mode.

setMode

public void setMode(String mode)
Sets the export mode. This mus be either MODE_DOCVIEW or MODE_SYSVIEW, otherwise a IllegalArgumentException is thrown.

Parameters:
mode - the export mode
Throws:
IllegalArgumentException - if the mode is not correct.

exportNode

public boolean exportNode(ExportContext context,
                          Node content)
                   throws Exception
Creates a docview response for the given node.

Specified by:
exportNode in class AbstractExportCommand
Parameters:
context - the export context
content - the node to be exported
Returns:
true
Throws:
Exception - if an error occurrs.

getDefaultContentType

public String getDefaultContentType()
Returns XML_CONTENT_TYPE.

Specified by:
getDefaultContentType in class AbstractExportCommand
Returns:
XML_CONTENT_TYPE.

canHandle

public boolean canHandle(Node node)
Returns true

Specified by:
canHandle in class AbstractExportCommand
Parameters:
node -
Returns:
true


Copyright © 2005 . All Rights Reserved.