Class ContainerBean
- java.lang.Object
-
- com.znize.platform.model.bean.Component
-
- com.znize.platform.model.container.ContainerBean
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
- Direct Known Subclasses:
DialogBean
public abstract class ContainerBean extends Component implements java.lang.Cloneable
ContainerBean with a PageContent that contains backing beans.- Since:
- 1.1
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.znize.platform.model.bean.Component
Component.ComponentVisitor
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCONTAINER_BEAN_VARContainerBean name in requestScope.static charCONTAINER_TAG_CHARContainer tag char: c.protected ContainerMenuBeancontainerMenuBeancontainerMenuBean: main menu of this ContainerBeanprotected DataAccessUnitdataAccessUnitstatic java.lang.StringREQUEST_GET_RESOURCE_BUNDLEModule request event: getResourceBundle(containerBean)-
Fields inherited from class com.znize.platform.model.bean.Component
parentComponent, uiView
-
-
Constructor Summary
Constructors Constructor Description ContainerBean()Default constructor
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidcleanCache()Clean cache, including cached ResourceBundle.voidclear()Clear pageContent, containerMenu and properties.voidclearRegionsOnCommand(MenuNode menuNode)Clear regions before executing the command of the menu node.java.lang.Objectclone()protected DialogBeancreateDialogBean(DialogBean.DialogType type)Create a dialogBean that is a child component of this containerBean.static <T extends PersistenceEntity>
EntityBackingBean<? super T>createEntity(java.lang.Class<T> entityType, java.util.List<CriteriaElement> propertyQueryElements, EntityViewConfig viewConfig, ContainerBean containerBean, MenuNodeFactory menuNodeFactory, DataAccessUnit dataAccessUnit)Create an EntityBackingBean for creating entitystatic <T extends PersistenceEntity>
EntityBackingBean<T>createEntityBackingBean(Component parentComponent, java.lang.Class<T> entityType, EntityDataSource eds, EntityViewConfig viewConfig, boolean manageMode, ContainerBean containerBean)Create the EntityBackingBean for the entity.static <T extends PersistenceEntity>
EntityBackingBean<? super T>createEntityBackingBean(Component parentComponent, java.lang.Class<T> entityType, java.lang.Class backingBeanType, EntityViewConfig viewConfig, EntityInitializer entityInitializer, ContainerBean containerBean, MenuNodeFactory menuNodeFactory, DataAccessUnit dataAccessUnit)Create entity backing bean for the entity initialized with the EntityInitializer.static <T extends PersistenceEntity>
EntityBackingBean<T>createEntityBackingBean(java.lang.Class<T> entityType, EntityDataSource eds, EntityViewConfig viewConfig, boolean manageMode, ContainerBean containerBean)Create the EntityBackingBean for the entity.static <T extends PersistenceEntity>
EntityListBackingBean<T>createEntityListBackingBean(Component parentComponent, java.lang.Class<T> entityType, EntityDataSource<T> eds, EntityListViewConfig viewConfig, boolean manageMode, ContainerBean containerBean)Create entity list backing bean.static <T extends PersistenceEntity>
EntityListBackingBean<T>createEntityListBackingBean(java.lang.Class<T> entityType, EntityDataSource eds, EntityListViewConfig viewConfig, boolean manageMode, ContainerBean containerBean)Create entity list backing bean whose parentComponent is null.protected abstract PageObjectResolvercreatePageObjectResolver()Create a page object (bean) resolver.<T extends PersistenceEntity>
voidentityCommitted(PersistenceDataBackingBean<T> backingBean, java.util.List<T> entities, ActionDescriptor ad)entityCommitted: called when an entity is created, deleted, or changed in persistence.ContainerBeanfindChildByPathIdentifier(java.lang.String pathId)Get the child containerBean from the path identifierBackingBeanContextgetBackingBeanContext()Get the cached BackingBeanContext that is session scope.<T extends PersistenceEntity>
java.util.List<PersistenceDataBackingBean<T>>getBeansOfEntityType(java.lang.Class<T> entityType, boolean recursive, ViewType... viewTypes)Find all beans(entity and/or entity list beans) with the entity type (or its subclass).abstract BorderLayoutgetBorderLayout()Get borderLayout.ContainerBeangetChildContainerBean(int childIndex)Get the child containerBean at the index.intgetChildIndex(ContainerBean childContainerBean)Get the index of the child containerBean.java.lang.StringgetChildPathIdentifier(int childIndex)Get the path identifier for child contianerBeanContainerBeangetContainerBean()Get the parent ContainerBean of this ContainerBeanContainerMenuBeangetContainerMenuBean()Get the ContainerMenuBean of this ContainerBean.DataAccessUnitgetDataAccessUnit(boolean returnNullForBoundDataAccessUnit)Get the DataAccessUnit of this containerBean.abstract java.util.List<java.lang.Integer>getDefaultQueryRenderRegions()Get the default render regions to show query form (EntityBackingBean query view).abstract java.util.List<java.lang.Integer>getDefaultQueryResultsRenderRegions()Get the default render regions to show query results, including any backing beans that is not a query EntityBackingBean.DialogBeangetDialogBean()Get existing dialogBean of this containerBean.DialogBeangetDialogBean(boolean create)Get or create dialogBean(type:REGULAR) from this containerBean.DialogBeangetDialogBean(boolean create, DialogBean.DialogType type)Get or create dialogBean from this containerBean.java.lang.StringgetDisplayTitle(boolean includeBrand)Get the title of the view for display using resource bundle.<T extends PersistenceEntity>
PersistenceDataBackingBean<T>getFirstBeanOfEntityType(java.lang.Class<T> entityType, boolean recursive, ViewType... viewTypes)Find the first bean(entity and/or entity list bean) with the entity type (or its subclass).ContainerBeangetLeafContainerBean()Get leaf containerBean.java.util.LocalegetLocale()Get the current locale for current user.java.lang.StringgetLocaleLanguageTag()Get user locale as language tag such as en-US.java.lang.StringgetLogo()Get the logo URL of the view backed by this containerBean.abstract java.lang.StringgetName()Get the name of this ContainerBean.java.lang.StringgetOutputLink(PersistenceEntity entity, boolean trackSession)Get the bookmarkable URL to show the entityPagegetPage()Get the page shown in this containerBean.PageContentgetPageContent()Get the PageContent of this ContainerBean.PageInfogetPageInfo()Get page info that contains page title, keywords and description.PageObjectResolvergetPageObjectResolver()Get page embedded object (bean) resolver.java.lang.IntegergetPageSize()Get the page size (rows per page) for this ContainerBean for current user.java.lang.ObjectgetParameter(java.lang.String name)Get parameter value for the name.java.lang.StringgetPathIdentifier()Get container path identifier: path in the container/dialog tree For example: c0_c1_c1, start from root: first child, second child, third child, and so on.ContainerBeangetPrintViewContainerBean()Get the containerBean that is used to show content for print view.java.lang.IntegergetPrintViewPageId()Get the print view page Id.protected java.lang.IntegergetQueryPageId()Get the page to show query form.static java.lang.IntegergetRenderRegionNumber(java.util.List<java.lang.Integer> renderRegions)Get the region number to put backing bean.java.util.ResourceBundlegetResourceBundle()Get the ResourceBundle for this component.ContainerBeangetRootContainerBean()Get root containerBean.java.lang.StringgetStyleClass()Get containerBean styleClass that is associated with containerBean name and responsive type(mobile or desktop).ParameterizedMessagegetTitle(boolean includeBrand)Get the title of the view backed by this ContainerBean, which is usually shown on the top of a page.java.lang.StringgetUrlLocaleLanguageTag()Get URL locale as language tag such as en-US, used as URL locale parameter value.ViewInfogetViewInfo()Get the ViewInfo of the view backed by this container bean.java.lang.StringhandleError(java.lang.Throwable t)Handle error.voidinit()Called after this containerBean is created and before it is put into service.protected voidinitFrom(ContainerBean containerBean)Copy data from the containerBean.protected voidinitPageInfo()Initialize page info including icon, logo, title, meta keywords and description.booleanisDialogOpened()Is the dialogBean of this ContainerBean visible?booleanisLayoutFullPage()Whether layout code is full page layout? If yes, <body> is the border layout target.booleanisMobile()Whether user agent is mobile or desktop?booleanisOpenDialogSupported()Can a dialog be opened from this containerBean? default is true.booleanisRenderable()Whether this containerBean is renderable.booleanisRoot()Is this containerBean the root contianerBean?booleanisSameOrDescendantContainerBean(ContainerBean containerBean)Is the containerBean the same as this ContainerBean or a descendant of this ContainerBean?booleanisSaveStates()Whether to save states for JSF pages backed by this containerBean? Saving states is disabled for bots(search engines).booleanisValidPathIdentifier(java.lang.String pathId)Whether the pathId is valid in terms of syntax.voidlocaleChanged()This method will be called when user locale is changed.DialogBeannewDialogBean()Create a new dialog (type: REGULAR) from this containerBean, existing dialogBean (if any) of this containerBean will be overridden since one containerBean can have one dialogBean only.DialogBeannewDialogBean(DialogBean.DialogType type)Create a new dialog from this containerBean, existing dialogBean (if any) of this containerBean will be overridden since one containerBean can have one dialogBean only.voidpostAddToView()postAddToView: called after viewRoot is added to view when building new view or restoring view.voidpreRenderView()preRenderView: called after buildView and before renderView.voidremoveParameter(java.lang.String name)Remove the parameter with the name.voidsetContainerBean(ContainerBean containerBean)Set the parent ContainerBean of this ContainerBeanvoidsetContainerMenuBean(ContainerMenuBean containerMenuBean)Set the ContainerMenuBean of this ContainerBean.voidsetDataAccessUnit(DataAccessUnit dataAccessUnit)Set the DataAccessUnit of this containerBeanvoidsetLayoutFullPage(boolean layoutFullPage)Set whether layout code is full page layout.voidsetPageContent(PageContent pageContent)Set the PageContent of this ContainerBean.voidsetPageInfo(PageInfo pageInfo)Set page info that contains page title, keywords and description.voidsetParameter(java.lang.String name, java.lang.Object value)Set parameter value.voidsetRenderable(boolean renderable)Set whether this containerBean is renderable.voidsetSaveStates(java.lang.Boolean saveStates)Set whether to save states for JSF pages backed by this containerBeanvoidsetViewInfo(ViewInfo viewInfo)Set the ViewInfo of the view backed by this container bean.PageNavigationshowBean(BackingBean bean, boolean addGeneratedBeans, java.util.List<java.lang.Integer> renderRegions, boolean clearRenderRegions, java.lang.Integer regionForGeneratedBeans, java.lang.Integer pageId)Add the bean to the regions.PageNavigationshowBean(BackingBean bean, java.lang.Integer regionNumber)Add the bean to the region.PageNavigationshowBean(BackingBean bean, java.util.List<java.lang.Integer> renderRegions, boolean clearRenderRegions)Add the bean to the regions.PageNavigationshowBeanList(java.util.List<BackingBean> beans, boolean addGeneratedBeans, java.util.List<java.lang.Integer> renderRegions, boolean clearRenderRegions, java.lang.Integer pageId)Add a list beans to the regions.PageNavigationshowConfirmDialog(ParameterizedMessage title, java.util.List<BackingBeanMessage> messages, ConfirmBean.Command[] commands, java.lang.String[] commandVisibleNames, DialogBean dialogBean)Show confirm dialog with the messages and commands.PageNavigationshowConfirmDialogWithBeans(ParameterizedMessage title, java.util.List<PersistenceDataBackingBean> beans, ConfirmBean.Command[] commands, java.lang.String[] commandVisibleNames, DialogBean dialogBean)Show confirm dialog with the list of beans as content and commands.PageNavigationshowEntity(EntityTypeId entityTypeId)Create the EntityBackingBean for the entity and place it in the PageContent of this ContainerBean for display.PageNavigationshowEntity(PersistenceEntity entity)Create the EntityBackingBean for the entity and place it in the PageContent of this ContainerBean for display.PageNavigationshowEntity(PersistenceEntity entity, EntityViewConfig viewConfig, boolean manageMode)Create the EntityBackingBean for the entity and place it in the PageContent of this ContainerBean for display.PageNavigationshowEntity(java.lang.Class entityType, EntityDataSource eds, EntityViewConfig viewConfig, boolean manageMode)Create the EntityBackingBean for the entity and place it in the PageContent of this ContainerBean for display.PageNavigationshowEntity(java.lang.Class entityType, EntityDataSource eds, EntityViewConfig viewConfig, boolean manageMode, java.lang.Integer pageId)Create the EntityBackingBean for the entity and place it in the PageContent of this ContainerBean for display.PageNavigationshowEntityList(java.lang.Class entityType, EntityDataSource eds, boolean manageMode)Create an EntityListBackingBean for the entity list and place it in the PageContent of this ContainerBean for display.PageNavigationshowEntityList(java.lang.Class entityType, EntityDataSource eds, boolean showCreateForm, boolean manageMode, java.lang.Integer pageId)Create an EntityListBackingBean for the entity list and place it in the PageContent of this ContainerBean for display.PageNavigationshowEntityList(java.lang.Class entityType, EntityDataSource eds, EntityListViewConfig viewConfig, boolean manageMode)Create an EntityListBackingBean for the entity list and place it in the PageContent of this ContainerBean for display.PageNavigationshowEntityList(java.lang.Class entityType, EntityDataSource eds, EntityListViewConfig viewConfig, boolean showCreateForm, boolean manageMode, java.lang.Integer pageId, boolean createIfEmpty)Create an EntityListBackingBean for the entity list and place it in the PageContent of this ContainerBean for display.PageNavigationshowEntityList(java.lang.Class entityType, EntityDataSource eds, EntityListViewConfig viewConfig, boolean manageMode, java.lang.Integer pageId)Create an EntityListBackingBean for the entity list and place it in the PageContent of this ContainerBean for display.PageNavigationshowMessageDialog(ParameterizedMessage title, java.util.List<ParameterizedMessage> messages)Open a message dialog.PageNavigationshowMessageDialog(java.util.List<ParameterizedMessage> messages)Open a message dialog with title: INFO.PageNavigationshowProgressDialog(MenuNode targetMenuNode, java.lang.Integer initialValue, java.lang.String labelTemplate, boolean ajax, boolean displayOnly, boolean closeDilaogOncomplete)Show progress dialog.<T extends PersistenceEntity>
PageNavigationshowQueryFormBean(java.lang.Class<T> entityType, EntityInitializer entityInitializer, boolean showQueryForm, EntityViewConfig queryViewConfig, java.util.List<java.lang.Integer> renderRegions, boolean showQueryResults, EntityListViewConfig queryResultViewConfig, QueryResultTransformer queryResultTransformer, MenuNodeFactory menuNodeFactory, DataAccessUnit dataAccessUnit)Show query form and/or query results beans for the entity type.PageNavigationshowSingleEntity(java.lang.Class entityType, java.util.List<CriteriaElement> propertyQueryElements, ParameterizedMessage title, boolean createIfEmpty, java.util.List<java.lang.Integer> renderRegions, boolean clearRenderRegions, EntityViewConfig viewConfig, MenuNodeFactory menuNodeFactory, DataAccessUnit dataAccessUnit)Create an EntityBackingBean to show the entity retrieved by the query criteria specified by the propertyQueryElements.voidwalkComponentTree(Component.ComponentVisitor visitor)Walk component tree and call visitor on each visited component.-
Methods inherited from class com.znize.platform.model.bean.Component
existPathToAncestorType, getAuthenticatedUser, getCalcContext, getChildOfClosestAncestor, getClientId, getClosestAncestor, getComponentsOnPathTo, getCountryFromCurrentLocale, getCurrencyCode, getCurrentDate, getCurrentLocalDateTime, getDataAccessUnit, getDataConverter, getDisplayValue, getInstanceUser, getParameters, getParameters, getParentComponent, getPathTo, getPersistenceEntityManager, getPersistenceEntityManager, getPersistenceEntityManager, getPersistenceEntityManager, getQueryHints, getRootComponent, getString, getUiView, getUiView, getYearStartDate, isAncestorComponentOf, isEntityI18NEnabled, isInPageContent, setClientId, setParentComponent, setUiView
-
-
-
-
Field Detail
-
CONTAINER_TAG_CHAR
public static final char CONTAINER_TAG_CHAR
Container tag char: c. containerBean path format: c0_c0_c0.- See Also:
- Constant Field Values
-
CONTAINER_BEAN_VAR
public static final java.lang.String CONTAINER_BEAN_VAR
ContainerBean name in requestScope. The current containerBean can be accessed by #{requestScope.containerBean} or by callingRequestHelper.getAttribute(String)with CONTAINER_BEAN_VAR parameter.- See Also:
- Constant Field Values
-
REQUEST_GET_RESOURCE_BUNDLE
public static final java.lang.String REQUEST_GET_RESOURCE_BUNDLE
Module request event: getResourceBundle(containerBean)- Since:
- 5.14
- See Also:
- Constant Field Values
-
dataAccessUnit
protected DataAccessUnit dataAccessUnit
-
containerMenuBean
protected ContainerMenuBean containerMenuBean
containerMenuBean: main menu of this ContainerBean
-
-
Method Detail
-
getResourceBundle
public java.util.ResourceBundle getResourceBundle()
Description copied from class:ComponentGet the ResourceBundle for this component.- Overrides:
getResourceBundlein classComponent- Returns:
- ResourceBundle object.
-
getDataAccessUnit
public DataAccessUnit getDataAccessUnit(boolean returnNullForBoundDataAccessUnit)
Get the DataAccessUnit of this containerBean. If this containerBean has a parent and its DataAccessUnit is not set, return its parent's DataAccessUnit (recursive).- Overrides:
getDataAccessUnitin classComponent- Parameters:
returnNullForBoundDataAccessUnit- whether to return null for current bound dataAccessUnit.- Returns:
- DataAccessUnit instance. Default is current bound DataAccessUnit.
- Since:
- 5.13
-
setDataAccessUnit
public void setDataAccessUnit(DataAccessUnit dataAccessUnit)
Set the DataAccessUnit of this containerBean- Parameters:
dataAccessUnit- DataAccessUnit instance.- Since:
- 5.13
-
init
@PostConstruct public void init()
Called after this containerBean is created and before it is put into service.
-
initFrom
protected void initFrom(ContainerBean containerBean)
Copy data from the containerBean. copy references instead of deep copy. After the copy, the containerBean will not be used any more.- Parameters:
containerBean- the containerBean to copy data from
-
getPageContent
public PageContent getPageContent()
Get the PageContent of this ContainerBean. If it is null, a new instance will be created.- Returns:
- PageContent instance.
-
setPageContent
public void setPageContent(PageContent pageContent)
Set the PageContent of this ContainerBean.- Parameters:
pageContent- the new pageContent- Since:
- 5.6
-
getContainerMenuBean
public ContainerMenuBean getContainerMenuBean()
Get the ContainerMenuBean of this ContainerBean. Container menu is the main menu of a ContainerBean.- Returns:
- ContainerMenuBean instance.
-
setContainerMenuBean
public void setContainerMenuBean(ContainerMenuBean containerMenuBean)
Set the ContainerMenuBean of this ContainerBean. Container menu is the main menu of a ContainerBean.- Parameters:
containerMenuBean- the container menu to set.
-
showEntity
public PageNavigation showEntity(java.lang.Class entityType, EntityDataSource eds, EntityViewConfig viewConfig, boolean manageMode) throws BackingBeanException, SystemException
Create the EntityBackingBean for the entity and place it in the PageContent of this ContainerBean for display.The render regions to show the bean can be specified in the EntityDataSource using
EntityDataSource.setRenderRegions(List, Boolean). If render regions is not specified, use the default regions for query results:getDefaultQueryResultsRenderRegions().- Parameters:
entityType- entity typeeds- the EntityDataSource that contains the entity to showviewConfig- entityViewConfig. if null, use default.manageMode- manage mode. If true, entity editing will be enabled if user has the permission.- Returns:
- a PageNavigation
- Throws:
BackingBeanException- throw if an backing bean related error occursSystemException- throw if any other error occurs
-
createEntityBackingBean
public static <T extends PersistenceEntity> EntityBackingBean<T> createEntityBackingBean(java.lang.Class<T> entityType, EntityDataSource eds, EntityViewConfig viewConfig, boolean manageMode, ContainerBean containerBean) throws SystemException
Create the EntityBackingBean for the entity. parentComponent is null.- Parameters:
entityType- entity typeeds- the EntityDataSource that contains the entity to showviewConfig- entityViewConfig. if null, use default.manageMode- manage mode. If true, entity editing will be enabled if user has the permission.containerBean- the ContainerBean of the EntityBackingBean to be created- Returns:
- EntityBackingBean instance
- Throws:
BackingBeanException- throw if an backing bean related error occursSystemException- throw if any other error occurs
-
createEntityBackingBean
public static <T extends PersistenceEntity> EntityBackingBean<T> createEntityBackingBean(Component parentComponent, java.lang.Class<T> entityType, EntityDataSource eds, EntityViewConfig viewConfig, boolean manageMode, ContainerBean containerBean) throws SystemException
Create the EntityBackingBean for the entity.- Parameters:
parentComponent- parent component, can be nullentityType- entity typeeds- the EntityDataSource that contains the entity to showviewConfig- entityViewConfig. if null, use default.manageMode- manage mode. If true, entity editing will be enabled if user has the permission.containerBean- the ContainerBean of the EntityBackingBean to be created- Returns:
- EntityBackingBean instance
- Throws:
BackingBeanException- throw if an backing bean related error occursSystemException- throw if any other error occurs
-
createEntityBackingBean
public static <T extends PersistenceEntity> EntityBackingBean<? super T> createEntityBackingBean(Component parentComponent, java.lang.Class<T> entityType, java.lang.Class backingBeanType, EntityViewConfig viewConfig, EntityInitializer entityInitializer, ContainerBean containerBean, MenuNodeFactory menuNodeFactory, DataAccessUnit dataAccessUnit) throws BackingBeanException
Create entity backing bean for the entity initialized with the EntityInitializer.- Parameters:
parentComponent- parent componententityType- entity typebackingBeanType- the EntityBackingBean type override default mappingviewConfig- entityViewConfig. if null, use default.entityInitializer- entity property value initializer.containerBean- the ContainerBean of the EntityBackingBean to be createdmenuNodeFactory- entityType menu node factory with which the EntityBackingBean is associated.dataAccessUnit- the dataAccessUnit of the entity, ignored if null- Returns:
- EntityBackingBean instance
- Throws:
BackingBeanException- throw if an error occurs
-
createEntityListBackingBean
public static <T extends PersistenceEntity> EntityListBackingBean<T> createEntityListBackingBean(java.lang.Class<T> entityType, EntityDataSource eds, EntityListViewConfig viewConfig, boolean manageMode, ContainerBean containerBean) throws SystemException
Create entity list backing bean whose parentComponent is null.- Parameters:
entityType- entity typeeds- the EntityDataSource that contains a QueryCriteria to retrieve entities or a MemoryEntityList instance.viewConfig- entityViewConfig. if null, use default.manageMode- manage mode. If true, entity editing will be enabled if user has the permission.containerBean- the ContainerBean of the EntityBackingBean to be created- Returns:
- EntityBackingBean instance
- Throws:
BackingBeanException- throw if an backing bean related error occursSystemException- throw if any other error occurs
-
createEntityListBackingBean
public static <T extends PersistenceEntity> EntityListBackingBean<T> createEntityListBackingBean(Component parentComponent, java.lang.Class<T> entityType, EntityDataSource<T> eds, EntityListViewConfig viewConfig, boolean manageMode, ContainerBean containerBean) throws SystemException
Create entity list backing bean.- Parameters:
parentComponent- parent component, can be nullentityType- entity typeeds- the EntityDataSource that contains a QueryCriteria to retrieve entities or a MemoryEntityList instance.viewConfig- entityViewConfig. if null, use default.manageMode- manage mode. If true, entity editing will be enabled if user has the permission.containerBean- the ContainerBean of the EntityBackingBean to be created- Returns:
- EntityBackingBean instance
- Throws:
BackingBeanException- throw if an backing bean related error occursSystemException- throw if any other error occurs
-
getRenderRegionNumber
public static java.lang.Integer getRenderRegionNumber(java.util.List<java.lang.Integer> renderRegions)
Get the region number to put backing bean. It is the first region number in the list.- Parameters:
renderRegions- a list of region numbers.- Returns:
- region number. return 0 if the renderRegions is empty or null.
-
showEntity
public PageNavigation showEntity(java.lang.Class entityType, EntityDataSource eds, EntityViewConfig viewConfig, boolean manageMode, java.lang.Integer pageId) throws BackingBeanException, SystemException
Create the EntityBackingBean for the entity and place it in the PageContent of this ContainerBean for display.The render regions to show the bean can be specified in the EntityDataSource using
EntityDataSource.setRenderRegions(List, Boolean). If render regions is not specified, use the default regions for query results:getDefaultQueryResultsRenderRegions().- Parameters:
entityType- entity typeeds- the EntityDataSource that contains the entity to showviewConfig- entityViewConfig. if null, use default.manageMode- manage mode. If true, entity editing will be enabled if user has the permission.pageId- the pageId to navigate to if not null.- Returns:
- a PageNavigation
- Throws:
BackingBeanException- throw if an backing bean related error occursSystemException- throw if any other error occurs
-
showSingleEntity
public PageNavigation showSingleEntity(java.lang.Class entityType, java.util.List<CriteriaElement> propertyQueryElements, ParameterizedMessage title, boolean createIfEmpty, java.util.List<java.lang.Integer> renderRegions, boolean clearRenderRegions, EntityViewConfig viewConfig, MenuNodeFactory menuNodeFactory, DataAccessUnit dataAccessUnit) throws SystemException
Create an EntityBackingBean to show the entity retrieved by the query criteria specified by the propertyQueryElements.- Parameters:
entityType- entity typepropertyQueryElements- query criteriatitle- bean titlecreateIfEmpty- where to show a form to create if no entities are not foundrenderRegions- the render regions to show the entityclearRenderRegions- whether to clear existing beans in the render regionsviewConfig- entityViewConfig, null for using default.menuNodeFactory- the MenuNodeFactory that is associated with showing the entity- Returns:
- a PageNavigation
- Throws:
BackingBeanException- throw if an error occurs in creating the bean.SystemException- throw if an error occurs in retrieving the entity.
-
showBean
public PageNavigation showBean(BackingBean bean, java.lang.Integer regionNumber)
Add the bean to the region. All the existing beans in the region will be removed.- Parameters:
bean- the bean to showregionNumber- region number. if null, use default regions: getDefaultQueryResultsRenderRegions()- Returns:
- a PageNavigation
-
showBean
public PageNavigation showBean(BackingBean bean, java.util.List<java.lang.Integer> renderRegions, boolean clearRenderRegions)
Add the bean to the regions. The first region will be used to add the bean.- Parameters:
bean- the bean to showrenderRegions- render regions. null for default regionsclearRenderRegions- whether to remove existing bean in the regions. will be removed.- Returns:
- a PageNavigation
-
showBean
public PageNavigation showBean(BackingBean bean, boolean addGeneratedBeans, java.util.List<java.lang.Integer> renderRegions, boolean clearRenderRegions, java.lang.Integer regionForGeneratedBeans, java.lang.Integer pageId)
Add the bean to the regions. The first region will be used to add the bean.- Parameters:
bean- the bean to showaddGeneratedBeans- whether to add the regenerated beans of the beanrenderRegions- render regions. null for default regionsclearRenderRegions- whether to remove existing bean in the regions. will be removed.regionForGeneratedBeans- where to add generated beans if addGeneratedBeans is true. null for adding to the same region.pageId- a pageId to navigate. null to keep current page. and always be null for ajax.- Returns:
- a PageNavigation.
-
showBeanList
public PageNavigation showBeanList(java.util.List<BackingBean> beans, boolean addGeneratedBeans, java.util.List<java.lang.Integer> renderRegions, boolean clearRenderRegions, java.lang.Integer pageId)
Add a list beans to the regions. The first region will be used to add the bean.- Parameters:
beans- the beans to showaddGeneratedBeans- whether to add the regenerated beans of the beanrenderRegions- render regions. null for default regionsclearRenderRegions- whether to remove existing bean in the regions. will be removed.pageId- a pageId to navigate. null to keep current page. and always be null for ajax.- Returns:
- a PageNavigation.
-
showEntity
public PageNavigation showEntity(PersistenceEntity entity) throws BackingBeanException, SystemException
Create the EntityBackingBean for the entity and place it in the PageContent of this ContainerBean for display.The render regions to show the entity is the default regions for query results:
getDefaultQueryResultsRenderRegions().- Parameters:
entity- the entity to show- Returns:
- a PageNavigation
- Throws:
BackingBeanException- throw if an backing bean related error occursSystemException- throw if any other error occurs
-
showEntity
public PageNavigation showEntity(EntityTypeId entityTypeId) throws SystemException
Create the EntityBackingBean for the entity and place it in the PageContent of this ContainerBean for display.The render regions to show the entity is the default regions for query results:
getDefaultQueryResultsRenderRegions().- Parameters:
entityTypeId- the entityTypeId that identifies the entity to show.- Returns:
- a PageNavigation
- Throws:
BackingBeanException- throw if an backing bean related error occursSystemException- throw if any other error occurs
-
showEntity
public PageNavigation showEntity(PersistenceEntity entity, EntityViewConfig viewConfig, boolean manageMode) throws BackingBeanException, SystemException
Create the EntityBackingBean for the entity and place it in the PageContent of this ContainerBean for display.The render regions to show the entity is the default regions for query results:
getDefaultQueryResultsRenderRegions().- Parameters:
entity- the entity to show.viewConfig- entityViewConfig. if null, use default.manageMode- manage mode. If true, entity editing will be enabled if user has the permission.- Returns:
- a PageNavigation
- Throws:
BackingBeanException- throw if an backing bean related error occursSystemException- throw if any other error occurs
-
showEntityList
public PageNavigation showEntityList(java.lang.Class entityType, EntityDataSource eds, boolean manageMode) throws BackingBeanException, SystemException
Create an EntityListBackingBean for the entity list and place it in the PageContent of this ContainerBean for display.The entity list can be specified using
QueryCriteriaorMemoryEntityListin the EntityDataSource.The render regions to show the bean can be specified in the EntityDataSource using
EntityDataSource.setRenderRegions(List, Boolean). If render regions is not specified, use the default regions for query results:getDefaultQueryResultsRenderRegions().- Parameters:
entityType- entity typeeds- the EntityDataSource that specifies the entity list to showmanageMode- manage mode. If true, entity editing will be enabled if user has the permission.- Returns:
- a PageNavigation
- Throws:
BackingBeanException- throw if an backing bean related error occursSystemException- throw if any other error occurs
-
showEntityList
public PageNavigation showEntityList(java.lang.Class entityType, EntityDataSource eds, EntityListViewConfig viewConfig, boolean manageMode) throws BackingBeanException, SystemException
Create an EntityListBackingBean for the entity list and place it in the PageContent of this ContainerBean for display.The entity list can be specified using
QueryCriteriaorMemoryEntityListin the EntityDataSource.The render regions to show the bean can be specified in the EntityDataSource using
EntityDataSource.setRenderRegions(List, Boolean). If render regions is not specified, use the default regions for query results:getDefaultQueryResultsRenderRegions().- Parameters:
entityType- entity typeeds- the EntityDataSource that specifies the entity list to showviewConfig- entityListViewConfig. if null, use default.manageMode- manage mode. If true, entity editing will be enabled if user has the permission.- Returns:
- a PageNavigation
- Throws:
BackingBeanException- throw if an backing bean related error occursSystemException- throw if any other error occurs
-
showEntityList
public PageNavigation showEntityList(java.lang.Class entityType, EntityDataSource eds, boolean showCreateForm, boolean manageMode, java.lang.Integer pageId) throws BackingBeanException, SystemException
Create an EntityListBackingBean for the entity list and place it in the PageContent of this ContainerBean for display.The entity list can be specified using
QueryCriteriaorMemoryEntityListin the EntityDataSource.The render regions to show the bean can be specified in the EntityDataSource using
EntityDataSource.setRenderRegions(List, Boolean). If render regions is not specified, use the default regions for query results:getDefaultQueryResultsRenderRegions().- Parameters:
entityType- entity typeeds- the EntityDataSource that specifies the entity list to showshowCreateForm- whether to show a form to create new entitymanageMode- manage mode. If true, entity editing will be enabled if user has the permission.pageId- the page to navigate to- Returns:
- a PageNavigation
- Throws:
BackingBeanException- throw if an backing bean related error occursSystemException- throw if any other error occurs
-
showEntityList
public PageNavigation showEntityList(java.lang.Class entityType, EntityDataSource eds, EntityListViewConfig viewConfig, boolean manageMode, java.lang.Integer pageId) throws BackingBeanException, SystemException
Create an EntityListBackingBean for the entity list and place it in the PageContent of this ContainerBean for display.The entity list can be specified using
QueryCriteriaorMemoryEntityListin the EntityDataSource.The render regions to show the bean can be specified in the EntityDataSource using
EntityDataSource.setRenderRegions(List, Boolean). If render regions is not specified, use the default regions for query results:getDefaultQueryResultsRenderRegions().- Parameters:
entityType- entity typeeds- the EntityDataSource that specifies the entity list to showviewConfig- entityListViewConfig. if null, use default.manageMode- manage mode. If true, entity editing will be enabled if user has the permission.pageId- the page to navigate to- Returns:
- a PageNavigation
- Throws:
BackingBeanException- throw if an backing bean related error occursSystemException- throw if any other error occurs
-
showEntityList
public PageNavigation showEntityList(java.lang.Class entityType, EntityDataSource eds, EntityListViewConfig viewConfig, boolean showCreateForm, boolean manageMode, java.lang.Integer pageId, boolean createIfEmpty) throws BackingBeanException, SystemException
Create an EntityListBackingBean for the entity list and place it in the PageContent of this ContainerBean for display.The entity list can be specified using
QueryCriteriaorMemoryEntityListin the EntityDataSource.The render regions to show the bean can be specified in the EntityDataSource using
EntityDataSource.setRenderRegions(List, Boolean). If render regions is not specified, use the default regions for query results:getDefaultQueryResultsRenderRegions().- Parameters:
entityType- entity typeeds- the EntityDataSource that specifies the entity list to showviewConfig- entityListViewConfig. if null, use default.showCreateForm- whether to show a form to create new entitymanageMode- manage mode. If true, entity editing will be enabled if user has the permission.pageId- the page to navigate tocreateIfEmpty- whether to show a form to create if the entity list is empty.- Returns:
- a PageNavigation
- Throws:
BackingBeanException- throw if an backing bean related error occursSystemException- throw if any other error occurs
-
createEntity
public static <T extends PersistenceEntity> EntityBackingBean<? super T> createEntity(java.lang.Class<T> entityType, java.util.List<CriteriaElement> propertyQueryElements, EntityViewConfig viewConfig, ContainerBean containerBean, MenuNodeFactory menuNodeFactory, DataAccessUnit dataAccessUnit) throws BackingBeanException
Create an EntityBackingBean for creating entity- Parameters:
entityType- entity typepropertyQueryElements- the property value initializerviewConfig- entityViewConfig. if null, use default.containerBean- the containerBean of the EntityBackingBean to be createdmenuNodeFactory- the MenuNodeFactory that is associated with showing the entitydataAccessUnit- the DataAccessUnit of the entity to be created- Returns:
- an EntityBackingBean
- Throws:
BackingBeanException- throw if an error occurs
-
getQueryPageId
protected java.lang.Integer getQueryPageId()
Get the page to show query form. Default is current page.- Returns:
- page
-
showQueryFormBean
public <T extends PersistenceEntity> PageNavigation showQueryFormBean(java.lang.Class<T> entityType, EntityInitializer entityInitializer, boolean showQueryForm, EntityViewConfig queryViewConfig, java.util.List<java.lang.Integer> renderRegions, boolean showQueryResults, EntityListViewConfig queryResultViewConfig, QueryResultTransformer queryResultTransformer, MenuNodeFactory menuNodeFactory, DataAccessUnit dataAccessUnit) throws SystemException
Show query form and/or query results beans for the entity type.- Parameters:
entityType- the entity type to queryentityInitializer- the entity initializer for queryshowQueryForm- whether to show query formqueryViewConfig- query viewConfigrenderRegions- the region numbers to show the query form beanshowQueryResults- whether to show query resultsqueryResultViewConfig- query results viewConfig. If not null, it will be merged to queryViewConfig's queryResultsViewConfig.queryResultTransformer- query result transformer that is used to transform entities retrieved from persistence.menuNodeFactory- the MenuNodeFactory that is associated with showing query form and/or query results- Returns:
- a PageNavigation
- Throws:
SystemException- throw if an error occurs in creating backing beans
-
initPageInfo
protected void initPageInfo() throws SystemExceptionInitialize page info including icon, logo, title, meta keywords and description.- Throws:
SystemException- throw if an error occurs
-
getOutputLink
public java.lang.String getOutputLink(PersistenceEntity entity, boolean trackSession) throws SystemException
Get the bookmarkable URL to show the entity- Parameters:
entity- the entity to showtrackSession- if true, add session id to the URL if necessary- Returns:
- url, default is null.
- Throws:
SystemException- throw if an error occurs
-
clear
public void clear()
Clear pageContent, containerMenu and properties.
-
cleanCache
public void cleanCache()
Clean cache, including cached ResourceBundle.- Since:
- 5.4
-
localeChanged
public void localeChanged() throws SystemExceptionThis method will be called when user locale is changed.- Throws:
SystemException- throw if an error occurs- Since:
- 5.21
-
setParameter
public void setParameter(java.lang.String name, java.lang.Object value)Set parameter value.- Parameters:
name- property namevalue- property value
-
removeParameter
public void removeParameter(java.lang.String name)
Remove the parameter with the name.- Parameters:
name- the name of the parameter to remove
-
getParameter
public java.lang.Object getParameter(java.lang.String name)
Get parameter value for the name.- Parameters:
name- parameter name- Returns:
- parameter value
-
getDialogBean
public DialogBean getDialogBean(boolean create, DialogBean.DialogType type)
Get or create dialogBean from this containerBean.If the dialog exists, it will not be re-rendered including its title, icons. But if its content changes, changed content will be refreshed.
if a new dialog is created, it will be opened automatically. For a completely new dialog, call newDialogBean(), which will override existing dialogBean if any.
- Parameters:
create- if true, create new dialog if the dialog does not exist.type- the dialogType of the new dialog to create- Returns:
- dialogBean
-
getDialogBean
public DialogBean getDialogBean(boolean create)
Get or create dialogBean(type:REGULAR) from this containerBean.If the dialog exists, it will not be re-rendered including its title, icons. But if its content changes, changed content will be refreshed.
if a new dialog is created, it will be opened automatically. For a completely new dialog, call newDialogBean(), which will override existing dialogBean if any.
- Parameters:
create- if true, create new dialog(type: REGULAR) if the dialog does not exist.- Returns:
- dialogBean
-
newDialogBean
public DialogBean newDialogBean(DialogBean.DialogType type)
Create a new dialog from this containerBean, existing dialogBean (if any) of this containerBean will be overridden since one containerBean can have one dialogBean only. DialogBean can have its own dialogBean.- Parameters:
type- dialogType- Returns:
- a new dialogBean
-
newDialogBean
public DialogBean newDialogBean()
Create a new dialog (type: REGULAR) from this containerBean, existing dialogBean (if any) of this containerBean will be overridden since one containerBean can have one dialogBean only. DialogBean can have its own dialogBean.- Returns:
- a new dialogBean
-
getDialogBean
public DialogBean getDialogBean()
Get existing dialogBean of this containerBean.- Returns:
- a DialogBean
-
createDialogBean
protected DialogBean createDialogBean(DialogBean.DialogType type)
Create a dialogBean that is a child component of this containerBean.- Parameters:
type- dialogType- Returns:
- DialogBean
-
clone
public java.lang.Object clone()
- Overrides:
clonein classjava.lang.Object
-
isDialogOpened
public boolean isDialogOpened()
Is the dialogBean of this ContainerBean visible?- Returns:
- true if dialogBean is visible.
-
isLayoutFullPage
public boolean isLayoutFullPage()
Whether layout code is full page layout? If yes, <body> is the border layout target.- Returns:
- true for full page layout
-
setLayoutFullPage
public void setLayoutFullPage(boolean layoutFullPage)
Set whether layout code is full page layout. If yes, <body> is the border layout target.- Parameters:
layoutFullPage- true for full page layout
-
getRootContainerBean
public ContainerBean getRootContainerBean()
Get root containerBean. A dialogBean's containerBean can be dialogBean or root.- Returns:
- root containerBean.
-
getLeafContainerBean
public ContainerBean getLeafContainerBean()
Get leaf containerBean. A containerBean has at most one child dialog bean,- Returns:
- containerBean
- Since:
- 5.13
-
isRoot
public boolean isRoot()
Is this containerBean the root contianerBean?- Returns:
- true if this containerBean is the root
-
getPathIdentifier
public java.lang.String getPathIdentifier()
Get container path identifier: path in the container/dialog tree For example: c0_c1_c1, start from root: first child, second child, third child, and so on.- Returns:
- path identifier, null for root containerBean.
-
getChildPathIdentifier
public java.lang.String getChildPathIdentifier(int childIndex)
Get the path identifier for child contianerBean- Parameters:
childIndex- the index of child containerBean.- Returns:
- child container path identifier
-
isValidPathIdentifier
public boolean isValidPathIdentifier(java.lang.String pathId)
Whether the pathId is valid in terms of syntax. empty: is valid for root.- Parameters:
pathId- the path identifier to verify- Returns:
- true if valid, false otherwise
-
findChildByPathIdentifier
public ContainerBean findChildByPathIdentifier(java.lang.String pathId)
Get the child containerBean from the path identifier- Parameters:
pathId- path identifier- Returns:
- child ContainerBean
-
getChildIndex
public int getChildIndex(ContainerBean childContainerBean)
Get the index of the child containerBean. The index is always 0 since only one child dialog is supported.- Parameters:
childContainerBean- child containerBean- Returns:
- index. return -1 if the childContainerBean is not the child DialogBean.
-
getChildContainerBean
public ContainerBean getChildContainerBean(int childIndex)
Get the child containerBean at the index. The index is always 0 since only one child dialog is supported.- Parameters:
childIndex- the index of child containerBean- Returns:
- child ContainerBean. return null if not found.
-
isSameOrDescendantContainerBean
public boolean isSameOrDescendantContainerBean(ContainerBean containerBean)
Is the containerBean the same as this ContainerBean or a descendant of this ContainerBean?- Parameters:
containerBean- a ContainerBean- Returns:
- true if the containerBean is the same or a descendant, false otherwise.
-
getDefaultQueryRenderRegions
public abstract java.util.List<java.lang.Integer> getDefaultQueryRenderRegions()
Get the default render regions to show query form (EntityBackingBean query view). The first region is used to add beans. The rest of regions may be cleared.- Returns:
- a list of region numbers.
- See Also:
EntityDataSource.isClearRenderRegions()
-
getDefaultQueryResultsRenderRegions
public abstract java.util.List<java.lang.Integer> getDefaultQueryResultsRenderRegions()
Get the default render regions to show query results, including any backing beans that is not a query EntityBackingBean. The first region is used to add beans. The rest of regions may be cleared.- Returns:
- a list of region numbers.
- See Also:
EntityDataSource.isClearRenderRegions()
-
showMessageDialog
public PageNavigation showMessageDialog(java.util.List<ParameterizedMessage> messages) throws SystemException
Open a message dialog with title: INFO.- Parameters:
messages- a list of messages to show in the dialog- Returns:
- a PageNavigation
- Throws:
SystemException- throw if an error occurs
-
showMessageDialog
public PageNavigation showMessageDialog(ParameterizedMessage title, java.util.List<ParameterizedMessage> messages) throws SystemException
Open a message dialog.- Parameters:
title- dialog titlemessages- a list of messages to show in the dialog- Returns:
- a PageNavigation
- Throws:
SystemException- throw if an error occurs
-
showConfirmDialog
public PageNavigation showConfirmDialog(ParameterizedMessage title, java.util.List<BackingBeanMessage> messages, ConfirmBean.Command[] commands, java.lang.String[] commandVisibleNames, DialogBean dialogBean) throws SystemException
Show confirm dialog with the messages and commands.- Parameters:
title- dialog titlemessages- message contentcommands- commands to show on the bottomcommandVisibleNames- command visible names. if null, use command names.dialogBean- if null, a new dialogBean instance will be create. DialogListener can be set in dialogBean.- Returns:
- a PageNavigation
- Throws:
SystemException- throw if an error occurs- See Also:
ConfirmBean
-
showConfirmDialogWithBeans
public PageNavigation showConfirmDialogWithBeans(ParameterizedMessage title, java.util.List<PersistenceDataBackingBean> beans, ConfirmBean.Command[] commands, java.lang.String[] commandVisibleNames, DialogBean dialogBean) throws SystemException
Show confirm dialog with the list of beans as content and commands.- Parameters:
title- dialog titlebeans- a list of beans as contentcommands- commands to show on the bottomcommandVisibleNames- command visible names. if null, use command names.dialogBean- if null, a new dialogBean instance will be create. DialogListener can be set in dialogBean.- Returns:
- a PageNavigation
- Throws:
SystemException- throw if an error occurs- Since:
- 5.20
- See Also:
ConfirmBean
-
showProgressDialog
public PageNavigation showProgressDialog(MenuNode targetMenuNode, java.lang.Integer initialValue, java.lang.String labelTemplate, boolean ajax, boolean displayOnly, boolean closeDilaogOncomplete) throws SystemException
Show progress dialog.- Parameters:
targetMenuNode- the menu node for which to track progressinitialValue- progress initial value, default is zero.labelTemplate- progress label template such as {value}%, use default if nullajax- whether to ajax poll progress value from server sidedisplayOnly- whether to display progress staticallycloseDilaogOncomplete- whether to close progress dialog when targetMenuNode command is successfully executed- Returns:
- a webPage (null)
- Throws:
SystemException- throw if an error occurs in creating progress bean- See Also:
ProgressBean.createProgressModalDialog(MenuNode, Integer, String, boolean, boolean, boolean, ContainerBean)
-
getBackingBeanContext
public BackingBeanContext getBackingBeanContext()
Get the cached BackingBeanContext that is session scope. it is same asBackingBeanContext.getInstance(), but cached in this ContainerBean.- Overrides:
getBackingBeanContextin classComponent- Returns:
- BackingBeanContext instance
-
getContainerBean
public ContainerBean getContainerBean()
Get the parent ContainerBean of this ContainerBean- Overrides:
getContainerBeanin classComponent- Returns:
- parent containerBean
-
setContainerBean
public void setContainerBean(ContainerBean containerBean)
Set the parent ContainerBean of this ContainerBean- Parameters:
containerBean- parent containerBean
-
entityCommitted
public <T extends PersistenceEntity> void entityCommitted(PersistenceDataBackingBean<T> backingBean, java.util.List<T> entities, ActionDescriptor ad) throws SystemException
entityCommitted: called when an entity is created, deleted, or changed in persistence. default: do nothing.- Parameters:
backingBean- the backing bean of the entities committedentities- the entities created, deleted or changed.ad- ActionDescriptor- Throws:
SystemException- throw if an error occurs
-
getPrintViewContainerBean
public ContainerBean getPrintViewContainerBean()
Get the containerBean that is used to show content for print view.- Returns:
- ContainerBean instance. default is this ContainerBean.
-
getPrintViewPageId
public java.lang.Integer getPrintViewPageId()
Get the print view page Id.- Returns:
- page id, default is null using the same page
- See Also:
PageNavigation
-
handleError
public java.lang.String handleError(java.lang.Throwable t)
Handle error. Show or log error message.- Parameters:
t- a Throwable- Returns:
- action result for page navigation.
-
getLocale
public java.util.Locale getLocale()
Get the current locale for current user.
-
getLocaleLanguageTag
public java.lang.String getLocaleLanguageTag()
Get user locale as language tag such as en-US.- Returns:
- language tag
- Since:
- 5.18
-
getUrlLocaleLanguageTag
public java.lang.String getUrlLocaleLanguageTag()
Get URL locale as language tag such as en-US, used as URL locale parameter value.- Returns:
- language tag
- Since:
- 6.0
-
postAddToView
public void postAddToView()
postAddToView: called after viewRoot is added to view when building new view or restoring view.- Since:
- 6.0
-
preRenderView
public void preRenderView() throws SystemExceptionpreRenderView: called after buildView and before renderView.- Throws:
SystemException- throw if an error occurs
-
isRenderable
public boolean isRenderable()
Whether this containerBean is renderable. Default is true. If it is not renderable, any components of this containerBean will not be added to render targets.- Returns:
- true if renderable.
-
setRenderable
public void setRenderable(boolean renderable)
Set whether this containerBean is renderable. Default is true. If it is not renderable, any components of this containerBean will not be added to render targets.- Parameters:
renderable- true if renderable
-
isSaveStates
public boolean isSaveStates()
Whether to save states for JSF pages backed by this containerBean? Saving states is disabled for bots(search engines). If request parameter saveState=false, saving states will be disabled. But saveState=true will be ignored.Saving states should be disabled for pages that does not have any POST actions.
- Returns:
- true if saving states. default is true.
-
setSaveStates
public void setSaveStates(java.lang.Boolean saveStates)
Set whether to save states for JSF pages backed by this containerBean- Parameters:
saveStates- true for saving status. null for using default.
-
getLogo
public java.lang.String getLogo()
Get the logo URL of the view backed by this containerBean. Default is the instanceType icon of current bound InstanceType.- Returns:
- image URL such as http://domain:port/context/image/logo.png. return null if icon is not defined for the instanceType.
-
getTitle
public ParameterizedMessage getTitle(boolean includeBrand) throws SystemException
Get the title of the view backed by this ContainerBean, which is usually shown on the top of a page. It is different from page title that is shown as browser title. Default is the name of current bound instanceType.- Parameters:
includeBrand- whether to include brand name- Returns:
- instanceType name that is translated using resource bundle
- Throws:
SystemException- throw if an error occurs
-
getDisplayTitle
public final java.lang.String getDisplayTitle(boolean includeBrand) throws SystemExceptionGet the title of the view for display using resource bundle.- Parameters:
includeBrand- whether to include brand name- Returns:
- display title
- Throws:
SystemException- throw if an error occurs in getting title from bean
-
getName
public abstract java.lang.String getName()
Get the name of this ContainerBean.- Returns:
- container name
-
getPageSize
public java.lang.Integer getPageSize()
Get the page size (rows per page) for this ContainerBean for current user.- Returns:
- page size
-
isMobile
public boolean isMobile()
Whether user agent is mobile or desktop?- Returns:
- true for mobile, false for desktop.
-
getViewInfo
public ViewInfo getViewInfo()
Get the ViewInfo of the view backed by this container bean.- Returns:
- ViewInfo instance
-
setViewInfo
public void setViewInfo(ViewInfo viewInfo)
Set the ViewInfo of the view backed by this container bean.- Parameters:
viewInfo- ViewInfo instance
-
isOpenDialogSupported
public boolean isOpenDialogSupported()
Can a dialog be opened from this containerBean? default is true.- Returns:
- true if a dialog can be opened.
-
getPageInfo
public PageInfo getPageInfo()
Get page info that contains page title, keywords and description.- Returns:
- PageInfo instance
-
setPageInfo
public void setPageInfo(PageInfo pageInfo)
Set page info that contains page title, keywords and description.- Parameters:
pageInfo- PageInfo instance
-
getStyleClass
public java.lang.String getStyleClass()
Get containerBean styleClass that is associated with containerBean name and responsive type(mobile or desktop).Desktop: ui-[containerBean name] ui-desktop Mobile: ui-[containerBean name]
For mobile, <html> tag will be enhanced by adding ui-mobile style class.- Returns:
- style class
-
clearRegionsOnCommand
public void clearRegionsOnCommand(MenuNode menuNode)
Clear regions before executing the command of the menu node. Default doing nothing.- Parameters:
menuNode- the menu node to click- Since:
- 5.5
- See Also:
MenuViewConfig.getClearRegionsOnCommand(String)
-
getPage
public Page getPage()
Get the page shown in this containerBean.- Returns:
- Page instance. return null there is no page shown.
- Since:
- 5.5
-
getPageObjectResolver
public final PageObjectResolver getPageObjectResolver()
Get page embedded object (bean) resolver. If not initialized, it will be created and cached.- Returns:
- PageObjectResolver instance
- Since:
- 5.7
-
createPageObjectResolver
protected abstract PageObjectResolver createPageObjectResolver()
Create a page object (bean) resolver.- Returns:
- PageObjectResolver instance
- Since:
- 6.0
-
getBeansOfEntityType
public <T extends PersistenceEntity> java.util.List<PersistenceDataBackingBean<T>> getBeansOfEntityType(java.lang.Class<T> entityType, boolean recursive, ViewType... viewTypes)
Find all beans(entity and/or entity list beans) with the entity type (or its subclass).- Parameters:
entityType- entity typeviewTypes- if not null, return those whose viewType matching one of the viewTypesrecursive- if true, search this containerBean and its descendant dialogBeans. if false, search this containerBean only.- Returns:
- a list of beans
- Since:
- 5.13
-
getFirstBeanOfEntityType
public <T extends PersistenceEntity> PersistenceDataBackingBean<T> getFirstBeanOfEntityType(java.lang.Class<T> entityType, boolean recursive, ViewType... viewTypes)
Find the first bean(entity and/or entity list bean) with the entity type (or its subclass).- Parameters:
entityType- entity typeviewTypes- if not null, return those whose viewType matching one of the viewTypesrecursive- if true, search this containerBean and its descendant dialogBeans. if false, search this containerBean only.- Returns:
- a PersistenceDataBackingBean
- Since:
- 5.19
-
walkComponentTree
public void walkComponentTree(Component.ComponentVisitor visitor) throws SystemException
Description copied from class:ComponentWalk component tree and call visitor on each visited component.- Specified by:
walkComponentTreein classComponent- Parameters:
visitor- component visitor- Throws:
SystemException- throw if an error occurs
-
getBorderLayout
public abstract BorderLayout getBorderLayout() throws SystemException
Get borderLayout.- Returns:
- BorderLayout object.
- Throws:
SystemException- Since:
- 6.0
-
-