KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > lenya > cms > publication > DocumentIdToPathMapper


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: DocumentIdToPathMapper.java 42598 2004-03-01 16:18:28Z gregor $ */
19
20 package org.apache.lenya.cms.publication;
21
22 import java.io.File JavaDoc;
23
24 public interface DocumentIdToPathMapper {
25     
26     /**
27      * Compute the document-path for a given publication, area
28      * and document-id. The file separator is the slash (/).
29      *
30      * @param documentId the document-id of the document
31      * @param language the language of the document
32      *
33      * @return the path to the document, without publication ID and area
34      */

35     String JavaDoc getPath(String JavaDoc documentId, String JavaDoc language);
36
37     /**
38      * Compute the document-path for a given publication, area,
39      * document-id and language
40      *
41      * @param publication the publication of the document
42      * @param area the area of the document
43      * @param documentId the document-id of the document
44      * @param language the language of the document
45      *
46      * @return the path to the document
47      */

48     File JavaDoc getFile(Publication publication, String JavaDoc area, String JavaDoc documentId,
49         String JavaDoc language);
50
51     /**
52      * Compute the document-path for a given publication, area and
53      * document-id. As there are possibly multiple files for the same
54      * document-id (for different languages) the return value is a directory.
55      *
56      * @param publication The publication.
57      * @param area The area.
58      * @param documentId The document id.
59      *
60      * @return The directory where all the files with the same
61      * document-id are located
62      */

63     File JavaDoc getDirectory(Publication publication, String JavaDoc area, String JavaDoc documentId);
64 }
65
Popular Tags