diff --git a/src/main/java/se/kb/oai/pmh/ListBase.java b/src/main/java/se/kb/oai/pmh/ListBase.java index cb586d0..6f5aa58 100644 --- a/src/main/java/se/kb/oai/pmh/ListBase.java +++ b/src/main/java/se/kb/oai/pmh/ListBase.java @@ -20,7 +20,7 @@ public abstract class ListBase extends ResponseBase { /** * Constructor. * - * @param the response + * @param document the response * * @throws ErrorResponseException */ diff --git a/src/site/apt/downloads.apt b/src/site/apt/downloads.apt new file mode 100644 index 0000000..e22fb27 --- /dev/null +++ b/src/site/apt/downloads.apt @@ -0,0 +1,29 @@ + ----- + OAI4J: a client library for PMH and ORE + ----- + Oskar Grenholm + ----- + 2008-03-18 + ----- + +Releases + + All releases can be found at the + {{{http://sourceforge.net/project/showfiles.php?group_id=221177}Sourceforge Downloads page}}. + +Source Code + + The source code can be retrieved via Subversion from Sourceforge by following + {{{http://sourceforge.net/svn/?group_id=221177}these instructions}}.\ + \ + It can then be built by using the {{{http://maven.apache.org/}Maven}} tool. + To create the jar file just type: + ++-----+ +mvn package ++-----+ + + in the downloaded directory that has the pom.xml file. This will create + an oai4j-VERSION.jar in the target/ directory. + + \ No newline at end of file diff --git a/src/site/apt/examples.apt b/src/site/apt/examples.apt new file mode 100644 index 0000000..dd8b4f6 --- /dev/null +++ b/src/site/apt/examples.apt @@ -0,0 +1,131 @@ + ----- + OAI4J: a client library for PMH and ORE + ----- + Oskar Grenholm + ----- + 2008-03-18 + ----- + + +Dependencies + + OAI4J has two dependencies on other Java libraries: + + * dom4j-1.6.1.jar - {{http://www.dom4j.org}} + + * jaxen-1.1.1.jar - {{http://jaxen.codehaus.org/}} + + [] + + Both of these needs to be present on the classpath to successfully run OAI4J. + +Examples + + To create an OaiPmhServer object and use it to retrieve a Record: + ++-----+ + +String baseurl = "http://magasin.kb.se:8080/oaiprovider/"; +OaiPmhServer server = new OaiPmhServer(baseurl); +Record record = server.getRecord("oai:kb:1", "oai_dc"); + ++-----+ + + + To get the metadata from the Record: + ++-----+ + +Element metadata = record.getMetadata(); +// You can now use the org.dom4j.Element to handle the metadata as you see fit. + +// OR you can get the metadata as a String instead. +String metadataString = record.getMetadataAsString(); + ++-----+ + + + To list ALL identifiers in the repository that has "oai_dc" metadata: + ++-----+ + +IdentifiersList list = server.listIdentifiers("oai_dc"); +while (more) { + for (Header header : list.asList()) { + System.out.println(header.getIdentifier()); + } + if (list.getResumptionToken() != null) + list = oai.listIdentifiers(list.getResumptionToken()); + else + more = false; +} + ++-----+ + + + To create an AtomFactory and use it to create a new ResourceMap: + ++-----+ + +// AtomFactory implements ResourceMapFactory +AtomFactory factory = new AtomFactory(); +ResourceMap map = factory.newResourceMap("http://test.kb.se/rem/"); + ++-----+ + + + To populate the ResourceMap with metadata: + ++-----+ + +map.setCreator("OAI4J Library"); +map.setModified(new Date()); +map.setRights("http://creativecommons.org/licenses/by-nc-sa/2.5/"); + ++-----+ + + + To populate the ResourceMap's Aggregation with an AggregatedResource: + ++-----+ + +Aggregation aggregation = map.getAggregation(); +AggregatedResource resource = new AggregatedResource("http://test.kb.se/docs/article.pdf"); + +// Add what kind of resource it is. +resource.addType(new Type("http://purl.org/dc/dcmitype/Text")); + +// Add the author of the article. +resource.addMetadata(new Metadata(Namespace.DC, "creator", "Philip J. Fry")); + +// Add the AggregatedResource to the Aggregation. +aggregation.addResource(resource); + ++-----+ + + + To create an AtomSerializer and use it to serialize the ResourceMap to a file: + ++-----+ + +// AtomSerializer implements ResourceMapSerializer +AtomSerializer serializer = new AtomSerializer(); +serializer.serializeToFile(new File("atom.xml"), map); + ++-----+ + + + To use an AtomFactory to parse an existing Atom feed and then modify it slightly: + ++-----+ + +ResourceMap map = factory.getResourceMap("http://test.kb.se/atom.xml"); + +// Add one more AggregatedResource to the Aggregation. +map.getAggregation.addResource(aResource); + +// Set the modified date to now. +map.setModified(new Date()); + ++-----+ + diff --git a/src/site/apt/index.apt b/src/site/apt/index.apt new file mode 100644 index 0000000..9a85e22 --- /dev/null +++ b/src/site/apt/index.apt @@ -0,0 +1,14 @@ + ----- + OAI4J: a client library for PMH and ORE + ----- + Oskar Grenholm + ----- + 2008-03-18 + ----- + +OAI4J: a client library for PMH and ORE + + OAI4J is an open-source client library for OAI-PMH and OAI-ORE created by the National Library of Sweden. + The library is object-oriented in it's design and written in Java. It can be used to harvest metadata from + OAI-PMH compliant repositories.It can also be used to create new OAI-ORE Resource Maps from scratch, to + parse existing ones and to serialize them to xml. \ No newline at end of file diff --git a/src/site/site.xml b/src/site/site.xml new file mode 100644 index 0000000..f74f01a --- /dev/null +++ b/src/site/site.xml @@ -0,0 +1,23 @@ + + + + Sourceforge + http://sflogo.sourceforge.net/sflogo.php?group_id=221177&type=2 + http://sourceforge.net + + + + + + + + + + + + + + + + +