KickJava   Java API By Example, From Geeks To Geeks.

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


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: DefaultLeafCreator.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
24 public class DefaultLeafCreator extends DefaultCreator {
25     /**
26      * Return the child type.
27      *
28      * @param childType a <code>short</code> value
29      *
30      * @return a <code>short</code> value
31      *
32      * @exception Exception if an error occurs
33      */

34     public short getChildType(short childType) throws Exception JavaDoc {
35         return LEAF_NODE;
36     }
37
38     /** (non-Javadoc)
39      * @see org.apache.lenya.cms.authoring.DefaultCreator#getChildFileName(java.io.File, java.lang.String)
40      */

41     protected String JavaDoc getChildFileName(
42         File JavaDoc parentDir,
43         String JavaDoc childId,
44         String JavaDoc language) {
45         return parentDir + File.separator + childId + getLanguageSuffix(language) + ".xml";
46     }
47
48     /** (non-Javadoc)
49      * @see org.apache.lenya.cms.authoring.DefaultCreator#getChildMetaFileName(java.io.File, java.lang.String)
50      */

51     protected String JavaDoc getChildMetaFileName(
52         File JavaDoc parentDir,
53         String JavaDoc childId,
54         String JavaDoc language) {
55         return parentDir
56             + File.separator
57             + childId
58             + "-meta"
59             + getLanguageSuffix(language)
60             + ".xml";
61     }
62 }
63
Popular Tags