Application Structure

Controllers

Overview

Controllers class diagram

Reference

AbstractController

AbstractController

Abstract base class for controllers. Controllers role is to adapt the application to its environment. Jspresso relies on two different types of controllers :

  • The frontend controller is responsible for managing UI interactions. Naturally, the type of frontend controller used depends on the UI channel.
  • The backend controller is responsible for managing the application session as well as transactions and persistence operations.

AbstractController properties
Property Description

customExceptionHandler

IException​Handler

Configures a custom exception handler on the controller. The controller itself is an exception handler and is used as such across most of the application layers. Jspresso philosophy is to use unchecked exceptions in services, business rules, and so on, so that, whenever an exception occurs, it climbs the call stack up to an exception handler (usually one of the controller). Whenever a custom exception handler is configured, the exception handling is delegated to it, allowing the exceptions to be refined or handled differently than for the built-in case. The exception handler can either :

  • return true if the exception was completely processed and does not need any further action.
  • return false if the exception was either not or un-completely processed and needs to continue the built-in handling.

liveDebugUI

boolean

Sets live debug ui.

loginContextName

String

Configures the name of the JAAS login context to use to authenticate users. It must reference a valid JAAS context that is installed in the JVM, either through setting the java.security.auth.login.config system property or through server-specific configuration.


AbstractBackendController

Base class for backend application controllers. Backend controllers are responsible for :

  • keeping a reference to the application session
  • keeping a reference to the application workspaces and their state
  • keeping a reference to the application clipboard
  • keeping a reference to the entity registry that guarantees the in-memory entity reference unicity in the user session
  • keeping a reference to the entity dirt recorder that keeps track of entity changes to afterwards optimize the ORM operations
  • keeping a reference to the Spring transaction template and its peer "Unit of Work" -aka UOW- that is responsible to manage application transactions and adapt the underlying transaction system (Hibernate, JTA, ...)
Moreover, the backend controller will provide several model related factories that can be configured to customize default, built-in behaviour. Most of these configured properties will be accessible using the corresponding getters. Those getters should be used by the service layer.

AbstractBackendController properties
Property Description

actionMonitoringPlugin

IAction​Monitoring​Plugin

Sets action monitoring plugin.

applicationSession

IApplication​Session

Assigns the application session to this backend controller. This property can only be set once and should only be used by the DI container. It will rarely be changed from built-in defaults unless you need to specify a custom implementation instance to be used.

asyncActionsThreadGroup

Thread​Group

Sets async actions thread group.

asyncExecutorsMaxCount

int

Configures the maximum count of concurrent asynchronous action executors. It defaults to 10.

carbonEntityCloneFactory

IEntity​Clone​Factory

Configures the entity clone factory used to carbon-copy entities. An entity carbon-copy is an technical copy of an entity, including id and version but excluding relationship properties. This mechanism is used by the controller when duplicating entities into the UOW to allow for memory state aware transactions. This property should only be used by the DI container. It will rarely be changed from built-in defaults unless you need to specify a custom implementation instance to be used.

clientTimeZone

Time​Zone

Sets client time zone.

collectionFactory

IComponent​Collection​Factory

Configures the factory responsible for creating entities (or components) collections that are held by domain relationship properties. This property should only be used by the DI container. It will rarely be changed from built-in defaults unless you need to specify a custom implementation instance to be used.

customSecurityPlugin

ISecurity​Plugin

Configures a custom security plugin on the controller. The controller itself is a security handler and is used as such across most of the application layers. Before delegating to the custom security handler, the controller will apply role-based security rules that cannot be disabled.

customTranslationPlugin

ITranslation​Plugin

Configures a custom translation plugin on the controller. The controller itself is a translation provider and is used as such across most of the application layers. The custom translation plugin is used to override the default static, bundle-based, i18n scheme.

dirtyTrackingEnabled

boolean

{@inheritDoc}

entityFactory

IEntity​Factory

Configures the entity factory to use to create new entities. Backend controllers only accept instances of ControllerAwareProxyEntityFactory or a subclass. This is because the backend controller must keep track of created entities. Jspresso entity implementations also use the controller from which they were created behind the scene.

modelConnectorFactory

IModel​Connector​Factory

Configures the model connector factory to use to create new model connectors. Connectors are adapters used by the binding layer to access domain model values.

referenceTimeZoneId

String

Sets reference time zone id.

slaveControllerFactory

IBackend​Controller​Factory

Sets the slaveControllerFactory.

throwExceptionOnBadUsage

boolean

Configures the backend controller to throw or not an exception whenever a bad usage is detected like manually merging a dirty entity from an ongoing UOW.

transactionTemplate

Transaction​Template

Assigns the Spring transaction template to this backend controller. This property can only be set once and should only be used by the DI container. It will rarely be changed from built-in defaults unless you need to specify a custom implementation instance to be used.

The configured instance is the one that will be returned by the controller's getTransactionTemplate() method that should be used by the service layer for transaction management.

translationProvider

ITranslation​Provider

Configures the translation provider used to compute internationalized messages and labels.

userPreferencesStore

IPreferences​Store

Sets the user preference store.


HibernateBackendController

This is the default Jspresso implementation of Hibernate-based backend controller.

HibernateBackendController properties
Property Description

defaultTxFlushMode

String

Sets the default Hibernate flush mode to apply to the Hibernate session when it is bound to a transaction. Defaults to {@link FlushMode#COMMIT}.

entityFactory

IEntity​Factory

Configures the entity factory to use to create new entities. Backend controllers only accept instances of HibernateControllerAwareProxyEntityFactory or a subclass.

hibernateSessionFactory

Session​Factory

Sets the hibernateSessionFactory.

noTxDataSource

Data​Source

Sets the noTxDataSource.


AbstractFrontendController

Base class for frontend application controllers. Frontend controllers are responsible for adapting the Jspresso application to the UI channel. Although this generic abstract class centralizes most of the controller's configuration, it will be subclassed by concrete, UI dependent subclasses to implement polymorphic behaviour.

More than a behavioural adapter, the frontend controller will also be the place where you define the top-level application structure like the workspace list, the name, the application-wide actions, ...

AbstractFrontendController properties
Property Description

actionMap

Action​Map

Configures an application-wide action map that will be installed in the main application frame. These actions are available at any time from the UI and thus, do not depend on the active workspace. General purpose actions like "Change password" action should be installed here.

checkActionThreadSafety

boolean

Sets the checkActionThreadSafety.

clientPreferencesStore

IPreferences​Store

Sets the clientPreferenceStore.

description

String

Sets the application description i18n key. The way this description is actually leveraged depends on the UI channel.

exitAction

IDisplayable​Action

Configures the exit action to be executed whenever the user wants to quit the application. The default installed exit action first checks for started module(s) dirty state(s), then notifies user of pending persistent changes. When no flush is needed or the user bypasses them, the actual exit is performed.

forcedStartingLocale

String

Configures the locale used to initiate the login process. Whenever the forced starting locale is null, the client host default locale is used.

As soon as the user logs-in, his locale is then used to translate the UI. Whenever the login process is disabled, then the forced starting locale is kept as the UI i18n locale.

frameHeight

Integer

Sets the preferred application frame height. How this dimension is leveraged depends on the UI channel.

frameWidth

Integer

Sets the preferred application frame width. How this dimension is leveraged depends on the UI channel.

helpActionMap

Action​Map

Configures the help action map. The help action map should contain actions that are related to helping the user (online help, reference manual, tutorial, version dialog...).

The help action map is visually distinguished from the regular application action map. For instance elp actions can be represented in a menu that is right-aligned in the menu bar.

i18nDescription

String

Sets i 18 n description.

i18nName

String

Sets i 18 n name.

iconImageURL

String

Sets the icon image URL that is used as the application icon. Supported URL protocols include :

  • all JVM supported protocols
  • the jar:/ pseudo URL protocol
  • the classpath:/ pseudo URL protocol

loginAction

IAction

Configures an action to be executed just after the user has successfully logged-in but before any UI initialization has begun. An example of such an action would be constructing a map of dynamic user right based on some arbitrary data store so that the UI construction can actually depend on these extracted values.

loginViewDescriptor

IView​Descriptor

Configures the view descriptor used to create the login dialog. The default built-in login view descriptor includes a standard login/password form.

mvcBinder

IMvc​Binder

Configures the MVC binder used to apply model-view bindings. There is hardly any reason for the developer to change the default binder but it can be customized here.

name

String

Sets the application name i18n key. The way this name is actually leveraged depends on the UI channel but it typically generates (part of the) frame title.

navigationActionMap

Action​Map

Configures the navigation action map. The navigation action map should contain actions that are related to navigating the modules and workspace history, e.g. previous, next, home, and so on.

onModuleEnterAction

IAction

Configures an action to be executed each time a module of the application is entered. The action is executed in the context of the module the user enters.

onModuleExitAction

IAction

Configures an action to be executed each time a module of the application is exited. The action is executed in the context of the module the user exits. Default frontend controller configuration installs an action that checks current module dirty state.

onModuleStartupAction

IAction

Configures an action to be executed each time a module of the application is started. The action is executed in the context of the module the user starts.

secondaryActionMap

Action​Map

Assigns the view secondary action map. Same rules as the primary action map apply except that actions in this map should be visually distinguished from the main action map, e.g. placed in another toolbar.

startupAction

IAction

Configures an action to be executed on an empty UI context when the application starts. The action executes once the user has logged-in and the main UI has been constructed based on its access rights.An example of such an action would be a default workspace/module opening and selection, a "tip of the day" like action, ...

viewFactory

IView​Factory​<​E​,F​,G​>​

Configures the view factory used to create views from view descriptors. Using a custom view factory is typically needed for extending Jspresso to use custom view descriptors / UI components. Of course, there is a view factory concrete type per UI channel.

workspaces

List​<​Workspace​>​

Configures the workspaces that are available in the application. Workspaces are application entry-points and are hierarchically composed of modules / sub-modules.

workspacesMenuIconImageUrl

String

Sets the icon image URL that is used as the workspace menu icon. Supported URL protocols include :

  • all JVM supported protocols
  • the jar:/ pseudo URL protocol
  • the classpath:/ pseudo URL protocol


AbstractRemoteController

This is is the base implementation of all "remotable" frontend controller.

AbstractRemoteController properties
Property Description

description

String

name

String

statusInfo

String

{@inheritDoc}


DefaultRemoteController

This is is the default implementation of a "remotable" frontend controller. It will implement a 3-tier architecture. The remote controller lives on server-side and communicates with generic UI engines that are deployed on client side. As of now, the remote frontend controller is used by the Flex and qooxdoo frontends. Communication happens through the use of generic UI commands that are produced/consumed on both sides of the network.

DefaultRemoteController properties
Property Description

clipboardContent

String

{@inheritDoc}


MobileRemoteController

This is is the mobile implementation of a "remotable" frontend controller.

MobileRemoteController properties
Property Description

clipboardContent

String

Not supported in mobile environment.

{@inheritDoc}

singleModuleWorkspaceShortcut

boolean

Sets single module workspace shortcut.


DefaultSwingController

This is is the default implementation of the Swing frontend controller. It will implement a 2-tier architecture that is particularly useful for the development/debugging phases. Workspaces are displayed using an MDI UI using internal frames.

DefaultSwingController properties
Property Description

clipboardContent

String

{@inheritDoc}

name

String

{@inheritDoc}

statusInfo

String

{@inheritDoc}


Modules

Overview

Modules class diagram

Reference

Workspace

Workspace

A workspace is an group of functional application modules. You may decide arbitrarily how to group modules into workspaces but a good approach might be to design the workspaces based on roles (i.e. business activities). This helps to clearly separates tasks-unrelated modules and eases authorization management since a workspace can be granted or forbidden as a whole by Jspresso security.

Workspaces might be graphically represented differently depending on the UI technology used. For instance, the Swing and ULC channels use a MDI UI in which each workspace is represented as an internal frame (document). On the other hand, Flex and qooxdoo channels represent workspaces stacked in an accordion. Whatever the graphical representation is, there is at most one workspace active at a time for a user session - either the active (focused) internal frame or the expanded accordion section.

Workspace properties
Property Description

description

String

Configures the key used to translate actual internationalized workspace description. The resulting translation will generally be leveraged as a toolTip on the UI side but its use may be extended for online help.

grantedRoles

Collection​<​String​>​

Assigns the roles that are authorized to start this workspace. It supports "!" prefix to negate the role(s). Whenever the user is not granted sufficient privileges, the workspace is not installed at all in the application frame. Setting the collection of granted roles to null (default value) disables role based authorization on this workspace.

headerDescription

String

Configures the key used to translate actual internationalized workspace header description. The resulting translation will generally be leveraged as a text header on the UI side.

i18nHeaderDescription

String

Sets i 18 n header description.

i18nPageHeaderDescription

String

Sets i 18 n page header description.

iconImageURL

String

Sets the icon image URL of this workspace. Supported URL protocols include :

  • all JVM supported protocols
  • the jar:/ pseudo URL protocol
  • the classpath:/ pseudo URL protocol

iconPreferredHeight

int

Sets the icon preferred width.

iconPreferredWidth

int

Sets the icon preferred width.

iconProvider

Icon​Provider

Since a workspace is represented as a tree view of modules, this property can be used to customize an icon image URL provider on the created tree view (see BasicTreeViewDescriptor.iconImageURLProvider). However, the workspace built-in icon image URL provider ( WorkspaceIconImageURLProvider) will setup sensible defaults so that it unlikely has to be changed.

itemSelectionAction

IAction

Configures the action to be installed as item selection action on the rendered module tree view - see BasicTreeViewDescriptor.itemSelectionAction. The configured action will then be executed each time a module selection changes in the workspace.

modules

List​<​Module​>​

Installs a list of module(s) into this workspace. Each module may own sub-modules that form a (potentially complex and dynamic) hierarchy, that is visually rendered as a tree view.

name

String

Configures the key used to translate actual internationalized workspace name. The resulting translation will be leveraged as the workspace label on the UI side.

pageHeaderDescription

String

Configures the key used to translate actual internationalized workspace page header description. The resulting translation will generally be leveraged as a textual section that explains the workspace goal.

permId

String

Sets the permanent identifier to this application element. Permanent identifiers are used by different framework parts, like dynamic security or record/replay controllers to uniquely identify an application element. Permanent identifiers are generated by the SJS build based on the element id but must be explicitly set if Spring XML is used.

startExpanded

boolean

Sets expanded.

startupAction

IAction

Configures an action to be executed the first time the workspace is "started" by the user. The action will execute in the context of the workspace but with no specific module selected. It will help initializing workspace values, notify user, ...


MobileWorkspace

A workspace is an group of functional application modules. You may decide arbitrarily how to group modules into workspaces but a good approach might be to design the workspaces based on roles (i.e. business activities). This helps to clearly separates tasks-unrelated modules and eases authorization management since a workspace can be granted or forbidden as a whole by Jspresso security.

Workspaces might be graphically represented differently depending on the UI technology used. For instance, the Swing and ULC channels use a MDI UI in which each workspace is represented as an internal frame (document). On the other hand, Flex and qooxdoo channels represent workspaces stacked in an accordion. Whatever the graphical representation is, there is at most one workspace active at a time for a user session - either the active (focused) internal frame or the expanded accordion section.

MobileWorkspace properties
Property Description
This class does not have any specific property.

Module

Module

A module is an entry point in the application. Modules are organized in bi-directional, parent-children hierarchy. As such, they can be viewed (and they are materialized in the UI) as trees. Modules can be (re)organized dynamically by changing their parent-children relationship and their owning workspace UI will reflect the change seamlessly, as with any Jspresso model (in fact workspaces and modules are regular beans that are used as model in standard Jspresso views).

Modules, among other features, are capable of providing a view to be installed in the UI wen they are selected. This makes Jspresso applications really modular and their architecture flexible enough to embed and run a large variety of different module types.

A module can also be as simple as a grouping structure for other modules (intermediary nodes).

Module properties
Property Description

description

String

Configures the key used to translate actual internationalized module description. The resulting translation will generally be leveraged as a toolTip on the UI side but its use may be extended for online help.

displayDirtyState

boolean

Sets display dirty state.

entryAction

IAction

Configures an action to be executed every time the module becomes the current selected module (either through a user explicit navigation or a programmatic selection). The action will execute in the context of the current workspace, this module being the current selected module.

exitAction

IAction

Configures an action to be executed every time the module becomes unselected (either through a user explicit navigation or a programmatic deselection). The action will execute in the context of the current workspace, this module being the current selected module (i.e. the action occurs before the module is actually left).

grantedRoles

Collection​<​String​>​

Assigns the roles that are authorized to start this module. It supports "!" prefix to negate the role(s). Whenever the user is not granted sufficient privileges, the module is simply not installed in the workspace. Setting the collection of granted roles to null (default value) disables role based authorization on this module.

Some specific modules that are component/entity model based i.e. Bean(Collection)Module also inherit their authorizations from their model.

i18nPageHeaderDescription

String

Sets i 18 n header description.

icon

Icon

Sets the icon.

iconImageURL

String

Sets the icon image URL of this descriptor. Supported URL protocols include :

  • all JVM supported protocols
  • the jar:/ pseudo URL protocol
  • the classpath:/ pseudo URL protocol

iconPreferredHeight

int

Sets the icon preferred width.

iconPreferredWidth

int

Sets the icon preferred width.

name

String

Configures the key used to translate actual internationalized module name. The resulting translation will be leveraged as the module label on the UI side.

pageHeaderDescription

String

Configures the key used to translate actual internationalized module header description. The resulting translation will generally be leveraged as a text header on the UI side.

permId

String

Sets the permanent identifier to this application element. Permanent identifiers are used by different framework parts, like dynamic security or record/replay controllers to uniquely identify an application element. Permanent identifiers are generated by the SJS build based on the element id but must be explicitly set if Spring XML is used.

projectedViewDescriptor

IView​Descriptor

Configures the view descriptor used to construct the view that will be displayed when this module is selected.

startupAction

IAction

Configures an action to be executed the first time the module is "started" by the user. The action will execute in the context of the current workspace, this module being the current selected module. It will help initializing module values, notify user, ....


BeanCollectionModule

This type of module keeps a reference on a beans collection. There is no assumption made on whether these beans are actually persistent entities or any other type of java beans.

Simple bean collection modules must have their collection of referenced beans initialized somehow. There is no standard built-in action to do so, since it is highly dependent on what's needed. So it's rather common to have the module content initialized through a startup action depending on the session state.

BeanCollectionModule properties
Property Description

detailViewIncluded

boolean

This property allows to automatically include the detail view in a tab of the main collection module view. A complementary action list is installed to navigate between module objects. Default value is false. *

elementComponentDescriptor

IComponent​Descriptor​<​Object​>​

Configures the type of bean element this collection module manages. A bunch of default values are inferred from this element component descriptor. For instance, paging size (if used) will default to the component one unless explicitly set. Same goes for icon image URL, default ordering properties or even granted roles. The latter means that bean collection modules based on forbidden entities will automatically be excluded from the workspace of the logged-in user.

if not explicitly configured, the element component descriptor can be inferred from the collection view descriptor configured as projected view descriptor.

elementViewDescriptor

IView​Descriptor

This property is not used by the module itself, but by built-in actions that maybe registered on this module. One of these actions is AddBeanAsSubModuleAction.

This property indicates the view to use whenever the user requests a "form-like" view on a collection element. Naturally the configured element view descriptor must be backed by a model matching the type of the module managed beans.

moduleObjects

List​<​?​>​

Assigns the list of beans this module manages. The projected view will automatically reflect this change since a "moduleObjects" property change will be fired.

navigateModuleObjectsActionList

Action​List

Sets navigate module objects action list.


FilterableBeanCollectionModule

This is a specialized type of bean collection module that provides a filter ( an instance of IQueryComponent ). This type of module, coupled with a generic, built-in, action map is perfectly suited for CRUD-like operations.

FilterableBeanCollectionModule properties
Property Description

criteriaFactory

Object

Sets criteria factory. Depending on the persistence layer used, it should be an instance of :

  • org.jspresso.framework.model.persistence.hibernate.criterion.ICriteriaFactory
  • org.jspresso.framework.model.persistence.mongo.criterion.IQueryFactory

criteriaRefiner

Object

Sets criteria refiner. Depending on the persistence layer used, it should be an instance of :

  • org.jspresso.framework.application.backend.action.persistence.hibernate.ICriteriaRefiner
  • org.jspresso.framework.application.backend.action.persistence.mongo.IQueryRefiner

displayPageIndex

Integer

Delegates to filter.

{@inheritDoc}

filter

IQuery​Component

Assigns the filter to this module instance. It is by default assigned by the module startup action (see InitModuleFilterAction). So if you ever want to change the default implementation of the filter, you have to write and install you own custom startup action or explicitly inject a specific instance.

filterComponentDescriptor

IComponent​Descriptor​<​IComponent​>​

This property allows to configure a custom filter model descriptor. If not set, which is the default value, the filter model is built out of the element component descriptor (QBE filter model).

filterExtraViewDescriptor

Basic​Tab​View​Descriptor

This property allow to refine the filter view. If this field is not empty the filter view will be replaced by a tab view containing this view and the view defined bu the {@link #setFilterViewDescriptor(IViewDescriptor)} method.

If the extra filter view or the filter view is already a tab view, then tab views will be merged to a single tab view.

filterViewDescriptor

IView​Descriptor

This property allows to refine the default filter view to re-arrange the filter fields. Custom filter view descriptors assigned here must not be assigned a model descriptor since they will be at runtime. This is because the filter component descriptor must be reworked - to adapt comparable field structures for instance.

findOnSet

Boolean

Whenever setting findOnSet to true, the module trigger the query each time a field is set in the filter view. This brings continuous autocomplete feature on the filter module.

findOnType

Boolean

Whenever setting findOnType to true, the module will trigger the query each time a field is typed-in in the module filter view. This brings continuous autocomplete feature on the filter module.

orderingProperties

Map​<​String​,ESort​>​

Configures a custom map of ordering properties for the result set. If not set, which is the default, the elements ordering properties is used.

This property consist of a Map whose entries are composed with :

  • the property name as key
  • the sort order for this property as value. This is either a value of the ESort enum (ASCENDING or DESCENDING) or its equivalent string representation.
Ordering properties are considered following their order in the map iterator.

page

Integer

Delegates to filter.

{@inheritDoc}

pageSize

Integer

Configures a custom page size for the result set. If not set, which is the default, the elements default page size is used.

paginationViewDescriptor

Basic​View​Descriptor

Configures the sub view used to navigate between the pages.

pagingAction

Backend​Action

Sets the pagingAction.

queryComponentDescriptorFactory

IQuery​Component​Descriptor​Factory

Sets the queryComponentDescriptorFactory.

queryComponentRefiner

IQuery​Component​Refiner

Sets query component refiner.

queryExtraViewDescriptorFactory

IQuery​Extra​View​Descriptor​Factory

Sets the queryExtraViewDescriptorFactory.

queryViewDescriptorFactory

IQuery​View​Descriptor​Factory

Sets the queryViewDescriptorFactory.

recordCount

Integer

Delegates to filter.

{@inheritDoc}

selectedRecordCount

Integer

Delegates to filter.

{@inheritDoc}

stickyResults

List​<​?​>​

Delegates to filter. {@inheritDoc}


MobileFilterableBeanCollectionModule

This is a specialized type of filterable bean collection module that provides a filter ( an instance of IQueryComponent ). This type of module, coupled with a generic, built-in, action map is perfectly suited for CRUD-like operations.

MobileFilterableBeanCollectionModule properties
Property Description

elementViewDescriptor

IView​Descriptor

Mobile filterable bean collection module views only support page views as element views descriptors.

{@inheritDoc}

filterViewDescriptor

IView​Descriptor

Mobile filterable bean collection module views only support mobile component views as filter views descriptors.

{@inheritDoc}

paginationViewDescriptor

Basic​View​Descriptor

Not supported in mobile environment.

{@inheritDoc}

projectedViewDescriptor

IView​Descriptor

Mobile filter bean collection module views only support list views as projected view descriptors.

{@inheritDoc}

queryModuleFilterAction

IDisplayable​Action

Sets query module filter action.


MobileBeanCollectionModule

This type of module keeps a reference on a beans collection. There is no assumption made on whether these beans are actually persistent entities or any other type of java beans.

Simple bean collection modules must have their collection of referenced beans initialized somehow. There is no standard built-in action to do so, since it is highly dependent on what's needed. So it's rather common to have the module content initialized through a startup action depending on the session state.

MobileBeanCollectionModule properties
Property Description

elementViewDescriptor

IView​Descriptor

Mobile bean collection module views only support page views as element views descriptors.

{@inheritDoc}

projectedViewDescriptor

IView​Descriptor

Mobile bean collection module views only support list views as projected view descriptors.

{@inheritDoc}


BeanModule

This type of module keeps a reference on a single bean. There is no assumption made on whether this bean is actually a persistent entity or any other type of java bean.

Bean modules must have their referenced bean initialized somehow. So it's rather common to have the module content initialized through a startup action depending on the session state or dynamically constructed by a standard action like AddBeanAsSubModuleAction.

This type of module is definitely the one that offers maximum flexibility to handle arbitrary models.

BeanModule properties
Property Description

componentDescriptor

IComponent​Descriptor​<​Object​>​

Configures the type of bean this module manages. A bunch of default values are inferred from this component descriptor. For instance, icon image URL or even granted roles can be inferred from the configured component descriptor. The latter means that bean modules based on forbidden entities will automatically be excluded from the workspace of the logged-in user.

However, when not set, the component descriptor it self can be inferred from the configured projected view descriptor model.

moduleObject

Object

Assigns the bean this module manages. The projected view will automatically reflect this change since a "moduleObject" property change will be fired.


MobileBeanModule

This type of module keeps a reference on a single bean. There is no assumption made on whether this bean is actually a persistent entity or any other type of java bean.

Bean modules must have their referenced bean initialized somehow. So it's rather common to have the module content initialized through a startup action depending on the session state or dynamically constructed by a standard action like AddBeanAsSubModuleAction.

This type of module is definitely the one that offers maximum flexibility to handle arbitrary models.

MobileBeanModule properties
Property Description

projectedViewDescriptor

IView​Descriptor

Mobile bean module only support page views as projected views descriptors.

{@inheritDoc}


Enabling/Disabling

Jspresso goes beyond static, role-based, authorization by introducing the concept of gate. A gate is a simple monitor that can open or close based on certain (dynamic) rules. Jspresso relies on gates to implement dynamic authorization that are most often based on some kind of model sate.

There are various places in Jspresso where dynamic authorization can be implemented :

  • model writability : once a model instance is determined to be read-only, all views on this model are also made.

  • view writability : same as above but only applies to a single view.

  • action enablement : enables / disable actions based on the model of the view they are installed in.

Wherever you want to use dynamic authorization, you can always combine gates. The combination is conjunctive, meaning that all gates must be open for the property (writability, actionability) to be allowed. In other words, a single closed gate is sufficient to forbid the property.

Overview

Gates class diagram

Reference

AbstractGate

AbstractGate

This is the base abstract class of all Jspresso built-in gates. Open/close rule is delegated to concrete implementations.

AbstractGate properties
Property Description
This class does not have any specific property.

AbstractModelGate

This is the base abstract implementation for gates that are model-based.

AbstractModelGate properties
Property Description

collectionBased

boolean

Sets the collectionBased.


AbstractPropertyModelGate

This is the base abstract class of gates whose opening rules are based on a single model property value.

AbstractPropertyModelGate properties
Property Description

accessorFactory

IAccessor​Factory

Configures the accessor factory to use to access the underlying model property.

grantedRoles

Collection​<​String​>​

Configures the roles for which the gate is installed. It supports "!" prefix to negate the role(s).

openOnTrue

boolean

This property allows to revert the standard behaviour of the gate, i.e. close when it should normally have opened and the other way around.

propertyName

String

Configures the model property name to which this gate is attached. How the property value is actually linked to the gate state is delegated to the concrete implementations.


BooleanPropertyModelGate

This gate opens and closes based on the value of a boolean property of the assigned model.

BooleanPropertyModelGate properties
Property Description

propertyName

String

Configures the boolean property name to use. Unless the openOnTrue property is set to false, the state of the gate will follow the boolean property value. It supports "!" prefix to negate the property value. It also supports non-boolean properties. In that case, the test is performed against the property != null condition.


EnumerationPropertyModelGate

This gate opens and closes based on the value of an enumeration property matching a set of allowed values.

EnumerationPropertyModelGate properties
Property Description

openingValues

Collection​<​String​>​

Configures the enumeration values for which the gate is to be open, unless the openOnTrue property is set to false.


RegexPropertyModelGate

This gate opens and closes based on the value of a string property matching a regular expression.

RegexPropertyModelGate properties
Property Description

regexpPattern

String

Configures the regular expression to match the property value against. The gate will open if the property value matches the regex unless the openOnTrue property has been set to false.


ServiceModelGate

This is a gate whose opening rules are based on an arbitrary method returning a boolean value.

ServiceModelGate properties
Property Description

accessorFactory

IAccessor​Factory

Configures the accessor factory to use to access the underlying model properties.

context

Map​<​String​,Object​>​

Sets context.

grantedRoles

Collection​<​String​>​

Configures the roles for which the gate is installed. It supports "!" prefix to negate the role(s).

methodName

String

Configures the model service method name to which this gate is attached.

openOnTrue

boolean

This property allows to revert the standard behaviour of the gate, i.e. close when it should normally have opened and the other way around.


ClosedGate

An always closed gate.

ClosedGate properties
Property Description
This class does not have any specific property.

GrantedRolesGate

This is a role based gate. The gate depends only on the roles of the logged-in user. The difference between using a roles gate and directly assigning the granted roles on the authorized artifact, is that the gate only disables the artifact whereas the artifact granted roles prevent the artifact from being created at all.

GrantedRolesGate properties
Property Description

grantedRoles

Collection​<​String​>​

Configures the roles for which the gate is open. It supports "!" prefix to negate the role(s). If at least one of the role is satisfied, then the gate is open.


Startup

Overview

Startup class diagram

results matching ""

    No results matching ""