public abstract class AbstractPageAction extends AbstractActionBean implements PageAction
Modifier and Type | Class and Description |
---|---|
static class |
AbstractPageAction.TerminalResource |
Modifier and Type | Field and Description |
---|---|
static String |
CONF_FORM_PREFIX |
static String |
copyright |
static String |
DEFAULT_LAYOUT_CONTAINER |
static org.slf4j.Logger |
logger |
static String[][] |
PAGE_CONFIGURATION_FIELDS |
static String[][] |
PAGE_CONFIGURATION_FIELDS_NO_DETAIL |
Form |
pageConfigurationForm
The Form to configure standard page settings.
|
PageInstance |
pageInstance
The PageInstance property.
|
protected String |
pageTemplate
The page template to use.
|
static String |
PORTOFINO_PAGEACTION_EXCEPTION |
Configuration |
portofinoConfiguration
The global configuration object.
|
String |
returnUrl
The URL the user cakeme from within the application.
|
protected String |
script
The Groovy script for this page.
|
ServerInfo |
serverInfo
Information about the web server.
|
TemplateRegistry |
templates
The templates registry.
|
context
Constructor and Description |
---|
AbstractPageAction() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
acceptsPathParameter() |
Resolution |
cancel() |
DispatchElement |
consumePathFragment(String pathFragment)
This is called to process a piece (fragment) of the requested URL.
|
protected SelectionProvider |
createTemplateSelectionProvider() |
Resolution |
forwardTo(String page)
Deprecated.
use simply new ForwardResolution(page) instead.
|
Resolution |
forwardToPageActionError(Throwable e)
Returns a ForwardResolution to a standard page that reports an exception with an error message saying that
the pageaction is not properly configured.
|
Resolution |
forwardToPageActionNotConfigured()
Returns a ForwardResolution to a standard page with an error message saying that the pageaction is not properly
configured.
|
String |
getActionAPIPath() |
String |
getActionPath() |
List |
getButtons() |
Object |
getConfiguration() |
protected String |
getDefaultReturnUrl() |
org.apache.commons.collections.MultiMap |
getEmbeddedPageActions() |
Map |
getOgnlContext() |
Page |
getPage() |
Form |
getPageConfigurationForm() |
Map<String,Object> |
getPageDescription()
Returns a description of this PageAction.
|
PageInstance |
getPageInstance()
Returns the PageInstance of this element.
|
NavigationItem |
getPages() |
String |
getPageTemplate() |
PageAction |
getParent() |
Configuration |
getPortofinoConfiguration() |
String |
getResourcePath(String resource)
Returns the path inside the web application of a resource relative to this action's directory.
|
String |
getReturnUrl()
This is the URL (typically relative to the application, i.e. without scheme, host, and port components)
where the action should redirect to after handling an event.
|
String |
getScript() |
Object |
getSubResource(String pathFragment)
REST support.
|
org.apache.commons.collections.MultiMap |
initEmbeddedPageActions()
Lifecycle method called by templates that can include embedded pages to compute the set of pages to embed
and their locations and order.
|
boolean |
isMultipartRequest() |
protected void |
prepareConfigurationForms()
Sets up the Elements form(s)
|
protected void |
prepareScript() |
protected void |
readPageConfigurationFromRequest()
Reads the page configuration form values from the request.
|
protected boolean |
saveConfiguration(Object configuration)
Utility method to save the configuration object to a file in this page's directory.
|
void |
setPageConfigurationForm(Form pageConfigurationForm) |
void |
setPageInstance(PageInstance pageInstance)
Sets the PageInstance of this element.
|
void |
setPageTemplate(String pageTemplate) |
void |
setReturnUrl(String returnUrl) |
void |
setScript(String script) |
protected boolean |
updatePageConfiguration()
Updates the page with values from the page configuration.
|
protected void |
updateScript() |
protected void |
updateTemplate(File directory,
FileFilter filter,
EditPage edit)
Recursively applies a template to a subtree of pages.
|
protected boolean |
validatePageConfiguration()
Validates the page configuration form values.
|
getContext, setContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getContext, preparePage
setContext
public static final String copyright
public static final String DEFAULT_LAYOUT_CONTAINER
public static final String[][] PAGE_CONFIGURATION_FIELDS
public static final String[][] PAGE_CONFIGURATION_FIELDS_NO_DETAIL
public static final String PORTOFINO_PAGEACTION_EXCEPTION
public static final String CONF_FORM_PREFIX
public PageInstance pageInstance
public Configuration portofinoConfiguration
public TemplateRegistry templates
public ServerInfo serverInfo
protected String pageTemplate
public String returnUrl
protected String script
public Form pageConfigurationForm
public static final org.slf4j.Logger logger
protected boolean saveConfiguration(Object configuration)
configuration
- the object to save. It must be in a state that will produce a valid XML document.public DispatchElement consumePathFragment(String pathFragment)
consumePathFragment
in interface DispatchElement
pathFragment
- the fragment to process. In path /foo/bar/baz, foo, bar and baz are three different fragments.this
. A null return value means that the dispatch failed (no child page
exists and this page does not accept parameters).protected boolean acceptsPathParameter()
@Path(value="{pathFragment}") public Object getSubResource(@PathParam(value="pathFragment") String pathFragment)
pathFragment
- the path fragment.public PageAction getParent()
getParent
in interface PageAction
@Path(value=":pages") @GET @Produces(value="application/json;charset=UTF-8") public NavigationItem getPages()
public org.apache.commons.collections.MultiMap initEmbeddedPageActions()
PageAction
initEmbeddedPageActions
in interface PageAction
public String getResourcePath(String resource)
resource
- the path of the resource, relative to this action's directory.public String getActionPath()
public String getActionAPIPath()
public org.apache.commons.collections.MultiMap getEmbeddedPageActions()
public boolean isMultipartRequest()
public Form getPageConfigurationForm()
public void setPageConfigurationForm(Form pageConfigurationForm)
public Resolution cancel()
public PageInstance getPageInstance()
DispatchElement
getPageInstance
in interface DispatchElement
public void setPageInstance(PageInstance pageInstance)
DispatchElement
setPageInstance
in interface DispatchElement
public Page getPage()
public String getReturnUrl()
PageAction
getReturnUrl
in interface PageAction
protected String getDefaultReturnUrl()
public void setReturnUrl(String returnUrl)
protected void prepareConfigurationForms()
protected SelectionProvider createTemplateSelectionProvider()
protected void readPageConfigurationFromRequest()
protected boolean validatePageConfiguration()
protected boolean updatePageConfiguration()
protected void updateTemplate(File directory, FileFilter filter, EditPage edit)
directory
- the starting page directory (root of the subtree).filter
- the filter for selecting pages.edit
- the object holding template configuration.protected void prepareScript()
protected void updateScript()
public Map getOgnlContext()
public String getScript()
public void setScript(String script)
public Configuration getPortofinoConfiguration()
@Deprecated public Resolution forwardTo(String page)
page
- the path to the page, from the root of the webapp.public Resolution forwardToPageActionNotConfigured()
public Resolution forwardToPageActionError(Throwable e)
public String getPageTemplate()
getPageTemplate
in interface PageAction
public void setPageTemplate(String pageTemplate)
@Path(value=":buttons") @GET @Produces(value="application/json;charset=UTF-8") public List getButtons()
@Path(value=":configuration") @GET @Produces(value="application/json;charset=UTF-8") public Object getConfiguration()