From c23d14522fa667a78caad8bd01169ce244a3b585 Mon Sep 17 00:00:00 2001 From: Willem Cazander Date: Sun, 6 May 2012 06:50:29 +0200 Subject: [PATCH] wip commit with working vasc demo tech --- authors.txt | 9 + licence.txt | 21 + pom.xml | 4 +- readme.txt | 35 + src/site/apt/todo.apt | 35 - todo.txt | 34 + .../metamodel/MetaModelDataContextJdbc.java | 90 +++ .../MetaModelDataContextMongodb.java | 12 +- .../metamodel/MetaModelVascBackend.java | 93 ++- .../impl/ui/VascSelectItemModelEntry.java | 8 +- vasc-demo/pom.xml | 2 +- .../vasc/demo/swing/JMainFrame.java | 640 ------------------ .../vasc/demo/swing/SwingStartup.java | 91 --- .../vasc/demo/swing/VascManager.java | 62 -- .../vasc/demo/swing/example/tables.xml | 317 --------- vasc-demo/vasc-demo-tech/.project | 17 + .../org.eclipse.core.resources.prefs | 2 + .../.settings/org.eclipse.m2e.core.prefs | 1 - vasc-demo/vasc-demo-tech/pom.xml | 19 + .../vasc-demo-tech-build/.project | 17 + .../org.eclipse.core.resources.prefs | 2 + .../.settings/org.eclipse.m2e.core.prefs | 4 + .../vasc-demo-tech-build/pom.xml | 45 ++ .../src/main/assembly/bin.xml | 62 ++ .../src/main/scripts/run.bat | 38 ++ .../src/main/scripts/run.sh | 38 ++ .../vasc-demo-tech-editor}/.classpath | 0 .../vasc-demo-tech-editor/.project | 23 + .../org.eclipse.core.resources.prefs | 1 - .../.settings/org.eclipse.jdt.core.prefs | 1 - .../.settings/org.eclipse.m2e.core.prefs | 4 + .../vasc-demo-tech-editor/pom.xml | 12 + .../forwardfire/vasc/editor}/vasc-edit.xml | 0 .../vasc-demo-tech-ui/.classpath | 10 + .../vasc-demo-tech-ui}/.project | 2 +- .../org.eclipse.core.resources.prefs | 6 + .../.settings/org.eclipse.jdt.core.prefs | 5 + .../.settings/org.eclipse.m2e.core.prefs | 4 + .../vasc-demo-tech-ui}/pom.xml | 35 +- .../demo/tech/ui/PatternLogFormatter.java | 134 ++++ .../forwardfire/vasc/demo/tech/ui/TechUI.java | 187 +++++ .../vasc/demo/tech/ui/VascManager.java | 292 ++++++++ .../demo/tech/ui/actions/JDialogMetaCsv.java | 78 +++ .../demo/tech/ui/actions/JDialogMetaJdbc.java | 108 +++ .../tech/ui/actions/JDialogMetaMongodb.java | 97 +++ .../tech/ui/components/JConsolePanel.java | 153 +++++ .../demo/tech/ui/components/JMainPanel.java | 269 ++++++++ .../tech/ui/components/JMainPanelMenuBar.java | 144 ++++ .../tech/ui/components/SpringLayoutGrid.java | 214 ++++++ .../demo/tech/ui/resources/TechUI.properties | 118 ++++ .../vasc-demo-tech-web/.classpath | 10 + .../vasc-demo-tech-web/.project | 23 + .../org.eclipse.core.resources.prefs | 6 + .../.settings/org.eclipse.jdt.core.prefs | 5 + .../.settings/org.eclipse.m2e.core.prefs | 4 + .../vasc-demo-tech/vasc-demo-tech-web/pom.xml | 77 +++ .../demo/tech/web/beans/UserController.java | 72 ++ .../tech/web/beans/VascFacesController.java | 88 +++ .../demo/tech/web/core/TomcatManager.java | 57 ++ .../vasc/demo/tech/web/models/WebUser.java | 50 ++ .../skins/vasc-demo-tech.skin.properties | 73 ++ .../src/main/webapp/WEB-INF/faces.xml | 26 + .../src/main/webapp/WEB-INF/web.xml | 205 ++++++ .../src/main/webapp/css/ie6_fixes.css | 8 + .../src/main/webapp/css/ie7_fixes.css | 8 + .../src/main/webapp/css/ie8_fixes.css | 4 + .../src/main/webapp/css/site.css | 538 +++++++++++++++ .../src/main/webapp/img/icon_download.png | Bin 0 -> 175 bytes .../src/main/webapp/img/icon_print.png | Bin 0 -> 172 bytes .../src/main/webapp/img/logstats-logo.png | Bin 0 -> 15551 bytes .../src/main/webapp/jsp/admin/index.xhtml | 22 + .../src/main/webapp/jsp/help.xhtml | 10 + .../webapp/jsp/includes/index-pulic.xhtml | 15 + .../main/webapp/jsp/includes/index-user.xhtml | 16 + .../src/main/webapp/jsp/includes/layout.xhtml | 71 ++ .../webapp/jsp/includes/vasc-template.xhtml | 318 +++++++++ .../webapp/jsp/includes/wiki-template.xhtml | 10 + .../src/main/webapp/jsp/index.xhtml | 20 + .../src/main/webapp/jsp/index_jsp.jsp | 2 + .../main/webapp/jsp/login/login-error.xhtml | 11 + .../main/webapp/jsp/login/login-forgot.xhtml | 11 + .../src/main/webapp/jsp/login/login.xhtml | 23 + .../src/main/webapp/jsp/login/logout.xhtml | 11 + .../src/main/webapp/jsp/realtime.xhtml | 56 ++ .../src/main/webapp/jsp/reports.xhtml | 10 + vasc-frontend/vasc-frontend-swing/pom.xml | 2 - .../frontends/swing/SwingVascEditDialog.java | 19 +- .../frontends/swing/SwingVascFrontend.java | 3 +- .../vasc/frontends/swing/ui/SwingDate.java | 5 +- .../vasc/frontends/swing/ui/SwingText.java | 4 + .../frontends/swing/ui/SwingTextArea.java | 36 +- .../DefaultCalendarResources.properties | 28 + .../microba/calendar/resource/back-16.png | Bin 0 -> 185 bytes .../calendar/resource/back-fast-16.png | Bin 0 -> 193 bytes .../microba/calendar/resource/forward-16.png | Bin 0 -> 179 bytes .../calendar/resource/forward-fast-16.png | Bin 0 -> 189 bytes .../microba/calendar/resource/picker-16.png | Bin 0 -> 461 bytes .../AbstractJSFVascFacesControllerBase.java | 4 +- .../web/jsf/VascRequestFacesFilter.java | 19 +- .../test/frontend/data/TestModelData.java | 1 + 100 files changed, 4356 insertions(+), 1220 deletions(-) create mode 100644 authors.txt create mode 100644 licence.txt create mode 100644 readme.txt delete mode 100644 src/site/apt/todo.apt create mode 100644 todo.txt create mode 100644 vasc-backend/vasc-backend-metamodel/src/main/java/net/forwardfire/vasc/backend/metamodel/MetaModelDataContextJdbc.java delete mode 100644 vasc-demo/vasc-demo-swing/src/main/java/net/forwardfire/vasc/demo/swing/JMainFrame.java delete mode 100644 vasc-demo/vasc-demo-swing/src/main/java/net/forwardfire/vasc/demo/swing/SwingStartup.java delete mode 100644 vasc-demo/vasc-demo-swing/src/main/java/net/forwardfire/vasc/demo/swing/VascManager.java delete mode 100644 vasc-demo/vasc-demo-swing/src/main/resources/net/forwardfire/vasc/demo/swing/example/tables.xml create mode 100644 vasc-demo/vasc-demo-tech/.project create mode 100644 vasc-demo/vasc-demo-tech/.settings/org.eclipse.core.resources.prefs rename vasc-demo/{vasc-demo-swing => vasc-demo-tech}/.settings/org.eclipse.m2e.core.prefs (74%) create mode 100644 vasc-demo/vasc-demo-tech/pom.xml create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-build/.project create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-build/.settings/org.eclipse.core.resources.prefs create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-build/.settings/org.eclipse.m2e.core.prefs create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-build/pom.xml create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-build/src/main/assembly/bin.xml create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-build/src/main/scripts/run.bat create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-build/src/main/scripts/run.sh rename vasc-demo/{vasc-demo-swing => vasc-demo-tech/vasc-demo-tech-editor}/.classpath (100%) create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-editor/.project rename vasc-demo/{vasc-demo-swing => vasc-demo-tech/vasc-demo-tech-editor}/.settings/org.eclipse.core.resources.prefs (86%) rename vasc-demo/{vasc-demo-swing => vasc-demo-tech/vasc-demo-tech-editor}/.settings/org.eclipse.jdt.core.prefs (88%) create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-editor/.settings/org.eclipse.m2e.core.prefs create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-editor/pom.xml rename vasc-demo/{vasc-demo-swing/src/main/resources/net/forwardfire/vasc/demo/swing/example => vasc-demo-tech/vasc-demo-tech-editor/src/main/resources/net/forwardfire/vasc/editor}/vasc-edit.xml (100%) create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/.classpath rename vasc-demo/{vasc-demo-swing => vasc-demo-tech/vasc-demo-tech-ui}/.project (94%) create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/.settings/org.eclipse.core.resources.prefs create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/.settings/org.eclipse.jdt.core.prefs create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/.settings/org.eclipse.m2e.core.prefs rename vasc-demo/{vasc-demo-swing => vasc-demo-tech/vasc-demo-tech-ui}/pom.xml (64%) create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/src/main/java/net/forwardfire/vasc/demo/tech/ui/PatternLogFormatter.java create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/src/main/java/net/forwardfire/vasc/demo/tech/ui/TechUI.java create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/src/main/java/net/forwardfire/vasc/demo/tech/ui/VascManager.java create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/src/main/java/net/forwardfire/vasc/demo/tech/ui/actions/JDialogMetaCsv.java create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/src/main/java/net/forwardfire/vasc/demo/tech/ui/actions/JDialogMetaJdbc.java create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/src/main/java/net/forwardfire/vasc/demo/tech/ui/actions/JDialogMetaMongodb.java create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/src/main/java/net/forwardfire/vasc/demo/tech/ui/components/JConsolePanel.java create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/src/main/java/net/forwardfire/vasc/demo/tech/ui/components/JMainPanel.java create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/src/main/java/net/forwardfire/vasc/demo/tech/ui/components/JMainPanelMenuBar.java create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/src/main/java/net/forwardfire/vasc/demo/tech/ui/components/SpringLayoutGrid.java create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/src/main/resources/net/forwardfire/vasc/demo/tech/ui/resources/TechUI.properties create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-web/.classpath create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-web/.project create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-web/.settings/org.eclipse.core.resources.prefs create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-web/.settings/org.eclipse.jdt.core.prefs create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-web/.settings/org.eclipse.m2e.core.prefs create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-web/pom.xml create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/java/net/forwardfire/vasc/demo/tech/web/beans/UserController.java create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/java/net/forwardfire/vasc/demo/tech/web/beans/VascFacesController.java create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/java/net/forwardfire/vasc/demo/tech/web/core/TomcatManager.java create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/java/net/forwardfire/vasc/demo/tech/web/models/WebUser.java create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/resources/META-INF/skins/vasc-demo-tech.skin.properties create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/WEB-INF/faces.xml create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/WEB-INF/web.xml create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/css/ie6_fixes.css create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/css/ie7_fixes.css create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/css/ie8_fixes.css create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/css/site.css create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/img/icon_download.png create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/img/icon_print.png create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/img/logstats-logo.png create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/admin/index.xhtml create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/help.xhtml create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/includes/index-pulic.xhtml create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/includes/index-user.xhtml create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/includes/layout.xhtml create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/includes/vasc-template.xhtml create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/includes/wiki-template.xhtml create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/index.xhtml create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/index_jsp.jsp create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/login/login-error.xhtml create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/login/login-forgot.xhtml create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/login/login.xhtml create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/login/logout.xhtml create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/realtime.xhtml create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/reports.xhtml create mode 100644 vasc-frontend/vasc-frontend-swing/src/main/resources/com/michaelbaranov/microba/calendar/DefaultCalendarResources.properties create mode 100644 vasc-frontend/vasc-frontend-swing/src/main/resources/com/michaelbaranov/microba/calendar/resource/back-16.png create mode 100644 vasc-frontend/vasc-frontend-swing/src/main/resources/com/michaelbaranov/microba/calendar/resource/back-fast-16.png create mode 100644 vasc-frontend/vasc-frontend-swing/src/main/resources/com/michaelbaranov/microba/calendar/resource/forward-16.png create mode 100644 vasc-frontend/vasc-frontend-swing/src/main/resources/com/michaelbaranov/microba/calendar/resource/forward-fast-16.png create mode 100644 vasc-frontend/vasc-frontend-swing/src/main/resources/com/michaelbaranov/microba/calendar/resource/picker-16.png diff --git a/authors.txt b/authors.txt new file mode 100644 index 0000000..a18b1c7 --- /dev/null +++ b/authors.txt @@ -0,0 +1,9 @@ +Vasc was written by: + + Willem Cazander + +Contributors: + + ... + + diff --git a/licence.txt b/licence.txt new file mode 100644 index 0000000..306d39d --- /dev/null +++ b/licence.txt @@ -0,0 +1,21 @@ +Copyright (c) 2007-2012, Willem Cazander +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided +that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this list of conditions and the + following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and + the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT +OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR +TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/pom.xml b/pom.xml index 26bdfda..23038fb 100644 --- a/pom.xml +++ b/pom.xml @@ -98,7 +98,9 @@ 3.0.0.CR2 6.0.0.Final - + + + 1.9.2 diff --git a/readme.txt b/readme.txt new file mode 100644 index 0000000..073e183 --- /dev/null +++ b/readme.txt @@ -0,0 +1,35 @@ + +=== Welcome in Vasc === + +Vasc is a framework to provided all crud operations on different +data backends like databases to csv files. With multiple frontends +like swing/jsf and swt. + +=== Files in this package === + +authors.txt - Contributors listing. +build.txt - Developer build guide. +licence.txt - The licence of PulseFire. +pom.xml - Maven specific build file. +readme.txt - This file. +todo.txt - Small todo list. +versions.txt - Versions history. +vasc-* - Maven java packages for vasc. +src - site source. + +=== Licenced binary files === + +./src/site/resources/images/site-logo.png +./src/site/vasc.jks + +The binary files in the above listing fall all under +the licence terms described in the licence.txt file. + + +=== External licenced binary files === + +None. + + + +#EOF diff --git a/src/site/apt/todo.apt b/src/site/apt/todo.apt deleted file mode 100644 index b567db0..0000000 --- a/src/site/apt/todo.apt +++ /dev/null @@ -1,35 +0,0 @@ -TODO LIST - -+-- - - -- (30%) X4O client/server config -- fix frontend event system -- make event channels work -- config prefix (and rest of default in finalizer) -- (10%) update SWT frontend -- create JSF frontend -- Make annotations work. -- Multiple SelectItems for addable null's etc. -- make sorting work -- make searching work -- made options work -- auto text converts - -- Plugin validation -- Plugin Role Parser -- Finalizer plugins -- Check user roles in frontend -- Default/Full Table and templating -- Ckeck all validators -- Bind to x18n -- MetaQuery support -- create JSF-extJS frontend -- create XML-RPC frontend -- export interface + exports -- graphs of numeric value columns - -=== DONE === - - -+-- diff --git a/todo.txt b/todo.txt new file mode 100644 index 0000000..c0706de --- /dev/null +++ b/todo.txt @@ -0,0 +1,34 @@ +== TODO == + +- xml file as argument +- x4o template +- swing readonly field editor +- order by list and edit. +- vasc AUTO ID +- textarea size in xml & swing. +- new NULL vs "" setting global+per entity +- date format list and edit per field. +- readonly field icm auto fill field from code/xml +- meta query xpql support +- page sum line +- total sum line +- graphs support +- mongo backend paging +- meta model backend paging +- mongo missing field == string gives; VascBackendProxySort$1.compare(VascBackendProxySort.java:102) +- disable i18n +- load FILE resource bundle (in xml?) +- make event channels work +- auto text converts +- Plugin validation +- Plugin Role Parser +- Finalizer plugins +- Check user roles in frontend +- Default/Full Table and templating +- Ckeck all validators +- Bind to x18n +- MetaQuery support +- create JSF-extJS frontend +- create XML-RPC frontend +- export interface + exports +- graphs of numeric value columns \ No newline at end of file diff --git a/vasc-backend/vasc-backend-metamodel/src/main/java/net/forwardfire/vasc/backend/metamodel/MetaModelDataContextJdbc.java b/vasc-backend/vasc-backend-metamodel/src/main/java/net/forwardfire/vasc/backend/metamodel/MetaModelDataContextJdbc.java new file mode 100644 index 0000000..56334c9 --- /dev/null +++ b/vasc-backend/vasc-backend-metamodel/src/main/java/net/forwardfire/vasc/backend/metamodel/MetaModelDataContextJdbc.java @@ -0,0 +1,90 @@ +package net.forwardfire.vasc.backend.metamodel; + +import java.sql.Connection; +import java.sql.DriverManager; + +import org.eobjects.metamodel.DataContext; +import org.eobjects.metamodel.jdbc.JdbcDataContext; + + +public class MetaModelDataContextJdbc implements MetaModelDataContextProvider { + + private String driverClass = null; + private String connectUrl = null; + private String username = null; + private String password = null; + + public DataContext getDataContext() { + JdbcDataContext dataContext = new JdbcDataContext(getConnection()); + return dataContext; + } + + public Connection getConnection() { + synchronized (this) { + try { + Class.forName(getDriverClass()); + Connection connection = DriverManager.getConnection(getConnectUrl(),getUsername(),getPassword()); + return connection; + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + } + + /** + * @return the username + */ + public String getUsername() { + return username; + } + + /** + * @param username the username to set + */ + public void setUsername(String username) { + this.username = username; + } + + /** + * @return the password + */ + public String getPassword() { + return password; + } + + /** + * @param password the password to set + */ + public void setPassword(String password) { + this.password = password; + } + + /** + * @return the connectUrl + */ + public String getConnectUrl() { + return connectUrl; + } + + /** + * @param connectUrl the connectUrl to set + */ + public void setConnectUrl(String connectUrl) { + this.connectUrl = connectUrl; + } + + /** + * @return the driverClass + */ + public String getDriverClass() { + return driverClass; + } + + /** + * @param driverClass the driverClass to set + */ + public void setDriverClass(String driverClass) { + this.driverClass = driverClass; + } +} diff --git a/vasc-backend/vasc-backend-metamodel/src/main/java/net/forwardfire/vasc/backend/metamodel/MetaModelDataContextMongodb.java b/vasc-backend/vasc-backend-metamodel/src/main/java/net/forwardfire/vasc/backend/metamodel/MetaModelDataContextMongodb.java index b58e7f3..ac91599 100644 --- a/vasc-backend/vasc-backend-metamodel/src/main/java/net/forwardfire/vasc/backend/metamodel/MetaModelDataContextMongodb.java +++ b/vasc-backend/vasc-backend-metamodel/src/main/java/net/forwardfire/vasc/backend/metamodel/MetaModelDataContextMongodb.java @@ -19,8 +19,8 @@ public class MetaModelDataContextMongodb implements MetaModelDataContextProvider private String password = null; private boolean readonly = false; - protected static Mongo mongo = null; - protected static DB db = null; + protected Mongo mongo = null; + //protected DB db = null; public DataContext getDataContext() { MongoDbDataContext dataContext = new MongoDbDataContext(getMongodbConnection()); @@ -28,9 +28,6 @@ public class MetaModelDataContextMongodb implements MetaModelDataContextProvider } public DB getMongodbConnection() { - if (db!=null) { - return db; - } synchronized (this) { ServerAddress server; try { @@ -40,7 +37,7 @@ public class MetaModelDataContextMongodb implements MetaModelDataContextProvider } MongoOptions options = new MongoOptions(); mongo = new Mongo(server,options); - db = mongo.getDB(database); + DB db = mongo.getDB(database); if (username!=null && password!=null) { boolean auth = db.authenticate(username, password.toCharArray()); if (auth==false) { @@ -50,9 +47,8 @@ public class MetaModelDataContextMongodb implements MetaModelDataContextProvider if (readonly) { db.setReadOnly(true); } - //logger.info("Connection to: "+db.getName()); + return db; } - return db; } /** diff --git a/vasc-backend/vasc-backend-metamodel/src/main/java/net/forwardfire/vasc/backend/metamodel/MetaModelVascBackend.java b/vasc-backend/vasc-backend-metamodel/src/main/java/net/forwardfire/vasc/backend/metamodel/MetaModelVascBackend.java index c683df7..7e80e8e 100644 --- a/vasc-backend/vasc-backend-metamodel/src/main/java/net/forwardfire/vasc/backend/metamodel/MetaModelVascBackend.java +++ b/vasc-backend/vasc-backend-metamodel/src/main/java/net/forwardfire/vasc/backend/metamodel/MetaModelVascBackend.java @@ -23,8 +23,9 @@ package net.forwardfire.vasc.backend.metamodel; import java.util.ArrayList; -import java.util.Arrays; +import java.util.Date; import java.util.HashMap; +import java.util.Iterator; import java.util.List; import java.util.Map; @@ -33,8 +34,11 @@ import org.eobjects.metamodel.UpdateScript; import org.eobjects.metamodel.UpdateableDataContext; import org.eobjects.metamodel.data.DataSet; import org.eobjects.metamodel.data.Row; +import org.eobjects.metamodel.insert.RowInsertionBuilder; import org.eobjects.metamodel.query.Query; import org.eobjects.metamodel.query.SelectItem; +import org.eobjects.metamodel.query.builder.SatisfiedQueryBuilder; +import org.eobjects.metamodel.query.builder.SatisfiedWhereBuilder; import org.eobjects.metamodel.schema.Schema; import org.eobjects.metamodel.schema.Table; import org.eobjects.metamodel.update.RowUpdationBuilder; @@ -74,7 +78,51 @@ public class MetaModelVascBackend extends AbstractVascBackend { UpdateableDataContext dataContext = getUpdateableDataContext(); Schema schema = dataContext.getDefaultSchema(); Table t = schema.getTableByName(table); - Query q = dataContext.query().from(t).select(t.getColumns()).toQuery(); + + Object qWhere = dataContext.query().from(t).select(t.getColumns()); + Iterator keys = state.getDataParameterKeys().iterator(); + boolean first = true; + while (keys.hasNext()) { + String key = keys.next(); + Object value = state.getDataParameter(key); /// TODO: redo this nasty code + if (value instanceof Number) { + if (first) { + qWhere = ((SatisfiedQueryBuilder)qWhere).where(key).equals((Number)value); + } else { + qWhere = ((SatisfiedWhereBuilder)qWhere).and(key).equals((Number)value); + } + } else if (value instanceof Date) { + if (first) { + qWhere = ((SatisfiedQueryBuilder)qWhere).where(key).equals((Date)value); + } else { + qWhere = ((SatisfiedWhereBuilder)qWhere).and(key).equals((Date)value); + } + } else if (value instanceof Boolean) { + if (first) { + qWhere = ((SatisfiedQueryBuilder)qWhere).where(key).equals((Boolean)value); + } else { + qWhere = ((SatisfiedWhereBuilder)qWhere).and(key).equals((Boolean)value); + } + } else { + if (value==null) { + if (first) { + qWhere = ((SatisfiedQueryBuilder)qWhere).where(key).isNull(); + } else { + qWhere = ((SatisfiedWhereBuilder)qWhere).and(key).isNull(); + } + } else { + if (first) { + qWhere = ((SatisfiedQueryBuilder)qWhere).where(key).equals(value.toString()); + } else { + qWhere = ((SatisfiedWhereBuilder)qWhere).and(key).equals(value.toString()); + } + } + } + first = false; + } + + + Query q = ((SatisfiedQueryBuilder)qWhere).toQuery(); DataSet ds = dataContext.executeQuery(q); List result = new ArrayList(50); while (ds.next()) { @@ -87,29 +135,25 @@ public class MetaModelVascBackend extends AbstractVascBackend { } result.add(map); } + ds.close(); return result; } + @SuppressWarnings("unchecked") public void persist(Object object) throws VascException { + final Map map = (Map)object; UpdateableDataContext dataContext = getUpdateableDataContext(); dataContext.executeUpdate(new UpdateScript() { public void run(UpdateCallback backendImpl) { - Table table = backendImpl.createTable(null, "some_entries").withColumn("foo").withColumn("bar") - .withColumn("baz").withColumn("list").execute(); - - backendImpl.insertInto(table).value("foo", 1).value("bar", "hello").execute(); - backendImpl.insertInto(table).value("foo", 2).value("bar", "world").execute(); - backendImpl.insertInto(table).value("foo", 3).value("bar", "hi").execute(); - - Map nestedObj = new HashMap(); - nestedObj.put("foo", "bar"); - nestedObj.put("123", 456); - - backendImpl.insertInto(table).value("foo", 4).value("bar", "there").value("baz", nestedObj) - .value("list", Arrays.asList(1, 2, 3)).execute(); + RowInsertionBuilder query = backendImpl.insertInto(table); + for (String key:map.keySet()) { + Object value = map.get(key); + query.value(key, value); + } + query.execute(); } - }); + }); } @SuppressWarnings("unchecked") @@ -118,8 +162,17 @@ public class MetaModelVascBackend extends AbstractVascBackend { UpdateableDataContext dataContext = getUpdateableDataContext(); dataContext.executeUpdate(new UpdateScript() { public void run(UpdateCallback backendImpl) { - RowUpdationBuilder query = backendImpl.update(table).where(tableId).equals(""+map.get(tableId)); + + RowUpdationBuilder query = null; + if (map.get(tableId) instanceof Number) { + query = backendImpl.update(table).where(tableId).equals((Number)map.get(tableId)); + } else { + query = backendImpl.update(table).where(tableId).equals(map.get(tableId).toString()); + } for (String key:map.keySet()) { + if (key.equals(tableId)) { + continue; // skip id; + } Object value = map.get(key); query.value(key, value); } @@ -135,7 +188,11 @@ public class MetaModelVascBackend extends AbstractVascBackend { UpdateableDataContext dataContext = getUpdateableDataContext(); dataContext.executeUpdate(new UpdateScript() { public void run(UpdateCallback backendImpl) { - backendImpl.deleteFrom(table).where(tableId).in(""+map.get(tableId)).execute(); + if (map.get(tableId) instanceof Number) { + backendImpl.deleteFrom(table).where(tableId).equals((Number)map.get(tableId)).execute(); + } else { + backendImpl.deleteFrom(table).where(tableId).equals(map.get(tableId).toString()).execute(); + } } }); } diff --git a/vasc-core/src/main/java/net/forwardfire/vasc/impl/ui/VascSelectItemModelEntry.java b/vasc-core/src/main/java/net/forwardfire/vasc/impl/ui/VascSelectItemModelEntry.java index 9855d55..1b1b1d6 100644 --- a/vasc-core/src/main/java/net/forwardfire/vasc/impl/ui/VascSelectItemModelEntry.java +++ b/vasc-core/src/main/java/net/forwardfire/vasc/impl/ui/VascSelectItemModelEntry.java @@ -169,12 +169,12 @@ public class VascSelectItemModelEntry implements VascSelectItemModel { for (Object o:back.execute(state)) { Object keyId = key.getVascEntryFieldValue().getValue(key, o); String nameId = dis.getVascEntryFieldValue().getDisplayValue(dis, o); - if (returnKeyValue!=null && true==returnKeyValue) { - VascSelectItem item = new VascSelectItem(nameId,keyId,""+keyId); + if (returnKeyValue!=null && false==returnKeyValue) { + VascSelectItem item = new VascSelectItem(nameId,o,""+keyId); result.add(item); } else { - VascSelectItem item = new VascSelectItem(nameId,o,""+keyId); - result.add(item); + VascSelectItem item = new VascSelectItem(nameId,keyId,""+keyId); // per default return keyID object. + result.add(item); } } } catch (Exception e) { diff --git a/vasc-demo/pom.xml b/vasc-demo/pom.xml index 3325983..965a98b 100644 --- a/vasc-demo/pom.xml +++ b/vasc-demo/pom.xml @@ -13,6 +13,6 @@ vasc-demo vasc-demo-petstore-j2ee5 - vasc-demo-swing + vasc-demo-tech \ No newline at end of file diff --git a/vasc-demo/vasc-demo-swing/src/main/java/net/forwardfire/vasc/demo/swing/JMainFrame.java b/vasc-demo/vasc-demo-swing/src/main/java/net/forwardfire/vasc/demo/swing/JMainFrame.java deleted file mode 100644 index 1b0761b..0000000 --- a/vasc-demo/vasc-demo-swing/src/main/java/net/forwardfire/vasc/demo/swing/JMainFrame.java +++ /dev/null @@ -1,640 +0,0 @@ -/* - * Copyright 2007-2012 forwardfire.net All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are permitted provided - * that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this list of conditions and the - * following disclaimer. - * * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and - * the following disclaimer in the documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package net.forwardfire.vasc.demo.swing; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Dimension; -import java.awt.Frame; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.io.File; - -import javax.swing.BorderFactory; -import javax.swing.JButton; -import javax.swing.JComboBox; -import javax.swing.JDialog; -import javax.swing.JFileChooser; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JMenuItem; -import javax.swing.JPanel; -import javax.swing.JTabbedPane; -import javax.swing.JTextField; -import javax.swing.JTree; -import javax.swing.SpringLayout; -import javax.swing.SwingUtilities; -import javax.swing.event.TreeModelListener; -import javax.swing.tree.DefaultMutableTreeNode; -import javax.swing.tree.DefaultTreeModel; -import javax.swing.tree.TreeNode; - -import org.eobjects.metamodel.DataContext; -import org.eobjects.metamodel.schema.Column; -import org.eobjects.metamodel.schema.Table; - -import net.forwardfire.vasc.backend.VascBackendControllerLocal; -import net.forwardfire.vasc.backend.VascBackendFilter; -import net.forwardfire.vasc.backend.metamodel.MetaModelDataContextCsv; -import net.forwardfire.vasc.backend.metamodel.MetaModelDataContextMongodb; -import net.forwardfire.vasc.backend.metamodel.MetaModelDataContextProvider; -import net.forwardfire.vasc.backend.metamodel.MetaModelVascBackend; -import net.forwardfire.vasc.core.VascController; -import net.forwardfire.vasc.core.VascEntry; -import net.forwardfire.vasc.core.VascEntryController; -import net.forwardfire.vasc.core.VascEntryControllerLocal; -import net.forwardfire.vasc.core.VascEntryField; -import net.forwardfire.vasc.core.VascEntryFieldSet; -import net.forwardfire.vasc.core.VascLinkEntry; -import net.forwardfire.vasc.frontends.swing.SwingPanelIntegration; -import net.forwardfire.vasc.frontends.swing.SwingPanelTabbed; -import net.forwardfire.vasc.impl.DefaultVascEntry; -import net.forwardfire.vasc.impl.DefaultVascEntryField; -import net.forwardfire.vasc.impl.DefaultVascFactory; -import net.forwardfire.vasc.validators.VascValidator; - -public class JMainFrame extends JFrame { - - VascManager vascManager = null; - SwingPanelIntegration spi = null; - JTabbedPane tabPane = null; - JTree vascTree = null; - JMenu fileMenu = new JMenu("File"); - JMenu connMenu = new JMenu("Connection"); - JMenu vascMenu = new JMenu("Entries"); - - public JMainFrame(VascManager vascManager ) { - this.vascManager=vascManager; - setTitle("Vasc Swing Demo"); - setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - setLocationRelativeTo(null); - - setLayout(new BorderLayout()); - add(createTreePane(), BorderLayout.LINE_START); - add(createContentPane(), BorderLayout.LINE_END); - add(createLogPane(), BorderLayout.PAGE_END); - - createMenuItems(); - JMenuBar menubar = new JMenuBar(); - menubar.add(fileMenu); - menubar.add(connMenu); - menubar.add(vascMenu); - - // view - setJMenuBar(menubar); - setMinimumSize(new Dimension(1111,888)); - pack(); - //setVisible(true); - - //spi.createNewVascView(ve); - } - - class VascTreeModel extends DefaultTreeModel { - public VascTreeModel(TreeNode root) { - super(root); - } - - private static final long serialVersionUID = -7436681803506994277L; - - @Override - public void addTreeModelListener(TreeModelListener l) { - super.addTreeModelListener(l); - } - } - - private JPanel createTreePane() { - - DefaultMutableTreeNode root = new DefaultMutableTreeNode(new VascTreeNode(VascTreeNodeType.NONE,null)); - - vascTree = new JTree(new VascTreeModel(root)); - vascTree.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent e) { - super.mouseClicked(e); - if (e.getClickCount() == 2 && vascTree.getSelectionModel().isSelectionEmpty()==false) { - try { - DefaultMutableTreeNode node = (DefaultMutableTreeNode)vascTree.getSelectionModel().getSelectionPath().getLastPathComponent(); - if (node.getUserObject() instanceof String) { - return; - } - VascTreeNode vascNode = (VascTreeNode)node.getUserObject(); - if (vascNode != null) { - if (vascNode.type == VascTreeNodeType.ENTRY) { - VascEntry ee = vascManager.getVascController().getVascEntryController().getVascEntryById(vascNode.id).clone(); - DefaultVascFactory.fillVascEntryFrontend(ee, vascManager.getVascController(), DefaultVascFactory.getDefaultVascFrontendData(null)); - spi.createNewVascView(ee); - } else if (vascNode.type == VascTreeNodeType.ENTRY_FIELD) { - VascEntryField vef = vascManager.getVascController().getVascEntryController().getVascEntryById(vascNode.entryId).getVascEntryFieldById(vascNode.id); - JDialogVascEntryField d = new JDialogVascEntryField(JMainFrame.this,vef); - d.setVisible(true); - } - } - } catch (Exception ee) { - ee.printStackTrace(); - } - } - } - }); - - JPanel treePanel = new JPanel(); - treePanel.setBorder(BorderFactory.createLineBorder(Color.PINK)); - treePanel.add(vascTree); - return treePanel; - } - - private JPanel createContentPane() { - JPanel contentPane = new JPanel(); - tabPane = new JTabbedPane(); - spi = new SwingPanelTabbed(tabPane); - contentPane.add(tabPane); - return contentPane; - } - - private JPanel createLogPane() { - JPanel logPanel = new JPanel(); - logPanel.add(new JLabel("log")); - return logPanel; - } - - class VascTreeNode { - public VascTreeNode() {} - public VascTreeNode(VascTreeNodeType type,String id) { this.type=type;this.id=id; } - public VascTreeNode(VascTreeNodeType type,String id,String entryId) { this.type=type;this.id=id;this.entryId=entryId; } - VascTreeNodeType type; - String id; - String entryId; - @Override - public String toString() { - return id; - } - - } - enum VascTreeNodeType { - NONE, - BACKEND, - ENTRY, - ENTRY_FIELD, - ENTRY_FIELD_SET - } - - private void rebuildTree() { - - DefaultMutableTreeNode root = (DefaultMutableTreeNode)vascTree.getModel().getRoot(); - root.removeAllChildren(); - - DefaultMutableTreeNode backends = new DefaultMutableTreeNode("VascBackends"); - for (String id:vascManager.getVascController().getVascBackendController().getVascBackendIds()) { - DefaultMutableTreeNode backendNode = new DefaultMutableTreeNode(new VascTreeNode(VascTreeNodeType.BACKEND,id)); - backends.add(backendNode); - } - root.add(backends); - - DefaultMutableTreeNode entries = new DefaultMutableTreeNode("VascEntries"); - for (String id:vascManager.getVascController().getVascEntryController().getVascEntryIds()) { - VascEntry ve = vascManager.getVascController().getVascEntryController().getVascEntryById(id); - DefaultMutableTreeNode entryNode = new DefaultMutableTreeNode(new VascTreeNode(VascTreeNodeType.ENTRY,id)); - entries.add(entryNode); - - DefaultMutableTreeNode fields = new DefaultMutableTreeNode("Fields"); - for (VascEntryField vef:ve.getVascEntryFields()) { - DefaultMutableTreeNode vefNode = new DefaultMutableTreeNode(new VascTreeNode(VascTreeNodeType.ENTRY_FIELD,vef.getId(),id)); - fields.add(vefNode); - - /* - DefaultMutableTreeNode validators = new DefaultMutableTreeNode("Validators"); - for (VascValidator vv:vef.getVascValidators()) { - DefaultMutableTreeNode vNode = new DefaultMutableTreeNode(new VascTreeNode(VascTreeNodeType.ENTRY_FIELD,vv.getClass().getSimpleName())); - validators.add(vNode); - } - vefNode.add(validators); - */ - } - entryNode.add(fields); - - DefaultMutableTreeNode fieldSets = new DefaultMutableTreeNode("FieldSets"); - for (VascEntryFieldSet vefs:ve.getVascEntryFieldSets()) { - DefaultMutableTreeNode vefsNode = new DefaultMutableTreeNode(new VascTreeNode(VascTreeNodeType.ENTRY_FIELD_SET,vefs.getId(),id)); - fieldSets.add(vefsNode); - } - entryNode.add(fieldSets); - - DefaultMutableTreeNode links = new DefaultMutableTreeNode("Links"); - for (VascLinkEntry vle:ve.getVascLinkEntries()) { - DefaultMutableTreeNode vefsNode = new DefaultMutableTreeNode(new VascTreeNode(VascTreeNodeType.ENTRY_FIELD_SET,vle.getId())); - links.add(vefsNode); - } - entryNode.add(links); - - DefaultMutableTreeNode filters = new DefaultMutableTreeNode("Backend Filters"); - for (VascBackendFilter vbf:ve.getVascBackendFilters()) { - DefaultMutableTreeNode vefsNode = new DefaultMutableTreeNode(new VascTreeNode(VascTreeNodeType.ENTRY_FIELD_SET,vbf.getClass().getSimpleName())); - filters.add(vefsNode); - } - entryNode.add(links); - - DefaultMutableTreeNode param = new DefaultMutableTreeNode("Backend Parameters"); - for (String key:ve.getEntryParameterKeys()) { - DefaultMutableTreeNode vefsNode = new DefaultMutableTreeNode(new VascTreeNode(VascTreeNodeType.ENTRY_FIELD_SET,key)); - param.add(vefsNode); - } - entryNode.add(param); - - - DefaultMutableTreeNode options = new DefaultMutableTreeNode("List Options"); - for (VascEntryField vef:ve.getListOptions()) { - DefaultMutableTreeNode vefsNode = new DefaultMutableTreeNode(new VascTreeNode(VascTreeNodeType.ENTRY_FIELD_SET,vef.getId())); - options.add(vefsNode); - } - entryNode.add(options); - } - root.add(entries); - - SwingUtilities.updateComponentTreeUI(vascTree); - } - - private void createMenuItems() { - JMenuItem openXmlItem = new JMenuItem("Open Xml"); - openXmlItem.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - try { - final JFileChooser fc = new JFileChooser(); - //fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); - int returnVal = fc.showOpenDialog((JMenuItem)e.getSource()); - if (returnVal == JFileChooser.APPROVE_OPTION) { - File file = fc.getSelectedFile(); - vascManager.openFile(file); - rebuildTree(); - } - } catch (Exception e1) { - e1.printStackTrace(); - } - } - - }); - fileMenu.add(openXmlItem); - JMenuItem closeXmlItem = new JMenuItem("Close"); - fileMenu.add(closeXmlItem); - fileMenu.addSeparator(); - JMenuItem exitItem = new JMenuItem("Exit"); - fileMenu.add(exitItem); - - JMenuItem connectVascItem = new JMenuItem("Add Vasc"); - connectVascItem.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - - } - }); - connMenu.add(connectVascItem); - - JMenuItem connectMongoItem = new JMenuItem("Connect Mongo"); - connectMongoItem.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - try { - - } catch (Exception e1) { - e1.printStackTrace(); - } - } - - }); - connMenu.add(connectMongoItem); - - JMenuItem connectPgItem = new JMenuItem("Add Postgres"); - connMenu.add(connectPgItem); - JMenuItem connectMysqlItem = new JMenuItem("Add Mysql"); - connMenu.add(connectMysqlItem); - JMenuItem connectLdapItem = new JMenuItem("Add Ldap"); - connMenu.add(connectLdapItem); - connMenu.addSeparator(); - JMenuItem connectMetaCsvItem = new JMenuItem("Add meta csv"); - connectMetaCsvItem.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - JDialogMetaCsv d = new JDialogMetaCsv(JMainFrame.this); - d.setVisible(true); - } - }); - connMenu.add(connectMetaCsvItem); - JMenuItem connectMetaXmlItem = new JMenuItem("Add meta xml"); - connMenu.add(connectMetaXmlItem); - JMenuItem connectMetaMongoItem = new JMenuItem("Add meta mongo"); - connectMetaMongoItem.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - JDialogMetaMongodb d = new JDialogMetaMongodb(JMainFrame.this); - d.setVisible(true); - } - }); - connMenu.add(connectMetaMongoItem); - JMenuItem connectMetaJdbcItem = new JMenuItem("Add meta jdbc"); - connMenu.add(connectMetaJdbcItem); - - /* - for (final String id:ve.getVascFrontendData().getVascController().getVascEntryController().getVascEntryIds()) { - JMenuItem item = new JMenuItem(id); - item.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - try { - VascEntry ee = ve.getVascFrontendData().getVascController().getVascEntryController().getVascEntryById(id).clone(); - DefaultVascFactory.fillVascEntryFrontend(ee, ve.getVascFrontendData().getVascController(), DefaultVascFactory.getDefaultVascFrontendData(null)); - spi.createNewVascView(ee); - } catch (Exception e1) { - e1.printStackTrace(); - } - } - - }); - vascMenu.add(item); - } - */ - - JMenuItem item = new JMenuItem("Close tab."); - item.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - if (tabPane.getSelectedIndex()>=0) { - tabPane.removeTabAt(tabPane.getSelectedIndex()); // todo release vasc frontend - } - } - - }); - vascMenu.add(item); - } - - public class JDialogMetaCsv extends JDialog implements ActionListener { - - private static final long serialVersionUID = -8638394652416472734L; - - public JDialogMetaCsv(Frame aFrame) { - setTitle("Add csv file"); - setMinimumSize(new Dimension(640,480)); - setPreferredSize(new Dimension(999,666)); - setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); - addWindowListener(new WindowAdapter() { - public void windowClosing(WindowEvent we) { - clearAndHide(); - } - }); - JPanel mainPanel = new JPanel(); - mainPanel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); - mainPanel.setLayout(new BorderLayout()); - //mainPanel.add(createPanelTop(),BorderLayout.NORTH); - mainPanel.add(createPanelCenter(),BorderLayout.CENTER); - //mainPanel.add(createPanelBottom(),BorderLayout.SOUTH); - getContentPane().add(mainPanel); - pack(); - setLocationRelativeTo(aFrame); - } - - public void clearAndHide() { - setVisible(false); - } - - public JPanel createPanelCenter() { - JPanel result = new JPanel(); - //result.setLayout(new SpringLayout()); - - result.add(new JLabel("File")); - JButton fileButton = new JButton("Open"); - fileButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - final JFileChooser fc = new JFileChooser(); - int returnVal = fc.showOpenDialog((JButton)e.getSource()); - if (returnVal == JFileChooser.APPROVE_OPTION) { - File file = fc.getSelectedFile(); - MetaModelDataContextCsv ds = new MetaModelDataContextCsv(); - ds.setFile(file.getAbsolutePath()); - createMetaEntry(ds,file.getName(),null); - } - } - }); - result.add(fileButton); - - return result; - } - - public void actionPerformed(ActionEvent arg0) { - // TODO Auto-generated method stub - - } - } - - public class JDialogMetaMongodb extends JDialog implements ActionListener { - - private static final long serialVersionUID = -8638394652416472734L; - private JTextField hostname = null; - private JTextField database = null; - - public JDialogMetaMongodb(Frame aFrame) { - setTitle("Add mongodb"); - setMinimumSize(new Dimension(800,600)); - setPreferredSize(new Dimension(999,666)); - setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); - addWindowListener(new WindowAdapter() { - public void windowClosing(WindowEvent we) { - clearAndHide(); - } - }); - JPanel mainPanel = new JPanel(); - mainPanel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); - mainPanel.setLayout(new BorderLayout()); - //mainPanel.add(createPanelTop(),BorderLayout.NORTH); - mainPanel.add(createPanelCenter(),BorderLayout.CENTER); - //mainPanel.add(createPanelBottom(),BorderLayout.SOUTH); - getContentPane().add(mainPanel); - pack(); - setLocationRelativeTo(aFrame); - } - - public void clearAndHide() { - setVisible(false); - } - - public JPanel createPanelCenter() { - JPanel result = new JPanel(); - //result.setLayout(new SpringLayout()); - - result.add(new JLabel("Hostname")); - hostname = new JTextField("localhost"); - result.add(hostname); - - result.add(new JLabel("Database")); - database = new JTextField("lefiona"); - result.add(database); - - JButton fileButton = new JButton("Connect"); - fileButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - MetaModelDataContextMongodb ds = new MetaModelDataContextMongodb(); - ds.setHostname(hostname.getText()); - ds.setDatabase(database.getText()); - DataContext metaDs = ds.getDataContext(); - for (String table:metaDs.getDefaultSchema().getTableNames()) { - createMetaEntry(ds,table,table); - } - } - }); - result.add(fileButton); - - return result; - } - - public void actionPerformed(ActionEvent arg0) { - // TODO Auto-generated method stub - - } - } - - - public class JDialogVascEntryField extends JDialog implements ActionListener { - - private static final long serialVersionUID = -8638394652416472734L; - private JButton okButton = null; - private JButton cancelButton = null; - private JTextField idField = null; - private JTextField backendNameField = null; - private JComboBox fieldTypeBox = null; - private VascEntryField field = null; - - public JDialogVascEntryField(Frame aFrame,VascEntryField field) { - this.field = field; - setTitle("Vasc Entry Field"); - setMinimumSize(new Dimension(800,600)); - setPreferredSize(new Dimension(999,666)); - setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); - addWindowListener(new WindowAdapter() { - public void windowClosing(WindowEvent we) { - clearAndHide(); - } - }); - JPanel mainPanel = new JPanel(); - mainPanel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); - mainPanel.setLayout(new BorderLayout()); - //mainPanel.add(createPanelTop(),BorderLayout.NORTH); - mainPanel.add(createPanelCenter(),BorderLayout.CENTER); - mainPanel.add(createPanelBottom(),BorderLayout.SOUTH); - getContentPane().add(mainPanel); - pack(); - setLocationRelativeTo(aFrame); - } - - public void clearAndHide() { - setVisible(false); - } - - public JPanel createPanelCenter() { - JPanel result = new JPanel(); - //result.setLayout(new SpringLayout()); - - result.add(new JLabel("id")); - idField = new JTextField(field.getId()); - result.add(idField); - - result.add(new JLabel("backendName")); - backendNameField = new JTextField(field.getBackendName()); - result.add(backendNameField); - - result.add(new JLabel("type")); - fieldTypeBox = new JComboBox(vascManager.getVascController().getVascEntryFieldTypeController().getVascEntryFieldTypeIds().toArray()); - fieldTypeBox.setSelectedItem(field.getVascEntryFieldType().getId()); - result.add(fieldTypeBox); - - return result; - } - - private JPanel createPanelBottom() { - JPanel result = new JPanel(); - okButton = new JButton("ok"); - okButton.addActionListener(this); - cancelButton = new JButton("cancel"); - cancelButton.addActionListener(this); - result.add(okButton); - result.add(cancelButton); - return result; - } - - public void actionPerformed(ActionEvent e) { - if (e.getSource()==cancelButton) { - clearAndHide(); - return; - } - if (e.getSource()==okButton) { - - VascEntryField vef = ((VascEntryControllerLocal)vascManager.getVascController().getVascEntryController()).getMasterVascEntryById(field.getVascEntry().getId()).getVascEntryFieldById(field.getId()); - vef.setVascEntryFieldType(vascManager.getVascController().getVascEntryFieldTypeController().getVascEntryFieldTypeById((String)fieldTypeBox.getSelectedItem())); - - clearAndHide(); - return; - } - } - } - - private void createMetaEntry(MetaModelDataContextProvider ds,String id,String tableName) { - DataContext metaDs = ds.getDataContext(); - Table metaTable = null; - if (tableName==null) { - metaTable = metaDs.getDefaultSchema().getTable(0); - } else { - metaTable = metaDs.getDefaultSchema().getTableByName(tableName); - } - Column[] keys = metaTable.getPrimaryKeys(); - Column[] cols = metaTable.getColumns(); - if (cols.length==0) { - return; // vasc needs at least one column - } - - MetaModelVascBackend backend = new MetaModelVascBackend(); - backend.setId(id+"_backend"); - backend.setDataContextProvider(ds); - backend.setTable(metaTable.getName()); - if (keys.length>0) { - backend.setTableId(keys[0].getName()); - } else { - backend.setTableId(cols[0].getName()); - //TODO backend.setRequestReadOnly(true); - } - - VascEntry ve = new DefaultVascEntry(); - ve.setId(id); - ve.setBackendId(id+"_backend"); - for (Column c:cols) { - VascEntryField vef = new DefaultVascEntryField(c.getName()); - vef.setVascEntryFieldType(vascManager.getVascController().getVascEntryFieldTypeController().getVascEntryFieldTypeByClass(c.getType().getJavaEquivalentClass())); - ve.addVascEntryField(vef); - } - - try { - ((VascBackendControllerLocal)vascManager.getVascController().getVascBackendController()).addVascBackend(backend); - ((VascEntryControllerLocal)vascManager.getVascController().getVascEntryController()).addVascEntry(ve, vascManager.getVascController()); - - // mm TODO rm this fill which adds the global actions ... and show updated tree in editor - DefaultVascFactory.fillVascControllerLocalEntries((VascEntryControllerLocal) vascManager.getVascController().getVascEntryController(), vascManager.getVascController()); - rebuildTree(); - } catch (Exception ee) { - ee.printStackTrace(); - } - } -} diff --git a/vasc-demo/vasc-demo-swing/src/main/java/net/forwardfire/vasc/demo/swing/SwingStartup.java b/vasc-demo/vasc-demo-swing/src/main/java/net/forwardfire/vasc/demo/swing/SwingStartup.java deleted file mode 100644 index b92ec82..0000000 --- a/vasc-demo/vasc-demo-swing/src/main/java/net/forwardfire/vasc/demo/swing/SwingStartup.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright 2007-2012 forwardfire.net All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are permitted provided - * that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this list of conditions and the - * following disclaimer. - * * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and - * the following disclaimer in the documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package net.forwardfire.vasc.demo.swing; - -import java.lang.reflect.Method; - -import net.forwardfire.vasc.core.VascEntry; -import net.forwardfire.vasc.core.VascEntryField; - -public class SwingStartup { - - private JMainFrame mainFrame = null; - private VascManager vascManager = null; - - - public static void main(String[] argu){ - try { - SwingStartup s = new SwingStartup(); - s.init(); - s.open(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - public void init() throws Exception { - vascManager = new VascManager(); - vascManager.start(); - - mainFrame = new JMainFrame(vascManager); - } - - public void open() throws Exception { - mainFrame.setVisible(true); - } - - - static void printEntry(VascEntry e) throws Exception { - - System.out.println(""); - System.out.println("=== Printing entry ==="); - System.out.println(""); - - for (Method m:e.getClass().getMethods()) { - if (m.getName().startsWith("get")==false) { //a bit dirty - continue; - } - if (m.getParameterTypes().length>0) { - continue; - } - System.out.println("prop: "+m.getName()+" -> "+m.invoke(e)); - } - - System.out.println(""); - System.out.println("=== Fields ==="); - for (VascEntryField vef:e.getVascEntryFields()) { - - System.out.println("=== Field: "+vef.getId()); - - for (Method m:vef.getClass().getMethods()) { - if (m.getName().startsWith("get")==false) { //a bit dirty - continue; - } - if (m.getParameterTypes().length>0) { - continue; - } - System.out.println("prop: "+m.getName()+" -> "+m.invoke(vef)); - } - } - } -} diff --git a/vasc-demo/vasc-demo-swing/src/main/java/net/forwardfire/vasc/demo/swing/VascManager.java b/vasc-demo/vasc-demo-swing/src/main/java/net/forwardfire/vasc/demo/swing/VascManager.java deleted file mode 100644 index cd4cddf..0000000 --- a/vasc-demo/vasc-demo-swing/src/main/java/net/forwardfire/vasc/demo/swing/VascManager.java +++ /dev/null @@ -1,62 +0,0 @@ -package net.forwardfire.vasc.demo.swing; - -import java.io.File; -import java.io.FileOutputStream; - -import net.forwardfire.vasc.core.VascController; -import net.forwardfire.vasc.core.VascEntryControllerLocal; -import net.forwardfire.vasc.core.VascException; -import net.forwardfire.vasc.impl.DefaultVascFactory; -import net.forwardfire.vasc.impl.x4o.VascParser; - -public class VascManager { - - VascController vascController = null; - - public VascManager() { - - } - - public void start() { - try { - vascController = DefaultVascFactory.getDefaultVascController(2288L,"forwardfire.net","user","admin"); - initEditor(); - } catch (VascException e) { - throw new RuntimeException(e); - } - } - - public void stop() { - } - - private void initEditor() { - try { - VascParser parser = new VascParser(vascController); - parser.addGlobalELBean("vascController", vascController); - parser.parseResource("net/forwardfire/vasc/demo/swing/example/vasc-edit.xml"); - - DefaultVascFactory.fillVascControllerLocalEntries((VascEntryControllerLocal) vascController.getVascEntryController(), vascController); - } catch (Exception e) { - e.printStackTrace(); - } - } - - - public void openFile(File file) { - try { - VascParser parser = new VascParser(vascController); - File f = File.createTempFile("test-vasc", ".xml"); - parser.setDebugOutputStream(new FileOutputStream(f)); - parser.parseFile(file.getAbsolutePath()); - - DefaultVascFactory.fillVascControllerLocalEntries((VascEntryControllerLocal) vascController.getVascEntryController(), vascController); - } catch (Exception e) { - e.printStackTrace(); - } - } - - - public VascController getVascController() { - return vascController; - } -} diff --git a/vasc-demo/vasc-demo-swing/src/main/resources/net/forwardfire/vasc/demo/swing/example/tables.xml b/vasc-demo/vasc-demo-swing/src/main/resources/net/forwardfire/vasc/demo/swing/example/tables.xml deleted file mode 100644 index 08665d3..0000000 --- a/vasc-demo/vasc-demo-swing/src/main/resources/net/forwardfire/vasc/demo/swing/example/tables.xml +++ /dev/null @@ -1,317 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/vasc-demo/vasc-demo-tech/.project b/vasc-demo/vasc-demo-tech/.project new file mode 100644 index 0000000..297b9a1 --- /dev/null +++ b/vasc-demo/vasc-demo-tech/.project @@ -0,0 +1,17 @@ + + + vasc-demo-tech + + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.m2e.core.maven2Nature + + diff --git a/vasc-demo/vasc-demo-tech/.settings/org.eclipse.core.resources.prefs b/vasc-demo/vasc-demo-tech/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..99f26c0 --- /dev/null +++ b/vasc-demo/vasc-demo-tech/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/vasc-demo/vasc-demo-swing/.settings/org.eclipse.m2e.core.prefs b/vasc-demo/vasc-demo-tech/.settings/org.eclipse.m2e.core.prefs similarity index 74% rename from vasc-demo/vasc-demo-swing/.settings/org.eclipse.m2e.core.prefs rename to vasc-demo/vasc-demo-tech/.settings/org.eclipse.m2e.core.prefs index d4fef1c..f897a7f 100644 --- a/vasc-demo/vasc-demo-swing/.settings/org.eclipse.m2e.core.prefs +++ b/vasc-demo/vasc-demo-tech/.settings/org.eclipse.m2e.core.prefs @@ -1,4 +1,3 @@ -#Sat Dec 31 00:34:57 CET 2011 activeProfiles= eclipse.preferences.version=1 resolveWorkspaceProjects=true diff --git a/vasc-demo/vasc-demo-tech/pom.xml b/vasc-demo/vasc-demo-tech/pom.xml new file mode 100644 index 0000000..99213d3 --- /dev/null +++ b/vasc-demo/vasc-demo-tech/pom.xml @@ -0,0 +1,19 @@ + + 4.0.0 + + vasc-demo + net.forwardfire.vasc.demo + 0.3.5-SNAPSHOT + .. + + vasc-demo-tech + pom + vasc-demo-tech + vasc-demo-tech + + vasc-demo-tech-build + vasc-demo-tech-editor + vasc-demo-tech-web + vasc-demo-tech-ui + + \ No newline at end of file diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-build/.project b/vasc-demo/vasc-demo-tech/vasc-demo-tech-build/.project new file mode 100644 index 0000000..5a8d1fa --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-build/.project @@ -0,0 +1,17 @@ + + + vasc-demo-tech-build + + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.m2e.core.maven2Nature + + diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-build/.settings/org.eclipse.core.resources.prefs b/vasc-demo/vasc-demo-tech/vasc-demo-tech-build/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..99f26c0 --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-build/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-build/.settings/org.eclipse.m2e.core.prefs b/vasc-demo/vasc-demo-tech/vasc-demo-tech-build/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..f897a7f --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-build/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-build/pom.xml b/vasc-demo/vasc-demo-tech/vasc-demo-tech-build/pom.xml new file mode 100644 index 0000000..1591e3e --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-build/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + + vasc-demo-tech + net.forwardfire.vasc.demo + 0.3.5-SNAPSHOT + .. + + vasc-demo-tech-build + pom + vasc-demo-tech-build + vasc-demo-tech-build + + + + org.apache.maven.plugins + maven-assembly-plugin + + gnu + + + + ui-dist-assembly + package + + single + + + + src/main/assembly/bin.xml + + + + + + + + + + net.forwardfire.vasc.demo + vasc-demo-tech-ui + ${project.version} + + + \ No newline at end of file diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-build/src/main/assembly/bin.xml b/vasc-demo/vasc-demo-tech/vasc-demo-tech-build/src/main/assembly/bin.xml new file mode 100644 index 0000000..a4ef952 --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-build/src/main/assembly/bin.xml @@ -0,0 +1,62 @@ + + + + bin + + tar.gz + tar.bz2 + zip + + true + vasc-demo-tech-${project.version} + + + /lib + false + false + runtime + + * + + + + + + ${project.parent.parent.parent.basedir} + / + + authors.txt + licence.txt + + + + + ${project.basedir}/src/main/scripts/ + / + 755 + + + \ No newline at end of file diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-build/src/main/scripts/run.bat b/vasc-demo/vasc-demo-tech/vasc-demo-tech-build/src/main/scripts/run.bat new file mode 100644 index 0000000..98faaaa --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-build/src/main/scripts/run.bat @@ -0,0 +1,38 @@ +:: +:: Copyright (c) 2011, Willem Cazander +:: All rights reserved. +:: +:: Redistribution and use in source and binary forms, with or without modification, are permitted provided +:: that the following conditions are met: +:: +:: * Redistributions of source code must retain the above copyright notice, this list of conditions and the +:: following disclaimer. +:: * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +:: the following disclaimer in the documentation and/or other materials provided with the distribution. +:: +:: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY +:: EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +:: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +:: THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +:: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT +:: OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +:: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR +:: TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +:: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +:: +@echo off +setlocal enableextensions + +:: Run in app dir +cd /d %~dp0 + +:: Config variables +set JAVA_OPTS=-Xms64m -Xmx256m +set MAIN_CLASS=net.forwardfire.vasc.demo.tech.ui.TechUI +set CP=lib\* + +:: Launch application +java %JAVA_OPTS% -cp "%CP%" %MAIN_CLASS% + +endlocal +:: EOF diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-build/src/main/scripts/run.sh b/vasc-demo/vasc-demo-tech/vasc-demo-tech-build/src/main/scripts/run.sh new file mode 100644 index 0000000..237670d --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-build/src/main/scripts/run.sh @@ -0,0 +1,38 @@ +#!/bin/sh +# +# Copyright (c) 2011, Willem Cazander +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, are permitted provided +# that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this list of conditions and the +# following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +# the following disclaimer in the documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +# THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT +# OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR +# TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +# Run in app dir +cd `dirname $0`; + +# Config variables +JAVA="java"; +JAVA_OPTS="-Xms64m -Xmx256m"; +MAIN_CLASS="net.forwardfire.vasc.demo.tech.ui.TechUI"; +CP=`echo lib/*.jar | sed 's/ /:/g'`; + +# Launch application +$JAVA $JAVA_OPTS -cp $CP $MAIN_CLASS; + +# EOF + diff --git a/vasc-demo/vasc-demo-swing/.classpath b/vasc-demo/vasc-demo-tech/vasc-demo-tech-editor/.classpath similarity index 100% rename from vasc-demo/vasc-demo-swing/.classpath rename to vasc-demo/vasc-demo-tech/vasc-demo-tech-editor/.classpath diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-editor/.project b/vasc-demo/vasc-demo-tech/vasc-demo-tech-editor/.project new file mode 100644 index 0000000..fc7ef40 --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-editor/.project @@ -0,0 +1,23 @@ + + + vasc-demo-tech-editor + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/vasc-demo/vasc-demo-swing/.settings/org.eclipse.core.resources.prefs b/vasc-demo/vasc-demo-tech/vasc-demo-tech-editor/.settings/org.eclipse.core.resources.prefs similarity index 86% rename from vasc-demo/vasc-demo-swing/.settings/org.eclipse.core.resources.prefs rename to vasc-demo/vasc-demo-tech/vasc-demo-tech-editor/.settings/org.eclipse.core.resources.prefs index efe1633..29abf99 100644 --- a/vasc-demo/vasc-demo-swing/.settings/org.eclipse.core.resources.prefs +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-editor/.settings/org.eclipse.core.resources.prefs @@ -1,4 +1,3 @@ -#Sat Dec 31 00:55:10 CET 2011 eclipse.preferences.version=1 encoding//src/main/java=UTF-8 encoding//src/main/resources=UTF-8 diff --git a/vasc-demo/vasc-demo-swing/.settings/org.eclipse.jdt.core.prefs b/vasc-demo/vasc-demo-tech/vasc-demo-tech-editor/.settings/org.eclipse.jdt.core.prefs similarity index 88% rename from vasc-demo/vasc-demo-swing/.settings/org.eclipse.jdt.core.prefs rename to vasc-demo/vasc-demo-tech/vasc-demo-tech-editor/.settings/org.eclipse.jdt.core.prefs index 9f32b97..abec6ca 100644 --- a/vasc-demo/vasc-demo-swing/.settings/org.eclipse.jdt.core.prefs +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-editor/.settings/org.eclipse.jdt.core.prefs @@ -1,4 +1,3 @@ -#Sat Dec 31 00:34:57 CET 2011 eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 org.eclipse.jdt.core.compiler.compliance=1.5 diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-editor/.settings/org.eclipse.m2e.core.prefs b/vasc-demo/vasc-demo-tech/vasc-demo-tech-editor/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..f897a7f --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-editor/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-editor/pom.xml b/vasc-demo/vasc-demo-tech/vasc-demo-tech-editor/pom.xml new file mode 100644 index 0000000..87d658d --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-editor/pom.xml @@ -0,0 +1,12 @@ + + 4.0.0 + + vasc-demo-tech + net.forwardfire.vasc.demo + 0.3.5-SNAPSHOT + .. + + vasc-demo-tech-editor + vasc-demo-tech-editor + vasc-demo-tech-editor + \ No newline at end of file diff --git a/vasc-demo/vasc-demo-swing/src/main/resources/net/forwardfire/vasc/demo/swing/example/vasc-edit.xml b/vasc-demo/vasc-demo-tech/vasc-demo-tech-editor/src/main/resources/net/forwardfire/vasc/editor/vasc-edit.xml similarity index 100% rename from vasc-demo/vasc-demo-swing/src/main/resources/net/forwardfire/vasc/demo/swing/example/vasc-edit.xml rename to vasc-demo/vasc-demo-tech/vasc-demo-tech-editor/src/main/resources/net/forwardfire/vasc/editor/vasc-edit.xml diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/.classpath b/vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/.classpath new file mode 100644 index 0000000..3c96d64 --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/vasc-demo/vasc-demo-swing/.project b/vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/.project similarity index 94% rename from vasc-demo/vasc-demo-swing/.project rename to vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/.project index e73e136..2989afe 100644 --- a/vasc-demo/vasc-demo-swing/.project +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/.project @@ -1,6 +1,6 @@ - vasc-demo-swing + vasc-demo-tech-ui diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/.settings/org.eclipse.core.resources.prefs b/vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..29abf99 --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,6 @@ +eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding//src/main/resources=UTF-8 +encoding//src/test/java=UTF-8 +encoding//src/test/resources=UTF-8 +encoding/=UTF-8 diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/.settings/org.eclipse.jdt.core.prefs b/vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..abec6ca --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,5 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.5 diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/.settings/org.eclipse.m2e.core.prefs b/vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..f897a7f --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/vasc-demo/vasc-demo-swing/pom.xml b/vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/pom.xml similarity index 64% rename from vasc-demo/vasc-demo-swing/pom.xml rename to vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/pom.xml index bb32c4a..071faa7 100644 --- a/vasc-demo/vasc-demo-swing/pom.xml +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/pom.xml @@ -1,15 +1,25 @@ 4.0.0 - vasc-demo + vasc-demo-tech net.forwardfire.vasc.demo 0.3.5-SNAPSHOT .. - vasc-demo-swing - vasc-demo-swing - vasc-demo-swing + vasc-demo-tech-ui + vasc-demo-tech-ui + vasc-demo-tech-ui + + net.forwardfire.vasc.demo + vasc-demo-tech-editor + ${project.version} + + + net.forwardfire.vasc.demo + vasc-demo-tech-web + ${project.version} + net.forwardfire.vasc vasc-core @@ -41,9 +51,15 @@ ${project.version} - de.odysseus.juel - juel - ${juel.version} + org.jdesktop.bsaf + bsaf + ${bsaf.version} + + + jnlp + javax.jnlp + + postgresql @@ -55,5 +71,10 @@ mysql-connector-java 5.1.19 + + org.slf4j + slf4j-jdk14 + 1.6.4 + \ No newline at end of file diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/src/main/java/net/forwardfire/vasc/demo/tech/ui/PatternLogFormatter.java b/vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/src/main/java/net/forwardfire/vasc/demo/tech/ui/PatternLogFormatter.java new file mode 100644 index 0000000..996cc82 --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/src/main/java/net/forwardfire/vasc/demo/tech/ui/PatternLogFormatter.java @@ -0,0 +1,134 @@ +/* + * Copyright (c) 2011, Willem Cazander + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted provided + * that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this list of conditions and the + * following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and + * the following disclaimer in the documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package net.forwardfire.vasc.demo.tech.ui; + +import java.io.PrintWriter; +import java.io.StringWriter; +import java.text.DateFormat; +import java.text.MessageFormat; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.logging.Formatter; +import java.util.logging.LogManager; +import java.util.logging.LogRecord; + +/** + * PatternLogFormatter Formats the messages of the logger. + * + * @author Willem Cazander + */ +public class PatternLogFormatter extends Formatter { + + private final String lineSeperator; + private final MessageFormat logFormat; + private final MessageFormat logErrorFormat; + private final DateFormat dateFormat; + static private final String DEFAULT_LOG_FORMAT = "%d %l [%C.%s] %m%r"; + static private final String DEFAULT_LOG_ERROR_FORMAT = "%d %l [%C.%s] %m%r%S"; + static private final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss"; + static private final String[] LOG_OPTIONS = { + "%d", /* Formated date string */ + "%l", /* Logger level */ + "%n", /* Logger name */ + "%m", /* Logger message */ + "%t", /* Thread ID */ + "%s", /* Source method */ + "%c", /* Source Class */ + "%C", /* Source Class Simple */ + "%S", /* Stacktrace */ + "%r", /* Return/newline */ + }; + + public PatternLogFormatter() { + String logFormatStr = LogManager.getLogManager().getProperty(getClass().getName()+".log_pattern"); + String logFormatErrorStr = LogManager.getLogManager().getProperty(getClass().getName()+".log_error_pattern"); + String logDateStr = LogManager.getLogManager().getProperty(getClass().getName()+".date_pattern"); + + if (logDateStr!=null && logDateStr.isEmpty()==false) { + dateFormat = new SimpleDateFormat(logDateStr); + } else { + dateFormat = new SimpleDateFormat(DEFAULT_DATE_FORMAT); + } + + if (logFormatStr==null || logFormatStr.isEmpty()) { + logFormatStr = DEFAULT_LOG_FORMAT; + } + if (logFormatStr.contains("{") || logFormatStr.contains("}")) { + throw new IllegalArgumentException("Curly braces not allowed in log pattern."); + } + for (int i=0;i 0 && dotIdx < logFields[6].length()) { + logFields[7] = logFields[6].substring(dotIdx); + } else { + logFields[7] = logFields[6]; + } + logFields[8] = record.getThrown()!=null ? createStackTrace(record.getThrown()) : ""; + logFields[9] = lineSeperator; + synchronized (logFormat) { + logFields[0] = dateFormat.format(new Date(record.getMillis())); // dateFormat is guarded by the logFormat lock. + if (record.getThrown()==null) { + return logFormat.format(logFields); + } else { + return logErrorFormat.format(logFields); + } + } + } + + private String createStackTrace(Throwable t) { + StringWriter buf = new StringWriter(); + t.printStackTrace(new PrintWriter(buf)); + return buf.getBuffer().toString(); + } +} diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/src/main/java/net/forwardfire/vasc/demo/tech/ui/TechUI.java b/vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/src/main/java/net/forwardfire/vasc/demo/tech/ui/TechUI.java new file mode 100644 index 0000000..51d2240 --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/src/main/java/net/forwardfire/vasc/demo/tech/ui/TechUI.java @@ -0,0 +1,187 @@ +/* + * Copyright 2007-2012 forwardfire.net All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted provided + * that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this list of conditions and the + * following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and + * the following disclaimer in the documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package net.forwardfire.vasc.demo.tech.ui; + +import java.awt.Dimension; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.EventObject; +import java.util.logging.Handler; +import java.util.logging.LogManager; +import java.util.logging.Logger; + +import javax.swing.JOptionPane; +import javax.swing.SwingUtilities; + +import org.apache.juli.logging.LogFactory; +import org.jdesktop.application.Application; +import org.jdesktop.application.FrameView; +import org.jdesktop.application.SingleFrameApplication; + +import net.forwardfire.vasc.demo.tech.ui.components.JMainPanel; +import net.forwardfire.vasc.demo.tech.ui.components.JMainPanelMenuBar; +import net.forwardfire.vasc.demo.tech.web.core.TomcatManager; + +public class TechUI extends SingleFrameApplication { + + private Logger logger = null; + private VascManager vascManager = null; + private TomcatManager tomcatManager = null; + + static public void main(String[] args) { + Application.launch(TechUI.class, args); + + } + + /** + * Config logging and setup logger object. + */ + private void setupLogging() { + + LogFactory.getLog(TechUI.class); // init JULI so reconfig is done once. + + File logConfig = new File("logfile.properties"); + if (logConfig.exists()) { + InputStream in = null; + try { + in = new FileInputStream(logConfig); + LogManager.getLogManager().readConfiguration(in); + } catch (Exception e) { + e.printStackTrace(); + } finally { + if (in!=null) { + try { + in.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + } else { + Logger rootLogger = Logger.getAnonymousLogger(); + while (rootLogger.getParent()!=null) { + rootLogger = rootLogger.getParent(); + } + for (Handler h:rootLogger.getHandlers()) { + h.setFormatter(new PatternLogFormatter()); + } + } + logger = Logger.getLogger(TechUI.class.getName()); + } + + class ShutdownManager implements ExitListener { + public boolean canExit(EventObject e) { + return true; + } + public void willExit(EventObject event) { + logger.info("Shutdown requested."); + long startTime = System.currentTimeMillis(); + try { + tomcatManager.stop(); + } catch (Exception e) { + e.printStackTrace(); + } + long stopTime = System.currentTimeMillis(); + logger.info("TechUI stopped in "+(stopTime-startTime)+" ms."); + } + } + + private void autoLoadVasc() { + File autoLoadDir = new File("auto"); + if (autoLoadDir.exists()==false) { + return; + } + for (File file:autoLoadDir.listFiles()) { + if (file.canRead()==false) { + continue; + } + if (file.getName().endsWith("xml")==false) { + continue; + } + vascManager.openFile(file); + } + } + + protected void initialize(String[] args) { + long startTime = System.currentTimeMillis(); + setupLogging(); + logger.info("Starting Vasc-Demo-Tech-UI."); + vascManager = new VascManager(); + vascManager.start(); + autoLoadVasc(); + + long stopTime = System.currentTimeMillis(); + logger.info("TechUI initialized in "+(stopTime-startTime)+" ms."); + } + + protected void startup() { + try { + long startTime = System.currentTimeMillis(); + addExitListener(new ShutdownManager()); + + FrameView mainView = getMainView(); + mainView.setComponent(new JMainPanel()); + mainView.setMenuBar(new JMainPanelMenuBar()); + mainView.getFrame().setMinimumSize(new Dimension(1024-64,768-128)); + show(mainView); + + tomcatManager = new TomcatManager(); + tomcatManager.setVascController(vascManager.getVascController()); + + SwingUtilities.invokeLater(new Runnable() { + public void run() { + try { + tomcatManager.start(); + } catch (Exception e) { + e.printStackTrace(); + } + } + }); + + + + long stopTime = System.currentTimeMillis(); + logger.info("TechUI startup in "+(stopTime-startTime)+" ms total startup in "+(stopTime-startTime)+" ms."); + } catch (Exception e) { + StringWriter sw = new StringWriter(); + e.printStackTrace(new PrintWriter(sw)); + JOptionPane.showMessageDialog(null, "Fatal Startup Error:\n"+sw.getBuffer().toString(), "Vasc Demo Tech Startup Error", JOptionPane.ERROR_MESSAGE); + e.printStackTrace(); + System.exit(1); + } + } + + + + static public TechUI getInstance() { + return getInstance(TechUI.class); + } + + public VascManager getVascManager() { + return vascManager; + } +} diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/src/main/java/net/forwardfire/vasc/demo/tech/ui/VascManager.java b/vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/src/main/java/net/forwardfire/vasc/demo/tech/ui/VascManager.java new file mode 100644 index 0000000..dbeb5ca --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/src/main/java/net/forwardfire/vasc/demo/tech/ui/VascManager.java @@ -0,0 +1,292 @@ +package net.forwardfire.vasc.demo.tech.ui; + +import java.io.File; +import java.io.FileOutputStream; +import java.lang.reflect.Method; +import java.util.logging.Logger; + +import org.eobjects.metamodel.DataContext; +import org.eobjects.metamodel.schema.Column; +import org.eobjects.metamodel.schema.Relationship; +import org.eobjects.metamodel.schema.Table; + +import net.forwardfire.vasc.backend.VascBackendControllerLocal; +import net.forwardfire.vasc.backend.metamodel.MetaModelDataContextProvider; +import net.forwardfire.vasc.backend.metamodel.MetaModelVascBackend; +import net.forwardfire.vasc.core.VascController; +import net.forwardfire.vasc.core.VascEntry; +import net.forwardfire.vasc.core.VascEntryControllerLocal; +import net.forwardfire.vasc.core.VascEntryField; +import net.forwardfire.vasc.core.VascException; +import net.forwardfire.vasc.core.VascLinkEntry; +import net.forwardfire.vasc.core.VascLinkEntryType; +import net.forwardfire.vasc.demo.tech.ui.components.JMainPanel; +import net.forwardfire.vasc.impl.DefaultVascEntry; +import net.forwardfire.vasc.impl.DefaultVascEntryField; +import net.forwardfire.vasc.impl.DefaultVascFactory; +import net.forwardfire.vasc.impl.DefaultVascLinkEntry; +import net.forwardfire.vasc.impl.ui.VascSelectItemModelEntry; +import net.forwardfire.vasc.impl.x4o.VascParser; + +public class VascManager { + + private Logger logger = null; + private VascController vascController = null; + + public VascManager() { + logger = Logger.getLogger(VascManager.class.getName()); + } + + public void start() { + try { + vascController = DefaultVascFactory.getDefaultVascController(2288L,"forwardfire.net","user","admin"); + initEditor(); + } catch (VascException e) { + throw new RuntimeException(e); + } + } + + public void stop() { + vascController = null; + logger.info("Stop manager, cleared all."); + } + + private void initEditor() { + try { + VascParser parser = new VascParser(vascController); + parser.addGlobalELBean("vascController", vascController); + parser.parseResource("net/forwardfire/vasc/editor/vasc-edit.xml"); + + DefaultVascFactory.fillVascControllerLocalEntries((VascEntryControllerLocal) vascController.getVascEntryController(), vascController); + } catch (Exception e) { + e.printStackTrace(); + } + } + + + public void openFile(File file) { + try { + VascParser parser = new VascParser(vascController); + File f = File.createTempFile("test-vasc", ".xml"); + parser.setDebugOutputStream(new FileOutputStream(f)); + parser.parseFile(file.getAbsolutePath()); + + DefaultVascFactory.fillVascControllerLocalEntries((VascEntryControllerLocal) vascController.getVascEntryController(), vascController); + } catch (Exception e) { + e.printStackTrace(); + } + } + + + public VascController getVascController() { + return vascController; + } + + public void printEntries() { + try { + for (String key:getVascController().getVascEntryController().getVascEntryIds()) { + VascEntry ve = getVascController().getVascEntryController().getVascEntryById(key); + printEntry(ve); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + private void printEntry(VascEntry e) throws Exception { + + System.out.println(""); + System.out.println("=== Printing entry ==="); + System.out.println(""); + + for (Method m:e.getClass().getMethods()) { + if (m.getName().startsWith("get")==false) { //a bit dirty + continue; + } + if (m.getParameterTypes().length>0) { + continue; + } + System.out.println("prop: "+m.getName()+" -> "+m.invoke(e)); + } + + System.out.println(""); + System.out.println("=== Fields ==="); + for (VascEntryField vef:e.getVascEntryFields()) { + + System.out.println("=== Field: "+vef.getId()); + + for (Method m:vef.getClass().getMethods()) { + if (m.getName().startsWith("get")==false) { //a bit dirty + continue; + } + if (m.getParameterTypes().length>0) { + continue; + } + System.out.println("prop: "+m.getName()+" -> "+m.invoke(vef)); + } + } + } + + + public void createMetaEntry(MetaModelDataContextProvider ds,String id,String tableName) { + logger.info("Creating entry id: "+id+" of table: "+tableName); + DataContext metaDs = ds.getDataContext(); + Table metaTable = null; + if (tableName==null) { + metaTable = metaDs.getDefaultSchema().getTable(0); + } else { + metaTable = metaDs.getDefaultSchema().getTableByName(tableName); + } + Column[] keys = metaTable.getPrimaryKeys(); + Column[] cols = metaTable.getColumns(); + if (cols.length==0) { + return; // vasc needs at least one column + } + + MetaModelVascBackend backend = new MetaModelVascBackend(); + backend.setId(id+"_backend"); + backend.setDataContextProvider(ds); + backend.setTable(metaTable.getName()); + if (keys.length>0) { + backend.setTableId(keys[0].getName()); + } else { + backend.setTableId(cols[0].getName()); + //TODO backend.setRequestReadOnly(true); + } + + VascEntry ve = new DefaultVascEntry(); + ve.setId(id); + ve.setBackendId(id+"_backend"); + ve.setPrimaryKeyFieldId(backend.getTableId()); + createFields(ve,cols); + + for (Relationship rs:metaTable.getRelationships()) { + logger.finer("Found relation FT: "+rs.getForeignTable().getName()+" PT: "+rs.getPrimaryTable().getName()); + if (tableName.equals(rs.getForeignTable().getName())==false) { + logger.info("Creating Link entry for: "+rs.getForeignColumns()[0].getName()+" of table: "+rs.getForeignTable().getName()); + createLinkEntry(ds,rs,ve,metaTable,id+"_"+rs.getForeignTable().getName()+"_"+rs.getForeignColumns()[0].getName()+"_link"); + } else { + logger.info("Creating List entry for: "+rs.getPrimaryColumns()[0].getName()+" of table: "+rs.getPrimaryTable().getName()); + createListEntry(ds,rs,ve,metaTable,id+"_"+rs.getPrimaryTable().getName()+"_"+rs.getPrimaryColumns()[0].getName()+"_list"); + } + } + + try { + ((VascBackendControllerLocal)getVascController().getVascBackendController()).addVascBackend(backend); + ((VascEntryControllerLocal)getVascController().getVascEntryController()).addVascEntry(ve, getVascController()); + + // mm TODO rm this fill which adds the global actions ... and show updated tree in editor + DefaultVascFactory.fillVascControllerLocalEntries((VascEntryControllerLocal) getVascController().getVascEntryController(), getVascController()); + //rebuildTree(); + ((JMainPanel)TechUI.getInstance().getMainView().getComponent()).rebuildTree(); + } catch (Exception ee) { + ee.printStackTrace(); + } + } + + private void createLinkEntry(MetaModelDataContextProvider ds,Relationship rs2,VascEntry ve,Table metaTable,String id) { + MetaModelVascBackend backendLink = new MetaModelVascBackend(); + backendLink.setId(id+"_backend"); + backendLink.setDataContextProvider(ds); + backendLink.setTable(rs2.getForeignTable().getName()); + + Column[] keys = rs2.getForeignTable().getPrimaryKeys(); + Column[] cols = rs2.getForeignTable().getColumns(); + if (cols.length==0) { + return; + } + if (keys.length>0) { + backendLink.setTableId(keys[0].getName()); + } else { + backendLink.setTableId(cols[0].getName()); + } + + VascEntry veLink = new DefaultVascEntry(); + veLink.setId(id); + veLink.setBackendId(id+"_backend"); + veLink.setPrimaryKeyFieldId(backendLink.getTableId()); + createFields(veLink,cols); + + for (Relationship rs:rs2.getForeignTable().getRelationships()) { + logger.finer("Found relation FT: "+rs.getForeignTable().getName()+" PT: "+rs.getPrimaryTable().getName()); + if (rs2.getForeignTable().getName().equals(rs.getForeignTable().getName())==false) { + //logger.info("Creating Link entry for: "+rs.getForeignColumns()[0].getName()+" of table: "+rs.getForeignTable().getName()); + //createLinkEntry(ds,rs,ve,rs2.getForeignTable(),id+"_"+rs.getForeignTable().getName()+"_"+rs.getForeignColumns()[0].getName()+"_link"); + } else { + logger.info("Creating List entry for: "+rs.getPrimaryColumns()[0].getName()+" of table: "+rs.getPrimaryTable().getName()); + createListEntry(ds,rs,veLink,rs2.getForeignTable(),id+"_"+rs.getPrimaryTable().getName()+"_"+rs.getPrimaryColumns()[0].getName()+"_list"); + } + } + + try { + ((VascBackendControllerLocal)getVascController().getVascBackendController()).addVascBackend(backendLink); + ((VascEntryControllerLocal)getVascController().getVascEntryController()).addVascEntry(veLink, getVascController()); + + VascLinkEntry vle = new DefaultVascLinkEntry(); + vle.setId(id+"Link"); + vle.setVascLinkEntryType(VascLinkEntryType.DEFAULT_TYPE); + vle.setVascEntryId(id); + vle.addEntryParameterFieldId(rs2.getForeignColumns()[0].getName(), rs2.getPrimaryColumns()[0].getName()); + + ve.addVascLinkEntry(vle); + + } catch (Exception e) { + e.printStackTrace(); + } + } + + private void createListEntry(MetaModelDataContextProvider ds,Relationship rs,VascEntry ve,Table metaTable,String id) { + MetaModelVascBackend backendLink = new MetaModelVascBackend(); + backendLink.setId(id+"_backend"); + backendLink.setDataContextProvider(ds); + backendLink.setTable(rs.getPrimaryTable().getName()); + + Column[] keys = rs.getPrimaryTable().getPrimaryKeys(); + Column[] cols = rs.getPrimaryTable().getColumns(); + if (cols.length==0) { + return; + } + if (keys.length>0) { + backendLink.setTableId(keys[0].getName()); + } else { + backendLink.setTableId(cols[0].getName()); + } + VascEntry veLink = new DefaultVascEntry(); + veLink.setId(id); + veLink.setBackendId(id+"_backend"); + veLink.setPrimaryKeyFieldId(backendLink.getTableId()); + createFields(veLink,cols); + try { + VascEntryField vef = ve.getVascEntryFieldById(rs.getForeignColumns()[0].getName()); + if (vef==null) { + logger.warning("Could not find: "+rs.getForeignColumns()[0].getName()+" in ve: "+ve.getId()); + return; + } + vef.setVascEntryFieldType(getVascController().getVascEntryFieldTypeController().getVascEntryFieldTypeById("ListField")); + + VascSelectItemModelEntry itemModel = new VascSelectItemModelEntry(); + itemModel.setEntryId(veLink.getId()); + itemModel.setDisplayFieldId(veLink.getDisplayNameFieldId()); + vef.getVascEntryFieldType().setDataObject(itemModel); + + ((VascBackendControllerLocal)getVascController().getVascBackendController()).addVascBackend(backendLink); + ((VascEntryControllerLocal)getVascController().getVascEntryController()).addVascEntry(veLink, getVascController()); + } catch (Exception e) { + e.printStackTrace(); + } + } + + private void createFields(VascEntry ve,Column[] cols) { + for (Column c:cols) { + VascEntryField vef = new DefaultVascEntryField(c.getName()); + vef.setVascEntryFieldType(getVascController().getVascEntryFieldTypeController().getVascEntryFieldTypeByClass(c.getType().getJavaEquivalentClass())); + if (c.getName().toLowerCase().contains("desc") || c.getName().toLowerCase().contains("text")) { + vef.setVascEntryFieldType(getVascController().getVascEntryFieldTypeController().getVascEntryFieldTypeById("TextAreaField")); + } + ve.addVascEntryField(vef); + if (ve.getDisplayNameFieldId()==null && c.getName().equals(ve.getPrimaryKeyFieldId())==false && c.getType().getJavaEquivalentClass()==String.class) { + ve.setDisplayNameFieldId(c.getName()); + } + } + } +} diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/src/main/java/net/forwardfire/vasc/demo/tech/ui/actions/JDialogMetaCsv.java b/vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/src/main/java/net/forwardfire/vasc/demo/tech/ui/actions/JDialogMetaCsv.java new file mode 100644 index 0000000..0fd304f --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/src/main/java/net/forwardfire/vasc/demo/tech/ui/actions/JDialogMetaCsv.java @@ -0,0 +1,78 @@ +package net.forwardfire.vasc.demo.tech.ui.actions; + +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.Frame; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.io.File; + +import javax.swing.BorderFactory; +import javax.swing.JButton; +import javax.swing.JDialog; +import javax.swing.JFileChooser; +import javax.swing.JLabel; +import javax.swing.JPanel; + +import net.forwardfire.vasc.backend.metamodel.MetaModelDataContextCsv; +import net.forwardfire.vasc.demo.tech.ui.TechUI; + +public class JDialogMetaCsv extends JDialog implements ActionListener { + + private static final long serialVersionUID = -8638394652416472734L; + + public JDialogMetaCsv(Frame aFrame) { + setTitle("Add csv file"); + setMinimumSize(new Dimension(640,480)); + setPreferredSize(new Dimension(999,666)); + setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); + addWindowListener(new WindowAdapter() { + public void windowClosing(WindowEvent we) { + clearAndHide(); + } + }); + JPanel mainPanel = new JPanel(); + mainPanel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); + mainPanel.setLayout(new BorderLayout()); + //mainPanel.add(createPanelTop(),BorderLayout.NORTH); + mainPanel.add(createPanelCenter(),BorderLayout.CENTER); + //mainPanel.add(createPanelBottom(),BorderLayout.SOUTH); + getContentPane().add(mainPanel); + pack(); + setLocationRelativeTo(aFrame); + } + + public void clearAndHide() { + setVisible(false); + } + + public JPanel createPanelCenter() { + JPanel result = new JPanel(); + //result.setLayout(new SpringLayout()); + + result.add(new JLabel("File")); + JButton fileButton = new JButton("Open"); + fileButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + final JFileChooser fc = new JFileChooser(); + int returnVal = fc.showOpenDialog((JButton)e.getSource()); + if (returnVal == JFileChooser.APPROVE_OPTION) { + File file = fc.getSelectedFile(); + MetaModelDataContextCsv ds = new MetaModelDataContextCsv(); + ds.setFile(file.getAbsolutePath()); + TechUI.getInstance().getVascManager().createMetaEntry(ds,file.getName(),null); + } + } + }); + result.add(fileButton); + + return result; + } + + public void actionPerformed(ActionEvent arg0) { + // TODO Auto-generated method stub + + } +} diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/src/main/java/net/forwardfire/vasc/demo/tech/ui/actions/JDialogMetaJdbc.java b/vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/src/main/java/net/forwardfire/vasc/demo/tech/ui/actions/JDialogMetaJdbc.java new file mode 100644 index 0000000..55d43dd --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/src/main/java/net/forwardfire/vasc/demo/tech/ui/actions/JDialogMetaJdbc.java @@ -0,0 +1,108 @@ +package net.forwardfire.vasc.demo.tech.ui.actions; + +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.Frame; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; + +import javax.swing.BorderFactory; +import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JDialog; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JTextField; +import javax.swing.SpringLayout; + +import net.forwardfire.vasc.backend.metamodel.MetaModelDataContextJdbc; +import net.forwardfire.vasc.demo.tech.ui.TechUI; +import net.forwardfire.vasc.demo.tech.ui.components.SpringLayoutGrid; + +import org.eobjects.metamodel.DataContext; + +public class JDialogMetaJdbc extends JDialog implements ActionListener { + + private static final long serialVersionUID = -8638394652416472734L; + private JComboBox driverClassBox = null; + private JTextField connectUrlField = null; + private JTextField usernameField = null; + private JTextField passwordField = null; + + + public JDialogMetaJdbc(Frame aFrame) { + setTitle("Add jdbc"); + setMinimumSize(new Dimension(300,200)); + setPreferredSize(new Dimension(500,400)); + setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); + addWindowListener(new WindowAdapter() { + public void windowClosing(WindowEvent we) { + clearAndHide(); + } + }); + JPanel mainPanel = new JPanel(); + mainPanel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); + mainPanel.setLayout(new BorderLayout()); + //mainPanel.add(createPanelTop(),BorderLayout.NORTH); + mainPanel.add(createPanelCenter(),BorderLayout.CENTER); + //mainPanel.add(createPanelBottom(),BorderLayout.SOUTH); + getContentPane().add(mainPanel); + pack(); + setLocationRelativeTo(aFrame); + } + + public void clearAndHide() { + setVisible(false); + } + + public JPanel createPanelCenter() { + JPanel result = new JPanel(); + result.setLayout(new SpringLayout()); + + result.add(new JLabel("Driver")); + driverClassBox = new JComboBox(new String[] {"org.postgresql.Driver","com.mysql.jdbc.Driver","org.apache.derby.jdbc.EmbeddedDriver","org.hsqldb.jdbcDriver","org.sqlite.JDBC"}); + driverClassBox.setSelectedIndex(0); + result.add(driverClassBox); + + result.add(new JLabel("Url")); + connectUrlField = new JTextField("jdbc:postgresql://localhost/dellstore2"); + result.add(connectUrlField); + + result.add(new JLabel("Username")); + usernameField = new JTextField("postgres"); + result.add(usernameField); + + result.add(new JLabel("Password")); + passwordField = new JTextField("postgresql"); + result.add(passwordField); + + JButton fileButton = new JButton("Connect"); + fileButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + String url = connectUrlField.getText(); + MetaModelDataContextJdbc ds = new MetaModelDataContextJdbc(); + ds.setDriverClass((String)driverClassBox.getSelectedItem()); + ds.setConnectUrl(url); + ds.setUsername(usernameField.getText()); + ds.setPassword(passwordField.getText()); + DataContext metaDs = ds.getDataContext(); + String dbName = url.substring(url.lastIndexOf('/')+1,url.length()); + for (String table:metaDs.getDefaultSchema().getTableNames()) { + TechUI.getInstance().getVascManager().createMetaEntry(ds,dbName+"_"+table,table); + } + } + }); + result.add(fileButton); + result.add(new JLabel("")); + + SpringLayoutGrid.makeCompactGrid(result, 5, 2); + return result; + } + + public void actionPerformed(ActionEvent arg0) { + // TODO Auto-generated method stub + + } +} diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/src/main/java/net/forwardfire/vasc/demo/tech/ui/actions/JDialogMetaMongodb.java b/vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/src/main/java/net/forwardfire/vasc/demo/tech/ui/actions/JDialogMetaMongodb.java new file mode 100644 index 0000000..a33fea0 --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/src/main/java/net/forwardfire/vasc/demo/tech/ui/actions/JDialogMetaMongodb.java @@ -0,0 +1,97 @@ +package net.forwardfire.vasc.demo.tech.ui.actions; + +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.Frame; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; + +import javax.swing.BorderFactory; +import javax.swing.JButton; +import javax.swing.JDialog; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JTextField; +import javax.swing.SpringLayout; + +import net.forwardfire.vasc.backend.metamodel.MetaModelDataContextMongodb; +import net.forwardfire.vasc.demo.tech.ui.TechUI; +import net.forwardfire.vasc.demo.tech.ui.components.SpringLayoutGrid; + +import org.eobjects.metamodel.DataContext; + +public class JDialogMetaMongodb extends JDialog implements ActionListener { + + private static final long serialVersionUID = -8638394652416472734L; + private JTextField hostNameField = null; + private JTextField hostPortField = null; + private JTextField databaseField = null; + + public JDialogMetaMongodb(Frame aFrame) { + setTitle("Add mongodb"); + setMinimumSize(new Dimension(300,200)); + setPreferredSize(new Dimension(400,300)); + setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); + addWindowListener(new WindowAdapter() { + public void windowClosing(WindowEvent we) { + clearAndHide(); + } + }); + JPanel mainPanel = new JPanel(); + mainPanel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); + mainPanel.setLayout(new BorderLayout()); + //mainPanel.add(createPanelTop(),BorderLayout.NORTH); + mainPanel.add(createPanelCenter(),BorderLayout.CENTER); + //mainPanel.add(createPanelBottom(),BorderLayout.SOUTH); + getContentPane().add(mainPanel); + pack(); + setLocationRelativeTo(aFrame); + } + + public void clearAndHide() { + setVisible(false); + } + + public JPanel createPanelCenter() { + JPanel result = new JPanel(); + result.setLayout(new SpringLayout()); + + result.add(new JLabel("Hostname")); + hostNameField = new JTextField("localhost"); + result.add(hostNameField); + + result.add(new JLabel("Port")); + hostPortField = new JTextField("27017"); + result.add(hostPortField); + + result.add(new JLabel("Database")); + databaseField = new JTextField("lefiona"); + result.add(databaseField); + + JButton fileButton = new JButton("Connect"); + fileButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + MetaModelDataContextMongodb ds = new MetaModelDataContextMongodb(); + ds.setHostname(hostNameField.getText()); + ds.setPort(new Integer(hostPortField.getText())); + ds.setDatabase(databaseField.getText()); + DataContext metaDs = ds.getDataContext(); + for (String table:metaDs.getDefaultSchema().getTableNames()) { + TechUI.getInstance().getVascManager().createMetaEntry(ds,ds.getDatabase()+"_"+table,table); + } + } + }); + result.add(fileButton); + result.add(new JLabel("")); + + SpringLayoutGrid.makeCompactGrid(result, 4, 2); + return result; + } + + public void actionPerformed(ActionEvent arg0) { + // TODO Auto-generated method stub + + } +} diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/src/main/java/net/forwardfire/vasc/demo/tech/ui/components/JConsolePanel.java b/vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/src/main/java/net/forwardfire/vasc/demo/tech/ui/components/JConsolePanel.java new file mode 100644 index 0000000..c3f0a5a --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/src/main/java/net/forwardfire/vasc/demo/tech/ui/components/JConsolePanel.java @@ -0,0 +1,153 @@ +package net.forwardfire.vasc.demo.tech.ui.components; + +import java.awt.Color; +import java.awt.FlowLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.Enumeration; +import java.util.logging.Handler; +import java.util.logging.Level; +import java.util.logging.LogManager; +import java.util.logging.LogRecord; +import java.util.logging.Logger; + +import javax.swing.BorderFactory; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JComboBox; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JTextArea; +import javax.swing.ScrollPaneConstants; +import javax.swing.SpringLayout; +import javax.swing.SwingUtilities; + +import net.forwardfire.vasc.demo.tech.ui.PatternLogFormatter; + +public class JConsolePanel extends JPanel implements ActionListener { + + private static final long serialVersionUID = 485766723433479054L; + private UILogHandler logHandler = null; + private JButton clearButton = null; + private JComboBox levelBox = null; + private JTextArea logTextArea = null; + private JCheckBox autoScrollBox = null; + private int logLinesMax = 255; + + public JConsolePanel() { + setLayout(new FlowLayout(FlowLayout.LEFT)); + JPanel wrap = new JPanel(); + wrap.setLayout(new SpringLayout()); + wrap.add(createHeader()); + wrap.add(createEditor()); + SpringLayoutGrid.makeCompactGrid(wrap,2,1); + add(wrap); + + Logger rootLogger = Logger.getAnonymousLogger(); + while (rootLogger.getParent()!=null) { + rootLogger = rootLogger.getParent(); + } + + logHandler = new UILogHandler(); + logHandler.setFormatter(new PatternLogFormatter()); + rootLogger.addHandler(logHandler); + + } + + /** + * This needs release if playing the the this tab add/removal very multiple times. + */ + public void release() { + Logger rootLogger = Logger.getAnonymousLogger(); + while (rootLogger.getParent()!=null) { + rootLogger = rootLogger.getParent(); + } + rootLogger.removeHandler(logHandler); + } + + private JPanel createHeader() { + JPanel result = new JPanel(); + result.setBorder(BorderFactory.createLineBorder(Color.BLUE)); + result.setLayout(new FlowLayout(FlowLayout.LEFT)); + result.add(new JLabel("Log Level")); + levelBox = new JComboBox(new Level[] {Level.OFF,Level.SEVERE,Level.WARNING,Level.INFO,Level.FINE,Level.FINER,Level.FINEST,Level.ALL}); + levelBox.setSelectedItem(Level.INFO); + levelBox.addActionListener(this); + result.add(levelBox); + clearButton = new JButton("Clear"); + clearButton.addActionListener(this); + result.add(clearButton); + autoScrollBox = new JCheckBox("Autoscroll"); + autoScrollBox.setSelected(true); + result.add(autoScrollBox); + return result; + } + + private JPanel createEditor() { + JPanel result = new JPanel(); + result.setBorder(BorderFactory.createLineBorder(Color.BLUE)); + logTextArea = new JTextArea(5, 80); + logTextArea.setAutoscrolls(true); + logTextArea.setEditable(false); + JScrollPane logScrollPane = new JScrollPane(logTextArea); + logScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); + logScrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); + logScrollPane.getViewport().setOpaque(false); + result.add(logScrollPane); + return result; + } + + public void actionPerformed(ActionEvent e) { + if (clearButton.equals(e.getSource())) { + logTextArea.setText(""); + } else if (levelBox.equals(e.getSource()) && levelBox.getSelectedIndex()!=-1) { + Level level = (Level)levelBox.getSelectedItem(); + logHandler.setLevel(level); + Enumeration loggers = LogManager.getLogManager().getLoggerNames(); + while (loggers.hasMoreElements()) { + String name = loggers.nextElement(); + Logger logger = LogManager.getLogManager().getLogger(name); + if (logger!=null && name.contains("pulsefire")) { + logger.setLevel(level); // only set pulsefire code loggers + } + } + } + } + + class UILogHandler extends Handler { + @Override + public void close() throws SecurityException { + } + @Override + public void flush() { + } + @Override + public void publish(LogRecord record) { + final String recordStr = getFormatter().format(record); + SwingUtilities.invokeLater(new Runnable() { + public void run() { + logTextArea.append(recordStr); + if (logTextArea.getLineCount() > logLinesMax) { + String t = logTextArea.getText(); + int l = 0; + int rm = logLinesMax/2; + for (int i=0;i=0) { + tabPane.removeTabAt(tabPane.getSelectedIndex()); // todo release vasc frontend + } + } + + }); + tabMenu.add(item); + JMenuItem itemAll = new JMenuItem("Close All tabs"); + itemAll.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + JTabbedPane tabPane = ((JMainPanel)TechUI.getInstance().getMainView().getComponent()).getTabPane(); + for (int i=tabPane.getTabCount();i>0;i--) { + tabPane.removeTabAt(i-1); // todo release vasc frontend + } + } + + }); + tabMenu.add(itemAll); + } +} diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/src/main/java/net/forwardfire/vasc/demo/tech/ui/components/SpringLayoutGrid.java b/vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/src/main/java/net/forwardfire/vasc/demo/tech/ui/components/SpringLayoutGrid.java new file mode 100644 index 0000000..a823531 --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/src/main/java/net/forwardfire/vasc/demo/tech/ui/components/SpringLayoutGrid.java @@ -0,0 +1,214 @@ +/* + * Copyright (c) 2011, Willem Cazander + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted provided + * that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this list of conditions and the + * following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and + * the following disclaimer in the documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package net.forwardfire.vasc.demo.tech.ui.components; + +import java.awt.Component; +import java.awt.Container; + +import javax.swing.Spring; +import javax.swing.SpringLayout; + + +/** + * SpringLayoutGrid, someone should create an JCP to get these functions into + * SpringLayout object because this code is to much duplicated on many projects. + * + * A 1.4 file that provides utility methods for creating form- or grid-style + * layouts with SpringLayout. These utilities are used by several programs, such + * as SpringBox and SpringCompactGrid. + */ +public class SpringLayoutGrid { + + + /** + * Aligns the first rows*cols components of + * parent in a grid. Each component is as big as the maximum + * preferred width and height of the components. The parent is made just big + * enough to fit them all. + * + * @param rows + * number of rows + * @param cols + * number of columns + * @param initialX + * x location to start the grid at + * @param initialY + * y location to start the grid at + * @param xPad + * x padding between cells + * @param yPad + * y padding between cells + */ + public static void makeGrid(Container parent, int rows, int cols,int initialX, int initialY, int xPad, int yPad) { + SpringLayout layout; + try { + layout = (SpringLayout) parent.getLayout(); + } catch (ClassCastException exc) { + throw new IllegalArgumentException("parent container has not StringLayout layoutmanager."); + } + + Spring xPadSpring = Spring.constant(xPad); + Spring yPadSpring = Spring.constant(yPad); + Spring initialXSpring = Spring.constant(initialX); + Spring initialYSpring = Spring.constant(initialY); + int max = rows * cols; + + //Calculate Springs that are the max of the width/height so that all + //cells have the same size. + Spring maxWidthSpring = layout.getConstraints(parent.getComponent(0)) + .getWidth(); + Spring maxHeightSpring = layout.getConstraints(parent.getComponent(0)) + .getWidth(); + for (int i = 1; i < max; i++) { + SpringLayout.Constraints cons = layout.getConstraints(parent + .getComponent(i)); + + maxWidthSpring = Spring.max(maxWidthSpring, cons.getWidth()); + maxHeightSpring = Spring.max(maxHeightSpring, cons.getHeight()); + } + + //Apply the new width/height Spring. This forces all the + //components to have the same size. + for (int i = 0; i < max; i++) { + SpringLayout.Constraints cons = layout.getConstraints(parent + .getComponent(i)); + + cons.setWidth(maxWidthSpring); + cons.setHeight(maxHeightSpring); + } + + //Then adjust the x/y constraints of all the cells so that they + //are aligned in a grid. + SpringLayout.Constraints lastCons = null; + SpringLayout.Constraints lastRowCons = null; + for (int i = 0; i < max; i++) { + SpringLayout.Constraints cons = layout.getConstraints(parent + .getComponent(i)); + if (i % cols == 0) { //start of new row + lastRowCons = lastCons; + cons.setX(initialXSpring); + } else { //x position depends on previous component + cons.setX(Spring.sum(lastCons.getConstraint(SpringLayout.EAST), + xPadSpring)); + } + + if (i / cols == 0) { //first row + cons.setY(initialYSpring); + } else { //y position depends on previous row + cons.setY(Spring.sum(lastRowCons + .getConstraint(SpringLayout.SOUTH), yPadSpring)); + } + lastCons = cons; + } + + //Set the parent's size. + SpringLayout.Constraints pCons = layout.getConstraints(parent); + pCons.setConstraint(SpringLayout.SOUTH, Spring.sum(Spring + .constant(yPad), lastCons.getConstraint(SpringLayout.SOUTH))); + pCons.setConstraint(SpringLayout.EAST, Spring.sum( + Spring.constant(xPad), lastCons + .getConstraint(SpringLayout.EAST))); + } + + /* Used by makeCompactGrid. */ + private static SpringLayout.Constraints getConstraintsForCell(int row, + int col, Container parent, int cols) { + SpringLayout layout = (SpringLayout) parent.getLayout(); + Component c = parent.getComponent(row * cols + col); + return layout.getConstraints(c); + } + + + public static void makeCompactGrid(Container parent, int rows, int cols) { + makeCompactGrid(parent,rows,cols,6,6,6,6); + } + + /** + * Aligns the first rows*cols components of + * parent in a grid. Each component in a column is as wide as + * the maximum preferred width of the components in that column; height is + * similarly determined for each row. The parent is made just big enough to + * fit them all. + * + * @param rows + * number of rows + * @param cols + * number of columns + * @param initialX + * x location to start the grid at + * @param initialY + * y location to start the grid at + * @param xPad + * x padding between cells + * @param yPad + * y padding between cells + */ + public static void makeCompactGrid(Container parent, int rows, int cols,int initialX, int initialY, int xPad, int yPad) { + SpringLayout layout; + try { + layout = (SpringLayout) parent.getLayout(); + } catch (ClassCastException exc) { + throw new IllegalArgumentException("parent container has not StringLayout layoutmanager."); + } + + //Align all cells in each column and make them the same width. + Spring x = Spring.constant(initialX); + for (int c = 0; c < cols; c++) { + Spring width = Spring.constant(0); + for (int r = 0; r < rows; r++) { + width = Spring.max(width, getConstraintsForCell(r, c, parent, + cols).getWidth()); + } + for (int r = 0; r < rows; r++) { + SpringLayout.Constraints constraints = getConstraintsForCell(r, + c, parent, cols); + constraints.setX(x); + constraints.setWidth(width); + } + x = Spring.sum(x, Spring.sum(width, Spring.constant(xPad))); + } + + //Align all cells in each row and make them the same height. + Spring y = Spring.constant(initialY); + for (int r = 0; r < rows; r++) { + Spring height = Spring.constant(0); + for (int c = 0; c < cols; c++) { + height = Spring.max(height, getConstraintsForCell(r, c, parent, + cols).getHeight()); + } + for (int c = 0; c < cols; c++) { + SpringLayout.Constraints constraints = getConstraintsForCell(r, + c, parent, cols); + constraints.setY(y); + constraints.setHeight(height); + } + y = Spring.sum(y, Spring.sum(height, Spring.constant(yPad))); + } + + //Set the parent's size. + SpringLayout.Constraints pCons = layout.getConstraints(parent); + pCons.setConstraint(SpringLayout.SOUTH, y); + pCons.setConstraint(SpringLayout.EAST, x); + } +} diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/src/main/resources/net/forwardfire/vasc/demo/tech/ui/resources/TechUI.properties b/vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/src/main/resources/net/forwardfire/vasc/demo/tech/ui/resources/TechUI.properties new file mode 100644 index 0000000..587508e --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-ui/src/main/resources/net/forwardfire/vasc/demo/tech/ui/resources/TechUI.properties @@ -0,0 +1,118 @@ +# +# Copyright (c) 2011, Willem Cazander +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, are permitted provided +# that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this list of conditions and the +# following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +# the following disclaimer in the documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +# THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT +# OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR +# TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +# Application's properties +Application.name = Vasc Demo Tech +Application.title = VascDemoTech +Application.vendor = Willem Cazander +Application.homepage = http://vasc.forwardfire.org/ +Application.vendorId = vasc +Application.id = vascdemotech +Application.lookAndFeel = com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel +#Application.icon = images/icon.png + + +generic.active.labelText = active +generic.active.toolTipText = active +generic.createdDate.labelText = createdDate +generic.createdDate.toolTipText = createdDate +generic.description.labelText = description +generic.description.toolTipText = description +generic.id.labelText = id +generic.id.toolTipText = id +generic.modifiedDate.labelText = modifiedDate +generic.modifiedDate.toolTipText = modifiedDate +generic.name.labelText = name +generic.name.toolTipText = name +generic.orderNumber.labelText = orderNumber +generic.orderNumber.toolTipText = orderNumber + +# hibernate validators +validator.assertFalse=assertion failed +validator.assertTrue=assertion failed +validator.future=Date must lie in the future +validator.length=Field must contain between {min} and {max} characters. +validator.max=Value must be equal to or lower than {value} +validator.min=Value must be equal to or higher than {value} +validator.notNull=A value must be entered +validator.past=Date must lie in the future +validator.pattern=Value must conform to "{regex}" +validator.range=Value must lie between {min} and {max} +validator.size=There must be between {min} and {max} characters +validator.email=The value must be a valid e-mail address + +# vasc validators +vasc.validator.VascDateFutureValidator=The date must lie in the future. +vasc.validator.VascDatePastValidator=The date must lie in the past. +vasc.validator.VascIntSizeValidator=Value must lie between {0} and {1} +vasc.validator.VascLongSizeValidator=Value must lie between {0} and {1} +vasc.validator.VascObjectNotNullValidator=A value must be entered +vasc.validator.VascObjectNullValidator=No value may be entered +vasc.validator.VascStringEmailValidator=The value must be a valid e-mail address +vasc.validator.VascStringLengthValidator=There must be at least {0} and at most {1} items +vasc.validator.VascStringRegexValidator=Value must conform to "{0}" +vasc.validator.VascStringZipCodeValidator=Value must be a valid post code. + +# Vasc actions labels +vasc.action.addRowAction.description = add a new record +vasc.action.addRowAction.name = Add +vasc.action.csvExportAction.description = CSV +vasc.action.csvExportAction.name = CSV +vasc.action.xmlExportAction.description = XML +vasc.action.xmlExportAction.name = XML +vasc.action.deleteRowAction.description = delete +vasc.action.deleteRowAction.name = delete +vasc.action.downloadAction.description = Select this record. +vasc.action.downloadAction.name = Select +vasc.action.editRowAction.description = edit +vasc.action.editRowAction.name = Edit + +# Temp jsf +generic.vasc.jsf.listOption.header = Searchoptions +generic.vasc.jsf.listOption.search = Searh\: +generic.vasc.jsf.listOption.sumbit = Search +generic.vasc.jsf.pager.previous = Previous +generic.vasc.jsf.pager.next = Next +generic.vasc.jsf.table.rows = Row Numbers\: +generic.vasc.jsf.table.pagerDirect = Go to\: +generic.vasc.jsf.table.downloadDirect = Download\: +generic.vasc.jsf.table.resultText = Results {0}-{1} from {2} rows +generic.vasc.jsf.table.download.img = Save table data. +generic.vasc.jsf.table.printer.img = Shows the table in printer friendly format. +generic.vasc.jsf.table.export.select = ... +generic.vasc.jsf.table.export.select.alt = Select Export +generic.vasc.jsf.table.page.select = ... +generic.vasc.jsf.table.page.select.alt = Select Page +generic.vasc.jsf.table.page.name = Page: +generic.vasc.jsf.table.page.description = Goto page: +generic.vasc.jsf.tableHeader.fields = Fields +generic.vasc.jsf.tableHeader.links = Links +generic.vasc.jsf.tableHeader.actions = Actions +generic.vasc.jsf.multiAction.selectAll = Select all: +generic.vasc.jsf.multiAction.name = ... +generic.vasc.jsf.multiAction.description = Select Action +generic.vasc.jsf.action.save = Save +generic.vasc.jsf.action.cancel = Cancel +generic.vasc.jsf.action.back = Back +generic.vasc.jsf.parentSelected = Selected: + diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/.classpath b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/.classpath new file mode 100644 index 0000000..3c96d64 --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/.project b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/.project new file mode 100644 index 0000000..f238743 --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/.project @@ -0,0 +1,23 @@ + + + vasc-demo-tech-web + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/.settings/org.eclipse.core.resources.prefs b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..29abf99 --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,6 @@ +eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding//src/main/resources=UTF-8 +encoding//src/test/java=UTF-8 +encoding//src/test/resources=UTF-8 +encoding/=UTF-8 diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/.settings/org.eclipse.jdt.core.prefs b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..abec6ca --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,5 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.5 diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/.settings/org.eclipse.m2e.core.prefs b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..f897a7f --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/pom.xml b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/pom.xml new file mode 100644 index 0000000..698d3ec --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/pom.xml @@ -0,0 +1,77 @@ + + 4.0.0 + + vasc-demo-tech + net.forwardfire.vasc.demo + 0.3.5-SNAPSHOT + .. + + vasc-demo-tech-web + vasc-demo-tech-web + vasc-demo-tech-web + + + + net.forwardfire.vasc + vasc-frontend-web-jsf + ${project.version} + + + + + org.apache.tomcat.embed + tomcat-embed-core + 7.0.22 + + + org.apache.tomcat.embed + tomcat-embed-jasper + 7.0.22 + + + org.apache.tomcat + tomcat-jasper + 7.0.22 + + + + + com.sun.facelets + jsf-facelets + 1.1.15.B1 + + + javax.servlet + jstl + 1.2 + + + javax.faces + jsf-api + 1.2_12 + + + javax.faces + jsf-impl + 1.2_12 + + + + + org.richfaces.framework + richfaces-api + 3.3.3-SNAPSHOT + + + org.richfaces.framework + richfaces-impl + 3.3.3-SNAPSHOT + + + org.richfaces.ui + richfaces-ui + 3.3.3-SNAPSHOT + + + + \ No newline at end of file diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/java/net/forwardfire/vasc/demo/tech/web/beans/UserController.java b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/java/net/forwardfire/vasc/demo/tech/web/beans/UserController.java new file mode 100644 index 0000000..b7f63ea --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/java/net/forwardfire/vasc/demo/tech/web/beans/UserController.java @@ -0,0 +1,72 @@ +/* + * Copyright 2009-2012 forwardfire.net All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted provided + * that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this list of conditions and the + * following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and + * the following disclaimer in the documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package net.forwardfire.vasc.demo.tech.web.beans; + +import java.io.Serializable; + +import net.forwardfire.vasc.demo.tech.web.models.WebUser; + +/** + * + * @author Willem Cazander + * @version 1.0 Nov 1, 2009 + */ +public class UserController implements Serializable { + + private static final long serialVersionUID = 1L; + private WebUser webUser = null; + + public void loginFilter() { + try { + //logUser = loginManager.getUser(); + //logRightRoles = loginManager.getClientRoles(); + + webUser = new WebUser(); + webUser.setLoginName( "test123"); + webUser.setFullName( "test1234567890"); + + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + public void logoutFilter() { + webUser = null; + //logRightRoles = null; + } + + public boolean isUserLoggedin() { + if (webUser==null) { + return false; + } + return true; + } + + public WebUser getUser() { + return webUser; + } + + //public List getRightRoles() { + // return logRightRoles; + //} +} \ No newline at end of file diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/java/net/forwardfire/vasc/demo/tech/web/beans/VascFacesController.java b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/java/net/forwardfire/vasc/demo/tech/web/beans/VascFacesController.java new file mode 100644 index 0000000..9fad205 --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/java/net/forwardfire/vasc/demo/tech/web/beans/VascFacesController.java @@ -0,0 +1,88 @@ +/* + * Copyright 2009-2012 forwardfire.net All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted provided + * that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this list of conditions and the + * following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and + * the following disclaimer in the documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package net.forwardfire.vasc.demo.tech.web.beans; + +import java.util.ArrayList; +import java.util.List; +import java.util.Locale; +import java.util.ResourceBundle; + +import javax.faces.context.FacesContext; + +import net.forwardfire.vasc.core.VascController; +import net.forwardfire.vasc.core.VascEntry; +import net.forwardfire.vasc.core.entry.VascEntryFrontendEventListener; + +import net.forwardfire.vasc.demo.tech.web.core.TomcatManager; +import net.forwardfire.vasc.frontend.VascFrontendData; +import net.forwardfire.vasc.frontends.web.jsf.AbstractJSFVascFacesControllerBase; +import net.forwardfire.vasc.impl.DefaultVascFactory; + + +/** + * + * @author Willem Cazander + * @version 1.0 Nov 1, 2009 + */ +public class VascFacesController extends AbstractJSFVascFacesControllerBase { + + + public List getVascAdminEntries() { + List result = new ArrayList(50); + VascController v = getVascController(); + for (String e:v.getVascEntryController().getVascEntryIds()) { + if (e.endsWith("Link")==false) { + result.add(e); + } + } + return result; + } + + @Override + public VascFrontendData getNewVascFrontendData() { + Locale locale = FacesContext.getCurrentInstance().getViewRoot().getLocale(); + // MergedResourceBundle bundle = new MergedResourceBundle(); + // bundle.addDataBundle(ResourceBundle.getBundle(getResourceBundleWEB(), locale)); + + VascFrontendData vascFrontendData = DefaultVascFactory.getDefaultVascFrontendData(ResourceBundle.getBundle("net/forwardfire/vasc/demo/tech/ui/resources/TechUI")); + vascFrontendData.addVascEntryFrontendEventListener(new VascEntryFrontendEventListener() { + private static final long serialVersionUID = 1L; + public VascFrontendEventType[] getEventTypes() { + VascFrontendEventType[] result = {VascEntryFrontendEventListener.VascFrontendEventType.EXCEPTION}; + return result; + } + public void vascEvent(VascEntry entry, Object data) { + if (data instanceof Exception) { + ((Exception)data).printStackTrace(); + } + } + }); + return vascFrontendData; + } + + @Override + public VascController getVascController() { + return TomcatManager.getInstance().getVascController(); + } + +} \ No newline at end of file diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/java/net/forwardfire/vasc/demo/tech/web/core/TomcatManager.java b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/java/net/forwardfire/vasc/demo/tech/web/core/TomcatManager.java new file mode 100644 index 0000000..963b014 --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/java/net/forwardfire/vasc/demo/tech/web/core/TomcatManager.java @@ -0,0 +1,57 @@ +package net.forwardfire.vasc.demo.tech.web.core; + +import java.io.File; + +import net.forwardfire.vasc.core.VascController; + +import org.apache.catalina.startup.Tomcat; + +public class TomcatManager { + + private Tomcat tomcat = null; + private VascController vascController = null; + + public void start() throws Exception { + String webappDirLocation = "../vasc-demo-tech-web/src/main/webapp/"; + Tomcat tomcat = new Tomcat(); + + String webPort = System.getenv("PORT"); + if(webPort == null || webPort.isEmpty()) { + webPort = "8899"; + } + tomcat.setPort(Integer.valueOf(webPort)); + tomcat.addWebapp("/demo", new File(webappDirLocation).getAbsolutePath()); + System.out.println("configuring app with basedir: " + new File("./" + webappDirLocation).getAbsolutePath()); + + instance = this; + + tomcat.start(); + } + + public void stop() throws Exception { + if (tomcat==null) { + return; + } + tomcat.stop(); + instance = null; + } + + static private TomcatManager instance = null; + static public TomcatManager getInstance() { + return instance; // hackje to rm mvn 1-1 dep with ui + } + + /** + * @return the vascController + */ + public VascController getVascController() { + return vascController; + } + + /** + * @param vascController the vascController to set + */ + public void setVascController(VascController vascController) { + this.vascController = vascController; + } +} diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/java/net/forwardfire/vasc/demo/tech/web/models/WebUser.java b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/java/net/forwardfire/vasc/demo/tech/web/models/WebUser.java new file mode 100644 index 0000000..be7ffb9 --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/java/net/forwardfire/vasc/demo/tech/web/models/WebUser.java @@ -0,0 +1,50 @@ +package net.forwardfire.vasc.demo.tech.web.models; + +import java.util.ArrayList; +import java.util.List; + +public class WebUser { + + private String loginName = null; + private String fullName = null; + private List groups = null; + + public WebUser() { + groups = new ArrayList(20); + } + + /** + * @return the loginName + */ + public String getLoginName() { + return loginName; + } + + /** + * @param loginName the loginName to set + */ + public void setLoginName(String loginName) { + this.loginName = loginName; + } + + /** + * @return the fullName + */ + public String getFullName() { + return fullName; + } + + /** + * @param fullName the fullName to set + */ + public void setFullName(String fullName) { + this.fullName = fullName; + } + + /** + * @return the groups + */ + public List getGroups() { + return groups; + } +} diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/resources/META-INF/skins/vasc-demo-tech.skin.properties b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/resources/META-INF/skins/vasc-demo-tech.skin.properties new file mode 100644 index 0000000..c993f8a --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/resources/META-INF/skins/vasc-demo-tech.skin.properties @@ -0,0 +1,73 @@ +#Colors +headerBackgroundColor=\#EAEAEA +headerGradientColor=\#E0E0E0 +headerTextColor=#282828 +headerWeightFont=bold + +generalBackgroundColor=#FFFFFF +generalTextColor=#282828 +generalSizeFont=11px +generalFamilyFont=Arial, Helvetica, sans-serif + +controlTextColor=#282828 +controlBackgroundColor=#ffffff +additionalBackgroundColor=#ffffff + +shadowBackgroundColor=#000000 +shadowOpacity=1 + +panelBorderColor=#BED6F8 +subBorderColor=#ffffff + +tabBackgroundColor=#C6DEFF +tabDisabledTextColor=#ffffff + +trimColor=#D6E6FB + +tipBackgroundColor=\#FAE6B0 +tipBorderColor=\#E5973E + +selectControlColor=#E79A00 + + +generalLinkColor=#004DEB +hoverLinkColor=#004DEB +visitedLinkColor=#004DEB + +# Fonts +headerSizeFont=11px +headerFamilyFont=Arial, Helvetica, sans-serif + +tabSizeFont=11 +tabFamilyFont=Arial, Helvetica, sans-serif + +buttonSizeFont=11 +buttonFamilyFont=Arial, Verdana, sans-serif + + +tableBackgroundColor=#FFFFFF +tableFooterBackgroundColor=#FFFFFF +tableSubfooterBackgroundColor=#FFFFFF + + +#Calendar colors +calendarWeekBackgroundColor=#F5F5F5 + +calendarHolidaysBackgroundColor=#FFEBDA +calendarHolidaysTextColor=#FF7800 + +calendarCurrentBackgroundColor=#FF7800 +calendarCurrentTextColor=#FFEBDA + +calendarSpecBackgroundColor=#E4F5E2 +calendarSpecTextColor=#000000 + + +warningColor=#282828 +warningBackgroundColor=##EE0000 + +editorBackgroundColor=#F1F1F1 +editBackgroundColor=#FEFFDA + +#Gradients +gradientType=plain diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/WEB-INF/faces.xml b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/WEB-INF/faces.xml new file mode 100644 index 0000000..cdb0533 --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/WEB-INF/faces.xml @@ -0,0 +1,26 @@ + + + + + + + en + + com.sun.facelets.FaceletViewHandler + + + + Controls the Users + userController + net.forwardfire.vasc.demo.tech.web.beans.UserController + session + + + + Controls Vasc Faces + vascFacesController + net.forwardfire.vasc.demo.tech.web.beans.VascFacesController + session + + + \ No newline at end of file diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/WEB-INF/web.xml b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..d5f0080 --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,205 @@ + + + + Vasc Demo Tech Web Application + + /jsp/index_jsp.jsp + + + 4 + + + + + + XHTML + *.xhtml + + + Include files + No direct access to include files. + /jsp/includes/* + POST + GET + + + No direct browser access to include files. + inaccessible + + + NONE + + + + + + + FORM + VascDemoSecurity + + /jsp/login/login.jsf + /jsp/login/login-error.jsf + + + + + user + + + admin-company + + + admin-system + + + inaccessible + + + + + + + + Comma separated list of URIs of (additional) faces + config files.(e.g./WEB-INF/my-config.xml) See JSF1.0 PRD 2,10.3.2 + + javax.faces.CONFIG_FILES + /WEB-INF/faces.xml + + + javax.faces.STATE_SAVING_METHOD + server + + + javax.faces.DEFAULT_SUFFIX + .xhtml + + + facelets.REFRESH_PERIOD + 2 + + + facelets.DEVELOPMENT + true + + + + + com.sun.faces.config.ConfigureListener + + + + The JSF Servlet + facesServlet + javax.faces.webapp.FacesServlet + 1 + + + facesServlet + *.jsf + + + + + org.richfaces.SKIN + vasc-demo-tech + + + + + org.richfaces.CONTROL_SKINNING + enable + + + + + RichFaces Filter + richfaces + org.ajax4jsf.Filter + + + + richfaces + facesServlet + REQUEST + FORWARD + INCLUDE + + + + + VASC Filter + vascFilter + net.forwardfire.vasc.frontends.web.jsf.VascRequestFacesFilter + + templateFile + /jsp/includes/vasc-template.jsf + + + + + + vascFilter + /vasc/* + REQUEST + + + diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/css/ie6_fixes.css b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/css/ie6_fixes.css new file mode 100644 index 0000000..4d7a0af --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/css/ie6_fixes.css @@ -0,0 +1,8 @@ + +/* CSS fixes for IE6 */ + +/* +#page_menu_left { + overflow: visible; +} +*/ \ No newline at end of file diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/css/ie7_fixes.css b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/css/ie7_fixes.css new file mode 100644 index 0000000..9001952 --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/css/ie7_fixes.css @@ -0,0 +1,8 @@ + +/* CSS fixes for IE7 */ + +/* +#page_menu_left { + overflow: visible; +} +*/ \ No newline at end of file diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/css/ie8_fixes.css b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/css/ie8_fixes.css new file mode 100644 index 0000000..1acb363 --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/css/ie8_fixes.css @@ -0,0 +1,4 @@ + +/* CSS fixes for IE8 */ + +/* Yet to come */ \ No newline at end of file diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/css/site.css b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/css/site.css new file mode 100644 index 0000000..2da186b --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/css/site.css @@ -0,0 +1,538 @@ + +/* HTML STYLES */ + +* { + margin:0px; + padding:0px; +} + +body { + font-family: Arial, Helvetica, sans-serif; + font-size: 15px; + color: #000000; + margin: 0px; + padding: 0px; + background-color:white; +} + +h1 { + font-size:1.2em; + font-weight:bold; + padding-bottom:10px; +} + +h2 { + -moz-border-radius:3px; + -webkit-border-radius:3px; + -khtml-border-radius:3px; + display:block; + font-size:1.0em; + font-weight:bold; + padding:10px 10px 10px 10px; +} + +a { + color:#004DEB; + text-decoration:underline; +} + +p { + margin:10px 10px 10px 10px; +} + +img { + border: none; + vertical-align: middle; +} + +ul { + margin-left:10px; +} + +/* DIVS */ + +#page_wrap{ + margin:10px; + margin-top:0px; + float:none; +} + +#page_header{ + height:80px; + font-size:18px; + border-bottom:1px solid #DDCCCC; + position:relative; +} + +#page_header a img{ + border:none; + padding-right:10px; + vertical-align:middle; +} + +#page_content { + margin-top:5px; +} + +#page_footer { + margin-top:35px; + padding: 5px; + font-size: 12px; + border-color:#e5e5e5; + border-style:solid; + border-width:1px 1px 1px 1px; + -moz-border-radius:3px; + -webkit-border-radius:3px; + -khtml-border-radius:3px; +} + +/* MENU */ + +#page_menu_left,#page_menu_right { + border-color:#DDCCCC; + border-style:solid; + border-width:0 0 1px 0; + vertical-align:bottom; + display:inline; +} + +#page_menu_right { + position:absolute; + bottom:0; + right:0; +} + +#page_menu_left a,#page_menu_right a { + border:1px solid #e0e0e0; + background-color:#DDCCCC; + border-bottom-width:0px; + text-align:center; + -moz-border-radius-topleft:3xp; + -moz-border-radius-topright:3xp; + -webkit-border-top-left-radius:3px; + -webkit-border-top-right-radius:3px; + -khtml-border-radius-topleft:3px; + -khtml-border-radius-topright:3px; + color:#000; + margin:0px 5px 0px 0px; + padding:3px 15px 2px 15px; + text-decoration:none; +} + +#page_menu_left a:hover,#page_menu_right a:hover { + text-decoration:none; + background-color:#fff; + border-color:#e0e0e0; +} + +#page_menu_left a.active,#page_menu_left a.active { + background-color:#fff; + font-weight:700; +} + +#page_user_info { + padding:5px; + position:absolute; + right:0; + top:0; + font-size:11px; +} + + +.actionbox{ + background-color:#DDCCCC; + -moz-border-radius:3px; + -webkit-border-radius:3px; + -khtml-border-radius:3px; + border:none; + -moz-border-radius-topleft:0; + -webkit-border-top-left-radius:0; + -khtml-border-radius-topleft:0; + clear:both; + padding:3px 0 3px 3px; + display:block; +} +.actionbox label{display:inline;} +ul.actionboxtab{margin:0;padding:0;} +ul.actionboxtab li{list-style-type:none;float:left;margin:0;padding:0;} +ul.actionboxtab li a { + border:solid 1px #ddd; + border-bottom-width:0; + -moz-border-radius-topleft:3px; + -moz-border-radius-topright:3px; + -khtml-border-radius-topright:3px; + -webkit-border-top-left-radius:3px; + -webkit-border-top-right-radius:3px; + -khtml-border-radius-topleft:3px; + font-weight:700; + display:block; + margin-right:5px;color:#000; + padding:3px 15px; +} +ul.actionboxtab li a.active{background-color:#DDCCCC;border:solid 1px #DDCCCC;text-decoration:none;} +ul.actionboxtab li a:hover{background-color:#DDCCCC;border:solid 1px #DDCCCC;text-decoration:none;} +td.tableactions{border-bottom-color:#bbb;text-align:left;} + + +ul.paging{ + clear:both; + margin-bottom:5px; + margin-top:5px; + display:block; + float:left; + padding-top:3px; + padding-bottom:3px; + width:100%; + list-style:none; +} +ul.paging li,ul.paging span{float:left;margin:0 2px 0 2px;} +.paging_thispage{font-weight:700;padding:0 6px;} +ul.paging .paging_atstart{margin-right:10px;}ul.paging .paging_atend{margin-left:10px;} +ul.paging .paging_atstart a,ul.paging .nolink.paging_atstart{ + padding-left:15px; +} +ul.paging .paging_atend a,ul.paging .nolink.paging_atend{ + padding-right:15px; +} +ul.paging .paging_next{ + margin-left:20px; + border:1px solid #DDD; + -moz-border-radius:3px; + -webkit-border-radius:3px; + -khtml-border-radius:3px; + padding:2px 6px; +} + +ul.paging .paging_prev{ + margin-right:20px; + border:1px solid #DDD; + -moz-border-radius:3px; + -webkit-border-radius:3px; + -khtml-border-radius:3px; + padding:2px 6px; +} +ul.paging a,ul.paging .paging_link{ + border:1px solid #DDD; + -moz-border-radius:3px; + -webkit-border-radius:3px; + -khtml-border-radius:3px; + padding:2px 6px; +} +ul.paging .paging_break{ + font-weight:700;padding:2px 6px; +} + + + +/* TABLES */ +/* +#m_content table { + text-align: left; +} +*/ + +table.table5, table.rating_table { + border-collapse:collapse; + font-size:11px; + width:100%; + margin-bottom: 30px; +} + +table.table5 th, table.rating_table th { + padding-top:5px; + padding-bottom:5px; + font-weight:700; + text-align:left; + vertical-align:top; + padding-left: 3px; +} + +table.table5 td, table.rating_table td { + vertical-align:top; + padding-top:5px; + padding-bottom:5px; + padding-left: 3px; +} + +.dataTableHeaderRow { + border:1px solid #e0e0e0; + background-color:#e4e4e4; + border-bottom-width:0; +} + +.dataTableHeaderRow th, td { + padding-right: 5px; +} + +table input,table select { + font-size: 11px; + margin-left:6px; + margin-right:6px; +} + +table.table5 tr:nth-child(even) { + background-color:#f0f0f0; +} + +.table_options_top { + -moz-border-radius-topleft:3px; + -moz-border-radius-topright:3px; + background-color:#DDCCCC; + font-size:12px; + font-weight:700; + padding:6px 15px; + display: block; +} + +.table_options_bottom { + -moz-border-radius-bottomleft:3px; + -moz-border-radius-bottomright:3px; + background-color:#DDCCCC; + font-size:12px; + font-weight:700; + padding:6px 15px; + display: block; + + margin-top:5px; +} + + +.table_sub_header { + -moz-border-radius-topleft:5px; + -moz-border-radius-topright:5px; + background-color:#EEEEEE; + border:1px solid #BBBBBB; + display:block; + font-size:14px; + font-weight:700; + margin:0 2px; + padding:3px 6px; + text-align:center; +} + + +.rich-table-subheader { + background-color:#DDCCCC; + border-top: 1px solid #C0C0C0; + border-left: 1px solid #C0C0C0; +} + +.rich-table { + border-top: none; + border-left: none; +} + +.rich-table-row { + border-left: 1px solid #C0C0C0; +} + +.rich-table-headercell,.rich-table-footercell { + background-color: #FFF; + border: none; + padding-left: 0px; + padding-right: 0px; + font-weight: none; +} + +.rich-table-thead { + border: none; +} + +.rich-table-header { + background: none; +} + +.homepage_stats { + margin-top:10px; + margin-bottom:10px; +} + + .homepage_stats_big { + color:#004DEB; + margin-top:5px; + margin-bottom:5px; + font-size: 20px; + display:block; + font-weight: normal; + } + +/* MESSAGES */ + +.message_info, +.message_1 { + display:block; + font-size: 14px; + font-weight: bold; + border:solid 1px #a0ff7d; + -moz-border-radius:3px; + -webkit-border-radius:3px; + -khtml-border-radius:3px; + background-color: #a0ff7d; + padding: 15px 15px; + margin-bottom: 15px; +} + +.message_warning, +.message_2 { + display:block; + font-size: 14px; + font-weight: bold; + border:solid 1px #ffae4c; + -moz-border-radius:3px; + -webkit-border-radius:3px; + -khtml-border-radius:3px; + background-color: #ffae4c; + padding: 15px 15px; + margin-bottom: 15px; +} + +.message_error, +.message_3 { + display:block; + font-size: 14px; + font-weight: bold; + border:solid 1px #ff5b43; + -moz-border-radius:3px; + -webkit-border-radius:3px; + -khtml-border-radius:3px; + background-color: #ff5b43; + padding: 15px 15px; + margin-bottom: 15px; +} + +.message_4 { + display:block; + font-size: 14px; + font-weight: bold; + border:solid 1px #fc9200; + background-color: #fc9200; + -moz-border-radius-topleft:3px; + -webkit-border-top-left-radius:3px; + -khtml-border-radius-topleft:3px; + -moz-border-radius-topright:3px; + -webkit-border-top-right-radius:3px; + -khtml-border-radius-topright:3px; + padding: 5px; + margin-bottom: 10px; +} + +.message_1 input, .message_1 button, .message_2 input, .message_2 button, .message_3 input, .message_3 button { + margin:0px; +} + +.message_4 h2 { + margin: 0px; + padding:5px; +} + +.message_4 input { + margin: 0px; + font-weight: bold; + font-size: 14px; + padding: 2px 5px; + margin-right: 5px; +} + +/* LOGINBOX */ + + +/* Text styles */ + +.text_justify { + text-align:justify; +} + +.text_left { + text-align:left; +} + +.text_right { + text-align:right; +} + +.text_center { + text-align:center; +} + +.text_middle { + vertical-align:middle!important; +} + +.text_top { + vertical-align:top; +} + +/* OTHER STYLES */ + +.no_wrap { + white-space: nowrap; +} + +.no_border { + border:none; +} + + +/* +** WIKI styles +*/ + +#toc, +.toc, +.mw-warning { + border: 1px solid #aaa; + background-color: #f9f9f9; + padding: 5px; + font-size: 95%; +} +#toc h2, +.toc h2 { + display: inline; + border: none; + padding: 0; + font-size: 100%; + font-weight: bold; +} +#toc #toctitle, +.toc #toctitle, +#toc .toctitle, +.toc .toctitle { + text-align: center; +} +#toc ul, +.toc ul { + list-style-type: none; + list-style-image: none; + margin-left: 0; + padding-left: 0; + text-align: left; +} +#toc ul ul, +.toc ul ul { + margin: 0 0 0 2em; +} +#toc .toctoggle, +.toc .toctoggle { + font-size: 94%; +} + +.thumbcaption { + border: none; + text-align: left; + line-height: 1.4em; + padding: 3px !important; + font-size: 94%; +} + +.location-right { + clear: right; + float: right; + border-width: .5em 0 .8em 1.4em; +} +.location-left { + float: left; + clear: left; + margin-right: .5em; + border-width: .5em 1.4em .8em 0; +} + diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/img/icon_download.png b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/img/icon_download.png new file mode 100644 index 0000000000000000000000000000000000000000..bbbb02f4ad706e5850e0102e42130cbace5843fe GIT binary patch literal 175 zcmeAS@N?(olHy`uVBq!ia0vp^{23R?$?8AvRsjW>OM?7@|Nm#Weu~!-$kp|9 zaSW-rm6YJb$|KM@+FIK2P> literal 0 HcmV?d00001 diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/img/icon_print.png b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/img/icon_print.png new file mode 100644 index 0000000000000000000000000000000000000000..27b4ac621f9a27de5b979c183874b7c518bb4fe8 GIT binary patch literal 172 zcmeAS@N?(olHy`uVBq!ia0vp^{23R?$?8AvRsjW>OM?7@|Nm#Weu~!-$kp<6 zaSW-rm6YJb%CqFNq#(ng^ae%=d9Bk9eKyKk2@WTkLIs{JW@=zyW|-8$@FB3;?;}tb NgQu&X%Q~loCID_hHemn& literal 0 HcmV?d00001 diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/img/logstats-logo.png b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/img/logstats-logo.png new file mode 100644 index 0000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(@Z8Ax3?doIt5KHh z%Wwd0QvMwD_$N(?SB`QXs6408?-TMa3@a8`N1<$?mIsiCE#i`pLk@ZUD^txo!r;US zS(?lU9ChSWlcGN-RF+a5RyT;zme&jWVv;72kFik;Z_QVKxLMJ3e1nQ|?I7-SnVYd$ za*Zfvu3TC5{>Z}cbfh*qP&H34BsVeaWg$0g>3}u`l9Iw>7R`E_U4E$lo_;l{5o5#S z9#g@WWJ?LB$1;nLk=YxlrGN}+UnMGA;l!R|6_TD8kVf)3?x&ZEV0Cx#ek44-T5~z!HO0k;8 zwIa%G3bus#FQHgr-S-F7klovpO;eI2a|D2$SP=5O*Q}ji`W>eRC1w(3B%eVgi@q?U z4}|B(aomG@fDZlv-Xq-g+oK+)+hCFx(P2dw%Ks(#mVaww!=?o zA>hs7qJ!P(9>D)~aFLI{H-hKrD6<3^Kai7Bh)F~AUD&nMpmBR1Lp2l4ua@xgl-|3* z3#cDfhFmJqFlm-+aJ1+5h``>T9_gS$k!N?Cj)*^zh=mL?w5T2CG*PP>8L6#NbI_iR zH)^Xn^`93?c6ra3wCuy>A`RHn1q4xK9{=J;zkZc6D9i}ew$UK5+9n9IDD?UlykdDb zxhU{0Hc)9{x{PBP)5Wl)03gcm^%#$3X5M~(14E301*-D*xB%gQE=Ew4Rg + + Vasc Admin + + + + + + + + + + + + + + diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/help.xhtml b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/help.xhtml new file mode 100644 index 0000000..8ed2f8f --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/help.xhtml @@ -0,0 +1,10 @@ + + Help + + diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/includes/index-pulic.xhtml b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/includes/index-pulic.xhtml new file mode 100644 index 0000000..8026865 --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/includes/index-pulic.xhtml @@ -0,0 +1,15 @@ + + +

+ + + + +
+
diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/includes/index-user.xhtml b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/includes/index-user.xhtml new file mode 100644 index 0000000..3368e39 --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/includes/index-user.xhtml @@ -0,0 +1,16 @@ + + +

+ + + + + +
+
diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/includes/layout.xhtml b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/includes/layout.xhtml new file mode 100644 index 0000000..06eaf40 --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/includes/layout.xhtml @@ -0,0 +1,71 @@ + + + + + + + + + <ui:insert name="title">Default title</ui:insert> + + + + + + + +
+ +
+

+ +
+
 
+ +
+
+ + \ No newline at end of file diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/includes/vasc-template.xhtml b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/includes/vasc-template.xhtml new file mode 100644 index 0000000..3fb7f9b --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/includes/vasc-template.xhtml @@ -0,0 +1,318 @@ + + + + + + + + + + + +

+ + + +

+ + + + +
+
+ + + + +

+ + + +

+ + + +
+
+ + + + +

+ + + + + + +

+ +
    +
  • + +
  • +
    +
+ + + +
+
+ + +

+ + +

+
+
+
+ + + + +

+ + + +

+ +

+ + + +

+
+ + + + + +
    +
  • + + + + +
  • + +
  • +
    +
+ + + + + + + + +
+ +
    +
  • + + +
  • + +
  • + + +
  • +
    + + +
  • + + +
  • +
    + +
  • ...
  • + +
  • + + +
  • +
    +
    +
  • ...
  • + +
  • + + +
  • +
    +
    +
  • + + +
  • +
+
+ + + + + + + + + + + #{entrySupport.i18nMap['generic.vasc.jsf.table.download.img']} + + + + + + #{entrySupport.i18nMap['generic.vasc.jsf.table.printer.img']} + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + #{entrySupport.i18nMap['generic.vasc.jsf.table.download.img']} + + + + + + #{entrySupport.i18nMap['generic.vasc.jsf.table.printer.img']} + + + + + + + + +
    +
  • + + +
  • + +
  • + + +
  • +
    + + +
  • + + +
  • +
    + +
  • ...
  • + +
  • + + +
  • +
    +
    +
  • ...
  • + +
  • + + +
  • +
    +
    +
  • + + +
  • +
+
+
+
+
+
+ +

+ +

+
+
+
+
+ +
+
+ diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/includes/wiki-template.xhtml b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/includes/wiki-template.xhtml new file mode 100644 index 0000000..98c0209 --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/includes/wiki-template.xhtml @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/index.xhtml b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/index.xhtml new file mode 100644 index 0000000..9559078 --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/index.xhtml @@ -0,0 +1,20 @@ + + Index + + + + + diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/index_jsp.jsp b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/index_jsp.jsp new file mode 100644 index 0000000..3255ad0 --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/index_jsp.jsp @@ -0,0 +1,2 @@ +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> + diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/login/login-error.xhtml b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/login/login-error.xhtml new file mode 100644 index 0000000..be05e55 --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/login/login-error.xhtml @@ -0,0 +1,11 @@ + + Error + + + + \ No newline at end of file diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/login/login-forgot.xhtml b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/login/login-forgot.xhtml new file mode 100644 index 0000000..fa5efcf --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/login/login-forgot.xhtml @@ -0,0 +1,11 @@ + + Forgot + + + + diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/login/login.xhtml b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/login/login.xhtml new file mode 100644 index 0000000..6ac57df --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/login/login.xhtml @@ -0,0 +1,23 @@ + + + Login + +
+ + + + + + + + +
+ + + +
+
+ \ No newline at end of file diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/login/logout.xhtml b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/login/logout.xhtml new file mode 100644 index 0000000..5ef22f0 --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/login/logout.xhtml @@ -0,0 +1,11 @@ + + Logout + + + + diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/realtime.xhtml b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/realtime.xhtml new file mode 100644 index 0000000..a50e795 --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/realtime.xhtml @@ -0,0 +1,56 @@ + + Realtime Logs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/reports.xhtml b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/reports.xhtml new file mode 100644 index 0000000..4ebdd1f --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/jsp/reports.xhtml @@ -0,0 +1,10 @@ + + Reports + + diff --git a/vasc-frontend/vasc-frontend-swing/pom.xml b/vasc-frontend/vasc-frontend-swing/pom.xml index 0507172..1a16857 100644 --- a/vasc-frontend/vasc-frontend-swing/pom.xml +++ b/vasc-frontend/vasc-frontend-swing/pom.xml @@ -5,9 +5,7 @@ net.forwardfire.vasc 0.3.5-SNAPSHOT - net.forwardfire.vasc vasc-frontend-swing - 0.3.5-SNAPSHOT vasc-frontend-swing vasc-frontend-swing diff --git a/vasc-frontend/vasc-frontend-swing/src/main/java/net/forwardfire/vasc/frontends/swing/SwingVascEditDialog.java b/vasc-frontend/vasc-frontend-swing/src/main/java/net/forwardfire/vasc/frontends/swing/SwingVascEditDialog.java index e1c9541..d75e661 100644 --- a/vasc-frontend/vasc-frontend-swing/src/main/java/net/forwardfire/vasc/frontends/swing/SwingVascEditDialog.java +++ b/vasc-frontend/vasc-frontend-swing/src/main/java/net/forwardfire/vasc/frontends/swing/SwingVascEditDialog.java @@ -23,10 +23,13 @@ package net.forwardfire.vasc.frontends.swing; import java.awt.BorderLayout; +import java.awt.FlowLayout; import java.awt.Font; +import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JLabel; import javax.swing.JPanel; @@ -74,17 +77,21 @@ public class SwingVascEditDialog extends JPanel { add(createBody(), BorderLayout.CENTER); add(createFooter(), BorderLayout.SOUTH); + editView.setLayout(new FlowLayout(FlowLayout.LEFT)); editView.add(this); } protected JPanel createHeader() { JPanel header = new JPanel(); + header.setLayout(new BoxLayout(header,BoxLayout.PAGE_AXIS)); JLabel l = new JLabel(); l.setText(swingFrontend.i18n(headerText,headerTextValue)); l.setFont(new Font(null,Font.BOLD, 14)); //l.setToolTipText(i18n(headerText)); header.add(l); + JPanel b = new JPanel(); + b.setLayout(new SpringLayout()); for (final VascLinkEntry vle:entry.getVascLinkEntries()) { JButton but = new JButton(vle.getName()); but.addActionListener(new ActionListener() { @@ -99,20 +106,20 @@ public class SwingVascEditDialog extends JPanel { Object selected = bean; for (String parameterName:vle.getEntryParameterFieldIdKeys()) { String fieldId = vle.getEntryParameterFieldId(parameterName); - VascEntryField v = ee.getVascEntryFieldById(fieldId); + VascEntryField v = entry.getVascEntryFieldById(fieldId); if (v==null) { - System.out.println("Could nog get VascEntryField for fieldID: "+fieldId); + //System.out.println("Could not get VascEntryField for fieldID: "+fieldId); continue; } if (v.getVascEntryFieldValue()==null) { - System.out.println("Could not get VascEntryFieldValue for fieldID: "+fieldId); + //System.out.println("Could not get VascEntryFieldValue for fieldID: "+fieldId); continue; } Object selectedValue = v.getVascEntryFieldValue().getValue(v, selected); // set data parameter on new vasc entry ee.getVascFrontendData().getVascEntryState().getVascBackendState().setDataParameter(parameterName, selectedValue); - System.out.println("Setting link parameter: "+parameterName+" with: "+selectedValue); + //System.out.println("Setting link parameter: "+parameterName+" with: "+selectedValue); } for (String fieldId:vle.getEntryCreateFieldValueKeys()) { @@ -138,8 +145,10 @@ public class SwingVascEditDialog extends JPanel { } } }); - header.add(but); + b.add(but); } + SpringUtilities.makeCompactGrid(b, b.getComponentCount(),1, 6,6, 6,6); + header.add(b); return header; } diff --git a/vasc-frontend/vasc-frontend-swing/src/main/java/net/forwardfire/vasc/frontends/swing/SwingVascFrontend.java b/vasc-frontend/vasc-frontend-swing/src/main/java/net/forwardfire/vasc/frontends/swing/SwingVascFrontend.java index f5a3504..2edf646 100644 --- a/vasc-frontend/vasc-frontend-swing/src/main/java/net/forwardfire/vasc/frontends/swing/SwingVascFrontend.java +++ b/vasc-frontend/vasc-frontend-swing/src/main/java/net/forwardfire/vasc/frontends/swing/SwingVascFrontend.java @@ -74,6 +74,7 @@ import net.forwardfire.vasc.frontend.VascFrontendData; import net.forwardfire.vasc.frontends.swing.ui.SwingBoolean; import net.forwardfire.vasc.frontends.swing.ui.SwingButton; import net.forwardfire.vasc.frontends.swing.ui.SwingColorChooser; +import net.forwardfire.vasc.frontends.swing.ui.SwingDate; import net.forwardfire.vasc.frontends.swing.ui.SwingLabel; import net.forwardfire.vasc.frontends.swing.ui.SwingList; import net.forwardfire.vasc.frontends.swing.ui.SwingText; @@ -121,7 +122,7 @@ public class SwingVascFrontend extends AbstractVascFrontend { // optional UI components vfd.putVascUIComponent(VascUIComponent.VASC_BOOLEAN , SwingBoolean.class.getName()); - //vfd.putVascUIComponent(VascUIComponent.VASC_DATE , SwingDate.class.getName()); + vfd.putVascUIComponent(VascUIComponent.VASC_DATE , SwingDate.class.getName()); vfd.putVascUIComponent(VascUIComponent.VASC_TEXTAREA, SwingTextArea.class.getName()); vfd.putVascUIComponent(VascUIComponent.VASC_COLOR, SwingColorChooser.class.getName()); } diff --git a/vasc-frontend/vasc-frontend-swing/src/main/java/net/forwardfire/vasc/frontends/swing/ui/SwingDate.java b/vasc-frontend/vasc-frontend-swing/src/main/java/net/forwardfire/vasc/frontends/swing/ui/SwingDate.java index 00fa1bf..600fc89 100644 --- a/vasc-frontend/vasc-frontend-swing/src/main/java/net/forwardfire/vasc/frontends/swing/ui/SwingDate.java +++ b/vasc-frontend/vasc-frontend-swing/src/main/java/net/forwardfire/vasc/frontends/swing/ui/SwingDate.java @@ -36,10 +36,8 @@ import net.forwardfire.vasc.core.VascException; import net.forwardfire.vasc.core.ui.VascUIComponent; import net.forwardfire.vasc.core.ui.VascValueModel; - import com.michaelbaranov.microba.calendar.DatePicker; - /** * * @@ -50,9 +48,10 @@ public class SwingDate implements VascUIComponent { private DatePicker datePicker = null; private Color orgBackgroundColor = null; - + public Object createComponent(VascEntry table,VascEntryField entryField,VascValueModel model,Object gui) throws VascException { datePicker = new DatePicker(); + orgBackgroundColor = datePicker.getBackground(); try { datePicker.setDate((Date)model.getValue()); diff --git a/vasc-frontend/vasc-frontend-swing/src/main/java/net/forwardfire/vasc/frontends/swing/ui/SwingText.java b/vasc-frontend/vasc-frontend-swing/src/main/java/net/forwardfire/vasc/frontends/swing/ui/SwingText.java index 609084f..3688241 100644 --- a/vasc-frontend/vasc-frontend-swing/src/main/java/net/forwardfire/vasc/frontends/swing/ui/SwingText.java +++ b/vasc-frontend/vasc-frontend-swing/src/main/java/net/forwardfire/vasc/frontends/swing/ui/SwingText.java @@ -50,6 +50,10 @@ public class SwingText implements VascUIComponent { public Object createComponent(VascEntry table,VascEntryField entryField,VascValueModel model,Object gui) throws VascException { textField = new JTextField(); + Integer sizeEdit = entryField.getSizeEdit(); + if (sizeEdit!=null) { + textField.setColumns(sizeEdit); + } orgBackgroundColor = textField.getBackground(); textField.setText(""+model.getValue()); ((JComponent)gui).add(textField); diff --git a/vasc-frontend/vasc-frontend-swing/src/main/java/net/forwardfire/vasc/frontends/swing/ui/SwingTextArea.java b/vasc-frontend/vasc-frontend-swing/src/main/java/net/forwardfire/vasc/frontends/swing/ui/SwingTextArea.java index 1c0923c..eafd34d 100644 --- a/vasc-frontend/vasc-frontend-swing/src/main/java/net/forwardfire/vasc/frontends/swing/ui/SwingTextArea.java +++ b/vasc-frontend/vasc-frontend-swing/src/main/java/net/forwardfire/vasc/frontends/swing/ui/SwingTextArea.java @@ -26,7 +26,9 @@ import java.awt.Color; import javax.swing.BorderFactory; import javax.swing.JComponent; +import javax.swing.JScrollPane; import javax.swing.JTextArea; +import javax.swing.ScrollPaneConstants; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; @@ -36,9 +38,6 @@ import net.forwardfire.vasc.core.VascException; import net.forwardfire.vasc.core.ui.VascUIComponent; import net.forwardfire.vasc.core.ui.VascValueModel; - - - /** * * @author Willem Cazander @@ -50,20 +49,33 @@ public class SwingTextArea implements VascUIComponent { private Color orgBackgroundColor = null; public Object createComponent(VascEntry entry,VascEntryField entryField,VascValueModel model,Object gui) throws VascException { - textArea = new JTextArea(); + int colsNum = 40; + int rowsNum = 8; + String cols = entryField.getVascEntryFieldType().getProperty("editor.columns"); + if (cols!=null && cols.isEmpty()==false) { + colsNum = new Integer(cols); + } + String rows = entryField.getVascEntryFieldType().getProperty("editor.rows"); + if (rows!=null && rows.isEmpty()==false) { + rowsNum = new Integer(rows); + } + textArea = new JTextArea(rowsNum,colsNum); textArea.setBorder(BorderFactory.createEtchedBorder()); - textArea.setRows(8); - - //entryField.getVascEntryFieldType().getProperty(name) - - //textArea.setRows(rows); - //textArea.setColumns(columns); orgBackgroundColor = textArea.getBackground(); textArea.setText(""+model.getValue()); - ((JComponent)gui).add(textArea); textArea.getDocument().addDocumentListener(new TextAreaListener(model,entry,this)); - return textArea; + + JScrollPane scrollPane = new JScrollPane(textArea); + scrollPane.setBorder(BorderFactory.createEmptyBorder()); + scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); + scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED); + scrollPane.getVerticalScrollBar().setUnitIncrement(10); + scrollPane.getHorizontalScrollBar().setUnitIncrement(10); + scrollPane.setSize(colsNum*10, rowsNum*20); + + ((JComponent)gui).add(scrollPane); + return scrollPane; /// TODO: mmm check return this object type } /** diff --git a/vasc-frontend/vasc-frontend-swing/src/main/resources/com/michaelbaranov/microba/calendar/DefaultCalendarResources.properties b/vasc-frontend/vasc-frontend-swing/src/main/resources/com/michaelbaranov/microba/calendar/DefaultCalendarResources.properties new file mode 100644 index 0000000..5577eb6 --- /dev/null +++ b/vasc-frontend/vasc-frontend-swing/src/main/resources/com/michaelbaranov/microba/calendar/DefaultCalendarResources.properties @@ -0,0 +1,28 @@ +en.key.none=none +en.key.today=today +de.key.none=kein +de.key.today=heute +fr.key.none=non +fr.key.today=ajourd'hui +pt.key.none=limpar +pt.key.today=hoje +ru.key.none=\u043D\u0435\u0442 +ru.key.today=\u0441\u0435\u0433\u043E\u0434\u043D\u044F +it.key.none=nessuno +it.key.today=oggi +nl.key.none=geen +nl.key.today=vandaag +es.key.none=ninguna +es.key.today=hoy +pl.key.none=\u017Caden +pl.key.today=dzisiaj +by.key.none=\u043Di\u0447\u043E\u0433\u0430 +by.key.today=\u0441\u0451\u043D\u043D\u044F +da.key.none=ingen +da.key.today=i dag +ro.key.none=sterge +ro.key.today=azi +sv.key.none=inget +sv.key.today=idag + + diff --git a/vasc-frontend/vasc-frontend-swing/src/main/resources/com/michaelbaranov/microba/calendar/resource/back-16.png b/vasc-frontend/vasc-frontend-swing/src/main/resources/com/michaelbaranov/microba/calendar/resource/back-16.png new file mode 100644 index 0000000000000000000000000000000000000000..8dc919c8430272298d201804ad8a2e220563afac GIT binary patch literal 185 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJOS+@4BLl|Xax;TbZ+)7GtVdj~_VX%M`feZwK8Z+6J>CSkka8I9sk&U5d3B!vp*ENqp OhIzXBxvX_lfx;TbZ+)7GtVdi|nUCdDZM|AVWP}{an^LB{Ts5L0vPv literal 0 HcmV?d00001 diff --git a/vasc-frontend/vasc-frontend-swing/src/main/resources/com/michaelbaranov/microba/calendar/resource/forward-16.png b/vasc-frontend/vasc-frontend-swing/src/main/resources/com/michaelbaranov/microba/calendar/resource/forward-16.png new file mode 100644 index 0000000000000000000000000000000000000000..d19caad40d5ca68fa04abff1e202d8fc9d58b4bf GIT binary patch literal 179 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJOS+@4BLl~uEx;TbZ+)7GtVdi}9_`)9g$|#V3NcOlDv5!8okUy%6L86F5 znuA94t`7002=AK&?UMoQjR5M10HtFUrDPSQWfh}g6{TSpqF)!IUl*cW7ouGlj9Dk4 zSs0;O7@$@fpHmy2P#c_09h^%ZoJ}5_N*(IiHS)?P@ujBkU&Q(QwfB zyS-*TgYUhIk1>7s5txK}xftN>fVJMX3E%E%53a{MrsuAVS}Q00000NkvXXu0mjf D)Wy*a literal 0 HcmV?d00001 diff --git a/vasc-frontend/vasc-frontend-web-jsf/src/main/java/net/forwardfire/vasc/frontends/web/jsf/AbstractJSFVascFacesControllerBase.java b/vasc-frontend/vasc-frontend-web-jsf/src/main/java/net/forwardfire/vasc/frontends/web/jsf/AbstractJSFVascFacesControllerBase.java index 2c47336..2358957 100644 --- a/vasc-frontend/vasc-frontend-web-jsf/src/main/java/net/forwardfire/vasc/frontends/web/jsf/AbstractJSFVascFacesControllerBase.java +++ b/vasc-frontend/vasc-frontend-web-jsf/src/main/java/net/forwardfire/vasc/frontends/web/jsf/AbstractJSFVascFacesControllerBase.java @@ -40,8 +40,8 @@ import net.forwardfire.vasc.impl.DefaultVascFactory; */ public abstract class AbstractJSFVascFacesControllerBase { - abstract VascFrontendData getNewVascFrontendData(); - abstract VascController getVascController(); + abstract public VascFrontendData getNewVascFrontendData(); + abstract public VascController getVascController(); public void setVascController(VascController vascController) { } diff --git a/vasc-frontend/vasc-frontend-web-jsf/src/main/java/net/forwardfire/vasc/frontends/web/jsf/VascRequestFacesFilter.java b/vasc-frontend/vasc-frontend-web-jsf/src/main/java/net/forwardfire/vasc/frontends/web/jsf/VascRequestFacesFilter.java index ffec0ae..5f1dd7b 100644 --- a/vasc-frontend/vasc-frontend-web-jsf/src/main/java/net/forwardfire/vasc/frontends/web/jsf/VascRequestFacesFilter.java +++ b/vasc-frontend/vasc-frontend-web-jsf/src/main/java/net/forwardfire/vasc/frontends/web/jsf/VascRequestFacesFilter.java @@ -71,17 +71,18 @@ public class VascRequestFacesFilter implements Filter { * @see javax.servlet.Filter#init(javax.servlet.FilterConfig) */ public void init(FilterConfig config) throws ServletException { - logger = Logger.getLogger(VascRequestFacesFilter.class.getName()); - templateFile=config.getInitParameter("templateFile"); + logger = Logger.getLogger(VascRequestFacesFilter.class.getName()); + servletContext = config.getServletContext(); + templateFile = config.getInitParameter("templateFile"); if (templateFile==null) { throw new ServletException("No templateFile init-param found."); } resourceBundle=config.getInitParameter("resourceBundle"); if (resourceBundle==null) { - throw new ServletException("No resourceBundle init-param found."); + return; //throw new ServletException("No resourceBundle init-param found."); } ResourceBundle.getBundle(resourceBundle); // test if it loads - servletContext=config.getServletContext(); + } /** @@ -161,9 +162,13 @@ public class VascRequestFacesFilter implements Filter { locale = new Locale("nl"); } try { - ResourceBundle i18n = ResourceBundle.getBundle(resourceBundle,locale); - String titleI18n = i18n.getString("vasc.entry."+entityName+".name"); - request.setAttribute("requestScopeVascEntityNameI18n" ,titleI18n); + if (resourceBundle!=null) { + ResourceBundle i18n = ResourceBundle.getBundle(resourceBundle,locale); + String titleI18n = i18n.getString("vasc.entry."+entityName+".name"); + request.setAttribute("requestScopeVascEntityNameI18n" ,titleI18n); + } else { + request.setAttribute("requestScopeVascEntityNameI18n" ,entityName); + } } catch (Exception e) { e.printStackTrace(); request.setAttribute("requestScopeVascEntityNameI18n" ,entityName); diff --git a/vasc-test/vasc-test-frontend-data/src/main/java/net/forwardfire/vasc/test/frontend/data/TestModelData.java b/vasc-test/vasc-test-frontend-data/src/main/java/net/forwardfire/vasc/test/frontend/data/TestModelData.java index fdc5589..2643c75 100644 --- a/vasc-test/vasc-test-frontend-data/src/main/java/net/forwardfire/vasc/test/frontend/data/TestModelData.java +++ b/vasc-test/vasc-test-frontend-data/src/main/java/net/forwardfire/vasc/test/frontend/data/TestModelData.java @@ -71,6 +71,7 @@ public class TestModelData { field = new DefaultVascEntryField(); field.setId("description"); + field.setVascEntryFieldType(vc.getVascEntryFieldTypeController().getVascEntryFieldTypeById("TextAreaField")); ve.addVascEntryField(field); field = new DefaultVascEntryField();