From 2d6fece6bbeecfb2716b47b557cc67cb871371d6 Mon Sep 17 00:00:00 2001 From: tveronezi Date: Wed, 30 Oct 2013 14:19:59 -0400 Subject: [PATCH] merging projects --- .gitignore | 4 +- Makefile | 64 +---- README.md | 22 +- photodb-gui/pom.xml | 148 ----------- photodb-gui/src/test/javascript/test/I18N.js | 29 --- photodb-gui/src/test/resources/start.js | 45 ---- photodb-gui/src/test/resources/test_config.js | 20 -- photodb-resources/pom.xml | 66 ----- photodb-web/pom.xml | 113 --------- pom.xml | 236 ++++++++++++++---- .../src => src}/main/config/checkstyle.xml | 0 src/main/config/localLoginScript.js | 27 -- src/main/config/login.config | 5 - .../main/java/photodb/cdi/DtoBuilder.java | 0 .../main/java/photodb/cdi/ImageManager.java | 0 .../main/java/photodb/data/dto/PhotoDto.java | 0 .../main/java/photodb/data/dto/UserInfo.java | 0 .../java/photodb/data/entity/BaseEntity.java | 0 .../main/java/photodb/data/entity/Photo.java | 0 .../main/java/photodb/data/entity/User.java | 0 .../photodb/service/ApplicationConfig.java | 0 .../photodb/service/ApplicationException.java | 0 .../photodb/service/ApplicationStart.java | 0 .../java/photodb/service/bean/BaseEAO.java | 0 .../java/photodb/service/bean/PhotoImpl.java | 0 .../java/photodb/service/bean/UserImpl.java | 0 .../java/photodb/service/rest/KeepAlive.java | 0 .../java/photodb/service/rest/Photos.java | 3 +- .../main/java/photodb/service/rest/User.java | 6 +- .../java/photodb/web/SessionListener.java | 0 .../main/resources/META-INF/beans.xml | 0 .../main/resources/META-INF/ejb-jar.xml | 0 .../main/resources/META-INF/persistence.xml | 0 .../main/tomee/conf/tomcat-users.xml | 16 +- src/main/tomee/conf/tomee.xml | 27 ++ .../main/webapp/META-INF/context.xml | 4 - .../src => src}/main/webapp/WEB-INF/web.xml | 0 .../src => src}/main/webapp/app/app.less | 0 .../src => src}/main/webapp/app/config.js | 0 .../main/webapp/app/js/application.js | 0 .../src => src}/main/webapp/app/js/i18n.js | 0 .../main/webapp/app/js/keep-alive.js | 0 .../src => src}/main/webapp/app/js/log.js | 0 .../main/webapp/app/js/model/file.js | 0 .../main/webapp/app/js/model/files.js | 0 .../src => src}/main/webapp/app/js/start.js | 0 .../main/webapp/app/js/templates.js | 0 .../webapp/app/js/templates/about.handlebars | 0 .../app/js/templates/container.handlebars | 0 .../app/js/templates/file-details.handlebars | 0 .../webapp/app/js/templates/file.handlebars | 0 .../webapp/app/js/templates/files.handlebars | 0 .../js/templates/growl-container.handlebars | 0 .../webapp/app/js/templates/growl.handlebars | 0 .../webapp/app/js/templates/login.handlebars | 0 .../webapp/app/js/templates/signin.handlebars | 0 .../app/js/templates/signout.handlebars | 0 .../main/webapp/app/js/view/about.js | 0 .../main/webapp/app/js/view/container.js | 0 .../main/webapp/app/js/view/files.js | 0 .../main/webapp/app/js/view/growl.js | 0 .../main/webapp/app/js/view/login.js | 0 .../src => src}/main/webapp/index.jsp | 0 .../test/java/photodb/TestImageHandling.java | 0 .../src => src}/test/resources/arquillian.xml | 0 .../test/resources/photos/legend.base64 | 0 .../test/resources/photos/tomee.base64 | 0 67 files changed, 229 insertions(+), 606 deletions(-) delete mode 100644 photodb-gui/pom.xml delete mode 100644 photodb-gui/src/test/javascript/test/I18N.js delete mode 100644 photodb-gui/src/test/resources/start.js delete mode 100644 photodb-gui/src/test/resources/test_config.js delete mode 100644 photodb-resources/pom.xml delete mode 100644 photodb-web/pom.xml rename {photodb-web/src => src}/main/config/checkstyle.xml (100%) delete mode 100644 src/main/config/localLoginScript.js delete mode 100644 src/main/config/login.config rename {photodb-web/src => src}/main/java/photodb/cdi/DtoBuilder.java (100%) rename {photodb-web/src => src}/main/java/photodb/cdi/ImageManager.java (100%) rename {photodb-web/src => src}/main/java/photodb/data/dto/PhotoDto.java (100%) rename {photodb-web/src => src}/main/java/photodb/data/dto/UserInfo.java (100%) rename {photodb-web/src => src}/main/java/photodb/data/entity/BaseEntity.java (100%) rename {photodb-web/src => src}/main/java/photodb/data/entity/Photo.java (100%) rename {photodb-web/src => src}/main/java/photodb/data/entity/User.java (100%) rename {photodb-web/src => src}/main/java/photodb/service/ApplicationConfig.java (100%) rename {photodb-web/src => src}/main/java/photodb/service/ApplicationException.java (100%) rename {photodb-web/src => src}/main/java/photodb/service/ApplicationStart.java (100%) rename {photodb-web/src => src}/main/java/photodb/service/bean/BaseEAO.java (100%) rename {photodb-web/src => src}/main/java/photodb/service/bean/PhotoImpl.java (100%) rename {photodb-web/src => src}/main/java/photodb/service/bean/UserImpl.java (100%) rename {photodb-web/src => src}/main/java/photodb/service/rest/KeepAlive.java (100%) rename {photodb-web/src => src}/main/java/photodb/service/rest/Photos.java (97%) rename {photodb-web/src => src}/main/java/photodb/service/rest/User.java (94%) rename {photodb-web/src => src}/main/java/photodb/web/SessionListener.java (100%) rename {photodb-web/src => src}/main/resources/META-INF/beans.xml (100%) rename {photodb-web/src => src}/main/resources/META-INF/ejb-jar.xml (100%) rename {photodb-web/src => src}/main/resources/META-INF/persistence.xml (100%) rename photodb-gui/src/test/resources/runner.html => src/main/tomee/conf/tomcat-users.xml (76%) create mode 100644 src/main/tomee/conf/tomee.xml rename {photodb-gui/src => src}/main/webapp/META-INF/context.xml (78%) rename {photodb-gui/src => src}/main/webapp/WEB-INF/web.xml (100%) rename {photodb-gui/src => src}/main/webapp/app/app.less (100%) rename {photodb-gui/src => src}/main/webapp/app/config.js (100%) rename {photodb-gui/src => src}/main/webapp/app/js/application.js (100%) rename {photodb-gui/src => src}/main/webapp/app/js/i18n.js (100%) rename {photodb-gui/src => src}/main/webapp/app/js/keep-alive.js (100%) rename {photodb-gui/src => src}/main/webapp/app/js/log.js (100%) rename {photodb-gui/src => src}/main/webapp/app/js/model/file.js (100%) rename {photodb-gui/src => src}/main/webapp/app/js/model/files.js (100%) rename {photodb-gui/src => src}/main/webapp/app/js/start.js (100%) rename {photodb-gui/src => src}/main/webapp/app/js/templates.js (100%) rename {photodb-gui/src => src}/main/webapp/app/js/templates/about.handlebars (100%) rename {photodb-gui/src => src}/main/webapp/app/js/templates/container.handlebars (100%) rename {photodb-gui/src => src}/main/webapp/app/js/templates/file-details.handlebars (100%) rename {photodb-gui/src => src}/main/webapp/app/js/templates/file.handlebars (100%) rename {photodb-gui/src => src}/main/webapp/app/js/templates/files.handlebars (100%) rename {photodb-gui/src => src}/main/webapp/app/js/templates/growl-container.handlebars (100%) rename {photodb-gui/src => src}/main/webapp/app/js/templates/growl.handlebars (100%) rename {photodb-gui/src => src}/main/webapp/app/js/templates/login.handlebars (100%) rename {photodb-gui/src => src}/main/webapp/app/js/templates/signin.handlebars (100%) rename {photodb-gui/src => src}/main/webapp/app/js/templates/signout.handlebars (100%) rename {photodb-gui/src => src}/main/webapp/app/js/view/about.js (100%) rename {photodb-gui/src => src}/main/webapp/app/js/view/container.js (100%) rename {photodb-gui/src => src}/main/webapp/app/js/view/files.js (100%) rename {photodb-gui/src => src}/main/webapp/app/js/view/growl.js (100%) rename {photodb-gui/src => src}/main/webapp/app/js/view/login.js (100%) rename {photodb-gui/src => src}/main/webapp/index.jsp (100%) rename {photodb-web/src => src}/test/java/photodb/TestImageHandling.java (100%) rename {photodb-web/src => src}/test/resources/arquillian.xml (100%) rename {photodb-web/src => src}/test/resources/photos/legend.base64 (100%) rename {photodb-web/src => src}/test/resources/photos/tomee.base64 (100%) diff --git a/.gitignore b/.gitignore index ec6338e..9f97022 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1 @@ -photodb-web/target/ -photodb-gui/target/ -photodb-resources/target/ +target/ \ No newline at end of file diff --git a/Makefile b/Makefile index 73cd274..084f593 100644 --- a/Makefile +++ b/Makefile @@ -12,67 +12,13 @@ # limitations under the License. # -HOME_DIR=$(shell cd && pwd) -TOMEE_DIR=$(HOME_DIR)/TOMEE -PROJECT_NAME=photodb -TOMEE_ORIGINAL_DIR_NAME=apache-tomee-plus-1.6.0-SNAPSHOT - up-static: - rm -rf $(TOMEE_DIR)/tomee-runtime/webapps/$(PROJECT_NAME)/app - cp -r $(PROJECT_NAME)-gui/src/main/webapp/app $(TOMEE_DIR)/tomee-runtime/webapps/$(PROJECT_NAME)/ - cp -r $(PROJECT_NAME)-gui/src/main/webapp/index.jsp $(TOMEE_DIR)/tomee-runtime/webapps/$(PROJECT_NAME)/index.jsp - -up-war: kill-tomee clean-install - rm -f $(TOMEE_DIR)/tomee-runtime/webapps/$(PROJECT_NAME).war - rm -Rf $(TOMEE_DIR)/tomee-runtime/webapps/$(PROJECT_NAME) - cp ./$(PROJECT_NAME)-gui/target/$(PROJECT_NAME).war $(TOMEE_DIR)/tomee-runtime/webapps/ - -up-war-restart: up-war restart-tomee + rm -rf target/apache-tomee/webapps/photodb/app + cp -r src/main/webapp/app target/apache-tomee/webapps/photodb/ -clean-start: start-tomee up-war - -clean-install: kill-tomee +run: mvn clean install -DskipTests=true + mvn tomee:run -unzip-tomee: kill-tomee clean-install - cd ./$(PROJECT_NAME)-resources/target && \ - rm -Rf tomee-runtime && \ - tar -xzf tomee-runtime.tar.gz && \ - mv $(TOMEE_ORIGINAL_DIR_NAME) tomee-runtime - mkdir -p $(TOMEE_DIR) - rm -Rf $(TOMEE_DIR)/tomee-runtime - mv ./$(PROJECT_NAME)-resources/target/tomee-runtime $(TOMEE_DIR)/ - cp ./$(PROJECT_NAME)-gui/target/$(PROJECT_NAME).war $(TOMEE_DIR)/tomee-runtime/webapps - -kill-tomee: - @if test -f $(HOME_DIR)/tomee-pid.txt; then \ - kill -9 `cat $(HOME_DIR)/tomee-pid.txt`; \ - rm $(HOME_DIR)/tomee-pid.txt; \ - fi - -shutdown-tomee: - cd $(TOMEE_DIR)/tomee-runtime/ && \ - ./bin/shutdown.sh - -start-tomee: unzip-tomee restart-tomee - -tail: - tail -f $(TOMEE_DIR)/tomee-runtime/logs/catalina.out - -restart-tomee: kill-tomee - cp -r ./src/main/config/localLoginScript.js $(TOMEE_DIR)/tomee-runtime/conf - export JPDA_SUSPEND=n && \ - export CATALINA_PID=$(HOME_DIR)/tomee-pid.txt && \ - export CATALINA_OPTS="-Djava.security.auth.login.config=$(shell pwd)/src/main/config/login.config" && \ - cd $(TOMEE_DIR)/tomee-runtime/ && \ - ./bin/catalina.sh jpda start - -run-jasmine: - cd ./$(PROJECT_NAME)-gui/ && mvn jasmine:bdd - -run-lint: - cd ./$(PROJECT_NAME)-gui/ && mvn jslint4java:lint - -.PHONY: up-war up-war-restart up-static clean-start clean-install unzip-tomee shutdown-tomee kill-tomee start-tomee \ - restart-tomee run-jasmine run-lint tail +.PHONY: up-static run diff --git a/README.md b/README.md index 4bf5ade..255122b 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,10 @@ photodb -======= +========= ### Quick start ### -If you use a Unix-like OS with Makefile support, you can run the application by following these simple steps. +You can run the application by following these simple steps. 1. Checkout this source code -2. Go to the root of your application and run *make clean-start* +2. Go to the root of your application and run *mvn clean install tomee:run* 3. Open - - -### Makefile targets ### - -* make up-static #It updates the "webapp/app" directory and the index.html/jsp file -* make up-war #It kills TomEE, rebuilds the application and installs the new application war file -* make up-war-restart #It calls "make up-war" followed by "make restart-tomee" -* make clean-install #Just an alias to mvn clean install -DskipTests=true -* make unzip-tomee #It unzips the latest TomEE installed in your mvn repository -* make start-tomee -* make kill-tomee #It calls kill -9 -* make clean-start #The same as "make clean-install" followed by "make start-tomee" -* make restart-tomee #It starts TomEE without a new build of your application -* make tail #It tails the catalina.out file -* make run-jasmine -* make run-lint #Please note that lint will run during the "mvn install" phase diff --git a/photodb-gui/pom.xml b/photodb-gui/pom.xml deleted file mode 100644 index e65bc66..0000000 --- a/photodb-gui/pom.xml +++ /dev/null @@ -1,148 +0,0 @@ - - - - 4.0.0 - - buildnplay - photodb - 1.0-SNAPSHOT - - photodb-gui - 1.0-SNAPSHOT - war - photodb-gui - - - buildnplay - photodb-web - 1.0-SNAPSHOT - - - org.apache.openejb.staticweb - static-tomee-backbone - ${tomee.version} - runtime - - - org.apache.openejb.staticweb - static-tomee-bootstrap - ${tomee.version} - runtime - - - org.apache.openejb.staticweb - static-tomee-jquery - ${tomee.version} - runtime - - - org.apache.openejb.staticweb - static-tomee-handlebars - ${tomee.version} - runtime - - - org.apache.openejb.staticweb - static-tomee-json2 - ${tomee.version} - runtime - - - org.apache.openejb.staticweb - static-tomee-lessjs - ${tomee.version} - runtime - - - org.apache.openejb.staticweb - static-tomee-requirejs - ${tomee.version} - runtime - - - org.apache.openejb.staticweb - static-tomee-underscorejs - ${tomee.version} - runtime - - - - photodb - - - com.github.searls - jasmine-maven-plugin - 1.2.0.0 - true - - - - test - - - - - - http://localhost:8234/src/main/webapp/app/lib/require/require.js - http://localhost:8234/src/test/resources/test_config.js - http://localhost:8234/src/main/webapp/app/config.js - http://localhost:8234/src/test/resources/start.js - - ${project.basedir}/src/main/webapp - - ${project.basedir}/src/test/javascript/empty - - - - src/test/resources/runner.html - - true - - - - com.googlecode.jslint4java - jslint4java-maven-plugin - 2.0.5 - - true - - true - true - define,require,requirejs,window,Backbone,_,$,Handlebars,APP_CONFIG - 4 - - - ${basedir}/src/main/webapp/app/js - - - - - install - - lint - - - - - - - diff --git a/photodb-gui/src/test/javascript/test/I18N.js b/photodb-gui/src/test/javascript/test/I18N.js deleted file mode 100644 index 358a232..0000000 --- a/photodb-gui/src/test/javascript/test/I18N.js +++ /dev/null @@ -1,29 +0,0 @@ -/** - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -define(['app/js/i18n'], function (I18N) { - describe('I18N test', function () { - it('should show the welcome message', function () { - var str = I18N.get('application.welcome', { - appName: I18N.get('application.name'), - userName: 'my Master' - }); - expect(str).toEqual('Hi my Master! Welcome to photodb!'); - }); - }); -}); diff --git a/photodb-gui/src/test/resources/start.js b/photodb-gui/src/test/resources/start.js deleted file mode 100644 index 843fe85..0000000 --- a/photodb-gui/src/test/resources/start.js +++ /dev/null @@ -1,45 +0,0 @@ -/** - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Set the paths needed for our tests -APP_CONFIG.paths.test = '/src/test/javascript/test/'; -APP_CONFIG.baseUrl = '/src/main/webapp/'; - -// APP_CONFIG is the same object used by the official application "start.js" file -require.config(APP_CONFIG); - -// Wrapping it because we don't the "tests" variable available outside this file. -(function () { - - // Don't forget to put a new entry here whenever you add a new test file. - var tests = [ - 'lib/jquery', - 'test/I18N' - ]; - - // Load all the test modules before starting. - require(tests, function () { - $(document).ready(function () { - jasmine.getEnv().addReporter( - new jasmine.HtmlReporter() - ); - // Run tests! - jasmine.getEnv().execute(); - }); - }); -})(); diff --git a/photodb-gui/src/test/resources/test_config.js b/photodb-gui/src/test/resources/test_config.js deleted file mode 100644 index b273645..0000000 --- a/photodb-gui/src/test/resources/test_config.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -window.ux = window.ux || {}; -window.ux.ROOT_URL = 'http://localhost:8234/'; \ No newline at end of file diff --git a/photodb-resources/pom.xml b/photodb-resources/pom.xml deleted file mode 100644 index d97b505..0000000 --- a/photodb-resources/pom.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - 4.0.0 - - buildnplay - photodb - 1.0-SNAPSHOT - - photodb-resources - 1.0-SNAPSHOT - jar - photodb-resources - - - - - - org.apache.maven.plugins - maven-dependency-plugin - 2.6 - - - copy - package - - copy - - - - - org.apache.openejb - apache-tomee - ${tomee.version} - plus - tar.gz - true - ${project.basedir}/target/ - tomee-runtime.tar.gz - - - - - - - - - - diff --git a/photodb-web/pom.xml b/photodb-web/pom.xml deleted file mode 100644 index f1455de..0000000 --- a/photodb-web/pom.xml +++ /dev/null @@ -1,113 +0,0 @@ - - - - 4.0.0 - - buildnplay - photodb - 1.0-SNAPSHOT - - photodb-web - 1.0-SNAPSHOT - jar - photodb-web - - - junit - junit - - - org.jboss.arquillian.junit - arquillian-junit-container - - - org.apache.openejb - arquillian-tomee-embedded - - - org.apache.openejb - openejb-core - - - commons-codec - commons-codec - - - org.apache.openejb - javaee-api - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.14.1 - - - org.apache.maven.plugins - maven-checkstyle-plugin - 2.10 - - false - src/main/config/checkstyle.xml - - - - - check - - - - - - org.apache.maven.plugins - maven-pmd-plugin - 3.0.1 - - - - check - - - - - - org.apache.openjpa - openjpa-maven-plugin - 2.2.0 - - **/photodb/data/entity/*.class - true - true - - - - enhancer - process-classes - - enhance - - - - - - - diff --git a/pom.xml b/pom.xml index cdf7a7e..af9fadc 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ buildnplay photodb 1.0-SNAPSHOT - pom + war photodb UTF-8 @@ -29,11 +29,6 @@ 4.10 1.0.3.Final - - photodb-gui - photodb-web - photodb-resources - apache.snapshots @@ -46,50 +41,189 @@ - - - - org.jboss.arquillian - arquillian-bom - ${arquillian.version} - import - pom - - - org.jboss.arquillian.junit - arquillian-junit-container - ${arquillian.version} - test - - - org.apache.openejb - arquillian-tomee-embedded - test + + + apache-m2-snapshot-plugin + Apache Snapshot Repository + http://repository.apache.org/snapshots + + + + + junit + junit + ${junit.version} + test + + + org.apache.openejb + ziplock + ${tomee.version} + test + + + org.apache.openejb + arquillian-tomee-embedded + ${tomee.version} + test + + + commons-codec + commons-codec + 1.7 + + + org.apache.openejb + openejb-core + ${openejb.version} + provided + + + org.apache.openejb + javaee-api + ${javaee.api} + provided + + + org.apache.openejb.staticweb + static-tomee-backbone + ${tomee.version} + runtime + + + org.apache.openejb.staticweb + static-tomee-bootstrap + ${tomee.version} + runtime + + + org.apache.openejb.staticweb + static-tomee-jquery + ${tomee.version} + runtime + + + org.apache.openejb.staticweb + static-tomee-handlebars + ${tomee.version} + runtime + + + org.apache.openejb.staticweb + static-tomee-json2 + ${tomee.version} + runtime + + + org.apache.openejb.staticweb + static-tomee-lessjs + ${tomee.version} + runtime + + + org.apache.openejb.staticweb + static-tomee-requirejs + ${tomee.version} + runtime + + + org.apache.openejb.staticweb + static-tomee-underscorejs + ${tomee.version} + runtime + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.14.1 + + + org.apache.maven.plugins + maven-checkstyle-plugin + 2.10 + + false + src/main/config/checkstyle.xml + + + + + check + + + + + + org.apache.maven.plugins + maven-pmd-plugin + 3.0.1 + + + + check + + + + + + org.apache.openjpa + openjpa-maven-plugin + 2.2.0 + + **/photodb/data/entity/*.class + true + true + + + + enhancer + process-classes + + enhance + + + + + + com.googlecode.jslint4java + jslint4java-maven-plugin + 2.0.5 + + true + + true + true + define,require,requirejs,window,Backbone,_,$,Handlebars,APP_CONFIG + 4 + + + ${basedir}/src/main/webapp/app/js + + + + + install + + lint + + + + + + org.apache.openejb.maven + tomee-maven-plugin ${tomee.version} - - - commons-codec - commons-codec - 1.7 - - - junit - junit - ${junit.version} - test - - - org.apache.openejb - openejb-core - ${openejb.version} - provided - - - org.apache.openejb - javaee-api - ${javaee.api} - provided - - - + + plus + -Xmx512m -XX:PermSize=256m + photodb + + + + + + \ No newline at end of file diff --git a/photodb-web/src/main/config/checkstyle.xml b/src/main/config/checkstyle.xml similarity index 100% rename from photodb-web/src/main/config/checkstyle.xml rename to src/main/config/checkstyle.xml diff --git a/src/main/config/localLoginScript.js b/src/main/config/localLoginScript.js deleted file mode 100644 index cb1f5b5..0000000 --- a/src/main/config/localLoginScript.js +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -function localAuthentication() { - var result = new java.util.ArrayList(); - result.add('photo-user'); - if (!user || user.trim() === '') { - throw 'Bad user or password. Test.'; - } - return result; -} - -localAuthentication(); diff --git a/src/main/config/login.config b/src/main/config/login.config deleted file mode 100644 index 8a03a86..0000000 --- a/src/main/config/login.config +++ /dev/null @@ -1,5 +0,0 @@ -ScriptLogin { - org.apache.openejb.core.security.jaas.ScriptLoginModule required - engineName="js" - scriptURI="localLoginScript.js"; -}; diff --git a/photodb-web/src/main/java/photodb/cdi/DtoBuilder.java b/src/main/java/photodb/cdi/DtoBuilder.java similarity index 100% rename from photodb-web/src/main/java/photodb/cdi/DtoBuilder.java rename to src/main/java/photodb/cdi/DtoBuilder.java diff --git a/photodb-web/src/main/java/photodb/cdi/ImageManager.java b/src/main/java/photodb/cdi/ImageManager.java similarity index 100% rename from photodb-web/src/main/java/photodb/cdi/ImageManager.java rename to src/main/java/photodb/cdi/ImageManager.java diff --git a/photodb-web/src/main/java/photodb/data/dto/PhotoDto.java b/src/main/java/photodb/data/dto/PhotoDto.java similarity index 100% rename from photodb-web/src/main/java/photodb/data/dto/PhotoDto.java rename to src/main/java/photodb/data/dto/PhotoDto.java diff --git a/photodb-web/src/main/java/photodb/data/dto/UserInfo.java b/src/main/java/photodb/data/dto/UserInfo.java similarity index 100% rename from photodb-web/src/main/java/photodb/data/dto/UserInfo.java rename to src/main/java/photodb/data/dto/UserInfo.java diff --git a/photodb-web/src/main/java/photodb/data/entity/BaseEntity.java b/src/main/java/photodb/data/entity/BaseEntity.java similarity index 100% rename from photodb-web/src/main/java/photodb/data/entity/BaseEntity.java rename to src/main/java/photodb/data/entity/BaseEntity.java diff --git a/photodb-web/src/main/java/photodb/data/entity/Photo.java b/src/main/java/photodb/data/entity/Photo.java similarity index 100% rename from photodb-web/src/main/java/photodb/data/entity/Photo.java rename to src/main/java/photodb/data/entity/Photo.java diff --git a/photodb-web/src/main/java/photodb/data/entity/User.java b/src/main/java/photodb/data/entity/User.java similarity index 100% rename from photodb-web/src/main/java/photodb/data/entity/User.java rename to src/main/java/photodb/data/entity/User.java diff --git a/photodb-web/src/main/java/photodb/service/ApplicationConfig.java b/src/main/java/photodb/service/ApplicationConfig.java similarity index 100% rename from photodb-web/src/main/java/photodb/service/ApplicationConfig.java rename to src/main/java/photodb/service/ApplicationConfig.java diff --git a/photodb-web/src/main/java/photodb/service/ApplicationException.java b/src/main/java/photodb/service/ApplicationException.java similarity index 100% rename from photodb-web/src/main/java/photodb/service/ApplicationException.java rename to src/main/java/photodb/service/ApplicationException.java diff --git a/photodb-web/src/main/java/photodb/service/ApplicationStart.java b/src/main/java/photodb/service/ApplicationStart.java similarity index 100% rename from photodb-web/src/main/java/photodb/service/ApplicationStart.java rename to src/main/java/photodb/service/ApplicationStart.java diff --git a/photodb-web/src/main/java/photodb/service/bean/BaseEAO.java b/src/main/java/photodb/service/bean/BaseEAO.java similarity index 100% rename from photodb-web/src/main/java/photodb/service/bean/BaseEAO.java rename to src/main/java/photodb/service/bean/BaseEAO.java diff --git a/photodb-web/src/main/java/photodb/service/bean/PhotoImpl.java b/src/main/java/photodb/service/bean/PhotoImpl.java similarity index 100% rename from photodb-web/src/main/java/photodb/service/bean/PhotoImpl.java rename to src/main/java/photodb/service/bean/PhotoImpl.java diff --git a/photodb-web/src/main/java/photodb/service/bean/UserImpl.java b/src/main/java/photodb/service/bean/UserImpl.java similarity index 100% rename from photodb-web/src/main/java/photodb/service/bean/UserImpl.java rename to src/main/java/photodb/service/bean/UserImpl.java diff --git a/photodb-web/src/main/java/photodb/service/rest/KeepAlive.java b/src/main/java/photodb/service/rest/KeepAlive.java similarity index 100% rename from photodb-web/src/main/java/photodb/service/rest/KeepAlive.java rename to src/main/java/photodb/service/rest/KeepAlive.java diff --git a/photodb-web/src/main/java/photodb/service/rest/Photos.java b/src/main/java/photodb/service/rest/Photos.java similarity index 97% rename from photodb-web/src/main/java/photodb/service/rest/Photos.java rename to src/main/java/photodb/service/rest/Photos.java index 358ecd8..72c8a4f 100644 --- a/photodb-web/src/main/java/photodb/service/rest/Photos.java +++ b/src/main/java/photodb/service/rest/Photos.java @@ -20,7 +20,6 @@ import photodb.cdi.DtoBuilder; -import photodb.cdi.ImageManager; import photodb.data.dto.PhotoDto; import photodb.data.entity.Photo; import photodb.service.bean.PhotoImpl; @@ -43,7 +42,7 @@ public class Photos { private PhotoImpl photoService; @Inject - private ImageManager imageManager; + private photodb.cdi.ImageManager imageManager; @Inject private DtoBuilder dtoBuilder; diff --git a/photodb-web/src/main/java/photodb/service/rest/User.java b/src/main/java/photodb/service/rest/User.java similarity index 94% rename from photodb-web/src/main/java/photodb/service/rest/User.java rename to src/main/java/photodb/service/rest/User.java index c0fa34e..2682f9d 100644 --- a/photodb-web/src/main/java/photodb/service/rest/User.java +++ b/src/main/java/photodb/service/rest/User.java @@ -18,9 +18,7 @@ package photodb.service.rest; -import photodb.cdi.DtoBuilder; import photodb.data.dto.UserInfo; -import photodb.service.bean.UserImpl; import javax.ejb.EJB; import javax.inject.Inject; @@ -35,10 +33,10 @@ public class User { @Inject - private DtoBuilder dtoBuilder; + private photodb.cdi.DtoBuilder dtoBuilder; @EJB - private UserImpl userService; + private photodb.service.bean.UserImpl userService; @POST @Path("/new") diff --git a/photodb-web/src/main/java/photodb/web/SessionListener.java b/src/main/java/photodb/web/SessionListener.java similarity index 100% rename from photodb-web/src/main/java/photodb/web/SessionListener.java rename to src/main/java/photodb/web/SessionListener.java diff --git a/photodb-web/src/main/resources/META-INF/beans.xml b/src/main/resources/META-INF/beans.xml similarity index 100% rename from photodb-web/src/main/resources/META-INF/beans.xml rename to src/main/resources/META-INF/beans.xml diff --git a/photodb-web/src/main/resources/META-INF/ejb-jar.xml b/src/main/resources/META-INF/ejb-jar.xml similarity index 100% rename from photodb-web/src/main/resources/META-INF/ejb-jar.xml rename to src/main/resources/META-INF/ejb-jar.xml diff --git a/photodb-web/src/main/resources/META-INF/persistence.xml b/src/main/resources/META-INF/persistence.xml similarity index 100% rename from photodb-web/src/main/resources/META-INF/persistence.xml rename to src/main/resources/META-INF/persistence.xml diff --git a/photodb-gui/src/test/resources/runner.html b/src/main/tomee/conf/tomcat-users.xml similarity index 76% rename from photodb-gui/src/test/resources/runner.html rename to src/main/tomee/conf/tomcat-users.xml index 7d224de..16d9e34 100644 --- a/photodb-gui/src/test/resources/runner.html +++ b/src/main/tomee/conf/tomcat-users.xml @@ -1,4 +1,4 @@ - + - - - - Jasmine Spec Runner - $cssDependencies$ - $javascriptDependencies$ - $sources$ - - - \ No newline at end of file + + + + diff --git a/src/main/tomee/conf/tomee.xml b/src/main/tomee/conf/tomee.xml new file mode 100644 index 0000000..b3b91e9 --- /dev/null +++ b/src/main/tomee/conf/tomee.xml @@ -0,0 +1,27 @@ + + + + + JdbcDriver org.hsqldb.jdbcDriver + JdbcUrl jdbc:hsqldb:mem:hsqldb + UserName sa + Password + + \ No newline at end of file diff --git a/photodb-gui/src/main/webapp/META-INF/context.xml b/src/main/webapp/META-INF/context.xml similarity index 78% rename from photodb-gui/src/main/webapp/META-INF/context.xml rename to src/main/webapp/META-INF/context.xml index ee6f38d..c86030a 100644 --- a/photodb-gui/src/main/webapp/META-INF/context.xml +++ b/src/main/webapp/META-INF/context.xml @@ -17,8 +17,4 @@ limitations under the License. --> - - diff --git a/photodb-gui/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from photodb-gui/src/main/webapp/WEB-INF/web.xml rename to src/main/webapp/WEB-INF/web.xml diff --git a/photodb-gui/src/main/webapp/app/app.less b/src/main/webapp/app/app.less similarity index 100% rename from photodb-gui/src/main/webapp/app/app.less rename to src/main/webapp/app/app.less diff --git a/photodb-gui/src/main/webapp/app/config.js b/src/main/webapp/app/config.js similarity index 100% rename from photodb-gui/src/main/webapp/app/config.js rename to src/main/webapp/app/config.js diff --git a/photodb-gui/src/main/webapp/app/js/application.js b/src/main/webapp/app/js/application.js similarity index 100% rename from photodb-gui/src/main/webapp/app/js/application.js rename to src/main/webapp/app/js/application.js diff --git a/photodb-gui/src/main/webapp/app/js/i18n.js b/src/main/webapp/app/js/i18n.js similarity index 100% rename from photodb-gui/src/main/webapp/app/js/i18n.js rename to src/main/webapp/app/js/i18n.js diff --git a/photodb-gui/src/main/webapp/app/js/keep-alive.js b/src/main/webapp/app/js/keep-alive.js similarity index 100% rename from photodb-gui/src/main/webapp/app/js/keep-alive.js rename to src/main/webapp/app/js/keep-alive.js diff --git a/photodb-gui/src/main/webapp/app/js/log.js b/src/main/webapp/app/js/log.js similarity index 100% rename from photodb-gui/src/main/webapp/app/js/log.js rename to src/main/webapp/app/js/log.js diff --git a/photodb-gui/src/main/webapp/app/js/model/file.js b/src/main/webapp/app/js/model/file.js similarity index 100% rename from photodb-gui/src/main/webapp/app/js/model/file.js rename to src/main/webapp/app/js/model/file.js diff --git a/photodb-gui/src/main/webapp/app/js/model/files.js b/src/main/webapp/app/js/model/files.js similarity index 100% rename from photodb-gui/src/main/webapp/app/js/model/files.js rename to src/main/webapp/app/js/model/files.js diff --git a/photodb-gui/src/main/webapp/app/js/start.js b/src/main/webapp/app/js/start.js similarity index 100% rename from photodb-gui/src/main/webapp/app/js/start.js rename to src/main/webapp/app/js/start.js diff --git a/photodb-gui/src/main/webapp/app/js/templates.js b/src/main/webapp/app/js/templates.js similarity index 100% rename from photodb-gui/src/main/webapp/app/js/templates.js rename to src/main/webapp/app/js/templates.js diff --git a/photodb-gui/src/main/webapp/app/js/templates/about.handlebars b/src/main/webapp/app/js/templates/about.handlebars similarity index 100% rename from photodb-gui/src/main/webapp/app/js/templates/about.handlebars rename to src/main/webapp/app/js/templates/about.handlebars diff --git a/photodb-gui/src/main/webapp/app/js/templates/container.handlebars b/src/main/webapp/app/js/templates/container.handlebars similarity index 100% rename from photodb-gui/src/main/webapp/app/js/templates/container.handlebars rename to src/main/webapp/app/js/templates/container.handlebars diff --git a/photodb-gui/src/main/webapp/app/js/templates/file-details.handlebars b/src/main/webapp/app/js/templates/file-details.handlebars similarity index 100% rename from photodb-gui/src/main/webapp/app/js/templates/file-details.handlebars rename to src/main/webapp/app/js/templates/file-details.handlebars diff --git a/photodb-gui/src/main/webapp/app/js/templates/file.handlebars b/src/main/webapp/app/js/templates/file.handlebars similarity index 100% rename from photodb-gui/src/main/webapp/app/js/templates/file.handlebars rename to src/main/webapp/app/js/templates/file.handlebars diff --git a/photodb-gui/src/main/webapp/app/js/templates/files.handlebars b/src/main/webapp/app/js/templates/files.handlebars similarity index 100% rename from photodb-gui/src/main/webapp/app/js/templates/files.handlebars rename to src/main/webapp/app/js/templates/files.handlebars diff --git a/photodb-gui/src/main/webapp/app/js/templates/growl-container.handlebars b/src/main/webapp/app/js/templates/growl-container.handlebars similarity index 100% rename from photodb-gui/src/main/webapp/app/js/templates/growl-container.handlebars rename to src/main/webapp/app/js/templates/growl-container.handlebars diff --git a/photodb-gui/src/main/webapp/app/js/templates/growl.handlebars b/src/main/webapp/app/js/templates/growl.handlebars similarity index 100% rename from photodb-gui/src/main/webapp/app/js/templates/growl.handlebars rename to src/main/webapp/app/js/templates/growl.handlebars diff --git a/photodb-gui/src/main/webapp/app/js/templates/login.handlebars b/src/main/webapp/app/js/templates/login.handlebars similarity index 100% rename from photodb-gui/src/main/webapp/app/js/templates/login.handlebars rename to src/main/webapp/app/js/templates/login.handlebars diff --git a/photodb-gui/src/main/webapp/app/js/templates/signin.handlebars b/src/main/webapp/app/js/templates/signin.handlebars similarity index 100% rename from photodb-gui/src/main/webapp/app/js/templates/signin.handlebars rename to src/main/webapp/app/js/templates/signin.handlebars diff --git a/photodb-gui/src/main/webapp/app/js/templates/signout.handlebars b/src/main/webapp/app/js/templates/signout.handlebars similarity index 100% rename from photodb-gui/src/main/webapp/app/js/templates/signout.handlebars rename to src/main/webapp/app/js/templates/signout.handlebars diff --git a/photodb-gui/src/main/webapp/app/js/view/about.js b/src/main/webapp/app/js/view/about.js similarity index 100% rename from photodb-gui/src/main/webapp/app/js/view/about.js rename to src/main/webapp/app/js/view/about.js diff --git a/photodb-gui/src/main/webapp/app/js/view/container.js b/src/main/webapp/app/js/view/container.js similarity index 100% rename from photodb-gui/src/main/webapp/app/js/view/container.js rename to src/main/webapp/app/js/view/container.js diff --git a/photodb-gui/src/main/webapp/app/js/view/files.js b/src/main/webapp/app/js/view/files.js similarity index 100% rename from photodb-gui/src/main/webapp/app/js/view/files.js rename to src/main/webapp/app/js/view/files.js diff --git a/photodb-gui/src/main/webapp/app/js/view/growl.js b/src/main/webapp/app/js/view/growl.js similarity index 100% rename from photodb-gui/src/main/webapp/app/js/view/growl.js rename to src/main/webapp/app/js/view/growl.js diff --git a/photodb-gui/src/main/webapp/app/js/view/login.js b/src/main/webapp/app/js/view/login.js similarity index 100% rename from photodb-gui/src/main/webapp/app/js/view/login.js rename to src/main/webapp/app/js/view/login.js diff --git a/photodb-gui/src/main/webapp/index.jsp b/src/main/webapp/index.jsp similarity index 100% rename from photodb-gui/src/main/webapp/index.jsp rename to src/main/webapp/index.jsp diff --git a/photodb-web/src/test/java/photodb/TestImageHandling.java b/src/test/java/photodb/TestImageHandling.java similarity index 100% rename from photodb-web/src/test/java/photodb/TestImageHandling.java rename to src/test/java/photodb/TestImageHandling.java diff --git a/photodb-web/src/test/resources/arquillian.xml b/src/test/resources/arquillian.xml similarity index 100% rename from photodb-web/src/test/resources/arquillian.xml rename to src/test/resources/arquillian.xml diff --git a/photodb-web/src/test/resources/photos/legend.base64 b/src/test/resources/photos/legend.base64 similarity index 100% rename from photodb-web/src/test/resources/photos/legend.base64 rename to src/test/resources/photos/legend.base64 diff --git a/photodb-web/src/test/resources/photos/tomee.base64 b/src/test/resources/photos/tomee.base64 similarity index 100% rename from photodb-web/src/test/resources/photos/tomee.base64 rename to src/test/resources/photos/tomee.base64