You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wsrp4j-dev@portals.apache.org by dl...@apache.org on 2005/08/28 23:34:39 UTC
cvs commit: ws-wsrp4j/sandbox/wsrp4j/commons-consumer/src/java/org/apache/wsrp4j/commons/consumer/interfaces/urlgenerator URLGenerator.java URLRewriter.java URLTemplateComposer.java
dlouzan 2005/08/28 14:34:39
Added: sandbox/wsrp4j/commons-consumer/src/java/org/apache/wsrp4j/commons/consumer/interfaces/urlgenerator
URLGenerator.java URLRewriter.java
URLTemplateComposer.java
Log:
Initial commit.
Revision Changes Path
1.1 ws-wsrp4j/sandbox/wsrp4j/commons-consumer/src/java/org/apache/wsrp4j/commons/consumer/interfaces/urlgenerator/URLGenerator.java
Index: URLGenerator.java
===================================================================
/*
* Copyright 2003-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.wsrp4j.commons.consumer.interfaces.urlgenerator;
import java.util.Map;
/**
* This interface provides methods to query the consumer's urls.
* These methods could be used to implement consumer url rewriting.
*
* @author <a href="mailto:stefan.behl@de.ibm.com">Stefan Behl</a>
*
* @version $Id: URLGenerator.java,v 1.1 2005/08/28 21:34:39 dlouzan Exp $
**/
public interface URLGenerator {
/**
* Creates a URL pointing to the consumer,triggering a
* performBlockingInteraction call.
*
* @param params A map with all parameters which should be appended
* to the URL.
*
* @return a blockingInteraction URL
**/
String getBlockingActionURL(Map params);
/**
* Creates a URL pointing to the consumer,triggering a getMarkup call.
*
* @param params A map with all parameters which should be appended
* to the URL.
*
* @return a getMarkup URL
**/
String getRenderURL(Map params);
/**
* Creates a URL pointing to the consumer,triggering the consumer
* to fetch a certain resource
*
* @param params A map with all parameters which should be appended
* to the URL.
*
* @return a resource URL
**/
String getResourceURL(Map params);
/**
* Creates a 'url' that the consumer can use to namespace tokens.
*
*
* @return a prefix which ca nbe used to namespace tokens.
**/
String getNamespacedToken(String token);
}
1.1 ws-wsrp4j/sandbox/wsrp4j/commons-consumer/src/java/org/apache/wsrp4j/commons/consumer/interfaces/urlgenerator/URLRewriter.java
Index: URLRewriter.java
===================================================================
/*
* Copyright 2003-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.wsrp4j.commons.consumer.interfaces.urlgenerator;
/**
* <p>This interface provides a method performing Consumer URLRewriting.</p>
*
* @author <a href="mailto:stefan.behl@de.ibm.com">Stefan Behl</a>
*
* @version $Id: URLRewriter.java,v 1.1 2005/08/28 21:34:39 dlouzan Exp $
*/
public interface URLRewriter {
/**
* Sets the URLGenerator to be used.
*/
void setURLGenerator(URLGenerator urlGenerator);
/**
* Parses the entire markup and rewrites all found URLs. The URLs to be
* rewritten are enclosed by the tokens "wsrp-rewrite" and "/wsrp-rewrite".
*
* @param markup The markup to be parsed for URLs
* to be rewritten.
*
* @return String representing markup incl. complete URLs.
*/
String rewriteURLs(String markup);
}
1.1 ws-wsrp4j/sandbox/wsrp4j/commons-consumer/src/java/org/apache/wsrp4j/commons/consumer/interfaces/urlgenerator/URLTemplateComposer.java
Index: URLTemplateComposer.java
===================================================================
/*
* Copyright 2003-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.wsrp4j.commons.consumer.interfaces.urlgenerator;
/**
* <p>This interface provides methods to generate URL templates.</p>
* <p>The generated templates will be transmitted to Producers (or
* respectively portlets) that are willing to properly write URLs for a
* Consumer. (With templates the Consumer indicates how it needs URLs
* formatted in order to process them properly.)</p>
*
* @author <a href="mailto:stefan.behl@de.ibm.com">Stefan Behl</a>
*
* @version $Id: URLTemplateComposer.java,v 1.1 2005/08/28 21:34:39 dlouzan Exp $
*/
public interface URLTemplateComposer {
/**
* Sets the URLGenerator to be used.
*/
void setURLGenerator(URLGenerator urlGenerator);
/**
* Creates a blocking action template. Includes tokens for url-type,
* portletMode, navigationalState, interactionState and windowState to
* be replaced by the producer.
*
* @return String representing the entire template.
*/
String createBlockingActionTemplate(
boolean includePortletHandle,
boolean includeUserContextKey,
boolean includePortletInstanceKey,
boolean includeSessionID);
/**
* Creates a secure blocking action template. Includes tokens for url-type,
* portletMode, navigationalState, interactionState, windowState and
* secureURL to be replaced by the producer.
*
* @return String representing the entire template.
*/
String createSecureBlockingActionTemplate(
boolean includePortletHandle,
boolean includeUserContextKey,
boolean includePortletInstanceKey,
boolean includeSessionID);
/**
* Creates a render template. Includes tokens for url-type, portletMode,
* navigationalState, interactionState and windowState to be replaced by
* the producer.
*
* @return String representing the entire template.
*/
String createRenderTemplate(
boolean includePortletHandle,
boolean includeUserContextKey,
boolean includePortletInstanceKey,
boolean includeSessionID);
/**
* Creates a secure render template. Includes tokens for url-type,
* portletMode, navigationalState, interactionState, windowState and
* secureURL to be replaced by the producer.
*
* @return String representing the entire template.
*/
String createSecureRenderTemplate(
boolean includePortletHandle,
boolean includeUserContextKey,
boolean includePortletInstanceKey,
boolean includeSessionID);
/**
* Creates a resource template. Includes tokens for url-type,
* rewriteResource and url to be replaced by the producer.
*
* @return String representing the entire template.
*/
String createResourceTemplate(
boolean includePortletHandle,
boolean includeUserContextKey,
boolean includePortletInstanceKey,
boolean includeSessionID);
/**
* Creates a secure resource template. Includes tokens for url-type, url,
* rewriteResource, and secureURL to be replaced by the producer.
*
* @return String representing the entire template.
*/
String createSecureResourceTemplate(
boolean includePortletHandle,
boolean includeUserContextKey,
boolean includePortletInstanceKey,
boolean includeSessionID);
/**
* Creates a default template. Includes tokens for url-type, portletMode,
* navigationalState, interactionState, windowState, url, rewriteResource
* and secureURL to be replaced by the producer.
*
* @return String representing the entire template.
*/
String createDefaultTemplate(
boolean includePortletHandle,
boolean includeUserContextKey,
boolean includePortletInstanceKey,
boolean includeSessionID);
/**
* Creates a secure default template. Includes tokens for url-type,
* portletMode, navigationalState, interactionState, windowState, url,
* rewriteResource and secureURL to be replaced by the producer.
*
* @return String representing the entire template.
*/
String createSecureDefaultTemplate(
boolean includePortletHandle,
boolean includeUserContextKey,
boolean includePortletInstanceKey,
boolean includeSessionID);
/**
* Get the consumers namespace prefix which is used by the portlet
* to namespace tokens which need to be unique on a aggregated page.
*
* @return The namespace prefix of the consumer.
**/
String getNamespacePrefix();
}