Commit 380c87cc authored by acoburn's avatar acoburn
Browse files

update readme files

parent 0e4bed04
......@@ -2,6 +2,12 @@
This is a collection of services that extend the functionality of a Fedora4 repository.
##Services
Id Mapping Service: This maps a public ID to a (internal and much longer) fedora URI
Id Mapping Service Database: This exposes a Postgres datastore for use with the Id Mapping service
Minter: This mints random (public) URIs for use with fedora resources
##Building
To build this project use
......
......@@ -7,7 +7,7 @@
http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0 http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.1.0.xsd"
default-activation="lazy">
<cm:property-placeholder persistent-id="edu.amherst.acdc.pgsql" update-strategy="reload" >
<cm:property-placeholder persistent-id="edu.amherst.acdc.idmapper.pgsql" update-strategy="reload" >
<cm:default-properties>
<cm:property name="pgsql.host" value="localhost"/>
<cm:property name="pgsql.port" value="5432"/>
......
......@@ -44,6 +44,10 @@
<groupId>org.apache.camel</groupId>
<artifactId>camel-sql</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jetty</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-blueprint</artifactId>
......
......@@ -61,7 +61,15 @@ public class EventRouter extends RouteBuilder {
System.getProperty("acdc.ext.idmapper.port", port));
/**
* Process a message.
* REST configuration
*/
rest("{{rest.prefix}}")
.get("{id}").to("direct:get")
.put("{id}").to("direct:update")
.delete("{id}").to("direct:delete");
/**
* Process a message via JMS
*/
from("{{input.stream}}")
.routeId("IdMappingRouter")
......@@ -77,23 +85,24 @@ public class EventRouter extends RouteBuilder {
.process(new IdProcessor())
.to("direct:update");
/**
* Handle CRUD operations
*/
from("direct:update")
.routeId("IdMappingUpdateRouter")
.to("sql:select count(*) from uris");
.to("sql:UPDATE idmapper SET fedora=:#fedora WHERE public=:#public")
.filter(simple("${body} == 0"))
.to("sql:INSERT INTO idmapper (fedora, public) VALUES (:#fedora, :#public)");
from("direct:get")
.routeId("IdMappingFetchRouter")
.log("${headers}")
.to("mock:jdbc:idmapper");
from("direct:put")
.routeId("IdMappingPutRouter")
.log("${headers}")
.to("direct:update");
.to("sql:SELECT fedora FROM idmapper WHERE public=:#public");
from("direct:delete")
.routeId("IdMappingDeleteRouter")
.log("${headers}")
.to("mock:jdbc:idmapper");
.to("sql:DELETE FROM idmapper WHERE public=:#public");
}
}
......@@ -13,6 +13,8 @@
<cm:property name="error.maxRedeliveries" value="10"/>
<cm:property name="jms.brokerUrl" value="tcp://localhost:61616"/>
<cm:property name="input.stream" value="activemq:topic:fedora"/>
<cm:property name="rest.prefix" value="idmapper"/>
<cm:property name="rest.port" value="9080"/>
<cm:property name="id.property" value="dc:identifier"/>
<cm:property name="id.namespace" value="http://purl.org/dc/elements/1.1/"/>
</cm:default-properties>
......
......@@ -11,13 +11,28 @@
<feature version="${camel.version}">camel-blueprint</feature>
<feature version="${camel.version}">camel-jetty</feature>
<feature version="${camel.version}">camel-jackson</feature>
<feature version="${camel.version}">camel-sql</feature>
<feature version="${fcrepo-camel.version}">fcrepo-camel</feature>
<bundle>mvn:edu.amherst.acdc/repo-id-mapper/{project.version}</bundle>
<bundle>mvn:edu.amherst.acdc/acrepo-idmapper/{project.version}</bundle>
<configfile finalname="/etc/edu.amherst.acdc.idmapper.cfg">mvn:edu.amherst.acdc/acrepo-idmapper/${project.version}/cfg/configuration</configfile>
</feature>
<feature name="acrepo-idmapper-pgsql" version="${project.version}" resolver="(obr)" start-level="50">
<details>Installs the id mapping service database</details>
<feature>jdbc</feature>
<feature>transaction</feature>
<feature>jndi</feature>
<bundle dependency="true">wrap:mvn:postgresql/postgresql/${postgresql.version}</bundle>
<bundle>mvn:edu.amherst.acdc/acrepo-idmapper-pgsql/{project.version}</bundle>
<configfile finalname="/etc/edu.amherst.acdc.idmapper.pgsql.cfg">mvn:edu.amherst.acdc/acrepo-idmapper-pgsql/${project.version}/cfg/configuration</configfile>
</feature>
<feature name="acrepo-mint" version="${project.version}" resolver="(obr)" start-level="50">
<details>Installs the id minter</details>
......
......@@ -49,6 +49,11 @@
<artifactId>camel-blueprint</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jetty</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-sql</artifactId>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment