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: package org.apache.jetspeed.page.document;
018:
019: /**
020: * <p>
021: * DocumentHandlerFactory
022: * </p>
023: * <p>
024: * Factory for generating <code>DocumentHandlers</code> for specific document types
025: * </p>
026: * @author <a href="mailto:weaver@apache.org">Scott T. Weaver</a>
027: * @version $Id: DocumentHandlerFactory.java 516448 2007-03-09 16:25:47Z ate $
028: *
029: */
030: public interface DocumentHandlerFactory {
031: /**
032: *
033: * <p>
034: * getDocumentHandler
035: * </p>
036: *
037: * @param documentType document type to retreive a handler for. Examples: .psml, .link
038: * @return DocumentHanlder for the <code>documentType</code> indicated. Never returns <code>null.</code>
039: * @throws UnsupportedDocumentTypeException If no handler has been registered for the
040: * <code>documentType</code> argument.
041: */
042: DocumentHandler getDocumentHandler(String documentType)
043: throws UnsupportedDocumentTypeException;
044:
045: /**
046: *
047: * <p>
048: * getDocumentHandlerForPath
049: * </p>
050: *
051: * @param documentPath
052: * @return
053: * @throws UnsupportedDocumentTypeException
054: */
055: DocumentHandler getDocumentHandlerForPath(String documentPath)
056: throws UnsupportedDocumentTypeException;
057:
058: /**
059: *
060: * <p>
061: * addDocumentHandler
062: * </p>
063: *
064: * @param documentHandler
065: */
066: void registerDocumentHandler(DocumentHandler documentHandler)
067: throws DocumentTypeAlreadyRegisteredException;
068:
069: /**
070: * <p>
071: * getConstraintsEnabled
072: * </p>
073: *
074: * @return enabled indicator
075: */
076: boolean getConstraintsEnabled();
077:
078: /**
079: * <p>
080: * setConstraintsEnabled
081: * </p>
082: *
083: * @param enabled indicator
084: */
085: void setConstraintsEnabled(boolean enabled);
086:
087: /**
088: * <p>
089: * getPermissionsEnabled
090: * </p>
091: *
092: * @return enabled indicator
093: */
094: boolean getPermissionsEnabled();
095:
096: /**
097: * <p>
098: * setPermissionsEnabled
099: * </p>
100: *
101: * @param enabled indicator
102: */
103: void setPermissionsEnabled(boolean enabled);
104: }
|