deleted renamed files.
This commit is contained in:
parent
6ccd763d1f
commit
d4e537a2bf
56 changed files with 0 additions and 7032 deletions
|
|
@ -1,30 +0,0 @@
|
|||
#
|
||||
# Vasc Demo Tech logging config.
|
||||
#
|
||||
|
||||
# Only log to a file
|
||||
handlers=java.util.logging.FileHandler
|
||||
|
||||
# default file output is in startup directory.
|
||||
java.util.logging.FileHandler.pattern=logs/vasc-demo-tech.log
|
||||
java.util.logging.FileHandler.limit=0
|
||||
java.util.logging.FileHandler.count=1
|
||||
java.util.logging.FileHandler.encoding=UTF8
|
||||
java.util.logging.FileHandler.formatter=net.forwardfire.vasc.demo.tech.ui.PatternLogFormatter
|
||||
|
||||
# The PatternLogFormatter lets you customise the log output;
|
||||
# %d = Formated date string %s =-Source method
|
||||
# %l = Logger level %c = Source Class
|
||||
# %n = Logger name %C = Source Class Simple
|
||||
# %m = Logger message %S = Stacktrace
|
||||
# %t = Thread ID %r = Return/newline
|
||||
#net.forwardfire.vasc.demo.tech.ui.PatternLogFormatter.log_pattern=%d %l [%C.%s] %m%r
|
||||
#net.forwardfire.vasc.demo.tech.ui.PatternLogFormatter.log_error_pattern=%d %l [%C.%s] %m%r%S
|
||||
#net.forwardfire.vasc.demo.tech.ui.PatternLogFormatter.date_pattern=yyyy-MM-dd HH:mm:ss
|
||||
|
||||
# Default global logging level.
|
||||
.level=INFO
|
||||
|
||||
# Different log levels for packages.
|
||||
net.forwardfire.vasc.demo.level=INFO
|
||||
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
|
||||
gui=true
|
||||
editor=true
|
||||
contextPath=/demo
|
||||
host=localhost
|
||||
port=8899
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
/*
|
||||
* Copyright 2007-2012 forwardfire.net All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
* that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
* the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.forwardfire.vasc.demo.tech.core;
|
||||
|
||||
import net.forwardfire.vasc.core.VascController;
|
||||
import net.forwardfire.vasc.core.VascControllerProvider;
|
||||
|
||||
/**
|
||||
* DemoVascControllerProvider gets the static local jvm vasc controller for this tech demo.
|
||||
*
|
||||
* @author Willem Cazander
|
||||
* @version 1.0 May 12, 2012
|
||||
*/
|
||||
public class DemoVascControllerProvider implements VascControllerProvider {
|
||||
|
||||
/**
|
||||
* @see net.forwardfire.vasc.core.VascControllerProvider#getVascController()
|
||||
*/
|
||||
public VascController getVascController() {
|
||||
return DemoVascManager.getVascControllerStatic();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,134 +0,0 @@
|
|||
/*
|
||||
* Copyright 2007-2012 forwardfire.net All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
* that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
* the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.forwardfire.vasc.demo.tech.core;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import net.forwardfire.vasc.backend.VascBackendControllerLocal;
|
||||
import net.forwardfire.vasc.core.VascController;
|
||||
import net.forwardfire.vasc.core.VascEntryConfigController;
|
||||
import net.forwardfire.vasc.core.VascEntryControllerLocal;
|
||||
import net.forwardfire.vasc.core.VascException;
|
||||
import net.forwardfire.vasc.impl.DefaultVascFactory;
|
||||
import net.forwardfire.vasc.impl.entry.export.VascEntryExporterJR4O;
|
||||
import net.forwardfire.vasc.impl.x4o.VascParser;
|
||||
import net.forwardfire.vasc.lib.jr4o.JR4ODesignManager.JRExportType;
|
||||
|
||||
/**
|
||||
* DemoVascManager manages the dynamic vasc controller for tech demo.
|
||||
*
|
||||
* @author Willem Cazander
|
||||
* @version 1.0 May 12, 2012
|
||||
*/
|
||||
public class DemoVascManager {
|
||||
|
||||
private Logger logger = null;
|
||||
static private VascController vascController = null;
|
||||
|
||||
public DemoVascManager() {
|
||||
logger = Logger.getLogger(DemoVascManager.class.getName());
|
||||
}
|
||||
|
||||
public void start() {
|
||||
logger.finer("Starting vascmanager");
|
||||
if (vascController!=null) {
|
||||
throw new RuntimeException("VascManager is already started.");
|
||||
}
|
||||
try {
|
||||
vascController = DefaultVascFactory.getDefaultVascController(2288L,"forwardfire.net","user","admin");
|
||||
|
||||
VascEntryConfigController vecc = vascController.getVascEntryConfigController();
|
||||
|
||||
// Config all report export engines for demo.
|
||||
vecc.addVascEntryExporter(new VascEntryExporterJR4O("jrPdfLandscape",JRExportType.PDF,"generic-landscape","net/forwardfire/vasc/lib/jr4o/reports/dynamic-reports.xml"));
|
||||
vecc.addVascEntryExporter(new VascEntryExporterJR4O("jrPdfPortrait",JRExportType.PDF,"generic-portrait","net/forwardfire/vasc/lib/jr4o/reports/dynamic-reports.xml"));
|
||||
vecc.addVascEntryExporter(new VascEntryExporterJR4O("jrRtf",JRExportType.RTF,"generic-landscape","net/forwardfire/vasc/lib/jr4o/reports/dynamic-reports.xml"));
|
||||
vecc.addVascEntryExporter(new VascEntryExporterJR4O("jrXls",JRExportType.XLS,"generic-landscape","net/forwardfire/vasc/lib/jr4o/reports/dynamic-reports.xml"));
|
||||
vecc.addVascEntryExporter(new VascEntryExporterJR4O("jrXml",JRExportType.XML,"generic-landscape","net/forwardfire/vasc/lib/jr4o/reports/dynamic-reports.xml"));
|
||||
vecc.addVascEntryExporter(new VascEntryExporterJR4O("jrCsv",JRExportType.CSV,"generic-landscape","net/forwardfire/vasc/lib/jr4o/reports/dynamic-reports.xml"));
|
||||
|
||||
// Config root bundle to load all resources.
|
||||
vecc.setResourceBundle("net.forwardfire.vasc.lib.i18n.bundle.RootApplicationBundle");
|
||||
|
||||
// Config some defaults
|
||||
vecc.setDefaultPageSize(200);
|
||||
vecc.setDefaultPageSizeMax(1500);
|
||||
|
||||
} catch (VascException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
if (vascController==null) {
|
||||
return;
|
||||
}
|
||||
VascBackendControllerLocal backends = (VascBackendControllerLocal)vascController.getVascBackendController();
|
||||
backends.clearAndStopBackends();
|
||||
|
||||
vascController = null;
|
||||
logger.info("Stop manager, cleared all.");
|
||||
}
|
||||
|
||||
public void startEditor() {
|
||||
try {
|
||||
VascParser parser = new VascParser(vascController);
|
||||
parser.addGlobalELBean("vascController", vascController);
|
||||
parser.parseResource("net/forwardfire/vasc/editor/vasc-edit.xml");
|
||||
|
||||
DefaultVascFactory.fillVascControllerLocalEntries((VascEntryControllerLocal) vascController.getVascEntryController(), vascController);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void openFile(File file) {
|
||||
logger.info("Vasc open file: "+file.getAbsoluteFile());
|
||||
try {
|
||||
VascParser parser = new VascParser(vascController);
|
||||
//File f = File.createTempFile("test-vasc", ".xml");
|
||||
//parser.setDebugOutputStream(new FileOutputStream(f));
|
||||
parser.parseFile(file);
|
||||
|
||||
DefaultVascFactory.fillVascControllerLocalEntries((VascEntryControllerLocal) vascController.getVascEntryController(), vascController);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public VascController getVascController() {
|
||||
return vascController;
|
||||
}
|
||||
|
||||
/**
|
||||
* Needed for the provider interface
|
||||
* @return
|
||||
*/
|
||||
static protected VascController getVascControllerStatic() {
|
||||
return vascController;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>vasc-demo-tech-ui</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,176 +0,0 @@
|
|||
<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>
|
||||
<artifactId>vasc-demo-tech</artifactId>
|
||||
<groupId>net.forwardfire.vasc.demo</groupId>
|
||||
<version>0.3.5-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
<artifactId>vasc-demo-tech-ui</artifactId>
|
||||
<name>vasc-demo-tech-ui</name>
|
||||
<description>vasc-demo-tech-ui</description>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.x4o</groupId>
|
||||
<artifactId>x4o-core</artifactId>
|
||||
<version>${x4o-core.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>javax.el</groupId>
|
||||
<artifactId>el-api</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.forwardfire.vasc.demo</groupId>
|
||||
<artifactId>vasc-demo-tech-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.forwardfire.vasc.demo</groupId>
|
||||
<artifactId>vasc-demo-tech-editor</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.forwardfire.vasc.demo</groupId>
|
||||
<artifactId>vasc-demo-tech-web</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.forwardfire.vasc</groupId>
|
||||
<artifactId>vasc-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.forwardfire.vasc</groupId>
|
||||
<artifactId>vasc-frontend-swing</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.forwardfire.vasc</groupId>
|
||||
<artifactId>vasc-frontend-web-jsf</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.forwardfire.vasc</groupId>
|
||||
<artifactId>vasc-frontend-web-export</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.forwardfire.vasc</groupId>
|
||||
<artifactId>vasc-frontend-cxf-server</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.forwardfire.vasc</groupId>
|
||||
<artifactId>vasc-backend-ldap</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.forwardfire.vasc</groupId>
|
||||
<artifactId>vasc-backend-mongodb</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.forwardfire.vasc</groupId>
|
||||
<artifactId>vasc-backend-metamodel</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.forwardfire.vasc</groupId>
|
||||
<artifactId>vasc-backend-jdbc</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.forwardfire.vasc.lib</groupId>
|
||||
<artifactId>vasc-lib-i18n</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.forwardfire.vasc.test</groupId>
|
||||
<artifactId>vasc-test-i18n</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jdesktop.bsaf</groupId>
|
||||
<artifactId>bsaf</artifactId>
|
||||
<version>${bsaf.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>jnlp</artifactId>
|
||||
<groupId>javax.jnlp</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<version>9.1-901.jdbc4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>5.1.19</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-jdk14</artifactId>
|
||||
<version>1.6.4</version>
|
||||
</dependency>
|
||||
<!-- Tomcat deps -->
|
||||
<dependency>
|
||||
<groupId>org.apache.tomcat.embed</groupId>
|
||||
<artifactId>tomcat-embed-core</artifactId>
|
||||
<version>7.0.22</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.tomcat.embed</groupId>
|
||||
<artifactId>tomcat-embed-jasper</artifactId>
|
||||
<version>7.0.22</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.tomcat</groupId>
|
||||
<artifactId>tomcat-jasper</artifactId>
|
||||
<version>7.0.22</version>
|
||||
</dependency>
|
||||
<!-- Web tech deps -->
|
||||
<dependency>
|
||||
<groupId>com.sun.facelets</groupId>
|
||||
<artifactId>jsf-facelets</artifactId>
|
||||
<version>1.1.15.B1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>jstl</artifactId>
|
||||
<version>1.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.faces</groupId>
|
||||
<artifactId>jsf-api</artifactId>
|
||||
<version>1.2_12</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.faces</groupId>
|
||||
<artifactId>jsf-impl</artifactId>
|
||||
<version>1.2_12</version>
|
||||
</dependency>
|
||||
|
||||
<!-- RichFaces libraries -->
|
||||
<dependency>
|
||||
<groupId>org.richfaces.framework</groupId>
|
||||
<artifactId>richfaces-api</artifactId>
|
||||
<version>3.3.3-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.richfaces.framework</groupId>
|
||||
<artifactId>richfaces-impl</artifactId>
|
||||
<version>3.3.3-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.richfaces.ui</groupId>
|
||||
<artifactId>richfaces-ui</artifactId>
|
||||
<version>3.3.3-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
@ -1,158 +0,0 @@
|
|||
package net.forwardfire.vasc.demo.tech.ui;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.math.BigInteger;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import net.forwardfire.vasc.demo.tech.ui.components.JMainPanel;
|
||||
|
||||
public class DeployManager {
|
||||
|
||||
private Logger logger = null;
|
||||
private File deployDir = null;
|
||||
private int scanPeriod = 3;
|
||||
private AutoDeployManager autoDeployManager = null;
|
||||
private Map<File,String> fileCheckSums = null;
|
||||
|
||||
public DeployManager() {
|
||||
logger = Logger.getLogger(DeployManager.class.getName());
|
||||
fileCheckSums = new HashMap<File,String>(20);
|
||||
}
|
||||
|
||||
public void start() {
|
||||
if (deployDir==null) {
|
||||
throw new NullPointerException("Can't deploy with null deployDir.");
|
||||
}
|
||||
if (deployDir.exists()==false) {
|
||||
throw new IllegalStateException("Can't deploy with non-existing deployDir.");
|
||||
}
|
||||
if (deployDir.isDirectory()==false) {
|
||||
throw new IllegalStateException("Can't deploy with non-directory deployDir.");
|
||||
}
|
||||
Thread scanThread = new Thread(new AutoDeployManager());
|
||||
scanThread.setName("hotdeploy-scanner");
|
||||
scanThread.start();
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
if (autoDeployManager==null) {
|
||||
return;
|
||||
}
|
||||
autoDeployManager.stop();
|
||||
}
|
||||
|
||||
|
||||
public String createMd5Sum(File file) throws IOException, NoSuchAlgorithmException {
|
||||
FileInputStream in = new FileInputStream(file.getAbsolutePath());
|
||||
try {
|
||||
byte[] b = new byte[1024 * 64];
|
||||
int num = 0;
|
||||
MessageDigest md = MessageDigest.getInstance("MD5");
|
||||
while ((num = in.read(b)) != -1) {
|
||||
md.update(b, 0, num);
|
||||
}
|
||||
byte[] hashBytes = md.digest();
|
||||
BigInteger hashResult = new BigInteger(hashBytes);
|
||||
String hashString = hashResult.toString(16);
|
||||
return hashString;
|
||||
} finally {
|
||||
if (in != null) {
|
||||
in.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void hotDeployVasc() throws NoSuchAlgorithmException, IOException {
|
||||
boolean deployed = false;
|
||||
for (File file:deployDir.listFiles()) {
|
||||
if (file.canRead()==false) {
|
||||
continue;
|
||||
}
|
||||
if (file.getName().endsWith("xml")==false) {
|
||||
continue;
|
||||
}
|
||||
String md5File = createMd5Sum(file);
|
||||
String md5Deploy = fileCheckSums.get(file);
|
||||
if (md5Deploy!=null && md5Deploy.equals(md5File)) {
|
||||
continue;
|
||||
}
|
||||
fileCheckSums.put(file, md5File);
|
||||
deployed = true;
|
||||
TechUI.getInstance().getVascManager().openFile(file);
|
||||
}
|
||||
if (deployed) {
|
||||
((JMainPanel)TechUI.getInstance().getMainView().getComponent()).rebuildTree();
|
||||
}
|
||||
}
|
||||
|
||||
protected class AutoDeployManager implements Runnable {
|
||||
private volatile boolean run = true;
|
||||
public void run() {
|
||||
try {
|
||||
Thread.sleep(5000); // let gui+tomcat start
|
||||
logger.info("AutoDeployManager started");
|
||||
while(run) {
|
||||
try {
|
||||
hotDeployVasc();
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.WARNING,"Error while depoying: "+e.getMessage(),e);
|
||||
}
|
||||
|
||||
if (scanPeriod == 0) {
|
||||
scanPeriod = 1;
|
||||
}
|
||||
try {
|
||||
Thread.sleep(1000*scanPeriod);
|
||||
} catch (InterruptedException ie) {
|
||||
logger.info("Interrupted sleep");
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.SEVERE,"Error in run: "+e.getMessage(),e);
|
||||
} finally {
|
||||
logger.info("AutoDeployManager stoped");
|
||||
}
|
||||
}
|
||||
public void stop() {
|
||||
run = false;
|
||||
this.notify();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the deployDir
|
||||
*/
|
||||
public File getDeployDir() {
|
||||
return deployDir;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param deployDir the deployDir to set
|
||||
*/
|
||||
public void setDeployDir(File deployDir) {
|
||||
this.deployDir = deployDir;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the scanPeriod
|
||||
*/
|
||||
public int getScanPeriod() {
|
||||
return scanPeriod;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param scanPeriod the scanPeriod to set
|
||||
*/
|
||||
public void setScanPeriod(int scanPeriod) {
|
||||
this.scanPeriod = scanPeriod;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,134 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2011, Willem Cazander
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
* that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
* the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.forwardfire.vasc.demo.tech.ui;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
import java.text.DateFormat;
|
||||
import java.text.MessageFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.logging.Formatter;
|
||||
import java.util.logging.LogManager;
|
||||
import java.util.logging.LogRecord;
|
||||
|
||||
/**
|
||||
* PatternLogFormatter Formats the messages of the logger.
|
||||
*
|
||||
* @author Willem Cazander
|
||||
*/
|
||||
public class PatternLogFormatter extends Formatter {
|
||||
|
||||
private final String lineSeperator;
|
||||
private final MessageFormat logFormat;
|
||||
private final MessageFormat logErrorFormat;
|
||||
private final DateFormat dateFormat;
|
||||
static private final String DEFAULT_LOG_FORMAT = "%d %l [%C.%s] %m%r";
|
||||
static private final String DEFAULT_LOG_ERROR_FORMAT = "%d %l [%C.%s] %m%r%S";
|
||||
static private final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
|
||||
static private final String[] LOG_OPTIONS = {
|
||||
"%d", /* Formated date string */
|
||||
"%l", /* Logger level */
|
||||
"%n", /* Logger name */
|
||||
"%m", /* Logger message */
|
||||
"%t", /* Thread ID */
|
||||
"%s", /* Source method */
|
||||
"%c", /* Source Class */
|
||||
"%C", /* Source Class Simple */
|
||||
"%S", /* Stacktrace */
|
||||
"%r", /* Return/newline */
|
||||
};
|
||||
|
||||
public PatternLogFormatter() {
|
||||
String logFormatStr = LogManager.getLogManager().getProperty(getClass().getName()+".log_pattern");
|
||||
String logFormatErrorStr = LogManager.getLogManager().getProperty(getClass().getName()+".log_error_pattern");
|
||||
String logDateStr = LogManager.getLogManager().getProperty(getClass().getName()+".date_pattern");
|
||||
|
||||
if (logDateStr!=null && logDateStr.isEmpty()==false) {
|
||||
dateFormat = new SimpleDateFormat(logDateStr);
|
||||
} else {
|
||||
dateFormat = new SimpleDateFormat(DEFAULT_DATE_FORMAT);
|
||||
}
|
||||
|
||||
if (logFormatStr==null || logFormatStr.isEmpty()) {
|
||||
logFormatStr = DEFAULT_LOG_FORMAT;
|
||||
}
|
||||
if (logFormatStr.contains("{") || logFormatStr.contains("}")) {
|
||||
throw new IllegalArgumentException("Curly braces not allowed in log pattern.");
|
||||
}
|
||||
for (int i=0;i<LOG_OPTIONS.length;i++) {
|
||||
logFormatStr = logFormatStr.replace(LOG_OPTIONS[i], "{"+i+"}");
|
||||
}
|
||||
logFormat = new MessageFormat(logFormatStr);
|
||||
|
||||
if (logFormatErrorStr==null || logFormatErrorStr.isEmpty()) {
|
||||
logFormatErrorStr = DEFAULT_LOG_ERROR_FORMAT;
|
||||
}
|
||||
if (logFormatErrorStr.contains("{") || logFormatErrorStr.contains("}")) {
|
||||
throw new IllegalArgumentException("Curly braces not allowed in log pattern.");
|
||||
}
|
||||
for (int i=0;i<LOG_OPTIONS.length;i++) {
|
||||
logFormatErrorStr = logFormatErrorStr.replace(LOG_OPTIONS[i], "{"+i+"}");
|
||||
}
|
||||
logErrorFormat = new MessageFormat(logFormatErrorStr);
|
||||
|
||||
lineSeperator = String.format("%n"); // Used platform dependent seperator
|
||||
}
|
||||
|
||||
@Override
|
||||
public String format(LogRecord record) {
|
||||
String[] logFields = new String[10];
|
||||
logFields[1] = record.getLevel().toString();
|
||||
logFields[2] = record.getLoggerName();
|
||||
logFields[3] = record.getMessage();
|
||||
if ((logFields[3] == null || logFields[3].isEmpty()) && record.getThrown()!=null) {
|
||||
logFields[3] = record.getThrown().getMessage();
|
||||
}
|
||||
logFields[4] = Integer.toString(record.getThreadID());
|
||||
logFields[5] = record.getSourceMethodName() != null ? record.getSourceMethodName() : "?";
|
||||
logFields[6] = record.getSourceClassName() != null ? record.getSourceClassName() : "?";
|
||||
int dotIdx = logFields[6].lastIndexOf(".") + 1;
|
||||
if (dotIdx > 0 && dotIdx < logFields[6].length()) {
|
||||
logFields[7] = logFields[6].substring(dotIdx);
|
||||
} else {
|
||||
logFields[7] = logFields[6];
|
||||
}
|
||||
logFields[8] = record.getThrown()!=null ? createStackTrace(record.getThrown()) : "";
|
||||
logFields[9] = lineSeperator;
|
||||
synchronized (logFormat) {
|
||||
logFields[0] = dateFormat.format(new Date(record.getMillis())); // dateFormat is guarded by the logFormat lock.
|
||||
if (record.getThrown()==null) {
|
||||
return logFormat.format(logFields);
|
||||
} else {
|
||||
return logErrorFormat.format(logFields);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private String createStackTrace(Throwable t) {
|
||||
StringWriter buf = new StringWriter();
|
||||
t.printStackTrace(new PrintWriter(buf));
|
||||
return buf.getBuffer().toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,273 +0,0 @@
|
|||
/*
|
||||
* Copyright 2007-2012 forwardfire.net All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
* that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
* the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.forwardfire.vasc.demo.tech.ui;
|
||||
|
||||
import java.awt.Dimension;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
import java.util.EventObject;
|
||||
import java.util.Properties;
|
||||
import java.util.logging.FileHandler;
|
||||
import java.util.logging.Handler;
|
||||
import java.util.logging.LogManager;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.swing.JOptionPane;
|
||||
|
||||
import org.apache.juli.logging.LogFactory;
|
||||
import org.jdesktop.application.Application;
|
||||
import org.jdesktop.application.FrameView;
|
||||
import org.jdesktop.application.SingleFrameApplication;
|
||||
|
||||
import net.forwardfire.vasc.core.VascController;
|
||||
import net.forwardfire.vasc.demo.tech.core.DemoVascManager;
|
||||
import net.forwardfire.vasc.demo.tech.ui.components.JMainPanel;
|
||||
import net.forwardfire.vasc.demo.tech.ui.components.JMainPanelMenuBar;
|
||||
|
||||
public class TechUI extends SingleFrameApplication {
|
||||
|
||||
private Logger logger = null;
|
||||
private boolean showGui = false;
|
||||
private DemoVascManager vascManager = null;
|
||||
private TomcatManager tomcatManager = null;
|
||||
private DeployManager deployManager = null;
|
||||
|
||||
static public void main(String[] args) {
|
||||
Application.launch(TechUI.class, args);
|
||||
}
|
||||
|
||||
/**
|
||||
* Config logging and setup logger object.
|
||||
*/
|
||||
private void setupLogging() {
|
||||
|
||||
LogFactory.getLog(TechUI.class); // init JULI so reconfig is done once.
|
||||
|
||||
File logConfig = new File("config/logging.properties");
|
||||
if (logConfig.exists()) {
|
||||
InputStream in = null;
|
||||
try {
|
||||
in = new FileInputStream(logConfig);
|
||||
LogManager.getLogManager().readConfiguration(in);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if (in!=null) {
|
||||
try {
|
||||
in.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Logger rootLogger = Logger.getAnonymousLogger();
|
||||
while (rootLogger.getParent()!=null) {
|
||||
rootLogger = rootLogger.getParent();
|
||||
}
|
||||
for (Handler h:rootLogger.getHandlers()) {
|
||||
h.setFormatter(new PatternLogFormatter());
|
||||
}
|
||||
}
|
||||
logger = Logger.getLogger(TechUI.class.getName());
|
||||
}
|
||||
|
||||
class ShutdownManager implements ExitListener {
|
||||
public boolean canExit(EventObject e) {
|
||||
return true;
|
||||
}
|
||||
public void willExit(EventObject event) {
|
||||
logger.info("Shutdown requested.");
|
||||
long startTime = System.currentTimeMillis();
|
||||
deployManager.stop();
|
||||
try {
|
||||
tomcatManager.stop();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
vascManager.stop();
|
||||
long stopTime = System.currentTimeMillis();
|
||||
logger.info("TechUI stopped in "+(stopTime-startTime)+" ms.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected void initialize(String[] argu) {
|
||||
long startTime = System.currentTimeMillis();
|
||||
|
||||
// First parse user program arguments.
|
||||
String serverHost = null;
|
||||
String serverPort = null;
|
||||
String contextPath = null;
|
||||
boolean editor = false;
|
||||
showGui = false;
|
||||
|
||||
File propFile = new File("config/server.properties");
|
||||
if (propFile.exists()) {
|
||||
|
||||
InputStream in = null;
|
||||
try {
|
||||
in = new FileInputStream(propFile);
|
||||
Properties p = new Properties();
|
||||
p.load(in);
|
||||
serverHost = p.getProperty("host");
|
||||
serverPort = p.getProperty("port");
|
||||
contextPath = p.getProperty("contextPath");
|
||||
if ("true".equalsIgnoreCase(p.getProperty("gui"))) {
|
||||
showGui = true;
|
||||
} else {
|
||||
showGui = false;
|
||||
}
|
||||
if ("true".equalsIgnoreCase(p.getProperty("editor"))) {
|
||||
editor = true;
|
||||
} else {
|
||||
editor = false;
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if (in!=null) {
|
||||
try {
|
||||
in.close();
|
||||
} catch (IOException e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
serverHost = "localhost";
|
||||
serverPort = "8899";
|
||||
}
|
||||
|
||||
|
||||
setupLogging();
|
||||
logger.info("Starting Vasc-Demo-Tech-UI.");
|
||||
|
||||
File deployDir = new File("deploy");
|
||||
File workDir = new File("workdir");
|
||||
if (isMavenRun()) {
|
||||
if (deployDir.exists()==false) {
|
||||
deployDir.mkdir();
|
||||
}
|
||||
if (workDir.exists()==false) {
|
||||
workDir.mkdir();
|
||||
}
|
||||
}
|
||||
|
||||
vascManager = new DemoVascManager();
|
||||
vascManager.start();
|
||||
if (editor) {
|
||||
vascManager.startEditor();
|
||||
}
|
||||
|
||||
deployManager = new DeployManager();
|
||||
deployManager.setDeployDir(deployDir);
|
||||
deployManager.start();
|
||||
|
||||
tomcatManager = new TomcatManager();
|
||||
tomcatManager.setWorkDir(workDir);
|
||||
tomcatManager.setVascController(vascManager.getVascController());
|
||||
if (serverHost!=null) {
|
||||
tomcatManager.setHostname(serverHost);
|
||||
}
|
||||
if (serverPort!=null) {
|
||||
tomcatManager.setPort(new Integer(serverPort));
|
||||
}
|
||||
if (contextPath!=null) {
|
||||
tomcatManager.setContextPath(contextPath);
|
||||
}
|
||||
|
||||
Thread t = new Thread(new Runnable() {
|
||||
public void run() {
|
||||
try {
|
||||
Thread.sleep(2000); // let gui come up.
|
||||
tomcatManager.start();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
});
|
||||
t.start();
|
||||
|
||||
long stopTime = System.currentTimeMillis();
|
||||
logger.info("TechUI initialized in "+(stopTime-startTime)+" ms.");
|
||||
}
|
||||
|
||||
protected void startup() {
|
||||
try {
|
||||
long startTime = System.currentTimeMillis();
|
||||
addExitListener(new ShutdownManager());
|
||||
|
||||
if (showGui) {
|
||||
FrameView mainView = getMainView();
|
||||
mainView.setComponent(new JMainPanel());
|
||||
mainView.setMenuBar(new JMainPanelMenuBar());
|
||||
mainView.getFrame().setMinimumSize(new Dimension(1024-64,768-128));
|
||||
show(mainView);
|
||||
} else {
|
||||
Thread t = new Thread(new Runnable() {
|
||||
public void run() {
|
||||
while(true)
|
||||
try {
|
||||
Thread.sleep(3333);
|
||||
} catch (InterruptedException e) {
|
||||
}
|
||||
}
|
||||
});
|
||||
t.start();
|
||||
}
|
||||
|
||||
long stopTime = System.currentTimeMillis();
|
||||
logger.info("TechUI startup in "+(stopTime-startTime)+" ms total startup in "+(stopTime-startTime)+" ms.");
|
||||
} catch (Exception e) {
|
||||
StringWriter sw = new StringWriter();
|
||||
e.printStackTrace(new PrintWriter(sw));
|
||||
JOptionPane.showMessageDialog(null, "Fatal Startup Error:\n"+sw.getBuffer().toString(), "Vasc Demo Tech Startup Error", JOptionPane.ERROR_MESSAGE);
|
||||
e.printStackTrace();
|
||||
System.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
static public TechUI getInstance() {
|
||||
return getInstance(TechUI.class);
|
||||
}
|
||||
|
||||
public DemoVascManager getVascManager() {
|
||||
return vascManager;
|
||||
}
|
||||
|
||||
public VascController getVascController() {
|
||||
return vascManager.getVascController();
|
||||
}
|
||||
|
||||
public boolean isMavenRun() {
|
||||
return System.getProperty("java.class.path").contains("classes");
|
||||
}
|
||||
}
|
||||
|
|
@ -1,174 +0,0 @@
|
|||
package net.forwardfire.vasc.demo.tech.ui;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.util.Enumeration;
|
||||
import java.util.jar.JarEntry;
|
||||
import java.util.jar.JarFile;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import net.forwardfire.vasc.core.VascController;
|
||||
|
||||
import org.apache.catalina.startup.Bootstrap;
|
||||
import org.apache.catalina.startup.Tomcat;
|
||||
import org.apache.catalina.valves.AccessLogValve;
|
||||
|
||||
public class TomcatManager {
|
||||
|
||||
private Logger logger = null;
|
||||
private Tomcat tomcat = null;
|
||||
private VascController vascController = null;
|
||||
private String hostname = null;
|
||||
private Integer port = null;
|
||||
private File workDir = null;
|
||||
private String contextPath = null;
|
||||
|
||||
public TomcatManager() {
|
||||
logger = Logger.getLogger(TomcatManager.class.getName());
|
||||
hostname = "localhost";
|
||||
port = 8899;
|
||||
contextPath = "/demo";
|
||||
}
|
||||
|
||||
public void start() throws Exception {
|
||||
if (workDir==null) {
|
||||
throw new NullPointerException("Can't start tomcat with null workDir.");
|
||||
}
|
||||
Tomcat tomcat = new Tomcat();
|
||||
tomcat.setBaseDir(workDir.getAbsolutePath());
|
||||
tomcat.setPort(getPort());
|
||||
tomcat.setHostname(getHostname());
|
||||
|
||||
tomcat.init();
|
||||
|
||||
if (TechUI.getInstance().isMavenRun()==false) {
|
||||
AccessLogValve accessLog = new AccessLogValve();
|
||||
accessLog.setDirectory("../logs");
|
||||
accessLog.setSuffix(".log");
|
||||
accessLog.setPattern("%h %l %u %t "%r" %s %b");
|
||||
tomcat.getHost().getPipeline().addValve(accessLog);
|
||||
}
|
||||
|
||||
if (TechUI.getInstance().isMavenRun()) {
|
||||
String webappPathLocation = "../vasc-demo-tech-web/src/main/webapp/";
|
||||
String deployPath = new File(webappPathLocation).getAbsolutePath();
|
||||
logger.info("Deploy demo app from workspace path: "+deployPath);
|
||||
tomcat.addWebapp(getContextPath(),deployPath);
|
||||
} else {
|
||||
|
||||
File techWarFile = null;
|
||||
for (File file:new File("lib").listFiles()) {
|
||||
if (file.getName().contains("vasc-demo-tech-web")) {
|
||||
techWarFile = file;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (techWarFile==null) {
|
||||
throw new NullPointerException("Could not locate war file in lib directory.");
|
||||
}
|
||||
File destDir = new File(workDir,"tomcat.wars"+File.separator+techWarFile.getName());
|
||||
if (destDir.exists()==false) {
|
||||
destDir.mkdirs();
|
||||
JarFile jar = new JarFile(techWarFile);
|
||||
Enumeration<JarEntry> jars = jar.entries();
|
||||
while (jars.hasMoreElements()) {
|
||||
java.util.jar.JarEntry file = jars.nextElement();
|
||||
java.io.File f = new java.io.File(destDir+File.separator+file.getName());
|
||||
if (file.isDirectory()) {
|
||||
f.mkdir();
|
||||
continue;
|
||||
}
|
||||
InputStream is = jar.getInputStream(file);
|
||||
FileOutputStream fos = new FileOutputStream(f);
|
||||
while (is.available() > 0) {
|
||||
fos.write(is.read()); // slow copy
|
||||
}
|
||||
fos.close();
|
||||
is.close();
|
||||
}
|
||||
}
|
||||
String deployPath = destDir.getAbsolutePath();
|
||||
logger.info("Deploy war path: "+deployPath);
|
||||
tomcat.addWebapp(getContextPath(),deployPath);
|
||||
}
|
||||
tomcat.start();
|
||||
}
|
||||
|
||||
public void stop() throws Exception {
|
||||
if (tomcat==null) {
|
||||
return;
|
||||
}
|
||||
tomcat.stop();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the vascController
|
||||
*/
|
||||
public VascController getVascController() {
|
||||
return vascController;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param vascController the vascController to set
|
||||
*/
|
||||
public void setVascController(VascController vascController) {
|
||||
this.vascController = vascController;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the hostname
|
||||
*/
|
||||
public String getHostname() {
|
||||
return hostname;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param hostname the hostname to set
|
||||
*/
|
||||
public void setHostname(String hostname) {
|
||||
this.hostname = hostname;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the port
|
||||
*/
|
||||
public Integer getPort() {
|
||||
return port;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param port the port to set
|
||||
*/
|
||||
public void setPort(Integer port) {
|
||||
this.port = port;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the workDir
|
||||
*/
|
||||
public File getWorkDir() {
|
||||
return workDir;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param workDir the workDir to set
|
||||
*/
|
||||
public void setWorkDir(File workDir) {
|
||||
this.workDir = workDir;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the contextPath
|
||||
*/
|
||||
public String getContextPath() {
|
||||
return contextPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param contextPath the contextPath to set
|
||||
*/
|
||||
public void setContextPath(String contextPath) {
|
||||
this.contextPath = contextPath;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,85 +0,0 @@
|
|||
package net.forwardfire.vasc.demo.tech.ui.actions;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Frame;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
import java.io.File;
|
||||
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JDialog;
|
||||
import javax.swing.JFileChooser;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
import net.forwardfire.vasc.backend.metamodel.MetaModelDataContextCsv;
|
||||
import net.forwardfire.vasc.backend.metamodel.MetaModelSchemaAutoEntry;
|
||||
import net.forwardfire.vasc.demo.tech.ui.TechUI;
|
||||
import net.forwardfire.vasc.demo.tech.ui.components.JMainPanel;
|
||||
|
||||
public class JDialogMetaCsv extends JDialog implements ActionListener {
|
||||
|
||||
private static final long serialVersionUID = -8638394652416472734L;
|
||||
|
||||
public JDialogMetaCsv(Frame aFrame) {
|
||||
setTitle("Add csv file");
|
||||
setMinimumSize(new Dimension(640,480));
|
||||
setPreferredSize(new Dimension(999,666));
|
||||
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
|
||||
addWindowListener(new WindowAdapter() {
|
||||
public void windowClosing(WindowEvent we) {
|
||||
clearAndHide();
|
||||
}
|
||||
});
|
||||
JPanel mainPanel = new JPanel();
|
||||
mainPanel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
|
||||
mainPanel.setLayout(new BorderLayout());
|
||||
//mainPanel.add(createPanelTop(),BorderLayout.NORTH);
|
||||
mainPanel.add(createPanelCenter(),BorderLayout.CENTER);
|
||||
//mainPanel.add(createPanelBottom(),BorderLayout.SOUTH);
|
||||
getContentPane().add(mainPanel);
|
||||
pack();
|
||||
setLocationRelativeTo(aFrame);
|
||||
}
|
||||
|
||||
public void clearAndHide() {
|
||||
setVisible(false);
|
||||
}
|
||||
|
||||
public JPanel createPanelCenter() {
|
||||
JPanel result = new JPanel();
|
||||
//result.setLayout(new SpringLayout());
|
||||
|
||||
result.add(new JLabel("File"));
|
||||
JButton fileButton = new JButton("Open");
|
||||
fileButton.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
final JFileChooser fc = new JFileChooser();
|
||||
int returnVal = fc.showOpenDialog((JButton)e.getSource());
|
||||
if (returnVal == JFileChooser.APPROVE_OPTION) {
|
||||
File file = fc.getSelectedFile();
|
||||
MetaModelDataContextCsv ds = new MetaModelDataContextCsv();
|
||||
ds.setFile(file.getAbsolutePath());
|
||||
|
||||
MetaModelSchemaAutoEntry schema = new MetaModelSchemaAutoEntry();
|
||||
schema.setDataContextProvider(ds);
|
||||
schema.setEntryPrefix(file.getName());
|
||||
schema.autoCreateEntries(TechUI.getInstance().getVascManager().getVascController());
|
||||
((JMainPanel)TechUI.getInstance().getMainView().getComponent()).rebuildTree();
|
||||
}
|
||||
}
|
||||
});
|
||||
result.add(fileButton);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public void actionPerformed(ActionEvent arg0) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,109 +0,0 @@
|
|||
package net.forwardfire.vasc.demo.tech.ui.actions;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Frame;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JComboBox;
|
||||
import javax.swing.JDialog;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JTextField;
|
||||
import javax.swing.SpringLayout;
|
||||
|
||||
import net.forwardfire.vasc.backend.metamodel.MetaModelDataContextJdbc;
|
||||
import net.forwardfire.vasc.backend.metamodel.MetaModelSchemaAutoEntry;
|
||||
import net.forwardfire.vasc.demo.tech.ui.TechUI;
|
||||
import net.forwardfire.vasc.demo.tech.ui.components.JMainPanel;
|
||||
import net.forwardfire.vasc.demo.tech.ui.components.SpringLayoutGrid;
|
||||
|
||||
public class JDialogMetaJdbc extends JDialog implements ActionListener {
|
||||
|
||||
private static final long serialVersionUID = -8638394652416472734L;
|
||||
private JComboBox driverClassBox = null;
|
||||
private JTextField connectUrlField = null;
|
||||
private JTextField usernameField = null;
|
||||
private JTextField passwordField = null;
|
||||
|
||||
|
||||
public JDialogMetaJdbc(Frame aFrame) {
|
||||
setTitle("Add jdbc");
|
||||
setMinimumSize(new Dimension(300,200));
|
||||
setPreferredSize(new Dimension(500,400));
|
||||
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
|
||||
addWindowListener(new WindowAdapter() {
|
||||
public void windowClosing(WindowEvent we) {
|
||||
clearAndHide();
|
||||
}
|
||||
});
|
||||
JPanel mainPanel = new JPanel();
|
||||
mainPanel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
|
||||
mainPanel.setLayout(new BorderLayout());
|
||||
//mainPanel.add(createPanelTop(),BorderLayout.NORTH);
|
||||
mainPanel.add(createPanelCenter(),BorderLayout.CENTER);
|
||||
//mainPanel.add(createPanelBottom(),BorderLayout.SOUTH);
|
||||
getContentPane().add(mainPanel);
|
||||
pack();
|
||||
setLocationRelativeTo(aFrame);
|
||||
}
|
||||
|
||||
public void clearAndHide() {
|
||||
setVisible(false);
|
||||
}
|
||||
|
||||
public JPanel createPanelCenter() {
|
||||
JPanel result = new JPanel();
|
||||
result.setLayout(new SpringLayout());
|
||||
|
||||
result.add(new JLabel("Driver"));
|
||||
driverClassBox = new JComboBox(new String[] {"org.postgresql.Driver","com.mysql.jdbc.Driver","org.apache.derby.jdbc.EmbeddedDriver","org.hsqldb.jdbcDriver","org.sqlite.JDBC"});
|
||||
driverClassBox.setSelectedIndex(0);
|
||||
result.add(driverClassBox);
|
||||
|
||||
result.add(new JLabel("Url"));
|
||||
connectUrlField = new JTextField("jdbc:postgresql://localhost/dellstore2");
|
||||
result.add(connectUrlField);
|
||||
|
||||
result.add(new JLabel("Username"));
|
||||
usernameField = new JTextField("postgres");
|
||||
result.add(usernameField);
|
||||
|
||||
result.add(new JLabel("Password"));
|
||||
passwordField = new JTextField("postgresql");
|
||||
result.add(passwordField);
|
||||
|
||||
JButton fileButton = new JButton("Connect");
|
||||
fileButton.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
String url = connectUrlField.getText();
|
||||
MetaModelDataContextJdbc ds = new MetaModelDataContextJdbc();
|
||||
ds.setDriverClass((String)driverClassBox.getSelectedItem());
|
||||
ds.setConnectUrl(url);
|
||||
ds.setUsername(usernameField.getText());
|
||||
ds.setPassword(passwordField.getText());
|
||||
String dbName = url.substring(url.lastIndexOf('/')+1,url.length());
|
||||
MetaModelSchemaAutoEntry schema = new MetaModelSchemaAutoEntry();
|
||||
schema.setDataContextProvider(ds);
|
||||
schema.setEntryPrefix(dbName);
|
||||
schema.autoCreateEntries(TechUI.getInstance().getVascManager().getVascController());
|
||||
((JMainPanel)TechUI.getInstance().getMainView().getComponent()).rebuildTree();
|
||||
}
|
||||
});
|
||||
result.add(fileButton);
|
||||
result.add(new JLabel(""));
|
||||
|
||||
SpringLayoutGrid.makeCompactGrid(result, 5, 2);
|
||||
return result;
|
||||
}
|
||||
|
||||
public void actionPerformed(ActionEvent arg0) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,101 +0,0 @@
|
|||
package net.forwardfire.vasc.demo.tech.ui.actions;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Frame;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JDialog;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JTextField;
|
||||
import javax.swing.SpringLayout;
|
||||
|
||||
import net.forwardfire.vasc.backend.metamodel.MetaModelDataContextMongodb;
|
||||
import net.forwardfire.vasc.backend.metamodel.MetaModelSchemaAutoEntry;
|
||||
import net.forwardfire.vasc.demo.tech.ui.TechUI;
|
||||
import net.forwardfire.vasc.demo.tech.ui.components.JMainPanel;
|
||||
import net.forwardfire.vasc.demo.tech.ui.components.SpringLayoutGrid;
|
||||
|
||||
import org.eobjects.metamodel.DataContext;
|
||||
|
||||
public class JDialogMetaMongodb extends JDialog implements ActionListener {
|
||||
|
||||
private static final long serialVersionUID = -8638394652416472734L;
|
||||
private JTextField hostNameField = null;
|
||||
private JTextField hostPortField = null;
|
||||
private JTextField databaseField = null;
|
||||
|
||||
public JDialogMetaMongodb(Frame aFrame) {
|
||||
setTitle("Add mongodb");
|
||||
setMinimumSize(new Dimension(300,200));
|
||||
setPreferredSize(new Dimension(400,300));
|
||||
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
|
||||
addWindowListener(new WindowAdapter() {
|
||||
public void windowClosing(WindowEvent we) {
|
||||
clearAndHide();
|
||||
}
|
||||
});
|
||||
JPanel mainPanel = new JPanel();
|
||||
mainPanel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
|
||||
mainPanel.setLayout(new BorderLayout());
|
||||
//mainPanel.add(createPanelTop(),BorderLayout.NORTH);
|
||||
mainPanel.add(createPanelCenter(),BorderLayout.CENTER);
|
||||
//mainPanel.add(createPanelBottom(),BorderLayout.SOUTH);
|
||||
getContentPane().add(mainPanel);
|
||||
pack();
|
||||
setLocationRelativeTo(aFrame);
|
||||
}
|
||||
|
||||
public void clearAndHide() {
|
||||
setVisible(false);
|
||||
}
|
||||
|
||||
public JPanel createPanelCenter() {
|
||||
JPanel result = new JPanel();
|
||||
result.setLayout(new SpringLayout());
|
||||
|
||||
result.add(new JLabel("Hostname"));
|
||||
hostNameField = new JTextField("localhost");
|
||||
result.add(hostNameField);
|
||||
|
||||
result.add(new JLabel("Port"));
|
||||
hostPortField = new JTextField("27017");
|
||||
result.add(hostPortField);
|
||||
|
||||
result.add(new JLabel("Database"));
|
||||
databaseField = new JTextField("lefiona");
|
||||
result.add(databaseField);
|
||||
|
||||
JButton fileButton = new JButton("Connect");
|
||||
fileButton.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
MetaModelDataContextMongodb ds = new MetaModelDataContextMongodb();
|
||||
ds.setHostname(hostNameField.getText());
|
||||
ds.setPort(new Integer(hostPortField.getText()));
|
||||
ds.setDatabase(databaseField.getText());
|
||||
|
||||
MetaModelSchemaAutoEntry schema = new MetaModelSchemaAutoEntry();
|
||||
schema.setDataContextProvider(ds);
|
||||
schema.setEntryPrefix(ds.getDatabase());
|
||||
schema.autoCreateEntries(TechUI.getInstance().getVascManager().getVascController());
|
||||
((JMainPanel)TechUI.getInstance().getMainView().getComponent()).rebuildTree();
|
||||
}
|
||||
});
|
||||
result.add(fileButton);
|
||||
result.add(new JLabel(""));
|
||||
|
||||
SpringLayoutGrid.makeCompactGrid(result, 4, 2);
|
||||
return result;
|
||||
}
|
||||
|
||||
public void actionPerformed(ActionEvent arg0) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,153 +0,0 @@
|
|||
package net.forwardfire.vasc.demo.tech.ui.components;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.FlowLayout;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.util.Enumeration;
|
||||
import java.util.logging.Handler;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.LogManager;
|
||||
import java.util.logging.LogRecord;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JCheckBox;
|
||||
import javax.swing.JComboBox;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JScrollPane;
|
||||
import javax.swing.JTextArea;
|
||||
import javax.swing.ScrollPaneConstants;
|
||||
import javax.swing.SpringLayout;
|
||||
import javax.swing.SwingUtilities;
|
||||
|
||||
import net.forwardfire.vasc.demo.tech.ui.PatternLogFormatter;
|
||||
|
||||
public class JConsolePanel extends JPanel implements ActionListener {
|
||||
|
||||
private static final long serialVersionUID = 485766723433479054L;
|
||||
private UILogHandler logHandler = null;
|
||||
private JButton clearButton = null;
|
||||
private JComboBox levelBox = null;
|
||||
private JTextArea logTextArea = null;
|
||||
private JCheckBox autoScrollBox = null;
|
||||
private int logLinesMax = 255;
|
||||
|
||||
public JConsolePanel() {
|
||||
setLayout(new FlowLayout(FlowLayout.LEFT));
|
||||
JPanel wrap = new JPanel();
|
||||
wrap.setLayout(new SpringLayout());
|
||||
wrap.add(createHeader());
|
||||
wrap.add(createEditor());
|
||||
SpringLayoutGrid.makeCompactGrid(wrap,2,1);
|
||||
add(wrap);
|
||||
|
||||
Logger rootLogger = Logger.getAnonymousLogger();
|
||||
while (rootLogger.getParent()!=null) {
|
||||
rootLogger = rootLogger.getParent();
|
||||
}
|
||||
|
||||
logHandler = new UILogHandler();
|
||||
logHandler.setFormatter(new PatternLogFormatter());
|
||||
rootLogger.addHandler(logHandler);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This needs release if playing the the this tab add/removal very multiple times.
|
||||
*/
|
||||
public void release() {
|
||||
Logger rootLogger = Logger.getAnonymousLogger();
|
||||
while (rootLogger.getParent()!=null) {
|
||||
rootLogger = rootLogger.getParent();
|
||||
}
|
||||
rootLogger.removeHandler(logHandler);
|
||||
}
|
||||
|
||||
private JPanel createHeader() {
|
||||
JPanel result = new JPanel();
|
||||
result.setBorder(BorderFactory.createLineBorder(Color.BLUE));
|
||||
result.setLayout(new FlowLayout(FlowLayout.LEFT));
|
||||
result.add(new JLabel("Log Level"));
|
||||
levelBox = new JComboBox(new Level[] {Level.OFF,Level.SEVERE,Level.WARNING,Level.INFO,Level.FINE,Level.FINER,Level.FINEST,Level.ALL});
|
||||
levelBox.setSelectedItem(Level.INFO);
|
||||
levelBox.addActionListener(this);
|
||||
result.add(levelBox);
|
||||
clearButton = new JButton("Clear");
|
||||
clearButton.addActionListener(this);
|
||||
result.add(clearButton);
|
||||
autoScrollBox = new JCheckBox("Autoscroll");
|
||||
autoScrollBox.setSelected(true);
|
||||
result.add(autoScrollBox);
|
||||
return result;
|
||||
}
|
||||
|
||||
private JPanel createEditor() {
|
||||
JPanel result = new JPanel();
|
||||
result.setBorder(BorderFactory.createLineBorder(Color.BLUE));
|
||||
logTextArea = new JTextArea(5, 80);
|
||||
logTextArea.setAutoscrolls(true);
|
||||
logTextArea.setEditable(false);
|
||||
JScrollPane logScrollPane = new JScrollPane(logTextArea);
|
||||
logScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
|
||||
logScrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
|
||||
logScrollPane.getViewport().setOpaque(false);
|
||||
result.add(logScrollPane);
|
||||
return result;
|
||||
}
|
||||
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (clearButton.equals(e.getSource())) {
|
||||
logTextArea.setText("");
|
||||
} else if (levelBox.equals(e.getSource()) && levelBox.getSelectedIndex()!=-1) {
|
||||
Level level = (Level)levelBox.getSelectedItem();
|
||||
logHandler.setLevel(level);
|
||||
Enumeration<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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class UILogHandler extends Handler {
|
||||
@Override
|
||||
public void close() throws SecurityException {
|
||||
}
|
||||
@Override
|
||||
public void flush() {
|
||||
}
|
||||
@Override
|
||||
public void publish(LogRecord record) {
|
||||
final String recordStr = getFormatter().format(record);
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
logTextArea.append(recordStr);
|
||||
if (logTextArea.getLineCount() > logLinesMax) {
|
||||
String t = logTextArea.getText();
|
||||
int l = 0;
|
||||
int rm = logLinesMax/2;
|
||||
for (int i=0;i<rm;i++) {
|
||||
int ll = t.indexOf('\n',l+1);
|
||||
if (ll==-1) {
|
||||
break;
|
||||
}
|
||||
l = ll;
|
||||
}
|
||||
String tt = t.substring(l,t.length());
|
||||
logTextArea.setText(tt);
|
||||
}
|
||||
if (autoScrollBox.isSelected()) {
|
||||
logTextArea.setCaretPosition(logTextArea.getText().length());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,355 +0,0 @@
|
|||
/*
|
||||
* Copyright 2007-2012 forwardfire.net All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
* that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
* the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.forwardfire.vasc.demo.tech.ui.components;
|
||||
|
||||
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.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import javax.swing.BorderFactory;
|
||||
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 net.forwardfire.vasc.core.VascEntry;
|
||||
import net.forwardfire.vasc.demo.tech.core.DemoVascManager;
|
||||
import net.forwardfire.vasc.demo.tech.ui.TechUI;
|
||||
import net.forwardfire.vasc.frontend.swing.SwingPanelIntegration;
|
||||
import net.forwardfire.vasc.frontend.swing.SwingPanelTabbed;
|
||||
import net.forwardfire.vasc.impl.DefaultVascFactory;
|
||||
import net.forwardfire.vasc.test.i18n.VascBundleCheckEntryKeys;
|
||||
|
||||
public class JMainPanel extends JPanel {
|
||||
|
||||
private static final long serialVersionUID = 5834715323973411147L;
|
||||
private DemoVascManager vascManager = null;
|
||||
private SwingPanelIntegration spi = null;
|
||||
private JTabbedPane tabPane = null;
|
||||
private JTree vascTree = null;
|
||||
private JSplitPane bottomSplitPane = null;
|
||||
private JSplitPane treeSplitPane = null;
|
||||
|
||||
|
||||
public JMainPanel() {
|
||||
this.vascManager=TechUI.getInstance().getVascManager();
|
||||
setLayout(new BorderLayout());
|
||||
add(createBottomSplit(), BorderLayout.CENTER);
|
||||
}
|
||||
|
||||
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(750);
|
||||
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;
|
||||
|
||||
@Override
|
||||
public void addTreeModelListener(TreeModelListener l) {
|
||||
super.addTreeModelListener(l);
|
||||
}
|
||||
}
|
||||
|
||||
private JScrollPane createTreePane() {
|
||||
|
||||
DefaultMutableTreeNode root = new DefaultMutableTreeNode(new VascTreeNode(VascTreeNodeType.NONE,null));
|
||||
|
||||
vascTree = new JTree(new VascTreeModel(root));
|
||||
vascTree.addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
super.mouseClicked(e);
|
||||
if (e.getClickCount() == 2 && vascTree.getSelectionModel().isSelectionEmpty()==false) {
|
||||
try {
|
||||
DefaultMutableTreeNode node = (DefaultMutableTreeNode)vascTree.getSelectionModel().getSelectionPath().getLastPathComponent();
|
||||
if (node.getUserObject() instanceof String) {
|
||||
return;
|
||||
}
|
||||
VascTreeNode vascNode = (VascTreeNode)node.getUserObject();
|
||||
if (vascNode != null) {
|
||||
if (vascNode.type == VascTreeNodeType.ENTRY) {
|
||||
VascEntry ee = vascManager.getVascController().getVascEntryController().getVascEntryById(vascNode.id).clone();
|
||||
DefaultVascFactory.fillVascEntryFrontend(ee, vascManager.getVascController(), DefaultVascFactory.getDefaultVascFrontendData("net.forwardfire.vasc.lib.i18n.bundle.RootApplicationBundle",new Locale("en")));
|
||||
spi.createNewVascView(ee);
|
||||
}
|
||||
}
|
||||
} catch (Exception ee) {
|
||||
ee.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 {
|
||||
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);
|
||||
|
||||
|
||||
// todo move
|
||||
Map<String,String> keys = new HashMap<String,String>(300);
|
||||
VascBundleCheckEntryKeys checker = new VascBundleCheckEntryKeys(ResourceBundle.getBundle("net.forwardfire.vasc.lib.i18n.bundle.RootApplicationBundle"));
|
||||
for (String veId:vascManager.getVascController().getVascEntryController().getVascEntryIds()) {
|
||||
VascEntry ve = vascManager.getVascController().getVascEntryController().getVascEntryById(veId);
|
||||
keys.putAll(checker.generateMissingKeys(ve));
|
||||
}
|
||||
if (keys.isEmpty()==false) {
|
||||
Properties p = new Properties();
|
||||
File dataDir = new File("data");
|
||||
|
||||
if (dataDir.exists()==false) {
|
||||
dataDir.mkdirs();
|
||||
}
|
||||
File resourceFile = new File("data/vasc-bundle.properties");
|
||||
if (resourceFile.exists()) {
|
||||
readPropertiesFile(p,resourceFile);
|
||||
}
|
||||
for (String key:keys.keySet()) {
|
||||
p.put(key, keys.get(key));
|
||||
}
|
||||
writePropertiesFile(p,resourceFile);
|
||||
|
||||
ResourceBundle.clearCache();
|
||||
}
|
||||
}
|
||||
|
||||
public JTabbedPane getTabPane() {
|
||||
return tabPane;
|
||||
}
|
||||
|
||||
protected void writePropertiesFile(Properties p,File file) {
|
||||
try {
|
||||
writePropertiesStream(p,new FileOutputStream(file));
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("Could not load resource file error: "+e.getMessage(),e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected void readPropertiesFile(Properties p,File file) {
|
||||
try {
|
||||
readPropertiesStream(p,new FileInputStream(file));
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("Could not load resource file error: "+e.getMessage(),e);
|
||||
}
|
||||
}
|
||||
|
||||
protected void writePropertiesStream(Properties p,OutputStream out) {
|
||||
try {
|
||||
p.store(out, "Saved by vasc auto i18n.");
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("Could not load properties error: "+e.getMessage(),e);
|
||||
} finally {
|
||||
if (out!=null) {
|
||||
try {
|
||||
out.close();
|
||||
} catch (IOException e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void readPropertiesStream(Properties p,InputStream in) {
|
||||
try {
|
||||
p.load(in);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("Could not load properties error: "+e.getMessage(),e);
|
||||
} finally {
|
||||
if (in!=null) {
|
||||
try {
|
||||
in.close();
|
||||
} catch (IOException e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,161 +0,0 @@
|
|||
package net.forwardfire.vasc.demo.tech.ui.components;
|
||||
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.io.File;
|
||||
|
||||
import javax.swing.JFileChooser;
|
||||
import javax.swing.JMenu;
|
||||
import javax.swing.JMenuBar;
|
||||
import javax.swing.JMenuItem;
|
||||
import javax.swing.JTabbedPane;
|
||||
|
||||
import net.forwardfire.vasc.backend.VascBackendControllerLocal;
|
||||
import net.forwardfire.vasc.core.VascEntryControllerLocal;
|
||||
import net.forwardfire.vasc.demo.tech.ui.TechUI;
|
||||
import net.forwardfire.vasc.demo.tech.ui.actions.JDialogMetaCsv;
|
||||
import net.forwardfire.vasc.demo.tech.ui.actions.JDialogMetaJdbc;
|
||||
import net.forwardfire.vasc.demo.tech.ui.actions.JDialogMetaMongodb;
|
||||
|
||||
public class JMainPanelMenuBar extends JMenuBar {
|
||||
|
||||
private static final long serialVersionUID = -2828428804621352725L;
|
||||
JMenu fileMenu = new JMenu("File");
|
||||
JMenu vascMenu = new JMenu("Vasc");
|
||||
JMenu tabMenu = new JMenu("Tabs");
|
||||
|
||||
public JMainPanelMenuBar() {
|
||||
createMenuItems();
|
||||
add(fileMenu);
|
||||
add(vascMenu);
|
||||
add(tabMenu);
|
||||
}
|
||||
|
||||
|
||||
private void createMenuItems() {
|
||||
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();
|
||||
TechUI.getInstance().getVascManager().openFile(file);
|
||||
((JMainPanel)TechUI.getInstance().getMainView().getComponent()).rebuildTree();
|
||||
}
|
||||
} catch (Exception e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
fileMenu.add(openXmlItem);
|
||||
//JMenuItem closeXmlItem = new JMenuItem("Close");
|
||||
//fileMenu.add(closeXmlItem);
|
||||
fileMenu.addSeparator();
|
||||
JMenuItem exitItem = new JMenuItem("Exit");
|
||||
exitItem.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
TechUI.getInstance().exit();
|
||||
}
|
||||
});
|
||||
fileMenu.add(exitItem);
|
||||
|
||||
JMenuItem connectVascItem = new JMenuItem("Add Vasc");
|
||||
connectVascItem.setEnabled(false);
|
||||
connectVascItem.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
||||
}
|
||||
});
|
||||
vascMenu.add(connectVascItem);
|
||||
|
||||
JMenuItem connectLdapItem = new JMenuItem("Add Ldap");
|
||||
connectLdapItem.setEnabled(false);
|
||||
vascMenu.add(connectLdapItem);
|
||||
vascMenu.addSeparator();
|
||||
JMenuItem connectMetaCsvItem = new JMenuItem("Add meta csv");
|
||||
connectMetaCsvItem.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
JDialogMetaCsv d = new JDialogMetaCsv(TechUI.getInstance().getMainFrame());
|
||||
d.setVisible(true);
|
||||
}
|
||||
});
|
||||
vascMenu.add(connectMetaCsvItem);
|
||||
JMenuItem connectMetaXmlItem = new JMenuItem("Add meta xml");
|
||||
connectMetaXmlItem.setEnabled(false);
|
||||
vascMenu.add(connectMetaXmlItem);
|
||||
JMenuItem connectMetaMongoItem = new JMenuItem("Add meta mongo");
|
||||
connectMetaMongoItem.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
JDialogMetaMongodb d = new JDialogMetaMongodb(TechUI.getInstance().getMainFrame());
|
||||
d.setVisible(true);
|
||||
}
|
||||
});
|
||||
vascMenu.add(connectMetaMongoItem);
|
||||
JMenuItem connectMetaJdbcItem = new JMenuItem("Add meta jdbc");
|
||||
connectMetaJdbcItem.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
JDialogMetaJdbc d = new JDialogMetaJdbc(TechUI.getInstance().getMainFrame());
|
||||
d.setVisible(true);
|
||||
}
|
||||
});
|
||||
vascMenu.add(connectMetaJdbcItem);
|
||||
|
||||
vascMenu.addSeparator();
|
||||
JMenuItem removeEntryItem = new JMenuItem("Remove entry");
|
||||
removeEntryItem.setEnabled(false);
|
||||
removeEntryItem.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
}
|
||||
});
|
||||
vascMenu.add(removeEntryItem);
|
||||
|
||||
JMenuItem removeAllItem = new JMenuItem("Remove all");
|
||||
removeAllItem.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
VascBackendControllerLocal backends = (VascBackendControllerLocal)TechUI.getInstance().getVascManager().getVascController().getVascBackendController();
|
||||
VascEntryControllerLocal entries = (VascEntryControllerLocal)TechUI.getInstance().getVascManager().getVascController().getVascEntryController();
|
||||
for (String entryId:entries.getVascEntryIds()) {
|
||||
if (entryId.startsWith("Vasc")) {
|
||||
continue;
|
||||
}
|
||||
entries.removeVascEntry(entryId);
|
||||
}
|
||||
for (String backendId:backends.getVascBackendIds()) {
|
||||
if (backendId.startsWith("Vasc")) {
|
||||
continue;
|
||||
}
|
||||
backends.removeVascBackendById(backendId);
|
||||
}
|
||||
((JMainPanel)TechUI.getInstance().getMainView().getComponent()).rebuildTree();
|
||||
}
|
||||
});
|
||||
vascMenu.add(removeAllItem);
|
||||
|
||||
JMenuItem item = new JMenuItem("Close tab");
|
||||
item.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
JTabbedPane tabPane = ((JMainPanel)TechUI.getInstance().getMainView().getComponent()).getTabPane();
|
||||
if (tabPane.getSelectedIndex()>=0) {
|
||||
tabPane.removeTabAt(tabPane.getSelectedIndex()); // todo release vasc frontend
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
tabMenu.add(item);
|
||||
JMenuItem itemAll = new JMenuItem("Close All tabs");
|
||||
itemAll.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
JTabbedPane tabPane = ((JMainPanel)TechUI.getInstance().getMainView().getComponent()).getTabPane();
|
||||
for (int i=tabPane.getTabCount();i>0;i--) {
|
||||
tabPane.removeTabAt(i-1); // todo release vasc frontend
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
tabMenu.add(itemAll);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,214 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2011, Willem Cazander
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
* that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
* the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.forwardfire.vasc.demo.tech.ui.components;
|
||||
|
||||
import java.awt.Component;
|
||||
import java.awt.Container;
|
||||
|
||||
import javax.swing.Spring;
|
||||
import javax.swing.SpringLayout;
|
||||
|
||||
|
||||
/**
|
||||
* SpringLayoutGrid, someone should create an JCP to get these functions into
|
||||
* SpringLayout object because this code is to much duplicated on many projects.
|
||||
*
|
||||
* A 1.4 file that provides utility methods for creating form- or grid-style
|
||||
* layouts with SpringLayout. These utilities are used by several programs, such
|
||||
* as SpringBox and SpringCompactGrid.
|
||||
*/
|
||||
public class SpringLayoutGrid {
|
||||
|
||||
|
||||
/**
|
||||
* Aligns the first <code>rows</code>*<code>cols</code> components of
|
||||
* <code>parent</code> in a grid. Each component is as big as the maximum
|
||||
* preferred width and height of the components. The parent is made just big
|
||||
* enough to fit them all.
|
||||
*
|
||||
* @param rows
|
||||
* number of rows
|
||||
* @param cols
|
||||
* number of columns
|
||||
* @param initialX
|
||||
* x location to start the grid at
|
||||
* @param initialY
|
||||
* y location to start the grid at
|
||||
* @param xPad
|
||||
* x padding between cells
|
||||
* @param yPad
|
||||
* y padding between cells
|
||||
*/
|
||||
public static void makeGrid(Container parent, int rows, int cols,int initialX, int initialY, int xPad, int yPad) {
|
||||
SpringLayout layout;
|
||||
try {
|
||||
layout = (SpringLayout) parent.getLayout();
|
||||
} catch (ClassCastException exc) {
|
||||
throw new IllegalArgumentException("parent container has not StringLayout layoutmanager.");
|
||||
}
|
||||
|
||||
Spring xPadSpring = Spring.constant(xPad);
|
||||
Spring yPadSpring = Spring.constant(yPad);
|
||||
Spring initialXSpring = Spring.constant(initialX);
|
||||
Spring initialYSpring = Spring.constant(initialY);
|
||||
int max = rows * cols;
|
||||
|
||||
//Calculate Springs that are the max of the width/height so that all
|
||||
//cells have the same size.
|
||||
Spring maxWidthSpring = layout.getConstraints(parent.getComponent(0))
|
||||
.getWidth();
|
||||
Spring maxHeightSpring = layout.getConstraints(parent.getComponent(0))
|
||||
.getWidth();
|
||||
for (int i = 1; i < max; i++) {
|
||||
SpringLayout.Constraints cons = layout.getConstraints(parent
|
||||
.getComponent(i));
|
||||
|
||||
maxWidthSpring = Spring.max(maxWidthSpring, cons.getWidth());
|
||||
maxHeightSpring = Spring.max(maxHeightSpring, cons.getHeight());
|
||||
}
|
||||
|
||||
//Apply the new width/height Spring. This forces all the
|
||||
//components to have the same size.
|
||||
for (int i = 0; i < max; i++) {
|
||||
SpringLayout.Constraints cons = layout.getConstraints(parent
|
||||
.getComponent(i));
|
||||
|
||||
cons.setWidth(maxWidthSpring);
|
||||
cons.setHeight(maxHeightSpring);
|
||||
}
|
||||
|
||||
//Then adjust the x/y constraints of all the cells so that they
|
||||
//are aligned in a grid.
|
||||
SpringLayout.Constraints lastCons = null;
|
||||
SpringLayout.Constraints lastRowCons = null;
|
||||
for (int i = 0; i < max; i++) {
|
||||
SpringLayout.Constraints cons = layout.getConstraints(parent
|
||||
.getComponent(i));
|
||||
if (i % cols == 0) { //start of new row
|
||||
lastRowCons = lastCons;
|
||||
cons.setX(initialXSpring);
|
||||
} else { //x position depends on previous component
|
||||
cons.setX(Spring.sum(lastCons.getConstraint(SpringLayout.EAST),
|
||||
xPadSpring));
|
||||
}
|
||||
|
||||
if (i / cols == 0) { //first row
|
||||
cons.setY(initialYSpring);
|
||||
} else { //y position depends on previous row
|
||||
cons.setY(Spring.sum(lastRowCons
|
||||
.getConstraint(SpringLayout.SOUTH), yPadSpring));
|
||||
}
|
||||
lastCons = cons;
|
||||
}
|
||||
|
||||
//Set the parent's size.
|
||||
SpringLayout.Constraints pCons = layout.getConstraints(parent);
|
||||
pCons.setConstraint(SpringLayout.SOUTH, Spring.sum(Spring
|
||||
.constant(yPad), lastCons.getConstraint(SpringLayout.SOUTH)));
|
||||
pCons.setConstraint(SpringLayout.EAST, Spring.sum(
|
||||
Spring.constant(xPad), lastCons
|
||||
.getConstraint(SpringLayout.EAST)));
|
||||
}
|
||||
|
||||
/* Used by makeCompactGrid. */
|
||||
private static SpringLayout.Constraints getConstraintsForCell(int row,
|
||||
int col, Container parent, int cols) {
|
||||
SpringLayout layout = (SpringLayout) parent.getLayout();
|
||||
Component c = parent.getComponent(row * cols + col);
|
||||
return layout.getConstraints(c);
|
||||
}
|
||||
|
||||
|
||||
public static void makeCompactGrid(Container parent, int rows, int cols) {
|
||||
makeCompactGrid(parent,rows,cols,6,6,6,6);
|
||||
}
|
||||
|
||||
/**
|
||||
* Aligns the first <code>rows</code>*<code>cols</code> components of
|
||||
* <code>parent</code> in a grid. Each component in a column is as wide as
|
||||
* the maximum preferred width of the components in that column; height is
|
||||
* similarly determined for each row. The parent is made just big enough to
|
||||
* fit them all.
|
||||
*
|
||||
* @param rows
|
||||
* number of rows
|
||||
* @param cols
|
||||
* number of columns
|
||||
* @param initialX
|
||||
* x location to start the grid at
|
||||
* @param initialY
|
||||
* y location to start the grid at
|
||||
* @param xPad
|
||||
* x padding between cells
|
||||
* @param yPad
|
||||
* y padding between cells
|
||||
*/
|
||||
public static void makeCompactGrid(Container parent, int rows, int cols,int initialX, int initialY, int xPad, int yPad) {
|
||||
SpringLayout layout;
|
||||
try {
|
||||
layout = (SpringLayout) parent.getLayout();
|
||||
} catch (ClassCastException exc) {
|
||||
throw new IllegalArgumentException("parent container has not StringLayout layoutmanager.");
|
||||
}
|
||||
|
||||
//Align all cells in each column and make them the same width.
|
||||
Spring x = Spring.constant(initialX);
|
||||
for (int c = 0; c < cols; c++) {
|
||||
Spring width = Spring.constant(0);
|
||||
for (int r = 0; r < rows; r++) {
|
||||
width = Spring.max(width, getConstraintsForCell(r, c, parent,
|
||||
cols).getWidth());
|
||||
}
|
||||
for (int r = 0; r < rows; r++) {
|
||||
SpringLayout.Constraints constraints = getConstraintsForCell(r,
|
||||
c, parent, cols);
|
||||
constraints.setX(x);
|
||||
constraints.setWidth(width);
|
||||
}
|
||||
x = Spring.sum(x, Spring.sum(width, Spring.constant(xPad)));
|
||||
}
|
||||
|
||||
//Align all cells in each row and make them the same height.
|
||||
Spring y = Spring.constant(initialY);
|
||||
for (int r = 0; r < rows; r++) {
|
||||
Spring height = Spring.constant(0);
|
||||
for (int c = 0; c < cols; c++) {
|
||||
height = Spring.max(height, getConstraintsForCell(r, c, parent,
|
||||
cols).getHeight());
|
||||
}
|
||||
for (int c = 0; c < cols; c++) {
|
||||
SpringLayout.Constraints constraints = getConstraintsForCell(r,
|
||||
c, parent, cols);
|
||||
constraints.setY(y);
|
||||
constraints.setHeight(height);
|
||||
}
|
||||
y = Spring.sum(y, Spring.sum(height, Spring.constant(yPad)));
|
||||
}
|
||||
|
||||
//Set the parent's size.
|
||||
SpringLayout.Constraints pCons = layout.getConstraints(parent);
|
||||
pCons.setConstraint(SpringLayout.SOUTH, y);
|
||||
pCons.setConstraint(SpringLayout.EAST, x);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
|
||||
# bundle list to merge and load
|
||||
bundle1.uri=net.forwardfire.vasc.demo.tech.ui.resources.TechUI
|
||||
|
||||
bundle2.uri=data/vasc-bundle.properties
|
||||
bundle2.type=FILE
|
||||
bundle2.optional=true
|
||||
|
||||
|
|
@ -1,137 +0,0 @@
|
|||
#
|
||||
# Copyright (c) 2011, Willem Cazander
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
# that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice, this list of conditions and the
|
||||
# following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
# the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
# THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
# OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
# TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
# Application's properties
|
||||
Application.name = Vasc Demo Tech
|
||||
Application.title = VascDemoTech
|
||||
Application.vendor = Willem Cazander
|
||||
Application.homepage = http://vasc.forwardfire.org/
|
||||
Application.vendorId = vasc
|
||||
Application.id = vascdemotech
|
||||
Application.lookAndFeel = com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel
|
||||
#Application.icon = images/icon.png
|
||||
|
||||
|
||||
generic.active.labelText = active
|
||||
generic.active.toolTipText = active
|
||||
generic.createdDate.labelText = createdDate
|
||||
generic.createdDate.toolTipText = createdDate
|
||||
generic.description.labelText = description
|
||||
generic.description.toolTipText = description
|
||||
generic.id.labelText = id
|
||||
generic.id.toolTipText = id
|
||||
generic.modifiedDate.labelText = modifiedDate
|
||||
generic.modifiedDate.toolTipText = modifiedDate
|
||||
generic.name.labelText = name
|
||||
generic.name.toolTipText = name
|
||||
generic.orderNumber.labelText = orderNumber
|
||||
generic.orderNumber.toolTipText = orderNumber
|
||||
|
||||
# hibernate validators
|
||||
validator.assertFalse=assertion failed
|
||||
validator.assertTrue=assertion failed
|
||||
validator.future=Date must lie in the future
|
||||
validator.length=Field must contain between {min} and {max} characters.
|
||||
validator.max=Value must be equal to or lower than {value}
|
||||
validator.min=Value must be equal to or higher than {value}
|
||||
validator.notNull=A value must be entered
|
||||
validator.past=Date must lie in the future
|
||||
validator.pattern=Value must conform to "{regex}"
|
||||
validator.range=Value must lie between {min} and {max}
|
||||
validator.size=There must be between {min} and {max} characters
|
||||
validator.email=The value must be a valid e-mail address
|
||||
|
||||
# vasc validators
|
||||
vasc.validator.VascDateFutureValidator=The date must lie in the future.
|
||||
vasc.validator.VascDatePastValidator=The date must lie in the past.
|
||||
vasc.validator.VascIntSizeValidator=Value must lie between {0} and {1}
|
||||
vasc.validator.VascLongSizeValidator=Value must lie between {0} and {1}
|
||||
vasc.validator.VascObjectNotNullValidator=A value must be entered
|
||||
vasc.validator.VascObjectNullValidator=No value may be entered
|
||||
vasc.validator.VascStringEmailValidator=The value must be a valid e-mail address
|
||||
vasc.validator.VascStringLengthValidator=There must be at least {0} and at most {1} items
|
||||
vasc.validator.VascStringRegexValidator=Value must conform to "{0}"
|
||||
vasc.validator.VascStringZipCodeValidator=Value must be a valid post code.
|
||||
|
||||
# Vasc actions labels
|
||||
vasc.action.addRowAction.description = add a new record
|
||||
vasc.action.addRowAction.name = Add
|
||||
vasc.action.deleteRowAction.description = delete
|
||||
vasc.action.deleteRowAction.name = delete
|
||||
vasc.action.downloadAction.description = Select this record.
|
||||
vasc.action.downloadAction.name = Select
|
||||
vasc.action.editRowAction.description = edit
|
||||
vasc.action.editRowAction.name = Edit
|
||||
|
||||
vasc.action.csvExportAction.description = CSV
|
||||
vasc.action.csvExportAction.name = CSV
|
||||
vasc.action.xmlExportAction.description = XML
|
||||
vasc.action.xmlExportAction.name = XML
|
||||
vasc.action.xmltreeExportAction.description = XMLTree
|
||||
vasc.action.xmltreeExportAction.name = XMLTree
|
||||
vasc.action.jrPdfLandscapeExportAction.description = jrPdfLandscape
|
||||
vasc.action.jrPdfLandscapeExportAction.name = PDF-Landscape
|
||||
vasc.action.jrPdfPortraitExportAction.description = jrPdfPortrait
|
||||
vasc.action.jrPdfPortraitExportAction.name = PDF-Portrait
|
||||
vasc.action.jrRtfExportAction.description = RTF
|
||||
vasc.action.jrRtfExportAction.name = RTF
|
||||
vasc.action.jrXlsExportAction.description = XLS
|
||||
vasc.action.jrXlsExportAction.name = XLS
|
||||
vasc.action.jrXmlExportAction.description = JR-XML
|
||||
vasc.action.jrXmlExportAction.name = JR-XML
|
||||
vasc.action.jrCsvExportAction.description = JR-CSV
|
||||
vasc.action.jrCsvExportAction.name = JR-CSV
|
||||
|
||||
|
||||
# Temp jsf
|
||||
generic.vasc.jsf.listOption.header = Searchoptions
|
||||
generic.vasc.jsf.listOption.search = Searh\:
|
||||
generic.vasc.jsf.listOption.sumbit = Search
|
||||
generic.vasc.jsf.pager.previous = Previous
|
||||
generic.vasc.jsf.pager.next = Next
|
||||
generic.vasc.jsf.table.rows = Row Numbers\:
|
||||
generic.vasc.jsf.table.pagerDirect = Go to\:
|
||||
generic.vasc.jsf.table.downloadDirect = Download\:
|
||||
generic.vasc.jsf.table.resultText = Results {0}-{1} from {2} rows
|
||||
generic.vasc.jsf.table.download.img = Save table data.
|
||||
generic.vasc.jsf.table.printer.img = Shows the table in printer friendly format.
|
||||
generic.vasc.jsf.table.export.select = ...
|
||||
generic.vasc.jsf.table.export.select.alt = Select Export
|
||||
generic.vasc.jsf.table.page.select = ...
|
||||
generic.vasc.jsf.table.page.select.alt = Select Page
|
||||
generic.vasc.jsf.table.page.name = Page:
|
||||
generic.vasc.jsf.table.page.description = Goto page:
|
||||
generic.vasc.jsf.tableHeader.fields = Fields
|
||||
generic.vasc.jsf.tableHeader.links = Links
|
||||
generic.vasc.jsf.tableHeader.actions = Actions
|
||||
generic.vasc.jsf.multiAction.selectAll = Select all:
|
||||
generic.vasc.jsf.multiAction.name = ...
|
||||
generic.vasc.jsf.multiAction.description = Select Action
|
||||
generic.vasc.jsf.action.save = Save
|
||||
generic.vasc.jsf.action.cancel = Cancel
|
||||
generic.vasc.jsf.action.back = Back
|
||||
generic.vasc.jsf.parentSelected = Selected:
|
||||
|
||||
vasc.dialog.edit.message = Edit
|
||||
vasc.dialog.save.name = Save
|
||||
vasc.dialog.cancel.name = Cancel
|
||||
|
|
@ -1,84 +0,0 @@
|
|||
/*
|
||||
* Copyright 2009-2012 forwardfire.net All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
* that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
* the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.forwardfire.vasc.demo.tech.web.beans;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
|
||||
import net.forwardfire.vasc.core.VascController;
|
||||
import net.forwardfire.vasc.core.VascEntry;
|
||||
import net.forwardfire.vasc.core.entry.VascEntryFrontendEventListener;
|
||||
import net.forwardfire.vasc.demo.tech.core.DemoVascControllerProvider;
|
||||
|
||||
import net.forwardfire.vasc.frontend.VascFrontendData;
|
||||
import net.forwardfire.vasc.frontend.web.jsf.AbstractJSFVascFacesControllerBase;
|
||||
import net.forwardfire.vasc.impl.DefaultVascFactory;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Willem Cazander
|
||||
* @version 1.0 Nov 1, 2009
|
||||
*/
|
||||
public class VascFacesController extends AbstractJSFVascFacesControllerBase {
|
||||
|
||||
|
||||
public List<String> getVascAdminEntries() {
|
||||
List<String> result = new ArrayList<String>(50);
|
||||
VascController v = getVascController();
|
||||
for (String e:v.getVascEntryController().getVascEntryIds()) {
|
||||
if (e.endsWith("Link")==false) {
|
||||
result.add(e);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public VascFrontendData getNewVascFrontendData() {
|
||||
Locale locale = FacesContext.getCurrentInstance().getViewRoot().getLocale();
|
||||
VascFrontendData vascFrontendData = DefaultVascFactory.getDefaultVascFrontendData("net.forwardfire.vasc.lib.i18n.bundle.RootApplicationBundle",locale);
|
||||
vascFrontendData.addVascEntryFrontendEventListener(new VascEntryFrontendEventListener() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public VascFrontendEventType[] getEventTypes() {
|
||||
VascFrontendEventType[] result = {VascEntryFrontendEventListener.VascFrontendEventType.EXCEPTION};
|
||||
return result;
|
||||
}
|
||||
public void vascEvent(VascEntry entry, Object data) {
|
||||
if (data instanceof Exception) {
|
||||
((Exception)data).printStackTrace();
|
||||
}
|
||||
}
|
||||
});
|
||||
return vascFrontendData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public VascController getVascController() {
|
||||
DemoVascControllerProvider provider = new DemoVascControllerProvider();
|
||||
return provider.getVascController();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,73 +0,0 @@
|
|||
#Colors
|
||||
headerBackgroundColor=\#EAEAEA
|
||||
headerGradientColor=\#E0E0E0
|
||||
headerTextColor=#282828
|
||||
headerWeightFont=bold
|
||||
|
||||
generalBackgroundColor=#FFFFFF
|
||||
generalTextColor=#282828
|
||||
generalSizeFont=11px
|
||||
generalFamilyFont=Arial, Helvetica, sans-serif
|
||||
|
||||
controlTextColor=#282828
|
||||
controlBackgroundColor=#ffffff
|
||||
additionalBackgroundColor=#ffffff
|
||||
|
||||
shadowBackgroundColor=#000000
|
||||
shadowOpacity=1
|
||||
|
||||
panelBorderColor=#BED6F8
|
||||
subBorderColor=#ffffff
|
||||
|
||||
tabBackgroundColor=#C6DEFF
|
||||
tabDisabledTextColor=#ffffff
|
||||
|
||||
trimColor=#D6E6FB
|
||||
|
||||
tipBackgroundColor=\#FAE6B0
|
||||
tipBorderColor=\#E5973E
|
||||
|
||||
selectControlColor=#E79A00
|
||||
|
||||
|
||||
generalLinkColor=#004DEB
|
||||
hoverLinkColor=#004DEB
|
||||
visitedLinkColor=#004DEB
|
||||
|
||||
# Fonts
|
||||
headerSizeFont=11px
|
||||
headerFamilyFont=Arial, Helvetica, sans-serif
|
||||
|
||||
tabSizeFont=11
|
||||
tabFamilyFont=Arial, Helvetica, sans-serif
|
||||
|
||||
buttonSizeFont=11
|
||||
buttonFamilyFont=Arial, Verdana, sans-serif
|
||||
|
||||
|
||||
tableBackgroundColor=#FFFFFF
|
||||
tableFooterBackgroundColor=#FFFFFF
|
||||
tableSubfooterBackgroundColor=#FFFFFF
|
||||
|
||||
|
||||
#Calendar colors
|
||||
calendarWeekBackgroundColor=#F5F5F5
|
||||
|
||||
calendarHolidaysBackgroundColor=#FFEBDA
|
||||
calendarHolidaysTextColor=#FF7800
|
||||
|
||||
calendarCurrentBackgroundColor=#FF7800
|
||||
calendarCurrentTextColor=#FFEBDA
|
||||
|
||||
calendarSpecBackgroundColor=#E4F5E2
|
||||
calendarSpecTextColor=#000000
|
||||
|
||||
|
||||
warningColor=#282828
|
||||
warningBackgroundColor=##EE0000
|
||||
|
||||
editorBackgroundColor=#F1F1F1
|
||||
editBackgroundColor=#FEFFDA
|
||||
|
||||
#Gradients
|
||||
gradientType=plain
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN" "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
|
||||
<faces-config>
|
||||
|
||||
<application>
|
||||
<locale-config>
|
||||
<default-locale>en</default-locale>
|
||||
</locale-config>
|
||||
<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
|
||||
</application>
|
||||
|
||||
<managed-bean>
|
||||
<description>Controls the Users</description>
|
||||
<managed-bean-name>userController</managed-bean-name>
|
||||
<managed-bean-class>net.forwardfire.vasc.demo.tech.web.beans.UserController</managed-bean-class>
|
||||
<managed-bean-scope>session</managed-bean-scope>
|
||||
</managed-bean>
|
||||
|
||||
<managed-bean>
|
||||
<description>Controls Vasc Faces</description>
|
||||
<managed-bean-name>vascFacesController</managed-bean-name>
|
||||
<managed-bean-class>net.forwardfire.vasc.demo.tech.web.beans.VascFacesController</managed-bean-class>
|
||||
<managed-bean-scope>session</managed-bean-scope>
|
||||
</managed-bean>
|
||||
|
||||
<managed-bean>
|
||||
<description>Controls Vasc Export Url Generator</description>
|
||||
<managed-bean-name>exportController</managed-bean-name>
|
||||
<managed-bean-class>net.forwardfire.vasc.demo.tech.web.beans.ExportController</managed-bean-class>
|
||||
<managed-bean-scope>session</managed-bean-scope>
|
||||
</managed-bean>
|
||||
|
||||
</faces-config>
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
|
||||
/* CSS fixes for IE6 */
|
||||
|
||||
/*
|
||||
#page_menu_left {
|
||||
overflow: visible;
|
||||
}
|
||||
*/
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
|
||||
/* CSS fixes for IE7 */
|
||||
|
||||
/*
|
||||
#page_menu_left {
|
||||
overflow: visible;
|
||||
}
|
||||
*/
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
|
||||
/* CSS fixes for IE8 */
|
||||
|
||||
/* Yet to come */
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 15 KiB |
|
|
@ -1,63 +0,0 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:ui="http://java.sun.com/jsf/facelets"
|
||||
xmlns:h="http://java.sun.com/jsf/html"
|
||||
xmlns:f="http://java.sun.com/jsf/core"
|
||||
xmlns:rich="http://richfaces.org/rich"
|
||||
>
|
||||
<ui:composition template="/jsp/includes/layout.xhtml">
|
||||
<ui:define name="title">Vasc Admin</ui:define>
|
||||
<ui:define name="content">
|
||||
<h:panelGrid columns="4" id="grid" width="100%">
|
||||
<rich:panel style="width:80%;">
|
||||
<f:facet name="header">
|
||||
<h:outputText value="Vasc Admin" />
|
||||
</f:facet>
|
||||
<rich:dataList var="info" value="#{vascFacesController.vascAdminEntries}">
|
||||
<h:column>
|
||||
<h:outputLink value="#{facesContext.externalContext.requestContextPath}/vasc/#{info}/list.jsf"><h:outputText value="#{info}"/></h:outputLink>
|
||||
</h:column>
|
||||
</rich:dataList>
|
||||
</rich:panel>
|
||||
<rich:panel style="width:80%;">
|
||||
<f:facet name="header">
|
||||
<h:outputText value="Export Servlet" />
|
||||
</f:facet>
|
||||
<h:form>
|
||||
<h:panelGrid columns="2" width="100%">
|
||||
<h:outputText value="Entry:"/>
|
||||
<h:selectOneMenu value="#{exportController.entryId}" onchange="javascript:this.form.submit(); return false;">
|
||||
<f:selectItems value="#{exportController.entryIdSelectItems}"/>
|
||||
</h:selectOneMenu>
|
||||
|
||||
<h:outputText value="Type:"/>
|
||||
<h:selectOneMenu value="#{exportController.exportType}" onchange="javascript:this.form.submit(); return false;">
|
||||
<f:selectItems value="#{exportController.exportTypeSelectItems}"/>
|
||||
</h:selectOneMenu>
|
||||
|
||||
<h:outputText value="tree-url:"/>
|
||||
<h:selectBooleanCheckbox value="#{exportController.exportTree}" onchange="javascript:this.form.submit(); return false;"/>
|
||||
</h:panelGrid>
|
||||
<h:panelGrid columns="2" width="100%">
|
||||
<h:outputText value="Url:"/>
|
||||
<h:outputLink value="#{facesContext.externalContext.requestContextPath}/#{exportController.buildExportUrl}">
|
||||
<h:outputText value="#{facesContext.externalContext.requestContextPath}/#{exportController.buildExportUrl}"/>
|
||||
</h:outputLink>
|
||||
</h:panelGrid>
|
||||
</h:form>
|
||||
</rich:panel>
|
||||
<rich:panel>
|
||||
<f:facet name="header">
|
||||
<h:outputText value="WebService Servlet" />
|
||||
</f:facet>
|
||||
<h:outputText value="todo" />
|
||||
</rich:panel>
|
||||
<rich:panel>
|
||||
<f:facet name="header">
|
||||
<h:outputText value="WebStart" />
|
||||
</f:facet>
|
||||
<h:outputText value="todo" />
|
||||
</rich:panel>
|
||||
</h:panelGrid>
|
||||
</ui:define>
|
||||
</ui:composition>
|
||||
</html>
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
<ui:composition template="/jsp/includes/layout.xhtml"
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:ui="http://java.sun.com/jsf/facelets"
|
||||
xmlns:h="http://java.sun.com/jsf/html"
|
||||
xmlns:f="http://java.sun.com/jsf/core"
|
||||
xmlns:rich="http://richfaces.org/rich"
|
||||
>
|
||||
<ui:define name="title">Help</ui:define>
|
||||
<ui:define name="content"><h:outputText value="Help"/></ui:define>
|
||||
</ui:composition>
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
<ui:composition
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:ui="http://java.sun.com/jsf/facelets"
|
||||
xmlns:h="http://java.sun.com/jsf/html"
|
||||
xmlns:f="http://java.sun.com/jsf/core"
|
||||
xmlns:rich="http://richfaces.org/rich"
|
||||
>
|
||||
<rich:panel header="User Greeter" style="width: 315px">
|
||||
<h2><h:outputText value="Hello User" /></h2>
|
||||
<h:outputLink value="user/index.jsf">
|
||||
<h:outputText value="Login" />
|
||||
</h:outputLink>
|
||||
<h:outputText value="Already Loggedin."/>
|
||||
</rich:panel>
|
||||
</ui:composition>
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
<ui:composition
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:ui="http://java.sun.com/jsf/facelets"
|
||||
xmlns:h="http://java.sun.com/jsf/html"
|
||||
xmlns:f="http://java.sun.com/jsf/core"
|
||||
xmlns:rich="http://richfaces.org/rich"
|
||||
>
|
||||
<rich:panel header="User Greeter" style="width: 315px">
|
||||
<h2><h:outputText value="Hello User" /></h2>
|
||||
<h:outputText value="Name: " />
|
||||
<h:outputText value="#{userController.flowUser.username}" />
|
||||
<rich:dataList value="#{userController.rightRoles}" var="role">
|
||||
<h:outputText value="#{role.roleKey}" />
|
||||
</rich:dataList>
|
||||
</rich:panel>
|
||||
</ui:composition>
|
||||
|
|
@ -1,71 +0,0 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:ui="http://java.sun.com/jsf/facelets"
|
||||
xmlns:h="http://java.sun.com/jsf/html"
|
||||
xmlns:f="http://java.sun.com/jsf/core"
|
||||
>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html;charset=UTF-8"/>
|
||||
<meta name="robots" content="noodp"/>
|
||||
<meta http-equiv="Pragma" content="no-cache"/>
|
||||
<meta name="description" content="vasc"/>
|
||||
<meta name="keywords" content="demo,forwardfire,x4o,vasc,java"/>
|
||||
<title><ui:insert name="title">Default title</ui:insert></title>
|
||||
<link href="#{facesContext.externalContext.requestContextPath}/css/site.css" rel="stylesheet" type="text/css"/>
|
||||
<!--[if IE 6]><link href="#{facesContext.externalContext.requestContextPath}/css/ie6_fixes.css" rel="stylesheet" type="text/css" /><![endif]-->
|
||||
<!--[if IE 7]><link href="#{facesContext.externalContext.requestContextPath}/css/ie7_fixes.css" rel="stylesheet" type="text/css" /><![endif]-->
|
||||
<!--[if IE 8]><link href="#{facesContext.externalContext.requestContextPath}/css/ie8_fixes.css" rel="stylesheet" type="text/css" /><![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<f:view>
|
||||
<div id="page_wrap">
|
||||
<div id="page_header">
|
||||
<a href="#{facesContext.externalContext.requestContextPath}/jsp/index.jsf"><img src="#{facesContext.externalContext.requestContextPath}/img/logstats-logo.png" alt="Demo Logo" /></a>
|
||||
<div id="page_menu_left">
|
||||
</div>
|
||||
<div id="page_menu_right">
|
||||
<a href="#{facesContext.externalContext.requestContextPath}/jsp/index.jsf" class="active">Home</a>
|
||||
<a href="#{facesContext.externalContext.requestContextPath}/jsp/reports.jsf">Reports</a>
|
||||
<a href="#{facesContext.externalContext.requestContextPath}/jsp/realtime.jsf">Log</a>
|
||||
<a href="#{facesContext.externalContext.requestContextPath}/jsp/help.jsf">Help</a>
|
||||
<h:outputLink rendered="#{userController.userLoggedin}" value="#{facesContext.externalContext.requestContextPath}/jsp/admin/index.jsf">
|
||||
<h:outputText value="Admin"/>
|
||||
</h:outputLink>
|
||||
</div>
|
||||
<div id="page_user_info">
|
||||
<h:outputLink rendered="#{userController.userLoggedin == false}" value="#{facesContext.externalContext.requestContextPath}/jsp/admin/index.jsf">
|
||||
<h:outputText value="Login"/>
|
||||
</h:outputLink>
|
||||
<h:panelGroup rendered="#{userController.userLoggedin == true}">
|
||||
<h:outputText value="#{userController.user.username}"/>
|
||||
<h:outputText value=" - "/>
|
||||
<h:outputLink value="#{facesContext.externalContext.requestContextPath}/jsp/login/logout.jsf">
|
||||
<h:outputText value="Logout"/>
|
||||
</h:outputLink>
|
||||
</h:panelGroup>
|
||||
</div>
|
||||
</div>
|
||||
<div id="page_content">
|
||||
<h1><ui:insert name="title" /></h1>
|
||||
<ui:insert name="content"/>
|
||||
</div>
|
||||
<div class="spacer"> </div>
|
||||
<div id="page_footer">
|
||||
<table width="100%" border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td colspan="4" class="text_center">Vasc Tech Demo Web.</td>
|
||||
</tr>
|
||||
<tr class="copyright">
|
||||
<td colspan="2" class="text_left">Copyright © none</td>
|
||||
<td colspan="2" class="text_right">
|
||||
Versie 0.8Beta -rXxx
|
||||
<i>(2010-06-26 01:07)</i>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</f:view>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,318 +0,0 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:ui="http://java.sun.com/jsf/facelets"
|
||||
xmlns:h="http://java.sun.com/jsf/html"
|
||||
xmlns:f="http://java.sun.com/jsf/core"
|
||||
xmlns:v="http://vasc.forwardfire.net/vasc.tld"
|
||||
xmlns:rich="http://richfaces.org/rich"
|
||||
>
|
||||
<ui:composition template="/jsp/includes/layout.xhtml">
|
||||
<ui:define name="title">
|
||||
<h:outputText value="#{requestScopeVascEntityNameI18n}" />
|
||||
</ui:define>
|
||||
<ui:define name="content">
|
||||
<script language="javascript" type="text/javascript">
|
||||
<![CDATA[
|
||||
function selectAllCheckboxes(x) {
|
||||
for (var i=0,l=x.form.length; i<l; i++) {
|
||||
if (x.form[i].type == 'checkbox' && (!x.form[i].disabled) && x!=x.form[i] ) {
|
||||
x.form[i].checked=!x.form[i].checked;
|
||||
}
|
||||
}
|
||||
}
|
||||
]]>
|
||||
</script>
|
||||
<v:vascEntry vascController="#{vascFacesController.vascController}"
|
||||
vascFrontendData="#{vascFacesController.newVascFrontendData}"
|
||||
entryName="#{requestScopeVascEntityName}"
|
||||
entrySupportVar="entrySupport"
|
||||
tableRecordVar="tableRecord"
|
||||
injectEditFieldsId="injectEditFieldsId"
|
||||
injectTableOptionsId="injectTableOptionsId"
|
||||
injectTableColumnsId="injectTableColumnsId"
|
||||
disableLinkColumns="true"
|
||||
>
|
||||
<f:facet name="deleteView" >
|
||||
<h:panelGroup>
|
||||
<!-- <h1><h:outputText value="#{entrySupport.i18nMap[entrySupport.vascEntry.name]}"/></h1> -->
|
||||
<p>
|
||||
<h:outputFormat value="#{entrySupport.i18nMap[entrySupport.vascEntry.deleteDescription]}" escape="false">
|
||||
<f:param value="#{entrySupport.selectedDisplayName}" />
|
||||
</h:outputFormat>
|
||||
</p>
|
||||
<h:form>
|
||||
<h:commandButton actionListener="#{entrySupport.deleteAction}" value="#{entrySupport.i18nMap['vasc.action.deleteRowAction.name']}"/>
|
||||
<h:commandButton actionListener="#{entrySupport.cancelAction}" value="#{entrySupport.i18nMap['generic.vasc.jsf.action.cancel']}" />
|
||||
</h:form>
|
||||
</h:panelGroup>
|
||||
</f:facet>
|
||||
|
||||
<f:facet name="exportView" >
|
||||
<h:panelGroup>
|
||||
<!-- <h1><h:outputText value="#{entrySupport.i18nMap[entrySupport.vascEntry.name]}"/></h1> -->
|
||||
<p>
|
||||
<h:outputFormat value="#{entrySupport.i18nMap[entrySupport.vascEntry.exportDescription]}" escape="false">
|
||||
<f:param value="#{entrySupport.vascEntry.name}" />
|
||||
</h:outputFormat>
|
||||
</p>
|
||||
<h:form>
|
||||
<h:commandButton actionListener="#{entrySupport.cancelAction}" value="#{entrySupport.i18nMap['generic.vasc.jsf.action.cancel']}" />
|
||||
</h:form>
|
||||
</h:panelGroup>
|
||||
</f:facet>
|
||||
|
||||
<f:facet name="editView" >
|
||||
<h:panelGroup>
|
||||
<!-- <h1><h:outputText value="#{entrySupport.i18nMap[entrySupport.vascEntry.name]}"/></h1> -->
|
||||
<p>
|
||||
<h:outputFormat value="#{entrySupport.i18nMap[entrySupport.vascEntry.editDescription]}" escape="false" rendered="#{!entrySupport.vascEntry.vascFrontendData.vascEntryState.editCreate}">
|
||||
<f:param value="#{entrySupport.vascEntry.name}" />
|
||||
</h:outputFormat>
|
||||
<h:outputFormat value="#{entrySupport.i18nMap[entrySupport.vascEntry.createDescription]}" escape="false" rendered="#{entrySupport.vascEntry.vascFrontendData.vascEntryState.editCreate}">
|
||||
<f:param value="#{entrySupport.vascEntry.name}" />
|
||||
</h:outputFormat>
|
||||
</p>
|
||||
<h:form>
|
||||
<ul class="actionboxtab">
|
||||
<li><a class="active"><h:outputText value="#{entrySupport.i18nMap['vasc.action.editRowAction.name']}"/></a></li>
|
||||
<ui:repeat var="link" value="#{entrySupport.vascLinkEntriesEditTab}" rendered="#{!entrySupport.vascEntry.vascFrontendData.vascEntryState.editCreate}">
|
||||
<li><h:commandLink actionListener="#{entrySupport.linkEditAction}" value="#{entrySupport.i18nMap[link.name]}" type="#{link.id}"/></li>
|
||||
</ui:repeat>
|
||||
</ul>
|
||||
<h:panelGrid columns="1" styleClass="actionbox" width="100%">
|
||||
<h:outputText value="&nbsp;&nbsp;" escape="false"/>
|
||||
</h:panelGrid>
|
||||
</h:form>
|
||||
<br/>
|
||||
<h:form>
|
||||
<h:panelGrid columns="3" id="injectEditFieldsId" styleClass="actionbox"/>
|
||||
<p>
|
||||
<h:commandButton actionListener="#{entrySupport.saveAction}" value="#{entrySupport.i18nMap['generic.vasc.jsf.action.save']}"/>
|
||||
<h:commandButton actionListener="#{entrySupport.cancelAction}" value="#{entrySupport.i18nMap['generic.vasc.jsf.action.cancel']}" />
|
||||
</p>
|
||||
</h:form>
|
||||
</h:panelGroup>
|
||||
</f:facet>
|
||||
|
||||
<f:facet name="listView" >
|
||||
<h:panelGroup>
|
||||
<!-- <h1><h:outputText value="#{entrySupport.i18nMap[entrySupport.vascEntry.name]}"/></h1> -->
|
||||
<p>
|
||||
<h:outputFormat value="#{entrySupport.i18nMap[entrySupport.vascEntry.listDescription]}" escape="false">
|
||||
<f:param value="#{entrySupport.vascEntry.name}" />
|
||||
</h:outputFormat>
|
||||
</p>
|
||||
<h:form>
|
||||
<p>
|
||||
<h:commandButton actionListener="#{entrySupport.addAction}"
|
||||
rendered="#{entrySupport.vascEntry.vascAdminCreate}"
|
||||
value="#{entrySupport.i18nMap['vasc.action.addRowAction.name']}"
|
||||
title="#{entrySupport.i18nMap['vasc.action.addRowAction.description']}"
|
||||
/>
|
||||
<h:commandButton actionListener="#{entrySupport.backAction}"
|
||||
rendered="#{entrySupport.renderBackAction}"
|
||||
value="#{entrySupport.i18nMap['generic.vasc.jsf.action.back']}"
|
||||
/>
|
||||
|
||||
</p>
|
||||
</h:form>
|
||||
<h:form>
|
||||
<rich:dataTable id="injectTableColumnsId" var="tableRecord" value="#{entrySupport.tableDataModel}" rowClasses="odd,even">
|
||||
<f:facet name="header">
|
||||
<rich:columnGroup>
|
||||
<rich:column colspan="#{entrySupport.totalColumnCount}" styleClass="text_left">
|
||||
<ul class="actionboxtab">
|
||||
<li>
|
||||
<h:panelGroup rendered="#{!entrySupport.renderBackAction}">
|
||||
<a class="active"><h:outputText value="#{entrySupport.i18nMap['generic.vasc.jsf.listOption.header']}"/></a>
|
||||
</h:panelGroup>
|
||||
<h:commandLink actionListener="#{entrySupport.backEditAction}" value="#{entrySupport.i18nMap['vasc.action.editRowAction.name']}" rendered="#{entrySupport.renderBackEditAction}"/>
|
||||
</li>
|
||||
<ui:repeat var="link" value="#{entrySupport.vascLinkEntriesEditTabParentState}">
|
||||
<li><h:commandLink actionListener="#{entrySupport.linkListAction}" value="#{entrySupport.i18nMap[link.name]}" type="#{link.id}" styleClass="#{link.vascEntryId==entrySupport.vascEntry.id?'active':''}"/></li>
|
||||
</ui:repeat>
|
||||
</ul>
|
||||
<h:panelGrid columns="1" styleClass="actionbox" width="100%">
|
||||
<h:panelGrid columns="2" id="injectTableOptionsId"/>
|
||||
<h:panelGroup>
|
||||
<h:outputText value="#{entrySupport.i18nMap['generic.vasc.jsf.listOption.search']}"/>
|
||||
<h:inputText value="#{entrySupport.searchString}"/>
|
||||
<h:commandButton actionListener="#{entrySupport.searchAction}" value="#{entrySupport.i18nMap['generic.vasc.jsf.listOption.sumbit']}"/>
|
||||
</h:panelGroup>
|
||||
</h:panelGrid>
|
||||
</rich:column>
|
||||
<rich:column colspan="#{entrySupport.totalColumnCount}" styleClass="text_left" breakBefore="true">
|
||||
<ul class="paging">
|
||||
<li class="paging_atstart">
|
||||
<h:commandLink rendered="#{entrySupport.hasPagePreviousAction}" value="#{entrySupport.i18nMap['generic.vasc.jsf.pager.previous']}"
|
||||
actionListener="#{entrySupport.pagePreviousAction}"/>
|
||||
<h:outputText rendered="#{!entrySupport.hasPagePreviousAction}" value="#{entrySupport.i18nMap['generic.vasc.jsf.pager.previous']}" />
|
||||
</li>
|
||||
<ui:repeat var="page" value="#{entrySupport.tablePagesDataModel}" rendered="#{!entrySupport.hasExtendedPageMode}">
|
||||
<li>
|
||||
<h:commandLink actionListener="#{entrySupport.pageAction}" value="#{page.pageNumber}" type="#{page.pageNumber}" rendered="#{!page.selected}"/>
|
||||
<h:outputText styleClass="paging_thispage" value="#{page.pageNumber}" rendered="#{page.selected}"/>
|
||||
</li>
|
||||
</ui:repeat>
|
||||
<h:panelGroup rendered="#{entrySupport.hasExtendedPageMode}">
|
||||
<ui:repeat var="page" value="#{entrySupport.tablePagesExtendedBegin}">
|
||||
<li>
|
||||
<h:commandLink actionListener="#{entrySupport.pageAction}" value="#{page.pageNumber}" type="#{page.pageNumber}" rendered="#{!page.selected}"/>
|
||||
<h:outputText styleClass="paging_thispage" value="#{page.pageNumber}" rendered="#{page.selected}"/>
|
||||
</li>
|
||||
</ui:repeat>
|
||||
<h:panelGroup rendered="#{entrySupport.hasExtendedPageModeCenter}">
|
||||
<li><span class="text">...</span></li>
|
||||
<ui:repeat var="page" value="#{entrySupport.tablePagesExtendedCenter}">
|
||||
<li>
|
||||
<h:commandLink actionListener="#{entrySupport.pageAction}" value="#{page.pageNumber}" type="#{page.pageNumber}" rendered="#{!page.selected}"/>
|
||||
<h:outputText styleClass="paging_thispage" value="#{page.pageNumber}" rendered="#{page.selected}"/>
|
||||
</li>
|
||||
</ui:repeat>
|
||||
</h:panelGroup>
|
||||
<li><span class="text">...</span></li>
|
||||
<ui:repeat var="page" value="#{entrySupport.tablePagesExtendedEnd}">
|
||||
<li>
|
||||
<h:commandLink actionListener="#{entrySupport.pageAction}" value="#{page.pageNumber}" type="#{page.pageNumber}" rendered="#{!page.selected}"/>
|
||||
<h:outputText styleClass="paging_thispage" value="#{page.pageNumber}" rendered="#{page.selected}"/>
|
||||
</li>
|
||||
</ui:repeat>
|
||||
</h:panelGroup>
|
||||
<li class="paging_atend">
|
||||
<h:commandLink rendered="#{entrySupport.hasPageNextAction}" value="#{entrySupport.i18nMap['generic.vasc.jsf.pager.next']}"
|
||||
actionListener="#{entrySupport.pageNextAction}"/>
|
||||
<h:outputText rendered="#{!entrySupport.hasPageNextAction}" value="#{entrySupport.i18nMap['generic.vasc.jsf.pager.next']}" />
|
||||
</li>
|
||||
</ul>
|
||||
</rich:column>
|
||||
<rich:column colspan="#{entrySupport.totalColumnCount}" styleClass="text_left" breakBefore="true">
|
||||
<h:panelGroup styleClass="table_options_top">
|
||||
<h:outputText value="#{entrySupport.i18nMap['generic.vasc.jsf.table.rows']}" />
|
||||
<h:inputText required="false" value="#{entrySupport.vascEntry.vascFrontendData.vascEntryState.vascBackendState.pageSize}" size="4"/>
|
||||
|
||||
<h:outputText value="#{entrySupport.i18nMap['generic.vasc.jsf.table.pagerDirect']}" />
|
||||
<h:selectOneMenu onchange="javascript:this.form.submit(); return false;" value="#{entrySupport.selectedDirectPage}" valueChangeListener="#{entrySupport.processDirectPageChange}">
|
||||
<f:selectItems value="#{entrySupport.directPageItems}" />
|
||||
</h:selectOneMenu>
|
||||
|
||||
<img src="#{facesContext.externalContext.requestContextPath}/img/icon_download.png" alt="#{entrySupport.i18nMap['generic.vasc.jsf.table.download.img']}" width="15" height="15" /><h:outputText value="&nbsp;&nbsp;" escape="false"/>
|
||||
<h:outputText value="#{entrySupport.i18nMap['generic.vasc.jsf.table.downloadDirect']}" />
|
||||
<h:selectOneMenu onchange="javascript:this.form.submit(); return false;" value="#{entrySupport.selectedExporterAction}" valueChangeListener="#{entrySupport.processDirectDownloadChange}">
|
||||
<f:selectItems value="#{entrySupport.globalExportItems}" />
|
||||
</h:selectOneMenu>
|
||||
|
||||
<img src="#{facesContext.externalContext.requestContextPath}/img/icon_print.png" alt="#{entrySupport.i18nMap['generic.vasc.jsf.table.printer.img']}" width="15" height="15" /><h:outputText value="&nbsp;&nbsp;" escape="false"/>
|
||||
<h:outputFormat value="#{entrySupport.i18nMap['generic.vasc.jsf.table.resultText']}">
|
||||
<f:param value="#{entrySupport.pageStartCount}" />
|
||||
<f:param value="#{entrySupport.pageStopCount}" />
|
||||
<f:param value="#{entrySupport.pageTotalRecordCount}" />
|
||||
</h:outputFormat>
|
||||
</h:panelGroup>
|
||||
</rich:column>
|
||||
<rich:column colspan="#{entrySupport.totalColumnCount}" styleClass="text_left" breakBefore="true" rendered="#{entrySupport.hasMultiRowActions}">
|
||||
<h:outputText value="#{entrySupport.i18nMap['generic.vasc.jsf.multiAction.selectAll']}"/>
|
||||
<h:selectBooleanCheckbox id="selectAllBox" required="false" onchange="javascript:selectAllCheckboxes(this);return false;" value="#{entrySupport.selectAllValue}"/>
|
||||
<h:outputText value="&nbsp;&nbsp;" escape="false"/>
|
||||
<h:selectOneMenu id="multiAction" required="false" value="#{entrySupport.selectedMultiRowAction}" onchange="javascript:this.form.submit(); return false;" valueChangeListener="#{entrySupport.processMultiRowActionChange}">
|
||||
<f:selectItems value="#{entrySupport.multiRowActionItems}" />
|
||||
</h:selectOneMenu>
|
||||
</rich:column>
|
||||
<rich:column colspan="#{entrySupport.totalFieldColumnCount}" breakBefore="true">
|
||||
<h:outputText value="#{entrySupport.i18nMap['generic.vasc.jsf.tableHeader.fields']}" styleClass="table_sub_header"/>
|
||||
</rich:column>
|
||||
<rich:column colspan="#{entrySupport.totalLinkColumnCount}" rendered="#{entrySupport.totalLinkColumnCount != 0}">
|
||||
<h:outputText value="#{entrySupport.i18nMap['generic.vasc.jsf.tableHeader.links']}" styleClass="table_sub_header"/>
|
||||
</rich:column>
|
||||
<rich:column colspan="#{entrySupport.totalActionColumnCount}" rendered="#{entrySupport.totalActionColumnCount != 0}">
|
||||
<h:outputText value="#{entrySupport.i18nMap['generic.vasc.jsf.tableHeader.actions']}" styleClass="table_sub_header"/>
|
||||
</rich:column>
|
||||
</rich:columnGroup>
|
||||
</f:facet>
|
||||
<f:facet name="footer">
|
||||
<rich:columnGroup>
|
||||
<rich:column colspan="#{entrySupport.totalColumnCount}" styleClass="text_left">
|
||||
<h:panelGroup styleClass="table_options_bottom">
|
||||
<h:outputText value="#{entrySupport.i18nMap['generic.vasc.jsf.table.rows']}" />
|
||||
<h:inputText required="false" value="#{entrySupport.vascEntry.vascFrontendData.vascEntryState.vascBackendState.pageSize}" size="4"/>
|
||||
|
||||
<h:outputText value="#{entrySupport.i18nMap['generic.vasc.jsf.table.pagerDirect']}" />
|
||||
<h:selectOneMenu onchange="javascript:this.form.submit(); return false;" value="#{entrySupport.selectedDirectPage}" valueChangeListener="#{entrySupport.processDirectPageChange}">
|
||||
<f:selectItems value="#{entrySupport.directPageItems}" />
|
||||
</h:selectOneMenu>
|
||||
|
||||
<img src="#{facesContext.externalContext.requestContextPath}/img/icon_download.png" alt="#{entrySupport.i18nMap['generic.vasc.jsf.table.download.img']}" width="15" height="15" /><h:outputText value="&nbsp;&nbsp;" escape="false"/>
|
||||
<h:outputText value="#{entrySupport.i18nMap['generic.vasc.jsf.table.downloadDirect']}" />
|
||||
<h:selectOneMenu onchange="javascript:this.form.submit(); return false;" value="#{entrySupport.selectedExporterAction}" valueChangeListener="#{entrySupport.processDirectDownloadChange}">
|
||||
<f:selectItems value="#{entrySupport.globalExportItems}" />
|
||||
</h:selectOneMenu>
|
||||
|
||||
<img src="#{facesContext.externalContext.requestContextPath}/img/icon_print.png" alt="#{entrySupport.i18nMap['generic.vasc.jsf.table.printer.img']}" width="15" height="15" /><h:outputText value="&nbsp;&nbsp;" escape="false"/>
|
||||
<h:outputFormat value="#{entrySupport.i18nMap['generic.vasc.jsf.table.resultText']}">
|
||||
<f:param value="#{entrySupport.pageStartCount}" />
|
||||
<f:param value="#{entrySupport.pageStopCount}" />
|
||||
<f:param value="#{entrySupport.pageTotalRecordCount}" />
|
||||
</h:outputFormat>
|
||||
</h:panelGroup>
|
||||
</rich:column>
|
||||
<rich:column colspan="#{entrySupport.totalColumnCount}" styleClass="text_left" breakBefore="true">
|
||||
<ul class="paging">
|
||||
<li class="paging_atstart">
|
||||
<h:commandLink rendered="#{entrySupport.hasPagePreviousAction}" value="#{entrySupport.i18nMap['generic.vasc.jsf.pager.previous']}"
|
||||
actionListener="#{entrySupport.pagePreviousAction}"/>
|
||||
<h:outputText rendered="#{!entrySupport.hasPagePreviousAction}" value="#{entrySupport.i18nMap['generic.vasc.jsf.pager.previous']}" />
|
||||
</li>
|
||||
<ui:repeat var="page" value="#{entrySupport.tablePagesDataModel}" rendered="#{!entrySupport.hasExtendedPageMode}">
|
||||
<li>
|
||||
<h:commandLink actionListener="#{entrySupport.pageAction}" value="#{page.pageNumber}" type="#{page.pageNumber}" rendered="#{!page.selected}"/>
|
||||
<h:outputText styleClass="paging_thispage" value="#{page.pageNumber}" rendered="#{page.selected}"/>
|
||||
</li>
|
||||
</ui:repeat>
|
||||
<h:panelGroup rendered="#{entrySupport.hasExtendedPageMode}">
|
||||
<ui:repeat var="page" value="#{entrySupport.tablePagesExtendedBegin}">
|
||||
<li>
|
||||
<h:commandLink actionListener="#{entrySupport.pageAction}" value="#{page.pageNumber}" type="#{page.pageNumber}" rendered="#{!page.selected}"/>
|
||||
<h:outputText styleClass="paging_thispage" value="#{page.pageNumber}" rendered="#{page.selected}"/>
|
||||
</li>
|
||||
</ui:repeat>
|
||||
<h:panelGroup rendered="#{entrySupport.hasExtendedPageModeCenter}">
|
||||
<li><span class="text">...</span></li>
|
||||
<ui:repeat var="page" value="#{entrySupport.tablePagesExtendedCenter}">
|
||||
<li>
|
||||
<h:commandLink actionListener="#{entrySupport.pageAction}" value="#{page.pageNumber}" type="#{page.pageNumber}" rendered="#{!page.selected}"/>
|
||||
<h:outputText styleClass="paging_thispage" value="#{page.pageNumber}" rendered="#{page.selected}"/>
|
||||
</li>
|
||||
</ui:repeat>
|
||||
</h:panelGroup>
|
||||
<li><span class="text">...</span></li>
|
||||
<ui:repeat var="page" value="#{entrySupport.tablePagesExtendedEnd}">
|
||||
<li>
|
||||
<h:commandLink actionListener="#{entrySupport.pageAction}" value="#{page.pageNumber}" type="#{page.pageNumber}" rendered="#{!page.selected}"/>
|
||||
<h:outputText styleClass="paging_thispage" value="#{page.pageNumber}" rendered="#{page.selected}"/>
|
||||
</li>
|
||||
</ui:repeat>
|
||||
</h:panelGroup>
|
||||
<li class="paging_atend">
|
||||
<h:commandLink rendered="#{entrySupport.hasPageNextAction}" value="#{entrySupport.i18nMap['generic.vasc.jsf.pager.next']}"
|
||||
actionListener="#{entrySupport.pageNextAction}"/>
|
||||
<h:outputText rendered="#{!entrySupport.hasPageNextAction}" value="#{entrySupport.i18nMap['generic.vasc.jsf.pager.next']}" />
|
||||
</li>
|
||||
</ul>
|
||||
</rich:column>
|
||||
</rich:columnGroup>
|
||||
</f:facet>
|
||||
</rich:dataTable>
|
||||
</h:form>
|
||||
<h:form>
|
||||
<p>
|
||||
<h:commandButton actionListener="#{entrySupport.addAction}"
|
||||
rendered="#{entrySupport.vascEntry.vascAdminCreate}"
|
||||
value="#{entrySupport.i18nMap['vasc.action.addRowAction.name']}"
|
||||
title="#{entrySupport.i18nMap['vasc.action.addRowAction.description']}"/>
|
||||
</p>
|
||||
</h:form>
|
||||
</h:panelGroup>
|
||||
</f:facet>
|
||||
</v:vascEntry>
|
||||
|
||||
</ui:define>
|
||||
</ui:composition>
|
||||
</html>
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
<ui:composition template="/jsp/includes/layout.xhtml"
|
||||
xmlns:ui="http://java.sun.com/jsf/facelets"
|
||||
xmlns:h="http://java.sun.com/jsf/html">
|
||||
<ui:define name="title">
|
||||
<h:outputText value="#{wikiPageController.wikiTitle}" />
|
||||
</ui:define>
|
||||
<ui:define name="content">
|
||||
<h:outputText value="#{wikiPageController.wikiContent}" escape="false"/>
|
||||
</ui:define>
|
||||
</ui:composition>
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
<ui:composition template="/jsp/includes/layout.xhtml"
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:ui="http://java.sun.com/jsf/facelets"
|
||||
xmlns:h="http://java.sun.com/jsf/html"
|
||||
xmlns:f="http://java.sun.com/jsf/core"
|
||||
xmlns:rich="http://richfaces.org/rich"
|
||||
>
|
||||
<ui:define name="title">Index</ui:define>
|
||||
<ui:define name="content">
|
||||
<h:outputText value="Test etsdfjs "/>
|
||||
<!--
|
||||
<h:panelGroup rendered="#{userController.userLoggedin == false}">
|
||||
<ui:include src="/jsp/includes/index-public.xhtml"/>
|
||||
</h:panelGroup>
|
||||
<h:panelGroup rendered="#{userController.userLoggedin == true}">
|
||||
<ui:include src="/jsp/includes/index-user.xhtml"/>
|
||||
</h:panelGroup
|
||||
-->
|
||||
</ui:define>
|
||||
</ui:composition>
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
|
||||
<c:redirect url="jsp/index.jsf"/>
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
<ui:composition template="/jsp/includes/layout.xhtml"
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:ui="http://java.sun.com/jsf/facelets"
|
||||
xmlns:h="http://java.sun.com/jsf/html"
|
||||
xmlns:f="http://java.sun.com/jsf/core"
|
||||
>
|
||||
<ui:define name="title">Error</ui:define>
|
||||
<ui:define name="content">
|
||||
<h:outputText value="Could not login" />
|
||||
</ui:define>
|
||||
</ui:composition>
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
<ui:composition template="/jsp/includes/layout.xhtml"
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:ui="http://java.sun.com/jsf/facelets"
|
||||
xmlns:h="http://java.sun.com/jsf/html"
|
||||
xmlns:f="http://java.sun.com/jsf/core"
|
||||
>
|
||||
<ui:define name="title">Forgot</ui:define>
|
||||
<ui:define name="content">
|
||||
<h:outputText value="Could forgot my login, send it to me" />
|
||||
</ui:define>
|
||||
</ui:composition>
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:ui="http://java.sun.com/jsf/facelets"
|
||||
xmlns:h="http://java.sun.com/jsf/html"
|
||||
xmlns:f="http://java.sun.com/jsf/core">
|
||||
<ui:composition template="/jsp/includes/layout.xhtml">
|
||||
<ui:define name="title">Login</ui:define>
|
||||
<ui:define name="content">
|
||||
<form method="post" action="j_security_check">
|
||||
<h:panelGrid columns="2">
|
||||
<h:column><h:outputText value="Username:" /></h:column>
|
||||
<h:column><input type="text" name="j_username"/></h:column>
|
||||
|
||||
<h:column><h:outputText value="Password:" /></h:column>
|
||||
<h:column><input type="password" name="j_password"/></h:column>
|
||||
</h:panelGrid>
|
||||
<input type="submit" value="Login"/>
|
||||
</form>
|
||||
<h:outputLink value="#{facesContext.externalContext.requestContextPath}/jsp/login/login-forgot.jsf">
|
||||
<h:outputText value="Forgot my login." />
|
||||
</h:outputLink>
|
||||
</ui:define>
|
||||
</ui:composition>
|
||||
</html>
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
<ui:composition template="/jsp/includes/layout.xhtml"
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:ui="http://java.sun.com/jsf/facelets"
|
||||
xmlns:h="http://java.sun.com/jsf/html"
|
||||
xmlns:f="http://java.sun.com/jsf/core"
|
||||
>
|
||||
<ui:define name="title">Logout</ui:define>
|
||||
<ui:define name="content">
|
||||
<h:outputText value="Succesfully logged out." />
|
||||
</ui:define>
|
||||
</ui:composition>
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
<ui:composition template="/jsp/includes/layout.xhtml"
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:ui="http://java.sun.com/jsf/facelets"
|
||||
xmlns:h="http://java.sun.com/jsf/html"
|
||||
xmlns:f="http://java.sun.com/jsf/core"
|
||||
xmlns:a4j="http://richfaces.org/a4j"
|
||||
xmlns:rich="http://richfaces.org/rich"
|
||||
>
|
||||
<ui:define name="title">Realtime Logs</ui:define>
|
||||
<ui:define name="content">
|
||||
<a4j:region>
|
||||
<h:form>
|
||||
<a4j:poll id="poll" interval="4000" enabled="#{realTimeController.pollEnabled}" reRender="poll,messageLog"/>
|
||||
</h:form>
|
||||
</a4j:region>
|
||||
<h:form>
|
||||
<h:panelGrid columns="1" id="grid" width="100%">
|
||||
<h:outputText value="Realtime processed data event log"/>
|
||||
<rich:separator lineType="none" height="10px"/>
|
||||
<rich:separator lineType="solid" height="1px"/>
|
||||
|
||||
<h:panelGroup>
|
||||
<h:outputText value="Polling active:"/>
|
||||
<h:selectBooleanCheckbox value="#{realTimeController.pollEnabled}" required="false" onchange="javascript:this.form.submit(); return false;"/>
|
||||
|
||||
<h:outputText value="Reversed tail:"/>
|
||||
<h:selectBooleanCheckbox value="#{realTimeController.reversedTail}" required="false" onchange="javascript:this.form.submit(); return false;"/>
|
||||
|
||||
<h:outputText value="LogHosts:"/>
|
||||
|
||||
<h:outputText value="LogLevel:"/>
|
||||
|
||||
<h:outputText value="Message regex:"/>
|
||||
<h:inputText value="#{realTimeController.filterRegex}" required="false"/>
|
||||
|
||||
<h:outputText value="Area rows:"/>
|
||||
<h:selectOneMenu value="#{realTimeController.messageRows}" onchange="javascript:this.form.submit(); return false;">
|
||||
<f:selectItems value="#{realTimeController.messageRowsSelectItems}"/>
|
||||
</h:selectOneMenu>
|
||||
<h:outputText value="cols:"/>
|
||||
<h:selectOneMenu value="#{realTimeController.messageCols}" onchange="javascript:this.form.submit(); return false;">
|
||||
<f:selectItems value="#{realTimeController.messageColsSelectItems}"/>
|
||||
</h:selectOneMenu>
|
||||
|
||||
</h:panelGroup>
|
||||
<h:inputTextarea
|
||||
id="messageLog"
|
||||
style="font-size:10px;"
|
||||
rows="#{realTimeController.messageRows}" cols="#{realTimeController.messageCols}"
|
||||
enabled="false"
|
||||
value="#{realTimeController.messageLogData}"
|
||||
/>
|
||||
</h:panelGrid>
|
||||
</h:form>
|
||||
</ui:define>
|
||||
</ui:composition>
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
<ui:composition template="/jsp/includes/layout.xhtml"
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:ui="http://java.sun.com/jsf/facelets"
|
||||
xmlns:h="http://java.sun.com/jsf/html"
|
||||
xmlns:f="http://java.sun.com/jsf/core"
|
||||
xmlns:rich="http://richfaces.org/rich"
|
||||
>
|
||||
<ui:define name="title">Reports</ui:define>
|
||||
<ui:define name="content"><h:outputText value="The report page"/></ui:define>
|
||||
</ui:composition>
|
||||
Loading…
Add table
Add a link
Reference in a new issue