Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: uvalib/beverly
...
head fork: uvalib/beverly
Checking mergeability… Don't worry, you can still create the pull request.
  • 6 commits
  • 20 files changed
  • 0 commit comments
  • 2 contributors
Commits on May 01, 2012
Michael Durbin Parameterized predicates that define link datastreams with indexers a…
…nd made changes to allow code to work against a fresh installation of fedora 3.5 and solr 3.5.0.
467cc14
Commits on May 02, 2012
Michael Durbin Eliminating the "dependency-predicate" configuration parameter. a8aecc9
Commits on May 10, 2012
@ajs6f ajs6f Merge branch 'fedora-35-general' e84dafe
@ajs6f ajs6f Merging 0695647
@ajs6f ajs6f Merge branch 'master' into LIBSRVOLEWORKFLOW-23 a03890e
Commits on May 11, 2012
@ajs6f ajs6f First simple tests of getIndexingMetadata dissemination using one tes…
…t object
0f12055
Showing with 615 additions and 333 deletions.
  1. +6 −0 itests/pom.xml
  2. +1 −1  itests/src/test/java/edu/virginia/lib/beverly/BuildFedoraObjects.java
  3. +1 −1  itests/src/test/java/edu/virginia/lib/beverly/Constants.java
  4. +4 −0 itests/src/test/java/edu/virginia/lib/beverly/GenericTest.java
  5. +49 −5 itests/src/test/java/edu/virginia/lib/beverly/ITestGetIndexingMetadata.java
  6. +0 −3  itests/src/test/java/edu/virginia/lib/beverly/ITestThatBeverlyExists.java
  7. +3 −4 itests/src/test/java/edu/virginia/lib/beverly/KarafConfig.java
  8. +118 −0 itests/src/test/resources/container-config/server.xml
  9. +4 −8 itests/src/test/resources/fedora-home/server/config/spring/web/security.xml
  10. +5 −0 repository-indexing/pom.xml
  11. +1 −0  repository-indexing/src/main/features/features.xml
  12. +55 −0 repository-indexing/src/main/java/edu/virginia/lib/camel/http/RedirectHttpClientConfigurer.java
  13. +351 −296 repository-indexing/src/main/resources/OSGI-INF/blueprint/camel-context.xml
  14. +3 −3 repository-indexing/src/main/resources/OSGI-INF/metatype/config-metadata.xml
  15. +1 −0  repository-indexing/src/main/resources/freemarker/atom/{getdatastream.vm → getDatastream.vm}
  16. +1 −1  repository-indexing/src/main/resources/freemarker/atom/removetriples.vm
  17. +3 −5 repository-indexing/src/main/resources/freemarker/sparql/getindexabledatastreams.vm
  18. +3 −5 repository-indexing/src/main/resources/freemarker/sparql/getindexeddatastreams.vm
  19. +1 −1  repository-indexing/src/main/resources/xslt/splitRDFDescriptions.xsl
  20. +5 −0 repository-indexing/src/site/xdoc/config.xml
View
6 itests/pom.xml
@@ -68,6 +68,12 @@
<version>1.2.1</version>
<configuration>
<configuration>
+ <configfiles>
+ <configfile>
+ <file>${project.basedir}/src/test/resources/container-config/server.xml</file>
+ <todir>conf</todir>
+ </configfile>
+ </configfiles>
<deployables>
<deployable>
<artifactId>fcrepo-webapp-fedora</artifactId>
View
2  itests/src/test/java/edu/virginia/lib/beverly/BuildFedoraObjects.java
@@ -26,7 +26,7 @@
final private static String repo1ObjectsUrlString = repo1Url
+ "/objects/new";
- @SneakyThrows()
+ @SneakyThrows
protected void buildObjects() {
log("Building and ingesting Fedora object into " + repo1Url);
View
2  itests/src/test/java/edu/virginia/lib/beverly/Constants.java
@@ -8,7 +8,7 @@
final protected static String test1 = "test:1";
final protected static String test1dissemination = repo1Url + "/objects/"
- + test1 + "/" + indexSDef + "/" + indexMethod;
+ + test1 + "/methods/" + indexSDef + "/" + indexMethod;
final protected static String test2 = "test:2";
final protected static String test2dissemination = repo1Url + "/objects/"
View
4 itests/src/test/java/edu/virginia/lib/beverly/GenericTest.java
@@ -9,10 +9,14 @@
import org.ops4j.pax.exam.TestProbeBuilder;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ProbeBuilder;
+import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
public class GenericTest {
+
+ @Inject
+ protected BundleContext context;
@Inject
CommandProcessor cp;
View
54 itests/src/test/java/edu/virginia/lib/beverly/ITestGetIndexingMetadata.java
@@ -5,7 +5,9 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
+import java.io.BufferedReader;
import java.io.IOException;
+import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
@@ -13,12 +15,17 @@
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
+import lombok.SneakyThrows;
+
+import org.apache.camel.CamelContext;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.EagerSingleStagedReactorFactory;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.util.tracker.ServiceTracker;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
@@ -42,7 +49,7 @@ public void createParser() throws ParserConfigurationException {
* objects and then just let the tests run, but see:
* http://team.ops4j.org/browse/PAXEXAM-288
*/
-
+
private static boolean objectsAreBuilt = false;
@Before
@@ -53,6 +60,37 @@ public void buildObjects() throws IOException, SAXException {
objectsAreBuilt = true;
}
+ /*
+ * Same-ish deal here: we need to make sure that Beverly herself is up and
+ * running before testing her.
+ */
+
+ private static boolean beverlyIsRunning = false;
+
+ @Before
+ @SneakyThrows(InvalidSyntaxException.class)
+ public void checkBeverly() throws InterruptedException {
+ if (!beverlyIsRunning) {
+ ServiceTracker tracker = new ServiceTracker(
+ context,
+ context.createFilter("(camel.context.name=repository-indexer)"),
+ null);
+ tracker.open();
+ tracker.waitForService(0);
+ CamelContext camel = (CamelContext) tracker.getService();
+ // now we know that Beverly is running
+ camel = null;
+ context.ungetService(tracker.getServiceReference());
+ tracker.close();
+ }
+ beverlyIsRunning = true;
+ }
+
+ //@Test
+ public void hangFire() {
+ pause();
+ }
+
@Test
public void testFedoraIsRunning() throws IOException {
log("Testing for Fedora's availability...");
@@ -78,16 +116,16 @@ public void testObjectsExist() throws IOException {
log("Testing for existence of Indexable service definition...");
url = new URL(repo1Url + "/objects/indexable:sdef");
conn = (HttpURLConnection) url.openConnection();
- assertEquals("Indexable service definition was not available!", 200,
- conn.getResponseCode());
+ assertEquals("Indexable service definition was not available!",
+ 200, conn.getResponseCode());
log("Found Indexable service definition.");
}
{
log("Testing for existence of Indexable service deployment...");
url = new URL(repo1Url + "/objects/indexable:sdep");
conn = (HttpURLConnection) url.openConnection();
- assertEquals("Indexable service deployment was not available!", 200,
- conn.getResponseCode());
+ assertEquals("Indexable service deployment was not available!",
+ 200, conn.getResponseCode());
log("Found Indexable service deployment.");
}
{
@@ -149,4 +187,10 @@ public void testGetIndexingMetadataReturnsReasonableSolrXml()
+ " results!", nodes.getLength(), 1);
}
+ @SneakyThrows
+ private void pause() {
+ BufferedReader br = new BufferedReader(new InputStreamReader(System.in) );
+ String sample = br.readLine();
+ }
+
}
View
3  itests/src/test/java/edu/virginia/lib/beverly/ITestThatBeverlyExists.java
@@ -43,9 +43,6 @@
@Filter(value = "osgi.blueprint.container.symbolicname=edu.virginia.lib.repository-indexing", timeout = 20000)
BlueprintContainer blueprint;
- @Inject
- private BundleContext context;
-
private ServiceTracker tracker;
@Inject
View
7 itests/src/test/java/edu/virginia/lib/beverly/KarafConfig.java
@@ -7,6 +7,7 @@
import java.io.File;
+import org.openengsb.labs.paxexam.karaf.options.KarafDistributionConfigurationFilePutOption;
import org.openengsb.labs.paxexam.karaf.options.LogLevelOption.LogLevel;
import org.ops4j.pax.exam.Option;
@@ -24,9 +25,8 @@
// junitBundles(),
compendiumProfile(),
// just in case we want to look at debris, we should keep the
- // container: let 'mvn clean' clean up if needed.
- keepRuntimeFolder(),
- logLevel(LogLevel.DEBUG),
+ // containers: let 'mvn clean' clean up if needed.
+ keepRuntimeFolder(), logLevel(LogLevel.DEBUG),
// the tests use Guava to simplify some collections jazz
mavenBundle("com.google.guava", "guava").versionAsInProject(),
// of course, Beverly needs an MQ plant
@@ -38,5 +38,4 @@
.type("xml").classifier("features"),
"repository-indexing") };
}
-
}
View
118 itests/src/test/resources/container-config/server.xml
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<!-- Note: A "Server" is not itself a "Container", so you may not
+ define subcomponents such as "Valves" at this level.
+ Documentation at /docs/config/server.html
+ --><Server port="8205" shutdown="SHUTDOWN">
+ <!-- Security listener. Documentation at /docs/config/listeners.html
+ <Listener className="org.apache.catalina.security.SecurityListener" />
+ -->
+ <!--APR library loader. Documentation at /docs/apr.html -->
+ <Listener SSLEngine="on" className="org.apache.catalina.core.AprLifecycleListener"/>
+ <!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
+ <Listener className="org.apache.catalina.core.JasperListener"/>
+ <!-- Prevent memory leaks due to use of particular java/javax APIs-->
+ <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener"/>
+ <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
+ <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener"/>
+
+ <!-- Global JNDI resources
+ Documentation at /docs/jndi-resources-howto.html
+ -->
+ <GlobalNamingResources>
+ <!-- Editable user database that can also be used by
+ UserDatabaseRealm to authenticate users
+ -->
+ <Resource auth="Container" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" name="UserDatabase" pathname="conf/tomcat-users.xml" type="org.apache.catalina.UserDatabase"/>
+ </GlobalNamingResources>
+
+ <!-- A "Service" is a collection of one or more "Connectors" that share
+ a single "Container" Note: A "Service" is not itself a "Container",
+ so you may not define subcomponents such as "Valves" at this level.
+ Documentation at /docs/config/service.html
+ -->
+ <Service name="Catalina">
+
+ <!--The connectors can use a shared executor, you can define one or more named thread pools-->
+ <!--
+ <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
+ maxThreads="150" minSpareThreads="4"/>
+ -->
+
+
+ <!-- A "Connector" represents an endpoint by which requests are received
+ and responses are returned. Documentation at :
+ Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
+ Java AJP Connector: /docs/config/ajp.html
+ APR (HTTP/AJP) Connector: /docs/apr.html
+ Define a non-SSL HTTP/1.1 Connector on port 8080
+ -->
+ <Connector SSLEnabled="false" URIEncoding="UTF-8" connectionTimeout="20000" emptySessionPath="true" port="8080" protocol="HTTP/1.1" redirectPort="8443" scheme="http" secure="false"/>
+ <!-- A "Connector" using the shared thread pool-->
+ <!--
+ <Connector executor="tomcatThreadPool"
+ port="8080" protocol="HTTP/1.1"
+ connectionTimeout="20000"
+ redirectPort="8443" />
+ -->
+ <!-- Define a SSL HTTP/1.1 Connector on port 8443
+ This connector uses the JSSE configuration, when using APR, the
+ connector should be using the OpenSSL style configuration
+ described in the APR documentation -->
+
+ <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
+ maxThreads="150" scheme="https" secure="true" URIEncoding="UTF-8"
+ clientAuth="false" sslProtocol="TLS" keyAlias="private" keystoreFile="${javax.net.ssl.trustStore}"
+ keystorePass="${javax.net.ssl.trustStorePassword}"/>
+
+
+ <!-- Define an AJP 1.3 Connector on port 8009 -->
+
+ <Connector port="8009" protocol="AJP/1.3" redirectPort="8443"/>
+
+
+ <!-- An Engine represents the entry point (within Catalina) that processes
+ every request. The Engine implementation for Tomcat stand alone
+ analyzes the HTTP headers included with the request, and passes them
+ on to the appropriate Host (virtual host).
+ Documentation at /docs/config/engine.html -->
+
+ <!-- You should set jvmRoute to support load-balancing via AJP ie :
+ <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
+ -->
+ <Engine defaultHost="localhost" name="Catalina">
+
+ <!--For clustering, please take a look at documentation at:
+ /docs/cluster-howto.html (simple how to)
+ /docs/config/cluster.html (reference documentation) -->
+ <!--
+ <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
+ -->
+
+ <!-- Use the LockOutRealm to prevent attempts to guess user passwords
+ via a brute-force attack -->
+ <Realm className="org.apache.catalina.realm.LockOutRealm">
+ <!-- This Realm uses the UserDatabase configured in the global JNDI
+ resources under the key "UserDatabase". Any edits
+ that are performed against this UserDatabase are immediately
+ available for use by the Realm. -->
+ <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
+ </Realm>
+
+ <Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true">
+
+ <!-- SingleSignOn valve, share authentication between web applications
+ Documentation at: /docs/config/valve.html -->
+ <!--
+ <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
+ -->
+
+ <!-- Access log processes all example.
+ Documentation at: /docs/config/valve.html
+ Note: The pattern used is equivalent to using pattern="common" -->
+ <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" pattern="%h %l %u %t &quot;%r&quot; %s %b" prefix="localhost_access_log." resolveHosts="false" suffix=".txt"/>
+
+
+ </Host>
+ </Engine>
+ </Service>
+</Server>
View
12 itests/src/test/resources/fedora-home/server/config/spring/web/security.xml
@@ -23,10 +23,6 @@
<security:filter-chain pattern="/getDS*"
filters="ChannelFilter" />
- <!-- RISearch service gets auth protection -->
- <security:filter-chain pattern="/risearch*"
- filters="ChannelFilter,AuthFilterJAAS" />
-
<!-- REST API -->
<security:filter-chain pattern="/objects*/**"
filters="ChannelFilter,AuthFilterJAAS" />
@@ -77,8 +73,8 @@
<security:intercept-url pattern="/management/upload"
access="${security.ssl.api.management}" />
- <security:intercept-url pattern="/services/management"
- access="${security.ssl.api.management}" />
+ <!--<security:intercept-url pattern="/services/management"
+ access="${security.ssl.api.management}" />-->
<security:intercept-url pattern="/management/getNextPID"
access="${security.ssl.api.management}" />
<security:intercept-url pattern="/getDSAuthenticated*/**"
@@ -99,8 +95,8 @@
access="${security.ssl.api.access}" />
<security:intercept-url pattern="/search*"
access="${security.ssl.api.access}" />
- <security:intercept-url pattern="/services/access"
- access="${security.ssl.api.access}" />
+ <!--<security:intercept-url pattern="/services/access"
+ access="${security.ssl.api.access}" />-->
<security:intercept-url pattern="/wsdl*"
access="${security.ssl.api.access}" />
<security:intercept-url pattern="**.jsp"
View
5 repository-indexing/pom.xml
@@ -67,6 +67,11 @@
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
+ <artifactId>camel-http4</artifactId>
+ <version>${camel.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
<artifactId>camel-jetty</artifactId>
<version>${camel.version}</version>
</dependency>
View
1  repository-indexing/src/main/features/features.xml
@@ -12,6 +12,7 @@
<feature version="2.9.1">camel-saxon</feature>
<feature version="2.9.1">camel-blueprint</feature>
<feature version="2.9.1">camel-http</feature>
+ <feature version="2.9.1">camel-http4</feature>
<feature version="2.9.1">camel-jms</feature>
<feature version="2.9.1">camel-jetty</feature>
<feature version="2.9.1">camel-freemarker</feature>
View
55 repository-indexing/src/main/java/edu/virginia/lib/camel/http/RedirectHttpClientConfigurer.java
@@ -0,0 +1,55 @@
+package edu.virginia.lib.camel.http;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import org.apache.camel.component.http4.HttpClientConfigurer;
+import org.apache.http.HttpRequest;
+import org.apache.http.HttpResponse;
+import org.apache.http.ProtocolException;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.RedirectStrategy;
+import org.apache.http.client.methods.HttpUriRequest;
+import org.apache.http.client.params.HttpClientParams;
+import org.apache.http.impl.client.AbstractHttpClient;
+import org.apache.http.impl.client.RequestWrapper;
+import org.apache.http.params.HttpParams;
+import org.apache.http.protocol.HttpContext;
+
+public class RedirectHttpClientConfigurer implements HttpClientConfigurer {
+
+ public RedirectHttpClientConfigurer() {
+ }
+
+ @Override
+ public void configureHttpClient(HttpClient client) {
+ HttpParams params = client.getParams();
+ HttpClientParams.setRedirecting(params, true);
+ ((AbstractHttpClient) client).setRedirectStrategy(new MindlessRedirectStrategy());
+ }
+
+ public class MindlessRedirectStrategy implements RedirectStrategy {
+
+ @Override
+ public boolean isRedirected(HttpRequest request, HttpResponse response,
+ HttpContext context) throws ProtocolException {
+ return true;
+ }
+
+ @Override
+ public HttpUriRequest getRedirect(HttpRequest request,
+ HttpResponse response, HttpContext context)
+ throws ProtocolException {
+ URI location = null;
+ try {
+ location = new URI(response.getLastHeader("Location").getValue());
+ } catch (URISyntaxException e) {
+ e.printStackTrace();
+ }
+ RequestWrapper rerequest = new RequestWrapper(request);
+ rerequest.setURI(location);
+ return rerequest;
+ }
+
+ }
+}
View
647 repository-indexing/src/main/resources/OSGI-INF/blueprint/camel-context.xml
@@ -1,342 +1,397 @@
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
- xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
+ xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0 http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0
http://camel.apache.org/schema/blueprint https://camel.apache.org/schema/blueprint/camel-blueprint.xsd">
- <!-- OSGI blueprint property placeholder -->
- <cm:property-placeholder id="blueprint.placeholder" persistent-id="edu.virginia.lib.beverly">
- <cm:default-properties>
- <cm:property name="indexable-cm" value="indexable:cm"/>
- <cm:property name="indexable-sdef" value="indexable:sdef"/>
- <cm:property name="solr-update-url" value="http://localhost:8080/solr/update"/>
- <cm:property name="getIndexingMetadata-port" value="8193"/>
- <cm:property name="indexer-cm" value="indexer:cm"/>
- <cm:property name="solr-datastream" value="SOLR"/>
- <cm:property name="fedora-api-m-queue-name" value="fedora.apim.update"/>
- <cm:property name="fedoraPassword" value="fedoraAdmin"/>
- <cm:property name="fedoraUsername" value="fedoraAdmin"/>
- <cm:property name="solr-http-timeout" value="60000"/>
- <cm:property name="xmlTypes"
- value="text/xml,application/xml,application/xhtml+xml,application/rdf+xml"/>
- </cm:default-properties>
- </cm:property-placeholder>
+ <!-- OSGI blueprint property placeholder -->
+ <cm:property-placeholder id="blueprint.placeholder" persistent-id="edu.virginia.lib.beverly">
+ <cm:default-properties>
+ <cm:property name="indexable-cm" value="indexable:cm"/>
+ <cm:property name="indexer-predicate"
+ value="http://fedora.lib.virginia.edu/relationships#isIndexedBy"/>
+ <cm:property name="indexable-sdef" value="indexable:sdef"/>
+ <cm:property name="solr-update-url" value="http://localhost:8080/solr/update"/>
+ <cm:property name="getIndexingMetadata-port" value="8193"/>
+ <cm:property name="indexer-cm" value="indexer:cm"/>
+ <cm:property name="solr-datastream" value="SOLR"/>
+ <cm:property name="fedora-api-m-queue-name" value="fedora.apim.update"/>
+ <cm:property name="fedoraPassword" value="fedoraAdmin"/>
+ <cm:property name="fedoraUsername" value="fedoraAdmin"/>
+ <cm:property name="solr-http-timeout" value="60000"/>
+ <cm:property name="xmlTypes"
+ value="text/xml,application/xml,application/xhtml+xml,application/rdf+xml"/>
+ </cm:default-properties>
+ </cm:property-placeholder>
- <camelContext id="repository-indexer" xmlns="http://camel.apache.org/schema/blueprint"
- streamCache="true" trace="false" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:atom="http://www.w3.org/2005/Atom"
- xmlns:fedora-model="info:fedora/fedora-system:def/model#"
- xmlns:fedora-management="http://www.fedora.info/definitions/1/0/management/"
- xmlns:fedora-types="http://www.fedora.info/definitions/1/0/types/">
+ <camelContext id="repository-indexer" xmlns="http://camel.apache.org/schema/blueprint"
+ streamCache="true" trace="false" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:atom="http://www.w3.org/2005/Atom"
+ xmlns:fedora-model="info:fedora/fedora-system:def/model#"
+ xmlns:fedora-management="http://www.fedora.info/definitions/1/0/management/"
+ xmlns:fedora-types="http://www.fedora.info/definitions/1/0/types/">
- <propertyPlaceholder id="properties" location="blueprint:blueprint.placeholder"/>
+ <propertyPlaceholder id="properties" location="blueprint:blueprint.placeholder" prefixToken="{{" suffixToken="}}"/>
- <jmxAgent id="agent" disabled="true"/>
+ <jmxAgent id="agent" disabled="true"/>
- <threadPoolProfile id="defaultThreadPoolProfile" defaultProfile="true" poolSize="8"
- maxPoolSize="12" maxQueueSize="10000" rejectedPolicy="CallerRuns"/>
+ <threadPoolProfile id="defaultThreadPoolProfile" defaultProfile="true" poolSize="8"
+ maxPoolSize="12" maxQueueSize="10000" rejectedPolicy="CallerRuns"/>
- <route>
- <description>Entry point for all indexing workflows</description>
- <from uri="seda:service:indexing:index"/>
+ <route>
+ <description>Entry point for all indexing workflows</description>
+ <from uri="seda:service:indexing:index"/>
- <choice>
- <when>
- <description>Is this a purgeObject operation?</description>
- <simple>${header.methodName} == 'purgeObject'</simple>
- <!-- fire a Solr delete operation at the index, in case it was an indexable object -->
- <to uri="freemarker:freemarker/solr/delete.vm"/>
- <setHeader headerName="Content-Type">
- <constant>text/xml</constant>
- </setHeader>
- <setHeader headerName="CamelHttpMethod">
- <constant>POST</constant>
- </setHeader>
- <to uri="{{solr-update-url}}"/>
- <removeHeader headerName="CamelHttpMethod"/>
- <!-- but also assume that it might have been an indexer object -->
- <!-- first gather the affected objects -->
- <to uri="freemarker:freemarker/sparql/getindexedobjects.vm"/>
- <inOut uri="seda:service:repositories:resource-index"/>
- <!-- remove the appropriate no-longer-relevant RELS-INT triples -->
- <split parallelProcessing="true">
- <xpath>/rdf:RDF/rdf:Description</xpath>
- <removeHeader headerName="methodName"/>
- <!-- remove the appropriate no-longer-relevant RELS-INT triple -->
- <setHeader headerName="subject">
- <!-- peel out the indexable subject -->
- <xpath resultType="java.lang.String">/rdf:Description/@rdf:about</xpath>
- </setHeader>
- <to uri="freemarker:freemarker/atom/removetriples.vm"/>
- <removeHeader headerName="subject"/>
- <to uri="seda:service:repositories:api-m"/>
- <!-- don't need to explicitly reindex the object because we just
+ <choice>
+ <when>
+ <description>Is this a purgeObject operation?</description>
+ <simple>${header.methodName} == 'purgeObject'</simple>
+ <!-- fire a Solr delete operation at the index, in case it was an indexable object -->
+ <to uri="freemarker:freemarker/solr/delete.vm"/>
+ <setHeader headerName="Content-Type">
+ <constant>text/xml</constant>
+ </setHeader>
+ <setHeader headerName="CamelHttpMethod">
+ <constant>POST</constant>
+ </setHeader>
+ <to uri="{{solr-update-url}}"/>
+ <removeHeader headerName="CamelHttpMethod"/>
+ <!-- but also assume that it might have been an indexer object -->
+ <!-- first gather the affected objects -->
+ <to uri="freemarker:freemarker/sparql/getindexedobjects.vm"/>
+ <inOut uri="seda:service:repositories:resource-index"/>
+ <!-- remove the appropriate no-longer-relevant RELS-INT triples -->
+ <split parallelProcessing="true">
+ <xpath>/rdf:RDF/rdf:Description</xpath>
+ <removeHeader headerName="methodName"/>
+ <!-- remove the appropriate no-longer-relevant RELS-INT triple -->
+ <setHeader headerName="subject">
+ <!-- peel out the indexable subject -->
+ <xpath resultType="java.lang.String">/rdf:Description/@rdf:about</xpath>
+ </setHeader>
+ <setHeader headerName="indexerPredicate">
+ <xpath resultType="java.lang.String">function:properties('indexer-predicate')</xpath>
+ </setHeader>
+ <to uri="freemarker:freemarker/atom/removetriples.vm"/>
+ <removeHeader headerName="subject"/>
+ <removeHeader headerName="indexerPredicate"/>
+ <to uri="seda:service:repositories:api-m"/>
+ <!-- don't need to explicitly reindex the object because we just
called purgeRelationship on it, which will trigger reindexing-->
- </split>
- </when>
- <otherwise>
- <description>This object was not purged, so we can retrieve info about it from its
+ </split>
+ </when>
+ <otherwise>
+ <description>This object was not purged, so we can retrieve info about it from its
repo</description>
- <!-- is this a content object or an indexer object? -->
+ <!-- is this a content object or an indexer object? -->
- <to uri="freemarker:freemarker/sparql/getcontentmodels.vm"/>
- <inOut uri="seda:service:repositories:resource-index"/>
- <log
- message="Retrieved content model information: in.body = ${in.body} and out.body = ${out.body}"/>
- <log
- message="Checking for indexable content model: ${in.headers.indexablecm} or indexer content model: ${in.headers.indexercm}"/>
- <choice>
- <when>
- <description>Does this object have the indexable CM?</description>
- <xpath>/rdf:RDF/rdf:Description/fedora-model:hasModel/@rdf:resource = concat('info:fedora/',function:properties('indexable-cm'))</xpath>
- <choice>
+ <to uri="freemarker:freemarker/sparql/getcontentmodels.vm"/>
+ <inOut uri="seda:service:repositories:resource-index"/>
+ <log
+ message="Retrieved content model information: in.body = ${in.body} and out.body = ${out.body}"/>
+ <log
+ message="Checking for indexable content model: {{indexable-cm}} or indexer content model: {{indexer-cm}}"/>
+ <choice>
+ <when>
+ <description>Does this object have the indexable CM?</description>
+ <xpath>/rdf:RDF/rdf:Description/fedora-model:hasModel/@rdf:resource = concat('info:fedora/',function:properties('indexable-cm'))</xpath>
+ <choice>
+ <when>
+ <description>Is this a purgeDatastream operation?</description>
+ <simple>${header.methodName} == 'purgeDatastream'</simple>
+ <!-- first remove any dependent RELS-INT triples -->
+ <to
+ uri="freemarker:freemarker/sparql/getindexedpurgeddatastreams.vm"/>
+ <!-- now reindex this object -->
+ <to uri="direct:service:indexing:indexIndexableObject"/>
+ </when>
+ <otherwise>
+ <to uri="direct:service:indexing:indexIndexableObject"/>
+ </otherwise>
+ </choice>
+ </when>
+ <when>
+ <description>Does this object have the indexer CM?</description>
+ <xpath>/rdf:RDF/rdf:Description/fedora-model:hasModel/@rdf:resource = concat('info:fedora/',function:properties('indexer-cm'))</xpath>
+ <log loggingLevel="DEBUG" message="Using indexer cm: {{indexer-cm}}"/>
+ <!-- Ordinary form to index on an indexer object -->
+ <!-- start by getting the indexed (dependent) datastreams -->
+ <setHeader headerName="indexerPredicate">
+ <xpath resultType="java.lang.String">function:properties('indexer-predicate')</xpath>
+ </setHeader>
+ <to uri="freemarker:freemarker/sparql/getindexeddatastreams.vm"/>
+ <removeHeader headerName="indexerPredicate"/>
+ <inOut uri="seda:service:repositories:resource-index"/>
+ <setHeader headerName="count">
+ <xpath resultType="java.lang.String">count(/rdf:RDF/rdf:Description)</xpath>
+ </setHeader>
+ <log message="Preparing to reindex ${headers.count} datastreams..."/>
+ <removeHeader headerName="count"/>
+ <split stopOnException="true" parallelProcessing="true">
+ <xpath>/rdf:RDF/rdf:Description</xpath>
+ <setHeader headerName="pid">
+ <!-- peel out the pid itself -->
+ <xpath resultType="java.lang.String">substring-before(substring-after(/rdf:Description/@rdf:about,'/'),'/')</xpath>
+ </setHeader>
+ <removeHeader headerName="methodName"/>
+ <to uri="seda:service:indexing:index"/>
+ </split>
+ </when>
+ </choice>
+ </otherwise>
+ </choice>
+ </route>
+
+ <route>
+ <description>Index a single object</description>
+ <from uri="direct:service:indexing:indexIndexableObject"/>
+ <setHeader headerName="CamelHttpUri">
+ <simple>${headers.repositoryURL}/objects/${headers.pid}/methods/{{indexable-sdef}}/getIndexingMetadata</simple>
+ </setHeader>
+ <setHeader headerName="CamelHttpMethod">
+ <constant>GET</constant>
+ </setHeader>
+ <to uri="http://fedora/getIndexingMetadata"/>
+ <removeHeader headerName="CamelHttpUri"/>
+ <removeHeader headerName="CamelHttpMethod"/>
+ <setHeader headerName="Content-Type">
+ <constant>text/xml</constant>
+ </setHeader>
+ <setHeader headerName="CamelHttpMethod">
+ <constant>POST</constant>
+ </setHeader>
+ <to
+ uri="{{solr-update-url}}?httpClient.connectionManagerTimeout={{solr-http-timeout}}&amp;httpClient.soTimeout={{solr-http-timeout}}"
+ />
+ </route>
+
+ <route>
+ <description>Construct or retrieve indexing metadata for a single object</description>
+ <from
+ uri="jetty:http://0.0.0.0:{{getIndexingMetadata-port}}/getIndexingMetadata?continuationTimeout=-1"/>
+ <removeHeader headerName="CamelHttpUri"/>
+ <removeHeader headerName="CamelHttpPath"/>
+
+ <to uri="freemarker:freemarker/atom/listdatastreams.vm"/>
+ <inOut uri="seda:service:repositories:api-a"/>
+
+ <choice>
<when>
- <description>Is this a purgeDatastream operation?</description>
- <simple>${header.methodName} == 'purgeDatastream'</simple>
- <!-- first remove any dependent RELS-INT triples -->
- <to uri="freemarker:freemarker/sparql/getindexedpurgeddatastreams.vm"/>
- <!-- now reindex this object -->
- <to uri="direct:service:indexing:indexIndexableObject"/>
+ <xpath>//datastreamDef/ID = function:properties('solr-datastream')</xpath>
+ <log
+ message="Datastream &quot;{{solr-datastream}}&quot; found, bypassing any configured transformations."/>
+ <setHeader headerName="CamelHttpUri">
+ <simple>${headers.repositoryURL}/objects/${headers.pid}/datastreams/${properties:solr-datastream}/content</simple>
+ </setHeader>
+ <setHeader headerName="Content-Type">
+ <constant>text/xml</constant>
+ </setHeader>
+ <setHeader headerName="CamelHttpMethod">
+ <constant>GET</constant>
+ </setHeader>
+ <to uri="http:fedora/objects?httpClient.soTimeout=6000"/>
+ <removeHeader headerName="CamelHttpUri"/>
+ <removeHeader headerName="CamelHttpMethod"/>
</when>
<otherwise>
- <to uri="direct:service:indexing:indexIndexableObject"/>
- </otherwise>
- </choice>
- </when>
- <when>
- <description>Does this object have the indexer CM?</description>
- <xpath>/rdf:RDF/rdf:Description/fedora-model:hasModel/@rdf:resource = concat('info:fedora/',function:properties('indexer-cm'))</xpath>
- <log loggingLevel="DEBUG" message="Using indexer cm: {{indexer-cm}}"/>
- <!-- Ordinary form to index on an indexer object -->
- <!-- start by getting the indexed (dependent) datastreams -->
- <to uri="freemarker:freemarker/sparql/getindexeddatastreams.vm"/>
- <inOut uri="seda:service:repositories:resource-index"/>
- <split stopOnException="true" parallelProcessing="true">
- <xpath>/rdf:RDF/rdf:Description</xpath>
- <setHeader headerName="pid">
- <!-- peel out the pid itself -->
- <xpath resultType="java.lang.String">substring-before(substring-after(/rdf:Description/@rdf:about,'/'),'/')</xpath>
- </setHeader>
- <removeHeader headerName="methodName"/>
- <to uri="seda:service:indexing:index"/>
- </split>
- </when>
- </choice>
- </otherwise>
- </choice>
- </route>
-
- <route>
- <description>Index a single object</description>
- <from uri="direct:service:indexing:indexIndexableObject"/>
- <setHeader headerName="CamelHttpUri">
- <simple>${headers.repositoryURL}/objects/${headers.pid}/methods/{{indexable-sdef}}/getIndexingMetadata</simple>
- </setHeader>
- <setHeader headerName="CamelHttpMethod">
- <constant>GET</constant>
- </setHeader>
- <to uri="http://fedora/getIndexingMetadata"/>
- <removeHeader headerName="CamelHttpUri"/>
- <removeHeader headerName="CamelHttpMethod"/>
- <setHeader headerName="Content-Type">
- <constant>text/xml</constant>
- </setHeader>
- <setHeader headerName="CamelHttpMethod">
- <constant>POST</constant>
- </setHeader>
- <to uri="{{solr-update-url}}?httpClient.connectionManagerTimeout={{solr-http-timeout}}&amp;httpClient.soTimeout={{solr-http-timeout}}"/>
- </route>
+ <description>Create indexing metadata from datastreams</description>
+ <log
+ message="No datastream &quot;{{solr-datastream}}&quot; found, will generate Solr document."/>
+ <setHeader headerName="indexerPredicate">
+ <xpath resultType="java.lang.String">function:properties('indexer-predicate')</xpath>
+ </setHeader>
+ <to uri="freemarker:freemarker/sparql/getindexabledatastreams.vm"/>
+ <removeHeader headerName="indexerPredicate"/>
+ <inOut uri="seda:service:repositories:resource-index"/>
+ <inOut uri="xslt:xslt/concretizeURIs.xsl?transformerFactory=tFactory"/>
+ <inOut uri="xslt:xslt/splitRDFDescriptions.xsl?transformerFactory=tFactory"/>
+ <log
+ message="Post-Split RDF descriptions: in.body = ${in.body} and out.body = ${out.body}"/>
+ <split stopOnException="true" parallelProcessing="false"
+ strategyRef="simpleXMLRecursiveMergeStrategy">
+ <xpath>/rdf:RDF/rdf:Description</xpath>
+ <!-- transform a single metadata stream against its XSLT -->
+ <log
+ message="One of the split RDF descriptions: in.body = ${in.body} and out.body = ${out.body}"/>
- <route>
- <description>Construct or retrieve indexing metadata for a single object</description>
- <from
- uri="jetty:http://0.0.0.0:{{getIndexingMetadata-port}}/getIndexingMetadata?continuationTimeout=-1"/>
- <removeHeader headerName="CamelHttpUri"/>
- <removeHeader headerName="CamelHttpPath"/>
+ <!-- use this header to select the transform dynamically
+ atomtosoap.xsl below is just a dummy -->
+ <setHeader headerName="stylesheetUrl">
+ <xpath resultType="java.lang.String">/rdf:Description/*[local-name() = substring-after(function:properties('indexer-predicate'), '#')]/@rdf:resource</xpath>
+ </setHeader>
+ <log loggingLevel="DEBUG"
+ message="Got stylesheet URL &quot;${headers.stylesheetUrl}&quot;"/>
+ <setHeader headerName="contentUrl">
+ <xpath resultType="java.lang.String">/rdf:Description/@rdf:about</xpath>
+ </setHeader>
+ <setHeader headerName="libDatastream">
+ <xpath resultType="java.lang.String">substring-before(substring-after(/rdf:Description/@rdf:about,concat(in:header('repositoryURL'),'/objects/',in:header('pid'),'/datastreams/')),'/content')</xpath>
+ </setHeader>
+ <!-- replace body with datastream content -->
+ <to uri="freemarker:freemarker/atom/getDatastream.vm"/>
+ <inOut uri="seda:service:repositories:api-m"/>
+ <log message="Retrieved datastream metadata: ${in.body}"/>
- <to uri="freemarker:freemarker/atom/listdatastreams.vm"/>
- <inOut uri="seda:service:repositories:api-a"/>
+ <setHeader headerName="MIMEType">
+ <xpath resultType="java.lang.String">/fedora-types:getDatastreamResponse/datastream/MIMEType</xpath>
+ </setHeader>
+ <log message="Found MIMEType ${in.headers.MIMEType}"/>
+ <setHeader headerName="nonXmlMIMEType">
+ <xpath resultType="java.lang.Boolean">not(contains(function:properties('xmlTypes'),in:header('MIMEType')))</xpath>
+ </setHeader>
+ <!-- fetch the datastream -->
+ <setHeader headerName="CamelHttpUri">
+ <header>contentUrl</header>
+ </setHeader>
+ <setHeader headerName="CamelHttpMethod">
+ <constant>GET</constant>
+ </setHeader>
+ <to uri="http://example.com"/>
+ <removeHeader headerName="CamelHttpUri"/>
+ <removeHeader headerName="CamelHttpMethod"/>
- <choice>
- <when>
- <xpath>//datastreamDef/ID = '{{solr-datastream}}'</xpath>
- <setHeader headerName="libDatastream">
- <constant>{{solr-datastream}}</constant>
- </setHeader>
- <to uri="freemarker:freemarker/atom/getDatastreamDissemination.vm"/>
- <inOut uri="seda:service:repositories:api-a"/>
- </when>
- <otherwise>
- <description>Create indexing metadata from datastreams</description>
+ <when>
+ <description>If datastream is not XML, use Tika</description>
+ <header>nonXmlMIMEType</header>
+ <log message="Sending to Tika"/>
+ <inOut uri="bean:tikaParser?method=parse"/>
+ </when>
- <to uri="freemarker:freemarker/sparql/getindexabledatastreams.vm"/>
- <inOut uri="seda:service:repositories:resource-index"/>
- <inOut uri="xslt:xslt/concretizeURIs.xsl?transformerFactory=tFactory"/>
- <inOut uri="xslt:xslt/splitRDFDescriptions.xsl?transformerFactory=tFactory"/>
- <log
- message="Post-Split RDF descriptions: in.body = ${in.body} and out.body = ${out.body}"/>
+ <setHeader headerName="CamelXsltResourceUri">
+ <simple>${headers.stylesheetUrl}</simple>
+ </setHeader>
+ <log message="About to run a single-datastream transform"/>
+ <inOut uri="xslt:xslt/atomtosoap.xsl?transformerFactory=tFactory"/>
+ <removeHeader headerName="CamelXsltResourceUri"/>
+ </split>
+ <inOut uri="xslt:xslt/mergeAndDeduplicateSolr.xsl?transformerFactory=tFactory"/>
+ </otherwise>
+ </choice>
+ </route>
- <split stopOnException="true" parallelProcessing="false"
- strategyRef="simpleXMLRecursiveMergeStrategy">
- <xpath>/rdf:RDF/rdf:Description</xpath>
- <!-- transform a single metadata stream against its XSLT -->
- <log
- message="One of the split RDF descriptions: in.body = ${in.body} and out.body = ${out.body}"/>
+ <route>
+ <from uri="jms:queue:{{fedora-api-m-queue-name}}"/>
+ <setHeader headerName="repositoryURL">
+ <xpath resultType="java.lang.String">/atom:entry/atom:author/atom:uri</xpath>
+ </setHeader>
+ <to uri="seda:service:indexing:index"/>
+ </route>
- <!-- use this header to select the transform dynamically
- atomtosoap.xsl below is just a dummy -->
- <setHeader headerName="stylesheetUrl">
- <xpath resultType="java.lang.String">/rdf:Description/isIndexedBy/@rdf:resource</xpath>
+ <route>
+ <from uri="seda:service:repositories:api-a"/>
+ <inOut uri="xslt:xslt/atomtosoap.xsl?transformerFactory=tFactory"/>
+ <setHeader headerName="CamelHttpMethod">
+ <constant>POST</constant>
</setHeader>
- <setHeader headerName="contentUrl">
- <xpath resultType="java.lang.String">/rdf:Description/@rdf:about</xpath>
+ <!-- override with repositoryURL -->
+ <setHeader headerName="CamelHttpUri">
+ <simple>${headers.repositoryURL}/services/access</simple>
</setHeader>
- <setHeader headerName="libDatastream">
- <xpath resultType="java.lang.String">substring-before(substring-after(/rdf:Description/@rdf:about,concat(in:header('repositoryURL'),'/objects/',in:header('pid'),'/datastreams/')),'/content')</xpath>
+ <!-- Fedora, for some odd reason, requires a set SOAPAction header without using it -->
+ <setHeader headerName="SOAPAction">
+ <constant>dummy</constant>
</setHeader>
- <!-- replace body with datastream content -->
- <to uri="freemarker:freemarker/atom/getDatastream.vm"/>
- <inOut uri="seda:service:repositories:api-m"/>
- <log message="Retrieved datastream metadata: ${in.body}"/>
+ <log
+ message="Sending SOAP message to repository: in.body = ${in.body} and out.body = ${out.body}"/>
+
+ <!-- default repo API-A url -->
+ <to
+ uri="http4:fedora/services/access?authMethod=Basic&amp;authUsername={{fedoraUsername}}&amp;authPassword={{fedoraPassword}}&amp;httpClient.soTimeout=6000"/>
+ <removeHeader headerName="SOAPAction"/>
+ <removeHeader headerName="CamelHttpUri"/>
+ <to uri="xslt:xslt/strip-soap.xsl?transformerFactory=tFactory"/>
+ </route>
- <setHeader headerName="MIMEType">
- <xpath resultType="java.lang.String">/fedora-types:getDatastreamResponse/datastream/MIMEType</xpath>
+ <route>
+ <from uri="seda:service:repositories:api-m"/>
+ <inOut uri="xslt:xslt/atomtosoap.xsl?transformerFactory=tFactory"/>
+ <setHeader headerName="CamelHttpMethod">
+ <constant>POST</constant>
</setHeader>
- <log message="Found MIMEType ${in.headers.MIMEType}"></log>
- <setHeader headerName="xmlMIMEType">
- <xpath resultType="java.lang.Boolean">not(contains(function:properties('xmlTypes'),in:header('MIMEType')))</xpath>
+ <!-- Fedora, for some odd reason, requires a set SOAPAction header without using it -->
+ <setHeader headerName="SOAPAction">
+ <constant>dummy</constant>
</setHeader>
- <!-- fetch the datastream -->
+ <!-- override with repositoryURL -->
<setHeader headerName="CamelHttpUri">
- <header>contentUrl</header>
+ <simple>${headers.repositoryURL}/services/management?httpClient.authenticationPreemptive=true</simple>
</setHeader>
- <setHeader headerName="CamelHttpMethod">
- <constant>GET</constant>
+ <removeHeader headerName="Host"/>
+ <!-- save a copy of the SOAP message if needed for redirect-->
+ <setHeader headerName="SOAPBody">
+ <simple>${in.body}</simple>
</setHeader>
- <to uri="http://example.com"/>
- <removeHeader headerName="CamelHttpUri"/>
- <removeHeader headerName="CamelHttpMethod"/>
-
+ <!-- dummy repo API-M url -->
+ <to
+ uri="http4:fedora/services/management?authMethod=Basic&amp;authUsername={{fedoraUsername}}&amp;authPassword={{fedoraPassword}}&amp;httpClient.soTimeout=6000&amp;throwExceptionOnFailure=false"/>
<when>
- <description>If datastream is not XML, use Tika</description>
- <header>xmlMIMEType</header>
- <log message="Sending to Tika"/>
- <inOut uri="bean:tikaParser?method=parse"/>
+ <!-- must we redirect? -->
+ <header>Location</header>
+ <setHeader headerName="CamelHttpUri">
+ <simple>${headers.Location}?authMethod=Basic&amp;httpClient.authenticationPreemptive=true&amp;authUsername=${properties:fedoraUsername}&amp;authPassword=${properties:fedoraPassword}&amp;httpClient.soTimeout=6000</simple>
+ </setHeader>
+ <setBody>
+ <header>soapBody</header>
+ </setBody>
+ <to uri="https4://dummy"/>
+ <removeHeader headerName="Location"/>
</when>
-
- <setHeader headerName="CamelXsltResourceUri">
- <simple>${headers.stylesheetUrl}</simple>
- </setHeader>
- <log message="About to run a single-datastream transform"></log>
- <inOut uri="xslt:xslt/atomtosoap.xsl?transformerFactory=tFactory"/>
- <removeHeader headerName="CamelXsltResourceUri"/>
- </split>
- <inOut uri="xslt:xslt/mergeAndDeduplicateSolr.xsl?transformerFactory=tFactory"/>
- </otherwise>
- </choice>
- </route>
-
- <route>
- <from uri="jms:queue:{{fedora-api-m-queue-name}}"/>
- <setHeader headerName="repositoryURL">
- <xpath resultType="java.lang.String">/atom:entry/atom:author/atom:uri</xpath>
- </setHeader>
- <to uri="seda:service:indexing:index"/>
- </route>
-
- <route>
- <from uri="seda:service:repositories:api-a"/>
- <inOut uri="xslt:xslt/atomtosoap.xsl?transformerFactory=tFactory"/>
- <setHeader headerName="CamelHttpMethod">
- <constant>POST</constant>
- </setHeader>
- <!-- override with repositoryURL -->
- <setHeader headerName="CamelHttpUri">
- <simple>${headers.repositoryURL}/services/access</simple>
- </setHeader>
- <!-- Fedora, for some odd reason, requires a set SOAPAction header without using it -->
- <setHeader headerName="SOAPAction">
- <constant>dummy</constant>
- </setHeader>
- <log
- message="Sending SOAP message to repository: in.body = ${in.body} and out.body = ${out.body}"/>
-
- <!-- default repo API-A url -->
- <to
- uri="http:fedora/services/access?authMethod=Basic&amp;authUsername={{fedoraUsername}}&amp;authPassword={{fedoraPassword}}&amp;httpClient.soTimeout=6000"/>
- <removeHeader headerName="SOAPAction"/>
- <removeHeader headerName="CamelHttpUri"/>
- <to uri="xslt:xslt/strip-soap.xsl?transformerFactory=tFactory"/>
- </route>
+ <removeHeader headerName="SOAPBody"/>
+ <removeHeader headerName="SOAPAction"/>
+ <removeHeader headerName="CamelHttpUri"/>
+ <to uri="xslt:xslt/strip-soap.xsl?transformerFactory=tFactory"/>
+ </route>
- <route>
- <from uri="seda:service:repositories:api-m"/>
- <inOut uri="xslt:xslt/atomtosoap.xsl?transformerFactory=tFactory"/>
- <setHeader headerName="CamelHttpMethod">
- <constant>POST</constant>
- </setHeader>
- <!-- Fedora, for some odd reason, requires a set SOAPAction header without using it -->
- <setHeader headerName="SOAPAction">
- <constant>dummy</constant>
- </setHeader>
- <!-- override with repositoryURL -->
- <setHeader headerName="CamelHttpUri">
- <simple>${headers.repositoryURL}/services/management?httpClient.authenticationPreemptive=true&amp;username={{fedoraUsername}}&amp;password={{fedoraPassword}}</simple>
- </setHeader>
- <!-- dummy repo API-M url -->
- <to uri="http:fedora/services/management?httpClient.soTimeout=6000"/>
- <removeHeader headerName="SOAPAction"/>
- <removeHeader headerName="CamelHttpUri"/>
- <to uri="xslt:xslt/strip-soap.xsl?transformerFactory=tFactory"/>
- </route>
+ <!-- streamCache is set to false to prevent an exception associated with stream cache temporary files (at least in camel-core 2.9.1) -->
+ <route streamCache="false">
+ <from uri="seda:service:repositories:resource-index"/>
+ <setHeader headerName="Content-Type">
+ <constant>application/x-www-form-urlencoded</constant>
+ </setHeader>
+ <setHeader headerName="CamelHttpChunked">
+ <constant>false</constant>
+ </setHeader>
+ <setHeader headerName="CamelHttpMethod">
+ <constant>POST</constant>
+ </setHeader>
+ <!-- override endpoint address with repositoryURL -->
+ <setHeader headerName="CamelHttpUri">
+ <simple>${headers.repositoryURL}/risearch</simple>
+ </setHeader>
+ <!-- dummy repo RI search url -->
+ <to uri="http4:fedora/risearch?httpClient.soTimeout=6000"/>
+ <removeHeader headerName="Content-Type"/>
+ <removeHeader headerName="CamelHttpChunked"/>
+ <removeHeader headerName="CamelHttpUri"/>
+ <removeHeader headerName="CamelHttpMethod"/>
+ </route>
- <route>
- <from uri="seda:service:repositories:resource-index"/>
- <setHeader headerName="Content-Type">
- <constant>application/x-www-form-urlencoded</constant>
- </setHeader>
- <setHeader headerName="CamelHttpChunked">
- <constant>false</constant>
- </setHeader>
- <setHeader headerName="CamelHttpMethod">
- <constant>POST</constant>
- </setHeader>
- <!-- override endpoint address with repositoryURL -->
- <setHeader headerName="CamelHttpUri">
- <simple>${headers.repositoryURL}/risearch</simple>
- </setHeader>
- <!-- dummy repo RI search url -->
- <to uri="http:fedora/risearch?httpClient.soTimeout=6000"/>
- <removeHeader headerName="Content-Type"/>
- <removeHeader headerName="CamelHttpChunked"/>
- <removeHeader headerName="CamelHttpUri"/>
- <removeHeader headerName="CamelHttpMethod"/>
- </route>
+ </camelContext>
- </camelContext>
+ <bean id="simpleXMLRecursiveMergeStrategy"
+ class="edu.virginia.lib.camel.aggregation.SimpleXMLRecursiveMergeStrategy">
+ <property name="log" ref="log"/>
+ </bean>
- <bean id="simpleXMLRecursiveMergeStrategy"
- class="edu.virginia.lib.camel.aggregation.SimpleXMLRecursiveMergeStrategy">
- <property name="log" ref="log"/>
- </bean>
+ <bean id="tikaParser" class="edu.virginia.lib.camel.parsing.TikaParser">
+ <property name="log" ref="log"/>
+ </bean>
- <bean id="tikaParser" class="edu.virginia.lib.camel.parsing.TikaParser">
- <property name="log" ref="log"/>
- </bean>
+ <bean id="tFactory" class="net.sf.saxon.TransformerFactoryImpl"/>
- <bean id="tFactory" class="net.sf.saxon.TransformerFactoryImpl"/>
+ <reference id="log" interface="org.osgi.service.log.LogService"/>
- <reference id="log" interface="org.osgi.service.log.LogService"/>
+ <!-- use CF from ActiveMQ blueprint service running in container -->
+ <reference id="connectionFactory" interface="javax.jms.ConnectionFactory"/>
+ <bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
+ <property name="connectionFactory" ref="connectionFactory"/>
+ </bean>
- <!-- use CF from ActiveMQ blueprint service running in container -->
- <reference id="connectionFactory" interface="javax.jms.ConnectionFactory"/>
- <bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
- <property name="connectionFactory" ref="connectionFactory"/>
- </bean>
+ <bean id="redirectHttpClientConfigurer" class="edu.virginia.lib.camel.http.RedirectHttpClientConfigurer"/>
+
-
</blueprint>
View
6 repository-indexing/src/main/resources/OSGI-INF/metatype/config-metadata.xml
@@ -6,6 +6,7 @@
<OCD xmlns="" name="Beverly" id="edu.virginia.lib.beverly" description="Configuration for the Beverly indexing system">
<AD id="solr-update-url" default="http://localhost:8080/solr/update" type="String" description="URL to which to send Solr update and delete messages." name="solr-update-url"/>
<AD id="indexable-cm" default="indexable:cm" type="String" description="The PID of the Fedora content model object that marks an object as being indexable." name="indexable-cm"/>
+ <AD id="indexer-predicate" name="indexer-predicate" default="http://fedora.lib.virginia.edu/relationships#isIndexedBy" description="The predicate (URI) that is used to relate a metadata datastream to the XSLT datastream that transforms it into a solr XML record." type="String" />
<AD id="indexer-cm" default="indexer:cm" type="String" description="The PID of the Fedora content model object that marks an object as being an indexer object." name="indexer-cm"/>
<AD id="indexable-sdef" default="indexable:sdef" type="String" description="The PID of the Fedora service definition object that supports the getIndexMetadata behavior." name="indexable-sdef"/>
<AD id="getIndexingMetadata-port" default="8193" type="Integer" description="The port on which to open the Beverly index metadata construction service." name="getIndexingMetadata-port"/>
@@ -15,9 +16,8 @@
<AD id="fedoraPassword" name="fedoraPassword" default="fedoraAdmin" description="For use with the fedoraUsername setting. If you secure the link between Karaf and Fedora's Webservices by other means, you can avoid using this setting." type="String"/>
<AD id="xmlTypes" name="xmlTypes" default="text/xml,application/xml,application/xhtml+xml,application/rdf+xml" description="MIMEtypes that will not be passed through Tika parsing prior to XSLT execution." type="String"/>
<AD id="solr-http-timeout" name="solr-http-timeout" default="60000" description="Time to wait for Solr index server to respond to messages." type="Integer"/>
-
- </OCD>
+ </OCD>
<Designate xmlns="" pid="edu.virginia.lib.beverly">
<Object ocdref="edu.virginia.lib.beverly"/>
</Designate>
-</MetaData>
+</MetaData>
View
1  ...c/main/resources/freemarker/atom/getdatastream.vm → ...c/main/resources/freemarker/atom/getDatastream.vm
@@ -9,3 +9,4 @@
<category term="${headers.pid}" scheme="fedora-types:pid" label="xsd:string"/>
<category term="${headers.libDatastream}" scheme="fedora-types:dsID" label="xsd:string"/>
</entry>
+
View
2  repository-indexing/src/main/resources/freemarker/atom/removetriples.vm
@@ -7,7 +7,7 @@
</author>
<title type="text">purgeRelationship</title>
<category term="${headers.subject}" scheme="fedora-types:subject" label="xsd:string"/>
- <category term="http://fedora.lib.virginia.edu/relationships#isIndexedBy" scheme="fedora-types:relationship" label="xsd:string"/>
+ <category term="${headers.indexerPredicate"" scheme="fedora-types:relationship" label="xsd:string"/>
<category term="info:fedora/${headers.pid}/XSLT" scheme="fedora-types:object" label="xsd:string"/>
<category term="false" scheme="fedora-types:isLiteral" label="xsd:boolean"/>
View
8 repository-indexing/src/main/resources/freemarker/sparql/getindexabledatastreams.vm
@@ -1,10 +1,8 @@
type=triples&format=RDF/XML&lang=sparql&query=
-PREFIX uva-lib: <http://fedora.lib.virginia.edu/relationships#>
-
-construct { ?datastream <uva-lib:isIndexedBy> ?xslt . }
+construct { ?datastream <${headers.indexerPredicate}> ?xslt . }
WHERE
{
<info:fedora/${headers.pid}> <fedora-view:disseminates> ?datastream .
- ?datastream <uva-lib:isIndexedBy> ?xslt .
-}
+ ?datastream <${headers.indexerPredicate}> ?xslt .
+}
View
8 repository-indexing/src/main/resources/freemarker/sparql/getindexeddatastreams.vm
@@ -1,9 +1,7 @@
type=triples&format=RDF/XML&lang=sparql&query=
-PREFIX uva-lib: <http://fedora.lib.virginia.edu/relationships#>
-
-CONSTRUCT { ?datastream <uva-lib:isDependentOn> <info:fedora/${headers.pid}> . }
+CONSTRUCT { ?datastream <${headers.indexerPredicate}> <info:fedora/${headers.pid}> . }
WHERE
{
- ?datastream <uva-lib:isIndexedBy> <info:fedora/${headers.pid}/XSLT>
-}
+ ?datastream <${headers.indexerPredicate}> <info:fedora/${headers.pid}/XSLT>
+}
View
2  repository-indexing/src/main/resources/xslt/splitRDFDescriptions.xsl
@@ -10,7 +10,7 @@
<xsl:for-each select="rdf:Description">
<xsl:for-each select="*[@rdf:resource]">
<rdf:Description rdf:about="{../@rdf:about}">
- <isIndexedBy rdf:resource="{@rdf:resource}"/>
+ <xsl:copy-of select="." />
</rdf:Description>
</xsl:for-each>
</xsl:for-each>
View
5 repository-indexing/src/site/xdoc/config.xml
@@ -49,6 +49,11 @@
<td>The PID of the Fedora content model object that marks an object as being an indexer object.</td>
</tr>
<tr>
+ <td>indexer-predicate</td>
+ <td>http://fedora.lib.virginia.edu/relationships#isIndexedBy</td>
+ <td>The predicate (URI) that is used to relate a metadata datastream to the XSLT datastream that transforms it into a solr XML record.</td>
+ </tr>
+ <tr>
<td>indexable-sdef</td>
<td>indexable:sdef</td>
<td>The PID of the Fedora service definition object that supports the getIndexMetadata behavior.</td>

No commit comments for this range

Something went wrong with that request. Please try again.