org.apache.lenya.cms.authoring
Interface ParentChildCreatorInterface

All Known Implementing Classes:
DefaultBranchCreator, DefaultCreator, DefaultLeafCreator, NewBlogEntryCreator

public interface ParentChildCreatorInterface


Field Summary
static short BRANCH_NODE
          Constant for a branch node.
static short LEAF_NODE
          Constant for a leaf node.
 
Method Summary
 void create(Publication publication, java.io.File samplesDir, java.io.File parentDir, java.lang.String parentId, java.lang.String childId, short childType, java.lang.String childName, java.lang.String language, java.util.Map parameters)
          Create a new document.
 java.lang.String generateTreeId(java.lang.String childId, short childType)
          Describe generateTreeId method here.
 java.lang.String getChildName(java.lang.String childname)
          Describe getChildName method here.
 short getChildType(short childType)
          Return the type of node this creator will create.
 void init(org.apache.avalon.framework.configuration.Configuration doctypeConf)
          Configures the Creator, based on a configuration file.
 

Field Detail

BRANCH_NODE

static final short BRANCH_NODE
Constant for a branch node. Branch nodes are somewhat related to the concept of collections in WebDAV. They are not the same however.

See Also:
Constant Field Values

LEAF_NODE

static final short LEAF_NODE
Constant for a leaf node. Leaf nodes are somewhat related to the concept of resources in WebDAV. They are not the same however.

See Also:
Constant Field Values
Method Detail

init

void init(org.apache.avalon.framework.configuration.Configuration doctypeConf)
Configures the Creator, based on a configuration file.

Parameters:
doctypeConf - A configuration.

getChildType

short getChildType(short childType)
                   throws java.lang.Exception
Return the type of node this creator will create. It can be either BRANCH_NODE or LEAF_NODE. An implementation can simply return the input parameter (which can be used to pass in a request parameter) or choose to ignore it.

Parameters:
childType - a short value
Returns:
a short value (either BRANCH_NODE or LEAF_NODE)
Throws:
java.lang.Exception - if an error occurs

getChildName

java.lang.String getChildName(java.lang.String childname)
                              throws java.lang.Exception
Describe getChildName method here.

Parameters:
childname - a String value
Returns:
a String value
Throws:
java.lang.Exception - if an error occurs

generateTreeId

java.lang.String generateTreeId(java.lang.String childId,
                                short childType)
                                throws java.lang.Exception
Describe generateTreeId method here.

Parameters:
childId - a String value
childType - a short value
Returns:
a String value
Throws:
java.lang.Exception - if an error occurs

create

void create(Publication publication,
            java.io.File samplesDir,
            java.io.File parentDir,
            java.lang.String parentId,
            java.lang.String childId,
            short childType,
            java.lang.String childName,
            java.lang.String language,
            java.util.Map parameters)
            throws java.lang.Exception
Create a new document.

Parameters:
publication - the publication context.
samplesDir - the directory where the template file is located.
parentDir - in which directory the document is to be created.
parentId - the parent id of the new document
childId - the document id of the new document
childType - the type of the new document.
childName - the name of the new document.
language - for which the document is created.
parameters - additional parameters that can be used when creating the child
Throws:
java.lang.Exception - if an error occurs


Copyright © 1999-2005 Apache Software Foundation. All Rights Reserved.