Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
acdc
repository-extension-services
Commits
8dcf5c8c
Commit
8dcf5c8c
authored
Sep 17, 2015
by
acoburn
Browse files
make GET and DELETE methods work properly
parent
7424a5fc
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
16 deletions
+11
-16
acrepo-idiomatic/pom.xml
acrepo-idiomatic/pom.xml
+0
-5
acrepo-idiomatic/src/main/java/edu/amherst/acdc/idiomatic/EventRouter.java
...src/main/java/edu/amherst/acdc/idiomatic/EventRouter.java
+11
-4
acrepo-karaf/src/main/resources/features.xml
acrepo-karaf/src/main/resources/features.xml
+0
-2
pom.xml
pom.xml
+0
-5
No files found.
acrepo-idiomatic/pom.xml
View file @
8dcf5c8c
...
...
@@ -42,11 +42,6 @@
<groupId>
org.apache.camel
</groupId>
<artifactId>
camel-core
</artifactId>
</dependency>
<!--<dependency>-->
<!--<groupId>org.springframework</groupId>-->
<!--<artifactId>spring-jdbc</artifactId>-->
<!--<version>${spring.version}</version>-->
<!--</dependency>-->
<dependency>
<groupId>
org.apache.camel
</groupId>
<artifactId>
camel-sql
</artifactId>
...
...
acrepo-idiomatic/src/main/java/edu/amherst/acdc/idiomatic/EventRouter.java
View file @
8dcf5c8c
...
...
@@ -13,6 +13,9 @@
*/
package
edu.amherst.acdc.idiomatic
;
import
static
org
.
apache
.
camel
.
builder
.
PredicateBuilder
.
not
;
import
org.apache.camel.Exchange
;
import
org.apache.camel.LoggingLevel
;
import
org.apache.camel.PropertyInject
;
import
org.apache.camel.RuntimeCamelException
;
...
...
@@ -89,18 +92,22 @@ public class EventRouter extends RouteBuilder {
from
(
"direct:update"
)
.
routeId
(
"IdMappingUpdateRouter"
)
.
to
(
"sql:UPDATE uris SET fedora=:#fedora WHERE public=:#public"
)
.
setHeader
(
Exchange
.
HTTP_RESPONSE_CODE
).
constant
(
204
)
.
filter
(
simple
(
"${body} == 0"
))
.
to
(
"sql:INSERT INTO uris (fedora, public) VALUES (:#fedora, :#public)"
);
from
(
"direct:get"
)
.
routeId
(
"IdMappingFetchRouter"
)
.
log
(
"${headers}"
)
.
to
(
"sql:SELECT fedora FROM uris WHERE public=:#public"
);
.
to
(
"sql:SELECT fedora FROM uris WHERE public=:#id?outputType=SelectOne"
)
.
removeHeader
(
"id"
)
.
filter
(
not
(
header
(
"CamelSqlRowCount"
).
isEqualTo
(
1
)))
.
setHeader
(
Exchange
.
HTTP_RESPONSE_CODE
).
constant
(
404
);
from
(
"direct:delete"
)
.
routeId
(
"IdMappingDeleteRouter"
)
.
log
(
"${headers}"
)
.
to
(
"sql:DELETE FROM uris WHERE public=:#public"
);
.
to
(
"sql:DELETE FROM uris WHERE public=:#id"
)
.
removeHeader
(
"id"
)
.
setHeader
(
Exchange
.
HTTP_RESPONSE_CODE
).
constant
(
204
);
}
}
acrepo-karaf/src/main/resources/features.xml
View file @
8dcf5c8c
...
...
@@ -13,8 +13,6 @@
<feature
version=
"${camel.version}"
>
camel
</feature>
<feature
version=
"${camel.version}"
>
camel-blueprint
</feature>
<feature
version=
"${camel.version}"
>
camel-jetty
</feature>
<feature
version=
"${camel.version}"
>
camel-jdbc
</feature>
<feature
version=
"${camel.version}"
>
camel-restlet
</feature>
<feature
version=
"${camel.version}"
>
camel-jackson
</feature>
<feature
version=
"${camel.version}"
>
camel-sql
</feature>
...
...
pom.xml
View file @
8dcf5c8c
...
...
@@ -60,11 +60,6 @@
<artifactId>
camel-restlet
</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>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment