added files
This commit is contained in:
parent
90b81deb29
commit
fc4c568b18
54
src/eclipse/ant/deploy-workspace.xml
Normal file
54
src/eclipse/ant/deploy-workspace.xml
Normal file
|
@ -0,0 +1,54 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project basedir="../../../"
|
||||
default="deploy-workspace"
|
||||
name="Deploy Eclipse Vasc Workspace Settings"
|
||||
>
|
||||
|
||||
<property name="project.basedir" value="." />
|
||||
|
||||
<property name="launch.postfix" value=".launch" />
|
||||
<property name="launch.postfix.template" value=".launch-template" />
|
||||
<property name="launch.dir.from" value="${project.basedir}/src/eclipse/launch" />
|
||||
<property name="launch.dir.to" value="${project.basedir}/.settings/vasc/launch" />
|
||||
|
||||
<property name="config.dir.from" value="${project.basedir}/src/eclipse/settings" />
|
||||
<property name="config.file.jdt" value="org.eclipse.jdt.core.prefs" />
|
||||
<property name="config.file.jdt.template" value="org.eclipse.jdt.core.prefs-template" />
|
||||
|
||||
<target name="deploy-workspace" description="Deploying eclipse project settings.">
|
||||
|
||||
<echo>Copy Launchers</echo>
|
||||
<mkdir dir="${launch.dir.to}" />
|
||||
<copy overwrite="true" file="${launch.dir.from}/vasc-demo-server${launch.postfix.template}" tofile="${launch.dir.to}/vasc-demo-server${launch.postfix.template}"/>
|
||||
<copy overwrite="true" file="${launch.dir.from}/vasc-demo-client-swing${launch.postfix.template}" tofile="${launch.dir.to}/vasc-demo-client-swing${launch.postfix.template}"/>
|
||||
|
||||
<echo>Copy java compiler settings to projects</echo>
|
||||
<copy overwrite="true" file="${config.dir.from}/${config.file.jdt-template}" tofile="vasc-backend/vasc-backend-api/.settings/${config.file.jdt}"/>
|
||||
<copy overwrite="true" file="${config.dir.from}/${config.file.jdt-template}" tofile="vasc-backend/vasc-backend-jdbc/.settings/${config.file.jdt}"/>
|
||||
<copy overwrite="true" file="${config.dir.from}/${config.file.jdt-template}" tofile="vasc-backend/vasc-backend-jpa/.settings/${config.file.jdt}"/>
|
||||
<copy overwrite="true" file="${config.dir.from}/${config.file.jdt-template}" tofile="vasc-backend/vasc-backend-ldap/.settings/${config.file.jdt}"/>
|
||||
<copy overwrite="true" file="${config.dir.from}/${config.file.jdt-template}" tofile="vasc-backend/vasc-backend-metamodel/.settings/${config.file.jdt}"/>
|
||||
<copy overwrite="true" file="${config.dir.from}/${config.file.jdt-template}" tofile="vasc-backend/vasc-backend-mongodb/.settings/${config.file.jdt}"/>
|
||||
<copy overwrite="true" file="${config.dir.from}/${config.file.jdt-template}" tofile="vasc-backend/vasc-backend-test/.settings/${config.file.jdt}"/>
|
||||
|
||||
<copy overwrite="true" file="${config.dir.from}/${config.file.jdt-template}" tofile="vasc-core/.settings/${config.file.jdt}"/>
|
||||
|
||||
<copy overwrite="true" file="${config.dir.from}/${config.file.jdt-template}" tofile="vasc-frontend/vasc-frontend-swing/.settings/${config.file.jdt}"/>
|
||||
<copy overwrite="true" file="${config.dir.from}/${config.file.jdt-template}" tofile="vasc-frontend/vasc-frontend-swt/.settings/${config.file.jdt}"/>
|
||||
<copy overwrite="true" file="${config.dir.from}/${config.file.jdt-template}" tofile="vasc-frontend/vasc-frontend-web-export/.settings/${config.file.jdt}"/>
|
||||
<copy overwrite="true" file="${config.dir.from}/${config.file.jdt-template}" tofile="vasc-frontend/vasc-frontend-web-jsf/.settings/${config.file.jdt}"/>
|
||||
|
||||
<copy overwrite="true" file="${config.dir.from}/${config.file.jdt-template}" tofile="vasc-lib/vasc-lib-i18n/.settings/${config.file.jdt}"/>
|
||||
<copy overwrite="true" file="${config.dir.from}/${config.file.jdt-template}" tofile="vasc-lib/vasc-lib-jr40/.settings/${config.file.jdt}"/>
|
||||
<copy overwrite="true" file="${config.dir.from}/${config.file.jdt-template}" tofile="vasc-lib/vasc-lib-xpql/.settings/${config.file.jdt}"/>
|
||||
|
||||
<copy overwrite="true" file="${config.dir.from}/${config.file.jdt-template}" tofile="vasc-opt/vasc-opt-editor/.settings/${config.file.jdt}"/>
|
||||
<copy overwrite="true" file="${config.dir.from}/${config.file.jdt-template}" tofile="vasc-opt/vasc-opt-metamodel/.settings/${config.file.jdt}"/>
|
||||
|
||||
<copy overwrite="true" file="${config.dir.from}/${config.file.jdt-template}" tofile="vasc-test/vasc-test-backend/.settings/${config.file.jdt}"/>
|
||||
<copy overwrite="true" file="${config.dir.from}/${config.file.jdt-template}" tofile="vasc-test/vasc-test-frontend/.settings/${config.file.jdt}"/>
|
||||
<copy overwrite="true" file="${config.dir.from}/${config.file.jdt-template}" tofile="vasc-test/vasc-test-i18n/.settings/${config.file.jdt}"/>
|
||||
|
||||
</target>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="1"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
|
||||
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
|
||||
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
|
||||
</listAttribute>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="net.forwardfire.vasc.demo.client.swing.VascDemoSwingClient"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="vasc-demo-client-swing"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx512m"/>
|
||||
</launchConfiguration>
|
17
src/eclipse/launch-template/vasc-demo-server.launch-template
Normal file
17
src/eclipse/launch-template/vasc-demo-server.launch-template
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="1"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
|
||||
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
|
||||
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
|
||||
</listAttribute>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="net.forwardfire.vasc.demo.server.core.VascTechDemoStartup"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="vasc-demo-server"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx512m"/>
|
||||
</launchConfiguration>
|
92
src/eclipse/settings/org.eclipse.jdt.core.prefs-template
Normal file
92
src/eclipse/settings/org.eclipse.jdt.core.prefs-template
Normal file
|
@ -0,0 +1,92 @@
|
|||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
|
||||
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
|
||||
org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
|
||||
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
|
||||
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
|
||||
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
||||
org.eclipse.jdt.core.compiler.compliance=1.7
|
||||
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
|
||||
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
|
||||
org.eclipse.jdt.core.compiler.problem.deadCode=warning
|
||||
org.eclipse.jdt.core.compiler.problem.deprecation=warning
|
||||
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.emptyStatement=error
|
||||
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
|
||||
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
|
||||
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
|
||||
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
|
||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
|
||||
org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
|
||||
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
|
||||
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
|
||||
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
|
||||
org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
|
||||
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error
|
||||
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
|
||||
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
|
||||
org.eclipse.jdt.core.compiler.problem.nullReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
|
||||
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
|
||||
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
|
||||
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
|
||||
org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
|
||||
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
|
||||
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
|
||||
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
|
||||
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
|
||||
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
|
||||
org.eclipse.jdt.core.compiler.source=1.7
|
|
@ -0,0 +1,80 @@
|
|||
/*
|
||||
* 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.backend;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* AbstractVascBackendResult.
|
||||
*
|
||||
* @author Willem Cazander
|
||||
* @version 1.0 Aug 23, 2014
|
||||
*/
|
||||
abstract public class AbstractVascBackendResult<DATA_OBJECT extends Serializable> implements VascBackendResult<DATA_OBJECT> {
|
||||
|
||||
private final List<DATA_OBJECT> pageData;
|
||||
private final long totalSize;
|
||||
private final Map<String, Serializable> pageSummary;
|
||||
private final Map<String, Serializable> totalSummary;
|
||||
|
||||
public AbstractVascBackendResult(List<DATA_OBJECT> pageData,long totalSize,Map<String, Serializable> pageSummary,Map<String, Serializable> totalSummary) {
|
||||
this.pageData = pageData;
|
||||
this.totalSize = totalSize;
|
||||
this.pageSummary = pageSummary;
|
||||
this.totalSummary = totalSummary;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see net.forwardfire.vasc.backend.VascBackendResult#getPageData()
|
||||
*/
|
||||
@Override
|
||||
public List<DATA_OBJECT> getPageData() {
|
||||
return pageData;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see net.forwardfire.vasc.backend.VascBackendResult#getTotalSize()
|
||||
*/
|
||||
@Override
|
||||
public long getTotalSize() {
|
||||
return totalSize;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see net.forwardfire.vasc.backend.VascBackendResult#getPageSummary()
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Serializable> getPageSummary() {
|
||||
return pageSummary;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see net.forwardfire.vasc.backend.VascBackendResult#getTotalSummary()
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Serializable> getTotalSummary() {
|
||||
return totalSummary;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* 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.backend;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* DefaultVascBackendResult.
|
||||
*
|
||||
* @author Willem Cazander
|
||||
* @version 1.0 Aug 23, 2014
|
||||
*/
|
||||
public final class DefaultVascBackendResult<DATA_OBJECT extends Serializable> extends AbstractVascBackendResult<DATA_OBJECT> {
|
||||
|
||||
public DefaultVascBackendResult(List<DATA_OBJECT> pageData) {
|
||||
this(pageData,-1,null,null);
|
||||
}
|
||||
|
||||
public DefaultVascBackendResult(List<DATA_OBJECT> pageData, long totalSize,
|
||||
Map<String, Serializable> pageSummary,
|
||||
Map<String, Serializable> totalSummary) {
|
||||
super(pageData, totalSize, pageSummary, totalSummary);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* 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.backend;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* VascBackendResult.
|
||||
*
|
||||
* @author Willem Cazander
|
||||
* @version 1.0 Aug 23, 2014
|
||||
*/
|
||||
public interface VascBackendResult<DATA_OBJECT extends Serializable> {
|
||||
|
||||
List<DATA_OBJECT> getPageData();
|
||||
long getTotalSize();
|
||||
Map<String,Serializable> getPageSummary();
|
||||
Map<String,Serializable> getTotalSummary();
|
||||
}
|
23
vasc-backend/vasc-backend-test/.project
Normal file
23
vasc-backend/vasc-backend-test/.project
Normal file
|
@ -0,0 +1,23 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>vasc-backend-test</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
44
vasc-backend/vasc-backend-test/pom.xml
Normal file
44
vasc-backend/vasc-backend-test/pom.xml
Normal file
|
@ -0,0 +1,44 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>net.forwardfire.vasc.backend</groupId>
|
||||
<artifactId>vasc-backend</artifactId>
|
||||
<version>0.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>vasc-backend-test</artifactId>
|
||||
<name>vasc-backend-test</name>
|
||||
<description>vasc-backend-test</description>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>net.forwardfire.vasc.backend</groupId>
|
||||
<artifactId>vasc-backend-jdbc</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.forwardfire.vasc.backend</groupId>
|
||||
<artifactId>vasc-backend-metamodel</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.forwardfire.vasc.backend</groupId>
|
||||
<artifactId>vasc-backend-mongodb</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.forwardfire.vasc.backend</groupId>
|
||||
<artifactId>vasc-backend-ldap</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
<version>${h2.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<version>${postgresql.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -0,0 +1,62 @@
|
|||
package net.forwardfire.vasc.backend.test;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import net.forwardfire.vasc.backend.DefaultVascBackendController;
|
||||
import net.forwardfire.vasc.backend.DefaultVascBackendState;
|
||||
import net.forwardfire.vasc.backend.VascBackend;
|
||||
import net.forwardfire.vasc.backend.VascBackendResult;
|
||||
import net.forwardfire.vasc.backend.VascEntryFieldValue;
|
||||
import net.forwardfire.vasc.backend.metamodel.MetaModelDataContextJdbc;
|
||||
import net.forwardfire.vasc.backend.metamodel.MetaModelVascBackend;
|
||||
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
public class CrudTest extends TestCase {
|
||||
|
||||
private DefaultVascBackendController backends;
|
||||
|
||||
//@Before
|
||||
public void setup() {
|
||||
backends = new DefaultVascBackendController();
|
||||
|
||||
MetaModelDataContextJdbc mmDB = new MetaModelDataContextJdbc();
|
||||
mmDB.setConnectUrl("jdbc:postgresql://localhost/moviedb");
|
||||
mmDB.setDriverClass("org.postgresql.Driver");
|
||||
mmDB.setUsername("postgres");
|
||||
mmDB.setPassword("postgresql");
|
||||
|
||||
MetaModelVascBackend mm = new MetaModelVascBackend();
|
||||
mm.setId("mm");
|
||||
mm.setTable("country");
|
||||
mm.setTableId("country_id");
|
||||
mm.setDataContextProvider(mmDB);
|
||||
|
||||
|
||||
backends.addVascBackend(mm);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCrudBackends() throws Exception {
|
||||
|
||||
setup();
|
||||
|
||||
VascBackend<Serializable> backend = (VascBackend<Serializable>) backends.getVascBackendById("mm");
|
||||
assertNotNull(backend);
|
||||
|
||||
DefaultVascBackendState state = new DefaultVascBackendState();
|
||||
VascBackendResult<Serializable> result = backend.execute(state);
|
||||
assertNotNull(result);
|
||||
assertFalse(result.getPageData().isEmpty());
|
||||
|
||||
VascEntryFieldValue<Serializable> values = backend.provideVascEntryFieldValue();
|
||||
|
||||
for (Serializable record:result.getPageData()) {
|
||||
Object id = values.getValue("country_id", record);
|
||||
Object name = values.getValue("name", record);
|
||||
Object code = values.getValue("code", record);
|
||||
System.out.println("line: "+id+" name: "+name+" code: "+code);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* @author willemc
|
||||
*
|
||||
*/
|
||||
package net.forwardfire.vasc.backend.test;
|
Loading…
Reference in a new issue