OSDN Git Service

add jsp-api
authorcintake <gozilla3st@users.osdn.me>
Tue, 3 May 2016 11:40:03 +0000 (20:40 +0900)
committercintake <gozilla3st@users.osdn.me>
Tue, 3 May 2016 11:40:03 +0000 (20:40 +0900)
src/main/java/net/korabo/app/orientdb/AppServletContextListener.java
src/main/resources/net/korabo/app/orientdb/smplconfig.xml [new file with mode: 0644]

index 79d66f8..2bb83d4 100644 (file)
@@ -12,8 +12,10 @@ import java.util.Properties;
 import javax.servlet.ServletContextEvent;
 import javax.servlet.ServletContextListener;
 import javax.servlet.annotation.WebListener;
+import net.korabo.lib.StreamUtil;
 import net.korabo.lib.UriUtil;
 import net.korabo.lib.file.FileUriUtil;
+import net.korabo.lib.file.ResourceFilesUtil;
 import net.korabo.lib.file.SysFilesUtil;
 import net.korabo.lib.settings.KSettingsUtil;
 
@@ -43,6 +45,13 @@ public class AppServletContextListener implements ServletContextListener{
         props.setProperty("orientdb.www.path", orientDBwww);
                
                try {
+            File cfgFile = FileUriUtil.getFileFor(orientDBcfg);
+                SysFilesUtil.chkAndMake(cfgFile);
+            if (cfgFile.length() == 0){
+              // initialize
+              
+              
+            }
                        OServer server = OServerMain.create();
                        server.startup(FileUriUtil.getFileFor(orientDBcfg));
                        server.activate();
diff --git a/src/main/resources/net/korabo/app/orientdb/smplconfig.xml b/src/main/resources/net/korabo/app/orientdb/smplconfig.xml
new file mode 100644 (file)
index 0000000..1cfe3f2
--- /dev/null
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<orient-server>
+    <network>
+        <protocols>
+            <protocol name="binary" implementation="com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary"/>
+            <protocol name="http" implementation="com.orientechnologies.orient.server.network.protocol.http.ONetworkProtocolHttpDb"/>
+        </protocols>
+        <listeners>
+
+            <listener ip-address="0.0.0.0" port-range="2424-2430" protocol="binary"/>
+            <listener ip-address="0.0.0.0" port-range="2480-2490" protocol="http">
+                <commands>
+                    <command implementation="com.orientechnologies.orient.server.network.protocol.http.command.get.OServerCommandGetStaticContent" pattern="GET|www GET|studio/ GET| GET|*.htm GET|*.html GET|*.xml GET|*.jpeg GET|*.jpg GET|*.png GET|*.gif GET|*.js GET|*.css GET|*.swf GET|*.ico GET|*.txt GET|*.otf GET|*.pjs GET|*.svg GET|*.json GET|*.woff GET|*.ttf GET|*.svgz" stateful="false">
+                        <parameters>
+                            <entry value="Cache-Control: no-cache, no-store, max-age=0, must-revalidate\r\nPragma: no-cache" name="http.cache:*.htm *.html"/>
+                            <entry value="Cache-Control: max-age=120" name="http.cache:default"/>
+                        </parameters>
+                    </command>
+                </commands>
+                <parameters>
+                    <parameter name="network.http.charset" value="utf-8"/>
+                </parameters>
+            </listener>
+        </listeners>
+    </network>
+    <users>
+        <user name="root" password="korabo" resources="*" />
+    </users>
+    <!-- storages>
+        <storage path="plocal:/opt/home/OrientDB/orientdb-community-2.1.12/databases/ConcordDebate" name="ConcordDebate"
+                 loaded-at-startup="true" />
+    </storages -->
+    <!-- properties>
+        <entry name="orientdb.www.path" value="/opt/home/OrientDB/orientdb-community-2.1.12/www/"/>
+        <entry name="orientdb.config.file" value="/Users/cintake/.krb/VAADIN01/data/OrientDB/config/orientdb-server-config.xml"/>
+        <entry name="server.cache.staticResources" value="false" />
+        <entry name="log.console.level" value="finest" />
+        <entry name="log.file.level" value="fine" />
+    </properties -->
+</orient-server>
\ No newline at end of file