2
0
Fork 0

made first demo almost fully working

This commit is contained in:
Willem Cazander 2012-11-26 16:08:45 +01:00
parent 2a0d992642
commit 01b3b5cc54
104 changed files with 3259 additions and 2181 deletions

View file

@ -13,5 +13,6 @@
<modules>
<module>vasc-demo-server-build</module>
<module>vasc-demo-server-core</module>
<module>vasc-demo-server-build-client-swing</module>
</modules>
</project>

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>vasc-demo-server-build-client-swing</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>

View file

@ -0,0 +1,42 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>net.forwardfire.vasc.demo</groupId>
<artifactId>vasc-demo-server</artifactId>
<version>0.4.1-SNAPSHOT</version>
</parent>
<artifactId>vasc-demo-server-build-client-swing</artifactId>
<packaging>pom</packaging>
<name>vasc-demo-server-build-client-swing</name>
<description>vasc-demo-server-build-client-swing</description>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>${maven-assembly-plugin.version}</version>
<executions>
<execution>
<id>build-clients-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>src/main/assembly/bin.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>net.forwardfire.vasc.demo</groupId>
<artifactId>vasc-demo-tech-client-swing</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>

View file

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>bin</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>true</includeBaseDirectory>
<baseDirectory>vasc-demo-server-build-client-swing-${project.version}</baseDirectory>
<dependencySets>
<dependencySet>
<outputDirectory>/libs</outputDirectory>
<useProjectArtifact>false</useProjectArtifact>
<unpack>false</unpack>
<scope>runtime</scope>
</dependencySet>
</dependencySets>
<fileSets>
<fileSet>
<directory>${project.basedir}/src/main/scripts/</directory>
<outputDirectory>/</outputDirectory>
<fileMode>755</fileMode>
</fileSet>
</fileSets>
</assembly>

View file

@ -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=-Xms128m -Xmx512m -XX:MaxPermSize=128m
set MAIN_CLASS=net.forwardfire.vasc.demo.client.swing.VascDemoSwingClient
set CP=libs\*
:: Launch application
java %JAVA_OPTS% -cp "%CP%" %MAIN_CLASS%
endlocal
:: EOF

View file

@ -27,8 +27,8 @@ cd `dirname $0`;
# Config variables
JAVA="java";
JAVA_OPTS="-Xms64m -Xmx256m";
MAIN_CLASS="net.forwardfire.vasc.demo.server.core.VascTechDemoStartup";
JAVA_OPTS="-Xms128m -Xmx512m -XX:MaxPermSize=128m";
MAIN_CLASS="net.forwardfire.vasc.demo.client.swing.VascDemoSwingClient";
CP=`echo libs/*.jar | sed 's/ /:/g'`;
# Launch application

View file

@ -91,5 +91,11 @@
<artifactId>vasc-demo-tech-web</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>net.forwardfire.vasc.demo</groupId>
<artifactId>vasc-demo-server-build-client-swing</artifactId>
<version>${project.version}</version>
<type>pom</type>
</dependency>
</dependencies>
</project>

View file

@ -50,7 +50,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</fileSet>
<fileSet>
<directory>${project.basedir}/src/main/scripts/</directory>
<outputDirectory>/</outputDirectory>
<outputDirectory>/bin</outputDirectory>
<fileMode>755</fileMode>
</fileSet>
<fileSet>
@ -71,5 +71,12 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<directory>${project.basedir}/target/docs/</directory>
<outputDirectory>/docs</outputDirectory>
</fileSet>
<fileSet>
<directory>${project.parent.basedir}/vasc-demo-server-build-client-swing/target/</directory>
<outputDirectory>/clients</outputDirectory>
<includes>
<include>vasc-demo-server-build-client-swing-${project.version}-bin.zip</include>
</includes>
</fileSet>
</fileSets>
</assembly>

View file

@ -8,14 +8,9 @@
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
<Listener className="net.forwardfire.vasc.demo.server.tomcat.JndiVascDeployerListener"
vascControllerName="vasc/server-tech"
scanPath="conf/server-tech"
scanPath="conf/vasc.d"
scanTime="3"
/>
<Listener className="net.forwardfire.vasc.demo.server.tomcat.JndiVascDeployerListener"
vascControllerName="vasc/server-admin"
scanPath="conf/server-admin"
scanTime="9"
/>
<GlobalNamingResources>
<!-- Config Vasc Tech Demo -->
<Environment name="config/START_GUI" value="true" type="java.lang.Boolean"/>
@ -36,11 +31,6 @@
vascControllerProvider="net.forwardfire.vasc.demo.server.core.VascTechDemoControllerConfig"
removeLocal="false"
/>
<Resource name="vasc/server-admin" auth="Container" type="net.forwardfire.vasc.core.VascController" singleton="true" scope="Shareable"
factory="net.forwardfire.vasc.impl.jndi.JndiVascControllerFactory"
vascControllerProvider="net.forwardfire.vasc.demo.server.core.VascTechDemoControllerConfig"
removeLocal="false"
/>
</GlobalNamingResources>
<Service name="Catalina">
<Connector port="8899" protocol="HTTP/1.1" connectionTimeout="5000" redirectPort="9988" />

View file

@ -3,7 +3,12 @@
xmlns:v="http://vasc.forwardfire.net/xml/ns/vasc-lang"
xmlns:mm="http://vasc.forwardfire.net/xml/ns/vasc-backend-metamodel"
>
<v:entryGroup
id="demo-csv"
rolesView="login"
/>
<mm:csvDataContext
el.id="metaPeopleDS"
file="data/demo/meta-people.csv"
@ -11,10 +16,10 @@
<mm:metaModelBackend
id="metaPeopleBackend"
dataContextProvider="${metaPeopleDS}"
table="meta_people"
table="meta-people"
tableId="id"
/>
<v:entry id="metaPeople" backendId="metaPeopleBackend">
<v:entry id="metaPeople" backendId="metaPeopleBackend" vascGroupId="demo-csv">
<v:field id="id" list="false"/>
<v:field id="name"/>
<v:field id="age"/>
@ -33,10 +38,10 @@
<mm:metaModelBackend
id="metaProjectBackend"
dataContextProvider="${metaProjectDS}"
table="meta_project"
table="meta-project"
tableId="id"
/>
<v:entry id="metaProject" backendId="metaProjectBackend">
<v:entry id="metaProject" backendId="metaProjectBackend" vascGroupId="demo-csv">
<v:field id="id" list="false"/>
<v:field id="name"/>
<v:field id="description" vascEntryFieldType="TextAreaField"/>

View file

@ -25,12 +25,6 @@
</v:entry>
-->
<!--
<mm:schemaAutoEntry dataContextProvider="${mmdc_pf}" entryPrefix="pf" />
-->
<!--
<td:tomcatResource name="mmdc/mongo/laura" auth="Container" type="org.eobjects.metamodel.DataContext"
factory="net.forwardfire.vasc.backend.metamodel.jndi.JndiDataContextObjectFactory"

View file

@ -4,11 +4,15 @@
xmlns:mm="http://vasc.forwardfire.net/xml/ns/vasc-backend-metamodel"
xmlns:td="http://vasc.forwardfire.net/xml/ns/vasc-tech-demo"
>
<v:entryGroup
id="tech-admin"
rolesView="admin"
/>
<mm:jndiDataSourceDataContext el.id="DemoManagerDataDC" jndiName="java:jdbc/DemoManagerDataDS" />
<mm:metaModelBackend id="AdminVascUserBackend" dataContextProvider="${DemoManagerDataDC}" table="VASC_USER" tableId="ID" />
<v:entry id="AdminVascUser" backendId="AdminVascUserBackend" displayNameFieldId="username">
<v:entry id="AdminVascUser" backendId="AdminVascUserBackend" displayNameFieldId="username" vascGroupId="tech-admin">
<v:field id="id" backendName="ID" list="false" editReadOnly="true" create="false"/>
<v:field id="username" backendName="USERNAME"/>
<v:field id="password" backendName="PASSWORD"/>
@ -17,7 +21,7 @@
<mm:metaModelBackend id="AdminVascUserRoleBackend" dataContextProvider="${DemoManagerDataDC}" table="VASC_USER_ROLE" tableId="ID" />
<v:entry id="AdminVascUserRole" backendId="AdminVascUserRoleBackend" >
<v:entry id="AdminVascUserRole" backendId="AdminVascUserRoleBackend" vascGroupId="tech-admin">
<v:field id="id" backendName="ID" list="false" editReadOnly="true" create="false"/>
<v:field id="username" backendName="USERNAME" vascEntryFieldType="ListField">
<v:vascSelectItemModel entryId="AdminVascUser" keyFieldId="username"/>
@ -27,7 +31,7 @@
<mm:metaModelBackend id="AdminVascUserChangeFieldBackend" dataContextProvider="${DemoManagerDataDC}" table="VASC_USER_CHANGE_FIELD" tableId="ID" />
<v:entry id="AdminVascUserChangeField" backendId="AdminVascUserChangeFieldBackend" adminEditReadOnly="true">
<v:entry id="AdminVascUserChangeField" backendId="AdminVascUserChangeFieldBackend" adminEditReadOnly="true" vascGroupId="tech-admin">
<v:field id="id" backendName="ID" list="false" editReadOnly="true" create="false"/>
<v:field id="field" backendName="FIELD"/>
<v:field id="name" backendName="NAME"/>
@ -36,7 +40,7 @@
<mm:metaModelBackend id="AdminVascUserChangeLogBackend" dataContextProvider="${DemoManagerDataDC}" table="VASC_USER_CHANGE_LOG" tableId="ID" />
<v:entry id="AdminVascUserChangeLog" backendId="AdminVascUserChangeLogBackend" adminEditReadOnly="true">
<v:entry id="AdminVascUserChangeLog" backendId="AdminVascUserChangeLogBackend" adminEditReadOnly="true" vascGroupId="tech-admin">
<v:field id="id" backendName="ID" list="false" editReadOnly="true" create="false"/>
<v:field id="user_id" backendName="USER_ID" vascEntryFieldType="ListField">
<v:vascSelectItemModel entryId="AdminVascUser" keyFieldId="id"/>
@ -49,7 +53,7 @@
</v:entry>
<mm:metaModelBackend id="AdminVascPageBackend" dataContextProvider="${DemoManagerDataDC}" table="VASC_PAGE" tableId="ID" />
<v:entry id="AdminVascPage" backendId="AdminVascPageBackend">
<v:entry id="AdminVascPage" backendId="AdminVascPageBackend" vascGroupId="tech-admin">
<v:field id="id" backendName="ID" list="false" editReadOnly="true" create="false"/>
<v:field id="slug" backendName="SLUG"/>
<v:field id="title" backendName="TITLE"/>
@ -60,7 +64,7 @@
<mm:metaModelBackend id="AdminVascPagePartBackend" dataContextProvider="${DemoManagerDataDC}" table="VASC_PAGE_PART" tableId="ID" />
<v:entry id="AdminVascPagePart" backendId="AdminVascPagePartBackend">
<v:entry id="AdminVascPagePart" backendId="AdminVascPagePartBackend" vascGroupId="tech-admin">
<v:field id="id" backendName="ID" list="false" editReadOnly="true" create="false"/>
<v:field id="page_id" backendName="PAGE_ID" vascEntryFieldType="ListField">
<v:vascSelectItemModel entryId="AdminVascPage" keyFieldId="id" displayFieldId="slug"/>
@ -78,7 +82,7 @@
<mm:metaModelBackend id="AdminVascMenuWebBackend" dataContextProvider="${DemoManagerDataDC}" table="VASC_MENU_WEB" tableId="ID" />
<v:entry id="AdminVascMenuWeb" backendId="AdminVascMenuWebBackend">
<v:entry id="AdminVascMenuWeb" backendId="AdminVascMenuWebBackend" vascGroupId="tech-admin">
<v:listOption id="menu_type" backendName="MENU_TYPE" vascEntryFieldType="ListField" optional="true">
<v:vascSelectItemModelEnum enumClass="net.forwardfire.vasc.demo.tech.ejb3.menu.model.VascMenuWebType"/>
</v:listOption>
@ -97,31 +101,4 @@
</v:field>
</v:entry>
<mm:metaModelBackend id="AdminVascMenuGroupBackend" dataContextProvider="${DemoManagerDataDC}" table="VASC_MENU_GROUP" tableId="ID" />
<v:entry id="AdminVascMenuGroup" backendId="AdminVascMenuGroupBackend">
<v:listOption id="active" backendName="ACTIVE" vascEntryFieldType="ListField" optional="true" defaultValue="FALSE">
<v:vascSelectItemModelString nullLabel="All" data="TRUE,FALSE"/>
</v:listOption>
<v:field id="id" backendName="ID" list="false" editReadOnly="true" create="false"/>
<v:field id="title" backendName="TITLE"/>
<v:field id="active" backendName="ACTIVE" vascEntryFieldType="BooleanField"/>
<v:field id="roles" backendName="ROLES"/>
<v:field id="menu_order" backendName="MENU_ORDER" vascEntryFieldType="IntegerField"/>
</v:entry>
<mm:metaModelBackend id="AdminVascMenuBackend" dataContextProvider="${DemoManagerDataDC}" table="VASC_MENU" tableId="ID" />
<v:entry id="AdminVascMenu" backendId="AdminVascMenuBackend">
<v:listOption id="active" backendName="ACTIVE" vascEntryFieldType="ListField" optional="true" defaultValue="FALSE">
<v:vascSelectItemModelString nullLabel="All" data="TRUE,FALSE"/>
</v:listOption>
<v:field id="id" backendName="ID" list="false" editReadOnly="true" create="false"/>
<v:field id="vascEntryId" backendName="VASC_ENTRY_ID"/>
<v:field id="title" backendName="TITLE"/>
<v:field id="active" backendName="ACTIVE" vascEntryFieldType="BooleanField"/>
<v:field id="roles" backendName="ROLES"/>
<v:field id="menu_order" backendName="MENU_ORDER" vascEntryFieldType="IntegerField"/>
<v:field id="menu_group" backendName="MENU_GROUP">
</v:field>
</v:entry>
</vasc:root>

View file

@ -5,6 +5,11 @@
xmlns:td="http://vasc.forwardfire.net/xml/ns/vasc-tech-demo"
>
<v:entryGroup
id="tech-server"
rolesView="admin"
/>
<!-- Load jndi factories into tomcat. -->
<td:tomcatResource name="mmdc/server/conf/server.xml" auth="Container" type="org.eobjects.metamodel.DataContext"
factory="net.forwardfire.vasc.backend.metamodel.jndi.JndiDataContextObjectFactory"
@ -35,10 +40,10 @@
<mm:jndiDataContext el.id="mmdc5" jndiName="java:mmdc/server/conf/web.xml"/>
<!-- Auto config schema from MetaModel backends. -->
<mm:schemaAutoEntry dataContextProvider="${mmdc1}" entryPrefix="AdminConfServer" />
<mm:schemaAutoEntry dataContextProvider="${mmdc2}" entryPrefix="AdminConfLogServer" />
<mm:schemaAutoEntry dataContextProvider="${mmdc3}" entryPrefix="AdminConfLogAccess" />
<mm:schemaAutoEntry dataContextProvider="${mmdc4}" entryPrefix="AdminConfConfig" />
<mm:schemaAutoEntry dataContextProvider="${mmdc5}" entryPrefix="AdminConfWeb" />
<mm:schemaAutoEntry vascGroupId="tech-server" dataContextProvider="${mmdc1}" entryPrefix="AdminConfServer" />
<mm:schemaAutoEntry vascGroupId="tech-server" dataContextProvider="${mmdc2}" entryPrefix="AdminConfLogServer" />
<mm:schemaAutoEntry vascGroupId="tech-server" dataContextProvider="${mmdc3}" entryPrefix="AdminConfLogAccess" />
<mm:schemaAutoEntry vascGroupId="tech-server" dataContextProvider="${mmdc4}" entryPrefix="AdminConfConfig" />
<mm:schemaAutoEntry vascGroupId="tech-server" dataContextProvider="${mmdc5}" entryPrefix="AdminConfWeb" />
</vasc:root>

View file

@ -25,11 +25,12 @@ setlocal enableextensions
:: Run in app dir
cd /d %~dp0
cd ..
:: Config variables
set JAVA_OPTS=-Xms64m -Xmx256m
set JAVA_OPTS=-Xms128m -Xmx768m -XX:MaxPermSize=256m
set MAIN_CLASS=net.forwardfire.vasc.demo.server.core.VascTechDemoStartup
set CP=libs\*
set CP=libs\tomcat-el-api-* libs\*
:: Launch application
java %JAVA_OPTS% -cp "%CP%" %MAIN_CLASS%

View file

@ -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="-Xms128m -Xmx768m -XX:MaxPermSize=256m";
MAIN_CLASS="org.apache.catalina.startup.Bootstrap";
CP=`echo libs/tomcat-* | sed 's/ /:/g'`;
# Launch application
$JAVA $JAVA_OPTS -cp $CP $MAIN_CLASS stop;
# EOF

View file

@ -0,0 +1,39 @@
::
:: 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
cd ..
:: Config variables
set JAVA_OPTS=-Xms128m -Xmx768m -XX:MaxPermSize=256m
set MAIN_CLASS=net.forwardfire.vasc.demo.server.core.VascTechDemoStartup
set CP=libs\tomcat-el-api-* libs\*
:: Launch application
java %JAVA_OPTS% -cp "%CP%" %MAIN_CLASS%
endlocal
:: EOF

View file

@ -0,0 +1,39 @@
#!/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="-Xms128m -Xmx768m -XX:MaxPermSize=256m";
MAIN_CLASS="net.forwardfire.vasc.demo.server.core.VascTechDemoStartup";
CP=`echo libs/tomcat-el-api-* libs/*.jar | sed 's/ /:/g'`;
# todo: tomcat-el-api needs loaded before javaee-api for ELResolver config.
# Launch application
$JAVA $JAVA_OPTS -cp $CP $MAIN_CLASS;
# EOF

View file

@ -170,11 +170,7 @@
<exclusion>
<artifactId>myfaces-impl</artifactId>
<groupId>org.apache.myfaces.core</groupId>
</exclusion><!--
<exclusion>
<artifactId>javaee-api</artifactId>
<groupId>org.apache.openejb</groupId>
</exclusion> -->
</exclusion>
</exclusions>
</dependency>

View file

@ -205,6 +205,7 @@ public class VascTechDemoStartup {
serverConfigService.stop();
tomcatService.stop();
databaseService.stop();
swingGuiService.stop();
long stopTime = System.currentTimeMillis();
logger.info("VascTechDemo shutdown in "+(stopTime-startTime)+" ms.");
} catch (Exception e) {

View file

@ -28,22 +28,29 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.Properties;
import java.util.ResourceBundle;
import java.util.logging.Logger;
import com.sun.faces.application.ApplicationAssociate;
import com.sun.faces.application.ApplicationResourceBundle;
import net.forwardfire.vasc.backend.VascBackendControllerLocal;
import net.forwardfire.vasc.core.VascController;
import net.forwardfire.vasc.core.VascEntry;
import net.forwardfire.vasc.core.VascEntryControllerLocal;
import net.forwardfire.vasc.core.VascEntryGroup;
import net.forwardfire.vasc.core.VascEventChannelControllerLocal;
import net.forwardfire.vasc.core.VascEventControllerListener;
import net.forwardfire.vasc.core.VascEventControllerType;
import net.forwardfire.vasc.demo.server.core.VascTechDemoStartup;
import net.forwardfire.vasc.impl.DefaultVascFactory;
import net.forwardfire.vasc.impl.x4o.VascParser;
import net.forwardfire.vasc.lib.i18n.bundle.RootApplicationBundle;
import net.forwardfire.vasc.test.i18n.VascBundleCheckEntryKeys;
/**
@ -127,6 +134,10 @@ public class VascControllerService {
VascEntry ve = vascController.getVascEntryController().getVascEntryById(veId);
keys.putAll(checker.generateMissingKeys(ve));
}
for (String groupId:vascController.getVascEntryController().getVascEntryGroupIds()) {
VascEntryGroup veg = vascController.getVascEntryController().getVascEntryGroupById(groupId);
keys.putAll(checker.generateMissingKeys(veg));
}
if (keys.isEmpty()==false) {
Properties p = new Properties();
File dataDir = new File("data");
@ -150,6 +161,21 @@ public class VascControllerService {
writePropertiesFile(p,resourceFile);
ResourceBundle.clearCache();
//ApplicationResourceBundle appBundle = ApplicationAssociate.getCurrentInstance().getResourceBundles().get(RootApplicationBundle.class.getName());
//Map<Locale, ResourceBundle> resources = getFieldValue(appBundle, "resources");
//resources.clear();
}
}
@SuppressWarnings("unchecked")
private <T> T getFieldValue(Object object, String fieldName) {
try {
Field field = object.getClass().getDeclaredField(fieldName);
field.setAccessible(true);
return (T) field.get(object);
} catch (Exception e) {
return null;
}
}

View file

@ -37,8 +37,6 @@ import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.util.logging.Logger;
import javax.ejb.embeddable.EJBContainer;
import net.forwardfire.vasc.demo.server.core.VascTechDemoStartup;
import org.apache.catalina.Container;

View file

@ -22,23 +22,12 @@
package net.forwardfire.vasc.demo.server.ui;
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 java.util.logging.SimpleFormatter;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
@ -52,25 +41,19 @@ import javax.swing.SwingUtilities;
* @author Willem Cazander
* @version 1.0 May 12, 2012
*/
public class JConsolePanel extends JPanel implements ActionListener {
public class JConsolePanel extends JPanel {
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);
setLayout(new SpringLayout());
setBorder(new JFireBorder("Console Log",this));
add(createEditor());
SpringLayoutGrid.makeCompactGrid(this, 1, 1, 6, 6, 6, 6);
Logger rootLogger = Logger.getAnonymousLogger();
while (rootLogger.getParent()!=null) {
rootLogger = rootLogger.getParent();
@ -93,53 +76,14 @@ public class JConsolePanel extends JPanel implements ActionListener {
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);
private JComponent createEditor() {
logTextArea = new JTextArea(6, 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<String> 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
}
}
}
JScrollPane scrollPane = new JScrollPane(logTextArea);
scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
return scrollPane;
}
class UILogHandler extends Handler {
@ -169,9 +113,7 @@ public class JConsolePanel extends JPanel implements ActionListener {
String tt = t.substring(l,t.length());
logTextArea.setText(tt);
}
if (autoScrollBox.isSelected()) {
logTextArea.setCaretPosition(logTextArea.getText().length());
}
logTextArea.setCaretPosition(logTextArea.getText().length());
}
});
}

View file

@ -0,0 +1,148 @@
package net.forwardfire.vasc.demo.server.ui;
import java.awt.Color;
import java.awt.Component;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.GradientPaint;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Insets;
import java.awt.RenderingHints;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.swing.JComponent;
import javax.swing.UIManager;
import javax.swing.border.Border;
/**
* JFireBorder
*
* @author Willem Cazander
*/
public class JFireBorder implements Border,MouseListener {
private int radius;
boolean entered = false;
private JComponent comp = null;
private String title;
static private JFireBorder lastFireBorder = null;
private GradientPaint gradientNormal = null;
private GradientPaint gradientEntered = null;
private int gradientWidth = 0;
public JFireBorder(String title,JComponent comp) {
this.radius = 10;
this.comp=comp;
this.title = title;
comp.addMouseListener(this);
}
public Insets getBorderInsets(Component c) {
return new Insets(getTitleHeight(c)+1, 1, radius-2, 1);
}
public boolean isBorderOpaque() {
return true;
}
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
Graphics2D g2 = (Graphics2D)g;
g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
int titleHeight = getTitleHeight(c);
if (gradientWidth!=width) {
gradientNormal = null;
gradientEntered = null;
}
gradientWidth = width;
Color endColor = UIManager.getColor("control");
if (endColor==null) {
endColor = c.getBackground();
}
Color startColor = UIManager.getColor("nimbusBorder");
if (startColor==null) {
startColor = c.getForeground();
}
//BufferedImage titleImage = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration().createCompatibleImage(width, height, Transparency.TRANSLUCENT);
if (gradientNormal==null) {
gradientNormal = new GradientPaint(
0, 0, startColor,
titleHeight*5, width/3,endColor,
false);
}
if (gradientEntered==null) {
startColor = UIManager.getColor("nimbusFocus");
if (startColor==null) {
startColor = c.getForeground();
}
gradientEntered = new GradientPaint(
0, 0, startColor,
titleHeight*5, width/3,endColor,
false);
}
if (entered) {
g2.setPaint(gradientEntered);
} else {
g2.setPaint(gradientNormal);
}
g2.fillRoundRect(x, y, width, titleHeight, radius, radius);
g2.fillRect(x,titleHeight/2,radius+1, titleHeight/2);
g2.drawRoundRect(x,y,width-1,height-1,radius,radius);
if (title==null) {
return;
}
Font font = UIManager.getFont("TitledBorder.font");
g2.setColor(c.getForeground());
FontMetrics metrics = c.getFontMetrics(font);
g2.setFont(font);
g2.drawString(title,x+8,y+(titleHeight-metrics.getHeight())/2 +metrics.getAscent());
}
protected int getTitleHeight(Component c) {
Font font = UIManager.getFont("TitledBorder.font");
FontMetrics metrics = c.getFontMetrics(font);
return (int)(metrics.getHeight() * 1.40);
}
public GradientPaint getGradient() {
if (entered) {
return gradientEntered;
} else {
return gradientNormal;
}
}
@Override
public void mouseClicked(MouseEvent e) {
}
@Override
public void mouseEntered(MouseEvent e) {
if (entered==true && lastFireBorder==this) {
return;
}
entered = true;
if (comp!=null) {
comp.repaint();
if (lastFireBorder!=null) {
lastFireBorder.entered = false;
lastFireBorder.comp.repaint();
}
lastFireBorder = this;
}
}
@Override
public void mouseExited(MouseEvent e) {
}
@Override
public void mousePressed(MouseEvent e) {
}
@Override
public void mouseReleased(MouseEvent e) {
}
}

View file

@ -1,20 +0,0 @@
package net.forwardfire.vasc.demo.server.ui;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JProgressBar;
public class JStartupPanel extends JPanel {
private static final long serialVersionUID = -2880272130103870144L;
private JProgressBar bar = null;
public JStartupPanel() {
JLabel label = new JLabel("Starting up....");
add(label);
bar = new JProgressBar();
add(bar);
}
}

View file

@ -22,262 +22,295 @@
package net.forwardfire.vasc.demo.server.ui;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.Serializable;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.lang.management.ManagementFactory;
import java.lang.management.ThreadInfo;
import java.lang.management.ThreadMXBean;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JSplitPane;
import javax.swing.JTabbedPane;
import javax.swing.JTree;
import javax.swing.ScrollPaneConstants;
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 javax.swing.SpringLayout;
import net.forwardfire.vasc.core.VascEntryLocal;
import org.apache.catalina.Context;
import org.apache.catalina.Server;
import org.apache.catalina.Service;
import net.forwardfire.vasc.core.VascController;
import net.forwardfire.vasc.demo.server.core.VascTechDemoStartup;
import net.forwardfire.vasc.demo.server.core.service.VascControllerService;
import net.forwardfire.vasc.frontend.swing.SwingPanelIntegration;
import net.forwardfire.vasc.frontend.swing.SwingPanelTabbed;
import net.forwardfire.vasc.demo.server.ui.load.JLoadDialog;
import net.forwardfire.vasc.demo.server.ui.load.JLoadDialog.LoadType;
/**
* JMainPanel is the main panel/window of this demo.
* JStatusPanel is the main panel/window of this demo.
*
* @author Willem Cazander
* @version 1.0 May 12, 2012
*/
public class JStatusPanel extends JPanel {
public class JStatusPanel extends JPanel implements ActionListener {
private static final long serialVersionUID = 5834715323973411147L;
private VascControllerService vascManager = null;
private SwingPanelIntegration spi = null;
private JTabbedPane tabPane = null;
private JTree vascTree = null;
private JSplitPane bottomSplitPane = null;
private JSplitPane treeSplitPane = null;
private JButton stopButton = null;
private JButton playButton = null;
private JButton shutdownButton = null;
private JButton restartButton = null;
private JButton importJdbcButton = null;
private JButton importMongoButton = null;
private JButton importDataFileButton = null;
private JButton importDataPathButton = null;
private JLabel infoStatus = null;
private JLabel infoThreads = null;
private JLabel infoWorkers = null;
private JLabel infoSessions = null;
private JLabel infoHttpPort = null;
private JLabel infoVascGroups = null;
private JLabel infoVascEntries = null;
private JLabel infoVascBackends= null;
public JStatusPanel() {
this.vascManager=VascTechDemoStartup.getInstance().getVascControllerService();
setLayout(new BorderLayout());
add(createBottomSplit(), BorderLayout.CENTER);
public JStatusPanel() {
setLayout(new SpringLayout());
JPanel main = new JPanel();
main.setLayout(new SpringLayout());
main.add(createPanelInfoServer());
main.add(createPanelInfoVasc());
main.add(createPanelAction());
main.add(createPanelImport());
SpringLayoutGrid.makeCompactGrid(main, 2,2,0,0,6,6);
JConsolePanel consolePanel = new JConsolePanel();
add(main);
add(consolePanel);
SpringLayoutGrid.makeCompactGrid(this, 2,1,6,6,0,0);
}
private JSplitPane createBottomSplit() {
JSplitPane sp0 = createTreeSplit();
JPanel sp1 = new JConsolePanel();
bottomSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT,sp0,sp1);
bottomSplitPane.setOneTouchExpandable(true);
bottomSplitPane.setResizeWeight(0.2);
bottomSplitPane.setDividerLocation(700);
sp0.setMinimumSize(new Dimension(400, 400));
sp1.setMinimumSize(new Dimension(400, 150));
return bottomSplitPane;
}
private JSplitPane createTreeSplit() {
JScrollPane sp0 = createTreePane();
JScrollPane sp1 = createContentPane();
treeSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,sp0,sp1);
treeSplitPane.setOneTouchExpandable(true);
treeSplitPane.setResizeWeight(0.7);
treeSplitPane.setDividerLocation(200);
sp0.setMinimumSize(new Dimension(200, 400));
sp1.setMinimumSize(new Dimension(400, 400));
return treeSplitPane;
}
class VascTreeModel extends DefaultTreeModel {
public VascTreeModel(TreeNode root) {
super(root);
}
private static final long serialVersionUID = -7436681803506994277L;
private JPanel createPanelInfoVasc() {
JPanel statusPanel = new JPanel();
statusPanel.setBorder(new JFireBorder("Info Vasc",statusPanel));
statusPanel.setLayout(new SpringLayout());
infoVascGroups = new JLabel("0");
infoVascEntries = new JLabel("0");
infoVascBackends = new JLabel("0");
statusPanel.add(new JLabel("Artifact:"));
statusPanel.add(new JLabel("vasc-demo-server-core"));
statusPanel.add(new JLabel("Version:"));
statusPanel.add(new JLabel("0.X.X"));
statusPanel.add(new JLabel("Groups:"));
statusPanel.add(infoVascGroups);
statusPanel.add(new JLabel("Entries:"));
statusPanel.add(infoVascEntries);
statusPanel.add(new JLabel("Backends:"));
statusPanel.add(infoVascBackends);
SpringLayoutGrid.makeCompactGrid(statusPanel, 5, 2);
return statusPanel;
}
private JPanel createPanelInfoServer() {
JPanel statusPanel = new JPanel();
statusPanel.setBorder(new JFireBorder("Info Server",statusPanel));
statusPanel.setLayout(new SpringLayout());
infoStatus = new JLabel("booting");
infoThreads = new JLabel("0");
infoWorkers = new JLabel("0");
infoSessions = new JLabel("0");
infoHttpPort = new JLabel("0");
statusPanel.add(new JLabel("Running:"));
statusPanel.add(infoStatus);
statusPanel.add(new JLabel("HttpPort:"));
statusPanel.add(infoHttpPort);
statusPanel.add(new JLabel("Threads:"));
statusPanel.add(infoThreads);
statusPanel.add(new JLabel("Workers:"));
statusPanel.add(infoWorkers);
statusPanel.add(new JLabel("Sessions:"));
statusPanel.add(infoSessions);
SpringLayoutGrid.makeCompactGrid(statusPanel, 5, 2);
return statusPanel;
}
@Override
public void addTreeModelListener(TreeModelListener l) {
super.addTreeModelListener(l);
private JPanel createPanelImport() {
JPanel statusPanel = new JPanel();
statusPanel.setBorder(new JFireBorder("Import",statusPanel));
statusPanel.setLayout(new SpringLayout());
importJdbcButton = new JButton("Jdbc");
importMongoButton = new JButton("Mongo");
importDataFileButton = new JButton("DataFile");
importDataPathButton = new JButton("DataPath");
importJdbcButton.addActionListener(this);
importMongoButton.addActionListener(this);
importDataFileButton.addActionListener(this);
importDataPathButton.addActionListener(this);
importJdbcButton.setEnabled(false);
importMongoButton.setEnabled(false);
importDataFileButton.setEnabled(false);
importDataPathButton.setEnabled(false);
statusPanel.add(new JLabel("Import Jdbc:"));
statusPanel.add(importJdbcButton);
statusPanel.add(new JLabel("Import Mongo:"));
statusPanel.add(importMongoButton);
statusPanel.add(new JLabel("Import File:"));
statusPanel.add(importDataFileButton);
statusPanel.add(new JLabel("Data Directory:"));
statusPanel.add(importDataPathButton);
SpringLayoutGrid.makeCompactGrid(statusPanel,2,4,6,6,0,0);
return statusPanel;
}
private JPanel createPanelAction() {
JPanel actionPanel = new JPanel();
actionPanel.setBorder(new JFireBorder("Actions",actionPanel));
actionPanel.setLayout(new SpringLayout());
actionPanel.add(new JLabel("Catalina:"));
playButton = new JButton("Play");
playButton.setEnabled(false);
playButton.addActionListener(this);
actionPanel.add(playButton);
stopButton = new JButton("Stop");
stopButton.setEnabled(false);
stopButton.addActionListener(this);
actionPanel.add(stopButton);
actionPanel.add(new JLabel("Application:"));
restartButton = new JButton("Restart");
restartButton.setEnabled(false);
restartButton.addActionListener(this);
actionPanel.add(restartButton);
shutdownButton = new JButton("Shutdown");
shutdownButton.setEnabled(false);
shutdownButton.addActionListener(this);
actionPanel.add(shutdownButton);
SpringLayoutGrid.makeCompactGrid(actionPanel,2,3,6,6,0,0);
return actionPanel;
}
public void startupDone() {
infoStatus.setText("running");
//restartButton.setEnabled(true);
shutdownButton.setEnabled(true);
importJdbcButton.setEnabled(true);
importMongoButton.setEnabled(true);
//importDataFileButton.setEnabled(true);
//importDataPathButton.setEnabled(true);
updateInfo();
}
@Override
public void actionPerformed(ActionEvent e) {
if (e.getSource().equals(shutdownButton)) {
VascTechDemoStartup.getInstance().shutdown();
} else if (e.getSource().equals(importJdbcButton)) {
JLoadDialog dialog = new JLoadDialog(ServerGuiApplication.getInstance().getMainFrame(),LoadType.JDBC);
dialog.setVisible(true);
} else if (e.getSource().equals(importMongoButton)) {
JLoadDialog dialog = new JLoadDialog(ServerGuiApplication.getInstance().getMainFrame(),LoadType.MONGODB);
dialog.setVisible(true);
} else if (e.getSource().equals(importDataFileButton)) {
JLoadDialog dialog = new JLoadDialog(ServerGuiApplication.getInstance().getMainFrame(),LoadType.JDBC);
dialog.setVisible(true);
} else if (e.getSource().equals(importDataPathButton)) {
JLoadDialog dialog = new JLoadDialog(ServerGuiApplication.getInstance().getMainFrame(),LoadType.JDBC);
dialog.setVisible(true);
}
}
private JScrollPane createTreePane() {
public void updateInfo() {
DefaultMutableTreeNode root = new DefaultMutableTreeNode(new VascTreeNode(VascTreeNodeType.NONE,null));
VascController vc = VascTechDemoStartup.getInstance().getVascControllerService().getVascController();
if (vc==null) {
return;
}
Server server = VascTechDemoStartup.getInstance().getTomcatService().getServer();
if (server==null) {
return; // still booting
}
Service service = server.findService("Catalina");
if (service==null) {
return;
}
Context demoContext = VascTechDemoStartup.getInstance().getTomcatService().getApplicationContext();
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) {
VascEntryLocal ee = (VascEntryLocal)vascManager.getVascController().getVascEntryController().getVascEntryById(vascNode.id);
vascManager.getVascController().getVascEntryConfigController().configVascFrontendController(vascManager.getVascController(), ee);
spi.createNewVascView(ee);
}
}
} catch (Exception ee) {
ee.printStackTrace();
infoVascGroups.setText(""+vc.getVascEntryController().getVascEntryGroupIds().size());
infoVascEntries.setText(""+vc.getVascEntryController().getVascEntryIds().size());
infoVascBackends.setText(""+vc.getVascBackendController().getVascBackendIds().size());
int httpPort = service.findConnectors()[0].getPort();
infoHttpPort.setText(""+httpPort);
infoThreads.setText(""+Thread.activeCount());
int sessions = 0;
int workers = 0;
if (demoContext!=null) {
sessions = demoContext.getManager().getActiveSessions();
}
ThreadMXBean man = ManagementFactory.getThreadMXBean();
ThreadInfo[] infos = man.getThreadInfo(man.getAllThreadIds());
for (ThreadInfo info:infos) {
if (info.getThreadName()!=null && info.getThreadName().startsWith("http")) {
workers++;
}
}
infoWorkers.setText(""+workers);
infoSessions.setText(""+sessions);
}
/*
*
*
JMenuItem openXmlItem = new JMenuItem("Import 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();
//VascTechDemoStartup.getInstance().getVascControllerService().openFile(file);
}
} catch (Exception e1) {
e1.printStackTrace();
}
}
});
JPanel treePanel = new JPanel();
treePanel.setLayout(new GridLayout(1,0));
JScrollPane p = createJScrollPane(treePanel);
p.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
p.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
treePanel.add(vascTree);
rebuildTree();
return p;
}
private JScrollPane createContentPane() {
JPanel contentPane = new JPanel();
contentPane.setLayout(new GridLayout(1,0));
JScrollPane p = createJScrollPane(contentPane);
tabPane = new JTabbedPane();
spi = new SwingPanelTabbed(tabPane);
contentPane.add(tabPane);
return p;
}
private JScrollPane createJScrollPane(JPanel innerPanel) {
JScrollPane scrollPane = new JScrollPane(innerPanel);
scrollPane.setBorder(BorderFactory.createEmptyBorder());
scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
scrollPane.getVerticalScrollBar().setUnitIncrement(10);
scrollPane.getHorizontalScrollBar().setUnitIncrement(10);
//innerPanel.setParentScrollPane(scrollPane);
return scrollPane;
}
class VascTreeNode implements Serializable {
private static final long serialVersionUID = -1177727401194030822L;
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,
FIELD_TYPE,
BACKEND,
ENTRY
}
public void rebuildTree() {
DefaultMutableTreeNode root = (DefaultMutableTreeNode)vascTree.getModel().getRoot();
root.removeAllChildren();
DefaultMutableTreeNode fieldTypes = new DefaultMutableTreeNode("VascFieldTypes");
for (String id:vascManager.getVascController().getVascEntryFieldTypeController().getVascEntryFieldTypeIds()) {
DefaultMutableTreeNode typeNode = new DefaultMutableTreeNode(new VascTreeNode(VascTreeNodeType.FIELD_TYPE,id));
fieldTypes.add(typeNode);
}
root.add(fieldTypes);
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);
}
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);
}
public JTabbedPane getTabPane() {
return tabPane;
}
public void changeEvent() {
rebuildTree();
}
});
*/
}

View file

@ -23,28 +23,32 @@
package net.forwardfire.vasc.demo.server.ui;
import java.awt.AWTException;
import java.awt.CheckboxMenuItem;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Image;
import java.awt.Menu;
import java.awt.Font;
import java.awt.MenuItem;
import java.awt.PopupMenu;
import java.awt.SystemTray;
import java.awt.TrayIcon;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.EventObject;
import java.util.Properties;
import java.util.logging.Logger;
import javax.swing.ImageIcon;
import javax.swing.JTabbedPane;
import javax.swing.JOptionPane;
import javax.swing.UIManager;
import net.forwardfire.vasc.demo.server.core.VascTechDemoStartup;
import org.jdesktop.application.Application;
import org.jdesktop.application.FrameView;
import org.jdesktop.application.SingleFrameApplication;
import org.jdesktop.application.Application.ExitListener;
/**
* SwingGuiService Shows the demo swing gui and vasc swing frontend.
@ -54,77 +58,113 @@ import org.jdesktop.application.Application.ExitListener;
*/
public class ServerGuiApplication extends SingleFrameApplication {
private Logger logger = null;
private JStatusPanel statusPanel = null;
private ImageIcon serverIcon = null;
public ServerGuiApplication() {
logger = Logger.getLogger(ServerGuiApplication.class.getName());
}
protected void startup() {
addExitListener(new ShutdownManager());
installColorsLaF();
addExitListener(new CloseWindowExitListener());
serverIcon = createImageIcon("/net/forwardfire/vasc/demo/server/ui/resources/icon.png", "Vasc Icon");
statusPanel = new JStatusPanel();
FrameView mainView = getMainView();
mainView.setComponent(new JStartupPanel());
mainView.getFrame().setMinimumSize(new Dimension(600,200));
//mainView.getFrame().setResizable(false);
mainView.setComponent(statusPanel);
mainView.getFrame().setMinimumSize(new Dimension(640,480));
mainView.getFrame().setMaximumSize(new Dimension(800,600));
mainView.getFrame().addWindowListener(new UpdateInfoListener());
show(mainView);
startSystemTray();
}
public void startupDone() {
getMainFrame().setVisible(false);
class UpdateInfoListener extends WindowAdapter {
@Override
public void windowActivated(WindowEvent e) {
System.out.println("vis: opened -ac");
statusPanel.updateInfo();
}
@Override
public void windowDeactivated(WindowEvent e) {
System.out.println("vis: closed - ac");
}
}
class CloseWindowExitListener implements ExitListener {
@Override
public boolean canExit(EventObject event) {
if (event!=null && event.getSource().equals(ServerGuiApplication.this)) {
return true;
} else {
ServerGuiApplication.getInstance().getMainFrame().setVisible(false);
return false;
}
}
@Override
public void willExit(EventObject event) {
}
}
public void startupDone() {
statusPanel.startupDone();
}
/**
* Stop if requested from service
*/
public void stop() {
exit();
//shutdown();
exit(new EventObject(this));
}
public ImageIcon getServerIcon() {
return serverIcon;
}
static public ServerGuiApplication getInstance() {
return getInstance(ServerGuiApplication.class);
}
class ShutdownManager implements ExitListener {
public boolean canExit(EventObject e) {
return true;
}
public void willExit(EventObject event) {
VascTechDemoStartup.getInstance().shutdown();
}
}
private void startSystemTray() {
if (!SystemTray.isSupported()) {
return;
}
final PopupMenu popup = new PopupMenu();
final TrayIcon trayIcon = new TrayIcon(createImage("/net/forwardfire/vasc/demo/server/ui/resources/tray-icon.png", "tray icon"));
final TrayIcon trayIcon = new TrayIcon(createImageIcon("/net/forwardfire/vasc/demo/server/ui/resources/tray-icon.png", "tray icon").getImage());
final SystemTray tray = SystemTray.getSystemTray();
MenuItem aboutItem = new MenuItem("About");
MenuItem statusItem = new MenuItem("View Status");
MenuItem logItem = new MenuItem("View Log");
Menu displayMenu = new Menu("Launch");
MenuItem errorItem = new MenuItem("Web client");
MenuItem warningItem = new MenuItem("Swing client");
MenuItem infoItem = new MenuItem("Swt client");
MenuItem noneItem = new MenuItem("None");
aboutItem.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
JOptionPane.showMessageDialog(ServerGuiApplication.getInstance().getMainFrame(), "Vasc Demo Tech Server:\nIs build to test and demo different parts of the vasc package.", "About Vasc Demo", JOptionPane.PLAIN_MESSAGE);
}
});
MenuItem statusItem = new MenuItem("Open Status");
statusItem.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
getMainFrame().setVisible(true);
}
});
MenuItem exitItem = new MenuItem("Exit");
exitItem.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
exit();
VascTechDemoStartup.getInstance().shutdown();
}
});
popup.add(aboutItem);
popup.addSeparator();
popup.add(statusItem);
popup.add(logItem);
popup.addSeparator();
popup.add(displayMenu);
displayMenu.add(errorItem);
displayMenu.add(warningItem);
displayMenu.add(infoItem);
displayMenu.add(noneItem);
popup.add(exitItem);
popup.addSeparator();
popup.add(aboutItem);
popup.add(statusItem);
trayIcon.setPopupMenu(popup);
@ -135,11 +175,45 @@ public class ServerGuiApplication extends SingleFrameApplication {
}
}
protected static Image createImage(String path, String description) {
protected static ImageIcon createImageIcon(String path, String description) {
URL imageURL = ServerGuiApplication.class.getResource(path);
if (imageURL == null) {
throw new NullPointerException("Could not find resource: "+path);
}
return (new ImageIcon(imageURL, description)).getImage();
return new ImageIcon(imageURL, description);
}
private String installColorsLaF() {
UIManager.put("TabbedPane.font", Font.decode("SansSerif-BOLD-12"));
UIManager.put("TitledBorder.font", Font.decode("SansSerif-BOLD-16"));
UIManager.put("FireDial.font", Font.decode("SansSerif-9"));
String colorName = "laf-colors";
ClassLoader cl = Thread.currentThread().getContextClassLoader();
if (cl==null) {
cl = this.getClass().getClassLoader();
}
InputStream in = cl.getResourceAsStream("net/forwardfire/vasc/demo/server/ui/resources/"+colorName+".properties");
if (in==null) {
logger.warning("Color schema not found: "+colorName);
return "unknown";
}
try {
Properties p = new Properties();
p.load(in);
for (Object key:p.keySet()) {
String value = p.getProperty(key.toString());
Color colorValue = Color.decode(value);
UIManager.put(key,colorValue);
}
} catch (IOException e) {
logger.warning("Could not load color schema: "+colorName+" error: "+e.getMessage());
} finally {
try {
in.close();
} catch (IOException e) {
}
}
return colorName;
}
}

View file

@ -0,0 +1,241 @@
/*
* 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.server.ui.load;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Frame;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import org.eobjects.metamodel.jdbc.JdbcDataContext;
import org.eobjects.metamodel.mongodb.MongoDbDataContext;
import net.forwardfire.vasc.demo.server.ui.JFireBorder;
import net.forwardfire.vasc.demo.server.ui.ServerGuiApplication;
/**
* JLoadDialog mini wizzard for loading.
*
* @author Willem Cazander
* @version 1.0 May 9, 2012
*/
public class JLoadDialog extends JDialog implements ActionListener {
private static final long serialVersionUID = -8638394652416472734L;
private JButton prev = null;
private JButton next = null;
private JButton cancel = null;
private List<LoadStep> steps = null;
private int currentStep = 0;
private LoadStepData model = null;
private JPanel centerPanel = null;
private JLabel topLabel = null;
public enum LoadType {
CSV,
JDBC,
MONGODB
}
public JLoadDialog(Frame aFrame,LoadType type) {
setTitle("Load Edit Data");
setIconImage(ServerGuiApplication.getInstance().getServerIcon().getImage());
setMinimumSize(new Dimension(640,400));
setPreferredSize(new Dimension(640,400));
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent we) {
clearAndHide();
}
});
JPanel mainPanel = new JPanel();
// mainPanel.setBorder();
// mainPanel.setLayout(new SpringLayout());
mainPanel.setLayout(new BorderLayout());
mainPanel.add(createPanelTop(),BorderLayout.PAGE_START);
JPanel wrap = new JPanel();
wrap.setLayout(new GridLayout(1,1));
wrap.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
centerPanel = new JPanel();
//centerPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
centerPanel.setLayout(new GridLayout(1,1));
centerPanel.setBorder(new JFireBorder(null,centerPanel));
wrap.add(centerPanel);
mainPanel.add(wrap,BorderLayout.CENTER);
model = new LoadStepData();
steps = new ArrayList<LoadStep>(10);
switch(type) {
case CSV:
break;
case JDBC:
steps.add(new JLoadStepMetaJdbc());
break;
case MONGODB:
steps.add(new JLoadStepMetaMongodb());
break;
}
steps.add(new JLoadStepSelectTables());
steps.add(new JLoadStepMiscInfo());
steps.add(new JLoadStepWriteFile());
centerPanel.add(steps.get(0).getPanel());
mainPanel.add(createPanelBottom(),BorderLayout.PAGE_END);
//SpringLayoutGrid.makeCompactGrid(mainPanel, 3, 1,6,6,6,6);
getContentPane().add(mainPanel);
pack();
setLocationRelativeTo(aFrame);
}
public void clearAndHide() {
setVisible(false);
// clean up connection
if (model.dc instanceof JdbcDataContext) {
JdbcDataContext dc = (JdbcDataContext)model.dc;
try {
dc.getConnection().close();
} catch (SQLException e) {
e.printStackTrace();
}
}
if (model.dc instanceof MongoDbDataContext) {
MongoDbDataContext dc = (MongoDbDataContext)model.dc;
dc.getMongoDb().getMongo().close();
}
}
public JPanel createPanelTop() {
JPanel top = new JPanel();
top.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
top.setLayout(new GridLayout(1,1));
JPanel wrap = new JPanel();
wrap.setLayout(new FlowLayout(FlowLayout.LEFT));
wrap.setBorder(new JFireBorder("Load",top));
topLabel = new JLabel("Load data to edit...");
wrap.add(topLabel);
top.add(wrap);
return top;
}
public JPanel createPanelBottom() {
JPanel bottom = new JPanel();
bottom.setLayout(new FlowLayout(FlowLayout.RIGHT));
prev = new JButton("Prev");
next = new JButton("Next");
cancel = new JButton("Cancel");
prev.addActionListener(this);
next.addActionListener(this);
cancel.addActionListener(this);
prev.setEnabled(false);
bottom.add(prev);
bottom.add(next);
bottom.add(cancel);
return bottom;
}
public void actionPerformed(ActionEvent e) {
if (e.getSource().equals(prev)) {
gotoStepPrev();
} else if (e.getSource().equals(next)) {
gotoStepNext();
} if (e.getSource().equals(cancel)) {
clearAndHide();
}
}
public void gotoStepPrev() {
if (currentStep <= 0) {
return;
}
currentStep--;
centerPanel.removeAll();
LoadStep step = steps.get(currentStep);
centerPanel.add(step.getPanel());
topLabel.setText(step.getStepTitle());
step.setupStep(model);
SwingUtilities.updateComponentTreeUI(centerPanel);
if (currentStep==0) {
prev.setEnabled(false);
}
next.setText("Next");
}
public void gotoStepNext() {
if (currentStep == steps.size()-1) {
// perform last step
LoadStep step = steps.get(currentStep);
boolean result = step.performStep(model);
if (result==false) {
return;
}
clearAndHide();
return;
}
if (currentStep > steps.size()-1) {
return;
}
LoadStep step = steps.get(currentStep);
boolean result = step.performStep(model);
if (result==false) {
return;
}
currentStep++;
centerPanel.removeAll();
step = steps.get(currentStep);
centerPanel.add(step.getPanel());
topLabel.setText(step.getStepTitle());
step.setupStep(model);
SwingUtilities.updateComponentTreeUI(centerPanel);
if (currentStep==steps.size()-1) {
next.setText("Finish");
}
prev.setEnabled(true);
}
}

View file

@ -20,27 +20,23 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.forwardfire.vasc.demo.server.ui.actions;
package net.forwardfire.vasc.demo.server.ui.load;
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.backend.metamodel.MetaModelSchemaAutoEntry;
import net.forwardfire.vasc.demo.server.core.VascTechDemoStartup;
/**
* JDialogMetaCsv Add and runs MetaModel Schema Auto Entry code.
@ -48,29 +44,21 @@ import net.forwardfire.vasc.demo.server.core.VascTechDemoStartup;
* @author Willem Cazander
* @version 1.0 May 9, 2012
*/
public class JDialogMetaCsv extends JDialog implements ActionListener {
public class JLoadStepMetaCsv extends JPanel implements ActionListener {
private static final long serialVersionUID = -8638394652416472734L;
public JDialogMetaCsv(Frame aFrame) {
setTitle("Add csv file");
public JLoadStepMetaCsv(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);
add(mainPanel);
}
public void clearAndHide() {
@ -95,7 +83,7 @@ public class JDialogMetaCsv extends JDialog implements ActionListener {
MetaModelSchemaAutoEntry schema = new MetaModelSchemaAutoEntry();
schema.setDataContextProvider(ds);
schema.setEntryPrefix(file.getName());
schema.autoCreateEntries(VascTechDemoStartup.getInstance().getVascControllerService().getVascController());
//schema.autoCreateEntries(VascTechDemoStartup.getInstance().getVascControllerService().getVascController());
//VascTechDemoStartup.getInstance().getVascControllerService().fireChangeEvent();
}
}

View file

@ -20,28 +20,21 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.forwardfire.vasc.demo.server.ui.actions;
package net.forwardfire.vasc.demo.server.ui.load;
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.awt.FlowLayout;
import java.sql.Connection;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.SpringLayout;
import org.eobjects.metamodel.jdbc.JdbcDataContext;
import net.forwardfire.vasc.backend.metamodel.MetaModelDataContextJdbc;
import net.forwardfire.vasc.backend.metamodel.MetaModelSchemaAutoEntry;
import net.forwardfire.vasc.demo.server.core.VascTechDemoStartup;
import net.forwardfire.vasc.demo.server.ui.SpringLayoutGrid;
/**
@ -50,7 +43,7 @@ import net.forwardfire.vasc.demo.server.ui.SpringLayoutGrid;
* @author Willem Cazander
* @version 1.0 May 9, 2012
*/
public class JDialogMetaJdbc extends JDialog implements ActionListener {
public class JLoadStepMetaJdbc extends JPanel implements LoadStep {
private static final long serialVersionUID = -8638394652416472734L;
private JComboBox driverClassBox = null;
@ -59,31 +52,19 @@ public class JDialogMetaJdbc extends JDialog implements ActionListener {
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 JLoadStepMetaJdbc() {
setLayout(new FlowLayout(FlowLayout.LEFT));
add(createPanelCenter());
}
public void clearAndHide() {
setVisible(false);
public String getStepTitle() {
return "Connect to database.";
}
public JPanel getPanel() {
return this;
}
public JPanel createPanelCenter() {
JPanel result = new JPanel();
result.setLayout(new SpringLayout());
@ -105,32 +86,41 @@ public class JDialogMetaJdbc extends JDialog implements ActionListener {
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());
String dbName = url.substring(url.lastIndexOf('/')+1,url.length());
MetaModelSchemaAutoEntry schema = new MetaModelSchemaAutoEntry();
schema.setDataContextProvider(ds);
schema.setEntryPrefix(dbName);
schema.autoCreateEntries(VascTechDemoStartup.getInstance().getVascControllerService().getVascController());
//VascTechDemoStartup.getInstance().getVascControllerService().fireChangeEvent();
}
});
result.add(fileButton);
result.add(new JLabel(""));
SpringLayoutGrid.makeCompactGrid(result, 5, 2);
SpringLayoutGrid.makeCompactGrid(result, 4, 2);
return result;
}
public void actionPerformed(ActionEvent arg0) {
// TODO Auto-generated method stub
public void setupStep(LoadStepData model) {
}
}
@Override
public boolean performStep(LoadStepData model) {
String url = connectUrlField.getText();
MetaModelDataContextJdbc ds = new MetaModelDataContextJdbc();
ds.setDriverClass((String)driverClassBox.getSelectedItem());
ds.setConnectUrl(url);
ds.setUsername(usernameField.getText());
ds.setPassword(passwordField.getText());
String dbName = url.substring(url.lastIndexOf('/')+1,url.length());
try {
Connection c = ds.getConnection();
c.close();
if (model.dc instanceof JdbcDataContext) {
JdbcDataContext dc = (JdbcDataContext)model.dc;
dc.getConnection().close();
}
model.dcProvider = ds;
model.dc=ds.getDataContext();
model.name=dbName;
} catch (Exception e) {
e.printStackTrace();
JOptionPane.showMessageDialog(null, "Fatal connect error:\n"+e.getMessage(), "Jdbc Connect Error", JOptionPane.ERROR_MESSAGE);
return false;
}
return true;
}
}

View file

@ -20,65 +20,49 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.forwardfire.vasc.demo.server.ui.actions;
package net.forwardfire.vasc.demo.server.ui.load;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.FlowLayout;
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.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.SpringLayout;
import org.eobjects.metamodel.mongodb.MongoDbDataContext;
import com.mongodb.DB;
import net.forwardfire.vasc.backend.metamodel.MetaModelDataContextMongodb;
import net.forwardfire.vasc.backend.metamodel.MetaModelSchemaAutoEntry;
import net.forwardfire.vasc.demo.server.core.VascTechDemoStartup;
import net.forwardfire.vasc.demo.server.ui.SpringLayoutGrid;
/**
* JDialogMetaMongodb Add and runs MetaModel Schema Auto Entry code.
* JLoadStepMetaMongodb Add and runs MetaModel Schema Auto Entry code.
*
* @author Willem Cazander
* @version 1.0 May 9, 2012
*/
public class JDialogMetaMongodb extends JDialog implements ActionListener {
public class JLoadStepMetaMongodb extends JPanel implements LoadStep,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 JLoadStepMetaMongodb() {
setLayout(new FlowLayout(FlowLayout.LEFT));
add(createPanelCenter());
}
public void clearAndHide() {
setVisible(false);
public String getStepTitle() {
return "Connect to mongodb.";
}
public JPanel getPanel() {
return this;
}
public JPanel createPanelCenter() {
@ -86,7 +70,7 @@ public class JDialogMetaMongodb extends JDialog implements ActionListener {
result.setLayout(new SpringLayout());
result.add(new JLabel("Hostname"));
hostNameField = new JTextField("localhost");
hostNameField = new JTextField("localhost",25);
result.add(hostNameField);
result.add(new JLabel("Port"));
@ -96,31 +80,45 @@ public class JDialogMetaMongodb extends JDialog implements ActionListener {
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());
MetaModelSchemaAutoEntry schema = new MetaModelSchemaAutoEntry();
schema.setDataContextProvider(ds);
schema.setEntryPrefix(ds.getDatabase());
schema.autoCreateEntries(VascTechDemoStartup.getInstance().getVascControllerService().getVascController());
//VascTechDemoStartup.getInstance().getVascControllerService().fireChangeEvent();
}
});
result.add(fileButton);
result.add(new JLabel(""));
SpringLayoutGrid.makeCompactGrid(result, 4, 2);
SpringLayoutGrid.makeCompactGrid(result, 3, 2);
return result;
}
public void actionPerformed(ActionEvent arg0) {
// TODO Auto-generated method stub
}
public void setupStep(LoadStepData model) {
}
@Override
public boolean performStep(LoadStepData model) {
MetaModelDataContextMongodb ds = new MetaModelDataContextMongodb();
ds.setHostname(hostNameField.getText());
ds.setPort(new Integer(hostPortField.getText()));
ds.setDatabase(databaseField.getText());
try {
DB mongoDB = ds.getMongodbConnection();
mongoDB.getMongo().close();
if (model.dc instanceof MongoDbDataContext) {
MongoDbDataContext dc = (MongoDbDataContext)model.dc;
dc.getMongoDb().getMongo().close();
}
model.dcProvider = ds;
model.dc=ds.getDataContext();
model.name=ds.getDatabase();
} catch (Exception e) {
e.printStackTrace();
JOptionPane.showMessageDialog(null, "Fatal connect error:\n"+e.getMessage(), "Jdbc Connect Error", JOptionPane.ERROR_MESSAGE);
return false;
}
return true;
}
}

View file

@ -0,0 +1,98 @@
/*
* 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.server.ui.load;
import java.awt.FlowLayout;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.SpringLayout;
import net.forwardfire.vasc.demo.server.ui.SpringLayoutGrid;
/**
* JLoadStepMiscInfo
*
* @author Willem Cazander
* @version 1.0 Nov 21, 2012
*/
public class JLoadStepMiscInfo extends JPanel implements LoadStep {
private static final long serialVersionUID = -8638394652416472734L;
private JTextField filenameField = null;
private JTextField groupIdField = null;
private JTextField rolesGroupField = null;
private JTextField rolesEntryField = null;
public JLoadStepMiscInfo() {
setLayout(new FlowLayout(FlowLayout.LEFT));
add(createPanelCenter());
}
public String getStepTitle() {
return "Select Info";
}
public JPanel getPanel() {
return this;
}
public JPanel createPanelCenter() {
JPanel result = new JPanel();
result.setLayout(new SpringLayout());
filenameField = new JTextField();
groupIdField = new JTextField();
rolesGroupField = new JTextField();
rolesEntryField = new JTextField();
result.add(new JLabel("Filename:"));
result.add(filenameField);
result.add(new JLabel("groupId:"));
result.add(groupIdField);
result.add(new JLabel("rolesGroup:"));
result.add(rolesGroupField);
result.add(new JLabel("rolesEntry:"));
result.add(rolesEntryField);
SpringLayoutGrid.makeCompactGrid(result, 4, 2);
return result;
}
public void setupStep(LoadStepData model) {
filenameField.setText(model.name+".xml");
groupIdField.setText(model.name);
rolesGroupField.setText("login,admin");
rolesEntryField.setText("login,admin");
}
@Override
public boolean performStep(LoadStepData model) {
model.filename = filenameField.getText();
model.groupId = groupIdField.getText();
model.rolesGroup = rolesGroupField.getText();
model.rolesEntry = rolesEntryField.getText();
return true;
}
}

View file

@ -0,0 +1,180 @@
/*
* 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.server.ui.load;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.ScrollPaneConstants;
import javax.swing.SpringLayout;
import javax.swing.table.AbstractTableModel;
import org.eobjects.metamodel.DataContext;
import net.forwardfire.vasc.demo.server.ui.SpringLayoutGrid;
/**
* JLoadStepSelectTables select tables to load.
*
* @author Willem Cazander
* @version 1.0 May 9, 2012
*/
public class JLoadStepSelectTables extends JPanel implements LoadStep {
private static final long serialVersionUID = -8638394652416472734L;
private JTable table = null;
private MetaModelTableModel tableModel = null;
private DataContext dcOld = null;
public JLoadStepSelectTables() {
setLayout(new SpringLayout());
add(createPanelCenter());
SpringLayoutGrid.makeCompactGrid(this, 1, 1, 6, 6, 6, 6);
}
public String getStepTitle() {
return "Select Tables";
}
public JPanel getPanel() {
return this;
}
public JComponent createPanelCenter() {
tableModel = new MetaModelTableModel();
table = new JTable(tableModel);
table.setFillsViewportHeight(true);
table.setShowHorizontalLines(true);
table.setAutoscrolls(true);
//((JComponent) table.getDefaultRenderer(Boolean.class)).setOpaque(true);// let backgroup color work correctly
JScrollPane scrollPane = new JScrollPane(table);
scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
return scrollPane;
}
public void setupStep(LoadStepData model) {
if (model.tables.isEmpty() | (dcOld!=null && dcOld!=model.dc)) {
tableModel.setData(Arrays.asList(model.dc.getDefaultSchema().getTableNames()));
dcOld = model.dc;
}
}
@Override
public boolean performStep(LoadStepData model) {
model.tables.clear();
for (TableRow row:tableModel.getData()) {
if (row.load) {
model.tables.add(row.table);
}
}
return true;
}
class TableRow {
String table;
boolean load = true;
}
class MetaModelTableModel extends AbstractTableModel {
private static final long serialVersionUID = 5487313677918103654L;
private List<TableRow> data = new ArrayList<TableRow>();
public void setData(List<String> tables) {
data.clear();
for (String table:tables) {
TableRow row = new TableRow();
row.table=table;
data.add(row);
}
fireTableDataChanged();
}
public List<TableRow> getData() {
return data;
}
@Override
public Class<?> getColumnClass(int columnIndex) {
if (columnIndex==0) {
return String.class;
} else {
return Boolean.class;
}
}
@Override
public int getColumnCount() {
return 2;
}
@Override
public String getColumnName(int columnIndex) {
if (columnIndex==0) {
return "TableName";
} else {
return "Import";
}
}
@Override
public int getRowCount() {
return data.size();
}
@Override
public Object getValueAt(int rowIndex, int columnIndex) {
TableRow row = data.get(rowIndex);
if (columnIndex==0) {
return row.table;
} else {
return new Boolean(row.load);
}
}
@Override
public boolean isCellEditable(int rowIndex, int columnIndex) {
return columnIndex>0;
}
@Override
public void setValueAt(Object value, int rowIndex, int columnIndex) {
if (columnIndex==1) {
TableRow row = data.get(rowIndex);
if (value instanceof Boolean) {
row.load = (Boolean)value;
}
}
}
}
}

View file

@ -0,0 +1,118 @@
/*
* 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.server.ui.load;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStreamWriter;
import java.io.StringWriter;
import java.io.Writer;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.ScrollPaneConstants;
import javax.swing.SpringLayout;
import org.x4o.xml.sax.XMLWriter;
import net.forwardfire.vasc.core.VascController;
import net.forwardfire.vasc.demo.server.core.VascTechDemoStartup;
import net.forwardfire.vasc.demo.server.ui.SpringLayoutGrid;
/**
* JLoadStepWriteFile writes the file.
*
* @author Willem Cazander
* @version 1.0 Nov 21, 2012
*/
public class JLoadStepWriteFile extends JPanel implements LoadStep,ActionListener {
private static final long serialVersionUID = -8638394652416472734L;
private JTextArea text = null;
public JLoadStepWriteFile() {
setLayout(new SpringLayout());
add(createPanelCenter());
SpringLayoutGrid.makeCompactGrid(this, 1, 1, 6, 6, 6, 6);
}
public String getStepTitle() {
return "Select Tables";
}
public JPanel getPanel() {
return this;
}
public JComponent createPanelCenter() {
text = new JTextArea(13,45);
text.setAutoscrolls(true);
JScrollPane scrollPane = new JScrollPane(text);
scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
return scrollPane;
}
public void actionPerformed(ActionEvent arg0) {
// TODO Auto-generated method stub
}
public void setupStep(LoadStepData model) {
try {
VascController vc = VascTechDemoStartup.getInstance().getVascControllerService().getVascController();
StringWriter out = new StringWriter();
XMLWriter outXml = new XMLWriter(out);
LoadVascXmlWriter writer = new LoadVascXmlWriter(outXml,vc);
writer.writeXml(model);
text.setText(out.getBuffer().toString());
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public boolean performStep(LoadStepData model) {
try {
VascController vc = VascTechDemoStartup.getInstance().getVascControllerService().getVascController();
File tmpFile = new File("conf/vasc.d/"+model.filename);// File.createTempFile("vasc","xml");
System.out.println("write to : "+tmpFile);
Writer out = new OutputStreamWriter(new FileOutputStream(tmpFile));
XMLWriter outXml = new XMLWriter(out);
LoadVascXmlWriter writer = new LoadVascXmlWriter(outXml,vc);
writer.writeXml(model);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return true;
}
}

View file

@ -0,0 +1,43 @@
/*
* 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.
*/
/**
* LoadStep are the load wizzard steps.
*
* @author Willem Cazander
* @version 1.0 Nov 21, 2012
*/
package net.forwardfire.vasc.demo.server.ui.load;
import javax.swing.JPanel;
public interface LoadStep {
JPanel getPanel();
String getStepTitle();
void setupStep(LoadStepData model);
boolean performStep(LoadStepData model);
}

View file

@ -0,0 +1,50 @@
/*
* 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.server.ui.load;
import java.util.ArrayList;
import java.util.List;
import org.eobjects.metamodel.DataContext;
import net.forwardfire.vasc.backend.metamodel.MetaModelDataContextProvider;
/**
* LoadStepData Simple model to load wizzard steps.
*
* @author Willem Cazander
* @version 1.0 Nov 21, 2012
*/
public class LoadStepData {
public String name = null;
public MetaModelDataContextProvider dcProvider = null;
public DataContext dc = null;
public String filename = null;
public String groupId = null;
public String rolesGroup = null;
public String rolesEntry = null;
public List<String> tables = new ArrayList<String>();
}

View file

@ -0,0 +1,242 @@
/*
* 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.server.ui.load;
import net.forwardfire.vasc.backend.metamodel.MetaModelDataContextJdbc;
import net.forwardfire.vasc.backend.metamodel.MetaModelDataContextMongodb;
import net.forwardfire.vasc.backend.metamodel.MetaModelSchemaAutoEntry;
import net.forwardfire.vasc.backend.metamodel.MetaModelVascBackend;
import net.forwardfire.vasc.core.VascController;
import net.forwardfire.vasc.core.VascEntry;
import net.forwardfire.vasc.core.VascEntryField;
import net.forwardfire.vasc.core.VascEntryFieldType;
import net.forwardfire.vasc.core.VascEntryLink;
import net.forwardfire.vasc.core.VascEntryLinkType;
import net.forwardfire.vasc.impl.ui.VascSelectItemModelEntry;
import org.xml.sax.SAXException;
import org.xml.sax.ext.DefaultHandler2;
import org.xml.sax.helpers.AttributesImpl;
/**
* LoadVascXmlWriter writes the xml tags.
* note: need to move this to x4o
*
* @author Willem Cazander
* @version 1.0 Nov 22, 2012
*/
public class LoadVascXmlWriter {
private VascController vc = null;
private DefaultHandler2 xmlWriter = null;
static private final String URI_VASC_ROOT = "http://vasc.forwardfire.net/xml/ns/vasc-root";
static private final String URI_VASC_LANG = "http://vasc.forwardfire.net/xml/ns/vasc-lang";
static private final String URI_META_MODEL = "http://vasc.forwardfire.net/xml/ns/vasc-backend-metamodel";
static private final String URI_VASC_DEMO = "http://vasc.forwardfire.net/xml/ns/vasc-tech-demo";
public LoadVascXmlWriter(DefaultHandler2 xmlWriter,VascController vc) {
this.xmlWriter=xmlWriter;
this.vc=vc;
}
public void writeXml(LoadStepData model) throws SAXException {
MetaModelSchemaAutoEntry autoEntry = new MetaModelSchemaAutoEntry();
autoEntry.setVascGroupId(model.groupId);
autoEntry.setEntryPrefix(model.name);
autoEntry.setDataContextProvider(model.dcProvider);
autoEntry.getTables().addAll(model.tables);
autoEntry.autoFillResult(vc);
xmlWriter.startDocument();
char[] msg;
msg = "\n".toCharArray();
xmlWriter.ignorableWhitespace(msg,0,msg.length);
xmlWriter.startPrefixMapping("vasc", URI_VASC_ROOT);
xmlWriter.startPrefixMapping("v", URI_VASC_LANG);
xmlWriter.startPrefixMapping("mm", URI_META_MODEL);
xmlWriter.startPrefixMapping("td", URI_VASC_DEMO);
AttributesImpl atts = new AttributesImpl();
xmlWriter.startElement (URI_VASC_ROOT, "root", "", atts);
msg = "Auto generated vasc xml example.".toCharArray();
xmlWriter.comment(msg,0,msg.length);
writeGroup(model.groupId,model.rolesGroup);
writeMetaProvider(model);
for (MetaModelVascBackend vb:autoEntry.getResultBackends()) {
writeEntryBackend(vb,model);
}
for (VascEntry ve:autoEntry.getResultEntries()) {
writeEntry(ve,model);
}
xmlWriter.endElement(URI_VASC_ROOT, "root", "");
xmlWriter.endDocument();
}
private void writeMetaProvider(LoadStepData model) throws SAXException {
AttributesImpl atts = null;
if (model.dcProvider instanceof MetaModelDataContextMongodb) {
MetaModelDataContextMongodb mongo = (MetaModelDataContextMongodb)model.dcProvider;
atts = new AttributesImpl();
atts.addAttribute ("", "el.id", "", "", model.name+"DC");
if (mongo.getHostname()!=null) {
atts.addAttribute ("", "hostname", "", "", mongo.getHostname());
}
if (mongo.getDatabase()!=null) {
atts.addAttribute ("", "database", "", "", mongo.getDatabase());
}
if (mongo.getUsername()!=null) {
atts.addAttribute ("", "username", "", "", mongo.getUsername());
}
if (mongo.getPassword()!=null) {
atts.addAttribute ("", "password", "", "", mongo.getPassword());
}
atts.addAttribute ("", "port", "", "", ""+mongo.getPort());
xmlWriter.startElement (URI_META_MODEL, "mongodbDataContext", "", atts);
xmlWriter.endElement(URI_META_MODEL, "mongodbDataContext", "");
} else if (model.dcProvider instanceof MetaModelDataContextJdbc) {
MetaModelDataContextJdbc jdbc = (MetaModelDataContextJdbc)model.dcProvider;
atts = new AttributesImpl();
atts.addAttribute ("", "name", "", "", "jdbc/load/"+model.name+"DS");
atts.addAttribute ("", "auth", "", "", "Container");
atts.addAttribute ("", "type", "", "", "javax.sql.DataSource");
atts.addAttribute ("", "factory", "", "", "org.apache.tomcat.jdbc.pool.DataSourceFactory");
atts.addAttribute ("", "initialSize", "", "", "1");
atts.addAttribute ("", "minIdle", "", "", "1");
atts.addAttribute ("", "username", "", "", jdbc.getUsername());
atts.addAttribute ("", "password", "", "", jdbc.getPassword());
atts.addAttribute ("", "driverClassName", "", "", jdbc.getDriverClass());
atts.addAttribute ("", "url", "", "", jdbc.getConnectUrl());
xmlWriter.startElement (URI_VASC_DEMO, "tomcatResource", "", atts);
xmlWriter.endElement(URI_VASC_DEMO, "tomcatResource", "");
atts = new AttributesImpl();
atts.addAttribute ("", "el.id", "", "", model.name+"DC");
atts.addAttribute ("", "jndiName", "", "", "java:jdbc/load/"+model.name+"DS");
xmlWriter.startElement (URI_META_MODEL, "jndiDataSourceDataContext", "", atts);
xmlWriter.endElement(URI_META_MODEL, "jndiDataSourceDataContext", "");
}
}
private void writeGroup(String groupId,String roles) throws SAXException {
AttributesImpl atts = new AttributesImpl();
atts.addAttribute ("", "id", "", "", groupId);
atts.addAttribute ("", "rolesView", "", "", roles);
xmlWriter.startElement (URI_VASC_LANG, "entryGroup", "", atts);
xmlWriter.endElement(URI_VASC_LANG, "entryGroup", "");
}
private void writeEntryBackend(MetaModelVascBackend vb,LoadStepData model) throws SAXException {
AttributesImpl atts = new AttributesImpl();
atts.addAttribute ("", "id", "", "", vb.getId());
atts.addAttribute ("", "dataContextProvider", "", "", "${"+model.name+ "DC}");
atts.addAttribute ("", "table", "", "", vb.getTable());
atts.addAttribute ("", "tableId", "", "", vb.getTableId());
xmlWriter.startElement (URI_META_MODEL, "metaModelBackend", "", atts);
xmlWriter.endElement(URI_META_MODEL, "metaModelBackend", "");
}
private void writeEntry(VascEntry ve,LoadStepData model) throws SAXException {
AttributesImpl atts = new AttributesImpl();
atts.addAttribute ("", "id", "", "", ve.getId());
atts.addAttribute ("", "backendId", "", "", ve.getBackendId());
atts.addAttribute ("", "primaryKeyFieldId", "", "", ve.getPrimaryKeyFieldId());
if (ve.getDisplayNameFieldId()!=null) {
atts.addAttribute ("", "displayNameFieldId", "", "", ve.getDisplayNameFieldId());
}
if (ve.getVascGroupId()!=null) {
atts.addAttribute ("", "vascGroupId", "", "", ve.getVascGroupId());
}
if (ve.getAccessType()!=null) {
atts.addAttribute ("", "accessType", "", "", ve.getAccessType().name());
}
xmlWriter.startElement (URI_VASC_LANG, "entry", "", atts);
createFields(ve);
for (VascEntryLink vel:ve.getVascEntryLinks()) {
atts = new AttributesImpl();
atts.addAttribute ("", "id", "", "", vel.getId());
if (vel.getVascEntryLinkType()!=null && vel.getVascEntryLinkType()!=VascEntryLinkType.DEFAULT_TYPE) {
atts.addAttribute ("", "vascEntryLinkType", "", "", ""+vel.getVascEntryLinkType());
}
atts.addAttribute ("", "vascEntryId", "", "", vel.getVascEntryId());
xmlWriter.startElement (URI_VASC_LANG, "link", "", atts);
for (String key:vel.getEntryParameterFieldIdKeys()) {
String value = vel.getEntryParameterFieldId(key);
atts = new AttributesImpl();
atts.addAttribute ("", "name", "", "", key);
atts.addAttribute ("", "valueFieldId", "", "", value);
xmlWriter.startElement (URI_VASC_LANG, "linkParameter", "", atts);
xmlWriter.endElement(URI_VASC_LANG, "linkParameter", "");
}
xmlWriter.endElement(URI_VASC_LANG, "link", "");
}
xmlWriter.endElement(URI_VASC_LANG, "entry", "");
}
private void createFields(VascEntry ve) throws SAXException {
for (VascEntryField f:ve.getVascEntryFields()) {
AttributesImpl atts = new AttributesImpl();
atts.addAttribute ("", "id", "", "", f.getId());
VascEntryFieldType type = f.getVascEntryFieldType();
if (type!=null) {
atts.addAttribute ("", "vascEntryFieldType", "", "", type.getId());
}
if (f.getEditReadOnly()!=null) {
atts.addAttribute ("", "editReadOnly", "", "", ""+f.getEditReadOnly());
}
//atts.addAttribute ("", "vascGroupId", "", "", model.groupId);
xmlWriter.startElement (URI_VASC_LANG, "field", "", atts);
if (type!=null && "ListField".equals(type.getId())) {
VascSelectItemModelEntry link = (VascSelectItemModelEntry)type.getDataObject();
atts = new AttributesImpl();
atts.addAttribute ("", "entryId", "", "", ""+link.getEntryId());
atts.addAttribute ("", "displayFieldId", "", "", ""+link.getDisplayFieldId());
xmlWriter.startElement (URI_VASC_LANG, "vascSelectItemModel", "", atts);
xmlWriter.endElement(URI_VASC_LANG, "vascSelectItemModel", "");
}
xmlWriter.endElement(URI_VASC_LANG, "field", "");
}
}
}

View file

@ -63,27 +63,6 @@ CREATE INDEX vasc_page_part_page_id_idx ON vasc_page_part(page_id);
CREATE INDEX vasc_page_part_active_idx ON vasc_page_part(active);
CREATE INDEX vasc_page_part_sitemap_idx ON vasc_page_part(sitemap);
CREATE TABLE vasc_menu_group (
id varchar not null primary key,
title varchar not null,
active BOOLEAN NOT NULL,
roles varchar not null,
menu_order integer not null,
);
CREATE INDEX vasc_menu_group_active_idx ON vasc_menu_group(active);
CREATE TABLE vasc_menu (
id IDENTITY not null primary key,
vasc_entry_id varchar not null,
title varchar not null,
active BOOLEAN NOT NULL,
roles varchar not null,
menu_order integer not null,
menu_group varchar not null
);
CREATE INDEX vasc_menu_active_idx ON vasc_menu(active);
CREATE TABLE vasc_menu_web (
id IDENTITY not null primary key,
href varchar not null,
@ -135,22 +114,6 @@ INSERT INTO vasc_page_part VALUES(10,6, 'metamodel','', TRUE,TRUE,TRUE,3,'WIKI',
-- INSERT INTO vasc_page VALUES(1, 'home','home','Welcome to the vasc demo, please login as admin to view all stuff.');
INSERT INTO vasc_menu_group VALUES('demo', 'Demo',true,'',1);
INSERT INTO vasc_menu_group VALUES('meta', 'Meta',true,'',2);
INSERT INTO vasc_menu VALUES(1,'metaPeople', 'People', true,'',1,'meta');
INSERT INTO vasc_menu VALUES(2,'metaProjects', 'Projects',true,'',2,'meta');
INSERT INTO vasc_menu VALUES(3,'AdminVascUser', 'Users', true,'',1,'demo');
INSERT INTO vasc_menu VALUES(4,'AdminVascUserRole', 'UserRole',true,'',2,'demo');
INSERT INTO vasc_menu VALUES(5,'AdminVascUserChangeField','ChangeField', true,'',3,'demo');
INSERT INTO vasc_menu VALUES(6,'AdminVascUserChangeLog', 'ChangeLog',true,'',4,'demo');
INSERT INTO vasc_menu VALUES(7,'AdminVascPage', 'Pages', true,'',5,'demo');
INSERT INTO vasc_menu VALUES(8,'AdminVascPagePart', 'PagesPart',true,'',6,'demo');
INSERT INTO vasc_menu VALUES( 9,'AdminVascMenuWeb', 'MenuWeb', true,'',7,'demo');
INSERT INTO vasc_menu VALUES(10,'AdminVascMenuGroup', 'MenuGroup',true,'',8,'demo');
INSERT INTO vasc_menu VALUES(11,'AdminVascMenu', 'Menu', true,'',9,'demo');
INSERT INTO vasc_menu_web VALUES(1, '/html/index.jsf','Home', '',true,'',1,'BAR_RIGHT');
INSERT INTO vasc_menu_web VALUES(2, '/html/admin/debug.jsf','Debug','',true,'admin',2,'BAR_RIGHT');
INSERT INTO vasc_menu_web VALUES(3, '/html/admin/index.jsf','Admin','',true,'admin',3,'BAR_RIGHT');

View file

@ -29,7 +29,7 @@ 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
Application.icon = icon.png
Application.web.meta.robots = index, follow
Application.web.meta.description = Vasc Tech Demo Web Frontends

View file

@ -0,0 +1,12 @@
#
# Default dark red color thema for pulsefire
#
text=#DF0A0A
info=#370A00
control=#0A1428
nimbusBase=#00050A
nimbusFocus=#0A6428
nimbusOrange=#00960A
nimbusBorder=#34415E
nimbusDisabledText=#850F0F
nimbusLightBackground=#050A28

Binary file not shown.

Before

Width:  |  Height:  |  Size: 644 B

After

Width:  |  Height:  |  Size: 400 B

Before After
Before After