KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > lenya > cms > publishing > ResourcePublishingEnvironment


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: ResourcePublishingEnvironment.java 42598 2004-03-01 16:18:28Z gregor $ */
19
20 package org.apache.lenya.cms.publishing;
21
22 import org.apache.avalon.framework.configuration.Configuration;
23 import org.apache.avalon.framework.configuration.ConfigurationException;
24 import org.apache.log4j.Category;
25
26
27 /**
28  * DOCUMENT ME!
29  *
30  */

31 public class ResourcePublishingEnvironment extends PublishingEnvironment {
32     private static Category log = Category.getInstance(ResourcePublishingEnvironment.class);
33     public static final String JavaDoc PARAMETER_RESOURCE_AUTHORING_PATH = "resources-authoring-path";
34     public static final String JavaDoc PARAMETER_RESOURCE_LIVE_PATH = "resources-live-path";
35     private String JavaDoc resourceAuthoringPath;
36     private String JavaDoc resourceLivePath;
37
38     /**
39      * Creates a new ResourcePublishingEnvironment object.
40      *
41      * @param contextPath DOCUMENT ME!
42      * @param publicationId DOCUMENT ME!
43      */

44     public ResourcePublishingEnvironment(String JavaDoc contextPath, String JavaDoc publicationId) {
45         super(contextPath, publicationId);
46     }
47
48     /**
49      * Creates a new ResourcePublishingEnvironment object.
50      *
51      * @param publicationPath DOCUMENT ME!
52      */

53     public ResourcePublishingEnvironment(String JavaDoc publicationPath) {
54         super(publicationPath);
55     }
56
57     /**
58      * DOCUMENT ME!
59      *
60      * @param configuration DOCUMENT ME!
61      *
62      * @throws org.apache.avalon.framework.configuration.ConfigurationException DOCUMENT ME!
63      */

64     public void configure(Configuration configuration)
65         throws ConfigurationException {
66         super.configure(configuration);
67
68         // authoring
69
setResourceAuthoringPath(configuration.getChild("authoring").getChild("resource")
70                                               .getAttribute("href"));
71
72         // live
73
setResourceLivePath(configuration.getChild("live").getChild("resource").getAttribute("href"));
74         log.debug("CONFIGURATION:\nresource authoring path=" + getResourceAuthoringPath() +
75             "\nresource live path=" + getResourceLivePath());
76     }
77
78     /**
79      * Get the live resource path.
80      *
81      * @return a <code>String</code> value
82      */

83     public String JavaDoc getResourceLivePath() {
84         return resourceLivePath;
85     }
86
87     /**
88      * Set the live resource path.
89      *
90      * @param path a <code>String</code> value
91      */

92     protected void setResourceLivePath(String JavaDoc path) {
93         resourceLivePath = path;
94     }
95
96     /**
97      * Get the authoring resource path.
98      *
99      * @return a <code>String</code> value
100      */

101     public String JavaDoc getResourceAuthoringPath() {
102         return resourceAuthoringPath;
103     }
104
105     /**
106      * Set the authoring resource path.
107      *
108      * @param path a <code>String</code> value
109      */

110     protected void setResourceAuthoringPath(String JavaDoc path) {
111         resourceAuthoringPath = path;
112     }
113 }
114
Popular Tags