Refactored demo section to single app layout.
This commit is contained in:
parent
b3635cf64d
commit
4bd244f4e5
337 changed files with 1630 additions and 1883 deletions
|
|
@ -3,7 +3,7 @@
|
|||
<parent>
|
||||
<artifactId>vasc</artifactId>
|
||||
<groupId>net.forwardfire.vasc</groupId>
|
||||
<version>0.4.1-SNAPSHOT</version>
|
||||
<version>0.4.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>vasc-core</artifactId>
|
||||
<name>vasc-core</name>
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.x4o</groupId>
|
||||
<artifactId>x4o-core</artifactId>
|
||||
<artifactId>x4o-driver</artifactId>
|
||||
<version>${x4o.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
@ -20,8 +20,8 @@
|
|||
<version>${x4o.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.forwardfire.vasc</groupId>
|
||||
<artifactId>vasc-xpql</artifactId>
|
||||
<groupId>net.forwardfire.vasc.lib</groupId>
|
||||
<artifactId>vasc-lib-xpql</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import net.forwardfire.vasc.core.VascEntryField;
|
|||
import net.forwardfire.vasc.core.entry.VascEntryFieldValue;
|
||||
import net.forwardfire.vasc.core.VascException;
|
||||
|
||||
import org.x4o.xml.impl.DefaultElementObjectPropertyValue;
|
||||
import org.x4o.xml.element.DefaultElementObjectPropertyValue;
|
||||
|
||||
/**
|
||||
* BeanVascEntryFieldValue provides get/set support for bean based backends.
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@
|
|||
|
||||
package net.forwardfire.vasc.core;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.x4o.xml.conv.ObjectConverter;
|
||||
|
||||
import net.forwardfire.vasc.core.base.VascBaseIdLocal;
|
||||
|
|
@ -41,6 +43,7 @@ public interface VascEntryFieldTypeLocal extends VascEntryFieldType,VascBaseIdLo
|
|||
|
||||
public void setAutoDetectClass(Class<?> classObject);
|
||||
|
||||
public List<VascValidator> getVascValidators();
|
||||
public void addVascValidator(VascValidator vascValidator);
|
||||
public void removeVascValidator(VascValidator vascValidator);
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ import net.forwardfire.vasc.core.VascEntryField;
|
|||
import net.forwardfire.vasc.core.entry.VascEntryFieldValue;
|
||||
import net.forwardfire.vasc.core.VascException;
|
||||
|
||||
import org.x4o.xml.impl.DefaultElementObjectPropertyValue;
|
||||
import org.x4o.xml.element.DefaultElementObjectPropertyValue;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
|
|||
|
|
@ -45,11 +45,9 @@ public class DefaultVascEntryFieldTypeController implements VascEntryFieldTypeCo
|
|||
|
||||
public DefaultVascEntryFieldTypeController() throws VascException {
|
||||
try {
|
||||
FieldTypeParser parser = new FieldTypeParser();
|
||||
parser.parseVascFieldTypes();
|
||||
|
||||
FieldTypeDriver driver = new FieldTypeDriver();
|
||||
vascEntryFieldTypes = new HashMap<String,VascEntryFieldTypeLocal>(35);
|
||||
for(VascEntryFieldTypeLocal v:parser.getTypes()) {
|
||||
for(VascEntryFieldTypeLocal v:driver.getVascFieldTypes()) {
|
||||
vascEntryFieldTypes.put(v.getId(),v);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
|
|
|||
|
|
@ -22,9 +22,9 @@
|
|||
|
||||
package net.forwardfire.vasc.impl.type;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.InvalidPropertiesFormatException;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
|
|
@ -32,12 +32,16 @@ import javax.xml.parsers.ParserConfigurationException;
|
|||
import net.forwardfire.vasc.core.VascEntryFieldTypeLocal;
|
||||
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import org.x4o.xml.X4ODriver;
|
||||
import org.x4o.xml.X4ODriverManager;
|
||||
import org.x4o.xml.conv.DefaultObjectConverterProvider;
|
||||
import org.x4o.xml.conv.ObjectConverter;
|
||||
import org.x4o.xml.core.X4OParser;
|
||||
import org.x4o.xml.core.config.X4OLanguageProperty;
|
||||
import org.x4o.xml.element.Element;
|
||||
import org.x4o.xml.io.X4OConnectionException;
|
||||
import org.x4o.xml.io.X4OReaderSession;
|
||||
import org.x4o.xml.lang.X4OLanguageSession;
|
||||
import org.x4o.xml.lang.X4OLanguageSessionLocal;
|
||||
import org.x4o.xml.lang.phase.X4OPhaseException;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -45,30 +49,35 @@ import org.x4o.xml.element.Element;
|
|||
* @author Willem Cazander
|
||||
* @version 1.0 Sep 11, 2008
|
||||
*/
|
||||
public class FieldTypeParser extends X4OParser {
|
||||
public class FieldTypeDriver extends X4ODriver<Object> {
|
||||
|
||||
static public final String FIELD_TYPE_LANGUAGE = "fieldtype";
|
||||
static public final String LANGUAGE_NAME = "fieldtype";
|
||||
static public final String[] LANGUAGE_VERSIONS = new String[]{X4ODriver.DEFAULT_LANGUAGE_VERSION};
|
||||
|
||||
/**
|
||||
*
|
||||
* @param language
|
||||
* @throws IOException
|
||||
* @throws InvalidPropertiesFormatException
|
||||
* @throws Exception
|
||||
*/
|
||||
public FieldTypeParser() throws InvalidPropertiesFormatException, IOException {
|
||||
super(FIELD_TYPE_LANGUAGE);
|
||||
setProperty(X4OLanguageProperty.PHASE_SKIP_RELEASE.toUri(), true);
|
||||
static public FieldTypeDriver getInstance() {
|
||||
return (FieldTypeDriver)X4ODriverManager.getX4ODriver(LANGUAGE_NAME);
|
||||
}
|
||||
|
||||
public void parseVascFieldTypes() throws IOException, SecurityException, NullPointerException, ParserConfigurationException, SAXException {
|
||||
parseResource("META-INF/fieldtypes.xml");
|
||||
@Override
|
||||
public String getLanguageName() {
|
||||
return LANGUAGE_NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getLanguageVersions() {
|
||||
return LANGUAGE_VERSIONS;
|
||||
}
|
||||
|
||||
public List<VascEntryFieldTypeLocal> getTypes() {
|
||||
public List<VascEntryFieldTypeLocal> getVascFieldTypes() throws FileNotFoundException, SecurityException, NullPointerException, ParserConfigurationException, SAXException, IOException, X4OPhaseException, X4OConnectionException {
|
||||
X4OReaderSession<Object> reader = createReaderSession();
|
||||
//reader.setProperty(X4OLanguageProperty.PHASE_SKIP_RELEASE.toUri(), true);
|
||||
reader.addPhaseSkip("READ_RELEASE");
|
||||
X4OLanguageSession session = reader.readResourceSession("META-INF/fieldtypes.xml");
|
||||
//((X4OLanguageSessionLocal)session).addPhaseSkip("READ_RELEASE");// TODO: fixme
|
||||
|
||||
List<VascEntryFieldTypeLocal> result = new ArrayList<VascEntryFieldTypeLocal>(40);
|
||||
DefaultObjectConverterProvider convProvider = new DefaultObjectConverterProvider(true);
|
||||
for (Element e:getDriver().getElementLanguage().getRootElement().getChilderen()) {
|
||||
for (Element e:session.getRootElement().getChilderen()) {
|
||||
VascEntryFieldTypeLocal a = (VascEntryFieldTypeLocal)e.getElementObject();
|
||||
if (a.getObjectConverter()==null && a.getAutoDetectClass()!=null) {
|
||||
ObjectConverter conv = convProvider.getObjectConverterForClass(a.getAutoDetectClass());
|
||||
|
|
@ -76,6 +85,7 @@ public class FieldTypeParser extends X4OParser {
|
|||
}
|
||||
result.add(a);
|
||||
}
|
||||
reader.releaseSession(session);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
@ -47,9 +47,9 @@ import net.forwardfire.vasc.impl.DefaultVascEntryField;
|
|||
import net.forwardfire.vasc.validators.VascValidator;
|
||||
import net.forwardfire.vasc.validators.VascValidatorClassParser;
|
||||
|
||||
import org.x4o.xml.core.config.X4OLanguageClassLoader;
|
||||
import org.x4o.xml.element.AbstractElement;
|
||||
import org.x4o.xml.element.ElementException;
|
||||
import org.x4o.xml.lang.X4OLanguageClassLoader;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -269,7 +269,7 @@ public class AnnotationParserElement extends AbstractElement {
|
|||
field.addVascValidator(v); // todo: merg with already added list of template so we can override.
|
||||
}
|
||||
|
||||
VascController vascController = VascParser.getVascController(this.getElementLanguage());
|
||||
VascController vascController = VascDriver.getVascController(this.getLanguageSession());
|
||||
VascChoices vc = parser.getVascChoices (modelClass, field.getId());
|
||||
if (vc!=null) {
|
||||
VascEntryFieldType type = vascController.getVascEntryFieldTypeController().getVascEntryFieldTypeById("ListField");
|
||||
|
|
|
|||
|
|
@ -22,9 +22,11 @@
|
|||
|
||||
package net.forwardfire.vasc.impl.x4o;
|
||||
|
||||
|
||||
import net.forwardfire.vasc.core.VascEntryField;
|
||||
import net.forwardfire.vasc.core.VascEntryFieldLocal;
|
||||
import net.forwardfire.vasc.core.VascEntryFieldType;
|
||||
import net.forwardfire.vasc.core.VascEntryListOptionLocal;
|
||||
import net.forwardfire.vasc.core.VascEntryLocal;
|
||||
import net.forwardfire.vasc.core.ui.VascSelectItemModel;
|
||||
|
||||
import org.x4o.xml.element.AbstractElementBindingHandler;
|
||||
|
|
@ -38,7 +40,7 @@ import org.x4o.xml.element.ElementBindingHandlerException;
|
|||
* @author Willem Cazander
|
||||
* @version 1.0 Apr 02, 2009
|
||||
*/
|
||||
public class SelectItemModelBindingHandler extends AbstractElementBindingHandler {
|
||||
public class SelectItemModelBindingHandler extends AbstractElementBindingHandler<VascEntryField> {
|
||||
|
||||
private final static Class<?>[] CLASSES_CHILD = new Class[] {
|
||||
VascSelectItemModel.class
|
||||
|
|
@ -58,16 +60,16 @@ public class SelectItemModelBindingHandler extends AbstractElementBindingHandler
|
|||
return CLASSES_CHILD;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.x4o.xml.element.ElementBindingHandler#doBind(java.lang.Object, java.lang.Object, org.x4o.xml.element.Element)
|
||||
*/
|
||||
public void doBind(Object parentObject, Object childObject,Element childElement) throws ElementBindingHandlerException {
|
||||
if (parentObject instanceof VascEntryField) {
|
||||
VascEntryField parent = (VascEntryField)parentObject;
|
||||
if (childObject instanceof VascSelectItemModel) {
|
||||
VascEntryFieldType type = parent.getVascEntryFieldType();
|
||||
type.setDataObject(childObject);
|
||||
}
|
||||
@Override
|
||||
public void bindChild(Element childElement, VascEntryField parentObject,Object childObject) throws ElementBindingHandlerException {
|
||||
if (childObject instanceof VascSelectItemModel) {
|
||||
VascEntryFieldType type = parentObject.getVascEntryFieldType();
|
||||
type.setDataObject(childObject);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createChilderen(Element parentElement, VascEntryField parentObject) throws ElementBindingHandlerException {
|
||||
createChild(parentElement, parentObject.getVascEntryFieldType().getDataObject());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ public class SetParameterElement extends AbstractElement {
|
|||
VascEntry entry = (VascEntry)getParent().getElementObject();
|
||||
logger.fine("Setting parameter name: "+name+" value: "+value+" type: "+type);
|
||||
|
||||
if ("setUserParameter".equals(getElementClass().getTag())) {
|
||||
if ("setUserParameter".equals(getElementClass().getId())) {
|
||||
if (value==null) {
|
||||
value="id"; // default to ids
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ public class VascBackendElementConfigurator extends AbstractElementConfigurator
|
|||
|
||||
VascBackend backend = (VascBackend)element.getElementObject();
|
||||
|
||||
VascController vascController = VascParser.getVascController(element.getElementLanguage());
|
||||
VascController vascController = VascDriver.getVascController(element.getLanguageSession());
|
||||
VascBackendController backendController = vascController.getVascBackendController();
|
||||
|
||||
if (backendController instanceof VascBackendControllerLocal) {
|
||||
|
|
|
|||
|
|
@ -22,54 +22,48 @@
|
|||
|
||||
package net.forwardfire.vasc.impl.x4o;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.el.ValueExpression;
|
||||
|
||||
import net.forwardfire.vasc.core.VascController;
|
||||
|
||||
import org.x4o.xml.core.X4OParser;
|
||||
import org.x4o.xml.element.ElementLanguage;
|
||||
import org.x4o.xml.X4ODriver;
|
||||
import org.x4o.xml.X4ODriverManager;
|
||||
import org.x4o.xml.io.X4OReader;
|
||||
import org.x4o.xml.lang.X4OLanguageSession;
|
||||
|
||||
/**
|
||||
* VascParser the vasc xml streams.
|
||||
* VascDriver the vasc xml streams.
|
||||
*
|
||||
* @author Willem Cazander
|
||||
* @version 1.0 Oct 27, 2008
|
||||
*/
|
||||
public class VascParser extends X4OParser {
|
||||
public class VascDriver extends X4ODriver<VascController> {
|
||||
|
||||
static public String VASC_LANGUAGE = "vasc";
|
||||
private VascController vascController = null;
|
||||
private Map<String,Object> beanMap = null;
|
||||
static final public String LANGUAGE_NAME = "vasc";
|
||||
static public final String[] LANGUAGE_VERSIONS = new String[]{X4ODriver.DEFAULT_LANGUAGE_VERSION};
|
||||
static final public String EL_VASC_CONTROLLER = "el_vasc_controller";
|
||||
|
||||
/**
|
||||
* @see X4OParser#X4OParser(String)
|
||||
*/
|
||||
public VascParser(VascController vascController) {
|
||||
super(VASC_LANGUAGE);
|
||||
if (vascController==null) {
|
||||
throw new NullPointerException("vascController may not be null");
|
||||
}
|
||||
this.vascController=vascController;
|
||||
addELBeanInstance("vascController", vascController);
|
||||
static public VascDriver getInstance() {
|
||||
return (VascDriver)X4ODriverManager.getX4ODriver(LANGUAGE_NAME);
|
||||
}
|
||||
|
||||
protected VascParser() {
|
||||
super(VASC_LANGUAGE);
|
||||
@Override
|
||||
public String getLanguageName() {
|
||||
return LANGUAGE_NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getLanguageVersions() {
|
||||
return LANGUAGE_VERSIONS;
|
||||
}
|
||||
|
||||
public void addELBean(String name,Object object) {
|
||||
beanMap.put(name,object);
|
||||
public void addVascController(X4OReader<VascController> reader,VascController controller) {
|
||||
reader.addELBeanInstance(EL_VASC_CONTROLLER, controller);
|
||||
}
|
||||
|
||||
public VascController getVascController() {
|
||||
return vascController;
|
||||
}
|
||||
|
||||
static public VascController getVascController(ElementLanguage context) {
|
||||
ValueExpression ee = context.getExpressionFactory().createValueExpression(context.getELContext(),"${vascController}", VascController.class);
|
||||
VascController con = (VascController)ee.getValue(context.getELContext());
|
||||
static public VascController getVascController(X4OLanguageSession context) {
|
||||
ValueExpression ee = context.getExpressionLanguageFactory().createValueExpression(context.getExpressionLanguageContext(),"${"+EL_VASC_CONTROLLER+"}", VascController.class);
|
||||
VascController con = (VascController)ee.getValue(context.getExpressionLanguageContext());
|
||||
return con;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -27,9 +27,9 @@ import net.forwardfire.vasc.core.actions.ColumnVascActionLocal;
|
|||
import net.forwardfire.vasc.core.actions.GlobalVascActionLocal;
|
||||
import net.forwardfire.vasc.core.actions.RowVascActionLocal;
|
||||
|
||||
import org.x4o.xml.core.config.X4OLanguageClassLoader;
|
||||
import org.x4o.xml.element.AbstractElement;
|
||||
import org.x4o.xml.element.ElementException;
|
||||
import org.x4o.xml.lang.X4OLanguageClassLoader;
|
||||
|
||||
/**
|
||||
* Handed the eventListener xml tag.
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ public class VascEntryElementConfigurator extends AbstractElementConfigurator {
|
|||
*/
|
||||
public void doConfigElement(Element element) throws ElementConfiguratorException {
|
||||
Object elementObject = element.getElementObject();
|
||||
VascController vascController = VascParser.getVascController(element.getElementLanguage());
|
||||
VascController vascController = VascDriver.getVascController(element.getLanguageSession());
|
||||
VascEntryController entryController = vascController.getVascEntryController();
|
||||
|
||||
if (entryController instanceof VascEntryControllerLocal) {
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ import org.x4o.xml.element.ElementBindingHandlerException;
|
|||
* @author Willem Cazander
|
||||
* @version 1.0 Apr 02, 2009
|
||||
*/
|
||||
public class VascEntryFieldBindingHandler extends AbstractElementBindingHandler {
|
||||
public class VascEntryFieldBindingHandler extends AbstractElementBindingHandler<VascEntryLocal> {
|
||||
|
||||
private final static Class<?>[] CLASSES_CHILD = new Class[] {
|
||||
VascEntryFieldLocal.class,
|
||||
|
|
@ -58,20 +58,25 @@ public class VascEntryFieldBindingHandler extends AbstractElementBindingHandler
|
|||
return CLASSES_CHILD;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.x4o.xml.element.ElementBindingHandler#doBind(java.lang.Object, java.lang.Object, org.x4o.xml.element.Element)
|
||||
*/
|
||||
public void doBind(Object parentObject, Object childObject,Element childElement) throws ElementBindingHandlerException {
|
||||
if (parentObject instanceof VascEntryLocal) {
|
||||
VascEntryLocal parent = (VascEntryLocal)parentObject;
|
||||
if (childObject instanceof VascEntryFieldLocal & (childObject instanceof VascEntryListOptionLocal)==false) {
|
||||
VascEntryFieldLocal child = (VascEntryFieldLocal) childObject;
|
||||
parent.addVascEntryField(child);
|
||||
}
|
||||
if (childObject instanceof VascEntryListOptionLocal) {
|
||||
VascEntryListOptionLocal child = (VascEntryListOptionLocal) childObject;
|
||||
parent.addVascEntryListOption(child);
|
||||
}
|
||||
@Override
|
||||
public void bindChild(Element childElement, VascEntryLocal parentObject,Object childObject) throws ElementBindingHandlerException {
|
||||
if (childObject instanceof VascEntryFieldLocal & (childObject instanceof VascEntryListOptionLocal)==false) {
|
||||
VascEntryFieldLocal child = (VascEntryFieldLocal) childObject;
|
||||
parentObject.addVascEntryField(child);
|
||||
}
|
||||
if (childObject instanceof VascEntryListOptionLocal) {
|
||||
VascEntryListOptionLocal child = (VascEntryListOptionLocal) childObject;
|
||||
parentObject.addVascEntryListOption(child);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createChilderen(Element parentElement, VascEntryLocal parentObject) throws ElementBindingHandlerException {
|
||||
for (VascEntryFieldLocal field:parentObject.getVascEntryFieldsLocal()) {
|
||||
createChild(parentElement, field);
|
||||
}
|
||||
for (VascEntryListOptionLocal field:parentObject.getVascEntryListOptionsLocal()) {
|
||||
createChild(parentElement, field);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ public class VascEntryFieldConfigurator extends AbstractElementConfigurator {
|
|||
if ("".equals(fieldID)) {
|
||||
fieldID = "TextField"; // ??
|
||||
}
|
||||
VascController controller = VascParser.getVascController(element.getElementLanguage());
|
||||
VascController controller = VascDriver.getVascController(element.getLanguageSession());
|
||||
VascEntryFieldType result = controller.getVascEntryFieldTypeController().getVascEntryFieldTypeById(fieldID);
|
||||
((VascEntryFieldLocal)element.getElementObject()).setVascEntryFieldType(result);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,13 +28,13 @@ import java.util.logging.Logger;
|
|||
import net.forwardfire.vasc.core.VascEntryField;
|
||||
import net.forwardfire.vasc.core.VascEntryFieldType;
|
||||
|
||||
import org.x4o.xml.core.X4OPhase;
|
||||
import org.x4o.xml.element.AbstractElement;
|
||||
import org.x4o.xml.element.ElementException;
|
||||
import org.x4o.xml.lang.phase.X4OPhase;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* VascEntryFieldTypeElement
|
||||
*
|
||||
* @author Willem Cazander
|
||||
* @version 1.0 Mar 27, 2009
|
||||
|
|
@ -56,6 +56,7 @@ public class VascEntryFieldTypeElement extends AbstractElement {
|
|||
VascEntryFieldType type = field.getVascEntryFieldType();
|
||||
setElementObject(type);
|
||||
logger.info("Readding the element for reparsing");
|
||||
getElementLanguage().addDirtyElement(this, X4OPhase.startX4OPhase);
|
||||
X4OPhase startX4OPhase = getLanguageSession().getLanguage().getPhaseManager().getPhase("READ_CONFIG_ELEMENT"); // TODO: back to enum ?
|
||||
getLanguageSession().addDirtyElement(this, startX4OPhase);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,46 +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.x4o;
|
||||
|
||||
import org.x4o.xml.core.X4OParserSupport;
|
||||
import org.x4o.xml.core.X4OParserSupportException;
|
||||
import org.x4o.xml.element.ElementLanguage;
|
||||
|
||||
/**
|
||||
* VascParserSupport the vasc xml config language.
|
||||
*
|
||||
* @author Willem Cazander
|
||||
* @version 1.0 Aug 25, 2012
|
||||
*/
|
||||
public class VascParserSupport implements X4OParserSupport {
|
||||
|
||||
/**
|
||||
* Loads the ElementLanguage of this language parser for support.
|
||||
* @return The loaded ElementLanguage.
|
||||
* @see org.x4o.xml.core.X4OParserSupport#loadElementLanguageSupport()
|
||||
*/
|
||||
public ElementLanguage loadElementLanguageSupport() throws X4OParserSupportException {
|
||||
VascParser parser = new VascParser();
|
||||
return parser.loadElementLanguageSupport();
|
||||
}
|
||||
}
|
||||
|
|
@ -5,24 +5,23 @@
|
|||
xmlns:root="http://eld.x4o.org/xml/ns/eld-root"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://eld.x4o.org/xml/ns/eld-root http://eld.x4o.org/xml/ns/eld-root-1.0.xsd"
|
||||
providerName="vasc.forwardfire.net"
|
||||
name="Vasc Field Type Language"
|
||||
providerHost="vasc.forwardfire.net"
|
||||
providerName="Vasc Field Type Language"
|
||||
id="mod-fieldtype-lang"
|
||||
>
|
||||
|
||||
<eld:classBindingHandler id="VascEntryFieldType-VascValidator"
|
||||
parentClass="net.forwardfire.vasc.core.VascEntryFieldType"
|
||||
childClass="net.forwardfire.vasc.validators.VascValidator"
|
||||
method="addVascValidator"/>
|
||||
parentClass="net.forwardfire.vasc.core.VascEntryFieldTypeLocal" childClass="net.forwardfire.vasc.validators.VascValidator"
|
||||
addMethod="addVascValidator" getMethod="getVascValidators"
|
||||
/>
|
||||
<eld:classBindingHandler id="VascEntryFieldType-ObjectConverter"
|
||||
parentClass="net.forwardfire.vasc.core.VascEntryFieldType"
|
||||
childClass="org.x4o.xml.conv.ObjectConverter"
|
||||
method="setObjectConverter"/>
|
||||
parentClass="net.forwardfire.vasc.core.VascEntryFieldTypeLocal" childClass="org.x4o.xml.conv.ObjectConverter"
|
||||
addMethod="setObjectConverter" getMethod="setObjectConverter"
|
||||
/>
|
||||
<eld:classBindingHandler id="ObjectConverter-ObjectConverter"
|
||||
parentClass="org.x4o.xml.conv.ObjectConverter"
|
||||
childClass="org.x4o.xml.conv.ObjectConverter"
|
||||
method="addObjectConverter"/>
|
||||
|
||||
parentClass="org.x4o.xml.conv.ObjectConverter" childClass="org.x4o.xml.conv.ObjectConverter"
|
||||
addMethod="addObjectConverter" getMethod="getObjectConverters"
|
||||
/>
|
||||
|
||||
<eld:namespace
|
||||
uri="http://fieldtype.vasc.forwardfire.net/xml/ns/fieldtype-root"
|
||||
|
|
|
|||
|
|
@ -6,6 +6,6 @@
|
|||
>
|
||||
<language version="1.0">
|
||||
<eld-resource>fieldtype-lang.eld</eld-resource>
|
||||
<sibling-loader>org.x4o.xml.meta.MetaLanguageSiblingLoader</sibling-loader>
|
||||
<sibling-loader>org.x4o.xml.lang.meta.MetaLanguageSiblingLoader</sibling-loader>
|
||||
</language>
|
||||
</modules>
|
||||
|
|
|
|||
|
|
@ -5,20 +5,44 @@
|
|||
xmlns:root="http://eld.x4o.org/xml/ns/eld-root"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://eld.x4o.org/xml/ns/eld-root http://eld.x4o.org/xml/ns/eld-root-1.0.xsd"
|
||||
providerName="vasc.forwardfire.net"
|
||||
name="Vasc Config Language"
|
||||
providerHost="vasc.forwardfire.net"
|
||||
providerName="Vasc Config Language"
|
||||
id="vasc-lang"
|
||||
>
|
||||
|
||||
<eld:classBindingHandler id="VascEntryLocal-VascEntryFieldSet" parentClass="net.forwardfire.vasc.core.VascEntryLocal" childClass="net.forwardfire.vasc.core.VascEntryFieldSet" method="addVascEntryFieldSet"/>
|
||||
<eld:classBindingHandler id="VascEntryLocal-VascEntryLink" parentClass="net.forwardfire.vasc.core.VascEntryLocal" childClass="net.forwardfire.vasc.core.VascEntryLinkLocal" method="addVascEntryLink"/>
|
||||
<eld:classBindingHandler id="VascEntryLocal-VascBackendFilter" parentClass="net.forwardfire.vasc.core.VascEntryLocal" childClass="net.forwardfire.vasc.backend.VascBackendFilter" method="addVascBackendFilter"/>
|
||||
<eld:classBindingHandler id="VascEntryLocal-GlobalVascAction" parentClass="net.forwardfire.vasc.core.VascEntryLocal" childClass="net.forwardfire.vasc.core.actions.GlobalVascAction" method="addGlobalAction"/>
|
||||
<eld:classBindingHandler id="VascEntryLocal-RowVascAction" parentClass="net.forwardfire.vasc.core.VascEntryLocal" childClass="net.forwardfire.vasc.core.actions.RowVascAction" method="addRowAction"/>
|
||||
<eld:classBindingHandler id="VascEntryLocal-ColumnVascAction" parentClass="net.forwardfire.vasc.core.VascEntryLocal" childClass="net.forwardfire.vasc.core.actions.ColumnVascAction" method="addColumnAction"/>
|
||||
<eld:classBindingHandler id="VascEntryFieldLocal-VascValidator" parentClass="net.forwardfire.vasc.core.VascEntryFieldLocal" childClass="net.forwardfire.vasc.validators.VascValidator" method="addVascValidator"/>
|
||||
<eld:bindingHandler id="SelectItemModelBindingHandler" bean.class="net.forwardfire.vasc.impl.x4o.SelectItemModelBindingHandler"/>
|
||||
<eld:bindingHandler id="VascEntryFieldBindingHandler" bean.class="net.forwardfire.vasc.impl.x4o.VascEntryFieldBindingHandler"/>
|
||||
<eld:classBindingHandler id="VascEntryLocal-VascEntryFieldSet"
|
||||
parentClass="net.forwardfire.vasc.core.VascEntryLocal" childClass="net.forwardfire.vasc.core.VascEntryFieldSet"
|
||||
addMethod="addVascEntryFieldSet" getMethod="getVascEntryFieldSetsLocal"
|
||||
/>
|
||||
<eld:classBindingHandler id="VascEntryLocal-VascEntryLink"
|
||||
parentClass="net.forwardfire.vasc.core.VascEntryLocal" childClass="net.forwardfire.vasc.core.VascEntryLinkLocal"
|
||||
addMethod="addVascEntryLink" getMethod="getVascEntryLinksLocal"
|
||||
/>
|
||||
<eld:classBindingHandler id="VascEntryLocal-VascBackendFilter"
|
||||
parentClass="net.forwardfire.vasc.core.VascEntryLocal" childClass="net.forwardfire.vasc.backend.VascBackendFilter"
|
||||
addMethod="addVascBackendFilter" getMethod="getVascBackendFilters"
|
||||
/>
|
||||
<eld:classBindingHandler id="VascEntryLocal-GlobalVascAction"
|
||||
parentClass="net.forwardfire.vasc.core.VascEntryLocal" childClass="net.forwardfire.vasc.core.actions.GlobalVascAction"
|
||||
addMethod="addGlobalAction" getMethod="getGlobalActionsLocal"
|
||||
/>
|
||||
<eld:classBindingHandler id="VascEntryLocal-RowVascAction"
|
||||
parentClass="net.forwardfire.vasc.core.VascEntryLocal" childClass="net.forwardfire.vasc.core.actions.RowVascAction"
|
||||
addMethod="addRowAction" getMethod="getRowActionsLocal"
|
||||
/>
|
||||
<eld:classBindingHandler id="VascEntryLocal-ColumnVascAction"
|
||||
parentClass="net.forwardfire.vasc.core.VascEntryLocal" childClass="net.forwardfire.vasc.core.actions.ColumnVascAction"
|
||||
addMethod="addColumnAction" getMethod="getColumnActionsLocal"
|
||||
/>
|
||||
<eld:classBindingHandler id="VascEntryFieldLocal-VascValidator"
|
||||
parentClass="net.forwardfire.vasc.core.VascEntryFieldLocal" childClass="net.forwardfire.vasc.validators.VascValidator"
|
||||
addMethod="addVascValidator" getMethod="getVascValidators"
|
||||
/>
|
||||
<eld:bindingHandler id="SelectItemModelBindingHandler"
|
||||
bean.class="net.forwardfire.vasc.impl.x4o.SelectItemModelBindingHandler"
|
||||
/>
|
||||
<eld:bindingHandler id="VascEntryFieldBindingHandler"
|
||||
bean.class="net.forwardfire.vasc.impl.x4o.VascEntryFieldBindingHandler"
|
||||
/>
|
||||
|
||||
<eld:elementInterface id="VascBackend" interfaceClass="net.forwardfire.vasc.backend.VascBackend">
|
||||
<eld:configurator id="VascBackendElementConfigurator" bean.class="net.forwardfire.vasc.impl.x4o.VascBackendElementConfigurator" configAction="true"/>
|
||||
|
|
@ -60,7 +84,7 @@
|
|||
<eld:elementParent tag="root" uri="http://vasc.forwardfire.net/xml/ns/vasc-root"/>
|
||||
</eld:element>
|
||||
<eld:element tag="field" objectClass="net.forwardfire.vasc.impl.DefaultVascEntryField" elementClass="net.forwardfire.vasc.impl.x4o.VascEntryFieldElement">
|
||||
<eld:attribute name="vascEntryFieldType" runBeanFill="false"/>
|
||||
<eld:attribute name="vascEntryFieldType" runBeanValue="false"/>
|
||||
<eld:configurator id="field-VascEntryFieldConfigurator" bean.class="net.forwardfire.vasc.impl.x4o.VascEntryFieldConfigurator" />
|
||||
</eld:element>
|
||||
|
||||
|
|
@ -81,7 +105,7 @@
|
|||
|
||||
|
||||
<eld:element tag="fieldSet" objectClass="net.forwardfire.vasc.impl.DefaultVascEntryFieldSet" elementClass="net.forwardfire.vasc.impl.x4o.VascEntryFieldSetElement">
|
||||
<eld:attribute name="vascEntryFieldIds" runBeanFill="false"/>
|
||||
<eld:attribute name="vascEntryFieldIds" runBeanValue="false"/>
|
||||
</eld:element>
|
||||
|
||||
<eld:element tag="link" objectClass="net.forwardfire.vasc.impl.DefaultVascEntryLink">
|
||||
|
|
@ -93,7 +117,7 @@
|
|||
<eld:element tag="linkCreateFieldValue" elementClass="net.forwardfire.vasc.impl.x4o.VascEntryLinkParameterElement"/>
|
||||
|
||||
<eld:element tag="listOption" objectClass="net.forwardfire.vasc.impl.DefaultVascEntryListOption" elementClass="net.forwardfire.vasc.impl.x4o.VascEntryFieldElement">
|
||||
<eld:attribute name="vascEntryFieldType" runBeanFill="false"/>
|
||||
<eld:attribute name="vascEntryFieldType" runBeanValue="false"/>
|
||||
<eld:configurator id="listOption-VascEntryFieldConfigurator" bean.class="net.forwardfire.vasc.impl.x4o.VascEntryFieldConfigurator" />
|
||||
</eld:element>
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,6 @@
|
|||
>
|
||||
<language version="1.0">
|
||||
<eld-resource>vasc-lang.eld</eld-resource>
|
||||
<sibling-loader>org.x4o.xml.meta.MetaLanguageSiblingLoader</sibling-loader>
|
||||
<sibling-loader>org.x4o.xml.lang.meta.MetaLanguageSiblingLoader</sibling-loader>
|
||||
</language>
|
||||
</modules>
|
||||
|
|
|
|||
33
vasc-core/src/main/resources/META-INF/x4o-drivers.xml
Normal file
33
vasc-core/src/main/resources/META-INF/x4o-drivers.xml
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
|
||||
Copyright (c) 2004-2013, Willem Cazander
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this list of conditions and the
|
||||
following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
-->
|
||||
<drivers version="1.0"
|
||||
xmlns="http://language.x4o.org/xml/ns/drivers"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://language.x4o.org/xml/ns/drivers http://language.x4o.org/xml/ns/drivers-1.0.xsd"
|
||||
>
|
||||
<driver language="vasc" className="net.forwardfire.vasc.impl.x4o.VascDriver"/>
|
||||
<driver language="fieldtype" className="net.forwardfire.vasc.impl.type.FieldTypeDriver"/>
|
||||
</drivers>
|
||||
|
|
@ -22,11 +22,8 @@
|
|||
|
||||
package net.forwardfire.vasc;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.logging.LogManager;
|
||||
|
||||
import net.forwardfire.vasc.core.VascEntryFieldType;
|
||||
import net.forwardfire.vasc.impl.type.FieldTypeParser;
|
||||
import net.forwardfire.vasc.impl.type.FieldTypeDriver;
|
||||
|
||||
|
||||
|
||||
|
|
@ -39,27 +36,16 @@ import junit.framework.TestCase;
|
|||
* @version 1.0 Jul 24, 2006
|
||||
*/
|
||||
public class FieldTypesTest extends TestCase {
|
||||
|
||||
public void setUp() throws Exception {
|
||||
// enable all logs
|
||||
// //InputStream loggingProperties = this.getClass().getResourceAsStream("/META-INF/logging.properties");
|
||||
// LogManager.getLogManager().readConfiguration( loggingProperties );
|
||||
// loggingProperties.close();
|
||||
}
|
||||
|
||||
public void tearDown() throws Exception {
|
||||
}
|
||||
public void testNull() throws Exception {
|
||||
assertEquals(true, true);
|
||||
}
|
||||
|
||||
public void testParse() throws Exception {
|
||||
FieldTypeParser p = new FieldTypeParser();
|
||||
p.parseVascFieldTypes();
|
||||
|
||||
System.out.println("Got types;");
|
||||
for (VascEntryFieldType t:p.getTypes()) {
|
||||
System.out.println("t= "+t.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
public void testNull() throws Exception {
|
||||
assertEquals(true, true);
|
||||
}
|
||||
|
||||
public void testParse() throws Exception {
|
||||
FieldTypeDriver p = new FieldTypeDriver();
|
||||
System.out.println("Got types;");
|
||||
for (VascEntryFieldType t:p.getVascFieldTypes()) {
|
||||
System.out.println("t= "+t.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue