01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: *
17: */
18: package org.apache.lenya.cms.publication.templating;
19:
20: import org.apache.avalon.framework.service.ServiceException;
21: import org.apache.avalon.framework.service.ServiceSelector;
22: import org.apache.lenya.cms.publication.Publication;
23:
24: /**
25: * <p>
26: * Component to manage publication templates.
27: * </p>
28: * <p>
29: * When a source is obtained, the traversing order is
30: * </p>
31: * <ol>
32: * <li>the publication itself,</li>
33: * <li>all its templates,</li>
34: * <li>the core.</li>
35: * </ol>
36: * @version $Id: PublicationTemplateManager.java 473861 2006-11-12 03:51:14Z gregor $
37: */
38: public interface PublicationTemplateManager {
39:
40: /**
41: * The avalon role.
42: */
43: String ROLE = PublicationTemplateManager.class.getName();
44:
45: /**
46: * <p>
47: * Visits the versions of a source in traversing order. The source doesn't have to exist to be
48: * visited.
49: * </p>
50: * @param publication The original publication.
51: * @param path The path of the source, relatively to the publication directory.
52: * @param visitor The visitor.
53: */
54: void visit(Publication publication, String path,
55: SourceVisitor visitor);
56:
57: /**
58: * Visits the publications in traversing order. The core is not visited.
59: * @param publication The original publication.
60: * @param visitor The visitor.
61: */
62: void visit(Publication publication, PublicationVisitor visitor);
63:
64: /**
65: * Returns the hint for the publiation which declares a service.
66: * @param publication The original publication.
67: * @param selector The service selector.
68: * @param originalHint The original hint.
69: * @return An object.
70: * @throws ServiceException if an error occurs.
71: */
72: Object getSelectableHint(Publication publication,
73: ServiceSelector selector, String originalHint)
74: throws ServiceException;
75:
76: }
|