@ApplicationScoped public class URLMarkupGenerator extends Object
Modifier and Type | Field and Description |
---|---|
static String |
COMMAND_RUNNER |
static String |
FRIENDLY_PREFIX |
static String |
PARAM_SEPARATOR |
Constructor and Description |
---|
URLMarkupGenerator() |
Modifier and Type | Method and Description |
---|---|
protected String |
_getServletMapping() |
String |
getAction() |
String |
getBaseHref(javax.servlet.ServletRequest request)
Get the base href for current request
|
String |
getBaseURI()
Mapping to the controller servlet.
|
String |
getContextHost(javax.servlet.ServletRequest request) |
protected Panel |
getCurrentPanel() |
String |
getHandler() |
String |
getLinkToPage(Section page,
boolean allowFriendly)
Get an absolute url that leads to a given page
|
String |
getLinkToPage(Section page,
boolean allowFriendly,
String lang)
Get an absolute url that leads to a given page in a given lang
|
String |
getLinkToPanelAction(Panel panel,
String action,
boolean allowFriendly)
Get an url that leads to a given panel action
|
String |
getLinkToPanelAction(Panel panel,
String action,
String extraParams,
boolean allowFriendly)
Get an url that leads to a given panel action
|
String |
getLinkToWorkspace(WorkspaceImpl workspace,
boolean allowFriendly)
Get an absolute url that leads to a given workspace
|
String |
getLinkToWorkspace(WorkspaceImpl workspace,
boolean allowFriendly,
String lang)
Get an absolute url that leads to a given workspace in a given lang
|
String |
getMarkup(String bean,
String property,
Map params)
Generate a link to a factory component action
|
protected String |
getParameterMarkup(String name,
Object value) |
String |
getParamsMarkup(Map params)
Convert a parameter map (string->string) to its URL form name1=value1&name2=value2 ...
|
String |
getPermanentLink(String bean,
String property,
Map params)
Get a permanent link to a given action on a bean
|
protected StringBuffer |
getRelativeLinkToPage(Section page,
boolean allowFriendly,
String lang) |
protected StringBuffer |
getRelativeLinkToWorkspace(WorkspaceImpl workspace,
boolean allowFriendly,
String lang) |
String |
getServletMapping()
Get the base URI for any markup, that is, the base path plus the servlet mapping.
|
protected StringBuffer |
postProcessURL(StringBuffer url)
Apply a final post-processing on generated URLs in order to add some extra information such as CSRF tokens or
propagate some behavioural parameters via URL-rewriting.
|
void |
setAction(String action) |
void |
setHandler(String handler) |
public static final String COMMAND_RUNNER
public static final String FRIENDLY_PREFIX
public static final String PARAM_SEPARATOR
public String getHandler()
public void setHandler(String handler)
public String getAction()
public void setAction(String action)
public String getPermanentLink(String bean, String property, Map params)
bean
- Factory component that will perform the actionproperty
- Component's property (method) that will be invokedparams
- Extra parameters for linkpublic String getServletMapping()
protected String _getServletMapping()
public String getBaseURI()
public String getMarkup(String bean, String property, Map params)
bean
- Factory component that will perform the actionproperty
- Component's property (method) that will be invokedparams
- Extra parameters for linkpublic String getParamsMarkup(Map params)
params
- parameter map to process.public String getContextHost(javax.servlet.ServletRequest request)
public String getBaseHref(javax.servlet.ServletRequest request) throws IOException
request
- IOException
protected Panel getCurrentPanel()
public String getLinkToWorkspace(WorkspaceImpl workspace, boolean allowFriendly)
workspace
- Workspace to take toallowFriendly
- allow friendly urlpublic String getLinkToWorkspace(WorkspaceImpl workspace, boolean allowFriendly, String lang)
workspace
- Workspace to take toallowFriendly
- allow friendly urlpublic String getLinkToPage(Section page, boolean allowFriendly)
page
- Page to take toallowFriendly
- allow friendly urlpublic String getLinkToPage(Section page, boolean allowFriendly, String lang)
page
- Page to take toallowFriendly
- allow friendly urllang
- lang to switch toprotected StringBuffer getRelativeLinkToPage(Section page, boolean allowFriendly, String lang)
protected StringBuffer getRelativeLinkToWorkspace(WorkspaceImpl workspace, boolean allowFriendly, String lang)
public String getLinkToPanelAction(Panel panel, String action, String extraParams, boolean allowFriendly)
panel
- Page to take toallowFriendly
- allow friendly urlaction
- action to perform on panelextraParams
- Aditional parameterspublic String getLinkToPanelAction(Panel panel, String action, boolean allowFriendly)
panel
- Page to take toallowFriendly
- allow friendly urlaction
- action to perform on panelprotected StringBuffer postProcessURL(StringBuffer url)
Copyright © 2012-2014 JBoss by Red Hat. All Rights Reserved.