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()+">"+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 @@