1   /*
2    * Copyright 2000-2001,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  
19   */
20  
21  package org.apache.wsrp4j.consumer;
22  
23  /**
24   * <p>This interface provides methods to generate URL templates.</p>
25   * <p>The generated templates will be transmitted to Producers (or respectively portlets)
26   * that are willing to properly write URLs for a Consumer. (With templates the Consumer
27   * indicates how it needs URLs formatted in order to process them properly.)</p> 
28   *
29   * @author <a href="mailto:stefan.behl@de.ibm.com">Stefan Behl</a>
30   *
31   * @version 1.1
32   */
33  public interface URLTemplateComposer {
34  
35      /**
36       * Sets the URLGenerator to be used.
37       */
38      public void setURLGenerator(URLGenerator urlGenerator);
39  
40      /**
41       * Creates a blocking action template. Includes tokens for url-type, portletMode,
42       * navigationalState, interactionState and windowState to be replaced by the producer.
43       *
44       * @return String representing the entire template.
45       */
46      public String createBlockingActionTemplate(boolean includePortletHandle,
47              boolean includeUserContextKey, boolean includePortletInstanceKey,
48              boolean includeSessionID);
49  
50      /**
51       * Creates a secure blocking action template. Includes tokens for url-type,
52       * portletMode, navigationalState, interactionState, windowState and secureURL to be replaced by
53       * the producer.
54       *
55       * @return String representing the entire template.
56       */
57      public String createSecureBlockingActionTemplate(
58              boolean includePortletHandle, boolean includeUserContextKey,
59              boolean includePortletInstanceKey, boolean includeSessionID);
60  
61      /**
62       * Creates a render template. Includes tokens for url-type, portletMode,
63       * navigationalState, interactionState and windowState to be replaced by the producer.
64       *
65       * @return String representing the entire template.
66       */
67      public String createRenderTemplate(boolean includePortletHandle,
68              boolean includeUserContextKey, boolean includePortletInstanceKey,
69              boolean includeSessionID);
70  
71      /**
72       * Creates a secure render template. Includes tokens for url-type, portletMode,
73       * navigationalState, interactionState, windowState and secureURL to be replaced by the producer.
74       *
75       * @return String representing the entire template.
76       */
77      public String createSecureRenderTemplate(boolean includePortletHandle,
78              boolean includeUserContextKey, boolean includePortletInstanceKey,
79              boolean includeSessionID);
80  
81      /**
82       * Creates a resource template. Includes tokens for url-type,
83       * rewriteResource and url to be replaced by the producer.
84       *
85       * @return String representing the entire template.
86       */
87      public String createResourceTemplate(boolean includePortletHandle,
88              boolean includeUserContextKey, boolean includePortletInstanceKey,
89              boolean includeSessionID);
90  
91      /**
92       * Creates a secure resource template. Includes tokens for url-type, url,
93       * rewriteResource, and secureURL to be replaced by the producer.
94       *
95       * @return String representing the entire template.
96       */
97      public String createSecureResourceTemplate(boolean includePortletHandle,
98              boolean includeUserContextKey, boolean includePortletInstanceKey,
99              boolean includeSessionID);
100 
101     /**
102      * Creates a default template. Includes tokens for url-type, portletMode,
103      * navigationalState, interactionState, windowState, url, rewriteResource
104      * and secureURL to be replaced by the producer.
105      *
106      * @return String representing the entire template.
107      */
108     public String createDefaultTemplate(boolean includePortletHandle,
109             boolean includeUserContextKey, boolean includePortletInstanceKey,
110             boolean includeSessionID);
111 
112     /**
113      * Creates a secure default template. Includes tokens for url-type, portletMode,
114      * navigationalState, interactionState, windowState, url, rewriteResource and secureURL
115      * to be replaced by the producer.
116      *
117      * @return String representing the entire template.
118      */
119     public String createSecureDefaultTemplate(boolean includePortletHandle,
120             boolean includeUserContextKey, boolean includePortletInstanceKey,
121             boolean includeSessionID);
122 
123     /**
124      * Get the consumers namespace prefix which is used by the portlet
125      * to namespace tokens which need to be unique on a aggregated page. 
126      *
127      * @return The namespace prefix of the consumer.
128      **/
129     public String getNamespacePrefix();
130 }