You can subscribe to this list here.
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(6) |
Aug
(41) |
Sep
(44) |
Oct
(31) |
Nov
(54) |
Dec
(53) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(71) |
Feb
(66) |
Mar
(65) |
Apr
(73) |
May
(68) |
Jun
(69) |
Jul
(28) |
Aug
(49) |
Sep
(44) |
Oct
(77) |
Nov
(64) |
Dec
(78) |
| 2009 |
Jan
(50) |
Feb
(28) |
Mar
(41) |
Apr
(30) |
May
(5) |
Jun
(30) |
Jul
(6) |
Aug
(2) |
Sep
(18) |
Oct
(11) |
Nov
(6) |
Dec
(10) |
| 2010 |
Jan
(5) |
Feb
(8) |
Mar
(4) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <tri...@us...> - 2007-12-24 13:09:58
|
Revision: 217
http://equanda.svn.sourceforge.net/equanda/?rev=217&view=rev
Author: triathlon98
Date: 2007-12-24 05:09:47 -0800 (Mon, 24 Dec 2007)
Log Message:
-----------
update to t5gui version
Modified Paths:
--------------
equanda-example/example-ear/pom.xml
equanda-example/example-gui/pom.xml
equanda-example/example-gui/src/main/webapp/WEB-INF/web.xml
equanda-example/pom.xml
equanda-example/src/main/om/om.ini
Added Paths:
-----------
equanda-example/example-gui/src/main/java/myapp/example/gui/components/EditLayout.java
equanda-example/example-gui/src/main/java/myapp/example/gui/components/Layout.java
equanda-example/example-gui/src/main/java/myapp/example/gui/components/SelectLayout.java
equanda-example/example-gui/src/main/java/myapp/example/gui/pages/
equanda-example/example-gui/src/main/java/myapp/example/gui/pages/Start.java
equanda-example/example-gui/src/main/java/myapp/example/gui/services/
equanda-example/example-gui/src/main/java/myapp/example/gui/services/AppModule.java
equanda-example/example-gui/src/main/resources/
equanda-example/example-gui/src/main/resources/myapp/
equanda-example/example-gui/src/main/resources/myapp/example/
equanda-example/example-gui/src/main/resources/myapp/example/gui/
equanda-example/example-gui/src/main/resources/myapp/example/gui/components/
equanda-example/example-gui/src/main/resources/myapp/example/gui/components/EditLayout.tml
equanda-example/example-gui/src/main/resources/myapp/example/gui/components/Layout.tml
equanda-example/example-gui/src/main/resources/myapp/example/gui/components/SelectLayout.tml
equanda-example/example-gui/src/main/resources/myapp/example/gui/pages/
equanda-example/example-gui/src/main/resources/myapp/example/gui/pages/Start.tml
Removed Paths:
-------------
equanda-example/example-gui/src/main/java/myapp/example/gui/components/Border.java
equanda-example/example-gui/src/main/webapp/WEB-INF/Border.html
equanda-example/example-gui/src/main/webapp/WEB-INF/Border.jwc
equanda-example/example-gui/src/main/webapp/WEB-INF/example/
equanda-example/example-gui/src/main/webapp/border.xml
equanda-example/example-gui/src/main/webapp/config.properties
equanda-example/example-gui/src/main/webapp/reports/
equanda-example/example-gui/src/main/webapp/tabtastic/
Modified: equanda-example/example-ear/pom.xml
===================================================================
--- equanda-example/example-ear/pom.xml 2007-12-24 12:22:11 UTC (rev 216)
+++ equanda-example/example-ear/pom.xml 2007-12-24 13:09:47 UTC (rev 217)
@@ -22,7 +22,7 @@
<configuration>
<displayname>example</displayname>
<description>
- Synergetics Competency Analyser
+ example equanda application
</description>
<version>1.4</version>
<defaultJavaBundleDir>/lib</defaultJavaBundleDir>
@@ -49,11 +49,6 @@
</webModule>
<!-- exclude files which are either unneeded or part of jboss distro -->
<javaModule>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <excluded>true</excluded>
- </javaModule>
- <javaModule>
<groupId>eclipse</groupId>
<artifactId>jdtcore</artifactId>
<excluded>true</excluded>
@@ -86,7 +81,7 @@
<loader-repository>example:app=ejb3</loader-repository>
</jboss>
</configuration>
- </plugin>
+ </plugin>
</plugins>
</build>
@@ -108,14 +103,6 @@
</dependency>
<!-- need to include some dependencies explicitly (especially war dependencies) -->
<dependency>
- <groupId>org.equanda</groupId>
- <artifactId>equanda-tapestry4</artifactId>
- </dependency>
- <dependency>
- <groupId>tapestry</groupId>
- <artifactId>tapestry-prop</artifactId>
- </dependency>
- <dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.0</version>
@@ -173,7 +160,7 @@
</plugin>
</plugins>
</build>
- </profile>
+ </profile>
</profiles>
</project>
Modified: equanda-example/example-gui/pom.xml
===================================================================
--- equanda-example/example-gui/pom.xml 2007-12-24 12:22:11 UTC (rev 216)
+++ equanda-example/example-gui/pom.xml 2007-12-24 13:09:47 UTC (rev 217)
@@ -20,10 +20,9 @@
<groupId>org.equanda</groupId>
<artifactId>equanda-maven-plugin</artifactId>
<configuration>
- <resources>true</resources>
<sourceDirectory>${basedir}/../src/main/om</sourceDirectory>
<outputDirectory>?</outputDirectory>
- <template>gui-descriptors</template>
+ <template>t5gui</template>
</configuration>
<executions>
<execution>
@@ -60,17 +59,11 @@
</dependency>
<dependency>
<groupId>org.equanda</groupId>
- <artifactId>equanda-tapestry4</artifactId>
+ <artifactId>equanda-tapestry5</artifactId>
</dependency>
<dependency>
- <groupId>tapestry</groupId>
- <artifactId>tapestry-prop</artifactId>
- </dependency>
- <dependency>
<groupId>org.equanda</groupId>
- <artifactId>equanda-t4-template</artifactId>
- <type>war</type>
- <scope>runtime</scope>
+ <artifactId>equanda-t5gui</artifactId>
</dependency>
<dependency>
<groupId>org.equanda</groupId>
Deleted: equanda-example/example-gui/src/main/java/myapp/example/gui/components/Border.java
===================================================================
--- equanda-example/example-gui/src/main/java/myapp/example/gui/components/Border.java 2007-12-24 12:22:11 UTC (rev 216)
+++ equanda-example/example-gui/src/main/java/myapp/example/gui/components/Border.java 2007-12-24 13:09:47 UTC (rev 217)
@@ -1,48 +0,0 @@
-/**
- * This file is part of equanda example
- *
- */
-
-package myapp.example.gui.components;
-
-import org.equanda.tapestry.util.Global;
-import org.apache.log4j.Logger;
-
-/**
- * Extra functionality for the CA border
- *
- * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
- */
-public abstract class Border
- extends org.equanda.tapestry.components.Border
-{
- public boolean isOrganizationSet()
- {
- return ( (Global) getPage().getGlobal() ).getFilter( "Organization" ) != null;
- }
-
- public String getOrganization()
- {
- return ( (Global) getPage().getGlobal() ).getFilter( "Organization" );
- }
-
- public boolean isApplicationDomainSet()
- {
- return ( (Global) getPage().getGlobal() ).getFilter( "Applicationdomain" ) != null;
- }
-
- public String getApplicationDomain()
- {
- return ( (Global) getPage().getGlobal() ).getFilter( "Applicationdomain" );
- }
-
- public boolean isContextSet()
- {
- return ( (Global) getPage().getGlobal() ).getFilter( "Context" ) != null;
- }
-
- public String getContext()
- {
- return ( (Global) getPage().getGlobal() ).getFilter( "Context" );
- }
-}
Added: equanda-example/example-gui/src/main/java/myapp/example/gui/components/EditLayout.java
===================================================================
--- equanda-example/example-gui/src/main/java/myapp/example/gui/components/EditLayout.java (rev 0)
+++ equanda-example/example-gui/src/main/java/myapp/example/gui/components/EditLayout.java 2007-12-24 13:09:47 UTC (rev 217)
@@ -0,0 +1,114 @@
+/**
+ * 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/
+ *
+ * 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.
+ */
+
+package myapp.example.gui.components;
+
+import org.apache.tapestry.annotations.Parameter;
+import org.apache.tapestry.Block;
+
+/**
+ * Layout which is used for the edit pages
+ *
+ * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
+ */
+public class EditLayout
+{
+ @Parameter
+ private Block title;
+
+ @Parameter
+ private Block context;
+
+ @Parameter
+ private Block buttons;
+
+ @Parameter
+ private Block reverseLinks;
+
+ @Parameter
+ private Block actions;
+
+ @Parameter
+ private Block help;
+
+ public Block getTitle()
+ {
+ return title;
+ }
+
+ public void setTitle( Block title )
+ {
+ this.title = title;
+ }
+
+ public Block getContext()
+ {
+ return context;
+ }
+
+ public void setContext( Block context )
+ {
+ this.context = context;
+ }
+
+ public Block getButtons()
+ {
+ return buttons;
+ }
+
+ public void setButtons( Block buttons )
+ {
+ this.buttons = buttons;
+ }
+
+ public Block getReverseLinks()
+ {
+ return reverseLinks;
+ }
+
+ public void setReverseLinks( Block reverseLinks )
+ {
+ this.reverseLinks = reverseLinks;
+ }
+
+ public Block getActions()
+ {
+ return actions;
+ }
+
+ public void setActions( Block actions )
+ {
+ this.actions = actions;
+ }
+
+ public Block getHelp()
+ {
+ return help;
+ }
+
+ public void setHelp( Block help )
+ {
+ this.help = help;
+ }
+}
Added: equanda-example/example-gui/src/main/java/myapp/example/gui/components/Layout.java
===================================================================
--- equanda-example/example-gui/src/main/java/myapp/example/gui/components/Layout.java (rev 0)
+++ equanda-example/example-gui/src/main/java/myapp/example/gui/components/Layout.java 2007-12-24 13:09:47 UTC (rev 217)
@@ -0,0 +1,153 @@
+/**
+ * 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/
+ *
+ * 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.
+ */
+
+package myapp.example.gui.components;
+
+import org.apache.tapestry.ioc.annotations.Inject;
+import org.apache.tapestry.annotations.Path;
+import org.apache.tapestry.annotations.Parameter;
+import org.apache.tapestry.Asset;
+import org.apache.tapestry.Block;
+
+/**
+ * ...
+ *
+ * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
+ */
+public class Layout
+{
+ @Inject
+ @Path("context:css/style.css")
+ private Asset style;
+
+ @Inject
+ @Path("context:images/favicon.ico")
+ private Asset favicon;
+
+ @Inject
+ @Path( "classpath:/org/equanda/tapestry5/resources/equanda.js" )
+ private Asset equandaJs;
+
+ @Inject
+ @Path("context:script/equanda.js")
+ private Asset script;
+
+ @Inject
+ @Path("context:images/synergetics.png")
+ private Asset logo;
+
+ @Parameter
+ private Block sidebar;
+
+ @Parameter
+ private Block context;
+
+ @Parameter
+ private Block title;
+
+ @Parameter
+ private Block buttons;
+
+ public Asset getEquandaJs() { return equandaJs; }
+
+ public Asset getStyle()
+ {
+ return style;
+ }
+
+ public void setStyle( Asset style )
+ {
+ this.style = style;
+ }
+
+ public Asset getFavicon()
+ {
+ return favicon;
+ }
+
+ public void setFavicon( Asset favicon )
+ {
+ this.favicon = favicon;
+ }
+
+ public Asset getScript()
+ {
+ return script;
+ }
+
+ public void setScript( Asset script )
+ {
+ this.script = script;
+ }
+
+ public Asset getLogo()
+ {
+ return logo;
+ }
+
+ public void setLogo( Asset logo )
+ {
+ this.logo = logo;
+ }
+
+ public Block getSidebar()
+ {
+ return sidebar;
+ }
+
+ public void setSidebar( Block sidebar )
+ {
+ this.sidebar = sidebar;
+ }
+
+ public Block getContext()
+ {
+ return context;
+ }
+
+ public void setContext( Block context )
+ {
+ this.context = context;
+ }
+
+ public Block getTitle()
+ {
+ return title;
+ }
+
+ public void setTitle( Block title )
+ {
+ this.title = title;
+ }
+
+ public Block getButtons()
+ {
+ return buttons;
+ }
+
+ public void setButtons( Block buttons )
+ {
+ this.buttons = buttons;
+ }
+}
Added: equanda-example/example-gui/src/main/java/myapp/example/gui/components/SelectLayout.java
===================================================================
--- equanda-example/example-gui/src/main/java/myapp/example/gui/components/SelectLayout.java (rev 0)
+++ equanda-example/example-gui/src/main/java/myapp/example/gui/components/SelectLayout.java 2007-12-24 13:09:47 UTC (rev 217)
@@ -0,0 +1,115 @@
+/**
+ * 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/
+ *
+ * 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.
+ */
+
+package myapp.example.gui.components;
+
+import org.apache.tapestry.annotations.Parameter;
+import org.apache.tapestry.Block;
+
+/**
+ * Layout which is used for the edit pages.
+ *
+ * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
+ */
+public class SelectLayout
+{
+ @Parameter
+ private Block title;
+
+ @Parameter
+ private Block context;
+
+ @Parameter
+ private Block buttons;
+
+ @Parameter
+ private Block parameters;
+
+ @Parameter
+ private Block selectors;
+
+ @Parameter
+ private Block help;
+
+ public Block getTitle()
+ {
+ return title;
+ }
+
+ public void setTitle( Block title )
+ {
+ this.title = title;
+ }
+
+ public Block getContext()
+ {
+ return context;
+ }
+
+ public void setContext( Block context )
+ {
+ this.context = context;
+ }
+
+ public Block getButtons()
+ {
+ return buttons;
+ }
+
+ public void setButtons( Block buttons )
+ {
+ this.buttons = buttons;
+ }
+
+ public Block getParameters()
+ {
+ return parameters;
+ }
+
+ public void setParameters( Block parameters )
+ {
+ this.parameters = parameters;
+ }
+
+ public Block getSelectors()
+ {
+ return selectors;
+ }
+
+ public void setSelectors( Block selectors )
+ {
+ this.selectors = selectors;
+ }
+
+ public Block getHelp()
+ {
+ return help;
+ }
+
+ public void setHelp( Block help )
+ {
+ this.help = help;
+ }
+
+}
Added: equanda-example/example-gui/src/main/java/myapp/example/gui/pages/Start.java
===================================================================
--- equanda-example/example-gui/src/main/java/myapp/example/gui/pages/Start.java (rev 0)
+++ equanda-example/example-gui/src/main/java/myapp/example/gui/pages/Start.java 2007-12-24 13:09:47 UTC (rev 217)
@@ -0,0 +1,38 @@
+/**
+ * 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/
+ *
+ * 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.
+ */
+
+package myapp.example.gui.pages;
+
+import java.util.Date;
+
+/**
+ * Start page of application ca-t5gui.
+ */
+public class Start
+{
+ public Date getCurrentTime()
+ {
+ return new Date();
+ }
+}
\ No newline at end of file
Added: equanda-example/example-gui/src/main/java/myapp/example/gui/services/AppModule.java
===================================================================
--- equanda-example/example-gui/src/main/java/myapp/example/gui/services/AppModule.java (rev 0)
+++ equanda-example/example-gui/src/main/java/myapp/example/gui/services/AppModule.java 2007-12-24 13:09:47 UTC (rev 217)
@@ -0,0 +1,149 @@
+/**
+ * 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/
+ *
+ * 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.
+ */
+
+package myapp.example.gui.services;
+
+import javassist.runtime.Desc;
+import org.apache.tapestry.Translator;
+import org.apache.tapestry.ioc.Configuration;
+import org.apache.tapestry.ioc.MappedConfiguration;
+import org.apache.tapestry.ioc.OrderedConfiguration;
+import org.apache.tapestry.ioc.ServiceBinder;
+import org.apache.tapestry.ioc.annotations.InjectService;
+import org.apache.tapestry.ioc.services.Coercion;
+import org.apache.tapestry.ioc.services.CoercionTuple;
+import org.apache.tapestry.services.Request;
+import org.apache.tapestry.services.RequestFilter;
+import org.apache.tapestry.services.RequestHandler;
+import org.apache.tapestry.services.Response;
+import org.slf4j.Logger;
+
+import java.io.IOException;
+
+/**
+ * This module is automatically included as part of the Tapestry IoC Registry, it's a good place to configure and extend
+ * Tapestry, or to place your own service definitions.
+ */
+public class AppModule
+{
+ /**
+ * Bind extra services.
+ *
+ * @param binder object to bind services to
+ */
+ public static void bind( ServiceBinder binder )
+ {
+ // binder.bind(MyServiceInterface.class, MyServiceImpl.class);
+
+ // Make bind() calls on the binder object to define most IoC services.
+ // Use service builder methods (example below) when the implementation
+ // is provided inline, or requires more initialization than simply
+ // invoking the constructor.
+
+ // assure that the ContextClassLoader is used by javassist (seems to not be the default)
+ System.out.println( "Desc.useContextClassLoader = " + Desc.useContextClassLoader );
+ javassist.runtime.Desc.useContextClassLoader = true;
+ }
+
+ /**
+ * Contribute application defaults
+ *
+ * @param configuration configuration to add to
+ */
+ public static void contributeApplicationDefaults(
+ MappedConfiguration<String, String> configuration )
+ {
+ // Contributions to ApplicationDefaults will override any contributions to
+ // FactoryDefaults (with the same key). Here we're restricting the supported
+ // locales to just "en" (English). As you add localised message catalogs and other assets,
+ // you can extend this list of locales (it's a comma seperated series of locale names;
+ // the first locale name is the default when there's no reasonable match).
+
+ configuration.add( "tapestry.supported-locales", "en,nl" );
+ }
+
+
+ /**
+ * This is a service definition, the service will be named "TimingFilter". The interface, RequestFilter, is used
+ * within the RequestHandler service pipeline, which is built from the RequestHandler service configuration.
+ * Tapestry IoC is responsible for passing in an appropriate Log instance. Requests for static resources are handled
+ * at a higher level, so this filter will only be invoked for Tapestry related requests.
+ * <p/>
+ * <p/>
+ * Service builder methods are useful when the implementation is inline as an inner class (as here) or require some
+ * other kind of special initialization. In most cases, use the static bind() method instead.
+ * <p/>
+ * <p/>
+ * If this method was named "build", then the service id would be taken from the service interface and would be
+ * "RequestFilter". Since Tapestry already defines a service named "RequestFilter" we use an explicit service id
+ * that we can reference inside the contribution method.
+ *
+ * @param log log
+ * @return request filter
+ */
+ public RequestFilter buildTimingFilter( final Logger log )
+ {
+ return new RequestFilter()
+ {
+ public boolean service( Request request, Response response, RequestHandler handler )
+ throws IOException
+ {
+ long startTime = System.currentTimeMillis();
+
+ try
+ {
+ // The reponsibility of a filter is to invoke the corresponding method
+ // in the handler. When you chain multiple filters together, each filter
+ // received a handler that is a bridge to the next filter.
+
+ return handler.service( request, response );
+ }
+ finally
+ {
+ long elapsed = System.currentTimeMillis() - startTime;
+
+ log.info( String.format( "Request time: %d ms", elapsed ) );
+ }
+ }
+ };
+ }
+
+ /**
+ * This is a contribution to the RequestHandler service configuration. This is how we extend Tapestry using the
+ * timing filter. A common use for this kind of filter is transaction management or security.
+ *
+ * @param configuration configuration to add to
+ * @param filter filter info
+ */
+ public void contributeRequestHandler( OrderedConfiguration<RequestFilter> configuration,
+ @InjectService( "TimingFilter" )
+ RequestFilter filter )
+ {
+ // Each contribution to an ordered configuration has a name, When necessary, you may
+ // set constraints to precisely control the invocation order of the contributed filter
+ // within the pipeline.
+
+ configuration.add( "Timing", filter );
+ }
+}
Added: equanda-example/example-gui/src/main/resources/myapp/example/gui/components/EditLayout.tml
===================================================================
--- equanda-example/example-gui/src/main/resources/myapp/example/gui/components/EditLayout.tml (rev 0)
+++ equanda-example/example-gui/src/main/resources/myapp/example/gui/components/EditLayout.tml 2007-12-24 13:09:47 UTC (rev 217)
@@ -0,0 +1,27 @@
+<t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+
+ <t:parameter name="title">
+ <meta http-equiv="Content-Language" content="en"/>
+ <t:delegate to="title"/>
+ </t:parameter>
+ <t:parameter name="context">
+ <t:delegate to="context"/>
+ </t:parameter>
+ <t:parameter name="buttons">
+ <t:delegate to="buttons"/>
+ </t:parameter>
+ <t:parameter name="sidebar">
+ <h2>reverse links</h2>
+ <t:delegate to="reverseLinks"/>
+ <hr/>
+ <h2>actions</h2>
+ <t:delegate to="actions"/>
+ <hr/>
+ <h2>help</h2>
+ <t:delegate to="help"/>
+ <hr/>
+ </t:parameter>
+
+ <t:body/>
+
+</t:layout>
Added: equanda-example/example-gui/src/main/resources/myapp/example/gui/components/Layout.tml
===================================================================
--- equanda-example/example-gui/src/main/resources/myapp/example/gui/components/Layout.tml (rev 0)
+++ equanda-example/example-gui/src/main/resources/myapp/example/gui/components/Layout.tml 2007-12-24 13:09:47 UTC (rev 217)
@@ -0,0 +1,111 @@
+<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+<head>
+ <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.4.0/build/reset/reset-min.css" />
+ <t:delegate to="title"/>
+ <link rel="shortcut icon" href="${favicon}" type="image/x-icon" />
+ <link type="text/css" rel="stylesheet" href="${style}" />
+ <script src="${script}" language="javascript" type="text/javascript" />
+ <script src="${equandaJs}" language="javascript" type="text/javascript" />
+</head>
+
+<body>
+
+<span t:type="equanda/FormTraversal"/>
+<div id="layout-left">
+ <span t:type="equanda/Accordion" t:id="accordion">
+ <t:parameter name="title1">Menu</t:parameter>
+ <t:parameter name="content1">
+ <div>
+ <ul>
+ <li>[<t:pagelink t:page="CompetencyAll">View all competencies</t:pagelink>]</li>
+ <li>[<t:pagelink t:page="OrganizationAll">View all organizations</t:pagelink>]</li>
+ <li>[<t:pagelink t:page="ArtifactAll">View all artifacts</t:pagelink>]</li>
+ <li><a href="nowhere">Create competency</a></li>
+ <li><a href="nowhere">Add competency profile</a></li>
+ <li><a href="nowhere">Edit competency profile</a></li>
+ <li><a href="nowhere">Find learning execution</a></li>
+ <li><a href="nowhere">Find best person</a></li>
+ </ul>
+ </div>
+ </t:parameter>
+ <t:parameter name="title2">User</t:parameter>
+ <t:parameter name="content2">
+ <div><p>Logged in user : <a href="nowhere">Joachim</a><br/>Organization : <a href="nowhere">Synergetics
+ nv</a><br/><a href="nowhere">log out</a><br/><a href="nowhere">change preferences</a><br/><a
+ href="nowhere">set as start page</a><br/></p></div>
+ </t:parameter>
+ <t:parameter name="title3">Environment</t:parameter>
+ <t:parameter name="content3">
+ <div><p>Synergetics Competency Analyzer<br/>Build <em>earlybird</em><br/></p></div>
+ </t:parameter>
+ <t:parameter name="title4">Other</t:parameter>
+ <t:parameter name="content4">
+ <div>
+ <ul>
+ <li><a href="nowhere">Data</a></li>
+ <li><a href="nowhere">Reports</a></li>
+ <li><a href="nowhere">Import</a></li>
+ <li><a href="nowhere">Export</a></li>
+ </ul>
+ </div>
+ </t:parameter>
+ <t:parameter name="title5">Help</t:parameter>
+ <t:parameter name="content5">
+ <div>
+ <p>This is the Synergetics Competency Analyzer. You can use the items above to display some common
+ options.The entire system can be used and accessed from this menu.
+ <ul>
+ <li>Menu contains common operations.</li>
+ <li>User contains user information and allows you to configure how you want to use the system.
+ </li>
+ <li>Environment.</li>
+ <li>Other gives access to all features, including the more obscure or less used stuff.</li>
+ <li>Help is where you are now.</li>
+ </ul>
+ The full manual can be viewed <a href="nowhere">here</a>.
+ </p>
+ </div>
+ </t:parameter>
+ </span>
+</div>
+<div id="layout-right">
+ <div id="layout-topbar">
+ <div id="layout-topbar-right"><t:delegate to="context"/></div>
+ <div id="layout-topbar-logo"><img src="${logo}" height="15px"/></div>
+ <div id="layout-topbar-end" />
+ </div>
+ <div id="layout-breadcrumbs">breadcrumbs bar</div>
+
+ <div id="layout-info">
+ <div id="layout-inforight"><t:delegate to="sidebar"/></div>
+ <div>
+ <t:form>
+ <div id="layout-main">
+ <t:errors/>
+ <t:body/>
+ </div>
+ <div id="layout-buttons"><t:delegate to="buttons"/></div>
+ </t:form>
+ </div>
+ </div>
+</div>
+<script type="text/javascript">
+ function setCssSizes()
+ {
+ var one = 15;
+ var padTitle = 8; /* padding + border (top+bottom) for title */
+ var padItem = 20; /* padding + border (top+bottom) for item */
+ var padMain = 6; /* padding + border (top+bottom) for main */
+ var total = equandaWindowHeight() - 5 * ( one + padTitle ) - padItem;
+ var info = equandaWindowHeight();
+ info = info - $("layout-topbar").getHeight();
+ info = info - $("layout-breadcrumbs").getHeight();
+ var main = info - $("layout-buttons").getHeight() - padMain;
+ var open = String.fromCharCode( 60 );
+ var close = String.fromCharCode( 62 );
+ document.write(open+'style'+close+'.accordion_title { height:'+one+'px; } .accordion_content { height: '+total+'px; } #layout-info { height:'+info+'px; } #layout-main { height:'+main+'px; } '+open+'/style'+close);
+ }
+ setCssSizes();
+</script>
+</body>
+</html>
Added: equanda-example/example-gui/src/main/resources/myapp/example/gui/components/SelectLayout.tml
===================================================================
--- equanda-example/example-gui/src/main/resources/myapp/example/gui/components/SelectLayout.tml (rev 0)
+++ equanda-example/example-gui/src/main/resources/myapp/example/gui/components/SelectLayout.tml 2007-12-24 13:09:47 UTC (rev 217)
@@ -0,0 +1,25 @@
+<t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+
+ <t:parameter name="title">
+ <meta http-equiv="Content-Language" content="en"/>
+ <t:delegate to="title"/>
+ </t:parameter>
+ <t:parameter name="context">
+ <t:delegate to="context"/>
+ </t:parameter>
+ <t:parameter name="buttons">
+ <t:delegate to="buttons"/>
+ </t:parameter>
+ <t:parameter name="sidebar">
+ <h2>Possible selections</h2>
+ <t:delegate to="selectors"/>
+ <hr/>
+ <h2>Help</h2>
+ <t:delegate to="help"/>
+ <hr/>
+ </t:parameter>
+
+ <t:delegate to="parameters"/>
+ <t:body/>
+
+</t:layout>
Added: equanda-example/example-gui/src/main/resources/myapp/example/gui/pages/Start.tml
===================================================================
--- equanda-example/example-gui/src/main/resources/myapp/example/gui/pages/Start.tml (rev 0)
+++ equanda-example/example-gui/src/main/resources/myapp/example/gui/pages/Start.tml 2007-12-24 13:09:47 UTC (rev 217)
@@ -0,0 +1,17 @@
+<t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+ <t:parameter name="title">
+ <meta http-equiv="Content-Language" content="en" />
+ <title>Competency Analyzer</title>
+ </t:parameter>
+ <t:parameter name="context">
+ <span id="context">context info</span>
+ </t:parameter>
+ <t:parameter name="sidebar">
+ <h1>tags</h1>
+ <p>tags with relevance or relevant links (like reverse links?)</p>
+ <h1>help</h1>
+ <p>short general page description stuff</p>
+ </t:parameter>
+
+ <p>Select what you want to do in the menu on the left.</p>
+</t:layout>
Deleted: equanda-example/example-gui/src/main/webapp/WEB-INF/Border.html
===================================================================
--- equanda-example/example-gui/src/main/webapp/WEB-INF/Border.html 2007-12-24 12:22:11 UTC (rev 216)
+++ equanda-example/example-gui/src/main/webapp/WEB-INF/Border.html 2007-12-24 13:09:47 UTC (rev 217)
@@ -1,241 +0,0 @@
-<html>
- <head>
- <title>
- Synergetics CA
- <span jwcid="@If" condition="ognl:hasInternationalizedTitle()">
- <span jwcid="@Insert" value="prop:internationalizedTitle"/>
- </span>
- </title>
- <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
-
- <link jwcid="@Any" type="text/css" media="all" href="asset:stylesheet" rel="stylesheet" />
- <link type="text/css" media="all" href="tabtastic/tabtastic.css" rel="stylesheet" />
- <link type="text/css" media="all" href="css/calendar-system.css" rel="stylesheet" />
- <link type="text/css" media="all" href="ThemeOffice/theme.css" rel="stylesheet" />
- <script type="text/javascript" src="tabtastic/addclasskillclass.js"></script>
- <script type="text/javascript" src="tabtastic/attachevent.js"></script>
- <script type="text/javascript" src="tabtastic/addcss.js"></script>
- <script type="text/javascript" src="tabtastic/tabtastic.js"></script>
- <script type="text/javascript" src="JSCookMenu.js"></script>
- <script type="text/javascript" src="ThemeOffice/theme.js"></script>
-
- <script type="text/javascript" src="dojo/dojo.js"></script>
- <script type="text/javascript">
- dojo.require("dojo.event.*");
- dojo.require("dojo.io.*");
- </script>
-
- <script type="text/javascript" src="CaseConversionScript.js"></script>
- </head>
- <body jwcid="@Body">
-
- <span jwcid="@If" condition="ognl:needsRefresh()">
- <script language="JavaScript">
- <!--
- window.location.reload( false );
- -->
- </script>
- </span>
-
- <span jwcid="@If" condition="ognl:getFormScript()">
- <script language="JavaScript" src="FormScript.js">
- </script>
- </span>
-
- <table border="0" cellpadding="4" callspacing="0" width="100%">
- <tr>
- <td align="left">
- <img src="/example/images/example.gif" width="334" height="97" border="0" vspace="0" hspace="0"/>
- </td>
- <td align="right">
- <span jwcid="@If" condition="ognl:isLoggedIn()">
- <span jwcid="@If" condition="prop:organizationSet">
- <span jwcid="@Insert" value="message:borderOrganization"/>
- <span jwcid="@Insert" value="prop:organization"/>
- </span>
- <span jwcid="@If" condition="prop:inactiveRecordsHidden">
- <input jwcid="@Any" type="checkbox" onclick="sendRequestToggleInactiveRecordsHide('Article', 'ActiveFilter', 'inactive', '0', 'Company', 'ActiveFilter', 'inactive', '0');" checked="true"><span jwcid="@Insert" value="message:HideInactiveRecords" /></input>
- </span>
- <span jwcid="@Else">
- <input jwcid="@Any" type="checkbox" onclick="sendRequestToggleInactiveRecordsHide('Article', 'ActiveFilter', 'inactive', '0', 'Company', 'ActiveFilter', 'inactive', '0');"><span jwcid="@Insert" value="message:HideInactiveRecords" /></input>
- </span>
-
-
- <script language="JavaScript">
- <!--
- function receiveToggleInactiveRecordsHide() {}
- -->
- </script>
- </span>
- <span jwcid="@UserAdminQuickAccess"/>
- </td>
- </tr>
- </table>
- <span jwcid="@If" condition="ognl:isLoggedIn()">
- <div id="menuID" style="width:10%; float:left" valign="top">
- <span jwcid="@BorderItems" menu="true" parentId="menuID"/>
- </div>
- </span>
- <div id="mainID" style="float:left; width:90%" valign="top">
- <!-- room for the actual content -->
- <script language="JavaScript">
- <!--
- function togglemenu() {
-
- var menu=document.getElementById("menuID");
- var main=document.getElementById("mainID");
-
- if (menu.style.display=='none')
- {
- menu.style.display='block';
- menu.style.width="10%";
- main.style.width="90%";
-
- } else {
- menu.style.display='none';
- main.style.width="100%";
- }
- sendRequestToggleMenu();
- }
-
- function receiveToggleMenu() {} // needed as parameter for XTile, but ignored
- -->
- </script>
- <span jwcid="@If" condition="ognl:isLoggedIn()">
- <div style="background: #EFEFDE; color: black">
- <a href="javascript:;" onClick="togglemenu();" style="float:left">menu</a>
- <center>
- <span jwcid="@NavigationHelper"/>
- <b>
- <span jwcid="@If" condition="ognl:hasTitle()">
- <span jwcid="@Insert" value="prop:title"/>
- </span>
-
- <span jwcid="@If" condition="ognl:hasInternationalizedTitle()">
- <span jwcid="@Insert" value="prop:internationalizedTitle"/>
- </span>
-
-
- <!-- let nbsp; here; otherwise, this bar is not drawn if there is no title-->
- </b>
- </center>
- </div>
- </span>
- <span jwcid="@If" condition="ognl:formCentered">
- <script language="JavaScript">
- <!--
- //at login or when menu is hidden, display the form in the center
-
- var menu=document.getElementById("menuID");
- if (menu!=null) menu.style.display="none";
- var main=document.getElementById("mainID");
- main.style.width="100%";
-
- -->
- </script>
- </span>
-
- <center>
- <span jwcid="@RenderBody"/>
- </center>
- <script language="JavaScript" src="AutoFocus.js">
- </script>
- <script language="JavaScript" src="FixNumberTranslators.js">
- </script>
-
-
- <span jwcid="@If" condition="ognl:isLoggedIn()">
- <form jwcid="@Form" id="hiddenFormID" listener="listener:hiddenFormSubmit"
- enctype="multipart/form-data" focus="ognl:false" style="display:none">
- <input jwcid="@TextField" value="prop:hiddenField1" id="borderHiddenField1Id"/>
- <input jwcid="@TextField" value="prop:hiddenField2" id="borderHiddenField2Id"/>
- </form>
- </span>
- <span jwcid="@If" condition="ognl:isNavPage()">
- <span jwcid="standby"/>
- <span jwcid="resumesb"/>
- <img src="/images/logo.png" style="filter:alpha(opacity=50); -moz-opacity:0.5" name="stai" width="0"
- height="0" border="0" vspace="0" hspace="0"/>
- <form name="lform" id="lform" style="display:none">
- <p>
- Password
- <input type="password" id="sb_password" name="sb_password"/>
- </p>
- <p align="center">
- <input type="button" id="sb_resume" name="resume" value="Resume"
- class="submitButton" onclick="callstandbyHide()"/>
- <input type="button" id="sb_login" name="login" value="Login"
- onclick="document.location='app?service=restart'"/>
- </p>
- </form>
-
- <script language="JavaScript">
- <!--
- var standbypass;
- function callstandby(pass)
- {
- // start by obtaining window (inside) width and height
- if (parseInt(navigator.appVersion)>3)
- {
- if (navigator.appName=="Netscape") {
- winW = window.innerWidth-16;
- winH = window.innerHeight-16;
- }
- if (navigator.appName.indexOf("Microsoft")!=-1) {
- winW = document.body.offsetWidth-20;
- winH = document.body.offsetHeight-20;
- }
- }
-
- standbypass = pass;
- if (standbypass=="null" || standbypass==null) standbypass="local";
-
- var stai = document.getElementsByName('stai')[0];
- var lform = document.getElementsByName('lform')[0];
- var p = document.getElementsByName('sb_password')[0];
-
- stai.style.display = "block";
- lform.style.display = "block";
-
- stai.style.position = "absolute";
- stai.style.border = "0px";
- stai.style.top = "0px";
- stai.style.left = "0px";
- stai.style.zIndex = "10";
- stai.style.width = winW + "px";
- stai.style.height = winH + "px";
-
- lform.style.position = "absolute";
- lform.style.zIndex = "11";
- lform.style.top = (winH/3) + "px";
- lform.style.left = (winW/3) + "px";
-
- p.value="";
- p.focus();
- }
- function callstandbyHide()
- {
- var p = document.getElementsByName('sb_password')[0];
- if (p && p != "" && p.value==standbypass)
- {
- var stai = document.getElementsByName('stai')[0];
- var lform = document.getElementsByName('lform')[0];
- stai.style.display = "none";
- lform.style.display = "none";
- resumesbSend();
- }
- }
- standbyTimeout();
- -->
- </script>
- </span>
-
- <span jwcid="@contrib:XTile" sendName="sendRequestToggleMenu" receiveName="receiveToggleMenu"
- listener="listener:handlerAjaxToggleMenu"/>
-
- <span jwcid="@contrib:XTile" sendName="sendRequestToggleInactiveRecordsHide" receiveName="receiveToggleInactiveRecordsHide"
- listener="listener:handlerAjaxToggleInactiveRecordsHide"/>
-
- </div>
- </body>
-</html>
\ No newline at end of file
Deleted: equanda-example/example-gui/src/main/webapp/WEB-INF/Border.jwc
===================================================================
--- equanda-example/example-gui/src/main/webapp/WEB-INF/Border.jwc 2007-12-24 12:22:11 UTC (rev 216)
+++ equanda-example/example-gui/src/main/webapp/WEB-INF/Border.jwc 2007-12-24 13:09:47 UTC (rev 217)
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- $Id: Border.jwc 2823 2006-08-07 08:40:12Z max_brod $ -->
-<!DOCTYPE component-specification PUBLIC
- "-//Apache Software Foundation//Tapestry Specification 4.0//EN"
- "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd">
-
-<component-specification class="myapp.example.gui.components.Border" allow-informal-parameters="no">
-
- <parameter name="title"/>
- <parameter name="internationalizedTitle"/>
- <parameter name="link1_name"/>
- <parameter name="link2_name"/>
- <parameter name="link1"/>
- <parameter name="link2"/>
- <parameter name="configPage"/>
- <parameter name="formScript" default-value="true"/>
-
- <asset name="stylesheet" path="/css/example.css"/>
-
- <asset name="imageGui" path="/images/gui.jpg"/>
- <asset name="imageReport" path="/images/report.jpg"/>
- <asset name="imageImport" path="/images/import.jpg"/>
-
-</component-specification>
Modified: equanda-example/example-gui/src/main/webapp/WEB-INF/web.xml
===================================================================
--- equanda-example/example-gui/src/main/webapp/WEB-INF/web.xml 2007-12-24 12:22:11 UTC (rev 216)
+++ equanda-example/example-gui/src/main/webapp/WEB-INF/web.xml 2007-12-24 13:09:47 UTC (rev 217)
@@ -1,71 +1,20 @@
-<?xml version="1.0"?>
-<!-- $Id: $ -->
-<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
- "http://java.sun.com/dtd/web-app_2_3.dtd">
-<web-app>
- <display-name>example</display-name>
-
- <filter>
- <filter-name>redirect</filter-name>
- <filter-class>org.apache.tapestry.RedirectFilter</filter-class>
- </filter>
-
- <filter-mapping>
- <filter-name>redirect</filter-name>
- <url-pattern>/</url-pattern>
- </filter-mapping>
-
- <servlet>
- <servlet-name>example</servlet-name>
- <servlet-class>org.apache.tapestry.ApplicationServlet</servlet-class>
- <init-param>
- <param-name>DatabaseMap</param-name>
- <param-value>myapp.example.ymport.DatabaseMap</param-value>
- </init-param>
- <init-param>
- <param-name>Inspector</param-name>
- <param-value>no</param-value>
- </init-param>
- <load-on-startup>1</load-on-startup>
- </servlet>
-
- <servlet-mapping>
- <servlet-name>example</servlet-name>
- <url-pattern>/app</url-pattern>
- </servlet-mapping>
-
- <security-constraint>
- <web-resource-collection>
- <web-resource-name>Secure Content</web-resource-name>
- <url-pattern>/app/*</url-pattern>
- </web-resource-collection>
-
- <auth-constraint>
- <role-name>LocalUser</role-name>
- <role-name>LocalAdmin</role-name>
- </auth-constraint>
-
- <user-data-constraint>
- <transport-guarantee>NONE</transport-guarantee>
- </user-data-constraint>
- </security-constraint>
-
- <login-config>
- <auth-method>FORM</auth-method>
- <realm-name>Restricted content</realm-name>
- <form-login-config>
- <form-login-page>/app?service=page&page=LoginPage</form-login-page>
- <form-error-page>/app?service=page&page=LoginErrorPage</form-error-page>
- </form-login-config>
- </login-config>
-
- <security-role>
- <description>Normal User</description>
- <role-name>LocalUser</role-name>
- </security-role>
- <security-role>
- <description>Administrator</description>
- <role-name>LocalAdmin</role-name>
- </security-role>
-
-</web-app>
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE web-app
+ PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+ <display-name>myapp example equanda application</display-name>
+ <context-param>
+ <!-- The only significant configuration for Tapestry 5, this informs Tapestry of where to look for pages, components and mixins. -->
+ <param-name>tapestry.app-package</param-name>
+ <param-value>myapp.example.gui</param-value>
+ </context-param>
+ <filter>
+ <filter-name>app</filter-name>
+ <filter-class>org.apache.tapestry.TapestryFilter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>app</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+</web-app>
Deleted: equanda-example/example-gui/src/main/webapp/border.xml
===================================================================
--- equanda-example/example-gui/src/main/webapp/border.xml 2007-12-24 12:22:11 UTC (rev 216)
+++ equanda-example/example-gui/src/main/webapp/border.xml 2007-12-24 13:09:47 UTC (rev 217)
@@ -1,7 +0,0 @@
-<items>
- <item page="/example/app?service=page&page=TablesIndexPage" key="menu.gui.label" id="cbGUI"/>
- <item page="/example/app?service=page&page=ReportList" icon="/images/report.jpg"
- key="menu.reports.label" id="cbREPORT"/>
- <item page="/example/app?service=page&page=Import" key="menu.import.label" id="cbIMPORT"/>
- <item page="/example/app?service=page&page=Alerts" key="menu.alerts.label" id="cbALERTS"/>
-</items>
Deleted: equanda-example/example-gui/src/main/webapp/config.properties
===================================================================
--- equanda-example/example-gui/src/main/webapp/config.properties 2007-12-24 12:22:11 UTC (rev 216)
+++ equanda-example/example-gui/src/main/webapp/config.properties 2007-12-24 13:09:47 UTC (rev 217)
@@ -1,9 +0,0 @@
-ejb-client-package=myapp.example.om.client.
-gui-max-field-length=30
-finder-limit=1000
-logo-file=logo.png
-maximum_links_in_combobox=50
-gui-select-page-size=25
-keep-alive-refresh-time=1800000
-show-stack-items=4
-timeout-sec=600
Modified: equanda-example/pom.xml
===================================================================
--- equanda-example/pom.xml 2007-12-24 12:22:11 UTC (rev 216)
+++ equanda-example/pom.xml 2007-12-24 13:09:47 UTC (rev 217)
@@ -8,7 +8,7 @@
<version>1.0-SNAPSHOT</version>
<name>example</name>
<description>
- example competency analyser
+ example equanda application
</description>
<modules>
<module>example-core</module>
@@ -17,13 +17,13 @@
<module>example-test</module>
<module>example-ddltool</module>
</modules>
- <url>http://ca.example.be</url>
+ <url>http://example.be</url>
<developers>
<developer>
- <name>Joachim Van der Auwera</name>
- <id>joachim</id>
- <email>jo...@ex...</email>
+ <name>Just Me</name>
+ <id>me</id>
+ <email>me...@ex...</email>
<timezone>+1</timezone>
<roles>
<role>project lead</role>
@@ -62,7 +62,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
- <!--<version>2.0</version>-->
+ <version>2.2</version>
<executions>
<execution>
<id>clean</id>
@@ -98,7 +98,7 @@
<dependency>
<groupId>org.staticwiki</groupId>
<artifactId>staticwiki-site-plugin</artifactId>
- <version>1.0-SNAPSHOT</version>
+ <version>${staticwiki-release-version}</version>
</dependency>
</dependencies>
</plugin>
@@ -133,7 +133,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
- <!--<version>2.0</version>-->
+ <version>2.2</version>
<configuration>
<instrumentation />
</configuration>
@@ -143,14 +143,6 @@
<artifactId>maven-ear-plugin</artifactId>
<version>2.2</version>
</plugin>
- <plugin>
- <groupId>org.codehaus.cargo</groupId>
- <artifactId>cargo-maven2-plugin</artifactId>
- <!--<version>0.2</version>-->
- <configuration>
- <instrumentation />
- </configuration>
- </plugin>
</plugins>
</reporting>
<dependencyManagement>
@@ -180,28 +172,27 @@
<dependency>
<groupId>org.equanda</groupId>
<artifactId>equanda-util</artifactId>
- <version>0.8-SNAPSHOT</version>
+ <version>${equanda-release-version}</version>
</dependency>
<dependency>
<groupId>org.equanda</groupId>
<artifactId>equanda-server</artifactId>
- <version>0.8-SNAPSHOT</version>
+ <version>${equanda-release-version}</version>
</dependency>
<dependency>
<groupId>org.equanda</groupId>
- <artifactId>equanda-tapestry4</artifactId>
- <version>0.8-SNAPSHOT</version>
+ <artifactId>equanda-tapestry5</artifactId>
+ <version>${equanda-release-version}</version>
</dependency>
<dependency>
<groupId>org.equanda</groupId>
- <artifactId>equanda-t4-template</artifactId>
- <version>0.8-SNAPSHOT</version>
- <type>war</type>
+ <artifactId>equanda-t5gui</artifactId>
+ <version>${equanda-release-version}</version>
</dependency>
<dependency>
<groupId>org.equanda</groupId>
<artifactId>equanda-maven-plugin</artifactId>
- <version>0.8-SNAPSHOT</version>
+ <version>${equanda-release-version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
@@ -355,4 +346,8 @@
</profile>
</profiles>
+ <properties>
+ <equanda-release-version>0.9-SNAPSHOT</equanda-release-version>
+ <staticwiki-release-version>0.9-SNAPSHOT</staticwiki-release-version>
+ </properties>
</project>
Modified: equanda-example/src/main/om/om.ini
===================================================================
--- equanda-example/src/main/om/om.ini 2007-12-24 12:22:11 UTC (rev 216)
+++ equanda-example/src/main/om/om.ini 2007-12-24 13:09:47 UTC (rev 217)
@@ -5,6 +5,9 @@
[ejb3]
package=myapp.example.om
+[t5gui]
+package=myapp.example.gui
+
[ddltool]
package=myapp.example.ddltool
@@ -36,4 +39,4 @@
[database,example]
type=firebird
-convert=org.equanda.persistence.xml.Max31Convert
+convert=org.equanda.domain.db.Max31Convert
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-12-24 12:22:15
|
Revision: 216
http://equanda.svn.sourceforge.net/equanda/?rev=216&view=rev
Author: triathlon98
Date: 2007-12-24 04:22:11 -0800 (Mon, 24 Dec 2007)
Log Message:
-----------
EQ-56 add selectors on proxies
Modified Paths:
--------------
trunk/equanda-generate/src/main/velocity/ejb3/ObjectProxy.java.vm
Modified: trunk/equanda-generate/src/main/velocity/ejb3/ObjectProxy.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/ejb3/ObjectProxy.java.vm 2007-12-20 13:43:36 UTC (rev 215)
+++ trunk/equanda-generate/src/main/velocity/ejb3/ObjectProxy.java.vm 2007-12-24 12:22:11 UTC (rev 216)
@@ -605,7 +605,7 @@
}
#end
- #foreach( $field in $table.Fields )
+#foreach( $field in $table.Fields )
#if( $field.isInternal() )
#set( $fieldtype=$field.JavaFieldType )
/**
@@ -619,6 +619,25 @@
public boolean isEquanda${field.Name}() { return proxy.$field.VarName; }
#end ## boolean
#end ## internal
- #end ## foreach field
+#end ## foreach field
+
+#foreach ($select in $table.Selects)
+ #set( $return="List<${table.Name}>" )
+ #if( $select.isSingle() )#set( $return="${table.Name}" )#end
+ $return select${select.Name}( $select.ParametersListWithTypes )
+ throws EquandaPersistenceException
+ {
+ ${table.Name}SelectorEJB sel = null;
+ try
+ {
+ return sel.select${select.Name}( $select.ParametersList );
+ }
+ finally
+ {
+ if ( sel != null ) sel.remove();
+ }
+ }
+#end
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-12-20 13:43:43
|
Revision: 215
http://equanda.svn.sourceforge.net/equanda/?rev=215&view=rev
Author: triathlon98
Date: 2007-12-20 05:43:36 -0800 (Thu, 20 Dec 2007)
Log Message:
-----------
remove unneeded import
Modified Paths:
--------------
trunk/equanda-tool/src/main/java/org/equanda/tool/export/object/ObjectSelector.java
Modified: trunk/equanda-tool/src/main/java/org/equanda/tool/export/object/ObjectSelector.java
===================================================================
--- trunk/equanda-tool/src/main/java/org/equanda/tool/export/object/ObjectSelector.java 2007-12-20 13:42:47 UTC (rev 214)
+++ trunk/equanda-tool/src/main/java/org/equanda/tool/export/object/ObjectSelector.java 2007-12-20 13:43:36 UTC (rev 215)
@@ -38,7 +38,6 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import murlen.util.fscript.FSObject;
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-12-20 13:42:52
|
Revision: 214
http://equanda.svn.sourceforge.net/equanda/?rev=214&view=rev
Author: triathlon98
Date: 2007-12-20 05:42:47 -0800 (Thu, 20 Dec 2007)
Log Message:
-----------
EQ-53 move some classes as part of this refactoring
Modified Paths:
--------------
trunk/equanda-generate/pom.xml
trunk/equanda-generate/src/main/java/org/equanda/generate/Generator.java
trunk/equanda-test/src/main/om/om.ini
trunk/src/site/wiki/config.wiki
Added Paths:
-----------
trunk/equanda-generate/src/main/java/org/equanda/domain/
trunk/equanda-generate/src/main/java/org/equanda/domain/db/
trunk/equanda-generate/src/main/java/org/equanda/domain/db/CodebaseConvert.java
trunk/equanda-generate/src/main/java/org/equanda/domain/db/Convert.java
trunk/equanda-generate/src/main/java/org/equanda/domain/db/Max31Convert.java
Modified: trunk/equanda-generate/pom.xml
===================================================================
--- trunk/equanda-generate/pom.xml 2007-12-20 12:44:19 UTC (rev 213)
+++ trunk/equanda-generate/pom.xml 2007-12-20 13:42:47 UTC (rev 214)
@@ -46,6 +46,10 @@
<artifactId>velocity-dep</artifactId>
</dependency>
<dependency>
+ <groupId>com.thoughtworks.xstream</groupId>
+ <artifactId>xstream</artifactId>
+ </dependency>
+ <dependency>
<groupId>jalopy</groupId>
<artifactId>jalopy</artifactId>
</dependency>
Copied: trunk/equanda-generate/src/main/java/org/equanda/domain/db/CodebaseConvert.java (from rev 201, trunk/equanda-generate/src/main/java/org/equanda/persistence/xml/CodebaseConvert.java)
===================================================================
--- trunk/equanda-generate/src/main/java/org/equanda/domain/db/CodebaseConvert.java (rev 0)
+++ trunk/equanda-generate/src/main/java/org/equanda/domain/db/CodebaseConvert.java 2007-12-20 13:42:47 UTC (rev 214)
@@ -0,0 +1,91 @@
+/**
+ * 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/
+ *
+ * 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.
+ */
+
+package org.equanda.domain.db;
+
+import org.equanda.util.INIFile;
+import org.equanda.util.SaveException;
+
+import java.io.IOException;
+
+/**
+ * convert table and field names from given names to something acceptable for the specific database Codebase ODBC driver
+ * specific implementation The conversion reads/writes a name conversion table (in the shape of an ini file)
+ *
+ * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
+ */
+public class CodebaseConvert
+ extends Convert
+{
+ public static final String FILE = "CodebaseConversion.txt";
+ INIFile convert;
+
+ public void init()
+ {
+ try
+ {
+ convert = new INIFile( FILE, true );
+ }
+ catch ( IOException e )
+ {
+ convert = new INIFile( true );
+ }
+ }
+
+ public void done()
+ {
+ try
+ {
+ convert.save( FILE );
+ }
+ catch ( IOException e )
+ {
+ SaveException.saveException( e, "on CodeBaseConvert.done()" );
+ }
+ }
+
+ public String convertTable( String name )
+ {
+ String res = convert.getValue( "table", name );
+ if ( res == null || res.equals( "" ) )
+ {
+ res = name;
+ if ( res.length() > 8 ) res = res.substring( 0, 8 );
+ convert.addValue( "table", name, res );
+ }
+ return res;
+ }
+
+ public String convertField( String name )
+ {
+ String res = convert.getValue( "field", name );
+ if ( res == null || res.equals( "" ) )
+ {
+ res = name;
+ if ( res.length() > 10 ) res = res.substring( 0, 10 );
+ convert.addValue( "field", name, res );
+ }
+ return res;
+ }
+}
Copied: trunk/equanda-generate/src/main/java/org/equanda/domain/db/Convert.java (from rev 201, trunk/equanda-generate/src/main/java/org/equanda/persistence/xml/Convert.java)
===================================================================
--- trunk/equanda-generate/src/main/java/org/equanda/domain/db/Convert.java (rev 0)
+++ trunk/equanda-generate/src/main/java/org/equanda/domain/db/Convert.java 2007-12-20 13:42:47 UTC (rev 214)
@@ -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/
+ *
+ * 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.
+ */
+
+package org.equanda.domain.db;
+
+/**
+ * convert table and field names from given names to something acceptable for the specific database Default
+ * implementation : no conversion
+ *
+ * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
+ */
+public class Convert
+{
+
+ /**
+ * initialise conversion routines, may read conversion tables
+ */
+ public void init()
+ {
+ }
+
+ /**
+ * finish off conversion routines, may be done to make conversions persistent
+ */
+ public void done()
+ {
+ }
+
+ /**
+ * convert a table name
+ *
+ * @param name
+ * @return
+ */
+ public String convertTable( String name )
+ {
+ return name;
+ }
+
+ /**
+ * convert a field name
+ *
+ * @param name
+ * @return
+ */
+ public String convertField( String name )
+ {
+ return name;
+ }
+}
Copied: trunk/equanda-generate/src/main/java/org/equanda/domain/db/Max31Convert.java (from rev 201, trunk/equanda-generate/src/main/java/org/equanda/persistence/xml/Max31Convert.java)
===================================================================
--- trunk/equanda-generate/src/main/java/org/equanda/domain/db/Max31Convert.java (rev 0)
+++ trunk/equanda-generate/src/main/java/org/equanda/domain/db/Max31Convert.java 2007-12-20 13:42:47 UTC (rev 214)
@@ -0,0 +1,62 @@
+/**
+ * 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/
+ *
+ * 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.
+ */
+
+package org.equanda.domain.db;
+
+/**
+ * convert table and field names from given names to something acceptable for the specific database Firebird only allows
+ * metadata names to be 31 characters in length.
+ *
+ * @author <a href="mailto:jo...@pr...">Joachim Van der Auwera</a>
+ */
+public class Max31Convert
+ extends Convert
+{
+ public static final int MAX_LENGTH = 31;
+
+ public String convertTable( String name )
+ {
+ if ( name.length() > MAX_LENGTH )
+ {
+ name = name.substring( 0, MAX_LENGTH );
+ }
+ return name;
+ }
+
+ public String convertField( String name )
+ {
+ if ( name.length() > MAX_LENGTH )
+ {
+ if ( name.endsWith( "_UOID" ) )
+ {
+ name = name.substring( 0, MAX_LENGTH - 5 ) + "_UOID";
+ }
+ else
+ {
+ name = name.substring( 0, MAX_LENGTH );
+ }
+ }
+ return name;
+ }
+}
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-20 12:44:19 UTC (rev 213)
+++ trunk/equanda-generate/src/main/java/org/equanda/generate/Generator.java 2007-12-20 13:42:47 UTC (rev 214)
@@ -40,6 +40,7 @@
import org.equanda.util.xml.tree.Document;
import org.equanda.util.xml.tree.Node;
import org.equanda.util.xml.tree.NodeList;
+import org.equanda.domain.db.Convert;
import org.xml.sax.*;
import javax.xml.parsers.DocumentBuilder;
Modified: trunk/equanda-test/src/main/om/om.ini
===================================================================
--- trunk/equanda-test/src/main/om/om.ini 2007-12-20 12:44:19 UTC (rev 213)
+++ trunk/equanda-test/src/main/om/om.ini 2007-12-20 13:42:47 UTC (rev 214)
@@ -37,4 +37,4 @@
[database,test]
type=firebird
-convert=org.equanda.persistence.xml.Max31Convert
+convert=org.equanda.domain.db.Max31Convert
Modified: trunk/src/site/wiki/config.wiki
===================================================================
--- trunk/src/site/wiki/config.wiki 2007-12-20 12:44:19 UTC (rev 213)
+++ trunk/src/site/wiki/config.wiki 2007-12-20 13:42:47 UTC (rev 214)
@@ -50,7 +50,7 @@
[database,myapp]
type=firebird
-convert=org.equanda.persistence.xml.Max31Convert
+convert=org.equanda.domain.db.Max31Convert
{code}
The "config" and "extra" sections contain parameters which may be used by all templates.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-12-20 12:44:20
|
Revision: 213
http://equanda.svn.sourceforge.net/equanda/?rev=213&view=rev
Author: triathlon98
Date: 2007-12-20 04:44:19 -0800 (Thu, 20 Dec 2007)
Log Message:
-----------
fix site generation
Modified Paths:
--------------
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2007-12-19 15:40:46 UTC (rev 212)
+++ trunk/pom.xml 2007-12-20 12:44:19 UTC (rev 213)
@@ -130,7 +130,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
- <!--<version>2.0</version>-->
+ <version>2.2</version>
<executions>
<execution>
<id>clean</id>
@@ -166,7 +166,7 @@
<dependency>
<groupId>org.staticwiki</groupId>
<artifactId>staticwiki-site-plugin</artifactId>
- <version>0.8</version>
+ <version>${staticwiki-release-version}</version>
</dependency>
</dependencies>
</plugin>
@@ -222,7 +222,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
- <!--<version>2.0</version>-->
+ <version>2.2</version>
<configuration>
<instrumentation></instrumentation>
</configuration>
@@ -293,6 +293,11 @@
<version>1.4</version>
</dependency>
<dependency>
+ <groupId>com.thoughtworks.xstream</groupId>
+ <artifactId>xstream</artifactId>
+ <version>1.2.2</version>
+ </dependency>
+ <dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
@@ -415,7 +420,7 @@
<dependency>
<groupId>org.staticwiki</groupId>
<artifactId>staticwiki-renderer</artifactId>
- <version>0.8</version>
+ <version>${staticwiki-release-version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.reporting</groupId>
@@ -520,6 +525,7 @@
<properties>
<tapestry-release-version>5.0.7-SNAPSHOT</tapestry-release-version>
+ <staticwiki-release-version>0.9-SNAPSHOT</staticwiki-release-version>
</properties>
</project>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-12-19 15:40:52
|
Revision: 212
http://equanda.svn.sourceforge.net/equanda/?rev=212&view=rev
Author: triathlon98
Date: 2007-12-19 07:40:46 -0800 (Wed, 19 Dec 2007)
Log Message:
-----------
EQ-116 allow determining classes in a package
Added Paths:
-----------
trunk/equanda-util/src/main/java/org/equanda/util/ReflectionUtil.java
Added: trunk/equanda-util/src/main/java/org/equanda/util/ReflectionUtil.java
===================================================================
--- trunk/equanda-util/src/main/java/org/equanda/util/ReflectionUtil.java (rev 0)
+++ trunk/equanda-util/src/main/java/org/equanda/util/ReflectionUtil.java 2007-12-19 15:40:46 UTC (rev 212)
@@ -0,0 +1,253 @@
+/**
+ * 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/
+ *
+ * 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.
+ */
+
+package org.equanda.util;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.JarURLConnection;
+import java.net.URL;
+import java.net.URLDecoder;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+
+/**
+ * based on the ReflectionUtil class in m-m-m
+ *
+ * @author Joerg Hohwiller (hohwille at users.sourceforge.net)
+ */
+public class ReflectionUtil
+{
+
+ /**
+ * This is the singleton instance of this {@link ReflectionUtil}. Instead of declaring the methods static, we declare
+ * this static instance what gives the same way of access while still allowing a design for extension by inheriting
+ * from this class.
+ */
+ public static final ReflectionUtil INSTANCE = new ReflectionUtil();
+
+ /**
+ * Forbidden constructor.
+ */
+ private ReflectionUtil()
+ {
+ super();
+ }
+
+ /**
+ * This method checks and transforms the filename of a potential {@link Class} given by <code>fileName</code>.
+ *
+ * @param fileName is the filename.
+ * @return the according Java {@link Class#getName() class-name} for the given <code>fileName</code> if it is a
+ * class-file that is no anonymous {@link Class}, else <code>null</code>.
+ */
+ private static String fixClassName( String fileName )
+ {
+
+ if ( fileName.endsWith( ".class" ) )
+ {
+ // remove extension (".class".length() == 6)
+ String nameWithoutExtension = fileName.substring( 0, fileName.length() - 6 );
+ // handle inner classes...
+ /*
+ * int lastDollar = nameWithoutExtension.lastIndexOf('$'); if (lastDollar >
+ * 0) { char innerClassStart = nameWithoutExtension.charAt(lastDollar +
+ * 1); if ((innerClassStart >= '0') && (innerClassStart <= '9')) { //
+ * ignore anonymous class } else { return
+ * nameWithoutExtension.replace('$', '.'); } } else { return
+ * nameWithoutExtension; }
+ */
+ return nameWithoutExtension;
+ }
+ return null;
+ }
+
+ /**
+ * This method finds the recursively scans the given <code>packageDirectory</code> for {@link Class} files and adds
+ * their according Java names to the given <code>classSet</code>.
+ *
+ * @param packageDirectory is the directory representing the {@link Package}.
+ * @param classSet is where to add the Java {@link Class}-names to.
+ * @param qualifiedNameBuilder is a {@link StringBuilder} containing the qualified prefix (the {@link Package} with a
+ * trailing dot).
+ * @param qualifiedNamePrefixLength the length of the prefix used to rest the string-builder after reuse.
+ */
+ private static void findClassNamesRecursive( File packageDirectory, Set<String> classSet,
+ StringBuilder qualifiedNameBuilder, int qualifiedNamePrefixLength )
+ {
+
+ for ( File childFile : packageDirectory.listFiles() )
+ {
+ String fileName = childFile.getName();
+ if ( childFile.isDirectory() )
+ {
+ qualifiedNameBuilder.setLength( qualifiedNamePrefixLength );
+ StringBuilder subBuilder = new StringBuilder( qualifiedNameBuilder );
+ subBuilder.append( fileName );
+ subBuilder.append( '.' );
+ findClassNamesRecursive( childFile, classSet, subBuilder, subBuilder.length() );
+ }
+ else
+ {
+ String simpleClassName = fixClassName( fileName );
+ if ( simpleClassName != null )
+ {
+ qualifiedNameBuilder.setLength( qualifiedNamePrefixLength );
+ qualifiedNameBuilder.append( simpleClassName );
+ classSet.add( qualifiedNameBuilder.toString() );
+ }
+ }
+ }
+ }
+
+ /**
+ * This method finds all classes that are located in the package identified by the given <code>packageName</code>.<br>
+ * <b>ATTENTION:</b><br> This is a relative expensive operation. Depending on your classpath multiple
+ * directories,JAR-, and WAR-files may need to be scanned.
+ *
+ * @param packageName is the name of the {@link Package} to scan.
+ * @param includeSubPackages - if <code>true</code> all sub-packages of the specified {@link Package} will be included
+ * in the search.
+ * @return a {@link Set} will the fully qualified names of all requested classes.
+ * @throws java.io.IOException if the operation failed with an I/O error.
+ */
+ public Set<String> findClassNames( String packageName, boolean includeSubPackages )
+ throws IOException
+ {
+
+ Set<String> classSet = new HashSet<String>();
+ findClassNames( packageName, includeSubPackages, classSet );
+ return classSet;
+ }
+
+ /**
+ * This method finds all classes that are located in the package identified by the given <code>packageName</code>.<br>
+ * <b>ATTENTION:</b><br> This is a relative expensive operation. Depending on your classpath multiple
+ * directories,JAR-, and WAR-files may need to be scanned.
+ *
+ * @param packageName is the name of the {@link Package} to scan.
+ * @param includeSubPackages - if <code>true</code> all sub-packages of the specified {@link Package} will be included
+ * in the search.
+ * @param classSet is where to add the classes.
+ * @throws IOException if the operation failed with an I/O error.
+ */
+ public void findClassNames( String packageName, boolean includeSubPackages, Set<String> classSet )
+ throws IOException
+ {
+
+ ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+ String path = packageName.replace( '.', '/' );
+ String pathWithPrefix = path + '/';
+ Enumeration<URL> urls = classLoader.getResources( path );
+ StringBuilder qualifiedNameBuilder = new StringBuilder( packageName );
+ qualifiedNameBuilder.append( '.' );
+ int qualifiedNamePrefixLength = qualifiedNameBuilder.length();
+ while ( urls.hasMoreElements() )
+ {
+ URL packageUrl = urls.nextElement();
+ String urlString = URLDecoder.decode( packageUrl.getFile(), "UTF-8" );
+ String protocol = packageUrl.getProtocol().toLowerCase();
+ if ( "file".equals( protocol ) )
+ {
+ File packageDirectory = new File( urlString );
+ if ( packageDirectory.isDirectory() )
+ {
+ if ( includeSubPackages )
+ {
+ findClassNamesRecursive( packageDirectory, classSet, qualifiedNameBuilder,
+ qualifiedNamePrefixLength );
+ }
+ else
+ {
+ for ( String fileName : packageDirectory.list() )
+ {
+ String simpleClassName = fixClassName( fileName );
+ if ( simpleClassName != null )
+ {
+ qualifiedNameBuilder.setLength( qualifiedNamePrefixLength );
+ qualifiedNameBuilder.append( simpleClassName );
+ classSet.add( qualifiedNameBuilder.toString() );
+ }
+ }
+ }
+ }
+ }
+ else if ( "jar".equals( protocol ) )
+ {
+ // somehow the connection has no close method and can NOT be disposed
+ JarURLConnection connection = (JarURLConnection) packageUrl.openConnection();
+ JarFile jarFile = connection.getJarFile();
+ Enumeration<JarEntry> jarEntryEnumeration = jarFile.entries();
+ while ( jarEntryEnumeration.hasMoreElements() )
+ {
+ JarEntry jarEntry = jarEntryEnumeration.nextElement();
+ String absoluteFileName = jarEntry.getName();
+ if ( absoluteFileName.endsWith( ".class" ) )
+ {
+ if ( absoluteFileName.startsWith( "/" ) )
+ {
+ absoluteFileName = absoluteFileName.substring( 1 );
+ }
+ // special treatment for WAR files...
+ // "WEB-INF/lib/" entries should be opened directly in contained jar
+ if ( absoluteFileName.startsWith( "WEB-INF/classes/" ) )
+ {
+ // "WEB-INF/classes/".length() == 16
+ absoluteFileName = absoluteFileName.substring( 16 );
+ }
+ boolean accept = true;
+ if ( absoluteFileName.startsWith( pathWithPrefix ) )
+ {
+ String qualifiedName = absoluteFileName.replace( '/', '.' );
+ if ( !includeSubPackages )
+ {
+ int index = absoluteFileName.indexOf( '/', qualifiedNamePrefixLength + 1 );
+ if ( index != -1 )
+ {
+ accept = false;
+ }
+ }
+ if ( accept )
+ {
+ String className = fixClassName( qualifiedName );
+ if ( className != null )
+ {
+ classSet.add( className );
+ }
+ }
+ }
+ }
+ }
+ }
+ else
+ {
+ // TODO: unknown protocol - log this?
+ }
+ }
+ }
+}
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-12-19 13:32:48
|
Revision: 211
http://equanda.svn.sourceforge.net/equanda/?rev=211&view=rev
Author: triathlon98
Date: 2007-12-19 05:32:46 -0800 (Wed, 19 Dec 2007)
Log Message:
-----------
doc improvements
Modified Paths:
--------------
trunk/src/site/wiki/index.wiki
Modified: trunk/src/site/wiki/index.wiki
===================================================================
--- trunk/src/site/wiki/index.wiki 2007-12-19 10:04:08 UTC (rev 210)
+++ trunk/src/site/wiki/index.wiki 2007-12-19 13:32:46 UTC (rev 211)
@@ -1,5 +1,5 @@
----
-*warning* this is incomplete documentation. We are working hard to improve both the feature set and the documentation. So do have a browse around, but definitely come back later to see how things evolve.
+*warning* this documentation is still somewhat incomplete. We are working hard to improve both the feature set and the documentation. So do have a browse around, but definitely come back later to see how things evolve.
----
@@ -48,81 +48,75 @@
h3. EJB3 persistence layer
-- The data model supports the following features
--- (multiple) inheritance
--- declarative constraints
--- programmed constraints
--- int, double and string fields
--- fields with multiple values
--- hard linked records (normal db links)
--- soft linked records (using an ordinary field reference, the linked record may not exist)
--- field values can be limited (choices) either statically (xml description) or programmatically (validation)
--- for removing records [cascade] can be used
--- field templates can be used
+Object model description options
+- (multiple) inheritance
+- declarative constraints
+- programmed constraints
+- int, double, string, blob, clob fields
+- fields with multiple values
+- hard linked records (normal db links)
+- soft linked records (using an ordinary field reference, the linked record may not exist)
+- field values can be limited (choices) either statically (xml description) or programmatically (validation)
+- for removing records cascade-delete, cascade-keep (don't delete when there are references to the record) or normal null all references behaviour can be used
+- field templates can be used
+Implementation
+- powerful proxies are used which make objects available remotely. Similar to detached objects, but completely transparent (no need to instantiate)
+- lazy collection instantiation, when a selector contains lots of objects, the results are still batched (and counting works too)
+- inheritance sensitive selectors
+- filters and sort orders can be defined on the selectors
+
+As a bonus, when your client only uses the proxies, it is straightforward to replace the backend (this way the data could for example be based on webservices instead of EJB3 entity beans).
+
h3. tapestry5 user interface
-- The user interface, out of the box, contains the following features
--- thin client, all browsers
--- no need for ActiveX activation of client side java
--- ajax for responsive, powerful user interface
--- easy/efficient keyboard [navigation]
--- powerful automatic cross linking of records
--- setting links using [suggest] values
--- fields can be distributed over (tab) pages with some fields be visible on all tabs
--- fields can be grouped
--- powerful user management with customization of rights
--- possible choice of visible fields per user
--- possible printout (pdf doc) of the result of selectors, with user configurable fields (screen and pdf), and column width (pdf)
--- inclusion of reporting in the user interface
--- generated components can be used to build custom pages
--- layout can be modified using css.
+- thin client, all browsers, no need for ActiveX activation of client side java
+- easy/efficient keyboard navigation
+- powerful automatic cross linking of records
+- fields can be distributed over (tab) pages with some fields be visible on all tabs
+- fields can be grouped
+- setting links using suggest values (*)
+- powerful user management with customization of rights (*)
+- possible choice of visible fields per user (*)
+- possible printout (pdf doc) of the result of selectors, with user configurable fields (screen and pdf), and column width (pdf) (*)
+- inclusion of reporting in the user interface (*)
+- generated components can be used to build custom pages
+- highly customizeably, layout components define how things are combined on screen
+- possible to change the components used for a specific type or field or on a case by case basis
+(*) ^Items marked like this are available in the old tapestry4 version and will be available again for the tapestry5 version.^
+
h3. user management support
+equanda uses an internal mechanism to configure the very granular access rights for the user interface. This is based on user information in the database. This module allows you to generate a login module which prevents duplication of user information between the application and the JAAS module.
+
h3. import data
-h3. import/export tool
+It is possible to generate code which can be used to import data from a CVS-like text file.
-h3. object model (domain model) documentation
+h3. ddltool
-{private}
-h3. tapestry4 user interface
-{private}
+This allows generation of a tool which handles database update (and optionally partial cleanup).
-- Powerful support for import and export of data using text files.
+h3. object model (domain model) documentation
-- [lazy] collections used to fetch selectors results
+Documentation for the object model can be generated. This includes html documentation, a Freemind mindmap and owl.
-- tools provided for import, export, remote printing of reports, database update (and partial cleanup)
-
-- utility classes for
--- ean128 barcode support
--- more efficient xml parsing, based on Javolution parser
--- FScript extensions
--- some useful Swing classes
-
h2. equanda modules
equanda contains several modules.
-- client
-- server
-- generate
-- maven-plugin
-- t4-template
-- t5gui
-- tapestry4
-- tapestry5
-- tool
-- util
+- [client|equanda-client/index.html] : client side code. This module needs to be included by the client components for equanda applications.
+- [server|equanda-server/index.html] : server side code which is needed for the equanda framework
+- [generate|equanda-generate/index.html] : module which handles the code generation, processing the object model and contains the templates.
+- [maven-plugin|equanda-maven-plugin/index.html] : maven plugin which allows the generation to be done as part of a maven build cycle, but also for editing the translations and doing a database update
+- [tapestry5|equanda-tapestry5/index.html] : collection of tapestry5 components which can also be used outside of equanda applications
+- [t5gui|equanda-t5gui/index.html] : collection of tapestry5 components which are specific for equanda generated applications
+- [tool|equanda-tool/index.html] : tool provided for import, export, remote printing of reports
+- [util|equanda-util/index.html] : contains several utility classes containing (amongst others) ean128 barcode support, [FScript|http://fscript.sf.net/] extensions, useful Swing classes
- test : this module is used to do integration testing. It is only included when the "-Dfulltest" switch is used in maven.
+- tapestry4, t4-template : modules for generated tapestry4 user interface, this is no longer really supported
-The [core] module is about automatic generation of a large part of an application (both user interface and data layer) from the object model.
-It can be extended to generate even more (like web services layer etc). There are provisions for the inclusion of reporting, hooks for the tools etc.
-The [util] module provides many additional services. For example for ean128 barcodes, FScript extensions etc.
-
-
h2. Technology
- The generated program uses EJB3 for the entity and session beans
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-12-19 10:04:15
|
Revision: 210
http://equanda.svn.sourceforge.net/equanda/?rev=210&view=rev
Author: triathlon98
Date: 2007-12-19 02:04:08 -0800 (Wed, 19 Dec 2007)
Log Message:
-----------
doc improvements
Modified Paths:
--------------
trunk/src/site/wiki/index.wiki
Added Paths:
-----------
trunk/equanda-generate/src/site/wiki/templates/
trunk/equanda-generate/src/site/wiki/templates/ddltool.wiki
trunk/equanda-generate/src/site/wiki/templates/docs.wiki
trunk/equanda-generate/src/site/wiki/templates/ejb3.wiki
trunk/equanda-generate/src/site/wiki/templates/gui-descriptors.wiki
trunk/equanda-generate/src/site/wiki/templates/import.wiki
trunk/equanda-generate/src/site/wiki/templates/login.wiki
trunk/equanda-generate/src/site/wiki/templates/reports.wiki
trunk/equanda-generate/src/site/wiki/templates/t5gui.wiki
Added: trunk/equanda-generate/src/site/wiki/templates/ddltool.wiki
===================================================================
--- trunk/equanda-generate/src/site/wiki/templates/ddltool.wiki (rev 0)
+++ trunk/equanda-generate/src/site/wiki/templates/ddltool.wiki 2007-12-19 10:04:08 UTC (rev 210)
@@ -0,0 +1 @@
+h1. dlltool templates
\ No newline at end of file
Added: trunk/equanda-generate/src/site/wiki/templates/docs.wiki
===================================================================
--- trunk/equanda-generate/src/site/wiki/templates/docs.wiki (rev 0)
+++ trunk/equanda-generate/src/site/wiki/templates/docs.wiki 2007-12-19 10:04:08 UTC (rev 210)
@@ -0,0 +1 @@
+h1. docs templates
\ No newline at end of file
Added: trunk/equanda-generate/src/site/wiki/templates/ejb3.wiki
===================================================================
--- trunk/equanda-generate/src/site/wiki/templates/ejb3.wiki (rev 0)
+++ trunk/equanda-generate/src/site/wiki/templates/ejb3.wiki 2007-12-19 10:04:08 UTC (rev 210)
@@ -0,0 +1 @@
+h1. ejb3 templates
Added: trunk/equanda-generate/src/site/wiki/templates/gui-descriptors.wiki
===================================================================
--- trunk/equanda-generate/src/site/wiki/templates/gui-descriptors.wiki (rev 0)
+++ trunk/equanda-generate/src/site/wiki/templates/gui-descriptors.wiki 2007-12-19 10:04:08 UTC (rev 210)
@@ -0,0 +1,4 @@
+h1. gui-descriptors templates
+
+This template generates xml user interface descriptions which are used by the tapestry4 gui rendering code to build a user interface for the object model.
+This is no longer supported as the power and configurability (not to mention developer friendlyness) of the newer tapestry5 user interface is much higher.
\ No newline at end of file
Added: trunk/equanda-generate/src/site/wiki/templates/import.wiki
===================================================================
--- trunk/equanda-generate/src/site/wiki/templates/import.wiki (rev 0)
+++ trunk/equanda-generate/src/site/wiki/templates/import.wiki 2007-12-19 10:04:08 UTC (rev 210)
@@ -0,0 +1 @@
+h1. import templates
Added: trunk/equanda-generate/src/site/wiki/templates/login.wiki
===================================================================
--- trunk/equanda-generate/src/site/wiki/templates/login.wiki (rev 0)
+++ trunk/equanda-generate/src/site/wiki/templates/login.wiki 2007-12-19 10:04:08 UTC (rev 210)
@@ -0,0 +1 @@
+h1. login templates
\ No newline at end of file
Added: trunk/equanda-generate/src/site/wiki/templates/reports.wiki
===================================================================
--- trunk/equanda-generate/src/site/wiki/templates/reports.wiki (rev 0)
+++ trunk/equanda-generate/src/site/wiki/templates/reports.wiki 2007-12-19 10:04:08 UTC (rev 210)
@@ -0,0 +1 @@
+h1. reports templates
\ No newline at end of file
Added: trunk/equanda-generate/src/site/wiki/templates/t5gui.wiki
===================================================================
--- trunk/equanda-generate/src/site/wiki/templates/t5gui.wiki (rev 0)
+++ trunk/equanda-generate/src/site/wiki/templates/t5gui.wiki 2007-12-19 10:04:08 UTC (rev 210)
@@ -0,0 +1 @@
+h1. t5gui templates
Modified: trunk/src/site/wiki/index.wiki
===================================================================
--- trunk/src/site/wiki/index.wiki 2007-12-18 22:42:41 UTC (rev 209)
+++ trunk/src/site/wiki/index.wiki 2007-12-19 10:04:08 UTC (rev 210)
@@ -9,12 +9,45 @@
This is done by generating as much as possible directly from an XML description of the the data and interactions (the _[object model|om.html]_ "om"). Some more thoughts about the concept (generation) can be found [here|http://blog.progs.be/?p=29].
-There are many ways to enhance/improve the generated application, but this is always done in such a way that most changes in the object model don't cause any problems. You just recompile (which re-generates al lthe files which needs modifying) and all the manual changes are preserved.
+There are many ways to enhance/improve the generated application, but this is always done in such a way that most changes in the object model don't cause any problems. You just recompile (which re-generates all the files which needs modifying) and all the manual changes are preserved.
The idea is that application development should be focussed on doing the important stuff (the unique features of the application), and that common aspects should only be done once (even more so because this improves consistency). The goal is to work towards a [vision|vision.html] of how application development should be (original thoughts in this [blog|http://blog.progs.be/?p=21]).
-h2. Features
+h2. Model based programming
+
+In equanda, the definition of the domain or object model is very important. This is a (xml) description which contains your data structure enriched with possible declarative constraints on your data, hints for the user interface, information about user rights etc.
+
+From this model various aspects of your application can be built. This is done using code generation based on [Velocity|http://jakarta.apache.org/velocity/] templates. The templates are written in such a way to allow programmatic customizations and extensions without affacteing the generation proces. So when your object model changes, you can just re-generate your application. The changes in the model will be propagated and your customizations will still be in place. No cut and paste or other manual labour is needed.
+
+equanda is built to have many aspects where flexibility is offered, to allow you to choose what kind of application is built.
+
+Some examples :
+- the persistence layer is built to use EJB3, but you could replace this to use web services to query the data (though currently only EJB3 templates exist).
+- user interface widgets can be replaced globally (by type or fieldname), on a per-field basis or in specific locations.
+- the user interface could be built using the interface of your choice (provided the templates exist).
+- the domain model has been used in projects to generate custom (non-soap) web services.
+- the domain model has been used in projects to generate data schema, data lists,...
+
+
+h2. Generated application features and options
+
+h3. General features
+
+equanda is intended to help you build enterprise grade (business) applications with minimal effort.
+
+The application can run in a client server environment and can be deployed on several tiers.
+Specifically, you could deploy the web server, the business tier and the database on different machines. Moreover, while the business tier needs to have access to the database tier, the (web) client tier only needs access to the business tier. This way it is possible to secure that all access to the database is forced through the business tier and to ensure that all the constraints which are enforced by the business tier cannot be evaded.
+
+Internationalization is built into the system. All the information in the system can be translated, both the messages on the user interface and the error messages. There is specific support and tools to manage the translations. This to allow seperate people (non-programmers) to manage the translations without the properties hell (where you have translation in tens or hundreds of properties files).
+
+The generation has some extra support for useability. There are efforts to make the templates as readable as possible, but to aid you the generated (java) files can be source formatted, the generated xml files can be formatted and/or validated. However, in both cases this can be disabled as well (to make generation faster).
+
+
+The following aspects of the application can be generated.
+
+h3. EJB3 persistence layer
+
- The data model supports the following features
-- (multiple) inheritance
-- declarative constraints
@@ -27,6 +60,8 @@
-- for removing records [cascade] can be used
-- field templates can be used
+h3. tapestry5 user interface
+
- The user interface, out of the box, contains the following features
-- thin client, all browsers
-- no need for ActiveX activation of client side java
@@ -43,6 +78,18 @@
-- generated components can be used to build custom pages
-- layout can be modified using css.
+h3. user management support
+
+h3. import data
+
+h3. import/export tool
+
+h3. object model (domain model) documentation
+
+{private}
+h3. tapestry4 user interface
+{private}
+
- Powerful support for import and export of data using text files.
- [lazy] collections used to fetch selectors results
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-12-18 22:42:48
|
Revision: 209
http://equanda.svn.sourceforge.net/equanda/?rev=209&view=rev
Author: triathlon98
Date: 2007-12-18 14:42:41 -0800 (Tue, 18 Dec 2007)
Log Message:
-----------
partial update of docs
Modified Paths:
--------------
trunk/src/site/wiki/index.wiki
Modified: trunk/src/site/wiki/index.wiki
===================================================================
--- trunk/src/site/wiki/index.wiki 2007-12-18 22:32:29 UTC (rev 208)
+++ trunk/src/site/wiki/index.wiki 2007-12-18 22:42:41 UTC (rev 209)
@@ -1,5 +1,5 @@
----
-*warning* this is highly preliminary information, the project (and especially the documentation) is in a very preliminary fase and will be improved soon. So do have a browse around, but definitely come back later to see how things evolve.
+*warning* this is incomplete documentation. We are working hard to improve both the feature set and the documentation. So do have a browse around, but definitely come back later to see how things evolve.
----
@@ -58,32 +58,43 @@
h2. equanda modules
equanda contains several modules.
+- client
+- server
+- generate
+- maven-plugin
+- t4-template
+- t5gui
+- tapestry4
+- tapestry5
+- tool
+- util
+- test : this module is used to do integration testing. It is only included when the "-Dfulltest" switch is used in maven.
The [core] module is about automatic generation of a large part of an application (both user interface and data layer) from the object model.
It can be extended to generate even more (like web services layer etc). There are provisions for the inclusion of reporting, hooks for the tools etc.
The [util] module provides many additional services. For example for ean128 barcodes, FScript extensions etc.
-The [build] and [template] modules are less important. The contain the build system for equanda and some template files which are needed (but can be customized) to build a full application.
h2. Technology
- The generated program uses EJB3 for the entity and session beans
-- JBoss AS is used for development of the framework (http:/www.jboss.org/)
-- Firebird database (http://www.firebirdsql.org/) is used for testing
-- The Tapestry framework (http://jakarta.apache.org/tapestry/) is used for the user interface
-- Ant (http://ant.apache.org/ant/) or maven (http://maven.apache.org) and Velocity (http://jakarta.apache.org/velocity/) are used to drive the generation
-- Javolution (http://javolution.org/) is used (mainly) to avoid garbage creation and for some extra speed.
-- FScript (http://fscript.sf.net/) for a simple, extensible scripting language
-- JasperReports () for a powerful open source reporting engine
-- junit () for unit testing
-- log4j () for logging support
-- commons httpclient ()
+- [JBoss AS|http:/www.jboss.org/] is used for development of the framework
+- [Firebird|http://www.firebirdsql.org/] database is used for testing
+- The [Tapestry framework|http://jakarta.apache.org/tapestry/] is used for the user interface
+- [maven|http://maven.apache.org] (or [Ant|http://ant.apache.org/ant/]) and [Velocity|http://jakarta.apache.org/velocity/] are used to drive the generation
+- [Javolution|http://javolution.org/] is used (mainly) to avoid garbage creation and for some extra speed.
+- [FScript|http://fscript.sf.net/] for a simple, extensible scripting language
+- JasperReports for a powerful open source reporting engine
+- junit for unit testing
+- log4j for logging support
+- commons httpclient
-[History] of the project.
+[History|history.html] of the project.
+
h2. Thanks to
- Equanda is based on [Uni-d|http://sf.net/projects/uni-d], for which the development was sponsored by [CAB-software|http://www.cab-software.be/]. The principles have proven themselves there for the implementation of [IC-trace|http://ic-trace.org].
-- The development is been sponsored by [synergetics|http://www.synergetics.be/]
+- The development is supported by [synergetics|http://www.synergetics.be/]
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-12-18 22:32:34
|
Revision: 208
http://equanda.svn.sourceforge.net/equanda/?rev=208&view=rev
Author: triathlon98
Date: 2007-12-18 14:32:29 -0800 (Tue, 18 Dec 2007)
Log Message:
-----------
EQ-105 save SelectorsState settings in session
Modified Paths:
--------------
trunk/equanda-t5gui/pom.xml
trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/AppModule.java
Modified: trunk/equanda-t5gui/pom.xml
===================================================================
--- trunk/equanda-t5gui/pom.xml 2007-12-18 15:16:26 UTC (rev 207)
+++ trunk/equanda-t5gui/pom.xml 2007-12-18 22:32:29 UTC (rev 208)
@@ -49,5 +49,10 @@
<artifactId>tapestry-core</artifactId>
<version>${tapestry-release-version}</version>
</dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
</dependencies>
</project>
Modified: trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/AppModule.java
===================================================================
--- trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/AppModule.java 2007-12-18 15:16:26 UTC (rev 207)
+++ trunk/equanda-t5gui/src/main/java/org/equanda/t5gui/services/AppModule.java 2007-12-18 22:32:29 UTC (rev 208)
@@ -24,22 +24,34 @@
package org.equanda.t5gui.services;
-import org.equanda.t5gui.translators.UoidTranslator;
import javassist.runtime.Desc;
import org.apache.tapestry.Translator;
import org.apache.tapestry.ioc.Configuration;
import org.apache.tapestry.ioc.MappedConfiguration;
+import org.apache.tapestry.ioc.OrderedConfiguration;
import org.apache.tapestry.ioc.ServiceBinder;
+import org.apache.tapestry.ioc.annotations.InjectService;
import org.apache.tapestry.ioc.services.Coercion;
import org.apache.tapestry.ioc.services.CoercionTuple;
+import org.apache.tapestry.services.*;
+import org.equanda.persistence.om.SelectorsState;
+import org.equanda.persistence.om.SelectorsStateType;
import org.equanda.persistence.om.UOID;
+import org.equanda.t5gui.translators.UoidTranslator;
+import org.slf4j.Logger;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+import java.io.IOException;
+
/**
* This module is automatically included as part of the Tapestry IoC Registry, it's a good place to configure and extend
* Tapestry, or to place your own service definitions.
*/
public class AppModule
{
+ private static final String SESSION_SELECTORSSTATE = "equandaSelectorsState";
+
/**
* Bind extra services.
*
@@ -92,4 +104,61 @@
configuration.add( UOID.class, new UoidTranslator() );
}
+ /**
+ * User management filter, the login method on the user should be called when the user logs in. If the user does not
+ * yet exist (which is possible when logging in using some SSO solution, then the user should be created).
+ *
+ * @param log log
+ * @return request filter
+ */
+ public RequestFilter buildSelectorsStateFilter( final Logger log,
+ final RequestGlobals requestGlobals )
+ {
+ return new RequestFilter()
+ {
+ public boolean service( Request request, Response response, RequestHandler handler )
+ throws IOException
+ {
+ // assure we have a user object, make it available on the session, login and set locale
+
+ HttpServletRequest servletRequest = requestGlobals.getHTTPServletRequest();
+ HttpSession session = servletRequest.getSession();
+ if ( session.getAttribute( SESSION_SELECTORSSTATE ) != null )
+ {
+ SelectorsState.setSelectorsState( (SelectorsStateType)session.getAttribute( SESSION_SELECTORSSTATE ));
+ }
+
+ try
+ {
+ // The reponsibility of a filter is to invoke the corresponding method
+ // in the handler. When you chain multiple filters together, each filter
+ // received a handler that is a bridge to the next filter.
+ return handler.service( request, response );
+ }
+ finally
+ {
+ // now store the SelectorsState back into the session
+ session.setAttribute( SESSION_SELECTORSSTATE, SelectorsState.getSelectorsState() );
+ }
+ }
+ };
+ }
+
+ /**
+ * This is a contribution to the RequestHandler service configuration. This is how we extend Tapestry using the
+ * timing filter. A common use for this kind of filter is transaction management or security.
+ *
+ * @param configuration configuration to add to
+ * @param selectorsStateFilter filter info
+ */
+ public void contributeRequestHandler( OrderedConfiguration<RequestFilter> configuration,
+ @InjectService( "SelectorsStateFilter" )RequestFilter selectorsStateFilter )
+ {
+ // Each contribution to an ordered configuration has a name, When necessary, you may
+ // set constraints to precisely control the invocation order of the contributed filter
+ // within the pipeline.
+
+ configuration.add( "SelectorsState", selectorsStateFilter );
+ }
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-12-18 15:17:02
|
Revision: 207
http://equanda.svn.sourceforge.net/equanda/?rev=207&view=rev
Author: triathlon98
Date: 2007-12-18 07:16:26 -0800 (Tue, 18 Dec 2007)
Log Message:
-----------
EQ-99 fix Display component when no object
Modified Paths:
--------------
trunk/equanda-generate/src/main/velocity/t5gui/components/Display.java.vm
trunk/equanda-generate/src/main/velocity/t5gui/components/Display.tml.vm
Modified: trunk/equanda-generate/src/main/velocity/t5gui/components/Display.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/components/Display.java.vm 2007-12-14 14:00:27 UTC (rev 206)
+++ trunk/equanda-generate/src/main/velocity/t5gui/components/Display.java.vm 2007-12-18 15:16:26 UTC (rev 207)
@@ -35,8 +35,8 @@
#set( $ejbPackage=${engine.getConfig("ejb-package")} )
import ${ejbPackage}.client.${table.Name};
import ${package}.pages.${table.Name}Edit;
+import org.apache.tapestry.annotations.InjectPage;
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;
@@ -71,4 +71,6 @@
{
this.object = object;
}
+
+ public boolean hasObject() { return object != null; }
}
Modified: trunk/equanda-generate/src/main/velocity/t5gui/components/Display.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/components/Display.tml.vm 2007-12-14 14:00:27 UTC (rev 206)
+++ trunk/equanda-generate/src/main/velocity/t5gui/components/Display.tml.vm 2007-12-18 15:16:26 UTC (rev 207)
@@ -1,5 +1,5 @@
<div xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
-
+ <t:if test="hasObject()">
<t:actionlink t:id="Edit" context="object.uOID">
#set( $sep = "" )
#foreach( $field in $table.getFields() )
@@ -13,5 +13,5 @@
#end
#end
</t:actionlink>
-
+ </t:if>
</div>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jo...@pr...> - 2007-12-18 08:07:30
|
See http://hudson.equanda.org/job/equanda/org.equanda$equanda-generate/104/changes |
|
From: <tri...@us...> - 2007-12-14 14:00:29
|
Revision: 206
http://equanda.svn.sourceforge.net/equanda/?rev=206&view=rev
Author: triathlon98
Date: 2007-12-14 06:00:27 -0800 (Fri, 14 Dec 2007)
Log Message:
-----------
EQ-99 more fixes in generation (equandaType)
Modified Paths:
--------------
trunk/equanda-generate/src/main/java/org/equanda/persistence/xml/OMRootTable.java
trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/type.tml.vm
Modified: trunk/equanda-generate/src/main/java/org/equanda/persistence/xml/OMRootTable.java
===================================================================
--- trunk/equanda-generate/src/main/java/org/equanda/persistence/xml/OMRootTable.java 2007-12-14 13:05:10 UTC (rev 205)
+++ trunk/equanda-generate/src/main/java/org/equanda/persistence/xml/OMRootTable.java 2007-12-14 14:00:27 UTC (rev 206)
@@ -24,10 +24,11 @@
package org.equanda.persistence.xml;
+import javolution.lang.TextBuilder;
import org.equanda.util.SaveException;
+import org.equanda.util.StringUtil;
import org.equanda.util.xml.tree.Node;
import org.equanda.util.xml.tree.NodeList;
-import javolution.lang.TextBuilder;
import java.util.*;
@@ -511,6 +512,37 @@
return name;
}
+ public List<TableType> getIncluded()
+ {
+ OMTable ref = getTable( name );
+ ArrayList<TableType> res = new ArrayList<TableType>();
+ for ( OMTable p : ref.getParentTables() ) res.add( new TableType( p.getType(), p.getName() ) );
+ res.add( this );
+ return res;
+ }
+
+ public List<TableType> getExcluded()
+ {
+ List<TableType> res = getTypes();
+ List<TableType> inc = getIncluded();
+ for ( TableType tt : inc ) res.remove( tt );
+ return res;
+ }
+
+ public int hashCode()
+ {
+ int res = 0;
+ if ( type != null ) res += type.hashCode();
+ if ( name != null ) res += 3 * name.hashCode();
+ return res;
+ }
+
+ public boolean equals( Object o )
+ {
+ if ( o == null || !( o instanceof TableType ) ) return false;
+ TableType other = (TableType) o;
+ return StringUtil.objectEquals( type, other.getType() ) && StringUtil.objectEquals( name, other.getName() );
+ }
}
public ArrayList<TableType> getTypes()
Modified: trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/type.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/type.tml.vm 2007-12-14 13:05:10 UTC (rev 205)
+++ trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/type.tml.vm 2007-12-14 14:00:27 UTC (rev 206)
@@ -1,21 +1,16 @@
<div class="${table.Name}-EquandaType ${table.Name}-type-">
<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>
+#foreach( $type in $table.Types )
+ <a href="javascript:;" id="Show-${table.Name}-type-${type.TrimmedType}" onclick="
+#foreach( $st in $type.Included )
+ $$('.${table.Name}-type-${st.TrimmedType}').each(function show(object){object.style.display='block';});
+#end
+#foreach( $st in $type.Excluded )
+ $$('.${table.Name}-type-${st.TrimmedType}').each(function show(object){object.style.display='none';});
+#end
+ ">${type.TrimmedType}</a>
+#end##foreach types
</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/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-12-14 13:05:12
|
Revision: 205
http://equanda.svn.sourceforge.net/equanda/?rev=205&view=rev
Author: triathlon98
Date: 2007-12-14 05:05:10 -0800 (Fri, 14 Dec 2007)
Log Message:
-----------
EQ-99 more fixes in generation
Modified Paths:
--------------
trunk/equanda-generate/src/main/java/org/equanda/persistence/xml/OMRootTable.java
trunk/equanda-generate/src/main/velocity/t5gui/components/Display.tml.vm
trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/linklist.tml.vm
trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/linkone.tml.vm
trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/page.tml.vm
trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/templates.properties
trunk/equanda-generate/src/main/velocity/t5gui.ini
Modified: trunk/equanda-generate/src/main/java/org/equanda/persistence/xml/OMRootTable.java
===================================================================
--- trunk/equanda-generate/src/main/java/org/equanda/persistence/xml/OMRootTable.java 2007-12-14 08:35:37 UTC (rev 204)
+++ trunk/equanda-generate/src/main/java/org/equanda/persistence/xml/OMRootTable.java 2007-12-14 13:05:10 UTC (rev 205)
@@ -47,13 +47,13 @@
new HashMap<String, String>(); // map with tables which inherit from this table, and their type indicator
boolean cloneable = false; // is this Table cloneable?
private String readonlyFieldsListWithTypes;
- private ArrayList<OMSelect> selects = null;
- private ArrayList<CascadeKeep> cascadeKeep = new ArrayList<CascadeKeep>();
- private ArrayList<OMSelect> linkedSelects =
+ private List<OMSelect> selects = null;
+ private List<CascadeKeep> cascadeKeep = new ArrayList<CascadeKeep>();
+ private List<OMSelect> linkedSelects =
new ArrayList<OMSelect>(); // list with selects that have a sinle parameter of this table type
- private ArrayList<OMSelect> moreLinkedSelects =
+ private List<OMSelect> moreLinkedSelects =
new ArrayList<OMSelect>(); // list with selects that have a parameter of this table type
- private ArrayList<OMSelect> suggestSelects =
+ private List<OMSelect> suggestSelects =
new ArrayList<OMSelect>(); // list with selects that are added because a suggested field
private OMField fieldReference;
private OMField fieldDescription;
@@ -93,7 +93,7 @@
}
}
- public ArrayList getCascadeKeep()
+ public List getCascadeKeep()
{
return cascadeKeep;
}
@@ -117,7 +117,7 @@
void addOMSelect( OMSelect sel )
{
- ArrayList<OMSelect> selects = getSelects();
+ List<OMSelect> selects = getSelects();
for ( OMSelect select : selects )
{
if ( sel.getName().toUpperCase().equals( select.getName().toUpperCase() ) )
@@ -164,7 +164,7 @@
void addPage( OMPage page )
{
- ArrayList<OMPage> pages = getPages();
+ List<OMPage> pages = getPages();
for ( OMPage pg : pages )
{
if ( pg.name.equals( page.name ) )
@@ -176,7 +176,7 @@
OMPage newPage = (OMPage) page.clone();
appendChild( newPage );
newPage.partOfRoot = true;
- ArrayList groups = getGroups();
+ List groups = getGroups();
for ( int i = 0; i < groups.size() ; i++ )
{
for ( int j = i + 1; j < groups.size() ; j++ )
@@ -191,7 +191,7 @@
}
}
}
- ArrayList fields = getFields();
+ List fields = getFields();
for ( int i = 0; i < fields.size() ; i++ )
{
for ( int j = i + 1; j < fields.size() ; j++ )
@@ -216,7 +216,7 @@
public OMPage getPage( String name )
{
- ArrayList<OMPage> pages = getPages();
+ List<OMPage> pages = getPages();
for ( OMPage page : pages )
{
if ( page.name.equals( name ) ) return page;
@@ -224,18 +224,29 @@
return null;
}
- public ArrayList<OMField> getFields()
+ public List<OMField> getFields()
{
- return (ArrayList<OMField>) getChildren( "field" );
+ return (List<OMField>) getChildren( "field" );
}
- public ArrayList<OMField> getSortedFields()
+ public List<OMField> getSortedFields()
{
- ArrayList<OMField> list = getFields();
+ List<OMField> list = getFields();
Collections.sort( list, new PriorityComparator() );
return list;
}
+ public List<OMField> getListDisplayField()
+ {
+ return (List<OMField>) getChildren( "field", new ListFilter<OMField>()
+ {
+ public boolean isSuitable( OMField field )
+ {
+ return field.isDisplayed() || field.isReference() || field.isDescription();
+ }
+ } );
+ }
+
class PriorityComparator
implements Comparator<OMField>
{
@@ -262,10 +273,10 @@
}
}
- public ArrayList<OMSelect> getSelects()
+ public List<OMSelect> getSelects()
{
if ( selects != null ) return selects;
- selects = (ArrayList<OMSelect>) getChildren( "select" );
+ selects = (List<OMSelect>) getChildren( "select" );
if ( !hasSelect( "EquandaAll" ) )
{
// add EquandaAll select for all tables
@@ -274,7 +285,7 @@
selectall.setSecurityRole( getSecurityRole() );
selectall.setTableName( name );
selectall.setRootTable( this );
- ArrayList<OMField> fields = getFields();
+ List<OMField> fields = getFields();
for ( OMField field : fields )
{
if ( field.isUnique() )
@@ -296,9 +307,9 @@
return selects;
}
- public ArrayList<OMBuild> getBuilders()
+ public List<OMBuild> getBuilders()
{
- ArrayList<OMBuild> builders = (ArrayList<OMBuild>) getChildren( "build" );
+ List<OMBuild> builders = (List<OMBuild>) getChildren( "build" );
if ( !hasBuild( "" ) )
{
OMBuild anonymous = new OMBuild();
@@ -308,33 +319,41 @@
return builders;
}
- public ArrayList<OMAction> getActions()
+ public List<OMAction> getActions()
{
return getChildren( "action" );
}
- public ArrayList<OMPage> getPages()
+ public List<OMPage> getPages()
{
return getChildren( "page" );
}
- public ArrayList getGroups()
+ public List getGroups()
{
return getChildren( "group" );
}
- private ArrayList getChildren( String name )
+ private List getChildren( String name )
{
+ return getChildren( name, null );
+ }
+
+ private List getChildren( String name, ListFilter filter )
+ {
NodeList nl = getNodesByTagName( name );
ArrayList<Object> list = new ArrayList<Object>( nl.getLength() );
- for ( int i = 0; i < nl.getLength() ; i++ ) list.add( nl.item( i ) );
+ for ( int i = 0; i < nl.getLength() ; i++ )
+ {
+ if ( filter == null || filter.isSuitable( nl.item( i ) ) ) list.add( nl.item( i ) );
+ }
return list;
}
// get a specific field from this table
OMField getField( String name )
{
- ArrayList<OMField> fields = getFields();
+ List<OMField> fields = getFields();
for ( OMField field : fields )
{
if ( field.getName().equals( name ) ) return field;
@@ -649,7 +668,7 @@
{
return readonlyFieldsListWithTypes;
}
- ArrayList<OMField> fields = getFields();
+ List<OMField> fields = getFields();
TextBuilder params = TextBuilder.newInstance();
for ( OMField field : fields )
{
@@ -693,7 +712,7 @@
linkedSelects.add( sel );
}
- public ArrayList getLinkedSelects()
+ public List getLinkedSelects()
{
return linkedSelects;
}
@@ -713,7 +732,7 @@
moreLinkedSelects.add( sel );
}
- public ArrayList getMoreLinkedSelects()
+ public List getMoreLinkedSelects()
{
return moreLinkedSelects;
}
@@ -746,7 +765,7 @@
}
}
- public ArrayList getSuggestSelects()
+ public List getSuggestSelects()
{
return suggestSelects;
}
@@ -782,15 +801,15 @@
}
/**
- * Returns a list of displayed fields, needed in the gui-descriptors templates
- * This is used for the display of link-fields only
+ * Returns a list of displayed fields, needed in the gui-descriptors templates This is used for the display of
+ * link-fields only
*
* @return the list of the displayed fields
*/
public String getDisplayedFields()
{
TextBuilder text = TextBuilder.newInstance();
- ArrayList<OMField> fields = getFields();
+ List<OMField> fields = getFields();
for ( OMField field : fields )
{
if ( field.isDisplayed() && !field.isLink() && !field.isMultiple() )
@@ -828,8 +847,13 @@
return getTable().getHideIfClass();
}
- public Map<String,String> getDataFilters()
+ public Map<String, String> getDataFilters()
{
return getTable().getDataFilters();
}
+
+ private interface ListFilter<T>
+ {
+ public boolean isSuitable( T object );
+ }
}
Modified: trunk/equanda-generate/src/main/velocity/t5gui/components/Display.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/components/Display.tml.vm 2007-12-14 08:35:37 UTC (rev 204)
+++ trunk/equanda-generate/src/main/velocity/t5gui/components/Display.tml.vm 2007-12-14 13:05:10 UTC (rev 205)
@@ -7,7 +7,7 @@
#if( !$field.isLink() )
$sep ${dollar}{object.${field.VarName}}
#else
- <span t:type="${engine.lowerFirst("${field.LinkTable.Name}")}.Display" t:value="object.${field.VarName}">
+ <span t:type="${engine.lowerFirst("${field.LinkTable.Name}")}/Display" t:object="object.${field.VarName}"/>
#end
#set( $sep = "," )
#end
Modified: trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/linklist.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/linklist.tml.vm 2007-12-14 08:35:37 UTC (rev 204)
+++ trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/linklist.tml.vm 2007-12-14 13:05:10 UTC (rev 205)
@@ -1,2 +1,2 @@
-<label>$field.Name</label>
-<input t:type="${field.VarName}/LinkList" t:label="${field.Name}" t:id="${field.VarName}" t:value="object.${field.VarName}"/>
+<label>${field.Name}</label>
+<input t:type="$engine.lowerFirst("${field.JavaFieldType}")/LinkList" t:label="${field.Name}" t:id="${field.VarName}" t:value="value.${field.VarName}"/>
Modified: trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/linkone.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/linkone.tml.vm 2007-12-14 08:35:37 UTC (rev 204)
+++ trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/linkone.tml.vm 2007-12-14 13:05:10 UTC (rev 205)
@@ -1,2 +1,2 @@
-<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"/>
+<label>${field.Name}</label>
+<input t:type="$engine.lowerFirst("${field.JavaFieldType}")/LinkOne" t:label="${field.Name}" t:id="${field.VarName}" t:value="value.${field.VarName}" t:setter="${field.Name}Setter"/>
Modified: trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/page.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/page.tml.vm 2007-12-14 08:35:37 UTC (rev 204)
+++ trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/page.tml.vm 2007-12-14 13:05:10 UTC (rev 205)
@@ -1,6 +1,7 @@
#if( !$page.isHidden() )
#if( $page.Name == "ALL" )
<t:parameter name="contentAll">
+#render( "field.${table.Name}.EquandaType" "field.EquandaType" "" "" )
#else
<t:parameter name="content$pageindex">
#set( $pageindex = $pageindex + 1 )
Modified: trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/templates.properties
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/templates.properties 2007-12-14 08:35:37 UTC (rev 204)
+++ trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/templates.properties 2007-12-14 13:05:10 UTC (rev 205)
@@ -4,6 +4,7 @@
field=edit-tml/field.tml.vm
type.string=edit-tml/string.tml.vm
+type.clob=edit-tml/string.tml.vm
type.double=edit-tml/double.tml.vm
type.int=edit-tml/int.tml.vm
type.date=edit-tml/date.tml.vm
Modified: trunk/equanda-generate/src/main/velocity/t5gui.ini
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui.ini 2007-12-14 08:35:37 UTC (rev 204)
+++ trunk/equanda-generate/src/main/velocity/t5gui.ini 2007-12-14 13:05:10 UTC (rev 205)
@@ -48,7 +48,7 @@
output9=${outputDir}${packageDir}components/${_table}/LinkList.java
template9=components/LinkList.java.vm
-output10=${outputDir}${packageDir}components/${_table}/linkList.tml
+output10=${outputDir}${packageDir}components/${_table}/LinkList.tml
template10=components/LinkList.tml.vm
// edit page
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-12-14 08:35:45
|
Revision: 204
http://equanda.svn.sourceforge.net/equanda/?rev=204&view=rev
Author: triathlon98
Date: 2007-12-14 00:35:37 -0800 (Fri, 14 Dec 2007)
Log Message:
-----------
EQ-99 more fixes in generation
Modified Paths:
--------------
trunk/equanda-generate/src/main/java/org/equanda/persistence/xml/OMField.java
trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/field.tml.vm
trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/group.tml.vm
trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/pages.tml.vm
trunk/equanda-generate/src/main/velocity/t5gui/pages/Edit.tml.vm
trunk/equanda-generate/src/main/velocity/t5gui/pages/Select.tml.vm
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-13 21:45:10 UTC (rev 203)
+++ trunk/equanda-generate/src/main/java/org/equanda/persistence/xml/OMField.java 2007-12-14 08:35:37 UTC (rev 204)
@@ -914,6 +914,49 @@
}
/**
+ * Get type used to template specification (specific)
+ *
+ * @return java field type
+ */
+ public String getT5guiSpecificType()
+ {
+ switch ( type )
+ {
+ case TYPE_STRING:
+ return "type.string";
+ case TYPE_BOOLEAN:
+ return "type.boolean";
+ case TYPE_DATE:
+ return "type.date";
+ case TYPE_TIMESTAMP:
+ return "type.timestamp";
+ case TYPE_INT:
+ return "type.int";
+ case TYPE_DOUBLE:
+ return "type.double";
+ case TYPE_BLOB:
+ return "type.blob";
+ case TYPE_CLOB:
+ return "type.clob";
+ case TYPE_LINK:
+ return multiple ? "type.link." + linkTable + ".list" : "type.link." + linkTableName + ".one";
+ default:
+ return "Unknown";
+ }
+ }
+
+ /**
+ * Get type used to template specification (generic)
+ *
+ * @return java field type
+ */
+ public String getT5guiGenericType()
+ {
+ if ( type == TYPE_LINK ) return multiple ? "type.link.list" : "type.link.one";
+ return "";
+ }
+
+ /**
* Get wrapping field type for field
*
* @return java wrapping field type
@@ -1693,7 +1736,7 @@
if ( sroot != null ) sroot.addSuggestSelect( suggest.getField() );
}
}
- if ( !(isString() || isClob()) && ( ( isReference() || isDescription() ) ) )
+ if ( !( isString() || isClob() ) && ( ( isReference() || isDescription() ) ) )
{
err( "only string or clob fields can be is-reference or is-description" );
}
Modified: trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/field.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/field.tml.vm 2007-12-13 21:45:10 UTC (rev 203)
+++ trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/field.tml.vm 2007-12-14 08:35:37 UTC (rev 204)
@@ -3,17 +3,8 @@
#set( $renderfirst = "" )
## no yet #set( $renderfirst = "$!field.Renderer" )
#if( "x$renderfirst" == "x" )#set( $renderfirst = "field.${table.Name}.${field.Name}" )#end
-#set( $specifictype = "type.${field.Type}" )
-#set( $generictype = "" )
-#if( $field.isLink() )
-#if( $field.isMultiple() )
- #set( $specifictype = "type.${field.FieldType}.list" )
- #set( $generictype = "type.link.list" )
-#else
- #set( $specifictype = "type.${field.FieldType}.one" )
- #set( $generictype = "type.link.one" )
-#end
-#end
+#set( $specifictype = "${field.T5guiSpecificType}" )
+#set( $generictype = "${field.T5guiGenericType}" )
#render( "$renderfirst" "field.${field.Name}" "$specifictype" "$generictype" )
<br/></div>
#end
Modified: trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/group.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/group.tml.vm 2007-12-13 21:45:10 UTC (rev 203)
+++ trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/group.tml.vm 2007-12-14 08:35:37 UTC (rev 204)
@@ -1,5 +1,5 @@
#if( !$group.isHidden() )
-#if( "x$group.Renderer" != "x" )
+#if( "x$!group.Renderer" != "x" )
#render( "$group.Renderer" "" "" "" )
#else
<fieldset>
Modified: trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/pages.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/pages.tml.vm 2007-12-13 21:45:10 UTC (rev 203)
+++ trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/pages.tml.vm 2007-12-14 08:35:37 UTC (rev 204)
@@ -1,6 +1,6 @@
<span t:type="equanda/Tabs">
## page titles
-#set( $pageindex = "1" )
+#set( $pageindex = 1 )
#foreach( $page in $table.Pages )
#if( !$page.isHidden() )
#if( $page.Name != "ALL" )
@@ -13,8 +13,27 @@
#end## foreach page
## page contents
-#set( $pageindex = "1" )
+#set( $pageindex = 1 )
#foreach( $page in $table.Pages )
#render( "page" "" "" "" )
#end
+
+ <t:parameter name="title$pageindex">Metadata</t:parameter>
+ <t:parameter name="content$pageindex">
+ <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>
Modified: trunk/equanda-generate/src/main/velocity/t5gui/pages/Edit.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/pages/Edit.tml.vm 2007-12-13 21:45:10 UTC (rev 203)
+++ trunk/equanda-generate/src/main/velocity/t5gui/pages/Edit.tml.vm 2007-12-14 08:35:37 UTC (rev 204)
@@ -17,7 +17,7 @@
#foreach( $select in $table.LinkedSelects )
<li><a href="nowhere">Find By $select.Name</a></li>
#end
- <ul>
+ </ul>
<hr/>
#end
#if( !$table.MoreLinkedSelects.isEmpty() )
Modified: trunk/equanda-generate/src/main/velocity/t5gui/pages/Select.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/pages/Select.tml.vm 2007-12-13 21:45:10 UTC (rev 203)
+++ trunk/equanda-generate/src/main/velocity/t5gui/pages/Select.tml.vm 2007-12-14 08:35:37 UTC (rev 204)
@@ -1,7 +1,7 @@
<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>
+ <title>${table.Name}, ${select.Name}</title>
</t:parameter>
<t:parameter name="context">
<span id="context">context info</span>
@@ -15,7 +15,7 @@
#set( $allSel = ${table.Selectors} )
<ul>
#foreach( $sel in $allSel )
-#if( $sel.Name != $selector.Name )
+#if( $sel.Name != $select.Name )
<li><a t:type="pagelink" t:page="${table.Name}${sel.Name}">${sel.Name}</a></li>
#end
#end
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-12-13 21:45:53
|
Revision: 203
http://equanda.svn.sourceforge.net/equanda/?rev=203&view=rev
Author: triathlon98
Date: 2007-12-13 13:45:10 -0800 (Thu, 13 Dec 2007)
Log Message:
-----------
fix AppModule reference
Modified Paths:
--------------
trunk/equanda-t5gui/pom.xml
Modified: trunk/equanda-t5gui/pom.xml
===================================================================
--- trunk/equanda-t5gui/pom.xml 2007-12-13 01:04:47 UTC (rev 202)
+++ trunk/equanda-t5gui/pom.xml 2007-12-13 21:45:10 UTC (rev 203)
@@ -20,7 +20,7 @@
<configuration>
<archive>
<manifestEntries>
- <Tapestry-Module-Classes>org.equanda.t5gui.services.EquandaModule</Tapestry-Module-Classes>
+ <Tapestry-Module-Classes>org.equanda.t5gui.services.AppModule</Tapestry-Module-Classes>
</manifestEntries>
</archive>
</configuration>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-12-13 01:04:52
|
Revision: 202
http://equanda.svn.sourceforge.net/equanda/?rev=202&view=rev
Author: triathlon98
Date: 2007-12-12 17:04:47 -0800 (Wed, 12 Dec 2007)
Log Message:
-----------
add tapestry snapshot repo
Modified Paths:
--------------
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2007-12-13 00:50:46 UTC (rev 201)
+++ trunk/pom.xml 2007-12-13 01:04:47 UTC (rev 202)
@@ -438,6 +438,10 @@
<id>OpenQA</id>
<url>http://maven.openqa.org</url>
</repository>
+ <repository>
+ <id>tapestry-snapshots</id>
+ <url>http://tapestry.formos.com/maven-snapshot-repository/</url>
+ </repository>
</repositories>
<distributionManagement>
<repository>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-12-13 00:50:51
|
Revision: 201
http://equanda.svn.sourceforge.net/equanda/?rev=201&view=rev
Author: triathlon98
Date: 2007-12-12 16:50:46 -0800 (Wed, 12 Dec 2007)
Log Message:
-----------
EQ-99 properly(?) render templates, with config (but not renderer tag)
Modified Paths:
--------------
trunk/equanda-generate/src/main/java/org/equanda/generate/Generator.java
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/LinkOne.java.vm
trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/field.tml.vm
trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/linklist.tml.vm
trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/linkone.tml.vm
trunk/equanda-generate/src/main/velocity/t5gui/pages/Edit.tml.vm
trunk/equanda-generate/src/main/velocity/t5gui/pages/Select.java.vm
trunk/equanda-generate/src/main/velocity/t5gui.ini
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-12 14:51:57 UTC (rev 200)
+++ trunk/equanda-generate/src/main/java/org/equanda/generate/Generator.java 2007-12-13 00:50:46 UTC (rev 201)
@@ -289,7 +289,7 @@
// initialize key-value pairs which are available to the templates
keyValue.clear();
- String keyValueLocation = templateDefinition.getValue( "config", "path" );
+ String keyValueLocation = templateDefinition.getValue( "config", "keyvalue" );
if ( keyValueLocation != null && !"".equals( keyValueLocation ) )
{
mergeKeyValues( keyValue, keyValueLocation );
@@ -370,6 +370,7 @@
// build context
context.put( "engine", this );
context.put( "name", "equanda" );
+ context.put( "dollar", "$" );
context.put( "data", doc.getDocumentRoot() );
context.put( "package", packageName );
context.put( "generationdate", new java.util.Date().toString() );
@@ -515,7 +516,15 @@
try
{
InputStream is = new EquandaResourceLoader().getResourceStream( keyValueLocation );
- if ( is != null ) prop.load( is );
+ if ( is != null )
+ {
+ prop.load( is );
+ }
+ else
+ {
+ failed = true;
+ System.err.println( "no keys found to merge at " + keyValueLocation );
+ }
}
catch ( IOException ioe ) { System.err.println( ioe );}
catch ( ResourceNotFoundException rnfe ) { System.err.println( rnfe );}
Modified: trunk/equanda-generate/src/main/velocity/t5gui/components/Display.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/components/Display.tml.vm 2007-12-12 14:51:57 UTC (rev 200)
+++ trunk/equanda-generate/src/main/velocity/t5gui/components/Display.tml.vm 2007-12-13 00:50:46 UTC (rev 201)
@@ -5,7 +5,7 @@
#foreach( $field in $table.getFields() )
#if( $field.isReference() || $field.isDescription() || $field.isDisplayed() )
#if( !$field.isLink() )
- $sep \$\{object.${field.VarName}\}
+ $sep ${dollar}{object.${field.VarName}}
#else
<span t:type="${engine.lowerFirst("${field.LinkTable.Name}")}.Display" t:value="object.${field.VarName}">
#end
Modified: trunk/equanda-generate/src/main/velocity/t5gui/components/Edit.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/components/Edit.java.vm 2007-12-12 14:51:57 UTC (rev 200)
+++ trunk/equanda-generate/src/main/velocity/t5gui/components/Edit.java.vm 2007-12-13 00:50:46 UTC (rev 201)
@@ -93,7 +93,7 @@
#foreach( $field in $table.Fields)
#if( $field.isLink() && !$field.isMultiple() )
- public SelectedSetter<$field.FieldTypeName> getOrganizationSetter()
+ public SelectedSetter<$field.FieldTypeName> get${field.Name}Setter()
{
return new SelectedSetter<${field.FieldTypeName}>() {
${table.Name} keep = value;
Modified: trunk/equanda-generate/src/main/velocity/t5gui/components/Edit.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/components/Edit.tml.vm 2007-12-12 14:51:57 UTC (rev 200)
+++ trunk/equanda-generate/src/main/velocity/t5gui/components/Edit.tml.vm 2007-12-13 00:50:46 UTC (rev 201)
@@ -2,23 +2,23 @@
#macro( render $key1 $key2 $key3 $key4 )
#set( $file = "" )
-#set( $file = $keyvalue.get("key1") )
+#set( $file = $keyvalue.getProperty("$key1") )
#if( "x$file" != "x" )
#parse( "$file" )
#else
-#set( $file = $keyvalue.get("key2") )
+#set( $file = $keyvalue.getProperty("$key2") )
#if( "x$file" != "x" )
#parse( "$file" )
#else
-#set( $file = $keyvalue.get("key3") )
+#set( $file = $keyvalue.getProperty("$key3") )
#if( "x$file" != "x" )
#parse( "$file" )
#else
-#set( $file = $keyvalue.get("key4") )
+#set( $file = $keyvalue.getProperty("$key4") )
#if( "x$file" != "x" )
#parse( "$file" )
#else
-"No renderer for object $key1 $key2 $key3"
+"No renderer for object $key1 $key2 $key3 $key4"
#end##key4
#end##key3
#end##key2
Modified: trunk/equanda-generate/src/main/velocity/t5gui/components/LinkList.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/components/LinkList.java.vm 2007-12-12 14:51:57 UTC (rev 200)
+++ trunk/equanda-generate/src/main/velocity/t5gui/components/LinkList.java.vm 2007-12-13 00:50:46 UTC (rev 201)
@@ -35,7 +35,7 @@
#set( $ejbPackage=${engine.getConfig("ejb-package")} )
import ${ejbPackage}.client.${table.Name};
import org.equanda.t5gui.SelectedSettings;
-import ${package}.pages.${table.Name}All;
+import ${package}.pages.${table.Name}EquandaAll;
import ${package}.pages.${table.Name}Edit;
import org.apache.tapestry.ComponentResources;
import org.apache.tapestry.annotations.InjectPage;
@@ -54,7 +54,7 @@
private List<${table.Name}> value;
@InjectPage
- private ${table.Name}All select;
+ private ${table.Name}EquandaAll select;
@Inject
private ComponentResources resources;
Modified: trunk/equanda-generate/src/main/velocity/t5gui/components/LinkOne.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/components/LinkOne.java.vm 2007-12-12 14:51:57 UTC (rev 200)
+++ trunk/equanda-generate/src/main/velocity/t5gui/components/LinkOne.java.vm 2007-12-13 00:50:46 UTC (rev 201)
@@ -36,7 +36,7 @@
import ${ejbPackage}.client.${table.Name};
import org.equanda.t5gui.SelectedSetter;
import org.equanda.t5gui.SelectedSettings;
-import ${package}.pages.${table.Name}All;
+import ${package}.pages.${table.Name}EquandaAll;
import org.apache.tapestry.ComponentResources;
import org.apache.tapestry.annotations.InjectPage;
import org.apache.tapestry.annotations.Parameter;
@@ -54,7 +54,7 @@
private SelectedSetter<${table.Name}> setter;
@InjectPage
- private ${table.Name}All select;
+ private ${table.Name}EquandaAll select;
@Inject
private ComponentResources resources;
Modified: trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/field.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/field.tml.vm 2007-12-12 14:51:57 UTC (rev 200)
+++ trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/field.tml.vm 2007-12-13 00:50:46 UTC (rev 201)
@@ -1,18 +1,19 @@
#if( !$field.isHidden() )
<div class="${table.Name}-${field.Name} ${table.Name}-type-${field.TableType}">
-#set( $renderfirst = "$field.Renderer" )
-#if( "x$renderfirst" == "x" )#set( $renderfirst = "field.${table.Name}.{$field.Name}" )#end
+#set( $renderfirst = "" )
+## no yet #set( $renderfirst = "$!field.Renderer" )
+#if( "x$renderfirst" == "x" )#set( $renderfirst = "field.${table.Name}.${field.Name}" )#end
#set( $specifictype = "type.${field.Type}" )
#set( $generictype = "" )
#if( $field.isLink() )
#if( $field.isMultiple() )
- #set( $specifictype = "type.${field.Type}.list" )
+ #set( $specifictype = "type.${field.FieldType}.list" )
#set( $generictype = "type.link.list" )
#else
- #set( $specifictype = "type.${field.Type}.one" )
+ #set( $specifictype = "type.${field.FieldType}.one" )
#set( $generictype = "type.link.one" )
#end
#end
-#render( "$renderer" "field.{$field.Name}" "$specifictype" "$generictype" )
+#render( "$renderfirst" "field.${field.Name}" "$specifictype" "$generictype" )
<br/></div>
#end
Modified: trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/linklist.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/linklist.tml.vm 2007-12-12 14:51:57 UTC (rev 200)
+++ trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/linklist.tml.vm 2007-12-13 00:50:46 UTC (rev 201)
@@ -0,0 +1,2 @@
+<label>$field.Name</label>
+<input t:type="${field.VarName}/LinkList" t:label="${field.Name}" t:id="${field.VarName}" t:value="object.${field.VarName}"/>
Modified: trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/linkone.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/linkone.tml.vm 2007-12-12 14:51:57 UTC (rev 200)
+++ trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/linkone.tml.vm 2007-12-13 00:50:46 UTC (rev 201)
@@ -0,0 +1,2 @@
+<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"/>
Modified: trunk/equanda-generate/src/main/velocity/t5gui/pages/Edit.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/pages/Edit.tml.vm 2007-12-12 14:51:57 UTC (rev 200)
+++ trunk/equanda-generate/src/main/velocity/t5gui/pages/Edit.tml.vm 2007-12-13 00:50:46 UTC (rev 201)
@@ -3,7 +3,7 @@
<title>${table.Name}, Edit</title>
</t:parameter>
<t:parameter name="context">
- <span id="context">uoid \$\{object?.uOID\}</span>
+ <span id="context">uoid ${dollar}{object?.uOID}</span>
</t:parameter>
<t:parameter name="buttons">
<input class="defaultSubmit" t:type="submit" value="Save" t:id="save"/>
Modified: trunk/equanda-generate/src/main/velocity/t5gui/pages/Select.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/pages/Select.java.vm 2007-12-12 14:51:57 UTC (rev 200)
+++ trunk/equanda-generate/src/main/velocity/t5gui/pages/Select.java.vm 2007-12-13 00:50:46 UTC (rev 201)
@@ -40,9 +40,11 @@
import ${package}.base.SelectPageBase;
import org.apache.log4j.Logger;
import org.apache.tapestry.annotations.InjectPage;
+import org.apache.tapestry.annotations.Persist;
import org.equanda.persistence.om.EquandaPersistenceException;
import java.util.List;
+import java.util.ArrayList;
/**
* Object selector page
@@ -57,17 +59,18 @@
public ${table.Name}Edit getEquandaCreatePage() { return equandaCreatePage; }
-#foreach( $par in $select.Selections )
-#if( $par.isTestComparison() && $par.isParameter() )
+#foreach( $sel in $select.Selections )
+#if( $sel.isTestComparison() && $sel.isParameter() )
@Persist
- ${sel.JavaFieldType} ${sel.VarName};
+ ${sel.Field.JavaFieldType} ${sel.VarName};
- public ${sel.JavaFieldType} get${sel.Name}() { return $sel.VarName; }
+ public ${sel.Field.JavaFieldType} get${sel.Name}() { return $sel.VarName; }
+ public void set${sel.Name}( ${sel.Field.JavaFieldType} obj ) { this.$sel.VarName = obj; }
#end
#end
- private static final ListGetter<${table.Name}> SELECTOR = new ListGetter<${table.Name}>()
+ private final ListGetter<${table.Name}> SELECTOR = new ListGetter<${table.Name}>()
{
public List<${table.Name}> getList()
{
@@ -75,7 +78,13 @@
List<${table.Name}> list = null;
try
{
+ #if( $select.isSingle() )
+ $table.Name one = sel.select${select.Name}( $select.ParametersListNoLimit );
+ list = new ArrayList<${table.Name}>();
+ if ( one != null ) list.add( one );
+ #else
list = sel.select${select.Name}( $select.ParametersListNoLimit );
+ #end
}
catch ( EquandaPersistenceException ee )
{
Modified: trunk/equanda-generate/src/main/velocity/t5gui.ini
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui.ini 2007-12-12 14:51:57 UTC (rev 200)
+++ trunk/equanda-generate/src/main/velocity/t5gui.ini 2007-12-13 00:50:46 UTC (rev 201)
@@ -1,6 +1,6 @@
[config]
path=t5gui
-keyvalue=t5gui/edit.tml/templates.properties
+keyvalue=t5gui/edit-tml/templates.properties
[global]
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-12-12 14:52:03
|
Revision: 200
http://equanda.svn.sourceforge.net/equanda/?rev=200&view=rev
Author: triathlon98
Date: 2007-12-12 06:51:57 -0800 (Wed, 12 Dec 2007)
Log Message:
-----------
EQ-99 (partial) fixed component classes, generate edit templates (with configurability)
Modified Paths:
--------------
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/LinkOne.java.vm
trunk/equanda-generate/src/main/velocity/t5gui/components/Select.java.vm
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.ini
Added Paths:
-----------
trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/boolean.tml.vm
trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/date.tml.vm
trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/double.tml.vm
trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/field.tml.vm
trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/group.tml.vm
trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/int.tml.vm
trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/linklist.tml.vm
trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/linkone.tml.vm
trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/page.tml.vm
trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/pages.tml.vm
trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/string.tml.vm
trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/templates.properties
trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/timestamp.tml.vm
trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/type.tml.vm
trunk/equanda-generate/src/main/velocity/t5gui/pages/Select.java.vm
trunk/equanda-generate/src/main/velocity/t5gui/pages/Select.tml.vm
Removed Paths:
-------------
trunk/equanda-generate/src/main/velocity/t5gui/pages/Selector.java.vm
trunk/equanda-generate/src/main/velocity/t5gui/pages/Selector.tml.vm
Modified: trunk/equanda-generate/src/main/velocity/t5gui/components/Display.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/components/Display.java.vm 2007-12-12 14:27:54 UTC (rev 199)
+++ trunk/equanda-generate/src/main/velocity/t5gui/components/Display.java.vm 2007-12-12 14:51:57 UTC (rev 200)
@@ -32,6 +32,7 @@
package ${package}.components.${engine.lowerFirst("$table.Name")};
+#set( $ejbPackage=${engine.getConfig("ejb-package")} )
import ${ejbPackage}.client.${table.Name};
import ${package}.pages.${table.Name}Edit;
import org.apache.tapestry.annotations.Parameter;
Modified: trunk/equanda-generate/src/main/velocity/t5gui/components/Display.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/components/Display.tml.vm 2007-12-12 14:27:54 UTC (rev 199)
+++ trunk/equanda-generate/src/main/velocity/t5gui/components/Display.tml.vm 2007-12-12 14:51:57 UTC (rev 200)
@@ -3,11 +3,11 @@
<t:actionlink t:id="Edit" context="object.uOID">
#set( $sep = "" )
#foreach( $field in $table.getFields() )
-#if( $field.isReference() || $field.isDescription || !field.isDisplay() )
+#if( $field.isReference() || $field.isDescription() || $field.isDisplayed() )
#if( !$field.isLink() )
- $sep \${object.${field.VarName}}
+ $sep \$\{object.${field.VarName}\}
#else
- <span t:type="${engine.lowerFirst(${field.LinkTable.Name}"}.Display" t:value="object.${field.VarName}">
+ <span t:type="${engine.lowerFirst("${field.LinkTable.Name}")}.Display" t:value="object.${field.VarName}">
#end
#set( $sep = "," )
#end
Modified: trunk/equanda-generate/src/main/velocity/t5gui/components/Edit.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/components/Edit.java.vm 2007-12-12 14:27:54 UTC (rev 199)
+++ trunk/equanda-generate/src/main/velocity/t5gui/components/Edit.java.vm 2007-12-12 14:51:57 UTC (rev 200)
@@ -32,9 +32,21 @@
package ${package}.components.${engine.lowerFirst("$table.Name")};
-import ${ejbPackage}.client.${table.Name};
+#set( $ejbPackage=${engine.getConfig("ejb-package")} )
+import ${ejbPackage}.client.*;
+import org.equanda.t5gui.SelectedSetter;
+import org.apache.tapestry.OptionModel;
+import org.apache.tapestry.SelectModel;
+import org.apache.tapestry.ValueEncoder;
import org.apache.tapestry.annotations.Parameter;
+import org.apache.tapestry.internal.OptionModelImpl;
+import org.apache.tapestry.internal.SelectModelImpl;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
/**
* Object edit component
*/
@@ -46,4 +58,51 @@
public ${table.Name} getValue() { return value; }
public void setValue( ${table.Name} value ) { this.value = value; }
+
+ public boolean isTypeKnown() { return value.getUOID() != null; }
+
+ public ValueEncoder getTypeEncoder()
+ {
+ return new ValueEncoder<String>()
+ {
+ public String toClient( String o )
+ {
+ return o;
+ }
+
+ public String toValue( String s )
+ {
+ return s;
+ }
+ };
+ }
+
+ public SelectModel getTypeModel()
+ {
+ List<OptionModel> list = new ArrayList<OptionModel>();
+ ${table.Name}Type type = new ${table.Name}Type();
+ Collection<String> values = type.getAllowedStringValues();
+ Iterator<String> names = type.getAllowedStringNames().iterator();
+ for ( String value : values )
+ {
+ String name = names.next();
+ list.add( new OptionModelImpl( name, false, value ) );
+ }
+ return new SelectModelImpl( null, list );
+ }
+
+#foreach( $field in $table.Fields)
+#if( $field.isLink() && !$field.isMultiple() )
+ public SelectedSetter<$field.FieldTypeName> getOrganizationSetter()
+ {
+ return new SelectedSetter<${field.FieldTypeName}>() {
+ ${table.Name} keep = value;
+ public void setSelected( ${field.FieldTypeName} newValue )
+ {
+ keep.set${field.Name}( newValue );
+ }
+ };
+ }
+#end
+#end
}
Modified: trunk/equanda-generate/src/main/velocity/t5gui/components/Edit.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/components/Edit.tml.vm 2007-12-12 14:27:54 UTC (rev 199)
+++ trunk/equanda-generate/src/main/velocity/t5gui/components/Edit.tml.vm 2007-12-12 14:51:57 UTC (rev 200)
@@ -1,115 +1,34 @@
-<div xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+<div class="${table.Name}-edit" 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/>
+#macro( render $key1 $key2 $key3 $key4 )
+#set( $file = "" )
+#set( $file = $keyvalue.get("key1") )
+#if( "x$file" != "x" )
+#parse( "$file" )
+#else
+#set( $file = $keyvalue.get("key2") )
+#if( "x$file" != "x" )
+#parse( "$file" )
+#else
+#set( $file = $keyvalue.get("key3") )
+#if( "x$file" != "x" )
+#parse( "$file" )
+#else
+#set( $file = $keyvalue.get("key4") )
+#if( "x$file" != "x" )
+#parse( "$file" )
+#else
+"No renderer for object $key1 $key2 $key3"
+#end##key4
+#end##key3
+#end##key2
+#end##key1
+#end##macro
- <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>
+## render all the pages in the form
+#render( "pages" "" "" "" )
+## and assure that the correct fields are visible based on the type
+<script type="text/javascript">$$('.${table.Name}-type-Selector')[0].onchange();</script>
+
</div>
Modified: trunk/equanda-generate/src/main/velocity/t5gui/components/LinkList.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/components/LinkList.java.vm 2007-12-12 14:27:54 UTC (rev 199)
+++ trunk/equanda-generate/src/main/velocity/t5gui/components/LinkList.java.vm 2007-12-12 14:51:57 UTC (rev 200)
@@ -32,6 +32,7 @@
package ${package}.components.${engine.lowerFirst("$table.Name")};
+#set( $ejbPackage=${engine.getConfig("ejb-package")} )
import ${ejbPackage}.client.${table.Name};
import org.equanda.t5gui.SelectedSettings;
import ${package}.pages.${table.Name}All;
Modified: trunk/equanda-generate/src/main/velocity/t5gui/components/LinkOne.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/components/LinkOne.java.vm 2007-12-12 14:27:54 UTC (rev 199)
+++ trunk/equanda-generate/src/main/velocity/t5gui/components/LinkOne.java.vm 2007-12-12 14:51:57 UTC (rev 200)
@@ -32,6 +32,7 @@
package ${package}.components.${engine.lowerFirst("$table.Name")};
+#set( $ejbPackage=${engine.getConfig("ejb-package")} )
import ${ejbPackage}.client.${table.Name};
import org.equanda.t5gui.SelectedSetter;
import org.equanda.t5gui.SelectedSettings;
Modified: trunk/equanda-generate/src/main/velocity/t5gui/components/Select.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/components/Select.java.vm 2007-12-12 14:27:54 UTC (rev 199)
+++ trunk/equanda-generate/src/main/velocity/t5gui/components/Select.java.vm 2007-12-12 14:51:57 UTC (rev 200)
@@ -32,6 +32,7 @@
package ${package}.components.${engine.lowerFirst("$table.Name")};
+#set( $ejbPackage=${engine.getConfig("ejb-package")} )
import ${ejbPackage}.client.EquandaGlobal;
import ${ejbPackage}.client.${table.Name};
import ${ejbPackage}.client.${table.Name}SelectorEJB;
@@ -79,17 +80,11 @@
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 = "," )
+#if( $field.isReference() || $field.isDescription() || $field.isDisplayed() )
+ model.add( "$field.VarName" );
#end
#end
- );
- model.add( "reference" );
- model.add( "name" );
return model;
}
Added: trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/boolean.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/boolean.tml.vm (rev 0)
+++ trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/boolean.tml.vm 2007-12-12 14:51:57 UTC (rev 200)
@@ -0,0 +1,2 @@
+<t:label for="${field.VarName}"/>
+<input t:type="CheckBox" t:label="${field.Name}" t:id="${field.VarName}" t:value="value.${field.Name}"/>
Added: trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/date.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/date.tml.vm (rev 0)
+++ trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/date.tml.vm 2007-12-12 14:51:57 UTC (rev 200)
@@ -0,0 +1,2 @@
+<t:label for="birthdate"/>
+<input t:type="DateField" t:label="Birthdate" t:id="birthdate" t:value="value.Birthdate"/>
Added: trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/double.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/double.tml.vm (rev 0)
+++ trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/double.tml.vm 2007-12-12 14:51:57 UTC (rev 200)
@@ -0,0 +1,2 @@
+<t:label for="${field.VarName}"/>
+<input t:type="DateField" t:label="${field.Name}" t:id="${field.VarName}" t:value="value.${field.Name}"/>
Added: trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/field.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/field.tml.vm (rev 0)
+++ trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/field.tml.vm 2007-12-12 14:51:57 UTC (rev 200)
@@ -0,0 +1,18 @@
+#if( !$field.isHidden() )
+<div class="${table.Name}-${field.Name} ${table.Name}-type-${field.TableType}">
+#set( $renderfirst = "$field.Renderer" )
+#if( "x$renderfirst" == "x" )#set( $renderfirst = "field.${table.Name}.{$field.Name}" )#end
+#set( $specifictype = "type.${field.Type}" )
+#set( $generictype = "" )
+#if( $field.isLink() )
+#if( $field.isMultiple() )
+ #set( $specifictype = "type.${field.Type}.list" )
+ #set( $generictype = "type.link.list" )
+#else
+ #set( $specifictype = "type.${field.Type}.one" )
+ #set( $generictype = "type.link.one" )
+#end
+#end
+#render( "$renderer" "field.{$field.Name}" "$specifictype" "$generictype" )
+<br/></div>
+#end
Added: trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/group.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/group.tml.vm (rev 0)
+++ trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/group.tml.vm 2007-12-12 14:51:57 UTC (rev 200)
@@ -0,0 +1,18 @@
+#if( !$group.isHidden() )
+#if( "x$group.Renderer" != "x" )
+#render( "$group.Renderer" "" "" "" )
+#else
+<fieldset>
+ <legend>$group.Name</legend>
+
+#foreach( $field in $group.Fields)
+#render( "field" "" "" "" )
+#end
+
+#foreach( $group in $group.Groups)
+#render( "group" "" "" "" )
+#end
+
+</fieldset>
+#end##own renderer
+#end##!group.isHidden
Added: trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/int.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/int.tml.vm (rev 0)
+++ trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/int.tml.vm 2007-12-12 14:51:57 UTC (rev 200)
@@ -0,0 +1,2 @@
+<t:label for="${field.VarName}"/>
+<input t:type="TextField" t:label="${field.Name}" t:id="${field.VarName}" t:value="value.${field.Name}"/>
Added: trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/linklist.tml.vm
===================================================================
Added: trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/linkone.tml.vm
===================================================================
Added: trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/page.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/page.tml.vm (rev 0)
+++ trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/page.tml.vm 2007-12-12 14:51:57 UTC (rev 200)
@@ -0,0 +1,18 @@
+#if( !$page.isHidden() )
+#if( $page.Name == "ALL" )
+<t:parameter name="contentAll">
+#else
+<t:parameter name="content$pageindex">
+#set( $pageindex = $pageindex + 1 )
+#end
+
+#foreach( $field in $page.Fields)
+#render( "field" "" "" "" )
+#end
+
+#foreach( $group in $page.Groups)
+#render( "group" "" "" "" )
+#end
+
+</t:parameter>
+#end##isHidden
Added: trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/pages.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/pages.tml.vm (rev 0)
+++ trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/pages.tml.vm 2007-12-12 14:51:57 UTC (rev 200)
@@ -0,0 +1,20 @@
+<span t:type="equanda/Tabs">
+## page titles
+#set( $pageindex = "1" )
+#foreach( $page in $table.Pages )
+#if( !$page.isHidden() )
+#if( $page.Name != "ALL" )
+<t:parameter name="title$pageindex">
+ $page.Name
+</t:parameter>
+#set( $pageindex = $pageindex + 1 )
+#end
+#end##isHidden
+#end## foreach page
+
+## page contents
+#set( $pageindex = "1" )
+#foreach( $page in $table.Pages )
+#render( "page" "" "" "" )
+#end
+</span>
Added: trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/string.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/string.tml.vm (rev 0)
+++ trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/string.tml.vm 2007-12-12 14:51:57 UTC (rev 200)
@@ -0,0 +1,2 @@
+<t:label for="${field.VarName}"/>
+<input t:type="TextField" t:label="${field.Name}" t:id="${field.VarName}" t:value="value.${field.Name}"/>
Added: trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/templates.properties
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/templates.properties (rev 0)
+++ trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/templates.properties 2007-12-12 14:51:57 UTC (rev 200)
@@ -0,0 +1,16 @@
+pages=edit-tml/pages.tml.vm
+page=edit-tml/page.tml.vm
+group=edit-tml/group.tml.vm
+field=edit-tml/field.tml.vm
+
+type.string=edit-tml/string.tml.vm
+type.double=edit-tml/double.tml.vm
+type.int=edit-tml/int.tml.vm
+type.date=edit-tml/date.tml.vm
+type.timestamp=edit-tml/timestamp.tml.vm
+type.boolean=edit-tml/boolean.tml.vm
+type.link.one=edit-tml/linkone.tml.vm
+type.link.list=edit-tml/linklist.tml.vm
+
+field.EquandaUser.Password=edit-tml/password.tml.vm
+field.EquandaType=edit-tml/type.tml.vm
\ No newline at end of file
Added: trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/timestamp.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/timestamp.tml.vm (rev 0)
+++ trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/timestamp.tml.vm 2007-12-12 14:51:57 UTC (rev 200)
@@ -0,0 +1,2 @@
+<t:label for="${field.VarName}"/>
+<input t:type="DateField" t:label="${field.Name}" t:id="${field.VarName}" t:value="value.${field.Name}"/>
Added: trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/type.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/type.tml.vm (rev 0)
+++ trunk/equanda-generate/src/main/velocity/t5gui/edit-tml/type.tml.vm 2007-12-12 14:51:57 UTC (rev 200)
@@ -0,0 +1,22 @@
+<div class="${table.Name}-EquandaType ${table.Name}-type-">
+ <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>
Modified: trunk/equanda-generate/src/main/velocity/t5gui/pages/Edit.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/pages/Edit.java.vm 2007-12-12 14:27:54 UTC (rev 199)
+++ trunk/equanda-generate/src/main/velocity/t5gui/pages/Edit.java.vm 2007-12-12 14:51:57 UTC (rev 200)
@@ -32,6 +32,7 @@
package ${package}.pages;
+#set( $ejbPackage=${engine.getConfig("ejb-package")} )
import ${ejbPackage}.client.${table.Name};
import ${ejbPackage}.client.${table.Name}SelectorEJB;
import ${ejbPackage}.client.EquandaGlobal;
@@ -67,5 +68,5 @@
}
}
- public Class getAllPage() { return ${table.Name}All.class; }
+ public Class getAllPage() { return ${table.Name}EquandaAll.class; }
}
Modified: trunk/equanda-generate/src/main/velocity/t5gui/pages/Edit.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/pages/Edit.tml.vm 2007-12-12 14:27:54 UTC (rev 199)
+++ trunk/equanda-generate/src/main/velocity/t5gui/pages/Edit.tml.vm 2007-12-12 14:51:57 UTC (rev 200)
@@ -3,7 +3,7 @@
<title>${table.Name}, Edit</title>
</t:parameter>
<t:parameter name="context">
- <span id="context">uoid ${object?.uOID}</span>
+ <span id="context">uoid \$\{object?.uOID\}</span>
</t:parameter>
<t:parameter name="buttons">
<input class="defaultSubmit" t:type="submit" value="Save" t:id="save"/>
Copied: trunk/equanda-generate/src/main/velocity/t5gui/pages/Select.java.vm (from rev 194, trunk/equanda-generate/src/main/velocity/t5gui/pages/Selector.java.vm)
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/pages/Select.java.vm (rev 0)
+++ trunk/equanda-generate/src/main/velocity/t5gui/pages/Select.java.vm 2007-12-12 14:51:57 UTC (rev 200)
@@ -0,0 +1,93 @@
+#**
+ * 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;
+
+#set( $ejbPackage=${engine.getConfig("ejb-package")} )
+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}${select.Name}.class );
+
+ @InjectPage
+ private ${table.Name}Edit equandaCreatePage;
+
+ public ${table.Name}Edit getEquandaCreatePage() { return equandaCreatePage; }
+
+#foreach( $par in $select.Selections )
+#if( $par.isTestComparison() && $par.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.select${select.Name}( $select.ParametersListNoLimit );
+ }
+ catch ( EquandaPersistenceException ee )
+ {
+ equandaLog.error( ee, ee );
+ }
+ sel.remove();
+ return list;
+ }
+ };
+
+ public ListGetter<${table.Name}> getSelector()
+ {
+ return SELECTOR;
+ }
+}
Copied: trunk/equanda-generate/src/main/velocity/t5gui/pages/Select.tml.vm (from rev 194, trunk/equanda-generate/src/main/velocity/t5gui/pages/Selector.tml.vm)
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/pages/Select.tml.vm (rev 0)
+++ trunk/equanda-generate/src/main/velocity/t5gui/pages/Select.tml.vm 2007-12-12 14:51:57 UTC (rev 200)
@@ -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.Name}">${sel.Name}</a></li>
+#end
+#end
+ <li><a href="#nowhere-yet">ExternalReference</a></li>
+ </ul>
+ </t:parameter>
+
+ <t:${engine.lowerFirst("$table.Name")}.Select selector="selector" selectedSettings="selectedSettings" />
+</t:selectlayout>
Deleted: trunk/equanda-generate/src/main/velocity/t5gui/pages/Selector.java.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/pages/Selector.java.vm 2007-12-12 14:27:54 UTC (rev 199)
+++ trunk/equanda-generate/src/main/velocity/t5gui/pages/Selector.java.vm 2007-12-12 14:51:57 UTC (rev 200)
@@ -1,92 +0,0 @@
-#**
- * 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;
- }
-}
Deleted: trunk/equanda-generate/src/main/velocity/t5gui/pages/Selector.tml.vm
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui/pages/Selector.tml.vm 2007-12-12 14:27:54 UTC (rev 199)
+++ trunk/equanda-generate/src/main/velocity/t5gui/pages/Selector.tml.vm 2007-12-12 14:51:57 UTC (rev 200)
@@ -1,27 +0,0 @@
-<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.Name}">${sel.Name}</a></li>
-#end
-#end
- <li><a href="#nowhere-yet">ExternalReference</a></li>
- </ul>
- </t:parameter>
-
- <t:${engine.lowerFirst("$table.Name")}.Select selector="selector" selectedSettings="selectedSettings" />
-</t:selectlayout>
Modified: trunk/equanda-generate/src/main/velocity/t5gui.ini
===================================================================
--- trunk/equanda-generate/src/main/velocity/t5gui.ini 2007-12-12 14:27:54 UTC (rev 199)
+++ trunk/equanda-generate/src/main/velocity/t5gui.ini 2007-12-12 14:51:57 UTC (rev 200)
@@ -53,10 +53,10 @@
// edit page
-output10=${outputDir}${packageDir}pages/${table}Edit.java
-template10=pages/Edit.java.vm
-output11=${outputDir}${packageDir}pages/${table}Edit.tml
-template11=pages/Edit.tml.vm
+output11=${outputDir}${packageDir}pages/${table}Edit.java
+template11=pages/Edit.java.vm
+output12=${outputDir}${packageDir}pages/${table}Edit.tml
+template12=pages/Edit.tml.vm
[select-not-hidden]
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-12-12 14:28:01
|
Revision: 199
http://equanda.svn.sourceforge.net/equanda/?rev=199&view=rev
Author: triathlon98
Date: 2007-12-12 06:27:54 -0800 (Wed, 12 Dec 2007)
Log Message:
-----------
EQ-102 auto mark reference and description fields
Modified Paths:
--------------
trunk/equanda-generate/src/main/java/org/equanda/persistence/xml/OMField.java
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-12 13:57:17 UTC (rev 198)
+++ trunk/equanda-generate/src/main/java/org/equanda/persistence/xml/OMField.java 2007-12-12 14:27:54 UTC (rev 199)
@@ -287,8 +287,6 @@
"Field " + getParentName() + '.' + value +
" - invalid fieldname, should not start with \"equanda\" or \"UOID\" or \"_\"" );
}
- if ( "reference".equalsIgnoreCase( val ) ) fieldReference = true;
- if ( "description".equalsIgnoreCase( val ) ) fieldDescription = true;
}
else if ( name.equals( "singular" ) )
{
@@ -1519,6 +1517,9 @@
// do some basic validation, only done at this point because base type replacement needs to be done
doValidation();
+ if ( "reference".equalsIgnoreCase( name ) && ( isString() || isClob() ) ) fieldReference = true;
+ if ( "description".equalsIgnoreCase( name ) && ( isString() || isClob() ) ) fieldDescription = true;
+
if ( type == TYPE_LINK )
{
// if this field is a link, check that the linked table exists (and is root)
@@ -1692,17 +1693,13 @@
if ( sroot != null ) sroot.addSuggestSelect( suggest.getField() );
}
}
- if ( !isString() && ( ( isReference() || isDescription() ) ) )
+ if ( !(isString() || isClob()) && ( ( isReference() || isDescription() ) ) )
{
- err( "is not a string field, so it cannot be a reference or description field" );
+ err( "only string or clob fields can be is-reference or is-description" );
}
- if ( isLink() && ( isReference() || isDescription() ) )
- {
- err( "is a link field, so it cannot be a reference or description field" );
- }
if ( isCalculated() && ( isReference() || isDescription() ) )
{
- err( "is a calculated field, so it cannot be a reference or description field" );
+ err( "is a calculated field, so it cannot is-reference or is-description" );
}
if ( hasMutableEvenIf() )
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-12-12 13:57:24
|
Revision: 198
http://equanda.svn.sourceforge.net/equanda/?rev=198&view=rev
Author: triathlon98
Date: 2007-12-12 05:57:17 -0800 (Wed, 12 Dec 2007)
Log Message:
-----------
EQ-102 auto mark reference and description fields
Modified Paths:
--------------
trunk/equanda-generate/src/main/java/org/equanda/persistence/xml/OMField.java
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-12 12:28:30 UTC (rev 197)
+++ trunk/equanda-generate/src/main/java/org/equanda/persistence/xml/OMField.java 2007-12-12 13:57:17 UTC (rev 198)
@@ -287,6 +287,8 @@
"Field " + getParentName() + '.' + value +
" - invalid fieldname, should not start with \"equanda\" or \"UOID\" or \"_\"" );
}
+ if ( "reference".equalsIgnoreCase( val ) ) fieldReference = true;
+ if ( "description".equalsIgnoreCase( val ) ) fieldDescription = true;
}
else if ( name.equals( "singular" ) )
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-12-12 12:28:42
|
Revision: 197
http://equanda.svn.sourceforge.net/equanda/?rev=197&view=rev
Author: triathlon98
Date: 2007-12-12 04:28:30 -0800 (Wed, 12 Dec 2007)
Log Message:
-----------
compiler demands extra dependency
Modified Paths:
--------------
trunk/equanda-t5gui/pom.xml
Modified: trunk/equanda-t5gui/pom.xml
===================================================================
--- trunk/equanda-t5gui/pom.xml 2007-12-12 12:20:16 UTC (rev 196)
+++ trunk/equanda-t5gui/pom.xml 2007-12-12 12:28:30 UTC (rev 197)
@@ -39,6 +39,12 @@
<artifactId>equanda-client</artifactId>
</dependency>
<dependency>
+ <!-- need to repeat as it is provided for equanda-client and needed to compile -->
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-ejb3x</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>org.apache.tapestry</groupId>
<artifactId>tapestry-core</artifactId>
<version>${tapestry-release-version}</version>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-12-12 12:20:23
|
Revision: 196
http://equanda.svn.sourceforge.net/equanda/?rev=196&view=rev
Author: triathlon98
Date: 2007-12-12 04:20:16 -0800 (Wed, 12 Dec 2007)
Log Message:
-----------
fix compilation problem
Modified Paths:
--------------
trunk/equanda-client/src/test/java/org/equanda/persistence/om/EquandaListTest.java
Modified: trunk/equanda-client/src/test/java/org/equanda/persistence/om/EquandaListTest.java
===================================================================
--- trunk/equanda-client/src/test/java/org/equanda/persistence/om/EquandaListTest.java 2007-12-12 10:08:22 UTC (rev 195)
+++ trunk/equanda-client/src/test/java/org/equanda/persistence/om/EquandaListTest.java 2007-12-12 12:20:16 UTC (rev 196)
@@ -249,6 +249,10 @@
public boolean isModified( boolean type ) { return false; }
+ public void equandaReset()
+ throws EquandaPersistenceException
+ {/*nothing to do, just assure this can be compiled*/}
+
public String getDistinct()
{
return distinct;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tri...@us...> - 2007-12-12 10:08:28
|
Revision: 195
http://equanda.svn.sourceforge.net/equanda/?rev=195&view=rev
Author: triathlon98
Date: 2007-12-12 02:08:22 -0800 (Wed, 12 Dec 2007)
Log Message:
-----------
EQ-101 keyvalue support
Modified Paths:
--------------
trunk/equanda-generate/src/main/java/org/equanda/generate/Generator.java
trunk/equanda-generate/src/main/java/org/equanda/persistence/xml/OMField.java
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 21:55:20 UTC (rev 194)
+++ trunk/equanda-generate/src/main/java/org/equanda/generate/Generator.java 2007-12-12 10:08:22 UTC (rev 195)
@@ -290,7 +290,7 @@
// initialize key-value pairs which are available to the templates
keyValue.clear();
String keyValueLocation = templateDefinition.getValue( "config", "path" );
- if ( keyValueLocation != null )
+ if ( keyValueLocation != null && !"".equals( keyValueLocation ) )
{
mergeKeyValues( keyValue, keyValueLocation );
}
@@ -301,9 +301,12 @@
{
String key = "keyvalue" + i;
keyValueLocation = ini.getValue( templateDefinitionFile, key );
- if ( keyValueLocation == null ) keyValueLocation = ini.getValue( "config", key );
- if ( keyValueLocation == null )
+ if ( keyValueLocation == null || "".equals( keyValueLocation ) )
{
+ keyValueLocation = ini.getValue( "config", key );
+ }
+ if ( keyValueLocation == null || "".equals( keyValueLocation ) )
+ {
hasKeyValue = false;
}
else
@@ -512,10 +515,10 @@
try
{
InputStream is = new EquandaResourceLoader().getResourceStream( keyValueLocation );
- prop.load( is );
+ if ( is != null ) prop.load( is );
}
- catch ( IOException ioe ) {/*ignore*/}
- catch ( ResourceNotFoundException rnfe ) {/*ignore*/}
+ catch ( IOException ioe ) { System.err.println( ioe );}
+ catch ( ResourceNotFoundException rnfe ) { System.err.println( rnfe );}
keyValue.putAll( prop );
}
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 21:55:20 UTC (rev 194)
+++ trunk/equanda-generate/src/main/java/org/equanda/persistence/xml/OMField.java 2007-12-12 10:08:22 UTC (rev 195)
@@ -1156,7 +1156,7 @@
return internal;
}
- public boolean JavisDisplayed()
+ public boolean isDisplayed()
{
return display;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
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] |