Package com.hybris.cockpitng.admin
Interface CockpitAdminService
-
- All Known Implementing Classes:
DefaultCockpitAdminService
public interface CockpitAdminServiceProvides functionality for cockpitNG admin mode.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringADMINMODE_SCLASSstatic java.lang.StringADMINMODE_SYMBOLIC_SCLASS
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancanReceiveFrom(WidgetSocket inputSocket, Widget targetWidget, WidgetSocket outputSocket, Widget srcWidget)Checks if outputSocket from srcWidget can be connected with inputSocket from targetWidget according to data type.booleancanReceiveFrom(WidgetSocket inputSocket, WidgetSocket outputSocket)Checks if outputSocket from srcWidget can be connected with inputSocket from targetWidget according to data type.org.zkoss.zul.WindowcreateSettingsWizard(org.zkoss.zk.ui.Component parent, Widgetslot widgetslot, Widget widget, org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event> closeCallback)Creates a popup of settings for given widgetjava.lang.StringgetWidgetToolbarColor()booleanisAdminMode()booleanisAdminModePermitted()booleanisInClipboard(Widget widget)Checks if given widget is already in the clipboardbooleanisShowConnectionsFlagEnabled()Checks showConnections flag statusbooleanisSymbolicAdminFlagEnabled()booleanisSymbolicAdminMode()voidmoveWidgetToClipboard(Widget widget)Adds the specified widget to the clipboard and removes it from the widget tree.voidrefreshCockpit()Clears the widget session cache, which results in recalculating the widget tree after the next page refresh.voidremoveWidgetFromClipboard(Widget widget)Removes a widget from the widget clipboard, if it's present there.voidrenderWidgetClipboard(org.zkoss.zk.ui.Component clipboardComponent, org.zkoss.zul.Caption caption)Render content of widget clipboard.org.zkoss.zk.ui.ComponentrenderWidgetDefinitionInfo(org.zkoss.zk.ui.Component parent, WidgetDefinition wiDef)Renders an area of widget definition informationvoidsetAdminMode(boolean adminMode, org.zkoss.zk.ui.Component ref)Enable or disable the admin mode.voidsetShowConnectionsFlagEnabled(boolean enabled)Sets showConnections flag.voidsetSymbolicAdminFlag(boolean enabled)Sets symbolic adminmode flag.voidsetWidgetToolbarColor(java.lang.String color, org.zkoss.zk.ui.Component ref)Sets a new Color to the toolbar.voidshowAddWidgetWizard(org.zkoss.zk.ui.Component ref, org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event> selectListener)Opens a wizard for adding a widget to a slot.voidshowGroupWidgetWizard(Widget widget, org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event> onCloseListener)Opens a wizard where the admin user can group a widget and its children into one single widget.voidshowWidgetConnectionWizard(Widget source, Widget target, org.zkoss.zk.ui.Component ref)Opens a wizard where a user can connect two widgets.voidshowWidgetMultiConnectionWizard(Widget widget, org.zkoss.zk.ui.Component ref)Shows a wizard for configuration of input/output sockets.voidtoggleAdminMode(org.zkoss.zk.ui.Component ref)Toggles backoffice's admin mode
-
-
-
Field Detail
-
ADMINMODE_SCLASS
static final java.lang.String ADMINMODE_SCLASS
- See Also:
- Constant Field Values
-
ADMINMODE_SYMBOLIC_SCLASS
static final java.lang.String ADMINMODE_SYMBOLIC_SCLASS
- See Also:
- Constant Field Values
-
-
Method Detail
-
setAdminMode
void setAdminMode(boolean adminMode, org.zkoss.zk.ui.Component ref)Enable or disable the admin mode.- Parameters:
adminMode- True, if adminmode should be enable, false otherwise.ref- An arbitraryComponentwhich is attached to the current page.
-
isAdminMode
boolean isAdminMode()
- Returns:
- true, if adminmode is currently enabled.
-
isAdminModePermitted
boolean isAdminModePermitted()
- Returns:
- true, if adminmode is allowed for current session user.
-
isSymbolicAdminMode
boolean isSymbolicAdminMode()
- Returns:
- true, if symbolic adminmode is currently enabled.
-
isSymbolicAdminFlagEnabled
boolean isSymbolicAdminFlagEnabled()
- Returns:
- true, if symbolic adminmode flag is true.
-
setSymbolicAdminFlag
void setSymbolicAdminFlag(boolean enabled)
Sets symbolic adminmode flag.- Parameters:
enabled- indicates whether symbolic admin mode should be enabled
-
removeWidgetFromClipboard
void removeWidgetFromClipboard(Widget widget)
Removes a widget from the widget clipboard, if it's present there.- Parameters:
widget- The widget that should be removed.
-
isInClipboard
boolean isInClipboard(Widget widget)
Checks if given widget is already in the clipboard- Parameters:
widget- The widget that should be checked- Returns:
- true, if the specified widget is in clipboard.
-
moveWidgetToClipboard
void moveWidgetToClipboard(Widget widget)
Adds the specified widget to the clipboard and removes it from the widget tree.- Parameters:
widget- which should be moved to clipboard
-
getWidgetToolbarColor
java.lang.String getWidgetToolbarColor()
- Returns:
- the current color string used for the widget toolbars in a CSS readable RGB representation.
-
showAddWidgetWizard
void showAddWidgetWizard(org.zkoss.zk.ui.Component ref, org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event> selectListener)Opens a wizard for adding a widget to a slot. Shows all widgets in the repository.- Parameters:
ref- An arbitraryComponentwhich is attached to the current page.selectListener- AnEventListenerwhich is called when a widget has been selected in the wizard.
-
renderWidgetClipboard
void renderWidgetClipboard(org.zkoss.zk.ui.Component clipboardComponent, org.zkoss.zul.Caption caption)Render content of widget clipboard.- Parameters:
clipboardComponent- clipborad componentcaption- clipborad caption
-
showGroupWidgetWizard
void showGroupWidgetWizard(Widget widget, org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event> onCloseListener)
Opens a wizard where the admin user can group a widget and its children into one single widget.- Parameters:
widget- The root widget of the new widget group.onCloseListener- AnEventListenerwhich is called when the wizard is closed by the user.
-
showWidgetConnectionWizard
void showWidgetConnectionWizard(Widget source, Widget target, org.zkoss.zk.ui.Component ref)
Opens a wizard where a user can connect two widgets.- Parameters:
source- The source widget, i.e. the widget that may fire the event.target- The target widget, i.e. the widget that should receive the event.ref- An arbitraryComponentwhich is attached to the current page.
-
setWidgetToolbarColor
void setWidgetToolbarColor(java.lang.String color, org.zkoss.zk.ui.Component ref)Sets a new Color to the toolbar.- Parameters:
color- the new colorref- An arbitraryComponentwhich is attached to the current page.
-
canReceiveFrom
boolean canReceiveFrom(WidgetSocket inputSocket, Widget targetWidget, WidgetSocket outputSocket, Widget srcWidget)
Checks if outputSocket from srcWidget can be connected with inputSocket from targetWidget according to data type.- Parameters:
inputSocket- -WidgetSocketrepresents input socketoutputSocket- -WidgetSocketrepresents output socketsrcWidget- - (@linkWidgetrepresents source widgettargetWidget- - (@linkWidgetrepresents target widget- Returns:
- true, if the targetWidget.
-
canReceiveFrom
boolean canReceiveFrom(WidgetSocket inputSocket, WidgetSocket outputSocket)
Checks if outputSocket from srcWidget can be connected with inputSocket from targetWidget according to data type.- Parameters:
inputSocket- -WidgetSocketrepresents input socketoutputSocket- -WidgetSocketrepresents output socket- Returns:
- true, if the targetWidget.
-
refreshCockpit
void refreshCockpit()
Clears the widget session cache, which results in recalculating the widget tree after the next page refresh.
-
createSettingsWizard
org.zkoss.zul.Window createSettingsWizard(org.zkoss.zk.ui.Component parent, Widgetslot widgetslot, Widget widget, org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event> closeCallback)Creates a popup of settings for given widget- Parameters:
parent- a component parent to which a component is appendedwidgetslot- a slot of the widgetwidget- a widget from which settings to display are takencloseCallback- a function which is called when settings popup is being close- Returns:
- created Window
-
showWidgetMultiConnectionWizard
void showWidgetMultiConnectionWizard(Widget widget, org.zkoss.zk.ui.Component ref)
Shows a wizard for configuration of input/output sockets.- Parameters:
widget- widget under configurationref- parent component
-
renderWidgetDefinitionInfo
org.zkoss.zk.ui.Component renderWidgetDefinitionInfo(org.zkoss.zk.ui.Component parent, WidgetDefinition wiDef)Renders an area of widget definition information- Parameters:
parent- a component parent to which a component is appendedwiDef- a widget definition containing information to display- Returns:
- created Component
-
setShowConnectionsFlagEnabled
void setShowConnectionsFlagEnabled(boolean enabled)
Sets showConnections flag.- Parameters:
enabled- - value for showConnections flag
-
isShowConnectionsFlagEnabled
boolean isShowConnectionsFlagEnabled()
Checks showConnections flag status- Returns:
- true, if showConnections flag is true.
-
toggleAdminMode
void toggleAdminMode(org.zkoss.zk.ui.Component ref)
Toggles backoffice's admin mode- Parameters:
ref- parent component
-
-