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 org.apache.jetspeed.headerresource.HeaderResourceFactory;
20  import org.apache.jetspeed.request.RequestContext;
21  
22  /***
23   * Jetspeed Desktop 
24   *
25   * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
26   * @version $Id: $
27   */
28  public interface JetspeedDesktop 
29  {
30      String DESKTOP_ENABLED_REQUEST_ATTRIBUTE = "desktop.enabled";
31      
32      String DESKTOP_ENCODER_REQUEST_PARAMETER = "encoder";
33      String DESKTOP_ENCODER_REQUEST_PARAMETER_VALUE = "desktop";
34      
35      String DESKTOP_AJAX_REQUEST_PARAMETER = "jsdajax";
36      String DESKTOP_REQUEST_NOT_AJAX_PARAMETER = "org.apache.jetspeed.desktop.request.not.ajax";
37      
38      String DEFAULT_DESKTOP_PIPELINE_PATH = "/desktop";
39      String DEFAULT_DESKTOP_ACTION_PIPELINE_PATH = "/action";
40      String DEFAULT_DESKTOP_RENDER_PIPELINE_PATH = "/render";
41      String DEFAULT_DESKTOP_CONFIGURE_PIPELINE_PATH = "/dtconfigure";
42  
43      /***
44       * Render a desktop theme.
45       * 
46       * @param request
47       */
48      void render(RequestContext request);
49      
50      /***
51       * Indicates whether /desktop is enabled for the current portal request.
52       * Located here due to range of jetspeed components which need this information and
53       * already have a DecorationFactory reference.
54       * 
55       * @param requestContext current portal request.
56       * 
57       * @return true if /desktop is enabled for the current portal request, otherwise false
58       */
59      boolean isDesktopEnabled( RequestContext requestContext );
60      
61      /***
62       * Retrieve the header resource factory
63       * 
64       * @return header resource factory
65       */
66      HeaderResourceFactory getHeaderResourceFactory();
67      
68      /***
69       * Desktop servlet path ( e.g. /desktop )
70       * 
71       * @return portal base url
72       */
73      public String getDesktopServletPath();
74      
75      /***
76       * Portal base url ( e.g. http://localhost:8080/jetspeed )
77       * 
78       * @return portal base url
79       */
80      public String getPortalBaseUrl( RequestContext requestContext );
81      
82      /***
83       * Portal base url ( e.g. http://localhost:8080/jetspeed )
84       * 
85       * @return portal base url
86       */
87      public String getPortalBaseUrl( RequestContext requestContext, boolean encode );
88      
89      /***
90       * Portal base url with relativePath argument appended ( e.g. http://localhost:8080/jetspeed/javascript/dojo/ )
91       * 
92       * @return portal base url with relativePath argument appended
93       */
94      public String getPortalResourceUrl( RequestContext requestContext, String relativePath );
95      
96      /***
97       * Portal base url with relativePath argument appended ( e.g. http://localhost:8080/jetspeed/javascript/dojo/ )
98       * 
99       * @return portal base url with relativePath argument appended
100      */
101     public String getPortalResourceUrl( RequestContext requestContext, String relativePath, boolean encode );
102     
103     /***
104      * Portal base servlet url ( e.g. http://localhost:8080/jetspeed/desktop/ )
105      * 
106      * @return portal base servlet url
107      */
108     public String getPortalUrl( RequestContext requestContext );
109     
110     /***
111      * Portal base servlet url ( e.g. http://localhost:8080/jetspeed/desktop/ )
112      * 
113      * @return portal base servlet url
114      */
115     public String getPortalUrl( RequestContext requestContext, boolean encode );
116     
117     /***
118      * Portal base servlet url with relativePath argument appended ( e.g. http://localhost:8080/jetspeed/desktop/default-page.psml )
119      * 
120      * @return portal base servlet url with relativePath argument appended
121      */
122     public String getPortalUrl( RequestContext requestContext, String relativePath );
123     
124     /***
125      * Portal base servlet url with relativePath argument appended ( e.g. http://localhost:8080/jetspeed/desktop/default-page.psml )
126      * 
127      * @return portal base servlet url with relativePath argument appended
128      */
129     public String getPortalUrl( RequestContext requestContext, String relativePath, boolean encode );
130             
131 }