org.apache.jackrabbit.server.io
Class DirListingExportCommand

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

public class DirListingExportCommand
extends AbstractCommand

This Class implements a collection export command that produces a HTML directory listing of all child nodes. If isCollectionNodeType(String) returns true, when passed the primary node type of a child node, the result will be a directory link.

The corresponding mapping is retrieved from the catalog. By default if no behaviour is specified, nodes are displayed as directories.


Field Summary
 
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
DirListingExportCommand()
          Creates a DirListingExportCommand
 
Method Summary
 boolean execute(AbstractContext context)
          Executes this command by delegating to execute(ExportContext) if the context has the correct class.
 boolean execute(ExportContext context)
          Executes this command.
 boolean isCollectionNodeType(String nodeTypeName)
          Returns true if the given the node type name denotes a collection.
 void setCollectionNodeTypes(String nodeTypeNames)
          Defines the given node type names to represent collection nodes.
 void setNonCollectionNodeTypes(String nodeTypeNames)
          Defines the given node type names to represent non-collection nodes.
 
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
 

Constructor Detail

DirListingExportCommand

public DirListingExportCommand()
Creates a DirListingExportCommand

Method Detail

isCollectionNodeType

public boolean isCollectionNodeType(String nodeTypeName)
Returns true if the given the node type name denotes a collection.

Returns:
true if the given the node type name denotes a collection node.

setCollectionNodeTypes

public void setCollectionNodeTypes(String nodeTypeNames)
Defines the given node type names to represent collection nodes. Child nodes having this node type result in a directory link.

Parameters:
nodeTypeNames - comma separated String value

setNonCollectionNodeTypes

public void setNonCollectionNodeTypes(String nodeTypeNames)
Defines the given node type names to represent non-collection nodes. Child nodes having this node type will never result in a directory link.

Parameters:
nodeTypeNames - comma separated String value

execute

public boolean execute(AbstractContext context)
                throws Exception
Executes this command by delegating to execute(ExportContext) if the context has the correct class.

Specified by:
execute in class AbstractCommand
Parameters:
context - the (import) context.
Returns:
false.
Throws:
Exception - if an error occurrs.

execute

public boolean execute(ExportContext context)
                throws Exception
Executes this command. It generates a HTML directory listing of all child nodes of the collection node.

Parameters:
context - the export context
Returns:
true
Throws:
Exception - in an error occurrs


Copyright © 2005 . All Rights Reserved.