You can add the SysViewStateCookie model pattern when you want users of a Turnkey server to share a link that restores the current state of a view, including its variables.
What SysViewStateCookie does
SysViewStateCookie is an optional model pattern for sharing the state of a page in a Turnkey application. When the pattern is present, Turnkey can create a unique SysViewStateCookie object that represents the current view state.
The shared URL is a DWV link that refers to that unique object. Opening the link restores the state captured for the view.
For example, a user can prepare a page with its current variable values, select the Share action, and send the resulting URL to another user. The URL refers to the captured SysViewStateCookie object rather than requiring the recipient to recreate the state manually.
Enable sharing in your model
- Add the optional SysViewStateCookie model pattern to the model used by your Turnkey application.
- Deploy the model to the Turnkey server.
- Open a view and set the variables to the state you want to share.
- Use the Share action in the toolbar. When
SysViewStateCookieis present, Turnkey shows this action. - Copy the URL placed by the Share action and send it to the intended recipient.
The Share action creates a DWV URL that references the unique SysViewStateCookie object for the captured view state.
Capture the current view programmatically
The SysViewStateCookie pattern supports the FillWithCurrentView method. Use this method when your model logic needs to populate a view-state cookie from the current view rather than relying on the toolbar Share action.
The method is listed among the methods supported by model patterns in Documentation:Pattern supported methods.
What is included
The purpose of the pattern is to share the complete current view state, including the current values of the view variables. This makes the link useful when the variable state is significant to what the recipient needs to see.
Notes and limitations
- The pattern is optional. If
SysViewStateCookieis not present, the toolbar Share action described on this page is not available. - The shared URL is a reference to a unique
SysViewStateCookieobject. - This page does not define the lifecycle, retention, access control, or authorization behavior of shared view-state objects. Confirm those behaviors for your deployment before using shared links for sensitive state.
- A connection to the ClipBook implementation has been noted, but the available documentation does not describe its behavior or configuration.
