KickJava   Java API By Example, From Geeks To Geeks.

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


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: DocumentBuilder.java 42598 2004-03-01 16:18:28Z gregor $ */
19
20 package org.apache.lenya.cms.publication;
21
22
23 /**
24  * A document builder builds a document from a URL.
25  */

26 public interface DocumentBuilder {
27
28     /**
29      * Builds a document.
30      *
31      * @param publication The publication the document belongs to.
32      * @param url The URL of the form /{publication-id}/{area}/{document-id}{language-suffix}.{extension}.
33      * @return A document.
34      * @throws DocumentBuildException when something went wrong.
35      */

36     Document buildDocument(Publication publication, String JavaDoc url)
37         throws DocumentBuildException;
38     
39     /**
40      * Checks if an URL corresponds to a CMS document.
41      *
42      * @param publication The publication the document belongs to.
43      * @param url The URL of the form /{publication-id}/...
44      * @return A boolean value.
45      * @throws DocumentBuildException when something went wrong.
46      */

47     boolean isDocument(Publication publication, String JavaDoc url)
48         throws DocumentBuildException;
49         
50     /**
51      * Builds an URL corresponding to a cms document from the publication,
52      * the area, the document id and the language
53      *
54      * @param publication The publication the document belongs to.
55      * @param area The area the document belongs to.
56      * @param documentid The document id of the document.
57      * @param language The language of the document.
58      * @return a String The builded url
59      */

60     String JavaDoc buildCanonicalUrl(
61         Publication publication,
62         String JavaDoc area,
63         String JavaDoc documentid,
64         String JavaDoc language);
65
66     /**
67      * Builds an URL corresponding to a cms document from the publication,
68      * the area and the document id
69      *
70      * @param publication The publication the document belongs to.
71      * @param area The area the document belongs to.
72      * @param documentid The document id of the document.
73      * @return a String The builded url
74      */

75     String JavaDoc buildCanonicalUrl(
76         Publication publication,
77         String JavaDoc area,
78         String JavaDoc documentid);
79     
80     /**
81      * Builds a clone of a document for another language.
82      * @param document The document to clone.
83      * @param language The language of the target document.
84      * @return A document.
85      */

86     Document buildLanguageVersion(Document document, String JavaDoc language);
87 }
88
Popular Tags