You can define your own types if necessary.
1 |
Choose Types in the Definitions > Module Contents pane. |
2 |
3 |
In the Name field, type in the name for your new type. The name must be capitalized. |
5 |
6 |
Define the properties of your new type by filling in the Properties table. |
• |
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. |
• |
1 |
In the Context tab of the definitions editor, click the Add Context Entry () button in the Additional group. |
2 |
In the Key field, give the data object a name by which it can be referenced. |
4 |
Select the Evaluate Once check box to create a single data object that may contain other variable properties such as lists. |
5 |
Click the Edit () button and choose Writable Data Object. |
6 |
The Edit - Context Entry dialog box appears. |
a |
Choose your new type from the Select Type dialog box by clicking the button at the right-hand side of the Type field. |
b |
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. |
c |
• |
xxxxx is your domain identifier (Examples: java, oracle, ops, admin) |
• |
yyyyy is an identifier for the data object. (Example: socFilter) |
7 |
Click Save. |
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:
• |
© ALL RIGHTS RESERVED. 利用規約 プライバシー Cookie Preference Center