View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    * 
9    *      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  package org.apache.jetspeed.desktop;
18  
19  import java.util.Locale;
20  import java.util.ResourceBundle;
21  
22  import org.apache.jetspeed.headerresource.HeaderResource;
23  
24  /***
25   * Jetspeed Desktop 
26   *
27   * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
28   * @author <a href="mailto:smilek@apache.org">Steve Milek</a>
29   * @version $Id: JetspeedDesktopContext.java $
30   */
31  public interface JetspeedDesktopContext
32  {
33      String DESKTOP_CONTEXT_ATTRIBUTE = "jetspeedDesktop";
34      String DESKTOP_REQUEST_CONTEXT_ATTRIBUTE = "JS2RequestContext";
35      String DESKTOP_COMPONENT_MANAGER_ATTRIBUTE = "JS2ComponentManager";
36      
37      String LAYOUT_TEMPLATE_EXTENSION_PROP = "template.extension";
38      String LAYOUT_DESKTOP_TEMPLATE_EXTENSION_PROP = "desktop.template.extension";
39      
40      String LAYOUT_TEMPLATE_ID_PROP = "template.id";
41      String LAYOUT_PRINT_TEMPLATE_ID_PROP = "template.print.id";
42      String LAYOUT_PORTALUSER_TEMPLATE_ID_PROP = "template.portaluser.id";
43      
44      String LAYOUT_TEMPLATE_ID_DEFAULT = "desktop";
45  
46      
47      /***
48       * Portal base url ( e.g. http://localhost:8080/jetspeed )
49       * 
50       * @return portal base url
51       */
52      public String getPortalBaseUrl();
53      
54      /***
55       * Portal base url ( e.g. http://localhost:8080/jetspeed )
56       * 
57       * @return portal base url
58       */
59      public String getPortalBaseUrl( boolean encode );
60      
61      /***
62       * Portal base url with relativePath argument appended ( e.g. http://localhost:8080/jetspeed/javascript/dojo/ )
63       * 
64       * @return portal base url with relativePath argument appended
65       */
66      public String getPortalResourceUrl( String relativePath );
67      
68      /***
69       * Portal base url with relativePath argument appended ( e.g. http://localhost:8080/jetspeed/javascript/dojo/ )
70       * 
71       * @return portal base url with relativePath argument appended
72       */
73      public String getPortalResourceUrl( String relativePath, boolean encode );
74      
75      /***
76       * Portal base servlet url ( e.g. http://localhost:8080/jetspeed/desktop/ )
77       * 
78       * @return portal base servlet url
79       */
80      public String getPortalUrl();
81      
82      /***
83       * Portal base servlet url ( e.g. http://localhost:8080/jetspeed/desktop/ )
84       * 
85       * @return portal base servlet url
86       */
87      public String getPortalUrl( boolean encode );
88      
89      /***
90       * Portal base servlet url with relativePath argument appended ( e.g. http://localhost:8080/jetspeed/desktop/default-page.psml )
91       * 
92       * @return portal base servlet url with relativePath argument appended
93       */
94      public String getPortalUrl( String relativePath );
95      
96      /***
97       * Portal base servlet url with relativePath argument appended ( e.g. http://localhost:8080/jetspeed/desktop/default-page.psml )
98       * 
99       * @return portal base servlet url with relativePath argument appended
100      */
101     public String getPortalUrl( String relativePath, boolean encode );
102 
103     /***
104      * Gets the layout decoration name
105      * 
106      * @return
107      */
108     public String getLayoutDecorationName();
109     
110     /***
111      * <p>
112      * Get the path to the layout decoration desktop template file.
113      * </p>
114      * 
115      * @return the desktop template file path.
116      */
117     public String getLayoutTemplatePath();
118 
119     /***
120      * <p>
121      * Get the path to the layout decoration desktop template file.
122      * The property name parameter is provided to allow for an alternate
123      * property value to be used as the filename (without extension)
124      * of the desktop template file.
125      * </p>
126      * 
127      * @return the desktop template file path.
128      */
129     public String getLayoutTemplatePath( 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 }