made server gui work and auto generate xml imports
This commit is contained in:
parent
01b3b5cc54
commit
c259e28e44
69 changed files with 1669 additions and 1230 deletions
|
|
@ -76,6 +76,16 @@
|
|||
<artifactId>vasc-backend-jdbc</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.forwardfire.vasc.export</groupId>
|
||||
<artifactId>vasc-export-jr4o</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.forwardfire.vasc.export</groupId>
|
||||
<artifactId>vasc-export-json</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.forwardfire.vasc.lib</groupId>
|
||||
<artifactId>vasc-lib-i18n</artifactId>
|
||||
|
|
|
|||
|
|
@ -26,9 +26,12 @@ import net.forwardfire.vasc.core.VascController;
|
|||
import net.forwardfire.vasc.core.VascControllerProvider;
|
||||
import net.forwardfire.vasc.core.VascEntryConfigControllerLocal;
|
||||
import net.forwardfire.vasc.core.VascException;
|
||||
import net.forwardfire.vasc.export.generic.VascEntryExportWriterCsv;
|
||||
import net.forwardfire.vasc.export.generic.VascEntryExportWriterXml;
|
||||
import net.forwardfire.vasc.export.jr4o.VascEntryExportWriterJR4O;
|
||||
import net.forwardfire.vasc.export.json.VascEntryExportWriterJson;
|
||||
import net.forwardfire.vasc.impl.DefaultVascFactory;
|
||||
import net.forwardfire.vasc.impl.entry.export.VascEntryExporterJR4O;
|
||||
import net.forwardfire.vasc.lib.jr4o.JR4ODesignManager.JRExportType;
|
||||
import net.forwardfire.vasc.impl.entry.DefaultVascEntryExport;
|
||||
|
||||
/**
|
||||
* DemoVascControllerProvider gets the static local jvm vasc controller for this tech demo.
|
||||
|
|
@ -49,12 +52,78 @@ public class VascTechDemoControllerConfig implements VascControllerProvider {
|
|||
VascEntryConfigControllerLocal vecc = (VascEntryConfigControllerLocal)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"));
|
||||
// Add all exporters in reverse ORDER
|
||||
|
||||
DefaultVascEntryExport export;
|
||||
|
||||
export = new DefaultVascEntryExport();
|
||||
export.setExportWriterClass(VascEntryExportWriterXml.class.getName());
|
||||
export.setId("xml");
|
||||
vecc.addVascEntryExporter(export);
|
||||
|
||||
export = new DefaultVascEntryExport();
|
||||
export.setExportWriterClass(VascEntryExportWriterXml.class.getName());
|
||||
export.addWriterParameter("xmltree", "true");
|
||||
export.setId("xmltree");
|
||||
vecc.addVascEntryExporter(export);
|
||||
|
||||
export = new DefaultVascEntryExport();
|
||||
export.setExportWriterClass(VascEntryExportWriterCsv.class.getName());
|
||||
export.setId("csv");
|
||||
vecc.addVascEntryExporter(export);
|
||||
|
||||
export = new DefaultVascEntryExport();
|
||||
export.setExportWriterClass(VascEntryExportWriterJR4O.class.getName());
|
||||
export.addWriterParameter("reportType", "PDF");
|
||||
export.addWriterParameter("reportName", "generic-landscape");
|
||||
export.addWriterParameter("reportResource", "net/forwardfire/vasc/lib/jr4o/reports/dynamic-reports.xml");
|
||||
export.setId("jrPdfLandscape");
|
||||
vecc.addVascEntryExporter(export);
|
||||
|
||||
export = new DefaultVascEntryExport();
|
||||
export.setExportWriterClass(VascEntryExportWriterJR4O.class.getName());
|
||||
export.addWriterParameter("reportType", "PDF");
|
||||
export.addWriterParameter("reportName", "generic-portrait");
|
||||
export.addWriterParameter("reportResource", "net/forwardfire/vasc/lib/jr4o/reports/dynamic-reports.xml");
|
||||
export.setId("jrPdfPortrait");
|
||||
vecc.addVascEntryExporter(export);
|
||||
|
||||
export = new DefaultVascEntryExport();
|
||||
export.setExportWriterClass(VascEntryExportWriterJR4O.class.getName());
|
||||
export.addWriterParameter("reportType", "RTF");
|
||||
export.addWriterParameter("reportName", "generic-landscape");
|
||||
export.addWriterParameter("reportResource", "net/forwardfire/vasc/lib/jr4o/reports/dynamic-reports.xml");
|
||||
export.setId("jrRtf");
|
||||
vecc.addVascEntryExporter(export);
|
||||
|
||||
export = new DefaultVascEntryExport();
|
||||
export.setExportWriterClass(VascEntryExportWriterJR4O.class.getName());
|
||||
export.addWriterParameter("reportType", "XLS");
|
||||
export.addWriterParameter("reportName", "generic-landscape");
|
||||
export.addWriterParameter("reportResource", "net/forwardfire/vasc/lib/jr4o/reports/dynamic-reports.xml");
|
||||
export.setId("jrXls");
|
||||
vecc.addVascEntryExporter(export);
|
||||
|
||||
export = new DefaultVascEntryExport();
|
||||
export.setExportWriterClass(VascEntryExportWriterJR4O.class.getName());
|
||||
export.addWriterParameter("reportType", "XML");
|
||||
export.addWriterParameter("reportName", "generic-landscape");
|
||||
export.addWriterParameter("reportResource", "net/forwardfire/vasc/lib/jr4o/reports/dynamic-reports.xml");
|
||||
export.setId("jrXml");
|
||||
vecc.addVascEntryExporter(export);
|
||||
|
||||
export = new DefaultVascEntryExport();
|
||||
export.setExportWriterClass(VascEntryExportWriterJR4O.class.getName());
|
||||
export.addWriterParameter("reportType", "CSV");
|
||||
export.addWriterParameter("reportName", "generic-landscape");
|
||||
export.addWriterParameter("reportResource", "net/forwardfire/vasc/lib/jr4o/reports/dynamic-reports.xml");
|
||||
export.setId("jrCsv");
|
||||
vecc.addVascEntryExporter(export);
|
||||
|
||||
export = new DefaultVascEntryExport();
|
||||
export.setExportWriterClass(VascEntryExportWriterJson.class.getName());
|
||||
export.setId("json");
|
||||
vecc.addVascEntryExporter(export);
|
||||
|
||||
// Config root bundle to load all resources.
|
||||
vecc.setResourceBundle("net.forwardfire.vasc.lib.i18n.bundle.RootApplicationBundle");
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ import net.forwardfire.vasc.demo.server.tomcat.TomcatService;
|
|||
*
|
||||
* @author Willem Cazander
|
||||
* @version 1.0 May 3, 2012
|
||||
*/
|
||||
*/
|
||||
public class VascTechDemoStartup {
|
||||
|
||||
private Logger logger = null;
|
||||
|
|
|
|||
|
|
@ -24,22 +24,16 @@ package net.forwardfire.vasc.demo.server.tomcat;
|
|||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Enumeration;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
import java.util.jar.JarEntry;
|
||||
import java.util.jar.JarFile;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import net.forwardfire.vasc.demo.server.core.VascTechDemoStartup;
|
||||
|
||||
import org.apache.catalina.Container;
|
||||
import org.apache.catalina.Context;
|
||||
import org.apache.catalina.Host;
|
||||
import org.apache.catalina.Server;
|
||||
|
|
@ -48,24 +42,8 @@ import org.apache.catalina.Wrapper;
|
|||
import org.apache.catalina.core.StandardContext;
|
||||
import org.apache.catalina.startup.Bootstrap;
|
||||
import org.apache.catalina.startup.ContextConfig;
|
||||
import org.apache.naming.NamingContext;
|
||||
import org.apache.naming.resources.VirtualDirContext;
|
||||
import org.apache.openejb.assembler.Deployer;
|
||||
import org.apache.openejb.assembler.DeployerEjb;
|
||||
import org.apache.openejb.assembler.classic.AppInfo;
|
||||
import org.apache.openejb.config.AppModule;
|
||||
import org.apache.openejb.config.ConfigurationFactory;
|
||||
import org.apache.openejb.config.DeploymentsResolver;
|
||||
import org.apache.openejb.config.sys.AdditionalDeployments;
|
||||
import org.apache.openejb.config.sys.Deployments;
|
||||
import org.apache.openejb.config.sys.JaxbOpenejb;
|
||||
import org.apache.openejb.loader.FileUtils;
|
||||
import org.apache.openejb.loader.IO;
|
||||
import org.apache.openejb.loader.Options;
|
||||
import org.apache.openejb.loader.SystemInstance;
|
||||
import org.apache.openejb.server.ejbd.EjbServer;
|
||||
import org.apache.openejb.spi.ContainerSystem;
|
||||
import org.apache.openejb.util.URLs;
|
||||
|
||||
|
||||
/**
|
||||
* TomcatService config and starts Tomcat in semi embedded mode.
|
||||
|
|
@ -95,17 +73,8 @@ public class TomcatService {
|
|||
}
|
||||
*/
|
||||
|
||||
//org.apache.tomee.catalina.ServerListener
|
||||
//we use org.apache.tomee.catalina.ServerListener
|
||||
System.setProperty("openejb.servicemanager.enabled", "true");
|
||||
System.setProperty("openejb.embedded.remotable", "true");
|
||||
System.setProperty("openejb.validation.output.level", "VERBOSE");
|
||||
|
||||
// System.setProperty("openejb.deployments.classpath", "true");
|
||||
// System.setProperty("openejb.deployments.classpath.ear", "true");
|
||||
//System.setProperty("openejb.deployments.classpath", "false");
|
||||
//System.setProperty("openejb.deployments.classpath.ear", "false");
|
||||
//System.setProperty("openejb.deployments.classpath.include", ".*");
|
||||
//System.setProperty("openejb.deployments.classpath.exclude", "");
|
||||
|
||||
Bootstrap boot = new Bootstrap();
|
||||
boot.setCatalinaHome(System.getProperty("user.dir"));
|
||||
|
|
@ -129,78 +98,6 @@ public class TomcatService {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static final String ADDITIONAL_DEPLOYMENTS = "conf/deployments.xml";
|
||||
private static final String CLASSPATH_AS_EAR = "openejb.deployments.classpath.ear";
|
||||
|
||||
private List<String> getDeclaredApps() {
|
||||
// make a copy of the list because we update it
|
||||
final List<Deployments> deployments = new ArrayList<Deployments>();
|
||||
//if (openejb != null) {
|
||||
// deployments.addAll(openejb.getDeployments());
|
||||
//}
|
||||
File additionalDeploymentFile;
|
||||
try {
|
||||
additionalDeploymentFile = SystemInstance.get().getBase().getFile(ADDITIONAL_DEPLOYMENTS, false);
|
||||
} catch (IOException e) {
|
||||
additionalDeploymentFile = null;
|
||||
}
|
||||
if (additionalDeploymentFile.exists()) {
|
||||
InputStream fis = null;
|
||||
try {
|
||||
fis = IO.read(additionalDeploymentFile);
|
||||
final AdditionalDeployments additionalDeployments = JaxbOpenejb.unmarshal(AdditionalDeployments.class, fis);
|
||||
deployments.addAll(additionalDeployments.getDeployments());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
//logger.error("can't read " + ADDITIONAL_DEPLOYMENTS, e);
|
||||
} finally {
|
||||
IO.close(fis);
|
||||
}
|
||||
}
|
||||
|
||||
// resolve jar locations ////////////////////////////////////// BEGIN ///////
|
||||
|
||||
final FileUtils base = SystemInstance.get().getBase();
|
||||
|
||||
final List<URL> declaredAppsUrls = new ArrayList<URL>();
|
||||
try {
|
||||
for (final Deployments deployment : deployments) {
|
||||
DeploymentsResolver.loadFrom(deployment, base, declaredAppsUrls);
|
||||
}
|
||||
} catch (SecurityException ignored) {
|
||||
}
|
||||
return toString(declaredAppsUrls);
|
||||
}
|
||||
|
||||
public ArrayList<File> getModulesFromClassPath(List<String> declaredApps, final ClassLoader classLoader) {
|
||||
final FileUtils base = SystemInstance.get().getBase();
|
||||
if (declaredApps == null) {
|
||||
declaredApps = getDeclaredApps();
|
||||
}
|
||||
final List<URL> classpathAppsUrls = new ArrayList<URL>();
|
||||
DeploymentsResolver.loadFromClasspath(base, classpathAppsUrls, classLoader);
|
||||
|
||||
final ArrayList<File> jarFiles = new ArrayList<File>();
|
||||
for (final URL path : classpathAppsUrls) {
|
||||
if (declaredApps.contains(URLs.toFilePath(path))) continue;
|
||||
|
||||
jarFiles.add(new File(URLs.toFilePath(path)));
|
||||
}
|
||||
return jarFiles;
|
||||
}
|
||||
|
||||
private List<String> toString(final List<URL> urls) {
|
||||
final List<String> toReturn = new ArrayList<String>(urls.size());
|
||||
for (final URL url : urls) {
|
||||
try {
|
||||
toReturn.add(url.toString());
|
||||
} catch (Exception ignore) {
|
||||
}
|
||||
}
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
public void deploy(String deployContext) throws Exception {
|
||||
Service service = server.findService("Catalina");
|
||||
|
|
@ -249,103 +146,23 @@ public class TomcatService {
|
|||
logger.info("Deploy war path: "+deployPath);
|
||||
}
|
||||
|
||||
|
||||
Context ctx = new StandardContext();
|
||||
ctx.setName(deployContext);
|
||||
ctx.setPath(deployContext);
|
||||
ctx.setDocBase(deployPath);
|
||||
//ctx.setParentClassLoader(commonLoader);
|
||||
ctx.setConfigured(true);
|
||||
|
||||
ContextConfig ctxCfg = new ContextConfig();
|
||||
ctx.addLifecycleListener(ctxCfg);
|
||||
|
||||
VirtualDirContext vDir = new VirtualDirContext();
|
||||
vDir.setExtraResourcePaths("../../vasc-demo-tech/vasc-demo-tech-web/target/classes");
|
||||
ctx.setResources(vDir);
|
||||
|
||||
//VirtualWebappLoader loader = new VirtualWebappLoader();
|
||||
//String cl = System.getProperty("java.class.path").replace(":", ";");
|
||||
//logger.info("Virtal class path: "+cl);
|
||||
//loader.setVirtualClasspath(cl);
|
||||
//loader.setSearchVirtualFirst(true);
|
||||
//ctx.setLoader(loader);
|
||||
|
||||
//ctx.getJarScanner().scan
|
||||
host.addChild(ctx);
|
||||
|
||||
applicationContext = ctx;
|
||||
|
||||
/*
|
||||
ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
|
||||
Deployer dep = (Deployer)containerSystem.getJNDIContext().lookup("java:global/openejb/openejb/Deployer");
|
||||
for (AppInfo ai:dep.getDeployedApps()) {
|
||||
System.out.println("AppInfo: "+ai.appId);
|
||||
}
|
||||
ctx.setName(deployContext);
|
||||
ctx.setPath(deployContext);
|
||||
ctx.setDocBase(deployPath);
|
||||
//ctx.setParentClassLoader(commonLoader);
|
||||
ctx.setConfigured(true);
|
||||
|
||||
System.out.println("Deploy JarFile: "+deployPath);
|
||||
Properties p = new Properties();
|
||||
p.setProperty(Deployer.FILENAME, ""+deployPath);
|
||||
p.setProperty(DeployerEjb.OPENEJB_DEPLOYER_FORCED_APP_ID_PROP, deployContext);
|
||||
AppInfo app = dep.deploy(p);
|
||||
ContextConfig ctxCfg = new ContextConfig();
|
||||
ctx.addLifecycleListener(ctxCfg);
|
||||
|
||||
for (Container c:host.findChildren()) {
|
||||
System.out.println("Containter: "+c.getName()+" info: "+c.getInfo());
|
||||
if ("/webapp".equals(c.getName()) | deployContext.equals(c.getName())) {
|
||||
applicationContext = (Context)c;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/* deploy embedded ejbs .
|
||||
for (AppInfo ai:dep.getDeployedApps()) {
|
||||
System.out.println("AppInfo2: "+ai.appId);
|
||||
}
|
||||
|
||||
final List<String> declaredApps = getDeclaredApps();
|
||||
final ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
|
||||
final ArrayList<File> jarFiles = getModulesFromClassPath(declaredApps, classLoader);
|
||||
try {
|
||||
for (final File jarFile : jarFiles) {
|
||||
System.out.println("Deploy JarFile: "+jarFile);
|
||||
|
||||
boolean skip = false;
|
||||
for (AppInfo ai:dep.getDeployedApps()) {
|
||||
if ((""+jarFile).contains(ai.appId)) {
|
||||
System.out.println("Skip deplyo: "+ai.appId);
|
||||
skip = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ((""+jarFile).contains("vasc-core-ejb3-server")) {
|
||||
System.out.println("Skip vasc-core-ejb3-server");
|
||||
skip = true;
|
||||
}
|
||||
if ((""+jarFile).contains("vasc-xpql-ejb3-server")) {
|
||||
System.out.println("Skip vasc-xpql-ejb3-server");
|
||||
skip = true;
|
||||
}
|
||||
if ((""+jarFile).contains("vasc-demo-tech-ejb3")) {
|
||||
System.out.println("Skip vasc-demo-tech-ejb3");
|
||||
skip = true;
|
||||
}
|
||||
if (skip) {
|
||||
continue;
|
||||
}
|
||||
|
||||
p = new Properties();
|
||||
p.setProperty(Deployer.FILENAME, ""+jarFile);
|
||||
p.setProperty(DeployerEjb.OPENEJB_DEPLOYER_FORCED_APP_ID_PROP, "webapp");
|
||||
dep.deploy(p);
|
||||
}
|
||||
if (jarFiles.size() == 0) {
|
||||
logger.warning("config.noModulesFoundToDeploy");
|
||||
}
|
||||
VirtualDirContext vDir = new VirtualDirContext();
|
||||
vDir.setExtraResourcePaths("../../vasc-demo-tech/vasc-demo-tech-web/target/classes");
|
||||
ctx.setResources(vDir);
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
*/
|
||||
host.addChild(ctx);
|
||||
|
||||
applicationContext = ctx;
|
||||
}
|
||||
|
||||
public void deployDebug() throws Exception {
|
||||
|
|
|
|||
|
|
@ -32,8 +32,6 @@ import java.awt.SystemTray;
|
|||
import java.awt.TrayIcon;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
|
|
@ -61,6 +59,7 @@ public class ServerGuiApplication extends SingleFrameApplication {
|
|||
private Logger logger = null;
|
||||
private JStatusPanel statusPanel = null;
|
||||
private ImageIcon serverIcon = null;
|
||||
private UpdateInfoTask updateInfoTask = null;
|
||||
|
||||
public ServerGuiApplication() {
|
||||
logger = Logger.getLogger(ServerGuiApplication.class.getName());
|
||||
|
|
@ -75,31 +74,45 @@ public class ServerGuiApplication extends SingleFrameApplication {
|
|||
mainView.setComponent(statusPanel);
|
||||
mainView.getFrame().setMinimumSize(new Dimension(640,480));
|
||||
mainView.getFrame().setMaximumSize(new Dimension(800,600));
|
||||
mainView.getFrame().addWindowListener(new UpdateInfoListener());
|
||||
|
||||
show(mainView);
|
||||
startSystemTray();
|
||||
|
||||
updateInfoTask = new UpdateInfoTask();
|
||||
Thread t = new Thread(updateInfoTask);
|
||||
t.setName(UpdateInfoTask.class.getSimpleName());
|
||||
t.start();
|
||||
}
|
||||
|
||||
class UpdateInfoListener extends WindowAdapter {
|
||||
class UpdateInfoTask implements Runnable {
|
||||
volatile public boolean run = true;
|
||||
volatile public boolean doUpdate = true;
|
||||
@Override
|
||||
public void windowActivated(WindowEvent e) {
|
||||
System.out.println("vis: opened -ac");
|
||||
statusPanel.updateInfo();
|
||||
public void run() {
|
||||
logger.finest("Updating thread started.");
|
||||
while(run) {
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
if (doUpdate) {
|
||||
statusPanel.updateInfo();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
logger.finest("Updating thread stopped.");
|
||||
}
|
||||
@Override
|
||||
public void windowDeactivated(WindowEvent e) {
|
||||
System.out.println("vis: closed - ac");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class CloseWindowExitListener implements ExitListener {
|
||||
@Override
|
||||
public boolean canExit(EventObject event) {
|
||||
if (event!=null && event.getSource().equals(ServerGuiApplication.this)) {
|
||||
updateInfoTask.run=false; // app will exit so stop update
|
||||
return true;
|
||||
} else {
|
||||
logger.finer("Closing application window.");
|
||||
updateInfoTask.doUpdate=false; // close window
|
||||
ServerGuiApplication.getInstance().getMainFrame().setVisible(false);
|
||||
return false;
|
||||
}
|
||||
|
|
@ -142,6 +155,7 @@ public class ServerGuiApplication extends SingleFrameApplication {
|
|||
aboutItem.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
logger.finer("Systray show about.");
|
||||
JOptionPane.showMessageDialog(ServerGuiApplication.getInstance().getMainFrame(), "Vasc Demo Tech Server:\nIs build to test and demo different parts of the vasc package.", "About Vasc Demo", JOptionPane.PLAIN_MESSAGE);
|
||||
}
|
||||
});
|
||||
|
|
@ -149,6 +163,8 @@ public class ServerGuiApplication extends SingleFrameApplication {
|
|||
statusItem.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
logger.finer("Systray open status window.");
|
||||
updateInfoTask.doUpdate=true;
|
||||
getMainFrame().setVisible(true);
|
||||
}
|
||||
});
|
||||
|
|
@ -156,6 +172,7 @@ public class ServerGuiApplication extends SingleFrameApplication {
|
|||
exitItem.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent arg0) {
|
||||
logger.finer("Systray exit application.");
|
||||
VascTechDemoStartup.getInstance().shutdown();
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ import java.io.StringWriter;
|
|||
import java.io.Writer;
|
||||
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JScrollPane;
|
||||
import javax.swing.JTextArea;
|
||||
|
|
@ -93,25 +94,23 @@ public class JLoadStepWriteFile extends JPanel implements LoadStep,ActionListene
|
|||
text.setText(out.getBuffer().toString());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
JOptionPane.showMessageDialog(null, "Fatal error:\n"+e.getMessage(), "Generate xml error", JOptionPane.ERROR_MESSAGE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean performStep(LoadStepData model) {
|
||||
|
||||
try {
|
||||
VascController vc = VascTechDemoStartup.getInstance().getVascControllerService().getVascController();
|
||||
File tmpFile = new File("conf/vasc.d/"+model.filename);// File.createTempFile("vasc","xml");
|
||||
System.out.println("write to : "+tmpFile);
|
||||
Writer out = new OutputStreamWriter(new FileOutputStream(tmpFile));
|
||||
XMLWriter outXml = new XMLWriter(out);
|
||||
LoadVascXmlWriter writer = new LoadVascXmlWriter(outXml,vc);
|
||||
writer.writeXml(model);
|
||||
|
||||
|
||||
File writeFile = new File("conf/vasc.d/"+model.filename);
|
||||
System.out.println("write to : "+writeFile);
|
||||
Writer out = new OutputStreamWriter(new FileOutputStream(writeFile));
|
||||
out.append(text.getText());
|
||||
out.flush();
|
||||
out.close();
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
JOptionPane.showMessageDialog(null, "Fatal error:\n"+e.getMessage(), "Write file error", JOptionPane.ERROR_MESSAGE);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ CREATE TABLE vasc_page (
|
|||
id IDENTITY not null primary key,
|
||||
slug varchar not null,
|
||||
title varchar not null,
|
||||
i18n_key boolean not null,
|
||||
active boolean not null,
|
||||
sitemap boolean not null,
|
||||
roles varchar not null
|
||||
|
|
@ -52,7 +51,6 @@ CREATE TABLE vasc_page_part (
|
|||
page_id integer not null,
|
||||
title varchar not null,
|
||||
text varchar not null,
|
||||
i18n_key boolean not null,
|
||||
active boolean not null,
|
||||
sitemap boolean not null,
|
||||
part_order integer not null,
|
||||
|
|
@ -92,45 +90,51 @@ INSERT INTO vasc_user_change_field VALUES(2,'Password', 'password', TRUE);
|
|||
INSERT INTO vasc_user_change_field VALUES(3,'Description', 'description', TRUE);
|
||||
INSERT INTO vasc_user_change_field VALUES(4,'Birthdate', 'date_age', TRUE);
|
||||
|
||||
-- ID SLUG TITLE I18N ACTIVE SITEMAP
|
||||
INSERT INTO vasc_page VALUES(4, 'debug', 'Debug', FALSE, TRUE, FALSE, '');
|
||||
INSERT INTO vasc_page VALUES(5, 'contact', '', TRUE, TRUE, TRUE, '');
|
||||
INSERT INTO vasc_page VALUES(6, 'help', '', TRUE, TRUE, TRUE, '');
|
||||
-- ID SLUG TITLE ATIVE SITEMAP
|
||||
INSERT INTO vasc_page VALUES(1, 'contact', 'Contact', TRUE, TRUE, '');
|
||||
INSERT INTO vasc_page VALUES(2, 'techno', 'Techno', TRUE, TRUE, '');
|
||||
INSERT INTO vasc_page VALUES(3, 'help', 'Help', TRUE, TRUE, '');
|
||||
INSERT INTO vasc_page VALUES(4, 'config', 'Config', TRUE, FALSE, '');
|
||||
|
||||
INSERT INTO vasc_page_part VALUES(1, 4, 'vasc', '', TRUE,TRUE,TRUE,1,'HTML', '');
|
||||
INSERT INTO vasc_page_part VALUES(2, 4, 'jdbc', '', TRUE,TRUE,TRUE,2,'HTML', '');
|
||||
INSERT INTO vasc_page_part VALUES(3, 4, 'jndi', '', TRUE,TRUE,TRUE,3,'HTML', '');
|
||||
INSERT INTO vasc_page_part VALUES(4, 4, 'logback', '', TRUE,TRUE,TRUE,3,'HTML', '');
|
||||
INSERT INTO vasc_page_part VALUES(1, 1, 'Project', 'The vasc project is build for amazing ease of editing data.', TRUE,TRUE,1,'HTML', '');
|
||||
INSERT INTO vasc_page_part VALUES(2, 1, 'Website', 'VASC: <a href="http://vasc.forwardfire.net">Website</a>', TRUE,TRUE,2,'HTML', '');
|
||||
|
||||
INSERT INTO vasc_page_part VALUES(5, 5, 'project', '', TRUE,TRUE,TRUE,1,'WIKI', '');
|
||||
INSERT INTO vasc_page_part VALUES(6, 5, 'support', '', TRUE,TRUE,TRUE,2,'WIKI', '');
|
||||
INSERT INTO vasc_page_part VALUES(7, 5, 'location', '', TRUE,TRUE,TRUE,3,'HTML', '');
|
||||
INSERT INTO vasc_page_part VALUES(3, 2, 'Used technologies.', 'Example: XML,JSF,JDBC,etc', TRUE,TRUE,1,'HTML', '');
|
||||
INSERT INTO vasc_page_part VALUES(4, 2, 'Used liberies', 'Todo make long list ?', TRUE,TRUE,2,'HTML', '');
|
||||
|
||||
INSERT INTO vasc_page_part VALUES(8, 6, 'server', '', TRUE,TRUE,TRUE,1,'WIKI', '');
|
||||
INSERT INTO vasc_page_part VALUES(9, 6, 'vasc', '', TRUE,TRUE,TRUE,2,'WIKI', '');
|
||||
INSERT INTO vasc_page_part VALUES(10,6, 'metamodel','', TRUE,TRUE,TRUE,3,'WIKI', '');
|
||||
INSERT INTO vasc_page_part VALUES(5, 3, 'Documenation.', 'See docs directory.', TRUE,TRUE,1,'HTML', '');
|
||||
INSERT INTO vasc_page_part VALUES(6, 3, 'Mailing list.', 'Goto some page to see.', TRUE,TRUE,2,'HTML', '');
|
||||
|
||||
INSERT INTO vasc_page_part VALUES(10, 4, 'Vasc', 'Config entries in conf/vasc.d directory.', TRUE,TRUE,1,'HTML', '');
|
||||
INSERT INTO vasc_page_part VALUES(11, 4, 'Jdbc', 'Config in vasc xml or context.xml', TRUE,TRUE,2,'HTML', '');
|
||||
INSERT INTO vasc_page_part VALUES(12, 4, 'Jndi', 'Example of data source.', TRUE,TRUE,3,'HTML', '');
|
||||
INSERT INTO vasc_page_part VALUES(13, 4, 'Logback', 'Change logging options.', TRUE,TRUE,3,'HTML', '');
|
||||
|
||||
|
||||
|
||||
-- INSERT INTO vasc_page VALUES(1, 'home','home','Welcome to the vasc demo, please login as admin to view all stuff.');
|
||||
|
||||
INSERT INTO vasc_menu_web VALUES(1, '/html/index.jsf','Home', '',true,'',1,'BAR_RIGHT');
|
||||
INSERT INTO vasc_menu_web VALUES(2, '/html/admin/debug.jsf','Debug','',true,'admin',2,'BAR_RIGHT');
|
||||
INSERT INTO vasc_menu_web VALUES(3, '/html/admin/index.jsf','Admin','',true,'admin',3,'BAR_RIGHT');
|
||||
INSERT INTO vasc_menu_web VALUES(1, '/html/index.jsf','Home', '',true,'' ,1,'BAR_LEFT');
|
||||
INSERT INTO vasc_menu_web VALUES(2, '/html/admin/debug.jsf','Debug','',true,'admin' ,2,'BAR_LEFT');
|
||||
INSERT INTO vasc_menu_web VALUES(3, '/html/admin/index.jsf','Admin','',true,'admin' ,3,'BAR_LEFT');
|
||||
|
||||
INSERT INTO vasc_menu_web VALUES(4, '/html/index.jsf','Home', '',true,'',1,'BAR_BOTTOM');
|
||||
INSERT INTO vasc_menu_web VALUES(5, '/html/index.jsf','Contact', '',true,'',2,'BAR_BOTTOM');
|
||||
INSERT INTO vasc_menu_web VALUES(6, '/html/index.jsf','Help', '',true,'',3,'BAR_BOTTOM');
|
||||
INSERT INTO vasc_menu_web VALUES(7, '/html/index.jsf','Techno', '',true,'',3,'BAR_BOTTOM');
|
||||
INSERT INTO vasc_menu_web VALUES(8, '/html/index.jsf','Licences', '',true,'',3,'BAR_BOTTOM');
|
||||
INSERT INTO vasc_menu_web VALUES(4, '/html/index.jsf', 'Home', '',true,'' ,1,'BAR_BOTTOM');
|
||||
INSERT INTO vasc_menu_web VALUES(5, '/page/contact', 'Contact', '',true,'' ,2,'BAR_BOTTOM');
|
||||
INSERT INTO vasc_menu_web VALUES(6, '/page/help', 'Help', '',true,'' ,3,'BAR_BOTTOM');
|
||||
INSERT INTO vasc_menu_web VALUES(7, '/page/techno', 'Techno', '',true,'' ,4,'BAR_BOTTOM');
|
||||
|
||||
INSERT INTO vasc_menu_web VALUES(10, '/vasc/AdminVascUser/list.jsf', 'Users', '',true,'admin',4,'PAGE_ADMIN');
|
||||
INSERT INTO vasc_menu_web VALUES(11, '/vasc/AdminVascUserRole/list.jsf', 'UserRoles', '',true,'admin',5,'PAGE_ADMIN');
|
||||
INSERT INTO vasc_menu_web VALUES(12, '/vasc/AdminVascUserChangeField/list.jsf', 'ChangeField', '',true,'admin',5,'PAGE_ADMIN');
|
||||
INSERT INTO vasc_menu_web VALUES(13, '/vasc/AdminVascUserChangeLog/list.jsf', 'ChangeFieldLog', '',true,'admin',5,'PAGE_ADMIN');
|
||||
INSERT INTO vasc_menu_web VALUES(8, '/page/contact', 'Contact', '',true,'' ,1,'BAR_RIGHT');
|
||||
INSERT INTO vasc_menu_web VALUES(9, '/page/help', 'Help', '',true,'' ,2,'BAR_RIGHT');
|
||||
|
||||
INSERT INTO vasc_menu_web VALUES(14, '/vasc/AdminVascPage/list.jsf', 'Pages', '',true,'admin',5,'PAGE_ADMIN');
|
||||
INSERT INTO vasc_menu_web VALUES(15, '/vasc/AdminVascPagePart/list.jsf', 'PageParts', '',true,'admin',5,'PAGE_ADMIN');
|
||||
INSERT INTO vasc_menu_web VALUES(16, '/vasc/AdminVascMenu/list.jsf', 'Menu', '',true,'admin',4,'PAGE_ADMIN');
|
||||
INSERT INTO vasc_menu_web VALUES(10, '/html/user/profile.jsf', 'Profile', '',true,'login',4,'MAIN_MENU_0');
|
||||
INSERT INTO vasc_menu_web VALUES(11, '/vasc/VascEntry/list.jsf', 'VascEntries', '',true,'admin',5,'MAIN_MENU_0');
|
||||
|
||||
INSERT INTO vasc_menu_web VALUES(20, '/vasc/AdminVascUser/list.jsf', 'Users', '',true,'admin',4,'PAGE_ADMIN');
|
||||
INSERT INTO vasc_menu_web VALUES(21, '/vasc/AdminVascUserRole/list.jsf', 'UserRoles', '',true,'admin',5,'PAGE_ADMIN');
|
||||
INSERT INTO vasc_menu_web VALUES(22, '/vasc/AdminVascUserChangeField/list.jsf', 'ChangeField', '',true,'admin',5,'PAGE_ADMIN');
|
||||
INSERT INTO vasc_menu_web VALUES(23, '/vasc/AdminVascUserChangeLog/list.jsf', 'ChangeFieldLog', '',true,'admin',5,'PAGE_ADMIN');
|
||||
INSERT INTO vasc_menu_web VALUES(24, '/vasc/AdminVascPage/list.jsf', 'Pages', '',true,'admin',5,'PAGE_ADMIN');
|
||||
INSERT INTO vasc_menu_web VALUES(25, '/vasc/AdminVascPagePart/list.jsf', 'PageParts', '',true,'admin',5,'PAGE_ADMIN');
|
||||
INSERT INTO vasc_menu_web VALUES(26, '/vasc/AdminVascMenu/list.jsf', 'Menu', '',true,'admin',4,'PAGE_ADMIN');
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ Application.web.footer.center = Vasc Tech Demo Web Based on JSF and Faclets and
|
|||
Application.web.footer.left = Copyright © 2012
|
||||
Application.web.footer.right = Version 0.4.x<i>(beta)</i>
|
||||
|
||||
generic.all = All
|
||||
generic.active.labelText = active
|
||||
generic.active.toolTipText = active
|
||||
generic.createdDate.labelText = createdDate
|
||||
|
|
@ -58,6 +59,10 @@ generic.name.toolTipText = name
|
|||
generic.orderNumber.labelText = orderNumber
|
||||
generic.orderNumber.toolTipText = orderNumber
|
||||
|
||||
menu.mainMenu0.title = Menu
|
||||
menu.mainMenu1.title = Menu
|
||||
menu.mainMenu2.title = Menu
|
||||
|
||||
# hibernate validators
|
||||
validator.assertFalse=assertion failed
|
||||
validator.assertTrue=assertion failed
|
||||
|
|
@ -112,7 +117,8 @@ vasc.action.jrXmlExportAction.description = JR-XML
|
|||
vasc.action.jrXmlExportAction.name = JR-XML
|
||||
vasc.action.jrCsvExportAction.description = JR-CSV
|
||||
vasc.action.jrCsvExportAction.name = JR-CSV
|
||||
|
||||
vasc.action.jsonExportAction.description = JSON
|
||||
vasc.action.jsonExportAction.name = JSON
|
||||
|
||||
# Temp jsf
|
||||
generic.vasc.jsf.listOption.header = Searchoptions
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue