KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > lenya > cms > authoring > ParentChildCreatorInterface


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */

17
18 /* $Id: ParentChildCreatorInterface.java 42616 2004-03-03 12:56:33Z gregor $ */
19
20 package org.apache.lenya.cms.authoring;
21
22 import java.io.File JavaDoc;
23 import java.util.Map JavaDoc;
24
25 import org.apache.avalon.framework.configuration.Configuration;
26
27 public interface ParentChildCreatorInterface {
28     /**
29      * Constant for a branch node. Branch nodes are somewhat related
30      * to the concept of collections in WebDAV. They are not the same
31      * however.
32      *
33      */

34     short BRANCH_NODE = 1;
35
36     /**
37      * Constant for a leaf node. Leaf nodes are somewhat related to
38      * the concept of resources in WebDAV. They are not the same
39      * however.
40      *
41      */

42     short LEAF_NODE = 0;
43
44     /**
45      * Configures the Creator, based on a configuration file.
46      *
47      * @param doctypeConf A configuration.
48      */

49     void init(Configuration doctypeConf);
50
51     /**
52      * Return the type of node this creator will create. It can be
53      * either <code>BRANCH_NODE</code> or <code>LEAF_NODE</code>. An
54      * implementation can simply return the input parameter (which can
55      * be used to pass in a request parameter) or choose to ignore it.
56      *
57      * @param childType a <code>short</code> value
58      * @return a <code>short</code> value (either <code>BRANCH_NODE</code> or <code>LEAF_NODE</code>)
59      * @exception Exception if an error occurs
60      */

61     short getChildType(short childType) throws Exception JavaDoc;
62
63     /**
64      * Describe <code>getChildName</code> method here.
65      *
66      * @param childname a <code>String</code> value
67      * @return a <code>String</code> value
68      * @exception Exception if an error occurs
69      */

70     String JavaDoc getChildName(String JavaDoc childname) throws Exception JavaDoc;
71
72     /**
73      * Describe <code>generateTreeId</code> method here.
74      *
75      * @param childId a <code>String</code> value
76      * @param childType a <code>short</code> value
77      * @return a <code>String</code> value
78      * @exception Exception if an error occurs
79      */

80     String JavaDoc generateTreeId(String JavaDoc childId, short childType) throws Exception JavaDoc;
81
82     /**
83      * Create a new document.
84      *
85      * @param samplesDir the directory where the template file is located.
86      * @param parentDir in which directory the document is to be created.
87      * @param childId the document id of the new document
88      * @param childType the type of the new document.
89      * @param childName the name of the new document.
90      * @param language for which the document is created.
91      * @param parameters additional parameters that can be used when creating the child
92      *
93      * @exception Exception if an error occurs
94      */

95     void create(
96         File JavaDoc samplesDir,
97         File JavaDoc parentDir,
98         String JavaDoc childId,
99         short childType,
100         String JavaDoc childName,
101         String JavaDoc language,
102         Map JavaDoc parameters)
103         throws Exception JavaDoc;
104 }
105
Popular Tags