KickJava   Java API By Example, From Geeks To Geeks.

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


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: Publication.java 160148 2005-04-05 09:40:13Z michi $ */
19
20 package org.apache.lenya.cms.publication;
21
22 import java.io.File JavaDoc;
23
24 import org.apache.lenya.cms.publishing.PublishingEnvironment;
25
26 /**
27  * A Lenya publication.
28  */

29 public interface Publication {
30
31     String JavaDoc AUTHORING_AREA = "authoring";
32     String JavaDoc STAGING_AREA = "staging";
33     String JavaDoc LIVE_AREA = "live";
34     String JavaDoc ADMIN_AREA = "admin";
35     String JavaDoc ARCHIVE_AREA = "archive";
36     String JavaDoc TRASH_AREA = "trash";
37     String JavaDoc ELEMENT_PATH_MAPPER = "path-mapper";
38     String JavaDoc ELEMENT_DOCUMENT_BUILDER = "document-builder";
39     String JavaDoc ELEMENT_SITE_STRUCTURE = "site-structure";
40     String JavaDoc ATTRIBUTE_TYPE = "type";
41     String JavaDoc LANGUAGES = "languages";
42     String JavaDoc LANGUAGE = "language";
43     String JavaDoc DEFAULT_LANGUAGE_ATTR = "default";
44     String JavaDoc BREADCRUMB_PREFIX = "breadcrumb-prefix";
45     String JavaDoc SSL_PREFIX = "ssl-prefix";
46     String JavaDoc LIVE_MOUNT_POINT = "live-mount-point";
47     String JavaDoc PUBLICATION_PREFIX = "lenya" + File.separator + "pubs";
48     String JavaDoc PUBLICATION_PREFIX_URI = "lenya/pubs";
49     String JavaDoc CONFIGURATION_PATH = "config";
50     String JavaDoc CONTENT_PATH = "content";
51     String JavaDoc PENDING_PATH = "pending";
52     String JavaDoc DELETE_PATH = "delete";
53     String JavaDoc INFO_AREA_PREFIX = "info-";
54     String JavaDoc SEARCH_AREA_PREFIX = "search-";
55     String JavaDoc CONFIGURATION_FILE = CONFIGURATION_PATH + File.separator + "publication.xconf";
56
57     /**
58      * Returns the publication ID.
59      * @return A string value.
60      */

61     String JavaDoc getId();
62
63     /**
64      * Returns the publishing environment of this publication.
65      * @return A {@link PublishingEnvironment} object.
66      * @deprecated It is planned to decouple the environments from the publication.
67      */

68     PublishingEnvironment getEnvironment();
69
70     /**
71      * Returns the servlet context this publication belongs to
72      * (usually, the <code>webapps/lenya</code> directory).
73      * @return A <code>File</code> object.
74      */

75     File JavaDoc getServletContext();
76
77     /**
78      * Returns the publication directory.
79      * @return A <code>File</code> object.
80      */

81     File JavaDoc getDirectory();
82
83     /**
84      * Return the directory of a specific area.
85      *
86      * @param area a <code>File</code> representing the root of the area content directory.
87      *
88      * @return the directory of the given content area.
89      */

90     File JavaDoc getContentDirectory(String JavaDoc area);
91
92     /**
93      * DOCUMENT ME!
94      *
95      * @param mapper DOCUMENT ME!
96      */

97     void setPathMapper(DefaultDocumentIdToPathMapper mapper);
98
99     /**
100      * Returns the path mapper.
101      *
102      * @return a <code>DocumentIdToPathMapper</code>
103      */

104     DocumentIdToPathMapper getPathMapper();
105
106     /**
107      * Get the default language
108      *
109      * @return the default language
110      */

111     String JavaDoc getDefaultLanguage();
112
113     /**
114      * Set the default language
115      *
116      * @param language the default language
117      */

118     void setDefaultLanguage(String JavaDoc language);
119
120     /**
121      * Get all available languages for this publication
122      *
123      * @return an <code>Array</code> of languages
124      */

125     String JavaDoc[] getLanguages();
126
127     /**
128      * Get the breadcrumb prefix. It can be used as a prefix if a publication is part of a larger site
129      *
130      * @return the breadcrumb prefix
131      */

132     String JavaDoc getBreadcrumbPrefix();
133
134     /**
135      * Get the SSL prefix. If you want to serve SSL-protected pages through a special site, use this
136      * prefix. This can come in handy if you have multiple sites that need SSL protection and you want
137      * to share one SSL certificate.
138      *
139      * @return the SSL prefix
140      */

141     String JavaDoc getSSLPrefix();
142
143     /**
144      * Get the Live mount point. The live mount point is used to rewrite links that are of the form
145      * /contextprefix/publication/area/documentid to /livemountpoint/documentid
146      *
147      * This is useful if you serve your live area through mod_proxy. to enable this functionality, set
148      * the Live mount point to / or something else. An empty mount point disables the feature.
149      *
150      * @return the Live mount point
151      */

152     String JavaDoc getLiveMountPoint();
153
154     /**
155      * Get the sitetree for a specific area of this publication.
156      * Sitetrees are created on demand and are cached.
157      *
158      * @param area the area
159      * @return the sitetree for the specified area
160      *
161      * @throws SiteTreeException if an error occurs
162      */

163     SiteTree getTree(String JavaDoc area) throws SiteTreeException;
164
165     /**
166      * Get the sitetree for a specific area of this publication.
167      * Sitetrees are created on demand and are cached.
168      *
169      * @deprecated Please use getTree() because this method returns the interface and not a specific implementation
170      * @see getTree()
171      *
172      * @param area the area
173      * @return the sitetree for the specified area
174      *
175      * @throws SiteTreeException if an error occurs
176      */

177     DefaultSiteTree getSiteTree(String JavaDoc area) throws SiteTreeException;
178
179     /**
180      * Returns the document builder of this instance.
181      * @return A document builder.
182      */

183     DocumentBuilder getDocumentBuilder();
184
185     /**
186      * Copies a document from one location to another location.
187      * @param sourceDocument The document to copy.
188      * @param destinationDocument The destination document.
189      * @throws PublicationException if a document which destinationDocument depends on
190      * does not exist.
191      */

192     void copyDocument(Document sourceDocument, Document destinationDocument)
193         throws PublicationException;
194
195     /**
196      * Copies a document to another area.
197      * @param sourceDocument The document to copy.
198      * @param destinationArea The destination area.
199      * @throws PublicationException if a document which the
200      * destination document depends on does not exist.
201      */

202     void copyDocumentToArea(Document sourceDocument, String JavaDoc destinationArea)
203         throws PublicationException;
204
205     /**
206      * Copies a document set to another area.
207      * @param documentSet The document set to copy.
208      * @param destinationArea The destination area.
209      * @throws PublicationException if a document which one of the
210      * destination documents depends on does not exist.
211      */

212     void copyDocumentSetToArea(DocumentSet documentSet, String JavaDoc destinationArea)
213         throws PublicationException;
214         
215     /**
216      * Deletes a document.
217      * @param document The document to delete.
218      * @throws PublicationException when something went wrong.
219      */

220     void deleteDocument(Document document) throws PublicationException;
221     
222     /**
223      * Moves a document from one location to another.
224      * @param sourceDocument The source document.
225      * @param destinationDocument The destination document.
226      * @throws PublicationException if a document which the
227      * destination document depends on does not exist.
228      */

229     void moveDocument(Document sourceDocument, Document destinationDocument) throws PublicationException;
230
231     /**
232      * Creates a version of the document object in another area.
233      * @param document The document to clone.
234      * @param area The destination area.
235      * @return A document.
236      * @throws PublicationException when an error occurs.
237      */

238     Document getAreaVersion(Document document, String JavaDoc area) throws PublicationException;
239
240     /**
241      * Returns the proxy which is used for a particular document.
242      * @param document The document.
243      * @param isSslProtected A boolean value.
244      * @return A proxy or <code>null</code> if no proxy is defined
245      * for this version.
246      */

247     Proxy getProxy(Document document, boolean isSslProtected);
248     
249     /**
250      * Returns an array of XPaths representing attributes to be rewritten
251      * when a document URL has changed.
252      * @return An array of strings.
253      */

254     String JavaDoc[] getRewriteAttributeXPaths();
255     
256 }
257
Popular Tags