Shared Variable builder inputsAdded by IBM on June 28, 2011 | 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. General inputs
|Name||Required. Enter a name for this builder call. The WebSphere® Portlet Factory Designer displays this name in the builder call list.|
|Variable||Required. Use the picker to choose the model variable to be shared.|
This variable will be connected to the external store.
|Scope||Required. 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||Required. 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 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||This input is available if the Scope input is set to Custom. |
This lets you specify a custom class used to load and store the variable value.
Choose the name of the class that will do the data loading/storing.
Note: This class must implement the following interface. com.bowstreet.builders.webapp.methods.VariableDataStore
|Custom Context||This input is available if the Scope input is set to 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||This input is available if the Scope input is set to Request. |
Optional: Select a page on which to place an onLoad event handler which causes the variable value to be republished to the corresponding request attribute each time that page is loaded.
Each time the named page loads, the variable value is republished into the corresponding request attribute.
Alternatively, you can call buildername.rePublishVariableValue to set the value, (for example in an OnRequest handler).
Table 2. Advanced input
|Use Outer Session||This input is available if the Scope input is set to Session. |
This input is relevant only if the model is being run as a portlet. The default setting is enabled.
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 is stored in the outer session, making it potentially available for all active portlets. Enable this input to use the outermost session object for data storage. In the portal, this is the session managed by the portal. This setting allows portlets to share data.
When this input is disabled, the data is kept in the inner session context. Disable this input to use the default local session. In the portlet, this limits session data visibility to the portlet in question.
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.
Parent topic: Shared Variable builder