Difference between revisions of "View Cache"
(→TestViewState) |
|||
Line 25: | Line 25: | ||
Get information about the current state of the View Cache. | Get information about the current state of the View Cache. | ||
<syntaxhighlight lang="csharp"> | <syntaxhighlight lang="csharp"> | ||
+ | /// <summary> | ||
+ | /// Gets information abut the state of view cache. | ||
+ | /// </summary> | ||
+ | /// <param name="appName">Name of the application.</param> | ||
+ | /// <param name="contextName">Name of the context.</param> | ||
+ | /// <param name="authentication">The authentication.</param> | ||
+ | /// <returns>Information about the state of the view cache as human readable string</returns> | ||
[OperationContract] | [OperationContract] | ||
[WebInvoke(UriTemplate = "GetViewStateInformation/{appName}/{contextName}/{authentication}", Method = "GET", | [WebInvoke(UriTemplate = "GetViewStateInformation/{appName}/{contextName}/{authentication}", Method = "GET", | ||
Line 35: | Line 42: | ||
Start or trigger reinitialization of the View Cache. | Start or trigger reinitialization of the View Cache. | ||
<syntaxhighlight lang="csharp"> | <syntaxhighlight lang="csharp"> | ||
+ | /// <summary> | ||
+ | /// Triggers a refresh of the view cache. | ||
+ | /// The current cache stays valid until the new cache was fully built. | ||
+ | /// </summary> | ||
+ | /// <param name="appName">Name of the application.</param> | ||
+ | /// <param name="contextName">Name of the context.</param> | ||
+ | /// <param name="authentication">The authentication.</param> | ||
+ | /// <returns>true as the refresh was triggered successfully, false otherwise</returns> | ||
[OperationContract] | [OperationContract] | ||
[WebInvoke(UriTemplate = "TriggerViewStateUpdate/{appName}/{contextName}/{authentication}", Method = "GET", | [WebInvoke(UriTemplate = "TriggerViewStateUpdate/{appName}/{contextName}/{authentication}", Method = "GET", | ||
Line 45: | Line 60: | ||
Test the View Cache's result for a single object (given by its {{Guid}}), without retrieving the physical documents. | Test the View Cache's result for a single object (given by its {{Guid}}), without retrieving the physical documents. | ||
<syntaxhighlight lang="csharp"> | <syntaxhighlight lang="csharp"> | ||
+ | /// <summary> | ||
+ | /// Test member for testing the View Cache. | ||
+ | /// </summary> | ||
+ | /// <param name="appName">Name of the application.</param> | ||
+ | /// <param name="contextName">Name of the context.</param> | ||
+ | /// <param name="ownerUID">UID of the object the test should be executed for (e.g. root object). All data below this object will be delivered.</param> | ||
+ | /// <param name="authentication">The authentication.</param> | ||
+ | /// <returns>data stored in the view cache as BCHierarchyDeltaShipments</returns> | ||
[OperationContract] | [OperationContract] | ||
[WebInvoke(UriTemplate = "TestViewState/{appName}/{contextName}/{owneruid}/{authentication}", Method = "GET", | [WebInvoke(UriTemplate = "TestViewState/{appName}/{contextName}/{owneruid}/{authentication}", Method = "GET", |
Revision as of 12:52, 7 May 2015
The View Cache feature increases the performance of the Web Service by caching the data to be published and sent to the clients. All content data as well as the hierarchies, as defined by the View and in the ACM, is evaluated and cached internally. Once the cache has been initialized, its status and additional information can be retrieved by web service methods.
Contents
Enabling the View Cache
The View Cache features needs to be enabled in the web.config file of the corresponding web service.
Area | Setting | Description |
---|---|---|
appSettings | UBIK.Service.EnableViewCachage | Enable (1) / Disable (0) the view cache feature for this web service |
...
<add key="UBIK.Service.EnableViewCache" value="1" />
</appSettings>
Web Service Interface
Use the these web service members to gain status and runtime information of the View Cache. More detailed information and a comprehensive list of all members and data types are located in the UBIK® class documentation.
GetViewStateInformation
Get information about the current state of the View Cache.
/// Gets information abut the state of view cache.
/// </summary>
/// <param name="appName">Name of the application.</param>
/// <param name="contextName">Name of the context.</param>
/// <param name="authentication">The authentication.</param>
/// <returns>Information about the state of the view cache as human readable string</returns>
[OperationContract]
[WebInvoke(UriTemplate = "GetViewStateInformation/{appName}/{contextName}/{authentication}", Method = "GET",
RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json)]
string GetViewStateInformation(string appName, string contextName, string authentication);
TriggerViewStateUpdate
Start or trigger reinitialization of the View Cache.
/// Triggers a refresh of the view cache.
/// The current cache stays valid until the new cache was fully built.
/// </summary>
/// <param name="appName">Name of the application.</param>
/// <param name="contextName">Name of the context.</param>
/// <param name="authentication">The authentication.</param>
/// <returns>true as the refresh was triggered successfully, false otherwise</returns>
[OperationContract]
[WebInvoke(UriTemplate = "TriggerViewStateUpdate/{appName}/{contextName}/{authentication}", Method = "GET",
RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json)]
bool TriggerViewStateRefresh(string appName, string contextName, string authentication);
TestViewState
Test the View Cache's result for a single object (given by its Guid), without retrieving the physical documents.
/// Test member for testing the View Cache.
/// </summary>
/// <param name="appName">Name of the application.</param>
/// <param name="contextName">Name of the context.</param>
/// <param name="ownerUID">UID of the object the test should be executed for (e.g. root object). All data below this object will be delivered.</param>
/// <param name="authentication">The authentication.</param>
/// <returns>data stored in the view cache as BCHierarchyDeltaShipments</returns>
[OperationContract]
[WebInvoke(UriTemplate = "TestViewState/{appName}/{contextName}/{owneruid}/{authentication}", Method = "GET",
RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json)]
DTO.V211.BCHierarchyDeltaShipments TestViewState(string appName, string contextName, string ownerUID, string authentication);