org.apache.jetspeed.util.template
Interface JetspeedLink

All Known Implementing Classes:
BaseJetspeedLink

public interface JetspeedLink

A customized version of the TemplateLink which can handle portlet references.

It is inserted into the template context by Turbine, via request tools.

Each portlet must call setPortlet(this) on it before entering the template rendering code. This is done currently in VelocityPortlet.

Version:
$Id: JetspeedLink.java,v 1.15 2004/03/11 03:08:53 paulsp Exp $
Author:
Paul Spencer

Field Summary
static int CURRENT
           
static int DEFAULT
           
static int GROUP
           
static int PANE_ID
           
static int PANE_NAME
           
static int PORTLET_ID
           
static int PORTLET_ID_QUERY
           
static int PORTLET_NAME
           
static int ROLE
           
static int USER
           
 
Method Summary
 org.apache.turbine.util.DynamicURI addPathInfo(java.lang.String name, java.lang.Object value)
          Adds a name=value pair to the path_info string.
 org.apache.turbine.util.DynamicURI addQueryData(java.lang.String name, java.lang.Object value)
          Adds a name=value pair to the query string.
 org.apache.turbine.util.DynamicURI getAction(java.lang.String action)
          Return a link that includes an action
 org.apache.turbine.util.DynamicURI getAction(java.lang.String action, Entry entry)
          Return a link that includes an action to a specific portlet, as defined by an entry
 org.apache.turbine.util.DynamicURI getAction(java.lang.String action, Portlet portlet)
          Return a link that includes an action to a specific portlet, as defined by a portlet
 org.apache.turbine.util.DynamicURI getAction(java.lang.String action, Portlets portlet)
          Return a link that includes an action to a specific portlet, as defined by a portlets
 org.apache.turbine.util.DynamicURI getAction(java.lang.String action, java.lang.String peid)
          Return a link that includes an action to a specific portlet, as defined by a PEID
 java.lang.String getActionKey()
          Return the action key.
 boolean getAnonymous()
          Is the PSML for the anonymous user?
 java.lang.String getCountry()
          Return country of the PSML file
 org.apache.turbine.util.DynamicURI getGroup(java.lang.String group)
          Return a link to a default page for the group
 org.apache.turbine.util.DynamicURI getGroup(java.lang.String group, java.lang.String page)
          Return a link to a desired page for the group
 java.lang.String getGroupName()
          Return Group name of the PSML file
 org.apache.turbine.util.DynamicURI getHomePage()
          Return link to the home page without user, page, group, role, template, action, media type, language, or country in link.
 java.lang.String getLanguage()
          Return Language of the PSML file
 org.apache.turbine.util.DynamicURI getLink(int rootType, java.lang.String rootValue, java.lang.String pageName, int elementType, java.lang.String elementValue)
           
 org.apache.turbine.util.DynamicURI getLink(int rootType, java.lang.String rootValue, java.lang.String pageName, int elementType, java.lang.String elementValue, java.lang.String actionName)
           
 org.apache.turbine.util.DynamicURI getLink(int rootType, java.lang.String rootValue, java.lang.String pageName, int elementType, java.lang.String elementValue, java.lang.String actionName, java.lang.String templateName)
           
 org.apache.turbine.util.DynamicURI getLink(int rootType, java.lang.String rootValue, java.lang.String pageName, int elementType, java.lang.String elementValue, java.lang.String actionName, java.lang.String templateName, java.lang.String mediaType)
           
 org.apache.turbine.util.DynamicURI getLink(int rootType, java.lang.String rootValue, java.lang.String pageName, int elementType, java.lang.String elementValue, java.lang.String actionName, java.lang.String templateName, java.lang.String mediaType, java.lang.String language)
           
 org.apache.turbine.util.DynamicURI getLink(int rootType, java.lang.String rootValue, java.lang.String pageName, int elementType, java.lang.String elementValue, java.lang.String actionName, java.lang.String templateName, java.lang.String mediaType, java.lang.String language, java.lang.String country)
          Return a link to a desired page.
 java.lang.String getMediaType()
          Return Media Type of the PSML file
 org.apache.turbine.util.DynamicURI getPage()
          Return a link to a default page for the current user, group, or role.
 org.apache.turbine.util.DynamicURI getPage(java.lang.String page)
          Return a link to a desired page for the current user, group, or role.
 org.apache.turbine.util.DynamicURI getPage(java.lang.String page, java.lang.String paneName)
          Return a link to a desired page and pane for the current user, group, or role.
 java.lang.String getPageName()
          Return Page name of the PSML file
 org.apache.turbine.util.DynamicURI getPaneById(java.lang.String paneId)
          Return a link to a specific pane using the pane's id
 org.apache.turbine.util.DynamicURI getPaneByName(java.lang.String paneName)
          Return a link to a specific pane using the pane's id
 org.apache.turbine.util.DynamicURI getPortletById(java.lang.String peid)
          Return an link to a specific portlet using the portet's id
 org.apache.turbine.util.DynamicURI getPortletByName(java.lang.String portletName)
          Deprecated. Use getPortletById()
 org.apache.turbine.util.DynamicURI getRole(java.lang.String role)
          Return a link to a default page for the role
 org.apache.turbine.util.DynamicURI getRole(java.lang.String role, java.lang.String page)
          Return a link to a desired page for the role
 java.lang.String getRoleName()
          Return Role name of the PSML file
 org.apache.turbine.util.DynamicURI getTemplate()
          Return a link that includes the template from rundata
 org.apache.turbine.util.DynamicURI getTemplate(java.lang.String template)
          Return a link to the template.
 org.apache.turbine.util.DynamicURI getUser(java.lang.String user)
          Return a link to a default page for the user
 org.apache.turbine.util.DynamicURI getUser(java.lang.String user, java.lang.String page)
          Return a link to a desired page for the user
 java.lang.String getUserName()
          Return User name of the PSML file
 void init(org.apache.turbine.util.RunData rundata)
          This will initialise a JetspeedLink object that was constructed with the default constructor
 org.apache.turbine.util.DynamicURI setAction(java.lang.String action)
          Deprecated. Use getAction()
 org.apache.turbine.util.DynamicURI setAction(java.lang.String action, Entry entry)
          Deprecated. use getAction()
 org.apache.turbine.util.DynamicURI setAction(java.lang.String action, Portlet portlet)
          Deprecated. use getAction()
 org.apache.turbine.util.DynamicURI setAction(java.lang.String action, Portlets portlet)
          Deprecated. use getAction()
 org.apache.turbine.util.DynamicURI setGroup(java.lang.String group)
          Deprecated. use getGroup()
 org.apache.turbine.util.DynamicURI setGroup(java.lang.String group, java.lang.String page)
          Deprecated. use getGroup()
 org.apache.turbine.util.DynamicURI setMediaType(java.lang.String mediaType)
           
 org.apache.turbine.util.DynamicURI setPage()
          Deprecated. use getPage()
 org.apache.turbine.util.DynamicURI setPage(java.lang.String page)
          Deprecated. use getPage()
 org.apache.turbine.util.DynamicURI setPage(java.lang.String page, java.lang.String paneName)
          Deprecated. use getPage()
 org.apache.turbine.util.DynamicURI setPaneById(java.lang.String paneId)
          Deprecated. Use getPaneById()
 org.apache.turbine.util.DynamicURI setPortalElement(java.lang.String peid)
          Deprecated. use getPortletById or getPaneById()
 void setPortlet(Portlet portlet)
          Deprecated. Use getLink() or getAction() or getPortletById() or getPortletByName().
 org.apache.turbine.util.DynamicURI setPortletById(java.lang.String peid)
          Deprecated. use getPortletById()
 org.apache.turbine.util.DynamicURI setPortletByName(java.lang.String portletName)
          Deprecated. use getPortletByName()
 org.apache.turbine.util.DynamicURI setRole(java.lang.String role)
          Deprecated. use getRole()
 org.apache.turbine.util.DynamicURI setRole(java.lang.String role, java.lang.String page)
          Deprecated. use getRole()
 org.apache.turbine.util.DynamicURI setTemplate(java.lang.String template)
          Deprecated. use getTemplate()
 org.apache.turbine.util.DynamicURI setUser(java.lang.String user)
          Deprecated. use getUser()
 org.apache.turbine.util.DynamicURI setUser(java.lang.String user, java.lang.String page)
          Deprecated. use getUser()
 java.lang.String toString()
          Return a URL, as a string, the the root page or pane.
 

Field Detail

CURRENT

public static final int CURRENT
See Also:
Constant Field Values

DEFAULT

public static final int DEFAULT
See Also:
Constant Field Values

GROUP

public static final int GROUP
See Also:
Constant Field Values

ROLE

public static final int ROLE
See Also:
Constant Field Values

USER

public static final int USER
See Also:
Constant Field Values

PANE_ID

public static final int PANE_ID
See Also:
Constant Field Values

PANE_NAME

public static final int PANE_NAME
See Also:
Constant Field Values

PORTLET_ID

public static final int PORTLET_ID
See Also:
Constant Field Values

PORTLET_NAME

public static final int PORTLET_NAME
See Also:
Constant Field Values

PORTLET_ID_QUERY

public static final int PORTLET_ID_QUERY
See Also:
Constant Field Values
Method Detail

addPathInfo

public org.apache.turbine.util.DynamicURI addPathInfo(java.lang.String name,
                                                      java.lang.Object value)
Adds a name=value pair to the path_info string.

Parameters:
name - A String with the name to add.
value - An Object with the value to add.
Returns:
DynamicURI that to the desired page

addQueryData

public org.apache.turbine.util.DynamicURI addQueryData(java.lang.String name,
                                                       java.lang.Object value)
Adds a name=value pair to the query string.

Parameters:
name - A String with the name to add.
value - An Object with the value to add.
Returns:
DynamicURI that to the desired page

getActionKey

public java.lang.String getActionKey()
Return the action key. Used by velocity templates, i.e. $jlink.ActionKey

Returns:
the action parameter name

getHomePage

public org.apache.turbine.util.DynamicURI getHomePage()
Return link to the home page without user, page, group, role, template, action, media type, language, or country in link.

Returns:
DynamicURI to the home page

init

public void init(org.apache.turbine.util.RunData rundata)
This will initialise a JetspeedLink object that was constructed with the default constructor

Parameters:
rundata - to be a RunData object

getTemplate

public org.apache.turbine.util.DynamicURI getTemplate()
Return a link that includes the template from rundata

Returns:
DynamicURI to template

getAnonymous

public boolean getAnonymous()
Is the PSML for the anonymous user?

Returns:
True = PSML is for the anonymous user

getCountry

public java.lang.String getCountry()
Return country of the PSML file

Returns:
Country of PSML, or null if no country

getGroupName

public java.lang.String getGroupName()
Return Group name of the PSML file

Returns:
Group name of PSML, or null if no Group name

getLanguage

public java.lang.String getLanguage()
Return Language of the PSML file

Returns:
Language of PSML, or null if no Language

getMediaType

public java.lang.String getMediaType()
Return Media Type of the PSML file

Returns:
Media Type of PSML, or null if no Media Type

getPageName

public java.lang.String getPageName()
Return Page name of the PSML file

Returns:
Page name of PSML, or null if no Page name

getRoleName

public java.lang.String getRoleName()
Return Role name of the PSML file

Returns:
Role name of PSML, or null if no Role name

getUserName

public java.lang.String getUserName()
Return User name of the PSML file

Returns:
User name of PSML, or null if no User name

getAction

public org.apache.turbine.util.DynamicURI getAction(java.lang.String action)
Return a link that includes an action

Parameters:
action - action
Returns:
DynamicURI that includes the desire action

getAction

public org.apache.turbine.util.DynamicURI getAction(java.lang.String action,
                                                    Entry entry)
Return a link that includes an action to a specific portlet, as defined by an entry

Parameters:
action - Desired action
entry - to receive the action
Returns:
DynamicURI that includes the desire action

getAction

public org.apache.turbine.util.DynamicURI getAction(java.lang.String action,
                                                    Portlet portlet)
Return a link that includes an action to a specific portlet, as defined by a portlet

Parameters:
action - Desired action
portlet - to receive the action
Returns:
DynamicURI that includes the desire action

getAction

public org.apache.turbine.util.DynamicURI getAction(java.lang.String action,
                                                    Portlets portlet)
Return a link that includes an action to a specific portlet, as defined by a portlets

Parameters:
action - Desired action
portlet - to receive the action
Returns:
DynamicURI that includes the desire action

getAction

public org.apache.turbine.util.DynamicURI getAction(java.lang.String action,
                                                    java.lang.String peid)
Return a link that includes an action to a specific portlet, as defined by a PEID

Parameters:
action - Desired action
peid - Id of portlet to receive the action
Returns:
DynamicURI that includes the desire action

getGroup

public org.apache.turbine.util.DynamicURI getGroup(java.lang.String group)
Return a link to a default page for the group

Parameters:
group - Desired group
Returns:
DynamicURI that to the desired page

getGroup

public org.apache.turbine.util.DynamicURI getGroup(java.lang.String group,
                                                   java.lang.String page)
Return a link to a desired page for the group

Parameters:
page - Desired page
group - Desired group
Returns:
DynamicURI that to the desired page

getPage

public org.apache.turbine.util.DynamicURI getPage()
Return a link to a default page for the current user, group, or role.

Returns:
DynamicURI that to the desired page

getPage

public org.apache.turbine.util.DynamicURI getPage(java.lang.String page)
Return a link to a desired page for the current user, group, or role.

Parameters:
page - Desired page
Returns:
DynamicURI that to the desired page

getPage

public org.apache.turbine.util.DynamicURI getPage(java.lang.String page,
                                                  java.lang.String paneName)
Return a link to a desired page and pane for the current user, group, or role.

Parameters:
page - Desired page
paneName - Name of desired pane
Returns:
DynamicURI that to the desired page

getPortletById

public org.apache.turbine.util.DynamicURI getPortletById(java.lang.String peid)
Return an link to a specific portlet using the portet's id

Parameters:
peid - of the portlet
Returns:
DynamicURI to specific portlet

getPortletByName

public org.apache.turbine.util.DynamicURI getPortletByName(java.lang.String portletName)
Deprecated. Use getPortletById()

Add a portlet reference in the link. Note: This must be used with caution, since a portlet may exist may times in a PSML. setPortletById() is the perfered method.

Parameters:
portletName - the name of the portlet to link to
Returns:
a DynamicURI referencing the named portlet for easy link construction in template

getRole

public org.apache.turbine.util.DynamicURI getRole(java.lang.String role)
Return a link to a default page for the role

Parameters:
role - Desired role
Returns:
DynamicURI that to the desired page

getRole

public org.apache.turbine.util.DynamicURI getRole(java.lang.String role,
                                                  java.lang.String page)
Return a link to a desired page for the role

Parameters:
role - Desired role
page - Desired page
Returns:
DynamicURI that to the desired page

getTemplate

public org.apache.turbine.util.DynamicURI getTemplate(java.lang.String template)
Return a link to the template.

Parameters:
template - to add to link
Returns:
DynamicURI to specific portlet

getUser

public org.apache.turbine.util.DynamicURI getUser(java.lang.String user)
Return a link to a default page for the user

Parameters:
user - Desired user
Returns:
DynamicURI that to the desired page

getUser

public org.apache.turbine.util.DynamicURI getUser(java.lang.String user,
                                                  java.lang.String page)
Return a link to a desired page for the user

Parameters:
page - Desired page
user - Desired user
Returns:
DynamicURI that to the desired page

setAction

public org.apache.turbine.util.DynamicURI setAction(java.lang.String action)
Deprecated. Use getAction()

Return a link that includes an action

Parameters:
action - action
Returns:
DynamicURI that includes the desire action

setAction

public org.apache.turbine.util.DynamicURI setAction(java.lang.String action,
                                                    Entry entry)
Deprecated. use getAction()

Return a link that includes an action to a specific portlet, as defined by an entry

Parameters:
action - Desired action
entry - to receive the action
Returns:
DynamicURI that includes the desire action

setAction

public org.apache.turbine.util.DynamicURI setAction(java.lang.String action,
                                                    Portlet portlet)
Deprecated. use getAction()

Return a link that includes an action to a specific portlet, as defined by a portlet

Parameters:
action - Desired action
portlet - to receive the action
Returns:
DynamicURI that includes the desire action

setAction

public org.apache.turbine.util.DynamicURI setAction(java.lang.String action,
                                                    Portlets portlet)
Deprecated. use getAction()

Return a link that includes an action to a specific portlet, as defined by a portlets

Parameters:
action - Desired action
portlet - to receive the action
Returns:
DynamicURI that includes the desire action

setGroup

public org.apache.turbine.util.DynamicURI setGroup(java.lang.String group)
Deprecated. use getGroup()

Return a link to a default page for the group

Parameters:
group - Desired group
Returns:
DynamicURI that to the desired page

setGroup

public org.apache.turbine.util.DynamicURI setGroup(java.lang.String group,
                                                   java.lang.String page)
Deprecated. use getGroup()

Return a link to a desired page for the group

Parameters:
page - Desired page
group - Desired group
Returns:
DynamicURI that to the desired page

setPage

public org.apache.turbine.util.DynamicURI setPage()
Deprecated. use getPage()

Return a link to a default page for the current user, group, or role.

Returns:
DynamicURI that to the desired page

setPage

public org.apache.turbine.util.DynamicURI setPage(java.lang.String page)
Deprecated. use getPage()

Return a link to a desired page for the current user, group, or role.

Parameters:
page - Desired page
Returns:
DynamicURI that to the desired page

setPage

public org.apache.turbine.util.DynamicURI setPage(java.lang.String page,
                                                  java.lang.String paneName)
Deprecated. use getPage()

Return a link to a desired page and pane for the current user, group, or role.

Parameters:
page - Desired page
paneName - Name of desired pane
Returns:
DynamicURI that to the desired page

setMediaType

public org.apache.turbine.util.DynamicURI setMediaType(java.lang.String mediaType)

setPortletById

public org.apache.turbine.util.DynamicURI setPortletById(java.lang.String peid)
Deprecated. use getPortletById()

Return an link to a specific portlet using the portet's id

Parameters:
peid - of the portlet
Returns:
DynamicURI to specific portlet

setPortalElement

public org.apache.turbine.util.DynamicURI setPortalElement(java.lang.String peid)
Deprecated. use getPortletById or getPaneById()

Return an link to a specific portal element

Parameters:
peid - of the portal element
Returns:
DynamicURI to specific portal element

setPortletByName

public org.apache.turbine.util.DynamicURI setPortletByName(java.lang.String portletName)
Deprecated. use getPortletByName()

Add a portlet reference in the link. Note: This must be used with caution, since a portlet may exist may times in a PSML. setPortletById() is the perfered method.

Parameters:
portletName - the name of the portlet to link to
Returns:
a DynamicURI referencing the named portlet for easy link construction in template

setRole

public org.apache.turbine.util.DynamicURI setRole(java.lang.String role)
Deprecated. use getRole()

Return a link to a default page for the role

Parameters:
role - Desired role
Returns:
DynamicURI that to the desired page

setRole

public org.apache.turbine.util.DynamicURI setRole(java.lang.String role,
                                                  java.lang.String page)
Deprecated. use getRole()

Return a link to a desired page for the role

Parameters:
role - Desired role
page - Desired page
Returns:
DynamicURI that to the desired page

setTemplate

public org.apache.turbine.util.DynamicURI setTemplate(java.lang.String template)
Deprecated. use getTemplate()

Return a link to the template.

Parameters:
template - to add to link
Returns:
DynamicURI to specific portlet

setUser

public org.apache.turbine.util.DynamicURI setUser(java.lang.String user)
Deprecated. use getUser()

Return a link to a default page for the user

Parameters:
user - Desired user
Returns:
DynamicURI that to the desired page

setUser

public org.apache.turbine.util.DynamicURI setUser(java.lang.String user,
                                                  java.lang.String page)
Deprecated. use getUser()

Return a link to a desired page for the user

Parameters:
page - Desired page
user - Desired user
Returns:
DynamicURI that to the desired page

toString

public java.lang.String toString()
Return a URL, as a string, the the root page or pane.

Returns:
a URL, as a string, the the root page or pane.

setPaneById

public org.apache.turbine.util.DynamicURI setPaneById(java.lang.String paneId)
Deprecated. Use getPaneById()

Return a link to a specific pane using the pane's id

Parameters:
paneId - of the Pane
Returns:
URI to specific portlet

getPaneById

public org.apache.turbine.util.DynamicURI getPaneById(java.lang.String paneId)
Return a link to a specific pane using the pane's id

Parameters:
paneId - of the Pane
Returns:
URI to specific portlet

getPaneByName

public org.apache.turbine.util.DynamicURI getPaneByName(java.lang.String paneName)
Return a link to a specific pane using the pane's id

Parameters:
paneName - Name of the Pane
Returns:
URI to specific portlet

setPortlet

public void setPortlet(Portlet portlet)
Deprecated. Use getLink() or getAction() or getPortletById() or getPortletByName().

Set the portlet giving context to this Link object.

This method is from JetspeedTemplateLink and is only here for backward compatibility. This it should not be used for any new development. Also any problems with this method will not be fixed

Parameters:
portlet - the name of the active portlet

getLink

public org.apache.turbine.util.DynamicURI getLink(int rootType,
                                                  java.lang.String rootValue,
                                                  java.lang.String pageName,
                                                  int elementType,
                                                  java.lang.String elementValue,
                                                  java.lang.String actionName,
                                                  java.lang.String templateName,
                                                  java.lang.String mediaType,
                                                  java.lang.String language,
                                                  java.lang.String country)
Return a link to a desired page. This is allows the inclusion of a Group/Role/User, page, template, action, media type, language, and country.

Parameters:
rootType - Type of root PSML docuument. The should be one of the following:
JetspeedLink.CURRENT
The link will retain the current Group/Role/User referance. rootValue is not used
JetspeedLink.DEFAULT
Default Group, Role, or User. rootValue is not used
JetspeedLink.GROUP
Link will be to a Group PSML. rootValue is a Group Name
JetspeedLink.ROLE
Link will be to a Role PSML. rootValue is a Role Name
JetspeedLink.USER
Link will be to a User PSML. rootValue is a User Name
rootValue - See description of rootType
pageName - Name of page. null = default page
elementType -
JetspeedLink.CURRENT
The link will retain the current Pane/Portlet referance. elementValue is not used
JetspeedLink.DEFAULT
The link will NOT referance a pane or portlet. elementValue is not used
JetspeedLink.PANE_ID
Link will be to a Pane using it's ID. elementValue is a Pane's ID
JetspeedLink.PANE_NAME
Link will be to a Pane using it's Name. elementValue is a Pane's Name
JetspeedLink.PORTLET_ID
Link will be to a Portlet using it's ID. elementValue is a Portlet's ID
JetspeedLink.PORTLET_NAME
Link will be to a Portlet using it's Name. elementValue is a Portlet's Name
elementValue - See description of elementType
actionName - Name of action. If no action is desired use JetspeedLink.NO_ACTION.
templateName - Name of template. If no template is desired use JetspeedLink.NO_TEMPLATE.
mediaType - Desired media type. null = default media type
language - Desired language. null = default language
country - Desired country. null = default language
Returns:
URI to specific portlet

getLink

public org.apache.turbine.util.DynamicURI getLink(int rootType,
                                                  java.lang.String rootValue,
                                                  java.lang.String pageName,
                                                  int elementType,
                                                  java.lang.String elementValue,
                                                  java.lang.String actionName,
                                                  java.lang.String templateName,
                                                  java.lang.String mediaType,
                                                  java.lang.String language)
See Also:
org.apache.jetspeed.util.template.JetspeedLink.getLink( int, String, String, int, String, String, String, String, String, String

getLink

public org.apache.turbine.util.DynamicURI getLink(int rootType,
                                                  java.lang.String rootValue,
                                                  java.lang.String pageName,
                                                  int elementType,
                                                  java.lang.String elementValue,
                                                  java.lang.String actionName,
                                                  java.lang.String templateName,
                                                  java.lang.String mediaType)

getLink

public org.apache.turbine.util.DynamicURI getLink(int rootType,
                                                  java.lang.String rootValue,
                                                  java.lang.String pageName,
                                                  int elementType,
                                                  java.lang.String elementValue,
                                                  java.lang.String actionName,
                                                  java.lang.String templateName)

getLink

public org.apache.turbine.util.DynamicURI getLink(int rootType,
                                                  java.lang.String rootValue,
                                                  java.lang.String pageName,
                                                  int elementType,
                                                  java.lang.String elementValue,
                                                  java.lang.String actionName)

getLink

public org.apache.turbine.util.DynamicURI getLink(int rootType,
                                                  java.lang.String rootValue,
                                                  java.lang.String pageName,
                                                  int elementType,
                                                  java.lang.String elementValue)


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