results = dctx.search(base, filter, sc);
- while (results.hasMore()) {
- SearchResult sr = (SearchResult) results.next();
- javax.naming.directory.Attributes attrs = sr.getAttributes();
-
- Attribute attr = attrs.get("cn");
- retString = (String) attr.get();
- }
- } catch (NamingException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
- try {
- dctx.close();
- } catch (NamingException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return retString;
- }
-
- /**
- * returns resource from path (in webapp) as InputStream.
- *
- * @param sc
- * @param path
- * @return
- */
- protected InputStream getResourceAsStream(ServletContext sc, String path) {
- InputStream ps = sc.getResourceAsStream(path);
- if (ps == null) {
- // try as file
- File pf = new File(sc.getRealPath(path));
- if (pf != null) {
- logger.debug("trying file for: " + pf);
- try {
- ps = new FileInputStream(pf);
- } catch (FileNotFoundException e) {
- logger.error(e);
- }
- }
- }
- return ps;
- }
-
- /**
- * get a real file name for a web app file pathname.
- *
- * If filename starts with "/" its treated as absolute else the path is
- * appended to the base directory of the web-app.
- *
- * @param filename
- * @param sc
- * @return
- */
- public static String getResourcePath(ServletContext sc, String filename) {
- File f = new File(filename);
- // is the filename absolute?
- if (!f.isAbsolute()) {
- // relative path -> use getRealPath to resolve in webapp
- filename = sc.getRealPath(filename);
- }
- return filename;
- }
-
- /* (non-Javadoc)
- * @see org.restlet.Application#stop()
- */
- @Override
- public synchronized void stop() throws Exception {
- /*
- * trying to clean up databases, nur sure if this is the right way...
- */
- if (srv != null) {
- logger.debug("Stopping DB admin server...");
- srv.stop();
- srv = null;
- }
- if (graphDb != null) {
- logger.debug("Stopping DB...");
- graphDb.shutdown();
- graphDb = null;
- }
- super.stop();
- }
-
- private static void registerShutdownHook(final GraphDatabaseService graphDb) {
- // Registers a shutdown hook for the Neo4j instance so that it
- // shuts down nicely when the VM exits (even if you "Ctrl-C" the
- // running example before it's completed)
- Runtime.getRuntime().addShutdownHook(new Thread() {
- @Override
- public void run() {
- graphDb.shutdown();
- }
- });
- }
-
-
-}
diff -r e9dfac5b0566 -r aafa3884b2c4 src/main/resources/de/mpiwg/itgroup/annotations/annotationstore-info.html
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/resources/de/mpiwg/itgroup/annotations/annotationstore-info.html Wed Sep 05 18:05:54 2012 +0200
@@ -0,0 +1,6 @@
+
+
+Annotation manager
+Annotation store overview
+
+
\ No newline at end of file
diff -r e9dfac5b0566 -r aafa3884b2c4 src/main/webapp/WEB-INF/web.xml
--- a/src/main/webapp/WEB-INF/web.xml Wed Sep 05 11:30:22 2012 +0200
+++ b/src/main/webapp/WEB-INF/web.xml Wed Sep 05 18:05:54 2012 +0200
@@ -4,21 +4,42 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
- AnnotationManager-Restlet
-
-
- org.restlet.application
- de.mpiwg.itgroup.annotations.restlet.RestServer
-
-
-
- RestletServlet
- org.restlet.ext.servlet.ServerServlet
-
-
-
- RestletServlet
-
- /*
-
+ AnnotationManager-Restlet
+
+
+ AnnotatorRestlet
+ org.restlet.ext.servlet.ServerServlet
+
+
+ org.restlet.application
+ de.mpiwg.itgroup.annotations.restlet.AnnotatorRestlet
+
+
+ 1
+
+
+
+ AnnotationStoreRestlet
+ org.restlet.ext.servlet.ServerServlet
+
+
+ org.restlet.application
+ de.mpiwg.itgroup.annotations.restlet.AnnotationStoreRestlet
+
+
+
+ 10
+
+
+
+
+ AnnotatorRestlet
+ /annotator/*
+
+
+
+ AnnotationStoreRestlet
+ /annotations/*
+
+
\ No newline at end of file