public class PanelDriver extends Object
Modifier and Type | Field and Description |
---|---|
static String |
PAGE_EDIT |
static String |
PAGE_HEADER |
static String |
PAGE_HELP_MODE |
static String |
PAGE_MANAGE_INVALID_DRIVER |
static String |
PAGE_SHOW |
protected PanelSecurity |
panelSecurity
Security table
|
static String |
PARAMETER_ACTION_EXECUTED_ENABLED |
protected List |
parameters
Parameters definitions to be supplied to the panel
|
Constructor and Description |
---|
PanelDriver() |
Modifier and Type | Method and Description |
---|---|
CommandResponse |
actionChangePage(Panel panel,
CommandRequest request)
Action to change a page for a panel.
|
void |
activateConfigMode(Panel panel,
CommandRequest request) |
void |
activateEditMode(Panel panel,
CommandRequest request)
Defines the action to be taken when activating edit mode
|
void |
activateHelpMode(Panel panel,
CommandRequest request) |
void |
activateNormalMode(Panel panel,
CommandRequest request)
Defines the action to be taken when activating edit mode
|
protected void |
addMethodPermission(String methodName,
Class permissionClass,
String action)
Adds a security restriction to a method in this panel.
|
protected void |
addParameter(PanelProviderParameter parameter)
Adds a parameter for this panel driver.
|
protected void |
addParameters(PanelProviderParameter[] parameters)
Adds an array of parameters for this panel driver.
|
protected void |
addSystemParameter(PanelProviderParameter parameter)
Adds a system parameter.
|
protected CommandResponse |
afterInvokeAction(Panel panel,
CommandRequest request,
CommandResponse actionResponse)
Called after executing an action method
|
protected void |
afterPanelClosed(Panel panel)
Fires in the same transaction, just after a panel is closed
|
protected void |
afterPanelCustomPropertiesModified(PanelInstance instance)
Called when the a panel custom properties have been manually modified
|
protected void |
afterPanelPlacedInRegion(Panel panel,
LayoutRegion oldRegion)
Fires in the same transaction, just after a panel is put in a region
|
protected void |
afterPanelPropertiesModified(PanelInstance instance)
Called when the a panel properties have been manually modified
|
protected void |
afterRenderPanel(Panel panel,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Called after panel has been redered
|
protected CommandResponse |
beforeInvokeAction(Panel panel,
CommandRequest request)
Called before dispatching to an action method
|
protected void |
beforePanelClosed(Panel panel)
Fires in the same transaction, just before a panel is closed
|
protected void |
beforePanelInstanceRemove(PanelInstance instance)
Called when a panel instance is removed from the system.
|
protected void |
beforePanelInstanceRemove(PanelInstance instance,
org.hibernate.Session session)
Deprecated.
use the version without session, and create your txFragment if needed.
|
protected void |
beforePanelPlacedInRegion(Panel panel,
LayoutRegion newRegion)
Fires in the same transaction, just before a panel is put in a region
|
protected void |
beforePanelRemoved(Panel panel)
Fires before the panel is removed
|
protected void |
beforeRenderPanel(Panel panel,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Called before render the panel.
|
boolean |
canInvokeAction(Panel panel,
String action)
Determine if an user can invoke an action in a panel based on permissions.
|
void |
checkInvokeAction(Panel panel,
String action)
Determine if an user can invoke an action in a panel based on permissions.
|
protected void |
checkMethodSecurity(String methodName,
Class permissionClass,
String action,
Panel panel) |
protected void |
copyDirectory(File src,
File dest) |
protected void |
copyFile(File src,
File dest) |
CommandResponse |
execute(Panel panel,
CommandRequest req)
Execute an action on this panel.
|
CommandResponse |
fireAfterInvokeAction(Panel panel,
CommandRequest request,
CommandResponse response)
Called after executing an action method
|
void |
fireAfterPanelClosed(Panel panel)
Fires in the same transaction, just after a panel is closed
|
void |
fireAfterPanelPlacedInRegion(Panel panel,
LayoutRegion region)
Called after the panel is placed in a region
|
void |
fireAfterRenderPanel(Panel panel,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Called after panel has been redered
|
CommandResponse |
fireBeforeInvokeAction(Panel panel,
CommandRequest request)
Called before dispatching to an action method.
|
void |
fireBeforePanelInstanceRemove(PanelInstance instance)
Called when a panel instance is removed from the system.
|
void |
fireBeforePanelPlacedInRegion(Panel panel,
LayoutRegion region)
Called before the panel is placed in a region
|
void |
fireBeforePanelRemoved(Panel panel)
Called before the panel is removed
|
void |
fireBeforeRenderPanel(Panel panel,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Called before render the panel.
|
void |
firePanelCustomPropertiesModified(PanelInstance instance)
Called when the a panel properties have been manually modified
|
void |
firePanelPropertiesModified(PanelInstance instance)
Called when the a panel properties have been manually modified
|
ResourceBundle |
getActionsBundle() |
PanelProviderParameter[] |
getAllParameters()
Returns all the parameters this panel driver allows to configure.
|
int |
getConfigHeight(Panel panel,
CommandRequest request) |
int |
getConfigWidth(Panel panel,
CommandRequest request) |
int |
getEditHeight(Panel panel,
CommandRequest request) |
int |
getEditWidth(Panel panel,
CommandRequest request) |
int |
getHelpHeight(Panel panel,
CommandRequest request) |
int |
getHelpWidth(Panel panel,
CommandRequest request) |
static String |
getMethodName(String action)
Determine the method name for a given action parameter.
|
protected String |
getPageEdit(Panel panel) |
protected String |
getPageHelpMode(Panel panel) |
protected File |
getPanelDir(Panel panel)
Returns the directory where this panel can store its files.
|
protected File |
getPanelDir(PanelInstance panelInstance)
Returns the directory where this panel can store its files.
|
protected String |
getPanelDirMapping(Panel panel)
Returns the URL mapping used to reference the directory which holds the panel data
|
protected String |
getPanelDirMapping(PanelInstance panelInstance)
Returns the URL mapping used to reference the directory which holds the panel data
|
protected String |
getPanelHTMLContent(PanelInstance instance,
String lang) |
PanelSession |
getPanelSession(CommandRequest req,
Panel panel)
Deprecated.
use getPanelSession(Panel panel)
|
PanelSession |
getPanelSession(javax.servlet.http.HttpServletRequest req,
Panel panel)
Deprecated.
use getPanelSession(Panel panel)
|
PanelSession |
getPanelSession(Panel panel)
Return the panel session related to this panel.
|
protected Object |
getResourceForPermission(Class permissionClass,
String action,
Panel panel)
Determine the resource associated for a permission.
|
ShowPanelPageComponent |
getShowPanelPageComponent() |
Map |
getTextShownByInstance(PanelInstance instance) |
String |
getURLWhenMaximized(PanelSession panelStatus)
Deprecated.
It is of no practical use
|
protected boolean |
hasMethodAccess(String methodName,
Class permissionClass,
String action,
Panel panel)
Checks security for a method in a panel for givrn user.
|
void |
init(PanelProvider provider)
Called on provider initialization.
|
void |
initPanel(PanelInstance instance)
Called on panel initialization
|
void |
initPanelSession(PanelSession panelSession,
javax.servlet.http.HttpSession session)
Called on panel initialization (when a new PanelSession instance is created attached to a given session)
|
protected void |
initPermissionsParameters() |
protected void |
initSystemParameters(PanelProvider provider) |
protected boolean |
isDoubleClickProtected(String action) |
static boolean |
isSystemAction(String action)
Determine if given action is a system action (currently, if it starts with "_".
|
void |
move(Panel panel,
String regionName)
Moves a panel from one region to another
|
CommandResponse |
panelActionClose(Panel panel,
CommandRequest request)
Removes panel from its region, but keeping it assigned to this section.
|
CommandResponse |
panelActionEditMode(Panel panel,
CommandRequest request)
Sets the panel in edit mode
|
CommandResponse |
panelActionFactory(Panel panel,
CommandRequest request)
Action that dispatches to a factory component.
|
CommandResponse |
panelActionHelpMode(Panel panel,
CommandRequest request)
Sets the panel in help management mode
|
CommandResponse |
panelActionInvalidateCache(Panel panel,
CommandRequest request)
Invalidates panel cache
|
CommandResponse |
panelActionMaximize(Panel panel,
CommandRequest request)
Maximizes the panel
|
CommandResponse |
panelActionMaximizeInRegion(Panel panel,
CommandRequest request)
Maximizes the panel in region
|
CommandResponse |
panelActionMinimize(Panel panel,
CommandRequest request)
Minimizes the panel
|
CommandResponse |
panelActionMoveBack(Panel panel,
CommandRequest request)
Moves panel backwards in its region
|
CommandResponse |
panelActionMoveForward(Panel panel,
CommandRequest request)
Moves panel forward in its region
|
CommandResponse |
panelActionRefreshPanel(Panel panel,
CommandRequest request)
Refresh a panel
|
CommandResponse |
panelActionRemove(Panel panel,
CommandRequest request)
Removes panel from system
|
CommandResponse |
panelActionRestore(Panel panel,
CommandRequest request)
Restores the panel to its regular size
|
CommandResponse |
panelActionSelect(Panel panel,
CommandRequest request)
Marks panel as selected in its region
|
CommandResponse |
panelActionShowMode(Panel panel,
CommandRequest request)
Sets the panel in show mode
|
CommandResponse |
panelActionStartConfig(Panel panel,
CommandRequest request) |
void |
replicateData(PanelInstance src,
PanelInstance dest)
Replicates panel data.
|
boolean |
supportsEditMode(Panel panel)
Returns if this driver defines support to activate edit mode.
|
boolean |
supportsHelpMode(Panel panel)
Returns if this driver defines support to activate help mode.
|
public static final String PAGE_MANAGE_INVALID_DRIVER
public static final String PAGE_HELP_MODE
public static final String PAGE_SHOW
public static final String PAGE_EDIT
public static final String PAGE_HEADER
public static final String PARAMETER_ACTION_EXECUTED_ENABLED
protected List parameters
protected PanelSecurity panelSecurity
public PanelProviderParameter[] getAllParameters()
protected void addParameter(PanelProviderParameter parameter)
parameter
- Parameter to add.protected void addParameters(PanelProviderParameter[] parameters)
parameters
- Parameters to add.protected void addSystemParameter(PanelProviderParameter parameter)
parameter
- Parameter to addprotected void addMethodPermission(String methodName, Class permissionClass, String action) throws NoSuchMethodException
methodName
- Method namepermissionClass
- Type of permission to apply before invoking itaction
- action on the resource indicated by the permissionNoSuchMethodException
public void init(PanelProvider provider) throws Exception
provider
- Panel provider for this driver.Exception
protected void initSystemParameters(PanelProvider provider)
protected void initPermissionsParameters() throws NoSuchMethodException
NoSuchMethodException
public void initPanel(PanelInstance instance) throws Exception
instance
- PanelInstance where the panel belongs.Exception
public PanelSession getPanelSession(Panel panel)
panel
- public PanelSession getPanelSession(CommandRequest req, Panel panel)
public PanelSession getPanelSession(javax.servlet.http.HttpServletRequest req, Panel panel)
protected CommandResponse beforeInvokeAction(Panel panel, CommandRequest request)
panel
- request
- protected CommandResponse afterInvokeAction(Panel panel, CommandRequest request, CommandResponse actionResponse)
panel
- request
- actionResponse
- Panel responseprotected void beforeRenderPanel(Panel panel, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
panel
- request
- response
- protected void afterRenderPanel(Panel panel, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
panel
- request
- protected void beforePanelInstanceRemove(PanelInstance instance, org.hibernate.Session session) throws Exception
Exception
protected void beforePanelInstanceRemove(PanelInstance instance) throws Exception
instance
- Panel which is about to be removedException
protected void beforePanelClosed(Panel panel)
panel
- panel closedprotected void afterPanelClosed(Panel panel) throws Exception
panel
- panel closedException
public final void fireAfterPanelClosed(Panel panel) throws Exception
panel
- panel closedException
protected void beforePanelRemoved(Panel panel) throws Exception
panel
- Exception
protected void beforePanelPlacedInRegion(Panel panel, LayoutRegion newRegion)
panel
- panel closednewRegion
- region where the panel is being placedprotected void afterPanelPlacedInRegion(Panel panel, LayoutRegion oldRegion) throws Exception
panel
- panel closedoldRegion
- region where the panel was before being moved.Exception
protected void afterPanelPropertiesModified(PanelInstance instance)
instance
- protected void afterPanelCustomPropertiesModified(PanelInstance instance)
instance
- public CommandResponse panelActionMaximize(Panel panel, CommandRequest request)
public CommandResponse panelActionMaximizeInRegion(Panel panel, CommandRequest request)
public CommandResponse panelActionMinimize(Panel panel, CommandRequest request)
public CommandResponse panelActionRestore(Panel panel, CommandRequest request)
public CommandResponse panelActionShowMode(Panel panel, CommandRequest request) throws Exception
Exception
public CommandResponse panelActionEditMode(Panel panel, CommandRequest request) throws Exception
Exception
public CommandResponse panelActionHelpMode(Panel panel, CommandRequest request) throws Exception
Exception
public CommandResponse panelActionStartConfig(Panel panel, CommandRequest request) throws Exception
Exception
public void activateHelpMode(Panel panel, CommandRequest request) throws Exception
Exception
public int getHelpWidth(Panel panel, CommandRequest request)
public int getHelpHeight(Panel panel, CommandRequest request)
public void activateNormalMode(Panel panel, CommandRequest request) throws Exception
panel
- request
- Exception
public void activateEditMode(Panel panel, CommandRequest request) throws Exception
panel
- request
- Exception
public int getEditWidth(Panel panel, CommandRequest request)
public int getEditHeight(Panel panel, CommandRequest request)
public void activateConfigMode(Panel panel, CommandRequest request) throws Exception
Exception
public int getConfigWidth(Panel panel, CommandRequest request)
public int getConfigHeight(Panel panel, CommandRequest request)
public ResourceBundle getActionsBundle()
public CommandResponse panelActionClose(Panel panel, CommandRequest request)
public CommandResponse panelActionMoveBack(Panel panel, CommandRequest request)
public void move(Panel panel, String regionName) throws Exception
panel
- regionName
- new region nameException
public CommandResponse panelActionMoveForward(Panel panel, CommandRequest request)
public CommandResponse panelActionRemove(Panel panel, CommandRequest request)
public CommandResponse panelActionInvalidateCache(Panel panel, CommandRequest request)
public CommandResponse panelActionSelect(Panel panel, CommandRequest request)
public CommandResponse panelActionRefreshPanel(Panel panel, CommandRequest request)
panel
- request
- public static String getMethodName(String action)
action
- Action to be performedpublic static boolean isSystemAction(String action)
action
- Action to processpublic CommandResponse execute(Panel panel, CommandRequest req) throws Exception
Exception
protected boolean isDoubleClickProtected(String action)
public boolean canInvokeAction(Panel panel, String action)
panel
- Panel where action is to be invokedaction
- Action to be performedpublic void checkInvokeAction(Panel panel, String action)
panel
- Panel where action is to be invokedaction
- Action to be performedprotected void checkMethodSecurity(String methodName, Class permissionClass, String action, Panel panel)
methodName
- Method to checkpermissionClass
- Type of permission to checkaction
- Action to checkpanel
- Panel where action is to be invokedprotected boolean hasMethodAccess(String methodName, Class permissionClass, String action, Panel panel)
methodName
- Method to checkpermissionClass
- Type of permission to checkaction
- Action to checkpanel
- Panel where action is to be invokedprotected Object getResourceForPermission(Class permissionClass, String action, Panel panel)
permissionClass
- Type of permissionaction
- action being performed, may be used internally.panel
- current panelprotected File getPanelDir(PanelInstance panelInstance) throws Exception
panelInstance
- Panel instance whose directory is retrievedException
protected File getPanelDir(Panel panel) throws Exception
panel
- Panel whose directory is retrievedException
protected String getPanelDirMapping(Panel panel) throws Exception
panel
- Panel being attendedException
protected String getPanelDirMapping(PanelInstance panelInstance) throws Exception
panelInstance
- PanelInstance being attendedException
public String getURLWhenMaximized(PanelSession panelStatus)
panelStatus
- public boolean supportsEditMode(Panel panel)
panel
- public boolean supportsHelpMode(Panel panel)
panel
- public void initPanelSession(PanelSession panelSession, javax.servlet.http.HttpSession session)
public final void fireBeforePanelPlacedInRegion(Panel panel, LayoutRegion region)
panel
- panel being placedregion
- region where the panel is being placedpublic final void fireAfterPanelPlacedInRegion(Panel panel, LayoutRegion region) throws Exception
panel
- panel being placedregion
- region where the panel was beforeException
public final void fireBeforePanelRemoved(Panel panel) throws Exception
panel
- panel being placedException
public final CommandResponse fireBeforeInvokeAction(Panel panel, CommandRequest request)
panel
- request
- beforeInvokeAction(org.jboss.dashboard.workspace.Panel, org.jboss.dashboard.ui.controller.CommandRequest)
public final CommandResponse fireAfterInvokeAction(Panel panel, CommandRequest request, CommandResponse response)
panel
- request
- response
- afterInvokeAction(org.jboss.dashboard.workspace.Panel, org.jboss.dashboard.ui.controller.CommandRequest, org.jboss.dashboard.ui.controller.CommandResponse)
public final void fireBeforeRenderPanel(Panel panel, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
panel
- request
- response
- beforeRenderPanel(org.jboss.dashboard.workspace.Panel, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
public final void fireAfterRenderPanel(Panel panel, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
panel
- request
- afterRenderPanel(org.jboss.dashboard.workspace.Panel, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
public final void fireBeforePanelInstanceRemove(PanelInstance instance) throws Exception
instance
- Panel which is about to be removedException
beforePanelInstanceRemove(org.jboss.dashboard.workspace.PanelInstance, org.hibernate.Session)
public final void firePanelPropertiesModified(PanelInstance instance)
instance
- afterPanelPropertiesModified(org.jboss.dashboard.workspace.PanelInstance)
public final void firePanelCustomPropertiesModified(PanelInstance instance)
instance
- afterPanelPropertiesModified(org.jboss.dashboard.workspace.PanelInstance)
public void replicateData(PanelInstance src, PanelInstance dest) throws Exception
src
- Source PanelInstancedest
- Destinaton PanelInstanceException
protected void copyDirectory(File src, File dest) throws IOException
IOException
protected void copyFile(File src, File dest) throws IOException
IOException
public CommandResponse panelActionFactory(Panel panel, CommandRequest request) throws Exception
Exception
public CommandResponse actionChangePage(Panel panel, CommandRequest request)
public Map getTextShownByInstance(PanelInstance instance)
protected String getPanelHTMLContent(PanelInstance instance, String lang)
public ShowPanelPageComponent getShowPanelPageComponent()
Copyright © 2012-2014 JBoss by Red Hat. All Rights Reserved.