001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: *
017: */
018:
019: /* $Id: Publication.java 547660 2007-06-15 12:43:47Z andreas $ */
020:
021: package org.apache.lenya.cms.publication;
022:
023: import java.io.File;
024:
025: import org.apache.lenya.cms.repository.RepositoryItem;
026:
027: /**
028: * A Lenya publication.
029: */
030: public interface Publication extends RepositoryItem {
031:
032: /**
033: * <code>AUTHORING_AREA</code> The authoring area
034: */
035: String AUTHORING_AREA = "authoring";
036: /**
037: * <code>DAV_AREA</code> The webDAV authoring area
038: */
039: String DAV_AREA = "webdav";
040: /**
041: * <code>STAGING_AREA</code> The staging area
042: */
043: String STAGING_AREA = "staging";
044: /**
045: * <code>LIVE_AREA</code> The live area
046: */
047: String LIVE_AREA = "live";
048: /**
049: * <code>ARCHIVE_AREA</code> The archive area
050: */
051: String ARCHIVE_AREA = "archive";
052: /**
053: * <code>TRASH_AREA</code> The trash area
054: */
055: String TRASH_AREA = "trash";
056: /**
057: * <code>PUBLICATION_PREFIX</code> The publication prefix
058: */
059: String PUBLICATION_PREFIX = "lenya" + File.separator + "pubs";
060: /**
061: * <code>PUBLICATION_PREFIX_URI</code> The publication prefix URI
062: */
063: String PUBLICATION_PREFIX_URI = "lenya/pubs";
064: /**
065: * <code>CONFIGURATION_PATH</code> The configuration path
066: */
067: String CONFIGURATION_PATH = "config";
068: /**
069: * <code>CONTENT_PATH</code> The content path
070: */
071: String CONTENT_PATH = "content";
072: /**
073: * <code>PENDING_PATH</code> The pending path
074: */
075: String PENDING_PATH = "pending";
076: /**
077: * <code>DELETE_PATH</code> The delete path
078: */
079: String DELETE_PATH = "delete";
080:
081: /**
082: * The item type.
083: */
084: String ITEM_TYPE = "publication";
085:
086: /**
087: * Returns the publication ID.
088: * @return A string value.
089: */
090: String getId();
091:
092: /**
093: * @return The name of the publication as specified in the configuration file.
094: */
095: String getName();
096:
097: /**
098: * Returns the servlet context this publication belongs to (usually, the
099: * <code>webapps/lenya</code> directory).
100: * @return A <code>File</code> object.
101: */
102: File getServletContext();
103:
104: /**
105: * @return if this publication exists.
106: */
107: boolean exists();
108:
109: /**
110: * Returns the publication directory.
111: * @return A <code>File</code> object.
112: */
113: File getDirectory();
114:
115: /**
116: * Return the directory of a specific area.
117: * @param area a <code>File</code> representing the root of the area content directory.
118: * @return the directory of the given content area.
119: */
120: File getContentDirectory(String area);
121:
122: /**
123: * Set the path mapper
124: * @param mapper The path mapper
125: */
126: void setPathMapper(DefaultDocumentIdToPathMapper mapper);
127:
128: /**
129: * Returns the path mapper.
130: * @return a <code>DocumentIdToPathMapper</code>
131: */
132: DocumentIdToPathMapper getPathMapper();
133:
134: /**
135: * Get the default language
136: * @return the default language
137: */
138: String getDefaultLanguage();
139:
140: /**
141: * Set the default language
142: * @param language the default language
143: */
144: void setDefaultLanguage(String language);
145:
146: /**
147: * Get all available languages for this publication
148: * @return an <code>Array</code> of languages
149: */
150: String[] getLanguages();
151:
152: /**
153: * Get the breadcrumb prefix. It can be used as a prefix if a publication is part of a larger
154: * site
155: * @return the breadcrumb prefix
156: */
157: String getBreadcrumbPrefix();
158:
159: /**
160: * Returns the hint of the site manager service that is used by this publication.
161: * @return A hint to use for service selection.
162: */
163: String getSiteManagerHint();
164:
165: /**
166: * Returns the document builder of this instance.
167: * @return A hint to use for service selection.
168: */
169: DocumentBuilder getDocumentBuilder();
170:
171: /**
172: * Returns the publication template instantiator hint. If the publication does not allow
173: * templating, <code>null</code> is returned.
174: * @return A hint to use for service selection.
175: */
176: String getInstantiatorHint();
177:
178: /**
179: * Returns the content dir.
180: * If the publication does not specify a content dir, then <code>null</code> is returned.
181: * @return A base directory where all the content is located.
182: */
183: String getContentDir();
184:
185: /**
186: * Returns the proxy which is used for a particular document's area
187: * (see {@link #getProxy(String, boolean)}).
188: * @param document The document.
189: * @param isSslProtected A boolean value.
190: * @return A proxy.
191: */
192: Proxy getProxy(Document document, boolean isSslProtected);
193:
194: /**
195: * <p>
196: * Returns the proxy which is used for the given area and the ssl parameter.
197: * </p>
198: * <p>
199: * If no proxy is defined in the publication configuration file, a default proxy
200: * with the URL <code>{contextPath}/{pubId}/{area}</code> is returned.
201: * </p>
202: * <p>
203: * If the area string is "root", the global proxy is returned. If no global proxy
204: * is defined, a default global proxy with the URL <code>{contextPath}</code>
205: * is returned.
206: * </p>
207: * @param area area
208: * @param isSslProtected A boolean value.
209: * @return A proxy.
210: */
211: Proxy getProxy(String area, boolean isSslProtected);
212:
213: /**
214: * @return The templates of the publication.
215: */
216: String[] getTemplateIds();
217:
218: /**
219: * @return the URI base for this publication
220: */
221: String getSourceURI();
222:
223: /**
224: * @param area The area.
225: * @return the URI base under which contents in this publication are accessed
226: */
227: String getContentURI(String area);
228:
229: /**
230: * @param resourceType The resource type or <code>null</code> if no workflow is registered for
231: * this resource type.
232: * @return The workflow schema to use for this resource type.
233: */
234: String getWorkflowSchema(ResourceType resourceType);
235:
236: /**
237: * @return The resource types that are supported by this publication.
238: */
239: String[] getResourceTypeNames();
240:
241: /**
242: * @param name The name.
243: * @return An area object.
244: * @throws PublicationException if an error occurs.
245: */
246: Area getArea(String name) throws PublicationException;
247:
248: /**
249: * @return The names of all available areas.
250: */
251: String[] getAreaNames();
252:
253: /**
254: * @return The document factory.
255: */
256: public DocumentFactory getFactory();
257:
258: }
|