001: /**
002: * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
003: *
004: * Permission is hereby granted, free of charge, to any person obtaining a copy
005: * of this software and associated documentation files (the "Software"), to deal
006: * in the Software without restriction, including without limitation the rights
007: * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
008: * copies of the Software, and to permit persons to whom the Software is
009: * furnished to do so, subject to the following conditions:
010: *
011: * The above copyright notice and this permission notice shall be included in
012: * all copies or substantial portions of the Software.
013: *
014: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
015: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
016: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
017: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
018: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
019: * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
020: * SOFTWARE.
021: */package com.liferay.portlet.wsrp;
022:
023: import org.apache.wsrp4j.consumer.URLGenerator;
024: import org.apache.wsrp4j.consumer.URLTemplateComposer;
025:
026: /**
027: * <a href="URLTemplateComposerImpl.java.html"><b><i>View Source</i></b></a>
028: *
029: * @author Michael Young
030: *
031: */
032: public class URLTemplateComposerImpl implements URLTemplateComposer {
033:
034: public static URLTemplateComposer getInstance() {
035: if (_instance == null) {
036: _instance = new URLTemplateComposerImpl();
037: }
038:
039: return _instance;
040: }
041:
042: private URLTemplateComposerImpl() {
043: }
044:
045: /**
046: * Sets the url generator to be used.
047: */
048: public void setURLGenerator(URLGenerator urlGenerator) {
049: this ._urlGenerator = urlGenerator;
050: }
051:
052: public String createBlockingActionTemplate(
053: boolean includePortletHandle,
054: boolean includeUserContextKey,
055: boolean includePortletInstanceKey, boolean includeSessionID) {
056:
057: String template = null;
058:
059: //TODO: Template processing Pluto case
060:
061: return template;
062: }
063:
064: public String createSecureBlockingActionTemplate(
065: boolean includePortletHandle,
066: boolean includeUserContextKey,
067: boolean includePortletInstanceKey, boolean includeSessionID) {
068:
069: String template = null;
070:
071: //TODO: Template processing Pluto case
072: /*
073: *
074: * if (this.urlGenerator != null) { template = createTemplate(
075: * urlGenerator.getBlockingActionURL(null), false, true, true, true,
076: * true, true, false, false, includePortletHandle,
077: * includeUserContextKey, includePortletInstanceKey, includeSessionID); }
078: */
079: return template;
080: }
081:
082: public String createRenderTemplate(boolean includePortletHandle,
083: boolean includeUserContextKey,
084: boolean includePortletInstanceKey, boolean includeSessionID) {
085:
086: String template = null;
087:
088: //TODO: Template processing Pluto case
089:
090: return template;
091: }
092:
093: public String createSecureRenderTemplate(
094: boolean includePortletHandle,
095: boolean includeUserContextKey,
096: boolean includePortletInstanceKey, boolean includeSessionID) {
097:
098: String template = null;
099:
100: //TODO: Template processing Pluto case
101:
102: return template;
103: }
104:
105: public String createResourceTemplate(boolean includePortletHandle,
106: boolean includeUserContextKey,
107: boolean includePortletInstanceKey, boolean includeSessionID) {
108:
109: String template = null;
110:
111: //TODO: Template processing Pluto case
112:
113: return template;
114: }
115:
116: public String createSecureResourceTemplate(
117: boolean includePortletHandle,
118: boolean includeUserContextKey,
119: boolean includePortletInstanceKey, boolean includeSessionID) {
120:
121: String template = null;
122:
123: //TODO: Template processing Pluto case
124:
125: return template;
126: }
127:
128: public String createDefaultTemplate(boolean includePortletHandle,
129: boolean includeUserContextKey,
130: boolean includePortletInstanceKey, boolean includeSessionID) {
131:
132: String template = null;
133:
134: //TODO: Template processing Pluto case
135:
136: return template;
137: }
138:
139: public String createSecureDefaultTemplate(
140: boolean includePortletHandle,
141: boolean includeUserContextKey,
142: boolean includePortletInstanceKey, boolean includeSessionID) {
143:
144: String template = null;
145:
146: //TODO: Template processing Pluto case
147:
148: return template;
149: }
150:
151: public String getNamespacePrefix() {
152: return _urlGenerator.getNamespacedToken("");
153: }
154:
155: private static URLTemplateComposer _instance = null;
156:
157: private URLGenerator _urlGenerator = null;
158:
159: }
|