Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collection Partial Lists #3

Open
sebhofmann opened this issue Sep 10, 2015 · 0 comments
Open

Collection Partial Lists #3

sebhofmann opened this issue Sep 10, 2015 · 0 comments

Comments

@sebhofmann
Copy link

In Atom-Pub its possible to get partitial lists of collections, the swordv2 spec contains no statement that its forbidden to use partial lists, so i have to assume that its okay to use them.
(http://www.ietf.org/rfc/rfc5023.txt -> 10.1. Collection Partial Lists)

My Col-IRI looks like this:

GET http://localhost:8291/sword2/col/DefaultModsCollection/
...
<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <link href="http://localhost:8291/sword2/col/DefaultModsCollection/1" rel="first"/>
  <link href="http://localhost:8291/sword2/col/DefaultModsCollection/2" rel="next"/>
  <link href="http://localhost:8291/sword2/col/DefaultModsCollection/2" rel="last"/>
<generator uri="http://www.swordapp.org/" version="2.0"/>
  <entry xmlns:app="http://www.w3.org/2007/app">
    <id>mods_00000001</id>
    ....
  </entry>
  <entry xmlns:app="http://www.w3.org/2007/app">
    <id>mods_00000002</id>
   ...
  </entry>
</feed>

For testing i have a limit of 2 entrys.
If i make a second request:

GET http://localhost:8291/sword2/col/DefaultModsCollection/2
...
<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <link href="http://localhost:8291/sword2/col/DefaultModsCollection/1" rel="first"/>
  <link href="http://localhost:8291/sword2/col/DefaultModsCollection/2" rel="last"/>
  <generator uri="http://www.swordapp.org/" version="2.0"/>
  <entry xmlns:app="http://www.w3.org/2007/app">
    <id>mods_00000003</id>
    ...
  </entry>
  <entry xmlns:app="http://www.w3.org/2007/app">
    <id>mods_00000004</id>
    ...
 </entry>
</feed>

If i now try to list the collection, then i only get mods_00000001 and mods_00000002. The API only respects the current document and ignores the next link.

// col = http://localhost:8291/sword2/col/DefaultModsCollection
final CollectionEntries collectionEntries = client.listCollection(col);
                    collectionEntries.getEntries().forEach(e-> {
                       System.out.println(e.getTitle() + "[" + e.getId() + "]");
                    });

Should the API handle this or should the user of JavaClient handle this ?
Is it unusual to do this in SwordV2 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant