org.apache.jetspeed.services.webpage
Class JetspeedWebPageService

java.lang.Object
  extended byorg.apache.jetspeed.services.webpage.JetspeedWebPageService
All Implemented Interfaces:
org.apache.jetspeed.services.webpage.WebPageService

public class JetspeedWebPageService
extends java.lang.Object
implements org.apache.jetspeed.services.webpage.WebPageService

This is the default implementation of the WebPageService interface.

It is a service that provides Web Page facade and delegation services for clients to transparently access resources existing on web pages from requests originating from the portal server.

Since the WebPage service is giving the appearance of a single session to the client, the service needs to manage the synchronization of sessions, including single-sign-on, and security authorization permissions between the the portal server and one or more sites.

Version:
$Id: JetspeedWebPageService.java,v 1.4 2004/02/23 03:46:26 jford Exp $
Author:
David Sean Taylor

Field Summary
static java.lang.String INIT_PROPERTIES_PARAM
           
static java.lang.String SERVICE_NAME
          The name of this service
static java.lang.String SESSION_MAP
           
static java.lang.String URL_SESSION_MAP
           
 
Constructor Summary
JetspeedWebPageService()
           
 
Method Summary
 void destroy()
          One time de-initialization of the proxy service
 void get(javax.servlet.http.HttpServlet servlet, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          The primary method invoked when the a Jetspeed GET is executed.
 java.lang.String getErrorString()
          Returns the error string from failed initialized.
 java.lang.String getResourcePath(java.lang.String url, javax.servlet.http.HttpServletRequest request)
          Creates the full path the requested resource on the site from a relative path in request.
 SessionMap getSession(java.lang.String id)
          Returns a session, give a string id key identifying that session.
 java.util.Collection getSessions()
          Returns a snapshot collection of all the active and inactive sessions.
 Site getSite(java.lang.String sid)
          Given a Site id, maps to base URL for that site and returns the Site object
 java.util.Collection getSites()
          Returns a snapshot collection of all the managed sites in the system.
 java.lang.String getTargetBase(java.lang.String url)
          Maps a full URL path to a resource to a base path given: http://localhost:8080/jetspeed/search/index.html returns: http://localhost:8080/jetspeed/
 boolean init(javax.servlet.ServletConfig config)
          One time initialization of the proxy service
 boolean isInit()
          Returns true if the service was initialized successfully.
 void post(javax.servlet.http.HttpServlet servlet, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          The primary method invoked when the a Jetspeed POST is executed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SESSION_MAP

public static final java.lang.String SESSION_MAP
See Also:
Constant Field Values

URL_SESSION_MAP

public static final java.lang.String URL_SESSION_MAP
See Also:
Constant Field Values

INIT_PROPERTIES_PARAM

public static final java.lang.String INIT_PROPERTIES_PARAM
See Also:
Constant Field Values

SERVICE_NAME

public static final java.lang.String SERVICE_NAME
The name of this service

See Also:
Constant Field Values
Constructor Detail

JetspeedWebPageService

public JetspeedWebPageService()
Method Detail

get

public void get(javax.servlet.http.HttpServlet servlet,
                javax.servlet.http.HttpServletRequest request,
                javax.servlet.http.HttpServletResponse response)
         throws javax.servlet.ServletException,
                java.io.IOException
The primary method invoked when the a Jetspeed GET is executed.

Specified by:
get in interface org.apache.jetspeed.services.webpage.WebPageService
Parameters:
servlet - the Servlet.
request - Servlet request.
response - Servlet response.
Throws:
java.io.IOException - a servlet exception.
javax.servlet.ServletException - a servlet exception.

post

public void post(javax.servlet.http.HttpServlet servlet,
                 javax.servlet.http.HttpServletRequest request,
                 javax.servlet.http.HttpServletResponse response)
          throws javax.servlet.ServletException,
                 java.io.IOException
The primary method invoked when the a Jetspeed POST is executed.

Specified by:
post in interface org.apache.jetspeed.services.webpage.WebPageService
Parameters:
servlet - the Servlet.
request - Servlet request.
response - Servlet response.
Throws:
java.io.IOException - a servlet exception.
javax.servlet.ServletException - a servlet exception.

getSite

public Site getSite(java.lang.String sid)
             throws javax.servlet.ServletException
Given a Site id, maps to base URL for that site and returns the Site object

Parameters:
sid - the string Site ID
Returns:
the Site object.
Throws:
javax.servlet.ServletException

getResourcePath

public java.lang.String getResourcePath(java.lang.String url,
                                        javax.servlet.http.HttpServletRequest request)
Creates the full path the requested resource on the site from a relative path in request.

Parameters:
url - the base url for the site.
request - the Servlet request.
Returns:
the full path to the resource.

getTargetBase

public java.lang.String getTargetBase(java.lang.String url)
                               throws javax.servlet.ServletException
Maps a full URL path to a resource to a base path given: http://localhost:8080/jetspeed/search/index.html returns: http://localhost:8080/jetspeed/

Parameters:
url - the full URL of the resource.
Returns:
the base host application string
Throws:
javax.servlet.ServletException

init

public boolean init(javax.servlet.ServletConfig config)
             throws javax.servlet.ServletException,
                    java.io.IOException
One time initialization of the proxy service

Specified by:
init in interface org.apache.jetspeed.services.webpage.WebPageService
Parameters:
config - the servlet configuration.
Throws:
java.io.IOException - a servlet exception.
javax.servlet.ServletException - a servlet exception.

isInit

public boolean isInit()
Returns true if the service was initialized successfully.

Specified by:
isInit in interface org.apache.jetspeed.services.webpage.WebPageService
Returns:
true if the service was initialized successfully.

destroy

public void destroy()
One time de-initialization of the proxy service

Specified by:
destroy in interface org.apache.jetspeed.services.webpage.WebPageService

getSessions

public java.util.Collection getSessions()
Returns a snapshot collection of all the active and inactive sessions.

Specified by:
getSessions in interface org.apache.jetspeed.services.webpage.WebPageService
Returns:
the collection of sessions.

getSession

public SessionMap getSession(java.lang.String id)
Returns a session, give a string id key identifying that session.

Specified by:
getSession in interface org.apache.jetspeed.services.webpage.WebPageService
Parameters:
id - The ID of the session.
Returns:
The corresponding session.

getSites

public java.util.Collection getSites()
Returns a snapshot collection of all the managed sites in the system.

Specified by:
getSites in interface org.apache.jetspeed.services.webpage.WebPageService
Returns:
the collection of sites.

getErrorString

public java.lang.String getErrorString()
Returns the error string from failed initialized.

Specified by:
getErrorString in interface org.apache.jetspeed.services.webpage.WebPageService
Returns:
the error string from last error.


Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.