|
From: <tri...@us...> - 2007-12-11 21:55:22
|
Revision: 194
http://equanda.svn.sourceforge.net/equanda/?rev=194&view=rev
Author: triathlon98
Date: 2007-12-11 13:55:20 -0800 (Tue, 11 Dec 2007)
Log Message:
-----------
fix typos
Modified Paths:
--------------
trunk/equanda-generate/src/main/java/org/equanda/generate/EquandaResourceLoader.java
trunk/equanda-generate/src/main/java/org/equanda/generate/Generator.java
trunk/equanda-generate/src/main/java/org/equanda/persistence/xml/OMField.java
Added Paths:
-----------
trunk/equanda-generate/src/main/velocity/t5gui/
trunk/equanda-generate/src/main/velocity/t5gui/base/
trunk/equanda-generate/src/main/velocity/t5gui/base/EditPageBase.java.vm
trunk/equanda-generate/src/main/velocity/t5gui/base/SelectComponentBase.java.vm
trunk/equanda-generate/src/main/velocity/t5gui/base/SelectPageBase.java.vm
trunk/equanda-generate/src/main/velocity/t5gui/components/
trunk/equanda-generate/src/main/velocity/t5gui/components/Display.java.vm
trunk/equanda-generate/src/main/velocity/t5gui/components/Display.tml.vm
trunk/equanda-generate/src/main/velocity/t5gui/components/Edit.java.vm
trunk/equanda-generate/src/main/velocity/t5gui/components/Edit.tml.vm
trunk/equanda-generate/src/main/velocity/t5gui/components/LinkList.java.vm
trunk/equanda-generate/src/main/velocity/t5gui/components/LinkList.tml.vm
trunk/equanda-generate/src/main/velocity/t5gui/components/LinkOne.java.vm
trunk/equanda-generate/src/main/velocity/t5gui/components/LinkOne.tml.vm
trunk/equanda-generate/src/main/velocity/t5gui/components/Select.java.vm
trunk/equanda-generate/src/main/velocity/t5gui/components/Select.tml.vm
trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/
trunk/equanda-generate/src/main/velocity/t5gui/pages/
trunk/equanda-generate/src/main/velocity/t5gui/pages/Edit.java.vm
trunk/equanda-generate/src/main/velocity/t5gui/pages/Edit.tml.vm
trunk/equanda-generate/src/main/velocity/t5gui/pages/Selector.java.vm
trunk/equanda-generate/src/main/velocity/t5gui/pages/Selector.tml.vm
trunk/equanda-generate/src/main/velocity/t5gui.ini
Modified: trunk/equanda-generate/src/main/java/org/equanda/generate/EquandaResourceLoader.java
===================================================================
--- trunk/equanda-generate/src/main/java/org/equanda/generate/EquandaResourceLoader.java 2007-12-11 15:03:15 UTC (rev 193)
+++ trunk/equanda-generate/src/main/java/org/equanda/generate/EquandaResourceLoader.java 2007-12-11 21:55:20 UTC (rev 194)
@@ -68,7 +68,7 @@
{
InputStream result = null;
- // check whether the search pth has been updated
+ // check whether the search path has been updated
String path = System.getProperty( PROPERTY_TEMPLATE_PATH );
if ( path != null )
{
@@ -100,8 +100,7 @@
if ( result != null ) rsvc.info( "EquandaResourceLoader : found " + name + " as " + qname );
}
catch ( Exception fnfe )
- { /* ignore exception for now */
- }
+ { /* ignore exception for now */ }
}
// if not found yet, try without prefix
Modified: trunk/equanda-generate/src/main/java/org/equanda/generate/Generator.java
===================================================================
--- trunk/equanda-generate/src/main/java/org/equanda/generate/Generator.java 2007-12-11 15:03:15 UTC (rev 193)
+++ trunk/equanda-generate/src/main/java/org/equanda/generate/Generator.java 2007-12-11 21:55:20 UTC (rev 194)
@@ -24,6 +24,14 @@
package org.equanda.generate;
+import de.hunsicker.jalopy.Jalopy;
+import org.apache.velocity.Template;
+import org.apache.velocity.VelocityContext;
+import org.apache.velocity.app.Velocity;
+import org.apache.velocity.exception.ResourceNotFoundException;
+import org.apache.xml.serialize.LineSeparator;
+import org.apache.xml.serialize.OutputFormat;
+import org.apache.xml.serialize.XMLSerializer;
import org.equanda.persistence.xml.*;
import org.equanda.util.INIFile;
import org.equanda.util.SaveException;
@@ -32,13 +40,6 @@
import org.equanda.util.xml.tree.Document;
import org.equanda.util.xml.tree.Node;
import org.equanda.util.xml.tree.NodeList;
-import de.hunsicker.jalopy.Jalopy;
-import org.apache.velocity.Template;
-import org.apache.velocity.VelocityContext;
-import org.apache.velocity.app.Velocity;
-import org.apache.xml.serialize.LineSeparator;
-import org.apache.xml.serialize.OutputFormat;
-import org.apache.xml.serialize.XMLSerializer;
import org.xml.sax.*;
import javax.xml.parsers.DocumentBuilder;
@@ -46,6 +47,7 @@
import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.Properties;
/**
* Actual generation of the code. Processed the description and outputs files using the template description.
@@ -65,6 +67,7 @@
Jalopy jalopy = new Jalopy(); // java source code reformatter
HashMap<String, String> vars = new HashMap<String, String>(); // name/value pairs for var replacement in varReplace
boolean generateAll; // should all files be generated (as if file is too old)
+ Properties keyValue = new Properties(); // map with key-value pairs for
public static void main( String[] args )
{
@@ -284,6 +287,31 @@
return;
}
+ // initialize key-value pairs which are available to the templates
+ keyValue.clear();
+ String keyValueLocation = templateDefinition.getValue( "config", "path" );
+ if ( keyValueLocation != null )
+ {
+ mergeKeyValues( keyValue, keyValueLocation );
+ }
+ // no merge the user's definitions
+ int i = 1;
+ boolean hasKeyValue = true;
+ while ( hasKeyValue )
+ {
+ String key = "keyvalue" + i;
+ keyValueLocation = ini.getValue( templateDefinitionFile, key );
+ if ( keyValueLocation == null ) keyValueLocation = ini.getValue( "config", key );
+ if ( keyValueLocation == null )
+ {
+ hasKeyValue = false;
+ }
+ else
+ {
+ mergeKeyValues( keyValue, keyValueLocation );
+ }
+ }
+
NodeList list = doc.getNodesByTagName( "user-interface" );
OMUserinterface userInterface = (OMUserinterface) list.item( 0 );
@@ -342,6 +370,7 @@
context.put( "data", doc.getDocumentRoot() );
context.put( "package", packageName );
context.put( "generationdate", new java.util.Date().toString() );
+ context.put( "keyvalue", keyValue );
Convert convert = null;
String cn = ini.getValue( dbSection, "convert" );
try
@@ -477,6 +506,19 @@
}
}
+ private void mergeKeyValues( Properties keyValue, String keyValueLocation )
+ {
+ Properties prop = new Properties();
+ try
+ {
+ InputStream is = new EquandaResourceLoader().getResourceStream( keyValueLocation );
+ prop.load( is );
+ }
+ catch ( IOException ioe ) {/*ignore*/}
+ catch ( ResourceNotFoundException rnfe ) {/*ignore*/}
+ keyValue.putAll( prop );
+ }
+
/**
* generate one output file
*
Modified: trunk/equanda-generate/src/main/java/org/equanda/persistence/xml/OMField.java
===================================================================
--- trunk/equanda-generate/src/main/java/org/equanda/persistence/xml/OMField.java 2007-12-11 15:03:15 UTC (rev 193)
+++ trunk/equanda-generate/src/main/java/org/equanda/persistence/xml/OMField.java 2007-12-11 21:55:20 UTC (rev 194)
@@ -1156,7 +1156,7 @@
return internal;
}
- public boolean isDisplayed()
+ public boolean JavisDisplayed()
{
return display;
}
Added: trunk/equanda-generate/src/main/velocity/t5gui/base/EditPageBase.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/base/EditPageBase.java.vm (rev 0)
+++ trunk/equanda-generate/src/main/velocity/t5gui/base/EditPageBase.java.vm 2007-12-11 21:55:20 UTC (rev 194)
@@ -0,0 +1,189 @@
+#**
+ * This file is part of the equanda project.
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at http://www.mozilla.org/MPL/
+ *
+ * Code generated by applying this template can be freely used.
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
+ * ANY KIND, either express or implied. See the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * Contributor(s):
+ * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
+ *#
+/**
+ * This file is generated by equanda on $generationdate, do not modify
+ */
+
+package ${package}.base;
+
+import org.apache.log4j.Logger;
+import org.apache.tapestry.ComponentResources;
+import org.apache.tapestry.annotations.Persist;
+import org.apache.tapestry.corelib.components.Form;
+import org.apache.tapestry.ioc.annotations.Inject;
+import org.equanda.persistence.om.EquandaPersistenceException;
+import org.equanda.persistence.om.EquandaProxy;
+import org.equanda.persistence.om.UOID;
+
+/**
+ * Base class for edit page
+ */
+public abstract class EditPageBase<T extends EquandaProxy>
+{
+ private static final Logger log = Logger.getLogger( EditPageBase.class );
+
+ @Persist
+ private Object returnPage;
+
+ private Object nextPage; // page to move to after submit
+
+ @Inject
+ private ComponentResources resources;
+
+ @Persist
+ private T object;
+
+ private Form getForm()
+ {
+ return (Form) resources.getPage().getComponentResources().getEmbeddedComponent( "form" );
+ }
+
+ public void setObject( T object )
+ {
+ this.object = object;
+ }
+
+ public T getObject()
+ {
+ return object;
+ }
+
+ public abstract T createObject()
+ throws EquandaPersistenceException;
+
+ public abstract T loadObject( UOID equandaId )
+ throws EquandaPersistenceException;
+
+ public abstract Object getAllPage();
+
+ void onActivate()
+ {
+ try
+ {
+ if ( getObject() == null ) setObject( createObject() );
+ }
+ catch ( EquandaPersistenceException epe )
+ {
+ log.warn( epe, epe );
+ getForm().recordError( epe.getMessage() );
+ }
+ }
+
+ public void onActivate( UOID equandaId )
+ {
+ try
+ {
+ if ( equandaId == null )
+ {
+ setObject( createObject() );
+ }
+ else
+ {
+ if ( getObject() == null || getObject().getUOID() == null ||
+ !getObject().getUOID().equals( equandaId ) )
+ {
+ setObject( loadObject( equandaId ) );
+ }
+ }
+ }
+ catch ( EquandaPersistenceException epe )
+ {
+ log.warn( epe, epe );
+ getForm().recordError( epe.getMessage() );
+ }
+ }
+
+ UOID onPassivate() { return getObject() != null ? getObject().getUOID() : null; }
+
+ public Object getReturnPage()
+ {
+ return returnPage;
+ }
+
+ public void setReturnPage( Object returnPage )
+ {
+ this.returnPage = returnPage;
+ }
+
+ public void onSelectedFromSave()
+ {
+ nextPage = null;
+ try
+ {
+ getObject().equandaUpdate();
+ nextPage = returnPage;
+ }
+ catch ( EquandaPersistenceException epe )
+ {
+ log.warn( epe );
+ getForm().recordError( epe.getMessage() );
+ }
+ }
+
+ public void onSelectedFromReset()
+ {
+ nextPage = null;
+ try
+ {
+ getObject().equandaReset();
+ }
+ catch ( EquandaPersistenceException epe ) { log.warn( epe ); }
+ }
+
+ public void onSelectedFromCancel()
+ {
+ nextPage = null;
+ try
+ {
+ getObject().equandaReset();
+ nextPage = returnPage;
+ }
+ catch ( EquandaPersistenceException epe ) { log.warn( epe ); }
+ }
+
+ public void onSelectedFromDelete()
+ {
+ nextPage = null;
+ try
+ {
+ getObject().removeEntityBean();
+ nextPage = returnPage == null ? getAllPage() : returnPage;
+ }
+ catch ( EquandaPersistenceException epe )
+ {
+ log.warn( epe );
+ getForm().recordError( epe.getMessage() );
+ }
+ }
+
+ public Object onSubmit()
+ {
+ return nextPage;
+ }
+}
Added: trunk/equanda-generate/src/main/velocity/t5gui/base/SelectComponentBase.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/base/SelectComponentBase.java.vm (rev 0)
+++ trunk/equanda-generate/src/main/velocity/t5gui/base/SelectComponentBase.java.vm 2007-12-11 21:55:20 UTC (rev 194)
@@ -0,0 +1,119 @@
+#**
+ * This file is part of the equanda project.
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at http://www.mozilla.org/MPL/
+ *
+ * Code generated by applying this template can be freely used.
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
+ * ANY KIND, either express or implied. See the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * Contributor(s):
+ * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
+ *#
+/**
+ * This file is generated by equanda on $generationdate, do not modify
+ */
+
+package ${package}.base;
+
+import org.equanda.persistence.om.EquandaProxy;
+import org.equanda.persistence.om.UOID;
+import org.apache.tapestry.grid.GridDataSource;
+import org.apache.tapestry.beaneditor.BeanModel;
+import org.apache.tapestry.annotations.Parameter;
+import org.equanda.t5gui.ListGetter;
+import org.equanda.t5gui.SelectedSettings;
+
+/**
+ * Base class for select component
+ */
+public abstract class SelectComponentBase<T extends EquandaProxy>
+{
+ private T currentRow;
+
+ @Parameter( required = true, defaultPrefix = "prop" )
+ private ListGetter<T> selector;
+
+ @Parameter
+ private SelectedSettings<T> selectedSettings;
+
+ public ListGetter<T> getSelector()
+ {
+ return selector;
+ }
+
+ public void setSelector( ListGetter<T> selector )
+ {
+ this.selector = selector;
+ }
+
+ public abstract BeanModel getGridModel();
+
+ public abstract GridDataSource getRows();
+
+ public T getCurrentRow()
+ {
+ return currentRow;
+ }
+
+ public void setCurrentRow( T currentRow )
+ {
+ this.currentRow = currentRow;
+ }
+
+ public SelectedSettings<T> getSelectedSettings()
+ {
+ return selectedSettings;
+ }
+
+ public void setSelectedSettings( SelectedSettings<T> selectedSettings )
+ {
+ this.selectedSettings = selectedSettings;
+ }
+
+ public abstract T getObject( UOID uoid );
+
+ Object onActionFromSelectOne( UOID uoid )
+ {
+ selectedSettings.getSelectedSetter().setSelected( getObject( uoid ) );
+ return selectedSettings.getSelectedReturnPage();
+ }
+
+ Object onActionFromSelectList( UOID uoid )
+ {
+ selectedSettings.getSelectedList().add( getObject( uoid ) );
+ return selectedSettings.getSelectedReturnPage();
+ }
+
+ public boolean isForSelect()
+ {
+ return selectedSettings != null &&
+ ( selectedSettings.getSelectedList() != null || selectedSettings.getSelectedSetter() != null );
+ }
+
+ public boolean isForSelectOne()
+ {
+ return selectedSettings != null && selectedSettings.getSelectedSetter() != null;
+ }
+
+ public boolean isForSelectList()
+ {
+ return selectedSettings != null && selectedSettings.getSelectedList() != null;
+ }
+}
Added: trunk/equanda-generate/src/main/velocity/t5gui/base/SelectPageBase.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/base/SelectPageBase.java.vm (rev 0)
+++ trunk/equanda-generate/src/main/velocity/t5gui/base/SelectPageBase.java.vm 2007-12-11 21:55:20 UTC (rev 194)
@@ -0,0 +1,89 @@
+#**
+ * This file is part of the equanda project.
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at http://www.mozilla.org/MPL/
+ *
+ * Code generated by applying this template can be freely used.
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
+ * ANY KIND, either express or implied. See the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * Contributor(s):
+ * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
+ *#
+/**
+ * This file is generated by equanda on $generationdate, do not modify
+ */
+
+package ${package}.base;
+
+import org.equanda.t5gui.ListGetter;
+import org.equanda.t5gui.SelectedSettings;
+import org.apache.log4j.Logger;
+import org.apache.tapestry.ComponentResources;
+import org.apache.tapestry.annotations.Persist;
+import org.apache.tapestry.ioc.annotations.Inject;
+import org.equanda.persistence.om.EquandaProxy;
+
+/**
+ * Select page base class.
+ */
+public abstract class SelectPageBase<T extends EquandaProxy>
+{
+ private static final Logger log = Logger.getLogger( SelectPageBase.class );
+
+ @Inject
+ private ComponentResources resources;
+
+ @Persist
+ private SelectedSettings selectedSettings;
+
+ private Object nextPage;
+
+ public void onSelectedFromPrint()
+ {
+ nextPage = null;
+ }
+
+ public abstract EditPageBase<T> getEquandaCreatePage();
+
+ public void onSelectedFromCreate()
+ {
+ EditPageBase<T> createPage = getEquandaCreatePage();
+ createPage.setObject( null );
+ createPage.setReturnPage( resources.createPageLink( resources.getPageName(), false ) );
+ nextPage = createPage;
+ }
+
+ public Object onSubmit()
+ {
+ return nextPage;
+ }
+
+ public abstract ListGetter<T> getSelector();
+
+ public SelectedSettings getSelectedSettings()
+ {
+ return selectedSettings;
+ }
+
+ public void setSelectedSettings( SelectedSettings selectedSettings )
+ {
+ this.selectedSettings = selectedSettings;
+ }
+}
Added: trunk/equanda-generate/src/main/velocity/t5gui/components/Display.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/components/Display.java.vm (rev 0)
+++ trunk/equanda-generate/src/main/velocity/t5gui/components/Display.java.vm 2007-12-11 21:55:20 UTC (rev 194)
@@ -0,0 +1,73 @@
+#**
+ * This file is part of the equanda project.
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at http://www.mozilla.org/MPL/
+ *
+ * Code generated by applying this template can be freely used.
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
+ * ANY KIND, either express or implied. See the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * Contributor(s):
+ * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
+ *#
+/**
+ * This file is generated by equanda on $generationdate, do not modify
+ */
+
+package ${package}.components.${engine.lowerFirst("$table.Name")};
+
+import ${ejbPackage}.client.${table.Name};
+import ${package}.pages.${table.Name}Edit;
+import org.apache.tapestry.annotations.Parameter;
+import org.apache.tapestry.annotations.InjectPage;
+import org.apache.tapestry.ioc.annotations.Inject;
+import org.apache.tapestry.ComponentResources;
+import org.equanda.persistence.om.UOID;
+
+/**
+ * Object (short) display component
+ */
+public class Display
+{
+ @Parameter( required = true )
+ private ${table.Name} object;
+
+ @InjectPage
+ private ${table.Name}Edit edit;
+
+ @Inject
+ private ComponentResources resources;
+
+ Object onActionFromEdit( UOID object )
+ {
+ edit.onActivate( object );
+ edit.setReturnPage( resources.createPageLink( resources.getPageName(), false ) );
+ return edit;
+ }
+
+ public ${table.Name} getObject()
+ {
+ return object;
+ }
+
+ public void setObject( ${table.Name} object )
+ {
+ this.object = object;
+ }
+}
Added: trunk/equanda-generate/src/main/velocity/t5gui/components/Display.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/components/Display.tml.vm (rev 0)
+++ trunk/equanda-generate/src/main/velocity/t5gui/components/Display.tml.vm 2007-12-11 21:55:20 UTC (rev 194)
@@ -0,0 +1,17 @@
+<div xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+
+ <t:actionlink t:id="Edit" context="object.uOID">
+#set( $sep = "" )
+#foreach( $field in $table.getFields() )
+#if( $field.isReference() || $field.isDescription || !field.isDisplay() )
+#if( !$field.isLink() )
+ $sep \${object.${field.VarName}}
+#else
+ <span t:type="${engine.lowerFirst(${field.LinkTable.Name}"}.Display" t:value="object.${field.VarName}">
+#end
+#set( $sep = "," )
+#end
+#end
+ </t:actionlink>
+
+</div>
\ No newline at end of file
Added: trunk/equanda-generate/src/main/velocity/t5gui/components/Edit.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/components/Edit.java.vm (rev 0)
+++ trunk/equanda-generate/src/main/velocity/t5gui/components/Edit.java.vm 2007-12-11 21:55:20 UTC (rev 194)
@@ -0,0 +1,49 @@
+#**
+ * This file is part of the equanda project.
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at http://www.mozilla.org/MPL/
+ *
+ * Code generated by applying this template can be freely used.
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
+ * ANY KIND, either express or implied. See the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * Contributor(s):
+ * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
+ *#
+/**
+ * This file is generated by equanda on $generationdate, do not modify
+ */
+
+package ${package}.components.${engine.lowerFirst("$table.Name")};
+
+import ${ejbPackage}.client.${table.Name};
+import org.apache.tapestry.annotations.Parameter;
+
+/**
+ * Object edit component
+ */
+public class Edit
+{
+ @Parameter( required = true )
+ private ${table.Name} value;
+
+ public ${table.Name} getValue() { return value; }
+
+ public void setValue( ${table.Name} value ) { this.value = value; }
+}
Added: trunk/equanda-generate/src/main/velocity/t5gui/components/Edit.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/components/Edit.tml.vm (rev 0)
+++ trunk/equanda-generate/src/main/velocity/t5gui/components/Edit.tml.vm 2007-12-11 21:55:20 UTC (rev 194)
@@ -0,0 +1,115 @@
+<div xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+
+ <span t:type="equanda/Tabs">
+ <t:parameter name="contentAll">
+ <t:label for="equandaType"/>
+ <div style="display:none;">
+ <a href="javascript:;" id="Show-${table.Name}-type-" onclick="
+ $$('.${table.Name}-type-').each(function show(object){object.style.display='block';});
+ $$('.${table.Name}-type-INTE').each(function show(object){object.style.display='none';});
+ $$('.${table.Name}-type-PERS').each(function show(object){object.style.display='none';});
+ ">BASE</a>
+ <a href="javascript:;" id="Show-${table.Name}-type-INTE" onclick="
+ $$('.${table.Name}-type-').each(function show(object){object.style.display='block';});
+ $$('.${table.Name}-type-INTE').each(function show(object){object.style.display='block';});
+ $$('.${table.Name}-type-PERS').each(function show(object){object.style.display='none';});
+ ">INTE</a>
+ <a href="javascript:;" id="Show-${table.Name}-type-PERS" onclick="
+ $$('.${table.Name}-type-').each(function show(object){object.style.display='block';});
+ $$('.${table.Name}-type-INTE').each(function show(object){object.style.display='block';});
+ $$('.${table.Name}-type-PERS').each(function show(object){object.style.display='block';});
+ ">PERS</a>
+ </div>
+ <input class="${table.Name}-type-Selector" t:type="Select" t:label="EquandaType" t:id="equandaType" t:value="value.EquandaType" t:disabled="isTypeKnown()" model="TypeModel" encoder="TypeEncoder" onchange="$(('Show-${table.Name}-type-'+this.options[this.selectedIndex].value).trim()).onclick();"/>
+ <br/>
+ <div class="${table.Name}-Reference ${table.Name}-type-">
+ <t:label for="reference"/>
+ <input t:type="TextField" t:label="Reference" t:id="reference" t:value="value.Reference" t:validate="max=30" size="30" onkeyup="equandaConvertCase( this, 2);"/>
+ <br/></div>
+ <div class="${table.Name}-Name ${table.Name}-type-">
+ <t:label for="name"/>
+ <input t:type="TextField" t:label="Name" t:id="name" t:value="value.Name" t:validate="max=100" size="50"/>
+ <br/></div>
+ </t:parameter>
+ <t:parameter name="title1">Default</t:parameter>
+ <t:parameter name="content1">
+ <label>${table.Name}</label>
+ <input t:type="${engine.lowerFirst("${table.Name}")}/LinkOne" t:label="${table.Name}" t:id="${engine.lowerFirst("${table.Name}")}" t:value="value.${table.Name}" t:setter="${table.Name}Setter"/>
+ <br/>
+ <t:label for="externalreference"/>
+ <input t:type="TextField" t:label="Externalreference" t:id="externalreference" t:value="value.Externalreference" t:validate="max=100" size="20"/>
+ <br/>
+ <t:label for="description"/>
+ <input t:type="TextArea" t:label="Description" t:id="description" t:value="value.Description" t:validate="max=120" size="50"/>
+ <br/>
+
+ <fieldset>
+ <legend></legend>
+ <div class="${table.Name}-PersonFirstName ${table.Name}-type-INTE">
+ <t:label for="personFirstName"/>
+ <input t:type="TextField" t:label="PersonFirstName" t:id="personFirstName" t:value="value.PersonFirstName" length="32" size="25"/>
+ <br/></div>
+ <div class="${table.Name}-PersonName ${table.Name}-type-PERS">
+ <t:label for="personname"/>
+ <input t:type="TextField" t:label="PersonName" t:id="personName" t:value="value.PersonName" length="32" size="25"/>
+ <br/></div>
+ <t:label for="birthdate"/>
+ <input t:type="DateField" t:label="Birthdate" t:id="birthdate" t:value="value.Birthdate"/>
+ <br/>
+ <t:label for="portfolio"/>
+ <input t:type="TextField" t:label="Portfolio" t:id="portfolio" t:value="value.Portfolio" length="100" size="50"/>
+ <br/>
+ <fieldset>
+ <legend>Address</legend>
+ <t:label for="address"/>
+ <input t:type="TextArea" t:label="Address" t:id="address" t:value="value.Address" t:validate="max=120" size="50"/>
+ <br/>
+ <t:label for="zip"/>
+ <input t:type="TextField" t:label="Zip" t:id="zip" t:value="value.Zip" t:validate="max=100" size="20"/>
+ <br/>
+ <t:label for="city"/>
+ <input t:type="TextField" t:label="City" t:id="city" t:value="value.City" t:validate="max=40" size="20"/>
+ <br/>
+ <t:label for="country"/>
+ <input t:type="TextField" t:label="Country" t:id="country" t:value="value.Country" t:validate="max=2" size="2"/>
+ <br/>
+ <t:label for="phone"/>
+ <input t:type="TextField" t:label="Phone" t:id="phone" t:value="value.Phone" t:validate="max=32" size="20"/>
+ <br/>
+ <t:label for="mobilephone"/>
+ <input t:type="TextField" t:label="Mobilephone" t:id="mobilephone" t:value="value.Mobilephone" t:validate="max=32" size="20"/>
+ <br/>
+ <t:label for="fax"/>
+ <input t:type="TextField" t:label="Fax" t:id="fax" t:value="value.Fax" t:validate="max=32" size="20"/>
+ <br/>
+ <t:label for="email"/>
+ <input t:type="TextField" t:label="Email" t:id="email" t:value="value.Email" t:validate="max=100" size="20"/>
+ <br/>
+ <t:label for="url"/>
+ <input t:type="TextField" t:label="Url" t:id="url" t:value="value.Url" t:validate="max=100" size="20"/>
+ <br/>
+ </fieldset>
+ </fieldset>
+ </t:parameter>
+ <t:parameter name="title2">Metadata</t:parameter>
+ <t:parameter name="content2">
+ <t:label for="uoid"/>
+ <input t:type="TextField" t:label="EquandaId" t:id="uoid" t:value="value.UOID" size="14" disabled="true"/>
+ <br/>
+ <t:label for="equandaCreationDate"/>
+ <input t:type="TextField" t:label="EquandaCreationDate" t:id="equandaCreationDate" t:value="value.EquandaCreationDate" size="20" disabled="true"/>
+ <br/>
+ <t:label for="equandaModificationDate"/>
+ <input t:type="TextField" t:label="EquandaModificationDate" t:id="equandaModificationDate" t:value="value.EquandaModificationDate" size="20" disabled="true"/>
+ <br/>
+ <t:label for="equandaVersion"/>
+ <input t:type="TextField" t:label="EquandaVersion" t:id="equandaVersion" t:value="value.EquandaVersion" size="6" disabled="true"/>
+ <br/>
+ <t:label for="equandaStatus"/>
+ <input t:type="TextField" t:label="EquandaStatus" t:id="equandaStatus" t:value="value.EquandaStatus" size="2" disabled="true"/>
+ <br/>
+ </t:parameter>
+ </span>
+ <script type="text/javascript">$$('.${table.Name}-type-Selector')[0].onchange();</script>
+
+</div>
Added: trunk/equanda-generate/src/main/velocity/t5gui/components/LinkList.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/components/LinkList.java.vm (rev 0)
+++ trunk/equanda-generate/src/main/velocity/t5gui/components/LinkList.java.vm 2007-12-11 21:55:20 UTC (rev 194)
@@ -0,0 +1,106 @@
+#**
+ * This file is part of the equanda project.
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at http://www.mozilla.org/MPL/
+ *
+ * Code generated by applying this template can be freely used.
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
+ * ANY KIND, either express or implied. See the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * Contributor(s):
+ * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
+ *#
+/**
+ * This file is generated by equanda on $generationdate, do not modify
+ */
+
+package ${package}.components.${engine.lowerFirst("$table.Name")};
+
+import ${ejbPackage}.client.${table.Name};
+import org.equanda.t5gui.SelectedSettings;
+import ${package}.pages.${table.Name}All;
+import ${package}.pages.${table.Name}Edit;
+import org.apache.tapestry.ComponentResources;
+import org.apache.tapestry.annotations.InjectPage;
+import org.apache.tapestry.annotations.Parameter;
+import org.apache.tapestry.ioc.annotations.Inject;
+import org.equanda.persistence.om.UOID;
+
+import java.util.List;
+
+/**
+ * Component for a multiple link to this object
+ */
+public class LinkList
+{
+ @Parameter( required = true )
+ private List<${table.Name}> value;
+
+ @InjectPage
+ private ${table.Name}All select;
+
+ @Inject
+ private ComponentResources resources;
+
+ private ${table.Name} current;
+ private int index;
+
+ public List<${table.Name}> getValue()
+ {
+ return value;
+ }
+
+ public void setValue( List<${table.Name}> value )
+ {
+ this.value = value;
+ }
+
+ public ${table.Name} getCurrent()
+ {
+ return current;
+ }
+
+ public void setCurrent( ${table.Name} current )
+ {
+ this.current = current;
+ }
+
+ public int getIndex()
+ {
+ return index;
+ }
+
+ public void setIndex( int index )
+ {
+ this.index = index;
+ }
+
+ Object onActionFromAdd()
+ {
+ select.setSelectedSettings( new SelectedSettings<${table.Name}>(
+ resources.createPageLink( resources.getPageName(), false ), value, null ) );
+ return select;
+ }
+
+ Object onActionFromDelete( int index )
+ {
+ value.remove( index );
+ return null;
+ }
+}
Added: trunk/equanda-generate/src/main/velocity/t5gui/components/LinkList.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/components/LinkList.tml.vm (rev 0)
+++ trunk/equanda-generate/src/main/velocity/t5gui/components/LinkList.tml.vm 2007-12-11 21:55:20 UTC (rev 194)
@@ -0,0 +1,10 @@
+<div class="equandaLinkList" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+
+ <t:loop source="value" value="current" index="index">
+ <div class="equandaLinkListRow">
+ <t:actionlink t:id="Delete" context="index">(x)</t:actionlink> <t:${engine.lowerFirst("${table.Name}")}.Display object="current"/>
+ </div>
+ </t:loop>
+ <t:actionlink t:id="Add">Add</t:actionlink>
+
+</div>
\ No newline at end of file
Added: trunk/equanda-generate/src/main/velocity/t5gui/components/LinkOne.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/components/LinkOne.java.vm (rev 0)
+++ trunk/equanda-generate/src/main/velocity/t5gui/components/LinkOne.java.vm 2007-12-11 21:55:20 UTC (rev 194)
@@ -0,0 +1,85 @@
+#**
+ * This file is part of the equanda project.
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at http://www.mozilla.org/MPL/
+ *
+ * Code generated by applying this template can be freely used.
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
+ * ANY KIND, either express or implied. See the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * Contributor(s):
+ * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
+ *#
+/**
+ * This file is generated by equanda on $generationdate, do not modify
+ */
+
+package ${package}.components.${engine.lowerFirst("$table.Name")};
+
+import ${ejbPackage}.client.${table.Name};
+import org.equanda.t5gui.SelectedSetter;
+import org.equanda.t5gui.SelectedSettings;
+import ${package}.pages.${table.Name}All;
+import org.apache.tapestry.ComponentResources;
+import org.apache.tapestry.annotations.InjectPage;
+import org.apache.tapestry.annotations.Parameter;
+import org.apache.tapestry.ioc.annotations.Inject;
+
+/**
+ * Component for a single link to this object
+ */
+public class LinkOne
+{
+ @Parameter( required = true )
+ private ${table.Name} value;
+
+ @Parameter( required = true )
+ private SelectedSetter<${table.Name}> setter;
+
+ @InjectPage
+ private ${table.Name}All select;
+
+ @Inject
+ private ComponentResources resources;
+
+ public ${table.Name} getValue()
+ {
+ return value;
+ }
+
+ public void setValue( ${table.Name} value )
+ {
+ this.value = value;
+ }
+
+ Object onActionFromSelect()
+ {
+ select.setSelectedSettings( new SelectedSettings<${table.Name}>(
+ resources.createPageLink( resources.getPageName(), false ), null, setter ) );
+ return select;
+ }
+
+ Object onActionFromDelete()
+ {
+ setter.setSelected( null );
+ return null;
+ }
+
+ public boolean hasValue() { return value != null; }
+}
Added: trunk/equanda-generate/src/main/velocity/t5gui/components/LinkOne.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/components/LinkOne.tml.vm (rev 0)
+++ trunk/equanda-generate/src/main/velocity/t5gui/components/LinkOne.tml.vm 2007-12-11 21:55:20 UTC (rev 194)
@@ -0,0 +1,8 @@
+<div class="equandaLinkList" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+
+ <div class="equandaLinkOne">
+ <t:actionlink t:id="Delete">(x)</t:actionlink> <t:actionlink t:id="Select">Select</t:actionlink>
+ <t:if test="hasValue()"><t:${engine.lowerFirst("${table.Name}")}.Display object="value"/></t:if>
+ </div>
+
+</div>
Added: trunk/equanda-generate/src/main/velocity/t5gui/components/Select.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/components/Select.java.vm (rev 0)
+++ trunk/equanda-generate/src/main/velocity/t5gui/components/Select.java.vm 2007-12-11 21:55:20 UTC (rev 194)
@@ -0,0 +1,127 @@
+#**
+ * This file is part of the equanda project.
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at http://www.mozilla.org/MPL/
+ *
+ * Code generated by applying this template can be freely used.
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
+ * ANY KIND, either express or implied. See the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * Contributor(s):
+ * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
+ *#
+/**
+ * This file is generated by equanda on $generationdate, do not modify
+ */
+
+package ${package}.components.${engine.lowerFirst("$table.Name")};
+
+import ${ejbPackage}.client.EquandaGlobal;
+import ${ejbPackage}.client.${table.Name};
+import ${ejbPackage}.client.${table.Name}SelectorEJB;
+import org.equanda.t5gui.EquandaGridDataSource;
+import ${package}.base.SelectComponentBase;
+import ${package}.pages.${table.Name}Edit;
+import org.apache.log4j.Logger;
+import org.apache.tapestry.ComponentResources;
+import org.apache.tapestry.annotations.InjectPage;
+import org.apache.tapestry.annotations.Retain;
+import org.apache.tapestry.beaneditor.BeanModel;
+import org.apache.tapestry.grid.GridDataSource;
+import org.apache.tapestry.ioc.annotations.Inject;
+import org.apache.tapestry.services.BeanModelSource;
+import org.equanda.persistence.om.EquandaPersistenceException;
+import org.equanda.persistence.om.UOID;
+import java.util.List;
+
+/**
+ * Component for displaying a list of these objects (for display/edit or select)
+ */
+public class Select
+ extends SelectComponentBase
+{
+ private static final Logger log = Logger.getLogger( Select.class );
+
+ @Inject
+ private BeanModelSource beanModelSource;
+
+ @Inject
+ private ComponentResources resources;
+
+ @Retain
+ private BeanModel model;
+
+ @InjectPage
+ private ${table.Name}Edit edit;
+
+ public BeanModel getGridModel()
+ {
+ model = beanModelSource.create( ${table.Name}.class, true, resources );
+ List<String> toremove = model.getPropertyNames();
+ for ( String one : toremove ) model.remove( one );
+
+ if ( isForSelectOne() ) model.add( "equandaSelectOne", null );
+ if ( isForSelectList() ) model.add( "equandaSelectList", null );
+ model.add( "equandaSelectEdit", null );
+ model.add(
+#set( $sep = "" )
+#foreach( $field in $table.getFields() )
+#if( $field.isReference() || $field.isDescription || !field.isDisplay() )
+ $sep $field.VarName
+#set( $sep = "," )
+#end
+#end
+ );
+ model.add( "reference" );
+ model.add( "name" );
+ return model;
+ }
+
+ public GridDataSource getRows()
+ {
+ return new EquandaGridDataSource<${table.Name}>( ${table.Name}.class, "${table.Name}", getSelector() );
+ }
+
+ public ${table.Name} getObject( UOID uoid )
+ {
+ ${table.Name} object = null;
+ ${table.Name}SelectorEJB sel = null;
+ try
+ {
+ sel = EquandaGlobal.get${table.Name}Selector();
+ object = sel.selectUOID( uoid );
+ }
+ catch ( EquandaPersistenceException epe )
+ {
+ log.error( epe );
+ }
+ finally
+ {
+ if ( sel != null ) sel.remove();
+ }
+ return object;
+ }
+
+ Object onActionFromEdit( UOID object )
+ {
+ edit.onActivate( object );
+ edit.setReturnPage( resources.createPageLink( resources.getPageName(), false ) );
+ return edit;
+ }
+}
Added: trunk/equanda-generate/src/main/velocity/t5gui/components/Select.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/components/Select.tml.vm (rev 0)
+++ trunk/equanda-generate/src/main/velocity/t5gui/components/Select.tml.vm 2007-12-11 21:55:20 UTC (rev 194)
@@ -0,0 +1,17 @@
+<div xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+
+ <t:grid model="gridModel" row="currentRow" source="rows">
+ <t:parameter name="empty">No available ${table.Name}</t:parameter>
+ <t:parameter name="equandaSelectOneCell">
+ <t:actionlink t:id="SelectOne" context="currentRow.uOID">Select</t:actionlink>
+ </t:parameter>
+ <t:parameter name="equandaSelectListCell">
+ <t:actionlink t:id="SelectList" context="currentRow.uOID">Add</t:actionlink>
+ </t:parameter>
+ <t:parameter name="equandaSelectEditCell">
+ <t:actionlink t:id="Edit" context="currentRow.uOID">Edit</t:actionlink>
+ </t:parameter>
+ </t:grid>
+
+</div>
+
Added: trunk/equanda-generate/src/main/velocity/t5gui/pages/Edit.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/pages/Edit.java.vm (rev 0)
+++ trunk/equanda-generate/src/main/velocity/t5gui/pages/Edit.java.vm 2007-12-11 21:55:20 UTC (rev 194)
@@ -0,0 +1,71 @@
+#**
+ * This file is part of the equanda project.
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at http://www.mozilla.org/MPL/
+ *
+ * Code generated by applying this template can be freely used.
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
+ * ANY KIND, either express or implied. See the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * Contributor(s):
+ * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
+ *#
+/**
+ * This file is generated by equanda on $generationdate, do not modify
+ */
+
+package ${package}.pages;
+
+import ${ejbPackage}.client.${table.Name};
+import ${ejbPackage}.client.${table.Name}SelectorEJB;
+import ${ejbPackage}.client.EquandaGlobal;
+import ${package}.base.EditPageBase;
+import org.equanda.persistence.om.EquandaPersistenceException;
+import org.equanda.persistence.om.UOID;
+import org.apache.tapestry.annotations.Persist;
+
+/**
+ * Default object edit page
+ */
+public class ${table.Name}Edit
+ extends EditPageBase<${table.Name}>
+{
+ public ${table.Name} createObject()
+ throws EquandaPersistenceException
+ {
+ return ${table.Name}.equandaCreate();
+ }
+
+ public ${table.Name} loadObject( UOID equandaId )
+ throws EquandaPersistenceException
+ {
+ ${table.Name}SelectorEJB sel = null;
+ try
+ {
+ sel = EquandaGlobal.get${table.Name}Selector();
+ return sel.selectUOID( equandaId );
+ }
+ finally
+ {
+ if ( sel != null ) sel.remove();
+ }
+ }
+
+ public Class getAllPage() { return ${table.Name}All.class; }
+}
Added: trunk/equanda-generate/src/main/velocity/t5gui/pages/Edit.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/pages/Edit.tml.vm (rev 0)
+++ trunk/equanda-generate/src/main/velocity/t5gui/pages/Edit.tml.vm 2007-12-11 21:55:20 UTC (rev 194)
@@ -0,0 +1,45 @@
+<t:editlayout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+ <t:parameter name="title">
+ <title>${table.Name}, Edit</title>
+ </t:parameter>
+ <t:parameter name="context">
+ <span id="context">uoid ${object?.uOID}</span>
+ </t:parameter>
+ <t:parameter name="buttons">
+ <input class="defaultSubmit" t:type="submit" value="Save" t:id="save"/>
+ <input t:type="submit" value="Reset" t:id="reset"/>
+ <input t:type="submit" value="Cancel" t:id="cancel"/>
+ <input t:type="submit" value="Delete" t:id="delete"/>
+ </t:parameter>
+ <t:parameter name="reverseLinks">
+#if( !$table.LinkedSelects.isEmpty() )
+ <ul>
+#foreach( $select in $table.LinkedSelects )
+ <li><a href="nowhere">Find By $select.Name</a></li>
+#end
+ <ul>
+ <hr/>
+#end
+#if( !$table.MoreLinkedSelects.isEmpty() )
+ <ul>
+#foreach( $select in $table.MoreLinkedSelects )
+ <li><a href="nowhere">Find By $select.Name</a></li>
+#end
+ </ul>
+ <hr/>
+#end
+ </t:parameter>
+ <t:parameter name="actions">
+ <ul>
+#foreach( $action in $table.Actions )
+ <li><a href="nowhere">Action ${action.Name}</a></li>
+#end
+ </ul>
+ </t:parameter>
+ <t:parameter name="help">
+ <p>short general page field info</p>
+ </t:parameter>
+
+ <input t:type="${engine.lowerFirst("$table.Name")}/Edit" t:value="object"/>
+
+</t:editlayout>
Added: trunk/equanda-generate/src/main/velocity/t5gui/pages/Selector.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/pages/Selector.java.vm (rev 0)
+++ trunk/equanda-generate/src/main/velocity/t5gui/pages/Selector.java.vm 2007-12-11 21:55:20 UTC (rev 194)
@@ -0,0 +1,92 @@
+#**
+ * This file is part of the equanda project.
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at http://www.mozilla.org/MPL/
+ *
+ * Code generated by applying this template can be freely used.
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
+ * ANY KIND, either express or implied. See the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * Contributor(s):
+ * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
+ *#
+/**
+ * This file is generated by equanda on $generationdate, do not modify
+ */
+
+package ${package}.pages;
+
+import ${ejbPackage}.client.${table.Name};
+import ${ejbPackage}.client.${table.Name}SelectorEJB;
+import ${ejbPackage}.client.EquandaGlobal;
+import org.equanda.t5gui.ListGetter;
+import ${package}.base.SelectPageBase;
+import org.apache.log4j.Logger;
+import org.apache.tapestry.annotations.InjectPage;
+import org.equanda.persistence.om.EquandaPersistenceException;
+
+import java.util.List;
+
+/**
+ * Object selector page
+ */
+public class ${table.Name}${select.Name}
+ extends SelectPageBase<${table.Name}>
+{
+ private static final Logger equandaLog = Logger.getLogger( ${table.Name}All.class );
+
+ @InjectPage
+ private ${table.Name}Edit equandaCreatePage;
+
+ public ${table.Name}Edit getEquandaCreatePage() { return equandaCreatePage; }
+
+#foreach( $par = $select.Selections )
+#if( isTestComparison() && selection.isParameter() )
+ @Persist
+ ${sel.JavaFieldType} ${sel.VarName};
+
+ public ${sel.JavaFieldType} get${sel.Name}() { return $sel.VarName; }
+
+#end
+#end
+
+ private static final ListGetter<${table.Name}> SELECTOR = new ListGetter<${table.Name}>()
+ {
+ public List<${table.Name}> getList()
+ {
+ ${table.Name}SelectorEJB sel = EquandaGlobal.get${table.Name}Selector();
+ List<${table.Name}> list = null;
+ try
+ {
+ list = sel.selectEquanda${select.Name}( $select.ParametersListNoLimit );
+ }
+ catch ( EquandaPersistenceException ee )
+ {
+ equandaLog.error( ee, ee );
+ }
+ sel.remove();
+ return list;
+ }
+ };
+
+ public ListGetter<${table.Name}> getSelector()
+ {
+ return SELECTOR;
+ }
+}
Added: trunk/equanda-generate/src/main/velocity/t5gui/pages/Selector.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/pages/Selector.tml.vm (rev 0)
+++ trunk/equanda-generate/src/main/velocity/t5gui/pages/Selector.tml.vm 2007-12-11 21:55:20 UTC (rev 194)
@@ -0,0 +1,27 @@
+<t:selectlayout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+ <t:parameter name="title">
+ <meta http-equiv="Content-Language" content="en"/>
+ <title>${table.Name}, ${selector.Name}</title>
+ </t:parameter>
+ <t:parameter name="context">
+ <span id="context">context info</span>
+ </t:parameter>
+ <t:parameter name="buttons">
+ <input t:type="submit" value="Refresh" t:id="refresh" class="defaultSubmit" />
+ <input t:type="submit" value="Print" t:id="print"/>
+ <input t:type="submit" value="Create" t:id="create"/>
+ </t:parameter>
+ <t:parameter name="selectors">
+#set( $allSel = ${table.Selectors} )
+ <ul>
+#foreach( $sel in $allSel )
+#if( $sel.Name != $selector.Name )
+ <li><a t:type="pagelink" t:page="${table.Name}${sel.Nam...
[truncated message content] |