-
ORCiD & Datacite, Programming
Getting started with the public ORCID API using swagger – quickstart guide
Posted on by TomORCID recently implemented a swagger definition file for it’s v2.0 API, which means it’s now even easier to access the public ORCID API from your website. Just use swagger.js. It’s Super. And Easy. Let’s give it a go. First, clone swagger onto your machine. Either use the git desktop client, click the button on the repository or fetch it… Read more »
-
A bit of background I’ve been working in the C# world for a few months now. While the code is very similar to Java,the culture around open source could not be more different. Where open source as business as usual in the Java & Javascript worlds, it’s very much exceptional circumstances only in the .Net one…. Read more »
-
Back when I was a lowly junior programmer, life was great. We had a humongous 64k of memory to play with, two whole (user defined!) colours and an 80 character width screen. We managed gigantic millions of member pension schemes using the equivalent of a commodore 64. Recursive functions meant stack overflow. Not one of these… Read more »
-
Programming
Making acceptance testing easy, useful and fun with BDD – enter cucumber
Posted on by TomUser stories, requirements analysis and all that Jazz. I’ve been mulling over my approach to gathering requirements recently and it’s become clear that although I’m Doing It Right a lot of the time, I’m also Doing It Wrong. Ron Jefferies wrote about the Three Cs 13 years ago. He did it in the context of Extreme… Read more »
-
A while back I wrote a post on how not to parse CSV using Java. It included a few pointers on how to pull CSV data into an application but not how to spit it back out. I thought I’d write a quick post on writing CSV and a few best practice pointers that will help… Read more »
-
Programming
How to set up method level caching with annotations using javax.cache / JCache / JSR-107 & Guice
Posted on by TomI’ve just spent a day looking at Java caching standards and utilising them in front of a data repository. It turns out that information, and by this I mean practical information that helps with implementation, is a little thin on the ground. If you’re not using Spring, you’re stuffed. Hence this post. JSR-107 is the original… Read more »
-
A little bit of history XML processing in Java has come a long way in the last ten years. Back in the old days mapping XML to Java was a bit of a nightmare, deserialising usually meant pulling the DOM apart bit by bit to get at the interesting parts. Serialisation was worse – the… Read more »
-
As part of my work with data-centres and ORCiD I’ve put together a tool that lets you see where works claimed within ORCiD have been published. Start typing a publisher into the search box and it’ll look up the DOI prefix (or other identifier prefix) for that publisher from a list nearly 4000 long. Current… Read more »
-
Update: ORCiD client now available as a Maven dependency! I’ve just open sourced a Java application I’ve been working on at the British Library. It’s a RESTlet server and JQuery/bootstrap client that enables people to claim a work from a remote service, log into ORCID using OAuth and add the work to their profile. It… Read more »
-
My previous post described how to serve webjars with RESTlet. This post will describe how to add caching so that users don’t swamp your servers with requests. Put simply, you put a filter in the chain before the directory and modify the HTTP headers of successful requests. Like so:
1234567891011121314151617181920//add a webjars listener.final Directory dir = new Directory(getContext(), "clap://class/META-INF/resources/webjars");//add cache headers to the webjars so we're not swamped by requests, set things to expire in a year.Filter cache = new Filter(getContext(),dir){protected void afterHandle(Request request, Response response) {super.afterHandle(request, response);if (response!= null && response.getEntity() != null) {if (response.getStatus().equals(Status.SUCCESS_OK)){final Calendar calendar = Calendar.getInstance();calendar.add(Calendar.YEAR, 1);response.getEntity().setExpirationDate(calendar.getTime());response.setCacheDirectives(new ArrayList<CacheDirective>());response.getCacheDirectives().add(CacheDirective.maxAge(31536000));}}}};this.attach("/webjars", cache);
Close