[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Handle-info] Handle source code - compile / github



The handle.jar code includes both handle server code and handle client ("resolver") code.  If you just want handle client code, you can download a smaller library jar from http://handle.net/client_download.html .

If you want a resolution service, you could download the "proxy servlet" from http://handle.net/proxy_servlet.html .  It is a servlet but doesn't incorporate Jetty and can run in any servlet container.  Perhaps you could adapt it to a non-servlet-based server environment.

The JSON REST API is implemented by HandleJsonRestApiServlet; that is used by either the handle server or the proxy server.  

Now---are you saying you want to write a stripped-down minimal handle server?  I suspect in that case you want to start with the proxy servlet code.  In addition to the JSON REST API, you'll also have "NativeServlet" which accepts Handle-protocol requests tunneled over HTTP.  Native handle clients (including hdl.handle.net) would then be able to talk to your server.  In Handle parlance you'd have a handle site with a single HTTP interface.

Let me know if that is helpful, and feel welcome to keep asking questions.

Robert

> On 2016-05-19, at 13:23, Peter Dietz <peter@longsight.com> wrote:
> 
> Hi Robert,
> 
> Thanks for that pointer, unpacking the src.zip in place provides the lib jars that got it to work, thanks. Once I got the ball rolling, I realized what all was needed, and am making progress. I was able to convert this locally to a gradle build project, pretty easy.
> 
> My next question is, how married is the handle resolver to jetty (listening on network interface and ports) and all that? I just want to run the jvm with a resolver, but no servlets, no ports, no ip addresses being listened (something else, lambda, will do that). Perhaps a different way of phrasing this, is whats the minimum amount of handle logic that I could get away with, if I'm only providing handle resolution? Are handshakes and key exchanges necessary, or can I just run something that responds to incoming requests.
> GET /handle/1234/5678    -> http://some.repository/handle/1234/5678
> 
> The release notes mention something about REST + JSON, which opens the door to independent handle servers (my very simple code that returns simple handle resolution), but that isn't enough information for me to build something.
> 
> Thanks.
> 
> ________________
> Peter Dietz
> Longsight
> www.longsight.com
> peter@longsight.com
> p: 740-599-5005 x809
> 
> On Wed, May 18, 2016 at 4:18 PM, Robert R Tupelo-Schneck <schneck@cnri.reston.va.us> wrote:
> Either unzip src.zip in place, or copy the entire "lib" directory structure from the distribution.  Then you will have all the necessary dependencies, including cnriutil.jar which has net.cnri packages (the source for those is also included separately in src.zip).
> 
> We have discussed dependency management / build frameworks and have not been moved to adopt Maven or Gradle for our own development.  However, we do have an eventual goal of making the handle client library easily available to those who do use Maven and want to use the handle library.
> 
> We have also discussed having our source on GitHub, and although some of us find that a very exciting option, it's not clear if or when it would actually be something CNRI would choose to do.
> 
> Robert
> 
> > On May 18, 2016, at 3:53 PM, Peter Dietz <peter@longsight.com> wrote:
> >
> > Long time handle user, first time trying to get my hands dirty and play with the code itself.
> >
> > 1) I'm having trouble getting the 8.1.1 code to compile. Here's what I've done so far:
> >
> > wget http://www.handle.net/hnr-source/hcj-8.1.1.tar.gz
> > tar xzvf hcj-8.1.1.tar.gz
> > cd dist/hcj-8.1.1/
> > mkdir handle-library-8.1.1
> > cp src.zip handle-library-8.1.1/
> >
> > cp src.zip handle-source-8.1.1
> > cd handle-source-8.1.1
> > ant
> >
> > BUILD FAILED
> > /Users/peterdietz/Projects/handle/hsj-8.1.1/handle-8.1.1-source/build.xml:224: /Users/peterdietz/Projects/handle/hsj-8.1.1/handle-8.1.1-source/lib/jetty does not exist.
> >
> > Okay.. So then, I make that directory:
> > mkdir -p lib/jetty
> > ant
> >
> > util:
> >     [javac] Compiling 14 source files to /Users/peterdietz/Projects/handle/hsj-8.1.1/handle-8.1.1-source/build
> >     [javac] /Users/peterdietz/Projects/handle/hsj-8.1.1/handle-8.1.1-source/src/net/handle/util/DeepClone.java:16: error: package net.cnri.util does not exist
> >     [javac] public interface DeepClone extends net.cnri.util.DeepClone
> >
> > It looks like things are referencing net.cnri, which doesn't exist in my source tree. Maybe I'm missing some jar? I only see net.handle.*
> >
> > I feel like instead of packaging the jar dependencies yourself, using a dependency management tool would work better, i.e. maven/gradle. Also, maybe I've missed some documentation about how to build it yourself.
> >
> >
> > 2) Is there a reason why the source code isn't somewhere accessible like GitHub? To get the library code, you have to get a tarball of the binary release, then unzip a src.zip file, and as I've mentioned above, is not working out of the box for me.
> > (Sorry if this is a naive question, it seems pretty commonplace these days).
> >
> >
> > Thanks in advance.
> >
> >
> > ________________
> > Peter Dietz
> > Longsight
> > www.longsight.com
> > peter@longsight.com
> > p: 740-599-5005 x809
> > _______________________________________________
> > Handle-Info mailing list
> > Handle-Info@cnri.reston.va.us
> > http://www.handle.net/mailman/listinfo/handle-info
> 
> 

_______________________________________________
Handle-Info mailing list
Handle-Info@cnri.reston.va.us
http://www.handle.net/mailman/listinfo/handle-info