From c259e28e443a6873ff4bf35d1f32239b6e85f159 Mon Sep 17 00:00:00 2001 From: Willem Cazander Date: Thu, 29 Nov 2012 20:39:24 +0100 Subject: [PATCH] made server gui work and auto generate xml imports --- pom.xml | 4 + .../metamodel/MetaModelSchemaAutoEntry.java | 34 ++ vasc-core/pom.xml | 45 +-- .../vasc/core/VascEntryConfigController.java | 4 +- .../core/VascEntryConfigControllerLocal.java | 6 +- .../entry/VascEntryExport.java} | 42 +-- ...porter.java => VascEntryExportWriter.java} | 10 +- .../vasc/frontend/VascFrontend.java | 4 +- .../DefaultVascEntryConfigController.java | 16 +- .../vasc/impl/DefaultVascFactory.java | 8 - .../impl/actions/ExportDataGlobalAction.java | 4 +- .../entry/BeanVascEntryRecordCreator.java | 3 +- .../impl/entry/DefaultVascEntryExport.java | 118 +++++++ .../entry/export/VascEntryExporterXml.java | 117 ------ .../frontend/DefaultVascFrontendActions.java | 4 +- .../main/directory/conf/vasc.d/demo-csv.xml | 5 +- .../main/directory/conf/vasc.d/tech-admin.xml | 6 +- .../directory/conf/vasc.d/tech-server.xml | 2 +- .../vasc-demo-server-core/pom.xml | 10 + .../core/VascTechDemoControllerConfig.java | 85 ++++- .../demo/server/core/VascTechDemoStartup.java | 2 +- .../demo/server/tomcat/TomcatService.java | 213 +---------- .../demo/server/ui/ServerGuiApplication.java | 41 ++- .../server/ui/load/JLoadStepWriteFile.java | 21 +- .../server/core/service/resources/init-db.sql | 66 ++-- .../resources/ServerGuiApplication.properties | 8 +- .../ejb3/menu/VascMenuControllerImpl.java | 32 -- .../tech/ejb3/menu/model/VascMenuWebType.java | 4 + .../demo/tech/web/beans/MenuController.java | 22 +- .../tech/web/pages/VascPageController.java | 203 ++++++++--- .../demo/tech/web/pages/VascPageFilter.java | 160 +++++++++ .../demo/tech/web/pages/model/VascPage.java | 37 +- .../tech/web/pages/model/VascPagePart.java | 33 +- .../src/main/webapp/WEB-INF/faces-config.xml | 11 + .../webapp/WEB-INF/template/page-wiki.xhtml | 8 +- .../template/structure/main-body-footer.xhtml | 34 +- .../template/structure/main-body-header.xhtml | 16 - .../template/structure/main-body-login.xhtml | 21 ++ .../template/structure/main-body-menu.xhtml | 42 ++- .../template/structure/main-body.xhtml | 9 +- .../src/main/webapp/WEB-INF/web.xml | 55 ++- .../src/main/webapp/css/site.css | 334 ------------------ .../main/webapp/css/skins/default/layout.css | 44 +-- .../main/webapp/css/skins/default/theme.css | 90 +++-- .../src/main/webapp/css/skins/green/theme.css | 8 +- .../src/main/webapp/html/admin/index.xhtml | 3 +- .../src/main/webapp/html/index.xhtml | 22 +- .../src/main/webapp/html/user/profile.xhtml | 11 +- .../src/main/webapp/img/logo.png | Bin 16157 -> 12691 bytes vasc-export/.project | 17 + vasc-export/pom.xml | 18 + vasc-export/vasc-export-generic/.project | 23 ++ vasc-export/vasc-export-generic/pom.xml | 18 + .../AbstractVascEntryExportWriter.java | 99 +++--- .../generic/VascEntryExportWriterCsv.java | 157 ++++++++ .../generic/VascEntryExportWriterXml.java | 102 ++++++ vasc-export/vasc-export-jr4o/.project | 23 ++ vasc-export/vasc-export-jr4o/pom.xml | 23 ++ .../jr4o}/JRDynamicDataSourceVascEntry.java | 2 +- .../jr4o/VascEntryExportWriterJR4O.java | 69 ++-- vasc-export/vasc-export-json/.project | 23 ++ vasc-export/vasc-export-json/pom.xml | 23 ++ .../json/VascEntryExportWriterJson.java | 115 ++++++ .../vasc/export/json/package-info.java | 6 + .../frontend/swing/SwingVascFrontend.java | 55 +-- .../vasc/frontend/swt/SwtVascFrontend.java | 11 +- .../web/export/VascExportServlet.java | 13 +- .../web/jsf/JSFVascEntrySupportBean.java | 19 +- .../web/jsf/JSFVascFrontendRenderer.java | 6 +- 69 files changed, 1669 insertions(+), 1230 deletions(-) rename vasc-core/src/main/java/net/forwardfire/vasc/{impl/entry/export/VascEntryExporterXmlTree.java => core/entry/VascEntryExport.java} (69%) rename vasc-core/src/main/java/net/forwardfire/vasc/core/entry/{VascEntryExporter.java => VascEntryExportWriter.java} (84%) create mode 100644 vasc-core/src/main/java/net/forwardfire/vasc/impl/entry/DefaultVascEntryExport.java delete mode 100644 vasc-core/src/main/java/net/forwardfire/vasc/impl/entry/export/VascEntryExporterXml.java create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/java/net/forwardfire/vasc/demo/tech/web/pages/VascPageFilter.java create mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/WEB-INF/template/structure/main-body-login.xhtml delete mode 100644 vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/css/site.css create mode 100644 vasc-export/.project create mode 100644 vasc-export/pom.xml create mode 100644 vasc-export/vasc-export-generic/.project create mode 100644 vasc-export/vasc-export-generic/pom.xml rename vasc-core/src/main/java/net/forwardfire/vasc/impl/entry/export/VascEntryExporterCsv.java => vasc-export/vasc-export-generic/src/main/java/net/forwardfire/vasc/export/generic/AbstractVascEntryExportWriter.java (50%) create mode 100644 vasc-export/vasc-export-generic/src/main/java/net/forwardfire/vasc/export/generic/VascEntryExportWriterCsv.java create mode 100644 vasc-export/vasc-export-generic/src/main/java/net/forwardfire/vasc/export/generic/VascEntryExportWriterXml.java create mode 100644 vasc-export/vasc-export-jr4o/.project create mode 100644 vasc-export/vasc-export-jr4o/pom.xml rename {vasc-core/src/main/java/net/forwardfire/vasc/impl/entry/export => vasc-export/vasc-export-jr4o/src/main/java/net/forwardfire/vasc/export/jr4o}/JRDynamicDataSourceVascEntry.java (99%) rename vasc-core/src/main/java/net/forwardfire/vasc/impl/entry/export/VascEntryExporterJR4O.java => vasc-export/vasc-export-jr4o/src/main/java/net/forwardfire/vasc/export/jr4o/VascEntryExportWriterJR4O.java (68%) create mode 100644 vasc-export/vasc-export-json/.project create mode 100644 vasc-export/vasc-export-json/pom.xml create mode 100644 vasc-export/vasc-export-json/src/main/java/net/forwardfire/vasc/export/json/VascEntryExportWriterJson.java create mode 100644 vasc-export/vasc-export-json/src/main/java/net/forwardfire/vasc/export/json/package-info.java diff --git a/pom.xml b/pom.xml index 6c19ec8..d0182b3 100644 --- a/pom.xml +++ b/pom.xml @@ -36,6 +36,7 @@ vasc-lib vasc-core-ejb3-client vasc-core-ejb3-server + vasc-export UTF-8 @@ -90,6 +91,9 @@ 2.7.3 + + 1.1 + 2.6.0 diff --git a/vasc-backend/vasc-backend-metamodel/src/main/java/net/forwardfire/vasc/backend/metamodel/MetaModelSchemaAutoEntry.java b/vasc-backend/vasc-backend-metamodel/src/main/java/net/forwardfire/vasc/backend/metamodel/MetaModelSchemaAutoEntry.java index cf91db6..aaed3cc 100644 --- a/vasc-backend/vasc-backend-metamodel/src/main/java/net/forwardfire/vasc/backend/metamodel/MetaModelSchemaAutoEntry.java +++ b/vasc-backend/vasc-backend-metamodel/src/main/java/net/forwardfire/vasc/backend/metamodel/MetaModelSchemaAutoEntry.java @@ -40,6 +40,7 @@ import net.forwardfire.vasc.core.VascController; import net.forwardfire.vasc.core.VascEntry; import net.forwardfire.vasc.core.VascEntryAccessType; import net.forwardfire.vasc.core.VascEntryControllerLocal; +import net.forwardfire.vasc.core.VascEntryField; import net.forwardfire.vasc.core.VascEntryFieldLocal; import net.forwardfire.vasc.core.VascEntryGroupLocal; import net.forwardfire.vasc.core.VascEntryLinkType; @@ -297,6 +298,39 @@ public class MetaModelSchemaAutoEntry { ve.setDisplayNameFieldId(c.getName()); } } + + // Some auto detection on fields so default imported list view looks oke on 8++ columns. + if (ve.getVascEntryFields().size()>8) { + List vefListIds = new ArrayList(20); + for (VascEntryField vef:ve.getVascEntryFields()) { + String id = vef.getId().toLowerCase(); + if ( id.contains("create") | + id.contains("update") | + id.contains("delete") | + id.contains("classname") | + id.contains("description") + ) { + vef.setList(false); + } + if (ve.getDisplayNameFieldId()!=null && ve.getDisplayNameFieldId().equals(vef.getId())) { + continue; + } + if (ve.getPrimaryKeyFieldId()!=null && ve.getPrimaryKeyFieldId().equals(vef.getId())) { + continue; + } + if (vef.getList()!=null && vef.getList()==false) { + continue; + } + vefListIds.add(vef.getId()); + } + if (vefListIds.size()<8) { + List vefListFalseIds = vefListIds.subList(8-1, vefListIds.size()); + for (String key:vefListFalseIds) { + VascEntryField vef = ve.getVascEntryFieldById(key); + vef.setList(false); + } + } + } } /** diff --git a/vasc-core/pom.xml b/vasc-core/pom.xml index ddd2e17..07eed1f 100644 --- a/vasc-core/pom.xml +++ b/vasc-core/pom.xml @@ -5,32 +5,25 @@ net.forwardfire.vasc 0.4.1-SNAPSHOT - net.forwardfire.vasc vasc-core - 0.4.1-SNAPSHOT vasc-core vasc-core - - org.x4o - x4o-core - ${x4o.version} - - - org.x4o - x4o-meta - ${x4o.version} - + + org.x4o + x4o-core + ${x4o.version} + + + org.x4o + x4o-meta + ${x4o.version} + net.forwardfire.vasc vasc-xpql ${project.version} - - net.forwardfire.vasc.lib - vasc-lib-jr4o - ${project.version} - javax.persistence persistence-api @@ -38,16 +31,16 @@ provided - org.hibernate - hibernate-validator - ${hibernate-validator.version} - provided + org.hibernate + hibernate-validator + ${hibernate-validator.version} + provided - de.odysseus.juel - juel - 2.1.0 - test + de.odysseus.juel + juel + 2.1.0 + test - \ No newline at end of file + diff --git a/vasc-core/src/main/java/net/forwardfire/vasc/core/VascEntryConfigController.java b/vasc-core/src/main/java/net/forwardfire/vasc/core/VascEntryConfigController.java index 1b0f7ff..ca5cbb0 100644 --- a/vasc-core/src/main/java/net/forwardfire/vasc/core/VascEntryConfigController.java +++ b/vasc-core/src/main/java/net/forwardfire/vasc/core/VascEntryConfigController.java @@ -25,7 +25,7 @@ package net.forwardfire.vasc.core; import java.util.List; import net.forwardfire.vasc.backend.VascBackend; -import net.forwardfire.vasc.core.entry.VascEntryExporter; +import net.forwardfire.vasc.core.entry.VascEntryExport; import net.forwardfire.vasc.core.VascException; /** @@ -51,7 +51,7 @@ public interface VascEntryConfigController { public List getVascEntryExporterIds(); - public VascEntryExporter getVascEntryExporterById(String exporterId); + public VascEntryExport getVascEntryExporterById(String exporterId); public void configVascFrontendController(VascController vascController,VascEntryLocal entry) throws VascException; diff --git a/vasc-core/src/main/java/net/forwardfire/vasc/core/VascEntryConfigControllerLocal.java b/vasc-core/src/main/java/net/forwardfire/vasc/core/VascEntryConfigControllerLocal.java index ed3ae40..c77a4e9 100644 --- a/vasc-core/src/main/java/net/forwardfire/vasc/core/VascEntryConfigControllerLocal.java +++ b/vasc-core/src/main/java/net/forwardfire/vasc/core/VascEntryConfigControllerLocal.java @@ -26,7 +26,7 @@ import java.util.List; import net.forwardfire.vasc.backend.VascBackendState; import net.forwardfire.vasc.backend.proxy.VascBackendProxy; -import net.forwardfire.vasc.core.entry.VascEntryExporter; +import net.forwardfire.vasc.core.entry.VascEntryExport; import net.forwardfire.vasc.core.entry.VascEntryFieldValidatorService; /** @@ -58,9 +58,9 @@ public interface VascEntryConfigControllerLocal extends VascEntryConfigControlle - public void addVascEntryExporter(VascEntryExporter exporter); + public void addVascEntryExporter(VascEntryExport exporter); - public void removeVascEntryExporter(VascEntryExporter exporter); + public void removeVascEntryExporter(VascEntryExport exporter); public VascBackendState getMasterVascBackendState(); diff --git a/vasc-core/src/main/java/net/forwardfire/vasc/impl/entry/export/VascEntryExporterXmlTree.java b/vasc-core/src/main/java/net/forwardfire/vasc/core/entry/VascEntryExport.java similarity index 69% rename from vasc-core/src/main/java/net/forwardfire/vasc/impl/entry/export/VascEntryExporterXmlTree.java rename to vasc-core/src/main/java/net/forwardfire/vasc/core/entry/VascEntryExport.java index 8a2cb95..7eccc7c 100644 --- a/vasc-core/src/main/java/net/forwardfire/vasc/impl/entry/export/VascEntryExporterXmlTree.java +++ b/vasc-core/src/main/java/net/forwardfire/vasc/core/entry/VascEntryExport.java @@ -20,31 +20,31 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.forwardfire.vasc.impl.entry.export; +package net.forwardfire.vasc.core.entry; + +import java.io.Serializable; +import java.util.Set; + +import net.forwardfire.vasc.core.VascException; /** - * VascEntryExporterXmlTree exports the data as xml tree. + * VascEntryExporter handles the export of data to an stream. * * @author Willem Cazander - * @version 1.0 May 9, 2012 + * @version 1.0 May 19, 2007 */ -public class VascEntryExporterXmlTree extends VascEntryExporterXml { - - private static final long serialVersionUID = 179434457857022828L; - static public final String EXPORT_TYPE = "xmltree"; - - /** - * Creates an VascEntryExporterXmlTree - */ - public VascEntryExporterXmlTree() { - setXmlTree(true); - } +public interface VascEntryExport extends Serializable { - /** - * @see net.forwardfire.vasc.impl.entry.export.VascEntryExporterXml#getId() - */ - @Override - public String getId() { - return EXPORT_TYPE; - } + // move ? + public VascEntryExportWriter createExportWriter() throws VascException; + + public String getId(); + + public String getRolesExport(); + + public String getExportWriterClass(); + + public void addWriterParameter(String key,String value); + public String getWriterParameter(String key); + public Set getWriterParameterKeys(); } \ No newline at end of file diff --git a/vasc-core/src/main/java/net/forwardfire/vasc/core/entry/VascEntryExporter.java b/vasc-core/src/main/java/net/forwardfire/vasc/core/entry/VascEntryExportWriter.java similarity index 84% rename from vasc-core/src/main/java/net/forwardfire/vasc/core/entry/VascEntryExporter.java rename to vasc-core/src/main/java/net/forwardfire/vasc/core/entry/VascEntryExportWriter.java index 53ff540..54d0268 100644 --- a/vasc-core/src/main/java/net/forwardfire/vasc/core/entry/VascEntryExporter.java +++ b/vasc-core/src/main/java/net/forwardfire/vasc/core/entry/VascEntryExportWriter.java @@ -22,24 +22,24 @@ package net.forwardfire.vasc.core.entry; +import java.io.IOException; import java.io.OutputStream; import java.io.Serializable; import net.forwardfire.vasc.core.VascEntry; import net.forwardfire.vasc.core.VascException; - - /** + * VascEntryExportWriter handles the export of data to an stream. * * @author Willem Cazander * @version 1.0 May 19, 2007 */ -public interface VascEntryExporter extends Serializable { +public interface VascEntryExportWriter extends Serializable { - public String getId(); + public void doInit(VascEntryExport export,VascEntry vascEntry) throws VascException; - public void doExport(OutputStream out,VascEntry vascEntry) throws VascException; + public void doExport(OutputStream out) throws IOException,VascException; public String getMineType(); diff --git a/vasc-core/src/main/java/net/forwardfire/vasc/frontend/VascFrontend.java b/vasc-core/src/main/java/net/forwardfire/vasc/frontend/VascFrontend.java index 52e735b..d167cec 100644 --- a/vasc-core/src/main/java/net/forwardfire/vasc/frontend/VascFrontend.java +++ b/vasc-core/src/main/java/net/forwardfire/vasc/frontend/VascFrontend.java @@ -23,7 +23,7 @@ package net.forwardfire.vasc.frontend; import net.forwardfire.vasc.core.VascEntry; -import net.forwardfire.vasc.core.entry.VascEntryExporter; +import net.forwardfire.vasc.core.entry.VascEntryExport; /** @@ -47,5 +47,5 @@ public interface VascFrontend { public void renderDelete() throws VascFrontendException; - public void renderExport(VascEntryExporter exporter) throws VascFrontendException; + public void renderExport(VascEntryExport exporter) throws VascFrontendException; } \ No newline at end of file diff --git a/vasc-core/src/main/java/net/forwardfire/vasc/impl/DefaultVascEntryConfigController.java b/vasc-core/src/main/java/net/forwardfire/vasc/impl/DefaultVascEntryConfigController.java index 3403d63..bfdbb3e 100644 --- a/vasc-core/src/main/java/net/forwardfire/vasc/impl/DefaultVascEntryConfigController.java +++ b/vasc-core/src/main/java/net/forwardfire/vasc/impl/DefaultVascEntryConfigController.java @@ -43,7 +43,7 @@ import net.forwardfire.vasc.core.VascEntryState; import net.forwardfire.vasc.core.VascInterfaceKey; import net.forwardfire.vasc.core.VascInterfaceKeyFrontend; import net.forwardfire.vasc.core.VascInterfaceLoader; -import net.forwardfire.vasc.core.entry.VascEntryExporter; +import net.forwardfire.vasc.core.entry.VascEntryExport; import net.forwardfire.vasc.core.entry.VascEntryFieldValidatorService; import net.forwardfire.vasc.core.entry.VascEntryFieldValue; import net.forwardfire.vasc.core.VascException; @@ -62,7 +62,7 @@ public class DefaultVascEntryConfigController implements VascEntryConfigControll private List configFinalizers = null; private List backendProxies = null; - private Map dataExporters = null; + private Map dataExporters = null; private List fieldValidators = null; private Map> vascInterfaceImpls = null; private Map> vascInterfaceImplFrontends = null; @@ -73,7 +73,7 @@ public class DefaultVascEntryConfigController implements VascEntryConfigControll public DefaultVascEntryConfigController() { configFinalizers = new ArrayList(10); backendProxies = new ArrayList(10); - dataExporters = new HashMap(10); + dataExporters = new HashMap(10); fieldValidators = new ArrayList(5); vascInterfaceImpls = new HashMap>(VascInterfaceKey.values().length); vascInterfaceImplFrontends = new HashMap>(VascInterfaceKeyFrontend.values().length); @@ -332,21 +332,21 @@ public class DefaultVascEntryConfigController implements VascEntryConfigControll /** * @see net.forwardfire.vasc.core.VascEntryConfigController#getVascEntryExporterById(java.lang.String) */ - public VascEntryExporter getVascEntryExporterById(String exporterId) { + public VascEntryExport getVascEntryExporterById(String exporterId) { return dataExporters.get(exporterId); } /** - * @see net.forwardfire.vasc.core.VascEntryConfigController#addVascEntryExporter(net.forwardfire.vasc.core.entry.VascEntryExporter) + * @see net.forwardfire.vasc.core.VascEntryConfigController#addVascEntryExporter(net.forwardfire.vasc.core.entry.VascEntryExport) */ - public void addVascEntryExporter(VascEntryExporter exporter) { + public void addVascEntryExporter(VascEntryExport exporter) { dataExporters.put(exporter.getId(),exporter); } /** - * @see net.forwardfire.vasc.core.VascEntryConfigController#removeVascEntryExporter(net.forwardfire.vasc.core.entry.VascEntryExporter) + * @see net.forwardfire.vasc.core.VascEntryConfigController#removeVascEntryExporter(net.forwardfire.vasc.core.entry.VascEntryExport) */ - public void removeVascEntryExporter(VascEntryExporter exporter) { + public void removeVascEntryExporter(VascEntryExport exporter) { dataExporters.remove(exporter.getId()); } diff --git a/vasc-core/src/main/java/net/forwardfire/vasc/impl/DefaultVascFactory.java b/vasc-core/src/main/java/net/forwardfire/vasc/impl/DefaultVascFactory.java index 01e6e7c..f941e08 100644 --- a/vasc-core/src/main/java/net/forwardfire/vasc/impl/DefaultVascFactory.java +++ b/vasc-core/src/main/java/net/forwardfire/vasc/impl/DefaultVascFactory.java @@ -42,9 +42,6 @@ import net.forwardfire.vasc.impl.entry.config.VascHelpIdFinalizer; import net.forwardfire.vasc.impl.entry.config.VascI18nFinalizer; import net.forwardfire.vasc.impl.entry.config.VascIdAutoFinalizer; import net.forwardfire.vasc.impl.entry.config.VascIdCheckFinalizer; -import net.forwardfire.vasc.impl.entry.export.VascEntryExporterCsv; -import net.forwardfire.vasc.impl.entry.export.VascEntryExporterXml; -import net.forwardfire.vasc.impl.entry.export.VascEntryExporterXmlTree; import net.forwardfire.vasc.impl.frontend.DefaultVascFrontendActions; import net.forwardfire.vasc.impl.frontend.DefaultVascFrontendController; import net.forwardfire.vasc.impl.frontend.DefaultVascFrontendDataSelector; @@ -101,11 +98,6 @@ public class DefaultVascFactory { vascConfig.addVascEntryConfigFinalizer(new VascHelpIdFinalizer()); vascConfig.addVascEntryConfigFinalizer(new VascDefaultsFinalizer()); - // Add all exporters in reverse ORDER - vascConfig.addVascEntryExporter(new VascEntryExporterXmlTree()); - vascConfig.addVascEntryExporter(new VascEntryExporterXml()); - vascConfig.addVascEntryExporter(new VascEntryExporterCsv()); - // Add only the default internal vasc validator. vascConfig.addVascEntryFieldValidatorService(new VascValidatorsValidatorService()); diff --git a/vasc-core/src/main/java/net/forwardfire/vasc/impl/actions/ExportDataGlobalAction.java b/vasc-core/src/main/java/net/forwardfire/vasc/impl/actions/ExportDataGlobalAction.java index 99030a6..23593ff 100644 --- a/vasc-core/src/main/java/net/forwardfire/vasc/impl/actions/ExportDataGlobalAction.java +++ b/vasc-core/src/main/java/net/forwardfire/vasc/impl/actions/ExportDataGlobalAction.java @@ -25,7 +25,7 @@ package net.forwardfire.vasc.impl.actions; import net.forwardfire.vasc.core.VascEntry; import net.forwardfire.vasc.core.VascException; import net.forwardfire.vasc.core.actions.AbstractVascGlobalActionLocal; -import net.forwardfire.vasc.core.entry.VascEntryExporter; +import net.forwardfire.vasc.core.entry.VascEntryExport; /** * ExportDataGlobalAction is action per exporter. @@ -53,7 +53,7 @@ public class ExportDataGlobalAction extends AbstractVascGlobalActionLocal { } public void doGlobalAction(VascEntry entry) throws VascException { - VascEntryExporter exporter = entry.getVascFrontendController().getVascController().getVascEntryConfigController().getVascEntryExporterById(exporterId); + VascEntryExport exporter = entry.getVascFrontendController().getVascController().getVascEntryConfigController().getVascEntryExporterById(exporterId); entry.getVascFrontendController().getVascFrontend().renderExport(exporter); } diff --git a/vasc-core/src/main/java/net/forwardfire/vasc/impl/entry/BeanVascEntryRecordCreator.java b/vasc-core/src/main/java/net/forwardfire/vasc/impl/entry/BeanVascEntryRecordCreator.java index 13ed242..e6c5a32 100644 --- a/vasc-core/src/main/java/net/forwardfire/vasc/impl/entry/BeanVascEntryRecordCreator.java +++ b/vasc-core/src/main/java/net/forwardfire/vasc/impl/entry/BeanVascEntryRecordCreator.java @@ -26,9 +26,8 @@ import net.forwardfire.vasc.core.VascEntry; import net.forwardfire.vasc.core.entry.VascEntryRecordCreator; import net.forwardfire.vasc.core.VascException; - - /** + * BeanVascEntryRecordCreator creates an new instance Object from a defined objectClass. * * @author Willem Cazander * @version 1.0 Mar 21, 2007 diff --git a/vasc-core/src/main/java/net/forwardfire/vasc/impl/entry/DefaultVascEntryExport.java b/vasc-core/src/main/java/net/forwardfire/vasc/impl/entry/DefaultVascEntryExport.java new file mode 100644 index 0000000..6fa0b94 --- /dev/null +++ b/vasc-core/src/main/java/net/forwardfire/vasc/impl/entry/DefaultVascEntryExport.java @@ -0,0 +1,118 @@ +/* + * Copyright 2007-2012 forwardfire.net All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted provided + * that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this list of conditions and the + * following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and + * the following disclaimer in the documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package net.forwardfire.vasc.impl.entry; + + +import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +import net.forwardfire.vasc.core.VascException; +import net.forwardfire.vasc.core.entry.VascEntryExport; +import net.forwardfire.vasc.core.entry.VascEntryExportWriter; + +/** + * DefaultVascEntryExport holds the id and roles for the export writer. + * + * @author Willem Cazander + * @version 1.0 Nov 23, 2012 + */ +public class DefaultVascEntryExport implements VascEntryExport { + + private static final long serialVersionUID = 4949926724589747264L; + private String id = null; + private String rolesExport = null; + private String exportWriterClass = null; + private Map writerParameters = null; + + public DefaultVascEntryExport() { + writerParameters = new HashMap(); + } + + public VascEntryExportWriter createExportWriter() throws VascException { + ClassLoader cl = Thread.currentThread().getContextClassLoader(); + if (cl == null) { + cl = DefaultVascEntryExport.class.getClassLoader(); + } + try { + Class clazz = cl.loadClass(getExportWriterClass()); + Object instance = clazz.newInstance(); + VascEntryExportWriter writer = (VascEntryExportWriter)instance; + return writer; + } catch (Exception e) { + throw new VascException(e); + } + } + + public void addWriterParameter(String key,String value) { + writerParameters.put(key,value); + } + public String getWriterParameter(String key) { + return writerParameters.get(key); + } + public Set getWriterParameterKeys() { + return writerParameters.keySet(); + } + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @param id the id to set + */ + public void setId(String id) { + this.id = id; + } + + /** + * @return the rolesExport + */ + public String getRolesExport() { + return rolesExport; + } + + /** + * @param rolesExport the rolesExport to set + */ + public void setRolesExport(String rolesExport) { + this.rolesExport = rolesExport; + } + + /** + * @return the exportWriterClass + */ + public String getExportWriterClass() { + return exportWriterClass; + } + + /** + * @param exportWriterClass the exportWriterClass to set + */ + public void setExportWriterClass(String exportWriterClass) { + this.exportWriterClass = exportWriterClass; + } +} diff --git a/vasc-core/src/main/java/net/forwardfire/vasc/impl/entry/export/VascEntryExporterXml.java b/vasc-core/src/main/java/net/forwardfire/vasc/impl/entry/export/VascEntryExporterXml.java deleted file mode 100644 index 95ac7b8..0000000 --- a/vasc-core/src/main/java/net/forwardfire/vasc/impl/entry/export/VascEntryExporterXml.java +++ /dev/null @@ -1,117 +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.impl.entry.export; - -import java.io.OutputStream; -import java.io.PrintWriter; - -import net.forwardfire.vasc.core.VascEntry; -import net.forwardfire.vasc.core.VascEntryField; -import net.forwardfire.vasc.core.entry.VascEntryExporter; -import net.forwardfire.vasc.core.VascException; - -/** - * VascEntryExporterXml writes entry data to xml format. - * - * @author Willem Cazander - * @version 1.0 Mar 30, 2007 - */ -public class VascEntryExporterXml implements VascEntryExporter { - - private static final long serialVersionUID = 3719424578585760828L; - static public final String EXPORT_TYPE = "xml"; - private boolean xmlTree = false; - - /** - * @see net.forwardfire.vasc.core.entry.VascEntryExporter#getId() - */ - public String getId() { - return EXPORT_TYPE; - } - - /** - * @see net.forwardfire.vasc.core.entry.VascEntryExporter#doExport(java.io.OutputStream, net.forwardfire.vasc.core.VascEntry) - */ - public void doExport(OutputStream out, VascEntry entry) throws VascException { - PrintWriter p = new PrintWriter(out); - p.write("\n"); - p.write("\n"); - - int oldIndex = entry.getVascFrontendController().getVascEntryState().getVascBackendState().getPageIndex(); - Long total = entry.getVascFrontendController().getVascEntryState().getTotalBackendRecords(); - int pages = total.intValue()/entry.getVascFrontendController().getVascEntryState().getVascBackendState().getPageSize(); - for (int page=0;page<=pages;page++) { - entry.getVascFrontendController().getVascEntryState().getVascBackendState().setPageIndex(page); - entry.getVascFrontendController().getVascFrontendActions().refreshData(); - for (Object o:entry.getVascFrontendController().getVascEntryState().getEntryDataList()) { - p.write("\t\n"); - for (VascEntryField c:entry.getVascEntryFields()) { - if (xmlTree) { - p.write("\t\t<"+c.getId()+">\n"); - } else { - p.write("\t\t\n"); - } - } - p.write("\t\n"); - p.flush(); - } - } - p.write("\n"); - p.flush(); - - // restore old page size - entry.getVascFrontendController().getVascEntryState().getVascBackendState().setPageIndex(oldIndex); - } - - /** - * @see net.forwardfire.vasc.core.entry.VascEntryExporter#getMineType() - */ - public String getMineType() { - return "text/xml"; - } - - /** - * @see net.forwardfire.vasc.core.entry.VascEntryExporter#getFileType() - */ - public String getFileType() { - return EXPORT_TYPE; - } - - /** - * @return the xmlTree - */ - public boolean isXmlTree() { - return xmlTree; - } - - /** - * @param xmlTree the xmlTree to set - */ - public void setXmlTree(boolean xmlTree) { - this.xmlTree = xmlTree; - } -} \ No newline at end of file diff --git a/vasc-core/src/main/java/net/forwardfire/vasc/impl/frontend/DefaultVascFrontendActions.java b/vasc-core/src/main/java/net/forwardfire/vasc/impl/frontend/DefaultVascFrontendActions.java index 9610031..f6308ad 100644 --- a/vasc-core/src/main/java/net/forwardfire/vasc/impl/frontend/DefaultVascFrontendActions.java +++ b/vasc-core/src/main/java/net/forwardfire/vasc/impl/frontend/DefaultVascFrontendActions.java @@ -208,7 +208,9 @@ public class DefaultVascFrontendActions implements VascFrontendActions { backendState.removeDataParameterAll(); for (String key:entry.getEntryParameterKeys()) { Object value = entry.getEntryParameter(key); - backendState.setDataParameter(key, value); + if (value!=null) { + backendState.setDataParameter(key, value); + } } // Update total every time first diff --git a/vasc-demo/vasc-demo-server/vasc-demo-server-build/src/main/directory/conf/vasc.d/demo-csv.xml b/vasc-demo/vasc-demo-server/vasc-demo-server-build/src/main/directory/conf/vasc.d/demo-csv.xml index 4152c2c..a59de0c 100644 --- a/vasc-demo/vasc-demo-server/vasc-demo-server-build/src/main/directory/conf/vasc.d/demo-csv.xml +++ b/vasc-demo/vasc-demo-server/vasc-demo-server-build/src/main/directory/conf/vasc.d/demo-csv.xml @@ -4,10 +4,7 @@ xmlns:mm="http://vasc.forwardfire.net/xml/ns/vasc-backend-metamodel" > - + - + @@ -84,9 +84,9 @@ - + - + diff --git a/vasc-demo/vasc-demo-server/vasc-demo-server-build/src/main/directory/conf/vasc.d/tech-server.xml b/vasc-demo/vasc-demo-server/vasc-demo-server-build/src/main/directory/conf/vasc.d/tech-server.xml index f83d620..9eac388 100644 --- a/vasc-demo/vasc-demo-server/vasc-demo-server-build/src/main/directory/conf/vasc.d/tech-server.xml +++ b/vasc-demo/vasc-demo-server/vasc-demo-server-build/src/main/directory/conf/vasc.d/tech-server.xml @@ -7,7 +7,7 @@ diff --git a/vasc-demo/vasc-demo-server/vasc-demo-server-core/pom.xml b/vasc-demo/vasc-demo-server/vasc-demo-server-core/pom.xml index 64c580f..b11c701 100644 --- a/vasc-demo/vasc-demo-server/vasc-demo-server-core/pom.xml +++ b/vasc-demo/vasc-demo-server/vasc-demo-server-core/pom.xml @@ -76,6 +76,16 @@ vasc-backend-jdbc ${project.version} + + net.forwardfire.vasc.export + vasc-export-jr4o + ${project.version} + + + net.forwardfire.vasc.export + vasc-export-json + ${project.version} + net.forwardfire.vasc.lib vasc-lib-i18n diff --git a/vasc-demo/vasc-demo-server/vasc-demo-server-core/src/main/java/net/forwardfire/vasc/demo/server/core/VascTechDemoControllerConfig.java b/vasc-demo/vasc-demo-server/vasc-demo-server-core/src/main/java/net/forwardfire/vasc/demo/server/core/VascTechDemoControllerConfig.java index 382814a..ade33a4 100644 --- a/vasc-demo/vasc-demo-server/vasc-demo-server-core/src/main/java/net/forwardfire/vasc/demo/server/core/VascTechDemoControllerConfig.java +++ b/vasc-demo/vasc-demo-server/vasc-demo-server-core/src/main/java/net/forwardfire/vasc/demo/server/core/VascTechDemoControllerConfig.java @@ -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"); diff --git a/vasc-demo/vasc-demo-server/vasc-demo-server-core/src/main/java/net/forwardfire/vasc/demo/server/core/VascTechDemoStartup.java b/vasc-demo/vasc-demo-server/vasc-demo-server-core/src/main/java/net/forwardfire/vasc/demo/server/core/VascTechDemoStartup.java index a29b542..dc5349a 100644 --- a/vasc-demo/vasc-demo-server/vasc-demo-server-core/src/main/java/net/forwardfire/vasc/demo/server/core/VascTechDemoStartup.java +++ b/vasc-demo/vasc-demo-server/vasc-demo-server-core/src/main/java/net/forwardfire/vasc/demo/server/core/VascTechDemoStartup.java @@ -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; diff --git a/vasc-demo/vasc-demo-server/vasc-demo-server-core/src/main/java/net/forwardfire/vasc/demo/server/tomcat/TomcatService.java b/vasc-demo/vasc-demo-server/vasc-demo-server-core/src/main/java/net/forwardfire/vasc/demo/server/tomcat/TomcatService.java index d83518a..fa10d06 100644 --- a/vasc-demo/vasc-demo-server/vasc-demo-server-core/src/main/java/net/forwardfire/vasc/demo/server/tomcat/TomcatService.java +++ b/vasc-demo/vasc-demo-server/vasc-demo-server-core/src/main/java/net/forwardfire/vasc/demo/server/tomcat/TomcatService.java @@ -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 getDeclaredApps() { - // make a copy of the list because we update it - final List deployments = new ArrayList(); - //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 declaredAppsUrls = new ArrayList(); - try { - for (final Deployments deployment : deployments) { - DeploymentsResolver.loadFrom(deployment, base, declaredAppsUrls); - } - } catch (SecurityException ignored) { - } - return toString(declaredAppsUrls); - } - - public ArrayList getModulesFromClassPath(List declaredApps, final ClassLoader classLoader) { - final FileUtils base = SystemInstance.get().getBase(); - if (declaredApps == null) { - declaredApps = getDeclaredApps(); - } - final List classpathAppsUrls = new ArrayList(); - DeploymentsResolver.loadFromClasspath(base, classpathAppsUrls, classLoader); - - final ArrayList jarFiles = new ArrayList(); - for (final URL path : classpathAppsUrls) { - if (declaredApps.contains(URLs.toFilePath(path))) continue; - - jarFiles.add(new File(URLs.toFilePath(path))); - } - return jarFiles; - } - - private List toString(final List urls) { - final List toReturn = new ArrayList(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 declaredApps = getDeclaredApps(); - final ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); - final ArrayList 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 { diff --git a/vasc-demo/vasc-demo-server/vasc-demo-server-core/src/main/java/net/forwardfire/vasc/demo/server/ui/ServerGuiApplication.java b/vasc-demo/vasc-demo-server/vasc-demo-server-core/src/main/java/net/forwardfire/vasc/demo/server/ui/ServerGuiApplication.java index 6fe1f6f..1b16850 100644 --- a/vasc-demo/vasc-demo-server/vasc-demo-server-core/src/main/java/net/forwardfire/vasc/demo/server/ui/ServerGuiApplication.java +++ b/vasc-demo/vasc-demo-server/vasc-demo-server-core/src/main/java/net/forwardfire/vasc/demo/server/ui/ServerGuiApplication.java @@ -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(); } }); diff --git a/vasc-demo/vasc-demo-server/vasc-demo-server-core/src/main/java/net/forwardfire/vasc/demo/server/ui/load/JLoadStepWriteFile.java b/vasc-demo/vasc-demo-server/vasc-demo-server-core/src/main/java/net/forwardfire/vasc/demo/server/ui/load/JLoadStepWriteFile.java index 9ab5736..93c54bb 100644 --- a/vasc-demo/vasc-demo-server/vasc-demo-server-core/src/main/java/net/forwardfire/vasc/demo/server/ui/load/JLoadStepWriteFile.java +++ b/vasc-demo/vasc-demo-server/vasc-demo-server-core/src/main/java/net/forwardfire/vasc/demo/server/ui/load/JLoadStepWriteFile.java @@ -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; } diff --git a/vasc-demo/vasc-demo-server/vasc-demo-server-core/src/main/resources/net/forwardfire/vasc/demo/server/core/service/resources/init-db.sql b/vasc-demo/vasc-demo-server/vasc-demo-server-core/src/main/resources/net/forwardfire/vasc/demo/server/core/service/resources/init-db.sql index 39c5c8f..589d53a 100644 --- a/vasc-demo/vasc-demo-server/vasc-demo-server-core/src/main/resources/net/forwardfire/vasc/demo/server/core/service/resources/init-db.sql +++ b/vasc-demo/vasc-demo-server/vasc-demo-server-core/src/main/resources/net/forwardfire/vasc/demo/server/core/service/resources/init-db.sql @@ -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: Website', 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'); diff --git a/vasc-demo/vasc-demo-server/vasc-demo-server-core/src/main/resources/net/forwardfire/vasc/demo/server/ui/resources/ServerGuiApplication.properties b/vasc-demo/vasc-demo-server/vasc-demo-server-core/src/main/resources/net/forwardfire/vasc/demo/server/ui/resources/ServerGuiApplication.properties index ff7165d..eafaf72 100644 --- a/vasc-demo/vasc-demo-server/vasc-demo-server-core/src/main/resources/net/forwardfire/vasc/demo/server/ui/resources/ServerGuiApplication.properties +++ b/vasc-demo/vasc-demo-server/vasc-demo-server-core/src/main/resources/net/forwardfire/vasc/demo/server/ui/resources/ServerGuiApplication.properties @@ -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(beta) +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 diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-ejb3/src/main/java/net/forwardfire/vasc/demo/tech/ejb3/menu/VascMenuControllerImpl.java b/vasc-demo/vasc-demo-tech/vasc-demo-tech-ejb3/src/main/java/net/forwardfire/vasc/demo/tech/ejb3/menu/VascMenuControllerImpl.java index 09af0cc..4405595 100644 --- a/vasc-demo/vasc-demo-tech/vasc-demo-tech-ejb3/src/main/java/net/forwardfire/vasc/demo/tech/ejb3/menu/VascMenuControllerImpl.java +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-ejb3/src/main/java/net/forwardfire/vasc/demo/tech/ejb3/menu/VascMenuControllerImpl.java @@ -208,36 +208,4 @@ public class VascMenuControllerImpl implements VascMenuControllerLocal,VascMenuC Collections.sort(result,vascMenuWebComparator); return result; } - - private List getMenuFiltered(VascMenuWebType type) { - return getFilteredMenuWeb(type); - } - - public List getMenuBarLeft() { - return getMenuFiltered(VascMenuWebType.BAR_LEFT); - } - - public List getMenuBarRight() { - return getMenuFiltered(VascMenuWebType.BAR_RIGHT); - } - - public List getMenuBarBottom() { - return getMenuFiltered(VascMenuWebType.BAR_BOTTOM); - } - - public List getMenuPageIndex() { - return getMenuFiltered(VascMenuWebType.PAGE_INDEX); - } - - public List getMenuPageUserLeft() { - return getMenuFiltered(VascMenuWebType.PAGE_USER_LEFT); - } - - public List getMenuPageUserRight() { - return getMenuFiltered(VascMenuWebType.PAGE_USER_RIGHT); - } - - public List getMenuPageAdmin() { - return getMenuFiltered(VascMenuWebType.PAGE_ADMIN); - } } \ No newline at end of file diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-ejb3/src/main/java/net/forwardfire/vasc/demo/tech/ejb3/menu/model/VascMenuWebType.java b/vasc-demo/vasc-demo-tech/vasc-demo-tech-ejb3/src/main/java/net/forwardfire/vasc/demo/tech/ejb3/menu/model/VascMenuWebType.java index 05c3190..31dd3a2 100644 --- a/vasc-demo/vasc-demo-tech/vasc-demo-tech-ejb3/src/main/java/net/forwardfire/vasc/demo/tech/ejb3/menu/model/VascMenuWebType.java +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-ejb3/src/main/java/net/forwardfire/vasc/demo/tech/ejb3/menu/model/VascMenuWebType.java @@ -34,6 +34,10 @@ public enum VascMenuWebType { BAR_RIGHT, BAR_BOTTOM, + MAIN_MENU_0, + MAIN_MENU_1, + MAIN_MENU_2, + PAGE_INDEX, PAGE_USER_LEFT, PAGE_USER_RIGHT, diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/java/net/forwardfire/vasc/demo/tech/web/beans/MenuController.java b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/java/net/forwardfire/vasc/demo/tech/web/beans/MenuController.java index 76f6464..c8afc0e 100644 --- a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/java/net/forwardfire/vasc/demo/tech/web/beans/MenuController.java +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/java/net/forwardfire/vasc/demo/tech/web/beans/MenuController.java @@ -23,23 +23,13 @@ package net.forwardfire.vasc.demo.tech.web.beans; import java.io.Serializable; -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.ArrayList; -import java.util.Collections; import java.util.List; -import javax.ejb.EJB; -import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; -import javax.sql.DataSource; import net.forwardfire.vasc.demo.tech.ejb3.menu.VascMenuController; import net.forwardfire.vasc.demo.tech.ejb3.menu.model.VascMenuGroup; -import net.forwardfire.vasc.demo.tech.ejb3.menu.model.VascMenuWebComparator; import net.forwardfire.vasc.demo.tech.ejb3.menu.model.VascMenuWeb; import net.forwardfire.vasc.demo.tech.ejb3.menu.model.VascMenuWebType; @@ -52,7 +42,6 @@ import net.forwardfire.vasc.demo.tech.ejb3.menu.model.VascMenuWebType; public class MenuController implements Serializable { private static final long serialVersionUID = -6820749860984575869L; - private List userVascMenu = null; private UserController userController = null; private VascMenuController vascMenuController = null; @@ -108,6 +97,17 @@ public class MenuController implements Serializable { return getMenuFiltered(VascMenuWebType.PAGE_ADMIN); } + public List getMainMenu0() { + return getMenuFiltered(VascMenuWebType.MAIN_MENU_0); + } + + public List getMainMenu1() { + return getMenuFiltered(VascMenuWebType.MAIN_MENU_1); + } + + public List getMainMenu2() { + return getMenuFiltered(VascMenuWebType.MAIN_MENU_2); + } /** * @return the userController diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/java/net/forwardfire/vasc/demo/tech/web/pages/VascPageController.java b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/java/net/forwardfire/vasc/demo/tech/web/pages/VascPageController.java index 0bd1d11..f2875f0 100644 --- a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/java/net/forwardfire/vasc/demo/tech/web/pages/VascPageController.java +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/java/net/forwardfire/vasc/demo/tech/web/pages/VascPageController.java @@ -23,24 +23,34 @@ package net.forwardfire.vasc.demo.tech.web.pages; import java.io.Serializable; +import java.lang.reflect.Method; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.ArrayList; -import java.util.Collections; import java.util.List; +import javax.faces.context.FacesContext; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; +import javax.servlet.ServletRequest; import javax.sql.DataSource; -import net.forwardfire.vasc.demo.tech.ejb3.menu.model.VascMenuWebComparator; +import de.tudarmstadt.ukp.wikipedia.parser.ParsedPage; +import de.tudarmstadt.ukp.wikipedia.parser.Section; +import de.tudarmstadt.ukp.wikipedia.parser.html.HtmlWriter; +import de.tudarmstadt.ukp.wikipedia.parser.mediawiki.MediaWikiParser; +import de.tudarmstadt.ukp.wikipedia.parser.mediawiki.MediaWikiParserFactory; + import net.forwardfire.vasc.demo.tech.web.beans.UserController; +import net.forwardfire.vasc.demo.tech.web.pages.model.VascPage; +import net.forwardfire.vasc.demo.tech.web.pages.model.VascPagePart; +import net.forwardfire.vasc.demo.tech.web.pages.model.VascPagePartType; /** - * MenuController Shows the menu for the user. + * VascPageController very hacky page context controller. * * @author Willem Cazander * @version 1.0 May 19, 2012 @@ -48,40 +58,32 @@ import net.forwardfire.vasc.demo.tech.web.beans.UserController; public class VascPageController implements Serializable { private static final long serialVersionUID = -6820749860984575869L; - //private List userVascMenu = null; - //private VascMenuComparator vascMenuComparator = null; private UserController userController = null; + private VascPage page = null; - /* - public List fetchVascPage() { - - vascMenuComparator = new VascMenuComparator(); - userVascMenu = new ArrayList(50); - - - + public VascPage fetchVascPage(String slug) { + VascPage result = null; Connection connection = null; try { DataSource ds = getDataSource("java:comp/env/jdbc/DemoManagerDataDS"); connection = ds.getConnection(); Statement s = connection.createStatement(); - s.execute("SELECT * FROM VASC_MENU"); + s.execute("SELECT * FROM VASC_PAGE WHERE SLUG='"+slug+"'"); // bad so redo .. ResultSet rs = s.getResultSet(); - //int cols = rs.getMetaData().getColumnCount(); - while (rs.next()) { - VascMenu menu = new VascMenu(); - menu.setId(rs.getInt(1)); - menu.setHref(rs.getString(2)); - menu.setTitle(rs.getString(3)); - menu.setTarget(rs.getString(4)); - menu.setActive(rs.getBoolean(5)); - menu.setRoles(rs.getString(6)); + if (rs.next()) { + result = new VascPage(); + result.setId(rs.getInt(1)); + result.setSlug(rs.getString(2)); + result.setTitle(rs.getString(3)); + result.setActive(rs.getBoolean(4)); + result.setSitemap(rs.getBoolean(5)); + result.setRoles(rs.getString(6)); + /* menu.setMenuOrder(rs.getInt(7)); menu.setMenuType(VascMenuType.valueOf(rs.getString(8))); if (filterVascMenuRoles(menu)==false) { continue; - } - userVascMenu.add(menu); + }*/ } } catch (Exception e) { e.printStackTrace(); @@ -93,8 +95,48 @@ public class VascPageController implements Serializable { } } } - - return userVascMenu; + return result; + } + + public List fetchVascPageParts(int pageId) { + List result = new ArrayList(50); + Connection connection = null; + try { + DataSource ds = getDataSource("java:comp/env/jdbc/DemoManagerDataDS"); + connection = ds.getConnection(); + Statement s = connection.createStatement(); + s.execute("SELECT * FROM VASC_PAGE_PART WHERE PAGE_ID="+pageId); // bad + ResultSet rs = s.getResultSet(); + while (rs.next()) { + VascPagePart menu = new VascPagePart(); + menu.setId(rs.getInt(1)); + menu.setPageId(rs.getInt(2)); + menu.setTitle(rs.getString(3)); + menu.setText(rs.getString(4)); + menu.setActive(rs.getBoolean(5)); + menu.setSitemap(rs.getBoolean(6)); + menu.setPartOrder(rs.getInt(7)); + menu.setPartType(VascPagePartType.valueOf(rs.getString(8))); + menu.setRoles(rs.getString(9)); + /* + menu.setMenuOrder(rs.getInt(7)); + menu.setMenuType(VascMenuType.valueOf(rs.getString(8))); + if (filterVascMenuRoles(menu)==false) { + continue; + }*/ + result.add(menu); + } + } catch (Exception e) { + e.printStackTrace(); + } finally { + if (connection!=null) { + try { + connection.close(); + } catch (Exception e) { + } + } + } + return result; } private DataSource getDataSource(String name) throws SQLException { @@ -110,6 +152,7 @@ public class VascPageController implements Serializable { } } + /* private boolean filterVascMenuRoles(VascMenu menu) { if (menu.getActive()!=null && menu.getActive()==false) { return false; @@ -127,30 +170,100 @@ public class VascPageController implements Serializable { } return true; } + */ - private List getMenuFiltered(VascMenuType type) { - if (type==null) { - throw new NullPointerException("Can't filter on null type."); + public VascPage getPage() { + + FacesContext context = FacesContext.getCurrentInstance(); + String pageId = (String)((ServletRequest)context.getExternalContext().getRequest()).getAttribute("pageId"); + + if (pageId==null) { + return null; // todo send somewhere } - List result = new ArrayList(15); - for (VascMenu menu:fetchVascMenu()) { - if (type.equals(menu.getMenuType())) { - result.add(menu); + if (page!=null && page.getSlug().equals(pageId)) { + return page; + } + + page = fetchVascPage(pageId); + page.getPageParts().addAll(fetchVascPageParts(page.getId())); + + return page; + } + + public String renderContent(VascPagePart part) { + if (part==null) { + return ""; + } + if (VascPagePartType.HTML.equals(part.getPartType())) { + return part.getText(); + } else if (VascPagePartType.PRE.equals(part.getPartType())) { + return "
"+part.getText()+"
\n"; + } else { + MediaWikiParserFactory pf = new MediaWikiParserFactory(); + MediaWikiParser parser = pf.createParser(); + ParsedPage page = parser.parse(part.getText()); + String result = FixedHtmlWriter.parsedPageToHtml(page); + return result; + } + } + + static class FixedHtmlWriter extends HtmlWriter { + public static String parsedPageToHtml( ParsedPage pp ){ + StringBuilder result = new StringBuilder(); + + if( pp != null ) { + //Title + result.append( + "\n"+ + "\n"); + + //Sections + result.append( + "\n"); + + //Categories + if( pp.getCategoryElement()!= null ){ + result.append("\n"); + } + + //Languages + if( pp.getLanguagesElement()!= null ){ + result.append("\n"); + } + + //Finalize + result.append("
ParsedPage: \n" + + pp.getName()+ + "
\n" ); + for( Section s: pp.getSections() ) { + result.append( invokePrivate("sectionToHtml",s)); + } + result.append( + "
\n"); + result.append("Categories:\n" + invokePrivate("contentElementToHtml",pp.getCategoryElement() )); + result.append("
\n"); + result.append("Languages:\n" + invokePrivate("contentElementToHtml",pp.getLanguagesElement() )); + result.append("
\n"); + } + + return result.toString(); + } + + static private String invokePrivate(String method,Object arg) { + for (Method m:FixedHtmlWriter.class.getDeclaredMethods()) { + if (m.getName().equals(method)) { + m.setAccessible(true); + try { + return (String)m.invoke(null, arg); + } catch (Exception e) { + e.printStackTrace(); + } + } } + return ""; } - Collections.sort(result,vascMenuComparator); - return result; } - public List getMenuBarLeft() { - return getMenuFiltered(VascMenuType.BAR_LEFT); - } - - public List getMenuBarRight() { - return getMenuFiltered(VascMenuType.BAR_RIGHT); - } -*/ - /** * @return the userController */ diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/java/net/forwardfire/vasc/demo/tech/web/pages/VascPageFilter.java b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/java/net/forwardfire/vasc/demo/tech/web/pages/VascPageFilter.java new file mode 100644 index 0000000..e277b8c --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/java/net/forwardfire/vasc/demo/tech/web/pages/VascPageFilter.java @@ -0,0 +1,160 @@ +/* + * 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.pages; + +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; + +import javax.faces.FactoryFinder; +import javax.faces.application.ViewExpiredException; +import javax.faces.component.UIViewRoot; +import javax.faces.context.FacesContext; +import javax.faces.context.FacesContextFactory; +import javax.faces.lifecycle.Lifecycle; +import javax.faces.lifecycle.LifecycleFactory; +import javax.servlet.Filter; +import javax.servlet.FilterChain; +import javax.servlet.FilterConfig; +import javax.servlet.ServletContext; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * VascPageServket + * + * @author Willem Cazander + * @version 1.0 Nov 29, 2012 + */ +public class VascPageFilter implements Filter { + + + private Logger logger = null; + private String templateFile = null; + private ServletContext servletContext = null; + + /** + * @see javax.servlet.Filter#destroy() + */ + public void destroy() { + servletContext = null; + templateFile = null; + logger = null; + } + + /** + * @see javax.servlet.Filter#init(javax.servlet.FilterConfig) + */ + public void init(FilterConfig config) throws ServletException { + logger = Logger.getLogger(VascPageFilter.class.getName()); + servletContext = config.getServletContext(); + templateFile = config.getInitParameter("templateFile"); + if (templateFile==null) { + throw new ServletException("No templateFile init-param found."); + } + } + + /** + * @see javax.servlet.Filter#doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain) + */ + public void doFilter(ServletRequest servletRequest,ServletResponse servletResponse,FilterChain chain) throws IOException, ServletException { + + HttpServletRequest request = (HttpServletRequest)servletRequest; + HttpServletResponse response = (HttpServletResponse)servletResponse; + + // request info + String path = request.getRequestURI(); + String v = "/page/"; + if (path.contains(v)) { + path = path.substring(path.indexOf(v)+v.length()); + } + + // stuff to fill + String pageId = null; + String actionName = null; + String actionRecordId = null; + + // parse request info + //path = path.substring(1); // rm / + int index = path.indexOf("/"); // check next / + String actionString = null; + if (index>0) { + actionString = path.substring(index+1); + pageId = path.substring(0,index); + } else { + pageId = path; + } + + if (actionString!=null) { + index = actionString.indexOf("/"); + String recordString = null; + if (index>0) { + recordString = actionString.substring(index+1); + actionName = actionString.substring(0,index); + } else { + actionName = actionString; + } + if (recordString!=null) { + actionRecordId = recordString; + } + } + + //log + if (logger.isLoggable(Level.FINE)) { + logger.log(Level.FINE,"pageId="+pageId+" actionName="+actionName+" actionRecordId="+actionRecordId); + } + + // Acquire the FacesContext instance for this request + FacesContext facesContext = FacesContext.getCurrentInstance(); + if (facesContext == null) { + FacesContextFactory facesContextFactory = (FacesContextFactory)FactoryFinder.getFactory(FactoryFinder.FACES_CONTEXT_FACTORY); + LifecycleFactory lifecycleFactory = (LifecycleFactory)FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY); + Lifecycle lifecycle = lifecycleFactory.getLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE); + + facesContext = facesContextFactory.getFacesContext(servletContext, request, response, lifecycle); + ProtectedFacesContext.setFacesContextAsCurrentInstance(facesContext); + + UIViewRoot viewRoot = facesContext.getApplication().getViewHandler().createView(facesContext,pageId+actionName); + facesContext.setViewRoot(viewRoot); + } + + // add to request attributes + request.setAttribute("pageId", pageId); + + // And dispatch to the vasc template file. + try { + request.getRequestDispatcher(templateFile).forward(request, response); + } catch (ViewExpiredException e) { + response.sendRedirect(request.getRequestURL().toString()); // lets try again + } + } + + private abstract static class ProtectedFacesContext extends FacesContext { + protected static void setFacesContextAsCurrentInstance(FacesContext facesContext) { + FacesContext.setCurrentInstance(facesContext); + } + } +} \ No newline at end of file diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/java/net/forwardfire/vasc/demo/tech/web/pages/model/VascPage.java b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/java/net/forwardfire/vasc/demo/tech/web/pages/model/VascPage.java index 8848299..dd7fd7d 100644 --- a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/java/net/forwardfire/vasc/demo/tech/web/pages/model/VascPage.java +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/java/net/forwardfire/vasc/demo/tech/web/pages/model/VascPage.java @@ -22,6 +22,9 @@ package net.forwardfire.vasc.demo.tech.web.pages.model; +import java.util.ArrayList; +import java.util.List; + /** @@ -35,10 +38,10 @@ public class VascPage { private Integer id = null; private String slug = null; private String title = null; - private Boolean i18nKey = null; private Boolean active = null; private Boolean sitemap = null; private String roles = null; + private List pageParts = new ArrayList(); /** * @return the id @@ -81,20 +84,6 @@ public class VascPage { this.title = title; } - /** - * @return the i18nKey - */ - public Boolean getI18nKey() { - return i18nKey; - } - - /** - * @param i18nKey the i18nKey to set - */ - public void setI18nKey(Boolean i18nKey) { - this.i18nKey = i18nKey; - } - /** * @return the active */ @@ -119,7 +108,7 @@ public class VascPage { /** * @param sitemap the sitemap to set */ - public void setSiteMap(Boolean sitemap) { + public void setSitemap(Boolean sitemap) { this.sitemap = sitemap; } @@ -135,5 +124,19 @@ public class VascPage { */ public void setRoles(String roles) { this.roles = roles; - } + } + + /** + * @return the pageParts + */ + public List getPageParts() { + return pageParts; + } + + /** + * @param pageParts the pageParts to set + */ + public void setPageParts(List pageParts) { + this.pageParts = pageParts; + } } diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/java/net/forwardfire/vasc/demo/tech/web/pages/model/VascPagePart.java b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/java/net/forwardfire/vasc/demo/tech/web/pages/model/VascPagePart.java index b72d7eb..b7d3ed9 100644 --- a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/java/net/forwardfire/vasc/demo/tech/web/pages/model/VascPagePart.java +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/java/net/forwardfire/vasc/demo/tech/web/pages/model/VascPagePart.java @@ -33,10 +33,9 @@ package net.forwardfire.vasc.demo.tech.web.pages.model; public class VascPagePart { private Integer id = null; - private VascPage vascPage = null; + private Integer pageId = null; private String title = null; private String text = null; - private Boolean i18nKey = null; private Boolean active = null; private Boolean sitemap = null; private Integer partOrder = null; @@ -58,19 +57,19 @@ public class VascPagePart { } /** - * @return the vascPage + * @return the pageId */ - public VascPage getVascPage() { - return vascPage; + public Integer getPageId() { + return pageId; } - + /** - * @param vascPage the vascPage to set + * @param pageId the pageId to set */ - public void setVascPage(VascPage vascPage) { - this.vascPage = vascPage; + public void setPageId(Integer pageId) { + this.pageId = pageId; } - + /** * @return the title */ @@ -99,20 +98,6 @@ public class VascPagePart { this.text = text; } - /** - * @return the i18nKey - */ - public Boolean getI18nKey() { - return i18nKey; - } - - /** - * @param i18nKey the i18nKey to set - */ - public void setI18nKey(Boolean i18nKey) { - this.i18nKey = i18nKey; - } - /** * @return the active */ diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/WEB-INF/faces-config.xml b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/WEB-INF/faces-config.xml index 611e025..5c870f8 100644 --- a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/WEB-INF/faces-config.xml +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/WEB-INF/faces-config.xml @@ -45,6 +45,17 @@ + + Controls the Pages + pageController + net.forwardfire.vasc.demo.tech.web.pages.VascPageController + session + + userController + #{userController} + + + Controls Vasc Export Url Generator exportController diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/WEB-INF/template/page-wiki.xhtml b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/WEB-INF/template/page-wiki.xhtml index 5a4f401..422f2a5 100644 --- a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/WEB-INF/template/page-wiki.xhtml +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/WEB-INF/template/page-wiki.xhtml @@ -4,15 +4,17 @@ xmlns:jawr="https://jawr.dev.java.net/jsf/facelets" > - + - +

- +

+ +

diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/WEB-INF/template/structure/main-body-footer.xhtml b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/WEB-INF/template/structure/main-body-footer.xhtml index 452b250..26ced5d 100644 --- a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/WEB-INF/template/structure/main-body-footer.xhtml +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/WEB-INF/template/structure/main-body-footer.xhtml @@ -5,22 +5,24 @@ xmlns:f="http://java.sun.com/jsf/core" > -
-
- - - - - - - - - - - - -
-
diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/WEB-INF/template/structure/main-body-login.xhtml b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/WEB-INF/template/structure/main-body-login.xhtml new file mode 100644 index 0000000..e6eebd2 --- /dev/null +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/WEB-INF/template/structure/main-body-login.xhtml @@ -0,0 +1,21 @@ + +
+ + + + + + + + + + + + +
+
diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/WEB-INF/template/structure/main-body-menu.xhtml b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/WEB-INF/template/structure/main-body-menu.xhtml index 9daa9eb..b6c46a8 100644 --- a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/WEB-INF/template/structure/main-body-menu.xhtml +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/WEB-INF/template/structure/main-body-menu.xhtml @@ -5,17 +5,53 @@ xmlns:f="http://java.sun.com/jsf/core" >
+ +
+

+ +

+ +
+
+ +
+

+ +

+ +
+
+ +
+

+ +

+ +
+
- diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/WEB-INF/template/structure/main-body.xhtml b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/WEB-INF/template/structure/main-body.xhtml index 6fdf001..1770875 100644 --- a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/WEB-INF/template/structure/main-body.xhtml +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/WEB-INF/template/structure/main-body.xhtml @@ -6,6 +6,9 @@ >
+ + + @@ -21,10 +24,10 @@

- - -
+ + +
diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/WEB-INF/web.xml b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/WEB-INF/web.xml index 68cdd5d..163d762 100644 --- a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/WEB-INF/web.xml +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/WEB-INF/web.xml @@ -212,27 +212,6 @@ vascFilter /vasc/* REQUEST - - - - - VASC Filter - vascFilterServerAdmin - net.forwardfire.vasc.frontend.web.jsf.VascRequestFacesFilter - - templateFile - /WEB-INF/template/page-vasc.jsf - - - vascControllerProvider - java:comp/env/vasc/server-admin@net.forwardfire.vasc.impl.jndi.JndiVascControllerProvider - - - - vascFilterServerAdmin - /server-admin/* - REQUEST - @@ -267,6 +246,23 @@ /cxf/* + + + + Page Filter + pageFilter + net.forwardfire.vasc.demo.tech.web.pages.VascPageFilter + + templateFile + /WEB-INF/template/page-wiki.jsf + + + + pageFilter + /page/* + REQUEST + + @@ -297,14 +293,13 @@ - - EjbServerServlet - org.apache.openejb.server.httpd.ServerServlet - - - - EjbServerServlet - /ejb/* - + + EjbServerServlet + org.apache.openejb.server.httpd.ServerServlet + + + EjbServerServlet + /ejb/* + diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/css/site.css b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/css/site.css deleted file mode 100644 index 125f5cc..0000000 --- a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/css/site.css +++ /dev/null @@ -1,334 +0,0 @@ - -body { - color:#000000; - background-color:#FFFFFF; -} - -h1 { - font-size:1.2em; - font-weight:bold; - padding-bottom:10px; -} - -h2 { - border-radius:3px; - display:block; - font-size:1.0em; - font-weight:bold; - padding:10px 10px 10px 10px; -} - -p { - margin:10px 10px 10px 10px; -} - -img { - border:none; - vertical-align: middle; -} - -ul { - margin-left:10px; -} - -a { - text-decoration:underline; -} - - -/* DIVS */ - - -/* MENU */ - -#page_menu_left,#page_menu_right { - border-color:#DDCCCC; - border-style:solid; - border-width:0 0 1px 0; - vertical-align:bottom; - display:inline; -} - -#page_menu_right { - position:absolute; - bottom:0; - right:0; -} - -#page_menu_left a,#page_menu_right a { - border:1px solid #e0e0e0; - background-color:#DDCCCC; - border-bottom-width:0px; - text-align:center; - -moz-border-radius-topleft:3xp; - -moz-border-radius-topright:3xp; - -webkit-border-top-left-radius:3px; - -webkit-border-top-right-radius:3px; - -khtml-border-radius-topleft:3px; - -khtml-border-radius-topright:3px; - color:#000; - margin:0px 5px 0px 0px; - padding:3px 15px 2px 15px; - text-decoration:none; -} - -#page_menu_left a:hover,#page_menu_right a:hover { - text-decoration:none; - background-color:#fff; - border-color:#e0e0e0; -} - -#page_menu_left a.active,#page_menu_left a.active { - background-color:#fff; - font-weight:700; -} - -#page_user_info { - padding:5px; - position:absolute; - right:0; - top:0; - font-size:11px; -} - - - - - -/* TABLES */ -/* -#m_content table { - text-align: left; -} -*/ - -table.table5, table.rating_table { - border-collapse:collapse; - font-size:11px; - width:100%; - margin-bottom: 30px; -} - -table.table5 th, table.rating_table th { - padding-top:5px; - padding-bottom:5px; - font-weight:700; - text-align:left; - vertical-align:top; - padding-left: 3px; -} - -table.table5 td, table.rating_table td { - vertical-align:top; - padding-top:5px; - padding-bottom:5px; - padding-left: 3px; -} - -.dataTableHeaderRow { - border:1px solid #e0e0e0; - background-color:#e4e4e4; - border-bottom-width:0; -} - -.dataTableHeaderRow th, td { - padding-right: 5px; -} - -table input,table select { - font-size: 11px; - margin-left:6px; - margin-right:6px; -} - -table.table5 tr:nth-child(even) { - background-color:#f0f0f0; -} - -.table_options_top { - -moz-border-radius-topleft:3px; - -moz-border-radius-topright:3px; - background-color:#DDCCCC; - font-size:12px; - font-weight:700; - padding:6px 15px; - display: block; -} - -.table_options_bottom { - -moz-border-radius-bottomleft:3px; - -moz-border-radius-bottomright:3px; - background-color:#DDCCCC; - font-size:12px; - font-weight:700; - padding:6px 15px; - display: block; - - margin-top:5px; -} - - -.table_sub_header { - -moz-border-radius-topleft:5px; - -moz-border-radius-topright:5px; - background-color:#EEEEEE; - border:1px solid #BBBBBB; - display:block; - font-size:14px; - font-weight:700; - margin:0 2px; - padding:3px 6px; - text-align:center; -} - - - - - - -/* MESSAGES */ - -.message_info, -.message_1 { - display:block; - font-size: 14px; - font-weight: bold; - border:solid 1px #a0ff7d; - -moz-border-radius:3px; - -webkit-border-radius:3px; - -khtml-border-radius:3px; - background-color: #a0ff7d; - padding: 15px 15px; - margin-bottom: 15px; -} - -.message_warning, -.message_2 { - display:block; - font-size: 14px; - font-weight: bold; - border:solid 1px #ffae4c; - -moz-border-radius:3px; - -webkit-border-radius:3px; - -khtml-border-radius:3px; - background-color: #ffae4c; - padding: 15px 15px; - margin-bottom: 15px; -} - -.message_error, -.message_3 { - display:block; - font-size: 14px; - font-weight: bold; - border:solid 1px #ff5b43; - -moz-border-radius:3px; - -webkit-border-radius:3px; - -khtml-border-radius:3px; - background-color: #ff5b43; - padding: 15px 15px; - margin-bottom: 15px; -} - -.message_4 { - display:block; - font-size: 14px; - font-weight: bold; - border:solid 1px #fc9200; - background-color: #fc9200; - -moz-border-radius-topleft:3px; - -webkit-border-top-left-radius:3px; - -khtml-border-radius-topleft:3px; - -moz-border-radius-topright:3px; - -webkit-border-top-right-radius:3px; - -khtml-border-radius-topright:3px; - padding: 5px; - margin-bottom: 10px; -} - -.message_1 input, .message_1 button, .message_2 input, .message_2 button, .message_3 input, .message_3 button { - margin:0px; -} - -.message_4 h2 { - margin: 0px; - padding:5px; -} - -.message_4 input { - margin: 0px; - font-weight: bold; - font-size: 14px; - padding: 2px 5px; - margin-right: 5px; -} - -/* LOGINBOX */ - - - - - -/* -** WIKI styles -*/ - -#toc, -.toc, -.mw-warning { - border: 1px solid #aaa; - background-color: #f9f9f9; - padding: 5px; - font-size: 95%; -} -#toc h2, -.toc h2 { - display: inline; - border: none; - padding: 0; - font-size: 100%; - font-weight: bold; -} -#toc #toctitle, -.toc #toctitle, -#toc .toctitle, -.toc .toctitle { - text-align: center; -} -#toc ul, -.toc ul { - list-style-type: none; - list-style-image: none; - margin-left: 0; - padding-left: 0; - text-align: left; -} -#toc ul ul, -.toc ul ul { - margin: 0 0 0 2em; -} -#toc .toctoggle, -.toc .toctoggle { - font-size: 94%; -} - -.thumbcaption { - border: none; - text-align: left; - line-height: 1.4em; - padding: 3px !important; - font-size: 94%; -} - -.location-right { - clear: right; - float: right; - border-width: .5em 0 .8em 1.4em; -} -.location-left { - float: left; - clear: left; - margin-right: .5em; - border-width: .5em 1.4em .8em 0; -} - diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/css/skins/default/layout.css b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/css/skins/default/layout.css index 0ebb32e..6df3e59 100644 --- a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/css/skins/default/layout.css +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/css/skins/default/layout.css @@ -9,7 +9,7 @@ body { } #body-content { - margin-left: 200px; + margin-left: 210px; padding: 10px; } @@ -23,38 +23,40 @@ body { #page-header-left { float:left; - margin-left: 200px; -} - -#page-header-info { - float:right; - padding-right: 20%; + margin-left: 210px; } #page-header-right { float:right; } -#page-header-left,#page-header-right { +#page-header-left,#page-header-right { padding-top: 10px; } +#page-body-login { + position: absolute; + top: 0px; +} + +#body-deco-logo { + position: absolute; + right: 5px; + top: 40px; +} + +#body-deco-menu { + position: absolute; + width: 200px; +} + #body-footer { - text-align: center; + margin-left: 210px; +} + +#body-footer-content { padding: 5px; margin-left:20em; margin-right:20em; margin-top:1em; } - -#body-deco-logo { - position: absolute; - right: 20px; - top: 50px; -} - -#body-deco-menu { - float: left; - width: 190px; -} - diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/css/skins/default/theme.css b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/css/skins/default/theme.css index 0005e66..5243d04 100644 --- a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/css/skins/default/theme.css +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/css/skins/default/theme.css @@ -8,28 +8,52 @@ body { } #body-content { + min-height: 400px; border: 1px solid #ccc; - border-bottom-left-radius:3px; - border-bottom-right-radius:3px; + border-bottom-left-radius:5px; + border-bottom-right-radius:5px; background-image: url(/demo/img/skin/default/body-view-bg.png); } -#page-header-left a,#page-header-right a,#page-header-info-body { +#page-body-login { + text-align: center; + height: 28px; + width: 198px; + padding-top: 7px; + border: 1px solid #BBBBBB; + border-top: none; + border-bottom-left-radius:5px; + border-bottom-right-radius:5px; + background-image: url(/demo/img/skin/default/body-view-bg.png); +} + +#page-header-left a,#page-header-right a { padding:10px; padding-bottom:5px; } -#page-header-left a,#page-header-right a,#page-header-info-body { +#page-header-left a,#page-header-right a { background-color:#DDCCCC; font-weight:bold; border-top-left-radius:5px; border-top-right-radius:5px; } +#page-header-left a { + margin-right: 3px; +} +#page-header-right a { + margin-left: 3px; +} #body-footer { - border-color:#e5e5e5; - border-style:solid; - border-width:1px 1px 1px 1px; - border-radius:3px; + margin-top: 10px; + border: 1px solid #BBBBBB; + border-radius:5px; + background-image: url(/demo/img/skin/default/body-view-bg.png); +} + +#body-footer-content { + text-align:center; + font-size:80%; } @@ -42,9 +66,7 @@ h1 { } h2 { - font-style: italic; - float: right; - margin-top: -45px; + font-style: italic; padding: 10px; color: #2d1100; } @@ -67,50 +89,22 @@ h3 span { padding-bottom: 4px; } - -/* - -#summary { - float: left; - width: 200px; - margin-right: 15px; - text-align: center; - border: 1px solid #ccc; - padding: 5px; - font-family: Georgia, serif; - font-style: italic; - -} - -*/ - -#body-deco-logo { - -} -#body-deco-menu { - -} - -#body-deco-logo-div,#body-deco-menu0-div,#body-deco-menu1-div,#body-deco-menu2-div { - /* - font: 10px verdana, sans-serif; - padding: 10px; - margin-top: 130px; - width: 130px; - border: 1px solid #ccc; - background-image: url(../../../img/skin/default/wrapper2.png); -*/ -} - - -#body-deco-menu-group { +.body-deco-menu-group { padding:5px; + margin-top: 5px; margin-bottom: 10px; border-radius:5px; border: 1px solid #BBBBBB; background-image: url(/demo/img/skin/default/body-view-bg.png); } +.body-deco-menu-group ul { + margin-left: 5px; + padding-left: 0px; + list-style:none; + font-size:80%; +} + .rf-p { border-radius:5px; border: 1px solid #BBBBBB; diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/css/skins/green/theme.css b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/css/skins/green/theme.css index 53851f3..28a18e2 100644 --- a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/css/skins/green/theme.css +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/css/skins/green/theme.css @@ -6,15 +6,15 @@ body { input:hover,textarea:hover,select:hover{ - border: 2px solid rgba(100, 224, 64, 0.6); + border: 2px solid rgba(10, 224, 64, 0.6); } .even { - background-color:rgba(70, 180, 60, 0.6); + background-color:rgba(70, 18, 60, 0.6); } .odd { - background-color:rgba(10, 230, 120, 0.6); + background-color:rgba(180, 230, 12, 0.6); } #page-header-left a,#page-header-right a,#page-header-info-body,.rf-dt-shdr-c a,.table_sub_header { @@ -26,6 +26,6 @@ input:hover,textarea:hover,select:hover{ } ul.actionboxtab li a:hover,#page-header-left a:hover,#page-header-right a:hover,#page-header-info-body:hover { - background-color:rgba(65, 182, 33, 0.6); + background-color:rgba(65, 18, 33, 0.6); } diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/html/admin/index.xhtml b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/html/admin/index.xhtml index 6046d2d..2418aa1 100644 --- a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/html/admin/index.xhtml +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/html/admin/index.xhtml @@ -7,7 +7,7 @@ > Admin Index - + @@ -45,6 +45,7 @@ +
diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/html/index.xhtml b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/html/index.xhtml index e9c287f..d4b8d4c 100644 --- a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/html/index.xhtml +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/html/index.xhtml @@ -7,23 +7,7 @@ > Index - - - - - - - - - - - - - - - +

Welcome to the vasc tech demo.

+

Please login to see more options.

+
diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/html/user/profile.xhtml b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/html/user/profile.xhtml index cfec6f0..a56e03c 100644 --- a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/html/user/profile.xhtml +++ b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/html/user/profile.xhtml @@ -16,11 +16,12 @@ - +

Select theme

+ diff --git a/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/img/logo.png b/vasc-demo/vasc-demo-tech/vasc-demo-tech-web/src/main/webapp/img/logo.png index 7c2a57dd90d2f1970fdcf20909ddccf260227b95..7ca618189b2109726c16dfe4a392aa195e502229 100644 GIT binary patch literal 12691 zcmZvDRZtvE6YTb;x1!x(& zn35?tSUPm%iuVBkWB^$SQ4No^b6?K@BF*NV?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WEQjw8~Q2Ip> zE%gsj^{GLRr{5a?R5x~e?DO{e`ug{wC9u2tL9@OBWP(ybV4LtP?`u+EC{vckTq-{b zT~4C_R`4W(90>5P|8n7aHo#r>%gH4)&y(IiwLVJyWGWpgU==^7se~G(h^+v1J|I7+ zAmy$R{ZErS`79fqR&4)rVF9<(m<<>P6VJ!guF{8Q8lGonLL_>x%QcyR47VZZy(6eH zzq!&in68!Qo#O)5rw@}ytZ#b`hvUc^Qbp0j#I^fd9LQ>-om>OMm|f{BM6P%MI#W?m zks&7J97hE?vDnSqYl9tiVq)SqtBipGiF$cTSf1yv>m%)31#6VixkXoCjAM;9@d8d6 ziPK05-*E3_`3*x`$`sU9KHUf&$I?;-Y?>G>r!4}^f$Fn=Ey^_AZKEU}q3Z%KdTy?dNfafjecSeCa5HNI7 zz<3M{mpmWY{QTNSW2}->TD{a&or%mLU{vy5_^Y0=p^i`3!RF{ak3P{rm0pcThIx+N z;K45({`$uHGhk@{C^ zh=gM+jsY$|6c{OR@u_k0zv==;c>7FeJo16jF=m$VDKY$TH*6pGCC<`C#xBK|m;;C7 zUsZrwcx$9W{G$kYgKXz|BJrZ#is?puA{(AY*}5|NSPe0LiBiF?1NwdLd4_|{TsPKq z&(IC|e&Rpu&N`q6B%62}&3GU*9;xQf91YYZy@3cgNvL0cl> zB-M9$M6Z>@iBUK^y<^HE^#W@%Py7JAOomOFF2}-W?ws+%OIuTP+HJ@$wB#d`nmXUJKX&`JoJk2 Y-7EXN!TE3n7*vOolTwzf7B>z4ADbIE9smFU diff --git a/vasc-export/.project b/vasc-export/.project new file mode 100644 index 0000000..906f5df --- /dev/null +++ b/vasc-export/.project @@ -0,0 +1,17 @@ + + + vasc-export + + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.m2e.core.maven2Nature + + diff --git a/vasc-export/pom.xml b/vasc-export/pom.xml new file mode 100644 index 0000000..b0e01c5 --- /dev/null +++ b/vasc-export/pom.xml @@ -0,0 +1,18 @@ + + 4.0.0 + + net.forwardfire.vasc + vasc + 0.4.1-SNAPSHOT + + vasc-export + net.forwardfire.vasc.export + pom + vasc-export + vasc-export + + vasc-export-jr4o + vasc-export-json + vasc-export-generic + + \ No newline at end of file diff --git a/vasc-export/vasc-export-generic/.project b/vasc-export/vasc-export-generic/.project new file mode 100644 index 0000000..c0ae249 --- /dev/null +++ b/vasc-export/vasc-export-generic/.project @@ -0,0 +1,23 @@ + + + vasc-export-generic + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/vasc-export/vasc-export-generic/pom.xml b/vasc-export/vasc-export-generic/pom.xml new file mode 100644 index 0000000..b869215 --- /dev/null +++ b/vasc-export/vasc-export-generic/pom.xml @@ -0,0 +1,18 @@ + + 4.0.0 + + net.forwardfire.vasc.export + vasc-export + 0.4.1-SNAPSHOT + + vasc-export-generic + vasc-export-generic + vasc-export-generic + + + net.forwardfire.vasc + vasc-core + ${project.version} + + + \ No newline at end of file diff --git a/vasc-core/src/main/java/net/forwardfire/vasc/impl/entry/export/VascEntryExporterCsv.java b/vasc-export/vasc-export-generic/src/main/java/net/forwardfire/vasc/export/generic/AbstractVascEntryExportWriter.java similarity index 50% rename from vasc-core/src/main/java/net/forwardfire/vasc/impl/entry/export/VascEntryExporterCsv.java rename to vasc-export/vasc-export-generic/src/main/java/net/forwardfire/vasc/export/generic/AbstractVascEntryExportWriter.java index 5dee7e8..2b52480 100644 --- a/vasc-core/src/main/java/net/forwardfire/vasc/impl/entry/export/VascEntryExporterCsv.java +++ b/vasc-export/vasc-export-generic/src/main/java/net/forwardfire/vasc/export/generic/AbstractVascEntryExportWriter.java @@ -20,78 +20,89 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.forwardfire.vasc.impl.entry.export; +package net.forwardfire.vasc.export.generic; +import java.io.IOException; import java.io.OutputStream; -import java.io.PrintWriter; +import java.util.ArrayList; +import java.util.List; import net.forwardfire.vasc.core.VascEntry; import net.forwardfire.vasc.core.VascEntryField; -import net.forwardfire.vasc.core.entry.VascEntryExporter; +import net.forwardfire.vasc.core.entry.VascEntryExport; +import net.forwardfire.vasc.core.entry.VascEntryExportWriter; import net.forwardfire.vasc.core.VascException; /** - * VascEntryExporterCsv writes data to csv output format. + * AbstractVascEntryExportWriter make read of paged data into methods. * * @author Willem Cazander - * @version 1.0 Mar 30, 2007 + * @version 1.0 Nov 23, 2012 */ -public class VascEntryExporterCsv implements VascEntryExporter { +@SuppressWarnings("serial") +abstract public class AbstractVascEntryExportWriter implements VascEntryExportWriter { - private static final long serialVersionUID = 2770924442917617161L; - static public final String EXPORT_TYPE = "csv"; + private VascEntryExport vascEntryExport = null; + private VascEntry vascEntry = null; - /** - * @see net.forwardfire.vasc.core.entry.VascEntryExporter#getId() - */ - public String getId() { - return EXPORT_TYPE; + public void doInit(VascEntryExport vascEntryExport,VascEntry vascEntry) throws VascException { + this.vascEntryExport=vascEntryExport; + this.vascEntry=vascEntry; } - - /** - * @see net.forwardfire.vasc.core.entry.VascEntryExporter#doExport(java.io.OutputStream, net.forwardfire.vasc.core.VascEntry) - */ - public void doExport(OutputStream out, VascEntry entry) throws VascException { - PrintWriter p = new PrintWriter(out); - p.write("# csv\n"); - for (VascEntryField c:entry.getVascEntryFields()) { - p.write(c.getId()+"\t"); - } - p.write("\n"); + + public void doExport(OutputStream out) throws IOException,VascException { + doExportInit(out); + doExportStart(); + + VascEntry entry = getVascEntry(); int oldIndex = entry.getVascFrontendController().getVascEntryState().getVascBackendState().getPageIndex(); Long total = entry.getVascFrontendController().getVascEntryState().getTotalBackendRecords(); int pages = total.intValue()/entry.getVascFrontendController().getVascEntryState().getVascBackendState().getPageSize(); for (int page=0;page<=pages;page++) { entry.getVascFrontendController().getVascEntryState().getVascBackendState().setPageIndex(page); entry.getVascFrontendController().getVascFrontendActions().refreshData(); - for (Object o:entry.getVascFrontendController().getVascEntryState().getEntryDataList()) { - for (VascEntryField c:entry.getVascEntryFields()) { - p.write(c.getVascEntryFieldValue().getDisplayValue(c, o)+"\t"); - } - p.write("\n"); - p.flush(); + + int dataSize = entry.getVascFrontendController().getVascEntryState().getEntryDataList().size(); + for (int dataIndex=0;dataIndex fieldList = new ArrayList(getVascEntry().getVascEntryFields()); + int fields = fieldList.size(); + for (int i=0;i\n"); + p.write("\n"); + } + + @Override + protected void doExportEnd() { + p.write("\n"); + p.flush(); + } + + @Override + protected void doExportRowStart(Object row) { + p.write("\t\n"); + } + + @Override + protected void doExportRowEnd(Object row,boolean isLast) { + p.write("\t\n"); + p.flush(); + } + + @Override + protected void doExportRowField(Object o, VascEntryField c,boolean isLast) throws VascException { + if (xmlTree) { + p.write("\t\t<"+c.getId()+">\n"); + } else { + p.write("\t\t\n"); + } + } + + /** + * @see net.forwardfire.vasc.core.entry.VascEntryExport#getMineType() + */ + public String getMineType() { + return "text/xml"; + } + + /** + * @see net.forwardfire.vasc.core.entry.VascEntryExport#getFileType() + */ + public String getFileType() { + return EXPORT_TYPE; + } +} diff --git a/vasc-export/vasc-export-jr4o/.project b/vasc-export/vasc-export-jr4o/.project new file mode 100644 index 0000000..39b54d2 --- /dev/null +++ b/vasc-export/vasc-export-jr4o/.project @@ -0,0 +1,23 @@ + + + vasc-export-jr4o + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/vasc-export/vasc-export-jr4o/pom.xml b/vasc-export/vasc-export-jr4o/pom.xml new file mode 100644 index 0000000..006dbf5 --- /dev/null +++ b/vasc-export/vasc-export-jr4o/pom.xml @@ -0,0 +1,23 @@ + + 4.0.0 + + net.forwardfire.vasc.export + vasc-export + 0.4.1-SNAPSHOT + + vasc-export-jr4o + vasc-export-jr4o + vasc-export-jr4o + + + net.forwardfire.vasc.export + vasc-export-generic + ${project.version} + + + net.forwardfire.vasc.lib + vasc-lib-jr4o + ${project.version} + + + \ No newline at end of file diff --git a/vasc-core/src/main/java/net/forwardfire/vasc/impl/entry/export/JRDynamicDataSourceVascEntry.java b/vasc-export/vasc-export-jr4o/src/main/java/net/forwardfire/vasc/export/jr4o/JRDynamicDataSourceVascEntry.java similarity index 99% rename from vasc-core/src/main/java/net/forwardfire/vasc/impl/entry/export/JRDynamicDataSourceVascEntry.java rename to vasc-export/vasc-export-jr4o/src/main/java/net/forwardfire/vasc/export/jr4o/JRDynamicDataSourceVascEntry.java index 2873fa6..b12be28 100644 --- a/vasc-core/src/main/java/net/forwardfire/vasc/impl/entry/export/JRDynamicDataSourceVascEntry.java +++ b/vasc-export/vasc-export-jr4o/src/main/java/net/forwardfire/vasc/export/jr4o/JRDynamicDataSourceVascEntry.java @@ -20,7 +20,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.forwardfire.vasc.impl.entry.export; +package net.forwardfire.vasc.export.jr4o; import java.util.ArrayList; import java.util.HashMap; diff --git a/vasc-core/src/main/java/net/forwardfire/vasc/impl/entry/export/VascEntryExporterJR4O.java b/vasc-export/vasc-export-jr4o/src/main/java/net/forwardfire/vasc/export/jr4o/VascEntryExportWriterJR4O.java similarity index 68% rename from vasc-core/src/main/java/net/forwardfire/vasc/impl/entry/export/VascEntryExporterJR4O.java rename to vasc-export/vasc-export-jr4o/src/main/java/net/forwardfire/vasc/export/jr4o/VascEntryExportWriterJR4O.java index 3cbc83a..8408b7e 100644 --- a/vasc-core/src/main/java/net/forwardfire/vasc/impl/entry/export/VascEntryExporterJR4O.java +++ b/vasc-export/vasc-export-jr4o/src/main/java/net/forwardfire/vasc/export/jr4o/VascEntryExportWriterJR4O.java @@ -20,7 +20,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.forwardfire.vasc.impl.entry.export; +package net.forwardfire.vasc.export.jr4o; import java.io.File; import java.io.OutputStream; @@ -28,64 +28,55 @@ import java.util.HashMap; import java.util.Map; import net.forwardfire.vasc.core.VascEntry; -import net.forwardfire.vasc.core.entry.VascEntryExporter; +import net.forwardfire.vasc.core.entry.VascEntryExport; +import net.forwardfire.vasc.core.entry.VascEntryExportWriter; import net.forwardfire.vasc.core.VascException; import net.forwardfire.vasc.lib.jr4o.JR4ODesignManager; import net.forwardfire.vasc.lib.jr4o.JR4ODesignManager.JRExportType; /** - * VascEntryExporterPdf creates an pdf view of the data. + * VascEntryExportWriterJR4O creates an pdf view of the data. * * @author Willem Cazander * @version 1.0 May 11, 2012 */ -public class VascEntryExporterJR4O implements VascEntryExporter { +public class VascEntryExportWriterJR4O implements VascEntryExportWriter { private static final long serialVersionUID = -3951608685719832654L; static public final String EXPORT_TYPE = "pdf"; - private JRExportType reportType = null; + private VascEntry entry = null; + private JRExportType reportType = JRExportType.PDF; private String reportResource = null; private String reportName = null; private File reportFile = null; - private String id = null; - - private VascEntryExporterJR4O(String id,JRExportType reportType,String reportName) { - if (reportName == null) { - throw new NullPointerException("Can't export null reportName."); - } - if (reportType == null) { - throw new NullPointerException("Can't export null reportType."); - } - this.id = id; - this.reportType = reportType; - this.reportName = reportName; - } - - public VascEntryExporterJR4O(String id,JRExportType reportType,String reportName,String reportResource) { - this(id,reportType,reportName); - this.reportResource=reportResource; - } - - public VascEntryExporterJR4O(String id,JRExportType reportType,String reportName,File reportFile) { - this(id,reportType,reportName); - this.reportFile=reportFile; - } /** - * @see net.forwardfire.vasc.core.entry.VascEntryExporter#getId() + * @see net.forwardfire.vasc.core.entry.VascEntryExportWriter#doInit(net.forwardfire.vasc.core.entry.VascEntryExport, net.forwardfire.vasc.core.VascEntry) */ - public String getId() { - return id; + @Override + public void doInit(VascEntryExport export, VascEntry vascEntry) throws VascException { + this.entry = vascEntry; + + String reportTypeString = export.getWriterParameter("reportType"); + if (reportTypeString!=null && reportTypeString.isEmpty()==false) { + reportType = JRExportType.valueOf(reportTypeString); + } + reportName = export.getWriterParameter("reportName"); + if (reportName==null) { + throw new NullPointerException("Can work with null reportName parameter."); + } + + String reportFileString = export.getWriterParameter("reportFile"); + if (reportFileString!=null && reportFileString.isEmpty()==false) { + reportFile = new File(reportFileString); + } + reportResource = export.getWriterParameter("reportResource"); } - public void setId(String id) { - this.id=id; - } - /** - * @see net.forwardfire.vasc.core.entry.VascEntryExporter#doExport(java.io.OutputStream, net.forwardfire.vasc.core.VascEntry) + * @see net.forwardfire.vasc.core.entry.VascEntryExport#doExport(java.io.OutputStream, net.forwardfire.vasc.core.VascEntry) */ - public void doExport(OutputStream out, VascEntry entry) throws VascException { + public void doExport(OutputStream out) throws VascException { Map parameters = new HashMap(5); parameters.put("title", entry.getVascFrontendController().getVascEntryResourceResolver().getTextValue(entry.getName())); @@ -113,14 +104,14 @@ public class VascEntryExporterJR4O implements VascEntryExporter { } /** - * @see net.forwardfire.vasc.core.entry.VascEntryExporter#getMineType() + * @see net.forwardfire.vasc.core.entry.VascEntryExport#getMineType() */ public String getMineType() { return "text/pdf"; } /** - * @see net.forwardfire.vasc.core.entry.VascEntryExporter#getFileType() + * @see net.forwardfire.vasc.core.entry.VascEntryExport#getFileType() */ public String getFileType() { return EXPORT_TYPE; diff --git a/vasc-export/vasc-export-json/.project b/vasc-export/vasc-export-json/.project new file mode 100644 index 0000000..8befc3e --- /dev/null +++ b/vasc-export/vasc-export-json/.project @@ -0,0 +1,23 @@ + + + vasc-export-json + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/vasc-export/vasc-export-json/pom.xml b/vasc-export/vasc-export-json/pom.xml new file mode 100644 index 0000000..45b3760 --- /dev/null +++ b/vasc-export/vasc-export-json/pom.xml @@ -0,0 +1,23 @@ + + 4.0.0 + + net.forwardfire.vasc.export + vasc-export + 0.4.1-SNAPSHOT + + vasc-export-json + vasc-export-json + vasc-export-json + + + net.forwardfire.vasc.export + vasc-export-generic + ${project.version} + + + com.googlecode.json-simple + json-simple + ${json-simple.version} + + + diff --git a/vasc-export/vasc-export-json/src/main/java/net/forwardfire/vasc/export/json/VascEntryExportWriterJson.java b/vasc-export/vasc-export-json/src/main/java/net/forwardfire/vasc/export/json/VascEntryExportWriterJson.java new file mode 100644 index 0000000..7a215e3 --- /dev/null +++ b/vasc-export/vasc-export-json/src/main/java/net/forwardfire/vasc/export/json/VascEntryExportWriterJson.java @@ -0,0 +1,115 @@ +/* + * 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.export.json; + +import java.io.IOException; +import java.io.OutputStream; +import java.io.PrintWriter; +import java.util.HashMap; +import java.util.Map; + +import org.json.simple.JSONObject; +import org.json.simple.JSONValue; + +import net.forwardfire.vasc.core.VascEntryField; +import net.forwardfire.vasc.core.VascException; +import net.forwardfire.vasc.export.generic.AbstractVascEntryExportWriter; + +/** + * VascEntryExportWriterJson exports the entry data to json format. + * + * @author Willem Cazander + * @version 1.0 Nov 23, 2012 + */ +public class VascEntryExportWriterJson extends AbstractVascEntryExportWriter { + + private static final long serialVersionUID = 2965474124451161061L; + private PrintWriter p = null; + private Map rowData = null; + + public VascEntryExportWriterJson() { + rowData = new HashMap(60); + } + + @Override + public String getMineType() { + return "text/json"; + } + + @Override + public String getFileType() { + return "json"; + } + + @Override + protected void doExportInit(OutputStream out) { + p = new PrintWriter(out); + } + + private void writeField(String key,String value) { + p.write("\""); + p.write(key); + p.write("\": \""); + p.write(JSONValue.escape(value)); + p.write("\""); + } + + @Override + protected void doExportStart() { + p.write("{\"entry\": {\n"); + writeField("id",getVascEntry().getId()); + p.write(",\n"); + writeField("vascGroupId",getVascEntry().getVascGroupId()); + p.write(",\n"); + p.write("\"data\": [\n"); + } + + @Override + protected void doExportEnd() { + p.write("]\n"); + p.write("}}\n"); + p.flush(); + } + + @Override + protected void doExportRowStart(Object row) { + rowData.clear(); + } + + @Override + protected void doExportRowEnd(Object row,boolean isLast) throws IOException { + JSONObject.writeJSONString(rowData, p); + if (isLast==false) { + p.write(","); + } + p.write("\n"); + p.flush(); + } + + @Override + protected void doExportRowField(Object row, VascEntryField field,boolean isLast) throws VascException { + String key = field.getId(); + Object data = field.getVascEntryFieldValue().getValue(field, row); + rowData.put(key, data); + } +} diff --git a/vasc-export/vasc-export-json/src/main/java/net/forwardfire/vasc/export/json/package-info.java b/vasc-export/vasc-export-json/src/main/java/net/forwardfire/vasc/export/json/package-info.java new file mode 100644 index 0000000..1b20b3e --- /dev/null +++ b/vasc-export/vasc-export-json/src/main/java/net/forwardfire/vasc/export/json/package-info.java @@ -0,0 +1,6 @@ + +/** + * @author willemc + * + */ +package net.forwardfire.vasc.export.json; \ No newline at end of file diff --git a/vasc-frontend/vasc-frontend-swing/src/main/java/net/forwardfire/vasc/frontend/swing/SwingVascFrontend.java b/vasc-frontend/vasc-frontend-swing/src/main/java/net/forwardfire/vasc/frontend/swing/SwingVascFrontend.java index f99a7d8..9c12189 100644 --- a/vasc-frontend/vasc-frontend-swing/src/main/java/net/forwardfire/vasc/frontend/swing/SwingVascFrontend.java +++ b/vasc-frontend/vasc-frontend-swing/src/main/java/net/forwardfire/vasc/frontend/swing/SwingVascFrontend.java @@ -66,7 +66,8 @@ import net.forwardfire.vasc.core.VascEntryField; import net.forwardfire.vasc.core.VascEntryListOption; import net.forwardfire.vasc.core.actions.GlobalVascAction; import net.forwardfire.vasc.core.actions.RowVascAction; -import net.forwardfire.vasc.core.entry.VascEntryExporter; +import net.forwardfire.vasc.core.entry.VascEntryExport; +import net.forwardfire.vasc.core.entry.VascEntryExportWriter; import net.forwardfire.vasc.core.ui.VascOptionValueModelListener; import net.forwardfire.vasc.core.ui.VascUIComponent; import net.forwardfire.vasc.core.ui.VascValueModel; @@ -215,40 +216,40 @@ public class SwingVascFrontend extends AbstractVascFrontend { /** * @see net.forwardfire.vasc.core.VascViewRenderer#renderExport(net.forwardfire.vasc.core.VascEntry, net.forwardfire.vasc.core.VascDataExporter) */ - public void renderExport(VascEntryExporter exporter) throws VascFrontendException { + public void renderExport(VascEntryExport exporter) throws VascFrontendException { String fileName = null; JFileChooser c = new JFileChooser(); - int rVal = c.showSaveDialog(null); - if (rVal == JFileChooser.APPROVE_OPTION) { - fileName = c.getSelectedFile().getAbsolutePath(); - // filename.setText(c.getSelectedFile().getName()); - //dir.setText(c.getCurrentDirectory().toString()); - } - if (rVal == JFileChooser.CANCEL_OPTION) { - return; - } + int rVal = c.showSaveDialog(null); + if (rVal == JFileChooser.APPROVE_OPTION) { + fileName = c.getSelectedFile().getAbsolutePath(); + } + if (rVal == JFileChooser.CANCEL_OPTION) { + return; + } - logger.fine("FileName: "+fileName); - if (fileName == null) { - return; - } - OutputStream out = null; - try { - out = new FileOutputStream(fileName); - exporter.doExport(out, entry); - } catch (VascException e) { - throw new VascFrontendException(e); - } catch (FileNotFoundException e) { - throw new VascFrontendException(e); + logger.fine("Export fileName: "+fileName); + if (fileName == null) { + return; + } + OutputStream out = null; + try { + VascEntryExportWriter veew = exporter.createExportWriter(); + veew.doInit(exporter, entry); + out = new FileOutputStream(fileName); + veew.doExport(out); + } catch (VascException e) { + throw new VascFrontendException(e); + } catch (IOException e) { + throw new VascFrontendException(e); } finally { - if (out!=null) { - try { + if (out!=null) { + try { out.close(); } catch (IOException e) { } - } - } + } + } } diff --git a/vasc-frontend/vasc-frontend-swt/src/main/java/net/forwardfire/vasc/frontend/swt/SwtVascFrontend.java b/vasc-frontend/vasc-frontend-swt/src/main/java/net/forwardfire/vasc/frontend/swt/SwtVascFrontend.java index 87a99c7..3583e54 100644 --- a/vasc-frontend/vasc-frontend-swt/src/main/java/net/forwardfire/vasc/frontend/swt/SwtVascFrontend.java +++ b/vasc-frontend/vasc-frontend-swt/src/main/java/net/forwardfire/vasc/frontend/swt/SwtVascFrontend.java @@ -35,7 +35,8 @@ import net.forwardfire.vasc.core.VascEntryListOption; import net.forwardfire.vasc.core.VascException; import net.forwardfire.vasc.core.actions.GlobalVascAction; import net.forwardfire.vasc.core.actions.RowVascAction; -import net.forwardfire.vasc.core.entry.VascEntryExporter; +import net.forwardfire.vasc.core.entry.VascEntryExport; +import net.forwardfire.vasc.core.entry.VascEntryExportWriter; import net.forwardfire.vasc.core.entry.VascEntryFrontendEventListener; import net.forwardfire.vasc.core.ui.VascOptionValueModelListener; import net.forwardfire.vasc.core.ui.VascUIComponent; @@ -163,7 +164,7 @@ public class SwtVascFrontend extends AbstractVascFrontend { /** These filter extensions are used to filter which files are displayed. */ private static final String[] FILTER_EXTS = { "*.*","*.csv","*.xls" }; - public void renderExport(VascEntryExporter exporter) throws VascFrontendException { + public void renderExport(VascEntryExport exporter) throws VascFrontendException { FileDialog dlg = new FileDialog(Display.getCurrent().getActiveShell(), SWT.SAVE); dlg.setFilterNames(FILTER_NAMES); dlg.setFilterExtensions(FILTER_EXTS); @@ -175,13 +176,15 @@ public class SwtVascFrontend extends AbstractVascFrontend { } OutputStream out = null; try { + VascEntryExportWriter veew = exporter.createExportWriter(); + veew.doInit(exporter, entry); out = new FileOutputStream(fileName); - exporter.doExport(out, entry); + veew.doExport(out); } catch (VascException e) { //MessageDialog.openError(Display.getCurrent().getActiveShell(),crudTable.i18n("crud.event.export.error.title"),crudTable.i18n("crud.event.export.error.message")); logger.log(Level.WARNING,"Error: "+e.getMessage(),e); throw new VascFrontendException(e); - } catch (FileNotFoundException e) { + } catch (IOException e) { throw new VascFrontendException(e); } finally { if (out!=null) { diff --git a/vasc-frontend/vasc-frontend-web-export/src/main/java/net/forwardfire/vasc/frontend/web/export/VascExportServlet.java b/vasc-frontend/vasc-frontend-web-export/src/main/java/net/forwardfire/vasc/frontend/web/export/VascExportServlet.java index 516b98d..71491ae 100644 --- a/vasc-frontend/vasc-frontend-web-export/src/main/java/net/forwardfire/vasc/frontend/web/export/VascExportServlet.java +++ b/vasc-frontend/vasc-frontend-web-export/src/main/java/net/forwardfire/vasc/frontend/web/export/VascExportServlet.java @@ -34,7 +34,8 @@ import javax.servlet.http.HttpServletResponse; import net.forwardfire.vasc.core.VascController; import net.forwardfire.vasc.core.VascControllerProvider; import net.forwardfire.vasc.core.VascEntryLocal; -import net.forwardfire.vasc.core.entry.VascEntryExporter; +import net.forwardfire.vasc.core.entry.VascEntryExport; +import net.forwardfire.vasc.core.entry.VascEntryExportWriter; import net.forwardfire.vasc.core.VascException; /** @@ -176,14 +177,16 @@ public class VascExportServlet extends HttpServlet { // Update total every time first Long total = ve.getVascFrontendController().getVascEntryState().getVascBackend().fetchTotalExecuteSize(ve.getVascFrontendController().getVascEntryState().getVascBackendState()); ve.getVascFrontendController().getVascEntryState().setTotalBackendRecords(total); - VascEntryExporter ex = vc.getVascEntryConfigController().getVascEntryExporterById(exportId); + VascEntryExport ex = vc.getVascEntryConfigController().getVascEntryExporterById(exportId); + VascEntryExportWriter exw = ex.createExportWriter(); + exw.doInit(ex, ve); - String filename = entryId+"-export."+ex.getFileType(); + String filename = entryId+"-export."+exw.getFileType(); response.setHeader("Content-disposition", "attachment; filename=" + filename); - String contentType = ex.getMineType(); + String contentType = exw.getMineType(); response.setContentType(contentType); - ex.doExport(out, ve); + exw.doExport(out); } catch (VascException e) { response.setStatus(500); response.setContentType("text/html"); diff --git a/vasc-frontend/vasc-frontend-web-jsf/src/main/java/net/forwardfire/vasc/frontend/web/jsf/JSFVascEntrySupportBean.java b/vasc-frontend/vasc-frontend-web-jsf/src/main/java/net/forwardfire/vasc/frontend/web/jsf/JSFVascEntrySupportBean.java index caade7d..2cc4d61 100644 --- a/vasc-frontend/vasc-frontend-web-jsf/src/main/java/net/forwardfire/vasc/frontend/web/jsf/JSFVascEntrySupportBean.java +++ b/vasc-frontend/vasc-frontend-web-jsf/src/main/java/net/forwardfire/vasc/frontend/web/jsf/JSFVascEntrySupportBean.java @@ -58,7 +58,8 @@ import net.forwardfire.vasc.core.VascEntryLinkType; import net.forwardfire.vasc.core.VascException; import net.forwardfire.vasc.core.actions.GlobalVascAction; import net.forwardfire.vasc.core.actions.RowVascAction; -import net.forwardfire.vasc.core.entry.VascEntryExporter; +import net.forwardfire.vasc.core.entry.VascEntryExport; +import net.forwardfire.vasc.core.entry.VascEntryExportWriter; import net.forwardfire.vasc.frontend.VascFrontendException; import net.forwardfire.vasc.impl.actions.AddRowAction; import net.forwardfire.vasc.impl.actions.DeleteRowAction; @@ -88,7 +89,7 @@ public class JSFVascEntrySupportBean implements Serializable { private Boolean backendPageable = null; private Boolean sortOrder = null; private String sortField = null; - private VascEntryExporter selectedExporter = null; + private VascEntryExport selectedExporter = null; private String selectedExporterAction = "null"; private String selectedDirectPage = "null"; private String selectedMultiRowAction = "null"; @@ -723,7 +724,7 @@ public class JSFVascEntrySupportBean implements Serializable { // restore normal view for next request. comp.setRenderFacetState("listView"); - VascEntryExporter ex = getSelectedExporter(); + VascEntryExport ex = getSelectedExporter(); if (ex==null) { logger.fine("No exporter selected for download."); @@ -733,15 +734,17 @@ public class JSFVascEntrySupportBean implements Serializable { FacesContext fc = FacesContext.getCurrentInstance(); try { + VascEntryExportWriter veew = ex.createExportWriter(); + veew.doInit(ex, entry); HttpServletResponse response = (HttpServletResponse)fc.getExternalContext().getResponse(); - String filename = "export-list."+ex.getFileType(); + String filename = "export-list."+veew.getFileType(); response.setHeader("Content-disposition", "attachment; filename=" + filename); - String contentType = ex.getMineType(); + String contentType = veew.getMineType(); response.setContentType(contentType); ServletOutputStream out = response.getOutputStream(); - ex.doExport(out, entry); + veew.doExport(out); out.close(); } catch (VascException e) { throw new VascFrontendException(e); @@ -869,14 +872,14 @@ public class JSFVascEntrySupportBean implements Serializable { /** * @return the selectedExporter */ - public VascEntryExporter getSelectedExporter() { + public VascEntryExport getSelectedExporter() { return selectedExporter; } /** * @param selectedExporter the selectedExporter to set */ - public void setSelectedExporter(VascEntryExporter selectedExporter) { + public void setSelectedExporter(VascEntryExport selectedExporter) { this.selectedExporter = selectedExporter; } diff --git a/vasc-frontend/vasc-frontend-web-jsf/src/main/java/net/forwardfire/vasc/frontend/web/jsf/JSFVascFrontendRenderer.java b/vasc-frontend/vasc-frontend-web-jsf/src/main/java/net/forwardfire/vasc/frontend/web/jsf/JSFVascFrontendRenderer.java index 82116e1..f1fe2b1 100644 --- a/vasc-frontend/vasc-frontend-web-jsf/src/main/java/net/forwardfire/vasc/frontend/web/jsf/JSFVascFrontendRenderer.java +++ b/vasc-frontend/vasc-frontend-web-jsf/src/main/java/net/forwardfire/vasc/frontend/web/jsf/JSFVascFrontendRenderer.java @@ -28,7 +28,7 @@ import java.util.logging.Logger; import javax.faces.component.UIViewRoot; import javax.faces.context.FacesContext; -import net.forwardfire.vasc.core.entry.VascEntryExporter; +import net.forwardfire.vasc.core.entry.VascEntryExport; import net.forwardfire.vasc.frontend.AbstractVascFrontend; import net.forwardfire.vasc.frontend.VascFrontendException; import net.forwardfire.vasc.frontend.VascFrontendController; @@ -116,9 +116,9 @@ public class JSFVascFrontendRenderer extends AbstractVascFrontend implements Ser } /** - * @see net.forwardfire.vasc.frontend.VascFrontend#renderExport(net.forwardfire.vasc.core.entry.VascEntryExporter) + * @see net.forwardfire.vasc.frontend.VascFrontend#renderExport(net.forwardfire.vasc.core.entry.VascEntryExport) */ - public void renderExport(VascEntryExporter exporter) throws VascFrontendException { + public void renderExport(VascEntryExport exporter) throws VascFrontendException { logger.finer("renderExport"); UIViewRoot viewRoot = FacesContext.getCurrentInstance().getViewRoot(); JSFVascUIComponent comp = JSFVascUIComponent.findVascChild(viewRoot,getVascEntry().getId());