Package org.sakaiproject.vm
Class ActionURL
- java.lang.Object
-
- org.sakaiproject.vm.ActionURL
-
public class ActionURL extends Object
PortletActionURL provides a URL with settable and re-settable parameters based on a portlet window's ActionURL base URL.
-
-
Field Summary
Fields Modifier and Type Field Description protected Stringm_baseThe base url to the portlet.protected booleanm_isActionIs this an Action URLprotected Stringm_pageThe site pge, if any.protected Stringm_panelThe panel, if any.protected Mapm_parametersparameters.protected Stringm_pidThe portlet window id, if any.protected Stringm_QueryStringPre-formatted query string, in lieu ofparameters protected HttpServletRequestm_requestHttpServletRequest *protected Stringm_resourcePathIs this a Resource URLprotected Stringm_siteThe site, if any.static StringPARAM_PAGEThe parameter for page.static StringPARAM_PANELThe parameter for paneld.static StringPARAM_PIDThe parameter for portlet window id (pid).static StringPARAM_SITEThe parameter for site.
-
Constructor Summary
Constructors Constructor Description ActionURL(String base, HttpServletRequest request)Construct with a base URL to the portlet, no parameters
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)ActionURLreset()"Reset" the URL by clearing the parameters.ActionURLsetAction()Set this URL to be an 'action' URL, one that usually does a Form POSTActionURLsetPage(String page)Set or reset the page.ActionURLsetPanel(String panel)Set or reset the panel.ActionURLsetParameter(String name, String value)Set or replace (or remove if value is null) a parameterActionURLsetPid(String pid)Set or reset the pid.ActionURLsetQueryString(String queryString)ActionURLsetResourcePath(String path)ActionURLsetSite(String site)Set or reset the site.StringtoString()Reneder the URL with parameters
-
-
-
Field Detail
-
PARAM_PID
public static final String PARAM_PID
The parameter for portlet window id (pid).- See Also:
- Constant Field Values
-
PARAM_SITE
public static final String PARAM_SITE
The parameter for site.- See Also:
- Constant Field Values
-
PARAM_PAGE
public static final String PARAM_PAGE
The parameter for page.- See Also:
- Constant Field Values
-
PARAM_PANEL
public static final String PARAM_PANEL
The parameter for paneld.- See Also:
- Constant Field Values
-
m_base
protected String m_base
The base url to the portlet.
-
m_parameters
protected Map m_parameters
parameters.
-
m_pid
protected String m_pid
The portlet window id, if any.
-
m_panel
protected String m_panel
The panel, if any.
-
m_site
protected String m_site
The site, if any.
-
m_page
protected String m_page
The site pge, if any.
-
m_isAction
protected boolean m_isAction
Is this an Action URL
-
m_resourcePath
protected String m_resourcePath
Is this a Resource URL
-
m_QueryString
protected String m_QueryString
Pre-formatted query string, in lieu ofparameters
-
m_request
protected HttpServletRequest m_request
HttpServletRequest *
-
-
Constructor Detail
-
ActionURL
public ActionURL(String base, HttpServletRequest request)
Construct with a base URL to the portlet, no parameters- Parameters:
base- The base URL
-
-
Method Detail
-
reset
public ActionURL reset()
"Reset" the URL by clearing the parameters.- Returns:
- this.
-
setParameter
public ActionURL setParameter(String name, String value)
Set or replace (or remove if value is null) a parameter- Parameters:
name- The parameter name.value- The parameter value.- Returns:
- this.
-
setAction
public ActionURL setAction()
Set this URL to be an 'action' URL, one that usually does a Form POST- Returns:
- this
-
setPid
public ActionURL setPid(String pid)
Set or reset the pid.- Parameters:
pid- The portlet window id.
-
setSite
public ActionURL setSite(String site)
Set or reset the site.- Parameters:
site- The site id.
-
setPage
public ActionURL setPage(String page)
Set or reset the page.- Parameters:
page- The page id.
-
setPanel
public ActionURL setPanel(String panel)
Set or reset the panel.- Parameters:
panel- The panel id.
-
toString
public String toString()
Reneder the URL with parameters
-
setResourcePath
public ActionURL setResourcePath(String path)
- Parameters:
resource- Whether the URL is a resource
-
-