Tchater maintenant avec le support
Tchattez avec un ingénieur du support

Foglight 6.0.0 - Web Component Guide

Introducing the Web Component Framework The Web Component Framework Configuring Views and Context Queries Functions Bindings Additional Components

Writable Data Object

If there is a need to build a custom complex user interface in Foglight there may be a need to create temporary objects to manage the new user interface, especially when there is a need to capture input from users to convert later into more persistent objects or to remember choices that a user has made in the past in order to streamline the user’s workflow in the future.

The Writable Data Object mechanism allows for the creation of types in the Web Component Framework that are specific to the UI mechanism and associated with the modules that contain the rest of the custom UI artifacts.

UI Type entities allow you to define types and their properties that can be used in various ways in your UI.

Creating a Data Type in a Module

You can define your own types if necessary.

Choose Types in the Definitions > Module Contents pane.
Click Add and the Add Type dialog box appears.
In the Name field, type in the name for your new type. The name must be capitalized.
You can choose the generic type Data Object from the common data source if your new type is not based on a particular data source type. Note that you can use the search box to filter the list of available types.
In the edit pane, fill in the Display Name and Description fields.
Name: A property name must start with a lower case letter and contain only A-Z, a-z, 0-9.
Display Name: Any string value is allowed
Data Type: The property’s data type.
List: Specifies whether the property is a list.
Reference: Specifies whether the property is a reference. For instance, properties that are enumerated types are always references because the values in enumerated types never change and there is no need to copy the enumeration into the data object. Static types such as strings and numbers cannot be references, but many object types can be. The Definitions editor will be enabled for the property if it can be either contained or a reference. See Saving Data Objects for information on how contained and reference types are saved.
Default Value: If desired, a fallback value for the property here. A newly-created object has all its properties set to their fallback values.
Annotations: For information about annotations, see Properties .

Creating a Data Object based on the New Type

Instances of the new type are created with the Context Binding mechanism available when specifying additional context.

In the Context tab of the definitions editor, click the Add Context Entry () button in the Additional group.
In the Key field, give the data object a name by which it can be referenced.
Select the Evaluate Once check box to create a single data object that may contain other variable properties such as lists.
The Edit - Context Entry dialog box appears.
Choose your new type from the Select Type dialog box by clicking the button at the right-hand side of the Type field.
Choose a Storage persistence. The create method attempts to load the data object from storage or it creates a new instance if the object does not exist. The choices are:
None: The object cannot be stored and is meant to be transitory (used on the page or passed through the context).
Site: Enables the object to be stored in a global location that is accessible to all users. If multiple users are changing the object at once from different sessions, the last copy of the object saved will be persisted.
User: The object is stored so that each user has a different copy of this object. This is useful to remember a user’s individual choices.
Session: The object is stored in the user’s HTTP session. Calling save() is not necessary to persist changes because the single live instance is stored in a session-owned cache. The object is released when the user logs out or when the object’s remove() method is called.
Type an identifier for the new object in Object ID, which must be formatted as xxxxx-yyyyy, where:
xxxxx is your domain identifier (Examples: java, oracle, ops, admin)
yyyyy is an identifier for the data object. (Example: socFilter)
Click Save.

Saving a Data Object

Changes to an object are persisted by calling the object's save() method.

To be saved, an object must be created with a storage mechanism Site, User, or Session.

Saving Contained versus Referenced Properties:

Documents connexes

The document was helpful.

Sélectionner une évaluation

I easily found the information I needed.

Sélectionner une évaluation