Difference between revisions of "Data cache service"

From Catglobe Wiki
Jump to: navigation, search
(Re-arranged sections, examples merged into the API descriptions)
Line 15: Line 15:
 
The user requesting data from a data cache must have minimum observer access to the data cache specification, no matter if the external or internal API is used.  
 
The user requesting data from a data cache must have minimum observer access to the data cache specification, no matter if the external or internal API is used.  
  
=== External API  ===
+
=== Data structures  ===
 +
 
 +
When data from a data cache is returned to the requester it is represented by a simple object structure.
 +
 
 +
[[Image:DataCacheDto.png]]
 +
 
 +
=== Internal API  ===
  
 
{| border="1" class="CGTable"
 
{| border="1" class="CGTable"
Line 24: Line 30:
 
|-
 
|-
 
| int  
 
| int  
| GetRowCount (string username, string password, int dcsResourceId)  
+
| GetRowCount (int dcsResourceId)  
 
| Gets the number of rows of a data cache.
 
| Gets the number of rows of a data cache.
 
|-
 
|-
 
| DataCacheDto  
 
| DataCacheDto  
| GetData (string username, string password, string[] columns, int dcsResourceId)  
+
| GetData (string[] columns, int dcsResourceId)  
 
| Gets all rows from a data cache, with data from a selection of columns.
 
| Gets all rows from a data cache, with data from a selection of columns.
 
|-
 
|-
 
| DataCacheDto  
 
| DataCacheDto  
| GetDataSorted (string username, string password, string[] columns, int dcsResourceId, string[] orderByColumns, DataCacheSortOrderEnum sortOrder)  
+
| GetDataSorted (string[] columns, int dcsResourceId, string[] orderByColumns, DataCacheSortOrderEnum sortOrder)  
 
| Gets all rows from a data cache, with data from a selection of columns.
 
| Gets all rows from a data cache, with data from a selection of columns.
 
|-
 
|-
 
| DataCacheDto  
 
| DataCacheDto  
| GetDataRows (string username, string password, string[] columns, int dcsResourceId, int rowIndex, int rowCount)  
+
| GetDataRows (string[] columns, int dcsResourceId, int rowIndex, int rowCount)  
 
| Gets all rows from a data cache starting from a row index and returning rows as requested.
 
| Gets all rows from a data cache starting from a row index and returning rows as requested.
 
|-
 
|-
 
| DataCacheDto  
 
| DataCacheDto  
| GetDataRowsSorted (string username, string password, string[] columns, int dcsResourceId, string[] orderByColumns, DataCacheSortOrderEnum sortOrder, int rowIndex, int rowCount)  
+
| GetDataRowsSorted (string[] columns, int dcsResourceId, string[] orderByColumns, DataCacheSortOrderEnum sortOrder, int rowIndex, int rowCount)  
 
| Gets all rows from a data cache starting from a row index and returning rows as requested.
 
| Gets all rows from a data cache starting from a row index and returning rows as requested.
 
|-
 
|-
 
| DataCacheDto  
 
| DataCacheDto  
| GetDataTop (string username, string password, int top, string[] columns, int dcsResourceId)  
+
| GetDataTop (int top, string[] columns, int dcsResourceId)  
 
| Gets the top N rows from a data cache, with data from a selection of columns, ordered by some column. Rows with no values will be excluded, meaning that the data cache returned might contain fewer rows, than indicated by N.
 
| Gets the top N rows from a data cache, with data from a selection of columns, ordered by some column. Rows with no values will be excluded, meaning that the data cache returned might contain fewer rows, than indicated by N.
 
|-
 
|-
 
| DataCacheDto  
 
| DataCacheDto  
| GetDataTopSorted (string username, string password, int top, string[] columns, int dcsResourceId, string[] orderByColumns, DataCacheSortOrderEnum sortOrder)  
+
| GetDataTopSorted (int top, string[] columns, int dcsResourceId, string[] orderByColumns, DataCacheSortOrderEnum sortOrder)  
 
| Gets the top N rows from a data cache, with data from a selection of columns, ordered by some column. Rows with no values will be excluded, meaning that the data cache returned might contain fewer rows, than indicated by N.
 
| Gets the top N rows from a data cache, with data from a selection of columns, ordered by some column. Rows with no values will be excluded, meaning that the data cache returned might contain fewer rows, than indicated by N.
 
|-
 
|-
 
| DataCacheDto  
 
| DataCacheDto  
| GetDataForUsers (string username, string password, string[] columns, int dcsResourceId, int[] users)  
+
| GetDataForUsers (string[] columns, int dcsResourceId, int[] users)  
 
| Gets all rows from a data cache, with data from a selection of columns, belonging to a selection of users.
 
| Gets all rows from a data cache, with data from a selection of columns, belonging to a selection of users.
 
|-
 
|-
 
| DataCacheDto  
 
| DataCacheDto  
| GetDataForUsersSorted (string username, string password, string[] columns, int dcsResourceId, int[] users, string[] orderByColumns, DataCacheSortOrderEnum sortOrder)  
+
| GetDataForUsersSorted (string[] columns, int dcsResourceId, int[] users, string[] orderByColumns, DataCacheSortOrderEnum sortOrder)  
 
| Gets all rows from a data cache, with data from a selection of columns, belonging to a selection of users.
 
| Gets all rows from a data cache, with data from a selection of columns, belonging to a selection of users.
 +
|-
 +
| DataCacheDto
 +
| GetDataForLoggedInUser (string[] columns, int dcsResourceId, Guid dataViewUser)
 +
| Gets all rows from a data cache,with data from a selection of columns, belonging to a logged in user.
 
|}
 
|}
  
=== Internal API  ===
+
==== Examples ====
 +
 
 +
=== External API  ===
  
 
{| border="1" class="CGTable"
 
{| border="1" class="CGTable"
Line 69: Line 81:
 
|-
 
|-
 
| int  
 
| int  
| GetRowCount (int dcsResourceId)  
+
| GetRowCount (string username, string password, int dcsResourceId)  
 
| Gets the number of rows of a data cache.
 
| Gets the number of rows of a data cache.
 
|-
 
|-
 
| DataCacheDto  
 
| DataCacheDto  
| GetData (string[] columns, int dcsResourceId)  
+
| GetData (string username, string password, string[] columns, int dcsResourceId)  
 
| Gets all rows from a data cache, with data from a selection of columns.
 
| Gets all rows from a data cache, with data from a selection of columns.
 
|-
 
|-
 
| DataCacheDto  
 
| DataCacheDto  
| GetDataSorted (string[] columns, int dcsResourceId, string[] orderByColumns, DataCacheSortOrderEnum sortOrder)  
+
| GetDataSorted (string username, string password, string[] columns, int dcsResourceId, string[] orderByColumns, DataCacheSortOrderEnum sortOrder)  
 
| Gets all rows from a data cache, with data from a selection of columns.
 
| Gets all rows from a data cache, with data from a selection of columns.
 
|-
 
|-
 
| DataCacheDto  
 
| DataCacheDto  
| GetDataRows (string[] columns, int dcsResourceId, int rowIndex, int rowCount)  
+
| GetDataRows (string username, string password, string[] columns, int dcsResourceId, int rowIndex, int rowCount)  
 
| Gets all rows from a data cache starting from a row index and returning rows as requested.
 
| Gets all rows from a data cache starting from a row index and returning rows as requested.
 
|-
 
|-
 
| DataCacheDto  
 
| DataCacheDto  
| GetDataRowsSorted (string[] columns, int dcsResourceId, string[] orderByColumns, DataCacheSortOrderEnum sortOrder, int rowIndex, int rowCount)  
+
| GetDataRowsSorted (string username, string password, string[] columns, int dcsResourceId, string[] orderByColumns, DataCacheSortOrderEnum sortOrder, int rowIndex, int rowCount)  
 
| Gets all rows from a data cache starting from a row index and returning rows as requested.
 
| Gets all rows from a data cache starting from a row index and returning rows as requested.
 
|-
 
|-
 
| DataCacheDto  
 
| DataCacheDto  
| GetDataTop (int top, string[] columns, int dcsResourceId)  
+
| GetDataTop (string username, string password, int top, string[] columns, int dcsResourceId)  
 
| Gets the top N rows from a data cache, with data from a selection of columns, ordered by some column. Rows with no values will be excluded, meaning that the data cache returned might contain fewer rows, than indicated by N.
 
| Gets the top N rows from a data cache, with data from a selection of columns, ordered by some column. Rows with no values will be excluded, meaning that the data cache returned might contain fewer rows, than indicated by N.
 
|-
 
|-
 
| DataCacheDto  
 
| DataCacheDto  
| GetDataTopSorted (int top, string[] columns, int dcsResourceId, string[] orderByColumns, DataCacheSortOrderEnum sortOrder)  
+
| GetDataTopSorted (string username, string password, int top, string[] columns, int dcsResourceId, string[] orderByColumns, DataCacheSortOrderEnum sortOrder)  
 
| Gets the top N rows from a data cache, with data from a selection of columns, ordered by some column. Rows with no values will be excluded, meaning that the data cache returned might contain fewer rows, than indicated by N.
 
| Gets the top N rows from a data cache, with data from a selection of columns, ordered by some column. Rows with no values will be excluded, meaning that the data cache returned might contain fewer rows, than indicated by N.
 
|-
 
|-
 
| DataCacheDto  
 
| DataCacheDto  
| GetDataForUsers (string[] columns, int dcsResourceId, int[] users)  
+
| GetDataForUsers (string username, string password, string[] columns, int dcsResourceId, int[] users)  
 
| Gets all rows from a data cache, with data from a selection of columns, belonging to a selection of users.
 
| Gets all rows from a data cache, with data from a selection of columns, belonging to a selection of users.
 
|-
 
|-
 
| DataCacheDto  
 
| DataCacheDto  
| GetDataForUsersSorted (string[] columns, int dcsResourceId, int[] users, string[] orderByColumns, DataCacheSortOrderEnum sortOrder)  
+
| GetDataForUsersSorted (string username, string password, string[] columns, int dcsResourceId, int[] users, string[] orderByColumns, DataCacheSortOrderEnum sortOrder)  
 
| Gets all rows from a data cache, with data from a selection of columns, belonging to a selection of users.
 
| Gets all rows from a data cache, with data from a selection of columns, belonging to a selection of users.
|-
 
| DataCacheDto
 
| GetDataForLoggedInUser (string[] columns, int dcsResourceId, Guid dataViewUser)
 
| Gets all rows from a data cache,with data from a selection of columns, belonging to a logged in user.
 
 
|}
 
|}
  
== Data structures  ==
+
==== Examples ====
 
 
When data from a data cache is returned to the requester it is represented by a simple object structure.
 
 
 
[[Image:DataCacheDto.png]]
 
 
 
== Error handling  ==
 
 
 
== Examples ==
 

Revision as of 05:20, 15 October 2009

Introduction

When working on solutions for clients it is not always enough to report on the collected data, in some cases the client also wants to get access to the raw data directly.

Normally this can be handled by exporting the data, but in some cases the client is looking for an automated approach, where they can develop a data consumer, thus we have created a service from which we provide access to data from data caches.

The raw data has also shown to be useful when setting up dashboards, where access to the raw data from an RCS for instance allows us to make very advanced solutions such as our CRM solution.

Service APIs

The data cache service consists of two APIs; an external API allowing external applications to retrieve data from a data cache through SOAP calls, and an internal API that gives access to data from a data cache through JavaScript, which can be used from dashboards for example.

Requests using the internal API happens in a stateful context contrary to the external API where requests happen in a stateless context. Thus the primary difference between the two APIs is that the external API requires username and password each time a request is made.

The user requesting data from a data cache must have minimum observer access to the data cache specification, no matter if the external or internal API is used.

Data structures

When data from a data cache is returned to the requester it is represented by a simple object structure.

DataCacheDto.png

Internal API

Type Signature Description
int GetRowCount (int dcsResourceId) Gets the number of rows of a data cache.
DataCacheDto GetData (string[] columns, int dcsResourceId) Gets all rows from a data cache, with data from a selection of columns.
DataCacheDto GetDataSorted (string[] columns, int dcsResourceId, string[] orderByColumns, DataCacheSortOrderEnum sortOrder) Gets all rows from a data cache, with data from a selection of columns.
DataCacheDto GetDataRows (string[] columns, int dcsResourceId, int rowIndex, int rowCount) Gets all rows from a data cache starting from a row index and returning rows as requested.
DataCacheDto GetDataRowsSorted (string[] columns, int dcsResourceId, string[] orderByColumns, DataCacheSortOrderEnum sortOrder, int rowIndex, int rowCount) Gets all rows from a data cache starting from a row index and returning rows as requested.
DataCacheDto GetDataTop (int top, string[] columns, int dcsResourceId) Gets the top N rows from a data cache, with data from a selection of columns, ordered by some column. Rows with no values will be excluded, meaning that the data cache returned might contain fewer rows, than indicated by N.
DataCacheDto GetDataTopSorted (int top, string[] columns, int dcsResourceId, string[] orderByColumns, DataCacheSortOrderEnum sortOrder) Gets the top N rows from a data cache, with data from a selection of columns, ordered by some column. Rows with no values will be excluded, meaning that the data cache returned might contain fewer rows, than indicated by N.
DataCacheDto GetDataForUsers (string[] columns, int dcsResourceId, int[] users) Gets all rows from a data cache, with data from a selection of columns, belonging to a selection of users.
DataCacheDto GetDataForUsersSorted (string[] columns, int dcsResourceId, int[] users, string[] orderByColumns, DataCacheSortOrderEnum sortOrder) Gets all rows from a data cache, with data from a selection of columns, belonging to a selection of users.
DataCacheDto GetDataForLoggedInUser (string[] columns, int dcsResourceId, Guid dataViewUser) Gets all rows from a data cache,with data from a selection of columns, belonging to a logged in user.

Examples

External API

Type Signature Description
int GetRowCount (string username, string password, int dcsResourceId) Gets the number of rows of a data cache.
DataCacheDto GetData (string username, string password, string[] columns, int dcsResourceId) Gets all rows from a data cache, with data from a selection of columns.
DataCacheDto GetDataSorted (string username, string password, string[] columns, int dcsResourceId, string[] orderByColumns, DataCacheSortOrderEnum sortOrder) Gets all rows from a data cache, with data from a selection of columns.
DataCacheDto GetDataRows (string username, string password, string[] columns, int dcsResourceId, int rowIndex, int rowCount) Gets all rows from a data cache starting from a row index and returning rows as requested.
DataCacheDto GetDataRowsSorted (string username, string password, string[] columns, int dcsResourceId, string[] orderByColumns, DataCacheSortOrderEnum sortOrder, int rowIndex, int rowCount) Gets all rows from a data cache starting from a row index and returning rows as requested.
DataCacheDto GetDataTop (string username, string password, int top, string[] columns, int dcsResourceId) Gets the top N rows from a data cache, with data from a selection of columns, ordered by some column. Rows with no values will be excluded, meaning that the data cache returned might contain fewer rows, than indicated by N.
DataCacheDto GetDataTopSorted (string username, string password, int top, string[] columns, int dcsResourceId, string[] orderByColumns, DataCacheSortOrderEnum sortOrder) Gets the top N rows from a data cache, with data from a selection of columns, ordered by some column. Rows with no values will be excluded, meaning that the data cache returned might contain fewer rows, than indicated by N.
DataCacheDto GetDataForUsers (string username, string password, string[] columns, int dcsResourceId, int[] users) Gets all rows from a data cache, with data from a selection of columns, belonging to a selection of users.
DataCacheDto GetDataForUsersSorted (string username, string password, string[] columns, int dcsResourceId, int[] users, string[] orderByColumns, DataCacheSortOrderEnum sortOrder) Gets all rows from a data cache, with data from a selection of columns, belonging to a selection of users.

Examples