Shared Variable builder inputsAdded by IBM on August 31, 2010 | Version 1 (Original)
|This topic describes the inputs for the Shared Variable builder.
This topic describes the inputs for the Shared Variable builder.
Table 1. Shared Variable builder inputs
|Name||Enter a name for this builder call. The WebSphere® Portlet Factory Designer displays this name in the builder call list.|
|Variable||Use the picker to choose the model variable to be shared.|
This variable will be connected to the external store.
|Scope||Select the scope of sharing for the variable data. You can choose one of the following scopes: |
To share variable data to an attribute of the HttpSession object.Request
To share variable data to an attribute of the current HttpServletRequest object.Application
To share variable data as a Java static in which a global data store is used to share the data across all programs in the same JVM.Custom
To specify a custom class which can load/store the variable values. This is an advanced option and can generally be ignored. You provide a Java class that implements the com.bowstreet.builders.webapp.methods.VariableDataStore interface. An instance of this class is used to load and store the variable value
|Unique ID||Specify a string used to identify the data in the external store. For example, as the name of the session or request attribute in those scopes.|
This string should be chosen so that it will not collide with other values unless you intend for such values to be used as the basis of this variable.
This ID is a key used to locate the variable's value. The type of key depends on the value of the Scope input. For example:
Request or Session mode
Name of the request/session attributeApplication mode
Key in an internal HashtableCustom mode
Interpretation is up to the custom class.
|Custom Class||Available when the Scope is Custom.|
This lets you specify a custom class used to load and store the variable's value.
Choose the name of the class that will do the data loading/storing
Note: This class must implement the interface: com.bowstreet.builders.webapp.methods.VariableDataStore
|Custom Context||Available when the Scope is Custom.|
A custom class may require a "context" value to allow it to manage its data. This value is dependent on the class chosen as the Custom Class input.
This input is intended to provide contextual information to the custom data store implementation what sort of value (if any) is determined by the implementation chosen by the value of the Custom Class input.
See the documentation for the class chosen there for details on what context value, if any, is required
|Page||Available when the Scope is Request.|
Optional: Select a page on which to place an onLoad event handler which causes the variable's value to be re-published to the corresponding request attribute each time that page is loaded.
Each time the named page loads, the variable's value will be re-published into the corresponding request attribute.
Alternatively, you can call buildername.rePublishVariableValue to set the value, (for example in an OnRequest handler).
|Use Outer Session||Available when the Scope is Session.|
This input is relevant only if the model is being run as a portlet.
In portlet containers, there are usually two levels of session data: an "inner" scope which is local to each portlet instance, and an "outer" session scope that is shared by all portlets.
When this input is enabled, the shared variable value will be stored in the outer session, making it potentially available for all active portlets. When this input is disabled, the data will be kept in the inner session context.
Note: Disable this input to use the inner session context if you are using session data to communicate with legacy code in your portlet (not other portlets) and want to avoid the possibility of collisions in the shared outer space.
To use the outermost session object for data storage. In a portal this will be the session managed by the portal. This setting allows portlets to share data.Disabled
To use the default "local" session. In the portlet case, this will limit session data visibility to the portlet in question.
Parent topic: Shared Variable builder: wpf7