org.apache.jetspeed.util
Class URILookup

java.lang.Object
  extended byorg.apache.jetspeed.util.URILookup

public class URILookup
extends java.lang.Object

URI lookup related functions.

Functions to get an URI based on a type like info, edit, save and to identify the type of an URI.

To overwrite the default behaviour, specify one of the following parameters in the JR.p file. URILookup will then return the uri specified in the properties file.

all possible property parameters:

Version:
$Id: URILookup.java,v 1.24 2004/02/23 03:23:42 jford Exp $
Author:
Stephan Hesmer, Santiago Gala

Field Summary
static int SUBTYPE_ACCEPT_LOGIN
          trues to login, after entering username and password
static int SUBTYPE_LOGOUT
          logs out the user
static int SUBTYPE_MARK
          mark the current page before processing portlet
static int SUBTYPE_MAXIMIZE
          show the current portlet maximized
additionally, the current page is marked for restoring
static int SUBTYPE_NONE
          apply no subtype to the url
static int SUBTYPE_RESTORE
          restore portlet to default size
static int SUBTYPE_SAVE
          save user settings before processing portlet
static int TYPE_BACK
          show the marked page
only used in function getURI, not in getURIType
static int TYPE_CUSTOMIZE
          show portlet customization
static int TYPE_EDIT_ACCOUNT
          show the edit page of the account
static int TYPE_ENROLLMENT
          creates new account
allowed Subtypes:
SUBTYPE_NONE
static int TYPE_HOME
          show Jetspeed Home page
allowed Subtypes:
SUBTYPE_NONE SUBTYPE_RESTORE SUBTYPE_MAXIMIZE SUBTYPE_LOGOUT SUBTYPE_ACCEPT_LOGIN
static int TYPE_INFO
          show some additional information about the portlet
static int TYPE_LOGIN
          show login screen
 
Constructor Summary
URILookup()
           
 
Method Summary
static PortletEntry getEntry(org.apache.turbine.util.ParameterParser params)
           Given a ParameterParser, get a PortletEntry.
static java.lang.String getMarkedPage(org.apache.turbine.util.RunData rundata)
          Gets the previous marked page as relative url.
If no page was marked, the Jetspeed Home page is returned.
static java.lang.String getMarkedPage(org.apache.turbine.util.RunData rundata, boolean relative)
          Gets the previous marked page.
If no page was marked, the Jetspeed Home page is returned.
static java.lang.String getURI(int aType, int aSubType, Portlet aPortlet, org.apache.turbine.util.RunData rundata)
          Gets the URI of the specified portlet with the specified type
static java.lang.String getURI(int aType, int aSubType, org.apache.turbine.util.RunData rundata)
          Gets the URI for the specified type
static java.lang.String getURI(int aType, int aSubType, java.lang.String userData, Portlet aPortlet, org.apache.turbine.util.RunData rundata)
          Gets the URI of the specified portlet with the specified type and adds given user data.
static java.lang.String getURI(int aType, int aSubType, java.lang.String aPortletName, org.apache.turbine.util.RunData rundata)
          Gets the URI of the specified portlet with the specified type
static java.lang.String getURI(int aType, int aSubType, java.lang.String userData, java.lang.String aPortletName, org.apache.turbine.util.RunData rundata)
          Gets the URI of the specified portlet with the specified type and adds given user data.
static int getURISubType(Portlet aPortlet, org.apache.turbine.util.RunData rundata)
          Gets the subtype of the URI (e.g.
static int getURIType(Portlet aPortlet, org.apache.turbine.util.RunData rundata)
          Gets the type of the URI (e.g.
static int getURIType(org.apache.turbine.util.RunData rundata)
          Gets the type of the URI (e.g.
static java.lang.String getURIUserData(org.apache.turbine.util.RunData rundata)
          Gets the user specific data stored in the URI.
static java.lang.String getWebAppBaseDirURI(org.apache.turbine.util.RunData rundata)
          returns the WebApplication base directory.
static void markCurrentPage(org.apache.turbine.util.RunData rundata)
          Marks the current URI and stores it internally for later usage.
static void markPage(java.lang.String aURI, org.apache.turbine.util.RunData rundata)
          Marks the URI and stores it internally for later usage.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_HOME

public static final int TYPE_HOME

show Jetspeed Home page
allowed Subtypes:

See Also:
Constant Field Values

TYPE_INFO

public static final int TYPE_INFO

show some additional information about the portlet

allowed Subtypes:

See Also:
Constant Field Values

TYPE_EDIT_ACCOUNT

public static final int TYPE_EDIT_ACCOUNT

show the edit page of the account

allowed Subtypes:

See Also:
Constant Field Values

TYPE_CUSTOMIZE

public static final int TYPE_CUSTOMIZE

show portlet customization

allowed Subtypes:

See Also:
Constant Field Values

TYPE_LOGIN

public static final int TYPE_LOGIN

show login screen

allowed Subtypes:

See Also:
Constant Field Values

TYPE_BACK

public static final int TYPE_BACK

show the marked page
only used in function getURI, not in getURIType

allowed Subtypes:

See Also:
Constant Field Values

TYPE_ENROLLMENT

public static final int TYPE_ENROLLMENT

creates new account
allowed Subtypes:

See Also:
Constant Field Values

SUBTYPE_NONE

public static final int SUBTYPE_NONE
apply no subtype to the url

See Also:
Constant Field Values

SUBTYPE_RESTORE

public static final int SUBTYPE_RESTORE
restore portlet to default size

See Also:
Constant Field Values

SUBTYPE_MAXIMIZE

public static final int SUBTYPE_MAXIMIZE
show the current portlet maximized
additionally, the current page is marked for restoring

See Also:
Constant Field Values

SUBTYPE_MARK

public static final int SUBTYPE_MARK
mark the current page before processing portlet

See Also:
Constant Field Values

SUBTYPE_LOGOUT

public static final int SUBTYPE_LOGOUT
logs out the user

See Also:
Constant Field Values

SUBTYPE_ACCEPT_LOGIN

public static final int SUBTYPE_ACCEPT_LOGIN
trues to login, after entering username and password

See Also:
Constant Field Values

SUBTYPE_SAVE

public static final int SUBTYPE_SAVE
save user settings before processing portlet

See Also:
Constant Field Values
Constructor Detail

URILookup

public URILookup()
Method Detail

getURI

public static java.lang.String getURI(int aType,
                                      int aSubType,
                                      org.apache.turbine.util.RunData rundata)
                               throws JetspeedException
Gets the URI for the specified type

Parameters:
aType - type of the URI
aSubType - subtype of the URI
rundata - the RunData object
Returns:
the URI
Throws:
JetspeedException

getURI

public static java.lang.String getURI(int aType,
                                      int aSubType,
                                      Portlet aPortlet,
                                      org.apache.turbine.util.RunData rundata)
                               throws JetspeedException
Gets the URI of the specified portlet with the specified type

Parameters:
aType - type of the URI
aSubType - subtype of the URI
aPortlet - Portlet the URI points to
rundata - the RunData object
Returns:
the URI
Throws:
JetspeedException

getURI

public static java.lang.String getURI(int aType,
                                      int aSubType,
                                      java.lang.String aPortletName,
                                      org.apache.turbine.util.RunData rundata)
                               throws JetspeedException
Gets the URI of the specified portlet with the specified type

Parameters:
aType - type of the URI
aSubType - subtype of the URI
aPortletName - Portlet the URI points to
rundata - the RunData object
Returns:
the URI
Throws:
JetspeedException

getURI

public static java.lang.String getURI(int aType,
                                      int aSubType,
                                      java.lang.String userData,
                                      Portlet aPortlet,
                                      org.apache.turbine.util.RunData rundata)
                               throws JetspeedException
Gets the URI of the specified portlet with the specified type and adds given user data.

Parameters:
aType - type of the URI
aSubType - subtype of the URI
userData - string which should be added to the URL
aPortlet - Portlet the URI points to
rundata - the RunData object
Returns:
the URI
Throws:
JetspeedException

getURI

public static java.lang.String getURI(int aType,
                                      int aSubType,
                                      java.lang.String userData,
                                      java.lang.String aPortletName,
                                      org.apache.turbine.util.RunData rundata)
                               throws JetspeedException
Gets the URI of the specified portlet with the specified type and adds given user data.

Parameters:
aType - type of the URI
aSubType - subtype of the URI
userData - string which should be added to the URL
aPortletName - Portlet the URI points to
rundata - the RunData object
Returns:
the URI
Throws:
JetspeedException

getURIType

public static int getURIType(org.apache.turbine.util.RunData rundata)
Gets the type of the URI (e.g. TYPE_INFO, TYPE_EDIT).

Parameters:
rundata - the RunData object
Returns:
the type

getURIType

public static int getURIType(Portlet aPortlet,
                             org.apache.turbine.util.RunData rundata)
Gets the type of the URI (e.g. TYPE_INFO, TYPE_EDIT). The default return value is TYPE_HOME

Hint:
Portlets should check for TYPE_EDIT_PORTLET and in any other case render the content

Parameters:
aPortlet - the associated portlet
rundata - the RunData object
Returns:
the type

getURISubType

public static int getURISubType(Portlet aPortlet,
                                org.apache.turbine.util.RunData rundata)
                         throws JetspeedException

Gets the subtype of the URI (e.g. SUBTYPE_SAVE).

returns only the values

Parameters:
aPortlet - the related portlet
rundata - the RunData object
Returns:
the type
Throws:
JetspeedException

getURIUserData

public static java.lang.String getURIUserData(org.apache.turbine.util.RunData rundata)
Gets the user specific data stored in the URI.

Parameters:
rundata - the RunData object
Returns:
the previous added user data
See Also:
getURI(int, int, org.apache.turbine.util.RunData)

getWebAppBaseDirURI

public static java.lang.String getWebAppBaseDirURI(org.apache.turbine.util.RunData rundata)
returns the WebApplication base directory.

Parameters:
rundata - the rundata object
Returns:
the URI

markCurrentPage

public static void markCurrentPage(org.apache.turbine.util.RunData rundata)
Marks the current URI and stores it internally for later usage.

Parameters:
rundata - the RunData object

markPage

public static void markPage(java.lang.String aURI,
                            org.apache.turbine.util.RunData rundata)
Marks the URI and stores it internally for later usage.

Parameters:
aURI - the URI to store
rundata - the RunData object

getMarkedPage

public static java.lang.String getMarkedPage(org.apache.turbine.util.RunData rundata)
Gets the previous marked page as relative url.
If no page was marked, the Jetspeed Home page is returned.

Returns:
the marked page URI

getMarkedPage

public static java.lang.String getMarkedPage(org.apache.turbine.util.RunData rundata,
                                             boolean relative)
Gets the previous marked page.
If no page was marked, the Jetspeed Home page is returned.

Parameters:
relative - specifies whether the returing URI should be relative
Returns:
the marked page URI

getEntry

public static final PortletEntry getEntry(org.apache.turbine.util.ParameterParser params)
                                   throws java.lang.Exception

Given a ParameterParser, get a PortletEntry. This is used so that when you have a URI created from PortletURIManager you can get back the PortletEntry that created it originally.

Return null if we aren't able to figure out the PortletEntry

Throws:
java.lang.Exception


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