BEA Systems, Inc.

com.beasys.portal.admin
Class PortalServiceManager

java.lang.Object
  |
  +--javax.servlet.GenericServlet
        |
        +--javax.servlet.http.HttpServlet
              |
              +--com.beasys.portal.admin.PortalServiceManager

public class PortalServiceManager
extends javax.servlet.http.HttpServlet
implements PortalAdminConstants

Acts as a traffic cop for a portal implementation. Provides redirection, forwarding, name-resolution, and security services.

See Also:
Serialized Form

Field Summary
protected  boolean allowAutoLogin
          Whether the portal allows auto-login upon portal invocation.
protected  int cookieTimeout
          The time (in milliseconds) which elapses before the portal cookie is timed outl The cookie defaults to timing out when the browser is closed.
protected  java.lang.String defaultDest
          The portal's default destination.
protected  java.lang.String documentRoot
          The server's document root.
protected  java.lang.String groupName
          The group name associated with the portal instance.
protected  java.lang.String homePage
          The portal's home page.
protected  java.lang.String portalName
          The portal name associated with the portal instance.
protected  java.lang.String sessionParamName
          The name assigned to the session.
protected  int sessionTimeout
          The time (in milliseconds) which elapses before the portal session is timed out.
protected  java.lang.String trafficURI
          The URI of the PortalServiceManager.
protected  java.lang.String workingDir
          The working directory, relative the server's document root, of the portal instance.
 
Fields inherited from interface com.beasys.portal.admin.PortalAdminConstants
DEFAULT_DESTINATION, DESTINATION_URI, FALSE, IMMUTABLE_PORTAL_PAGE, PORTAL_COOKIE_TIMEOUT, PORTAL_GROUP, PORTAL_LOGGED_IN, PORTAL_MANAGER_A, PORTAL_NAME, PORTAL_PAGE, PORTAL_PROPERTIES_A, PORTAL_SESSION_TIMEOUT, PORTAL_USER, PROFILE_GROUP, PROFILE_USER, TRAFFIC_URI, TRANSACTION_SERVICE, TRANSACTION_TIMEOUT, TRUE, WORKING_DIR
 
Constructor Summary
PortalServiceManager()
           
 
Method Summary
protected  void appendParameters(java.lang.String key, java.lang.String[] values, java.lang.StringBuffer sb)
          Help creating the request query string, if we need to redirect the destination.
 void baseReset(javax.servlet.http.HttpServletRequest aRequest)
          Reset the values that can't be overridden.
protected  java.lang.String determineDestination(javax.servlet.http.HttpServletRequest req)
          Figure out what the real destination is.
protected  void finishTx(javax.jts.UserTransaction tx, javax.servlet.http.HttpServletRequest req)
          Finish tx.
protected  java.lang.String handleAttributes(javax.servlet.http.HttpServletRequest req, java.lang.String aDestination)
          Handle attributes.
 void init(javax.servlet.ServletConfig config)
          Initializes the servlet.
protected  java.lang.String initSession(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Handle the session initialization.
protected  void redirect(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, java.lang.String aDestination)
          If the destination contains a '?' (for parms).
protected  void resetSession(javax.servlet.http.HttpServletRequest aRequest)
          Reset the session to a known state.
 void service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Implements the service method of the servlet.
protected  javax.jts.UserTransaction startTx()
          Start tx.
protected  boolean stillAlive(javax.servlet.http.HttpServletRequest aRequest)
          Check to see if the session has timed out.
protected  boolean userStillExist(java.lang.String aUser, javax.servlet.http.HttpServletRequest aRequest)
          User still exist.
protected  boolean validDestination(java.lang.String aDestination)
          Check if the destination is valid.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doOptions, doPost, doPut, doTrace, getLastModified, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

trafficURI

protected java.lang.String trafficURI
The URI of the PortalServiceManager.

groupName

protected java.lang.String groupName
The group name associated with the portal instance.

portalName

protected java.lang.String portalName
The portal name associated with the portal instance.

defaultDest

protected java.lang.String defaultDest
The portal's default destination.

homePage

protected java.lang.String homePage
The portal's home page.

sessionTimeout

protected int sessionTimeout
The time (in milliseconds) which elapses before the portal session is timed out. The session defaults to timing out when the browser is closed.

cookieTimeout

protected int cookieTimeout
The time (in milliseconds) which elapses before the portal cookie is timed outl The cookie defaults to timing out when the browser is closed.

allowAutoLogin

protected boolean allowAutoLogin
Whether the portal allows auto-login upon portal invocation. If auto-login is allowed, the user's cookie will be used to automatically log the user into the portal. Otherwise, a default portal is presented, and the user must login to observe a personalized portal.

workingDir

protected java.lang.String workingDir
The working directory, relative the server's document root, of the portal instance.

documentRoot

protected java.lang.String documentRoot
The server's document root.

sessionParamName

protected java.lang.String sessionParamName
The name assigned to the session.
Constructor Detail

PortalServiceManager

public PortalServiceManager()
Method Detail

init

public void init(javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
Initializes the servlet. Looks for the property "initial" to set the pageCount variable.
Overrides:
init in class javax.servlet.GenericServlet
Parameters:
the - configuration.

baseReset

public void baseReset(javax.servlet.http.HttpServletRequest aRequest)
Reset the values that can't be overridden.
Parameters:
the - request.

resetSession

protected void resetSession(javax.servlet.http.HttpServletRequest aRequest)
                     throws java.io.IOException
Reset the session to a known state.
Parameters:
the - session

stillAlive

protected boolean stillAlive(javax.servlet.http.HttpServletRequest aRequest)
Check to see if the session has timed out.
Parameters:
the - session
Returns:
true if the session is still within time limits.

userStillExist

protected boolean userStillExist(java.lang.String aUser,
                                 javax.servlet.http.HttpServletRequest aRequest)
User still exist. Is this user still in the system.
Parameters:
aUser - the user name.
Returns:
boolean yes/no.

initSession

protected java.lang.String initSession(javax.servlet.http.HttpServletRequest req,
                                       javax.servlet.http.HttpServletResponse res)
                                throws java.io.IOException
Handle the session initialization.

determineDestination

protected java.lang.String determineDestination(javax.servlet.http.HttpServletRequest req)
Figure out what the real destination is. Check the override destination first to see if they wanted to send it somewhere that was not a request parameter. If they don't have either of those items (attribute or req parm) then if they are logged in, send them to homepage otherwise send them to the default destination.
Parameters:
the - request
Returns:
the destination.

appendParameters

protected void appendParameters(java.lang.String key,
                                java.lang.String[] values,
                                java.lang.StringBuffer sb)
Help creating the request query string, if we need to redirect the destination. We would redirect the destination if the destination contained a query string.
Parameters:
the - key.
the - associated values to the key.
the - buffer to continue filling.

redirect

protected void redirect(javax.servlet.http.HttpServletRequest req,
                        javax.servlet.http.HttpServletResponse res,
                        java.lang.String aDestination)
                 throws java.io.IOException
If the destination contains a '?' (for parms). If this is true we need to redirect the request (and all parameters) to the traffic cop without the destination containing a query.
Parameters:
the - request.
the - response.
the - destination with a query string.

validDestination

protected boolean validDestination(java.lang.String aDestination)
                            throws java.io.IOException
Check if the destination is valid. This is primarily a security check. They may have tried to beat the directory structures by using relative paths. NOTE: this method does not check to see if the file exists.
Parameters:
the - destination.
Returns:
true if it is valid.

startTx

protected javax.jts.UserTransaction startTx()
Start tx.
Returns:
UserTransaction

finishTx

protected void finishTx(javax.jts.UserTransaction tx,
                        javax.servlet.http.HttpServletRequest req)
Finish tx.
Parameters:
tx -  
req -  

handleAttributes

protected java.lang.String handleAttributes(javax.servlet.http.HttpServletRequest req,
                                            java.lang.String aDestination)
                                     throws java.rmi.RemoteException,
                                            PortalObjectNotFoundException,
                                            PortalFinderException,
                                            PortalCreateException,
                                            PortalException
Handle attributes.
Parameters:
req -  
aDestination -  
Returns:
String if it is suspended this will be the suspended url.
Throws:
RemoteException -  
PortalObjectNotFoundException -  
PortalFinderException -  
PortalCreateException -  
PortalException -  

service

public void service(javax.servlet.http.HttpServletRequest req,
                    javax.servlet.http.HttpServletResponse res)
             throws java.io.IOException,
                    javax.servlet.ServletException
Implements the service method of the servlet.
Overrides:
service in class javax.servlet.http.HttpServlet

BEA Systems, Inc.

Copyright © 2000 BEA Systems, Inc. All Rights Reserved