com.bea.portlet.transformation
Class UrlTransformation

java.lang.Object
  extended by UrlCompression
      extended by com.bea.portlet.transformation.UrlTransformation
Direct Known Subclasses:
PageHierarchyUrlTransformation, SimpleRegExUrlTransformation

public abstract class UrlTransformation
extends UrlCompression

This is an extension of the default url compression algorithm that allows a developer to rewrite a portion of a wlp url to make it more readable or to format it in a way that fits the usage model for the portal site. After a concrete implementation of this class, do the following to enable. Add the following to the web app's web.xml UrlTransformationServlet com.bea.portlet.transformation.UrlTranformationServlet defaultPage /index.jsp errorPage /errors/error.jsp implementation concrete implementation of com.bea.portlet.transformation.UrlTransformation param pageId 1 UrlTransformationServlet TheGreatestBookStore/* Add the following tag to your beehive-url-template-config.xml templates. {url:compression}


Constructor Summary
UrlTransformation()
          Default constructor.
 
Method Summary
abstract  String transformUrl(javax.servlet.http.HttpServletRequest request, String url)
          Transform a fully qualified wlp url into a format that meets the requirements of the application.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UrlTransformation

public UrlTransformation()
Default constructor.

Method Detail

transformUrl

public abstract String transformUrl(javax.servlet.http.HttpServletRequest request,
                                    String url)
                             throws UrlTransformationException
Transform a fully qualified wlp url into a format that meets the requirements of the application. For example, you may turn the url from http://host:port/books/bookstore.portal?_nfpb=true&_pageLabel=stephen_king into http://host:port/books/bookstore/books/horror/stephen_king?pageId=1234 .

Parameters
request - object that contains the request the client made of the servlet
url - the fully qualified wlp url.
Returns
the transformed url. This must be in a format that can be appended to the server/webapp info portion of the url and before the query string. An example may be something like '/books/horror/stephen_king'. Please note, there should be *no* appended '/'. Also, returning null is not valid.
Throws
UrlTransformationException - wrapper exception for any exception that is raised.


Copyright © 2011, Oracle. All rights reserved.