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.desktop;
018:
019: import java.util.Locale;
020: import java.util.ResourceBundle;
021:
022: import org.apache.jetspeed.headerresource.HeaderResource;
023:
024: /**
025: * Jetspeed Desktop
026: *
027: * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
028: * @author <a href="mailto:smilek@apache.org">Steve Milek</a>
029: * @version $Id: JetspeedDesktopContext.java $
030: */
031: public interface JetspeedDesktopContext {
032: String DESKTOP_CONTEXT_ATTRIBUTE = "jetspeedDesktop";
033: String DESKTOP_REQUEST_CONTEXT_ATTRIBUTE = "JS2RequestContext";
034: String DESKTOP_COMPONENT_MANAGER_ATTRIBUTE = "JS2ComponentManager";
035:
036: String LAYOUT_TEMPLATE_EXTENSION_PROP = "template.extension";
037: String LAYOUT_DESKTOP_TEMPLATE_EXTENSION_PROP = "desktop.template.extension";
038:
039: String LAYOUT_TEMPLATE_ID_PROP = "template.id";
040: String LAYOUT_PRINT_TEMPLATE_ID_PROP = "template.print.id";
041: String LAYOUT_PORTALUSER_TEMPLATE_ID_PROP = "template.portaluser.id";
042:
043: String LAYOUT_TEMPLATE_ID_DEFAULT = "desktop";
044:
045: /**
046: * Portal base url ( e.g. http://localhost:8080/jetspeed )
047: *
048: * @return portal base url
049: */
050: public String getPortalBaseUrl();
051:
052: /**
053: * Portal base url ( e.g. http://localhost:8080/jetspeed )
054: *
055: * @return portal base url
056: */
057: public String getPortalBaseUrl(boolean encode);
058:
059: /**
060: * Portal base url with relativePath argument appended ( e.g. http://localhost:8080/jetspeed/javascript/dojo/ )
061: *
062: * @return portal base url with relativePath argument appended
063: */
064: public String getPortalResourceUrl(String relativePath);
065:
066: /**
067: * Portal base url with relativePath argument appended ( e.g. http://localhost:8080/jetspeed/javascript/dojo/ )
068: *
069: * @return portal base url with relativePath argument appended
070: */
071: public String getPortalResourceUrl(String relativePath,
072: boolean encode);
073:
074: /**
075: * Portal base servlet url ( e.g. http://localhost:8080/jetspeed/desktop/ )
076: *
077: * @return portal base servlet url
078: */
079: public String getPortalUrl();
080:
081: /**
082: * Portal base servlet url ( e.g. http://localhost:8080/jetspeed/desktop/ )
083: *
084: * @return portal base servlet url
085: */
086: public String getPortalUrl(boolean encode);
087:
088: /**
089: * Portal base servlet url with relativePath argument appended ( e.g. http://localhost:8080/jetspeed/desktop/default-page.psml )
090: *
091: * @return portal base servlet url with relativePath argument appended
092: */
093: public String getPortalUrl(String relativePath);
094:
095: /**
096: * Portal base servlet url with relativePath argument appended ( e.g. http://localhost:8080/jetspeed/desktop/default-page.psml )
097: *
098: * @return portal base servlet url with relativePath argument appended
099: */
100: public String getPortalUrl(String relativePath, boolean encode);
101:
102: /**
103: * Gets the layout decoration name
104: *
105: * @return
106: */
107: public String getLayoutDecorationName();
108:
109: /**
110: * <p>
111: * Get the path to the layout decoration desktop template file.
112: * </p>
113: *
114: * @return the desktop template file path.
115: */
116: public String getLayoutTemplatePath();
117:
118: /**
119: * <p>
120: * Get the path to the layout decoration desktop template file.
121: * The property name parameter is provided to allow for an alternate
122: * property value to be used as the filename (without extension)
123: * of the desktop template file.
124: * </p>
125: *
126: * @return the desktop template file path.
127: */
128: public String getLayoutTemplatePath(
129: String layoutTemplateIdPropertyName);
130:
131: /**
132: * <p>
133: * Returns the base path for the layout decoration.
134: * </p>
135: *
136: * @return the base path for the layout decoration.
137: */
138: public String getLayoutBasePath();
139:
140: /**
141: * <p>
142: * Returns the base path for the layout decoration
143: * with the relativePath argument added.
144: * </p>
145: *
146: * @param relativePath
147: * @return the base path for the layout decoration with the relativePath argument added.
148: */
149: public String getLayoutBasePath(String relativePath);
150:
151: /**
152: * <p>
153: * Returns the base url for the layout decoration.
154: * </p>
155: *
156: * @return the base url for the layout decoration.
157: */
158: public String getLayoutBaseUrl();
159:
160: /**
161: * <p>
162: * Returns the base url for the layout decoration
163: * with the relativePath argument added.
164: * </p>
165: *
166: * @param relativePath
167: * @return the base url for the layout decoration with the relativePath argument added.
168: */
169: public String getLayoutBaseUrl(String relativePath);
170:
171: /**
172: * @return the layout decoration resource bundle for the given Locale.
173: */
174: public ResourceBundle getLayoutResourceBundle(Locale locale);
175:
176: /**
177: * @return the HeaderResource component.
178: */
179: public HeaderResource getHeaderResource();
180: }
|