01: /*
02: * Copyright 2004 Outerthought bvba and Schaubroeck nv
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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: package org.outerj.daisy.publisher;
17:
18: import org.xml.sax.ContentHandler;
19: import org.xml.sax.SAXException;
20: import org.outerj.daisy.repository.RepositoryException;
21: import org.outerj.daisy.repository.VariantKey;
22: import org.outerx.daisy.x10Publisher.PublisherRequestDocument;
23:
24: /**
25: * Using the Publisher it is possible to retrieve a variety of information from the repository
26: * using one (remote) call, the response it returned as XML. The Publisher also has performs
27: * additional processing and annotation on the content to prepare it for publishing.
28: *
29: * <p>This component helps a lot to create publishing frontends to the repository server,
30: * of which the Daisy Wiki is one example. The Daisy documentation contains more extensive
31: * documentation on the possibilities of the Publisher.
32: *
33: * <p>This is an optional repository extension component.
34: *
35: * <p>The Publisher is obtained from the {@link org.outerj.daisy.repository.Repository Repository} as
36: * follows:
37: *
38: * <pre>
39: * Publisher publisher = (Publisher)repository.getExtension("Publisher");
40: * </pre>
41: *
42: * <p>In the remote repository API, the Publisher extension can be registered as follows:
43: *
44: * <pre>
45: * RemoteRepositoryManager repositoryManager = ...;
46: * repositoryManager.registerExtension("Publisher",
47: * new Packages.org.outerj.daisy.publisher.clientimpl.RemotePublisherProvider());
48: * </pre>
49: */
50: public interface Publisher {
51: /**
52: * <p>Retrieves information about a document part without having to go through
53: * the normal repository API. In the normal API, this would require multiple API
54: * calls, which is a performance disadvantage when using the remote implementation of the API
55: * (for the in-VM API, it doesn't make any difference in performance).
56: *
57: * <b>Important: after usage, you must call the dispose method of the BlobInfo object.</b>
58: *
59: * @param versionSpec a version number, or "last" or "live"
60: * @param partType a part type id or part type name
61: */
62: BlobInfo getBlobInfo(VariantKey variantKey, String versionSpec,
63: String partType) throws RepositoryException;
64:
65: /**
66: * Processes a publisher request. See the Daisy documentation for more information on
67: * publisher requests.
68: */
69: void processRequest(
70: PublisherRequestDocument publisherRequestDocument,
71: ContentHandler contentHandler) throws SAXException,
72: RepositoryException, PublisherException;
73: }
|