Starting to do something?

47 views
Skip to first unread message

Anja Le Blanc

unread,
Sep 23, 2013, 7:01:35 AM9/23/13
to dspac...@googlegroups.com
Dear all,

We finished our release and I have now some time to spend on the DSpace REST API.

The DSpace commiters are pushing to have a REST API with DSpace 4.0. Depending on whether they succeed a new REST API, if it wants to replace the then official API, must be pretty much compatible with which ever one they are choosing. From my work perspective that would not be altogether a bad thing as we would not have to change the application which is using REST that much.

From where we are at the moment what would be the best way to proceed?

Best regards,
Anja

Peter Dietz

unread,
Sep 23, 2013, 8:56:48 AM9/23/13
to Anja Le Blanc, dspac...@googlegroups.com
I've refactored my work-in-progress Jersey based REST API into the DSpace source tree on my account.


It would help if I knew what the data output that I'm looking for would be, i.e. Richard's intent-driven. I'm thinking for now I'll start with something similar to the current DSpaceObject shape/name of objects. 
Currently it works for /communities, /collections/, /collections/:id, /items/:id, and I'm working between improving the quality of each endpoint, and adding more endpoints.

I would like to see a REST API become standard with DSpace. I don't think I would be able to put much of any support into the Sakai ones, thus I'm putting some of my energy into the Jersey approach.



Peter Dietz


--
You received this message because you are subscribed to the Google Groups "DSpace REST" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dspace-rest...@googlegroups.com.
Visit this group at http://groups.google.com/group/dspace-rest.
For more options, visit https://groups.google.com/groups/opt_out.

Anja Le Blanc

unread,
Sep 23, 2013, 9:35:02 AM9/23/13
to dspac...@googlegroups.com, Anja Le Blanc
Great work so far. What is the best way for me to contribute?
I have some time now :-)

Anja

Pottinger, Hardy J.

unread,
Sep 23, 2013, 10:38:38 AM9/23/13
to Anja Le Blanc, dspac...@googlegroups.com
Anja, I know you asked Peter, but I thought I'd just chime in here. I
suggest that we just pretend that Peter's branch will end up being a pull
request, and pull it into our own working copies and then make comments on
Peter's branch if we see areas that need attention or changes. Or just
send him a pull request if you have some changes you've tried and would
like to see incorporated into the eventual PR. Sound like a plan?

--
HARDY POTTINGER <potti...@umsystem.edu>
University of Missouri Library Systems
http://lso.umsystem.edu/~pottingerhj/
https://MOspace.umsystem.edu/
"What day is it?"
"It's today," squeaked Piglet.
"My favorite day," said Pooh.
>dspace-rest...@googlegroups.com <javascript:>.
><http://groups.google.com/group/dspace-rest>.
>For more options, visit
>https://groups.google.com/groups/opt_out
><https://groups.google.com/groups/opt_out>.

Peter Dietz

unread,
Sep 23, 2013, 10:40:12 AM9/23/13
to Anja Le Blanc, dspac...@googlegroups.com
Hi Anja, 

Feel free to check out that branch, and get it running. I would fork it, and start commiting to your own branch, and then make various pull-requests to merge them back into my account. 

Things that I was hoping for jersey, would be to have an endpoint for each DSO, /communities/, /collections, /items, /bitstreams. I don't care for bundles...

The response for each, needs to have the objects basic internal metadata, i.e. name, internalID, handle, type, last-modified. Then have ways to expose the related data such as the items in a collection.

As you go, be sure the make requests/tests for each Accept type, of xml vs json. While I was working, I noticed that a feature I added couldn't serialize to XML, so I took it out.
Accept: application/xml;q=0.3,application/json;q=0.4

I'm hoping to first start with getting the read-only of non-sensitive information first, and get that working solidly. Then, after that, I would think about what to do for AUTH, and then to support the remaining features in CRUD. I don't have anything in there for paging, 1-50, 51-100, ..., but that is probably important for large sets.

There is some interesting work in the Sakai based interfaces, I would love to grab relevant implemented sections, and plop them in. Also, as I'm going, I'm thinking I might have to refactor some objects in dspace-api, to add some type of helper methods. Already I've added something to like DCValue.getMetadataKey(), which is a helper to get: dc.date.issued. Even though I want to avoid using a deprecated class, I don't have an alternative.



Peter Dietz

Anja Le Blanc

unread,
Sep 23, 2013, 11:10:02 AM9/23/13
to dspac...@googlegroups.com
I forked it, but something seems not completely right with the maven:

[INFO] DSpace REST (JAX RS 1 - Jersey) :: Local Customizations  FAILURE [0.074s]

[ERROR] Failed to execute goal on project rest: Could not resolve dependencies for project org.dspace.modules:rest:war:4.0-SNAPSHOT: Failure to find org.dspace:dspace-rest:jar:classes:4.0-SNAPSHOT in http://oss.sonatype.org/content/repositories/releases/ was cached in the local repository, resolution will not be reattempted...

Something to look into tomorrow.
Otherwise your plan sounds good to me. I'll let you (the list) know what I am planning to do to avoid writing the same classes.

Regards,

Anja

Pottinger, Hardy J.

unread,
Sep 23, 2013, 11:21:15 AM9/23/13
to Anja Le Blanc, dspac...@googlegroups.com
Hi, Anja, I ran into the same issue. Peter has provided some advice in the
README file:

https://github.com/peterdietz/DSpace/blob/rest-jersey/dspace-rest/README#L8



--

HARDY POTTINGER <potti...@umsystem.edu>
University of Missouri Library Systems
http://lso.umsystem.edu/~pottingerhj/
https://MOspace.umsystem.edu/
"I think I like disruptive technology because
it makes the whole world a bit fuzzy, my
normal state of mind."
-- Robert Llewellyn (aka Kryten)
><http://groups.google.com/group/dspace-rest>.
>For more options, visit
>https://groups.google.com/groups/opt_out
><https://groups.google.com/groups/opt_out>.
>
>
>
>
>
>
>
>
>
>--
>You received this message because you are subscribed to the Google Groups
>"DSpace REST" group.
>To unsubscribe from this group and stop receiving emails from it, send an
>email to
>dspace-rest...@googlegroups.com <javascript:>.
><http://groups.google.com/group/dspace-rest>.
>For more options, visit
>https://groups.google.com/groups/opt_out
><https://groups.google.com/groups/opt_out>.

Peter Dietz

unread,
Sep 23, 2013, 11:59:46 AM9/23/13
to Pottinger, Hardy J., Anja Le Blanc, dspac...@googlegroups.com
I'm not a super maven-expert. 

I've wrote some advice in the readme.


mvn clean package
#If you run into an issue with Maven, try manually importing the Jar/War.
mvn install:install-file -DgroupId=org.dspace -DartifactId=dspace-rest -Dversion=4.0-SNAPSHOT -Dclassifier=classes -Dpackaging=jar -Dfile=dspace-rest/target/dspace-rest.war
mvn clean package
ant update

Peter Dietz

Anja Le Blanc

unread,
Sep 24, 2013, 10:48:48 AM9/24/13
to dspac...@googlegroups.com
In
/dspace/modules/rest/pom.xml
lines 101 to 107
is the dependency of dspace-rest.jar

I took it out and maven builds correctly now.
Nowhere in the build process is a dsapce-rest. jar being build - do you actually need it?

Regards,
Anja

Peter Dietz

unread,
Sep 24, 2013, 2:19:05 PM9/24/13
to Anja Le Blanc, dspac...@googlegroups.com
I think I was just emulating how the dspace/modules/xmlui/pom.xml was set up. If dspace-rest.jar isn't needed, then in 93-98, do I also need to depend on dspace-rest.war? (I get maven, but I haven't mastered these finer points)



One of the things on my this-week agenda is to get /collections and /communities endpoints complete enough that I can replace the community-list page with it.

Building the FULL site community/collection tree is quite expensive, and with our cocoon caching being more trouble than its worth, we'd like to enlist REST to help speed up the rendering of this page. Our current XMLUI community-list load time is about 30 seconds. I'm thinking to have AJAX fetch more data when the user hits the expand button.

Peter Dietz


bill mckinney

unread,
Sep 24, 2013, 2:55:24 PM9/24/13
to dspac...@googlegroups.com, Anja Le Blanc
Hey guys,

I can't promise any great performance improvements but you might get some ideas on some possible json result formats from our community/collection endpoints.

For example, here is an endpoint that provides the full community-collection hierarchy: http://50.116.59.51:8080/api/v2/communities/tree

You can get an unexpanded community list as well: http://50.116.59.51:8080/api/v2/communities

Peter, the on demand loading idea is a good one!

--Bill

Anja Le Blanc

unread,
Sep 25, 2013, 3:57:15 AM9/25/13
to dspac...@googlegroups.com
On Tuesday, September 24, 2013 7:19:05 PM UTC+1, Peter Dietz wrote:
I think I was just emulating how the dspace/modules/xmlui/pom.xml was set up. If dspace-rest.jar isn't needed, then in 93-98, do I also need to depend on dspace-rest.war? (I get maven, but I haven't mastered these finer points)

Short answer - yes you need dspace-rest.war. That provides you with the rest webapp in the right places.

Longer answer: the main pom.xml contains a module 'dspace' which executes the dspace/pom.xml which again contains a module 'module' (executes dspace/module/pom.xml) which contains
all the add on modules (including 'rest'), than executing all the pom.xml of the modules. With the 'rest' module being dependent on dspace-rest.war this file is copied to the rest/target directory. Back in the dspace/pom.xml is a maven-assembly-plugin dspace/src/main/assembly/assembly.xml which is responsible for copying everything war from the modules to the webapps directory.
At this point ant should do everything else.

Best regards,
Anja
Reply all
Reply to author
Forward
0 new messages