diff --git a/vp/pom.xml b/vp/pom.xml new file mode 100644 index 0000000..dcb9e03 --- /dev/null +++ b/vp/pom.xml @@ -0,0 +1,159 @@ + + + 4.0.0 + com.easymorse + vp + pom + 1.0-SNAPSHOT + vp + http://www.easymorse.com + + + mars + Marshal Wu + marshal.wu@gmail.com + +8 + + + + + junit + junit + 4.4 + test + + + org.apache.activemq + activemq-core + 5.3.0 + + + org.codehaus.groovy + groovy + 1.6.5 + + + ${jdbc.grougId} + ${jdbc.artifactId} + ${jdbc.version} + + + javax.servlet + servlet-api + 2.4 + provided + + + javax.servlet + jsp-api + 2.0 + provided + + + javax.servlet + jstl + 1.1.0 + + + taglibs + standard + 1.1.0 + + + + + + maven-resources-plugin + 2.4.1 + + true + + + + copy-resources + validate + + copy-resources + + + true + ${basedir}/target/${project.artifactId}-${project.version}/WEB-INF/ + + + src/main/webapp/WEB-INF/ + + * + + + + + + + + + maven-javadoc-plugin + + + http://gceclub.sun.com.cn/Java_Docs/jdk6/html/zh_CN/api + + true + + + + maven-site-plugin + + zh_CN + UTF-8 + + + + org.mortbay.jetty + maven-jetty-plugin + 6.1.6 + + + + + + + maven-compiler-plugin + + 1.6 + 1.6 + UTF-8 + + + + + + + + org.codehaus.mojo + surefire-report-maven-plugin + + + maven-javadoc-plugin + + + http://gceclub.sun.com.cn/Java_Docs/jdk6/html/zh_CN/api + + true + UTF-8 + UTF-8 + UTF-8 + + + + + + mysql + mysql-connector-java + 5.0.5 + com.mysql.jdbc.Driver + + + vp-backend + vp-manager + vp-client + + \ No newline at end of file diff --git a/vp/vp-backend/bin/VideoConvertor.groovy b/vp/vp-backend/bin/VideoConvertor.groovy new file mode 100755 index 0000000..96b2767 --- /dev/null +++ b/vp/vp-backend/bin/VideoConvertor.groovy @@ -0,0 +1,34 @@ +#!/usr/bin/env groovy + +import groovy.lang.Grab; +import org.apache.log4j.* + +@Grab(group="log4j",module="log4j",version="1.2.12") +class Convertor{ + + private static Logger logger=Logger.getLogger(Convertor.class) + + static{ + PropertyConfigurator.configure("log4j.properties"); + } + + def convert(input,output){ + def time=new Date().time + def file=new File(output) + + if(file.exists()){ + file.delete() + logger.debug("delete file ${output}.") + } + + def process="ffmpeg -i ${input} ${output}".execute() + process.waitFor() + + logger.debug("生成${output}成功,耗时${new Date().time-time}毫秒。") + } +} + + +def input='test.mov' +def output='output.mp4' +new Convertor().convert(input,output) \ No newline at end of file diff --git a/vp/vp-backend/bin/VideoDirectoryMonitor.groovy b/vp/vp-backend/bin/VideoDirectoryMonitor.groovy new file mode 100644 index 0000000..2249c5f --- /dev/null +++ b/vp/vp-backend/bin/VideoDirectoryMonitor.groovy @@ -0,0 +1 @@ +#!/usr/bin/env groovy \ No newline at end of file diff --git a/vp/vp-backend/bin/log4j.properties b/vp/vp-backend/bin/log4j.properties new file mode 100644 index 0000000..e3da9ab --- /dev/null +++ b/vp/vp-backend/bin/log4j.properties @@ -0,0 +1,33 @@ +# +# Log4J Settings for log4j 1.2.x (via jakarta-commons-logging) +# +# The five logging levels used by Log are (in order): +# +# 1. DEBUG (the least serious) +# 2. INFO +# 3. WARN +# 4. ERROR +# 5. FATAL (the most serious) + + +# Set root logger level to WARN and append to stdout +log4j.rootLogger=ERROR, stdout + +log4j.appender.${log4j.file.appender}=org.apache.log4j.DailyRollingFileAppender +log4j.appender.${log4j.file.appender}.layout=org.apache.log4j.PatternLayout +log4j.appender.${log4j.file.appender}.layout.ConversionPattern=%d{yy-M-d HH:mm:ss} %5p (%c:%L) - %m%n +log4j.appender.${log4j.file.appender}.file=${log4j.file.path2} +log4j.appender.${log4j.file.appender}.DatePattern='.'yyyy-MM-dd + +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout + +# Pattern to output the caller's file name and line number. +log4j.appender.stdout.layout.ConversionPattern=%d{yy-M-d HH:mm:ss} %5p (%c:%L) - %m%n + +# Print only messages of level ERROR or above in the package noModule. +log4j.logger.noModule=FATAL + +# My business +log4j.logger.com.easymorse=DEBUG +log4j.logger.Convertor=DEBUG diff --git a/vp/vp-backend/bin/test.mov b/vp/vp-backend/bin/test.mov new file mode 100644 index 0000000..5b7061c Binary files /dev/null and b/vp/vp-backend/bin/test.mov differ diff --git a/vp/vp-backend/pom.xml b/vp/vp-backend/pom.xml new file mode 100644 index 0000000..f7a1243 --- /dev/null +++ b/vp/vp-backend/pom.xml @@ -0,0 +1,20 @@ + + + 4.0.0 + + vp + com.easymorse + 1.0-SNAPSHOT + + jar + com.easymorse + vp-backend + 1.0-SNAPSHOT + vp-backend + + + + bin + + diff --git a/vp/vp-client/pom.xml b/vp/vp-client/pom.xml new file mode 100644 index 0000000..dfa7431 --- /dev/null +++ b/vp/vp-client/pom.xml @@ -0,0 +1,48 @@ + + + 4.0.0 + + vp + com.easymorse + 1.0-SNAPSHOT + + war + com.easymorse + vp-client + 1.0-SNAPSHOT + vp-client + + + + + + org.codehaus.mojo + tomcat-maven-plugin + 1.0-beta-1 + + tomcat.server + http://localhost:8080/manager + + + + org.apache.maven.plugins + maven-eclipse-plugin + + true + true + 2.0 + + + + org.mortbay.jetty + maven-jetty-plugin + 6.1.6 + + + + + + + + diff --git a/vp/vp-client/src/main/java/com/easymorse/App.java b/vp/vp-client/src/main/java/com/easymorse/App.java new file mode 100644 index 0000000..4ae2dad --- /dev/null +++ b/vp/vp-client/src/main/java/com/easymorse/App.java @@ -0,0 +1,13 @@ +package com.easymorse; + +/** + * Hello world! + * + */ +public class App +{ + public static void main( String[] args ) + { + System.out.println( "Hello World!" ); + } +} diff --git a/vp/vp-client/src/main/webapp/META-INF/MANIFEST.MF b/vp/vp-client/src/main/webapp/META-INF/MANIFEST.MF new file mode 100644 index 0000000..34e819b --- /dev/null +++ b/vp/vp-client/src/main/webapp/META-INF/MANIFEST.MF @@ -0,0 +1,12 @@ +Manifest-Version: 1.0 +Class-Path: activeio-core-3.1.2.jar activemq-core-5.3.0.jar activemq-p + rotobuf-1.0.jar ant-1.7.1.jar ant-launcher-1.7.1.jar antlr-2.7.7.jar + aopalliance-1.0.jar asm-2.2.3.jar asm-analysis-2.2.3.jar asm-tree-2.2 + .3.jar asm-util-2.2.3.jar avalon-framework-4.1.3.jar commons-logging- + 1.1.jar commons-logging-api-1.1.jar commons-net-2.0.jar geronimo-j2ee + -management_1.0_spec-1.0.jar geronimo-j2ee-management_1.1_spec-1.0.1. + jar geronimo-jms_1.1_spec-1.1.1.jar groovy-1.6.5.jar jline-0.9.94.jar + jstl-1.1.0.jar kahadb-5.3.0.jar log4j-1.2.12.jar logkit-1.0.1.jar my + sql-connector-java-5.0.5.jar spring-beans-2.5.6.jar spring-context-2. + 5.6.jar spring-core-2.5.6.jar standard-1.1.0.jar + diff --git a/vp/vp-client/src/test/java/com/easymorse/AppTest.java b/vp/vp-client/src/test/java/com/easymorse/AppTest.java new file mode 100644 index 0000000..1df92d5 --- /dev/null +++ b/vp/vp-client/src/test/java/com/easymorse/AppTest.java @@ -0,0 +1,38 @@ +package com.easymorse; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} diff --git a/vp/vp-manager/pom.xml b/vp/vp-manager/pom.xml new file mode 100644 index 0000000..ee0af0e --- /dev/null +++ b/vp/vp-manager/pom.xml @@ -0,0 +1,48 @@ + + + 4.0.0 + + vp + com.easymorse + 1.0-SNAPSHOT + + war + com.easymorse + vp-manager + 1.0-SNAPSHOT + vp-manager + + + + + + org.codehaus.mojo + tomcat-maven-plugin + 1.0-beta-1 + + tomcat.server + http://localhost:8080/manager + + + + org.apache.maven.plugins + maven-eclipse-plugin + + true + true + 2.0 + + + + org.mortbay.jetty + maven-jetty-plugin + 6.1.6 + + + + + + + + diff --git a/vp/vp-manager/src/main/java/com/easymorse/App.java b/vp/vp-manager/src/main/java/com/easymorse/App.java new file mode 100644 index 0000000..4ae2dad --- /dev/null +++ b/vp/vp-manager/src/main/java/com/easymorse/App.java @@ -0,0 +1,13 @@ +package com.easymorse; + +/** + * Hello world! + * + */ +public class App +{ + public static void main( String[] args ) + { + System.out.println( "Hello World!" ); + } +} diff --git a/vp/vp-manager/src/main/webapp/META-INF/MANIFEST.MF b/vp/vp-manager/src/main/webapp/META-INF/MANIFEST.MF new file mode 100644 index 0000000..34e819b --- /dev/null +++ b/vp/vp-manager/src/main/webapp/META-INF/MANIFEST.MF @@ -0,0 +1,12 @@ +Manifest-Version: 1.0 +Class-Path: activeio-core-3.1.2.jar activemq-core-5.3.0.jar activemq-p + rotobuf-1.0.jar ant-1.7.1.jar ant-launcher-1.7.1.jar antlr-2.7.7.jar + aopalliance-1.0.jar asm-2.2.3.jar asm-analysis-2.2.3.jar asm-tree-2.2 + .3.jar asm-util-2.2.3.jar avalon-framework-4.1.3.jar commons-logging- + 1.1.jar commons-logging-api-1.1.jar commons-net-2.0.jar geronimo-j2ee + -management_1.0_spec-1.0.jar geronimo-j2ee-management_1.1_spec-1.0.1. + jar geronimo-jms_1.1_spec-1.1.1.jar groovy-1.6.5.jar jline-0.9.94.jar + jstl-1.1.0.jar kahadb-5.3.0.jar log4j-1.2.12.jar logkit-1.0.1.jar my + sql-connector-java-5.0.5.jar spring-beans-2.5.6.jar spring-context-2. + 5.6.jar spring-core-2.5.6.jar standard-1.1.0.jar + diff --git a/vp/vp-manager/src/test/java/com/easymorse/AppTest.java b/vp/vp-manager/src/test/java/com/easymorse/AppTest.java new file mode 100644 index 0000000..1df92d5 --- /dev/null +++ b/vp/vp-manager/src/test/java/com/easymorse/AppTest.java @@ -0,0 +1,38 @@ +package com.easymorse; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +}