|
|
|
|
|
- If the management mode of contexts via cookies is used (ctxCookie constant used in ConfigureAWPContext):
- If the management mode of contexts on disk is used (ctxDisk constant used in ConfigureAWPContext):
DeclareAWPContext (Function) In french: DéclareContexteAWP Allows you to declare a list of variables whose value will be persistent between the successive displays of AWP pages. This function indicates the variables that will be saved and restored whenever the Active WEBDEV Pages are displayed. This allows you to manage an AWP context. Two modes are available for managing the contexts: - Managing contexts via cookies (by default).
- Managing contexts on disk.
The mode for managing the contexts is selected in ConfigureAWPContext. If this function is not called, contexts are managed via cookies by default. DeclareAWPContext is taken into account in AWP mode only. It is recommended to use this function in the project initialization event (for project variables) and/or in the page initialization event (for page variables). In most cases, this function must be used in the process where the variables are declared and initialized. If your project uses pre-launched sessions, this function must not be used in the project initialization event. This function must be used in the "Initialization in pre-launched session mode" event. Remark: For more details: Caution: This function requires a good knowledge of WEBDEV.
gnNumCurrentProduct is int = 1
DeclareAWPContext(gnNumCurrentProduct)
Syntax
<Result> = DeclareAWPContext(<Name of variable 1> [, <Name of variable 2> [... [, <Name of variable N>]]])
<Result>: Boolean - True if the specified variables have been restored,
- False otherwise (during the first page display for example).
<Name of variable 1>: Variable type Name of the first variable that will be saved at the end of the display. The value of this variable will be retrieved during the successive page displays. <Name of variable 2>: Type of variable (optional parameter) Name of 2nd variable that will be saved at the end of display. The value of this variable will be retrieved during the successive page displays. <Name of variable N>: Type of variable (optional parameter) Name of Nth variable that will be saved at the end of display. The value of this variable will be retrieved during the successive page displays. Remarks If the management mode of contexts via cookies is used (ctxCookie constant used in ConfigureAWPContext): - DeclareAWPContext uses HTTP cookies. The values of variables will not be restored if the HTTP cookies are ignored by the browser used on the current computer.
- The total size of values for the different variables cannot exceed 4KB. If the size of these values is too important, these values will be truncated (missing variable and/or truncated content).
- DeclareAWPContext is not recommended for the sensitive data (user password for example). Indeed, the data flows via the browser. This function must NOT be used to store a user connection for example.
- If two variables are saved with the same name (one in the project and the other one in a page for example), only the first variable will be stored.
- DeclareAWPContext returns False if one of the variables was not restored.
- Only the variables passed to DeclareAWPContext during a page display will be retrieved during the next display. The variables that were previously passed are not automatically saved again.
- Only simple variables (integer, string, etc.) are supported.
Remark: To manipulate buffers, use the context on disk instead.
If the management mode of contexts on disk is used (ctxDisk constant used in ConfigureAWPContext): - DeclareAWPContext uses contexts on disk. The values of variables are always restored.
- The total size of values for the different variables is not limited.
- DeclareAWPContext can be used for sensitive data (user password, for example).
- If two variables are saved with the same name (one in the project and the other one in a page for example), the two variables are stored independently.
- DeclareAWPContext returns False if one of the variables was not restored.
- All variables passed to DeclareAWPContext during a page display can be retrieved during the next display. The variables that were passed beforehand are automatically saved again.
- Simple variables (integer, string, etc.) are supported, as well variables of type:
- structure,
- class,
- array,
- associative array,
- combination
- enumeration
- The following variable types are not supported:
- fixed arrays,
- global members of classes,
- associative arrays of local structures,
- references to dynamic objects.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|