Hi all,
According to the off-line discussions I had with Subash and Ruchira, how
governance handles pagination in UI is as follows.
- Use 'getAllGenericArtifactIds' method [01] to get all the asset-id's
of a given type.
- Get asset count from the result.
- Then implement pagination logic based on defined 'number of items for
a page'.
If we use same methodology to support pagination in ES, we'll have to
perform above steps at each time the page is refreshed etc. This will be a
blocker in the perspective of performance. Further, when I look into the
implementation of "getAllGenericArtifactIds" it calls following method.[02]
> public String[] getAllGovernanceArtifactIds() throws GovernanceException {
> GovernanceArtifact[] artifacts = getAllGovernanceArtifacts();
> String[] artifactIds = new String[artifacts.length];
> for (int i = 0; i < artifacts.length; i++) {
> artifactIds[i] = artifacts[i].getId();
> }
> return artifactIds;
> }
>
Therefore I think using above methodology to handle pagination[to get
number of pages] is not acceptable due to the amount of back-end processing.
I suggest that we better have a method of returning a count of assets of a
given type. (something like caching asset count).
WDYT?
[01]
https://github.com/wso2-dev/carbon-governance/blob/master/components/governance/org.wso2.carbon.governance.api/src/main/java/org/wso2/carbon/governance/api/generic/GenericArtifactManager.java
[02]
https://github.com/wso2-dev/carbon-governance/blob/master/components/governance/org.wso2.carbon.governance.api/src/main/java/org/wso2/carbon/governance/api/common/GovernanceArtifactManager.java
On Tue, Jul 29, 2014 at 4:52 PM, Ayesha Dissanayaka <[email protected]> wrote:
> Hi,
>
> In order to provide pagination via ES-API we need to get the number of
> available assets of a given type.
>
>> ex: Registry.ArtifactManager.getCount();
>>
>
> If registry provides such direct method, what would be it? If not, is it
> possible to provide such method or what would be the best approach?
>
> --
> *Ayesha Dissanayaka*
> Software Engineer,
> WSO2, Inc : http://wso2.co
> <http://www.google.com/url?q=http%3A%2F%2Fwso2.com&sa=D&sntz=1&usg=AFQjCNEZvyc0uMD1HhBaEGCBxs6e9fBObg>
> 20, Palmgrove Avenue, Colombo 3
> E-Mail: [email protected] <[email protected]>
>
--
*Ayesha Dissanayaka*
Software Engineer,
WSO2, Inc : http://wso2.com
<http://www.google.com/url?q=http%3A%2F%2Fwso2.com&sa=D&sntz=1&usg=AFQjCNEZvyc0uMD1HhBaEGCBxs6e9fBObg>
20, Palmgrove Avenue, Colombo 3
E-Mail: [email protected] <[email protected]>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev