Server side paging
When loading a SoftType instance via a GET request and that loaded SoftType instance has one or more arrays of entries, ShareAspace will by default return a maximum of 10 of these entries per array. If there are more than 10 references per array, ShareAspace will provide HAETOAS links for requesting additional pages (in set of 10) for each of the arrays exceeding 10.
Requesting a page for an array is done using the following pattern.
GET https://{fqdn}/api/space/{spaceId}/softtype/page/{softTypeId}/{outputSchemaId}/{arrayPortId}/{objectId}/{pageNumber}
Note
The first page has page number 0.
Example
In this example a SoftType GET request is performed in order to load a SoftType. This SoftType
has an array files
with a total of 18 entries.
When loading the SoftType we get the first 10 entries back.
In the HAETOAS (link
) section there is a page
link including the pattern for requesting
the additional pages. There is also additional metadata stating that the number of items in
total is 18 and that the total number of pages is 2.
{
"href": "https://xyz.eurostep.com/api/space/test/softtype/0400000000000000120105000000",
"data": {
...
"files": [
{
"$entryId": 17,
"name": "SMC-Cyl-CJ2-16x75.png",
"location": "0400000000000000120111000000"
},
{
"$entryId": 19,
"name": "SMC-Cyl-CJ2-16x75.jt",
"location": "0400000000000000120113000000"
},
{
"$entryId": 38,
"name": "es-doc-0001.pdf",
"location": "0400000000000000120126000000"
},
{
"$entryId": 40,
"name": "es-doc-0002.pdf",
"location": "0400000000000000120128000000"
},
{
"$entryId": 42,
"name": "es-doc-0003.pdf",
"location": "040000000000000012012a000000"
},
{
"$entryId": 44,
"name": "es-doc-0004.pdf",
"location": "040000000000000012012c000000"
},
{
"$entryId": 46,
"name": "es-doc-0005.pdf",
"location": "040000000000000012012e000000"
},
{
"$entryId": 48,
"name": "es-doc-0006.pdf",
"location": "0400000000000000120130000000"
},
{
"$entryId": 50,
"name": "es-doc-0007.pdf",
"location": "0400000000000000120132000000"
},
{
"$entryId": 52,
"name": "es-doc-0008.pdf",
"location": "0400000000000000120134000000"
}
...
},
"version": 2,
"links": [
...
{
"rel": "page",
"href": "https://xyz.eurostep.com/api/space/test/softtype/page/Part/defaultOut/files/0400000000000000120110000000/{pageNumber}",
"method": "GET",
"sectionPath": "files",
"pages": 2,
"totalNumber": 18
},
...
]
}
Using the provided link with pageNumber set to 1 the second page will be returned.
GET https://xyz.eurostep.com/api/space/test/softtype/page/Part/defaultOut/files/0400000000000000120110000000/1
{
"href": "https://xyz.eurostep.com/api/space/test/softtype/page/Part/defaultOut/files/0400000000000000120110000000/1",
"data": [
{
"$entryId": 54,
"name": "es-doc-0009.pdf",
"location": "0400000000000000120136000000"
},
{
"$entryId": 56,
"name": "es-doc-0010.pdf",
"location": "0400000000000000120138000000"
},
{
"$entryId": 58,
"name": "es-doc-0011.pdf",
"location": "040000000000000012013a000000"
},
{
"$entryId": 60,
"name": "es-doc-0012.pdf",
"location": "040000000000000012013c000000"
},
{
"$entryId": 62,
"name": "es-doc-0013.pdf",
"location": "040000000000000012013e000000"
},
{
"$entryId": 64,
"name": "es-doc-0014.pdf",
"location": "0400000000000000120140000000"
},
{
"$entryId": 66,
"name": "es-doc-0015.pdf",
"location": "0400000000000000120142000000"
},
{
"$entryId": 68,
"name": "es-doc-0016.pdf",
"location": "0400000000000000120144000000"
}
],
"version": 2
}
Filter Configuration
In the configuration it is possible to define filters for SoftTypes and their array ports. This is done in the SoftType Filter section of the configuration tool.
To use a defined filter and to get the correct filtered information in the HAETOAS links you can provide the filter id as a query parameter when doing the SoftType GET and the page GET.
If you have a filter configuration where you have left the value field blank you also have the ability to pass a dynamic value parameter using the query parameters.
Note
These filters can also be configured to be used by UI controls that displays arrays.
SoftType GET
GET https://xyz.eurostep.com/api/space/test/softtype/0400000000000000120105000000?softTypeFilterId={filterId}
GET https://xyz.eurostep.com/api/space/test/softtype/0400000000000000120105000000?softTypeFilterId=documents
With a dynamic value parameter:
GET https://xyz.eurostep.com/api/space/test/softtype/0400000000000000120105000000?softTypeFilterId={filterId}&{gourpId}.{criteriaPort}={portValue}
GET https://xyz.eurostep.com/api/space/test/softtype/0400000000000000120105000000?softTypeFilterId=documents&documents.value.id=myValue
Page 2 GET
GET https://xyz.eurostep.com/api/space/test/softtype/page/Part/defaultOut/files/0400000000000000120110000000/1?softTypeFilter={filterId}
With a dynamic value parameter:
GET https://xyz.eurostep.com/api/space/test/softtype/page/Part/defaultOut/files/0400000000000000120110000000/1?softTypeFilter={filterId}&{gourpId}.{criteriaPort}={portValue}