[jboss-cvs] jboss-seam/seam-gen/view ...
Gavin King
gavin.king at jboss.com
Fri Feb 9 17:49:37 EST 2007
User: gavin
Date: 07/02/09 17:49:37
Modified: seam-gen/view edit.page.xml.ftl edit.xhtml.ftl
list.page.xml.ftl list.xhtml.ftl view.page.xml.ftl
view.xhtml.ftl
Log:
basic working support for composite keys
Revision Changes Path
1.8 +8 -1 jboss-seam/seam-gen/view/edit.page.xml.ftl
(In the diff below, changes in quantity of whitespace are not shown.)
Index: edit.page.xml.ftl
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/seam-gen/view/edit.page.xml.ftl,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- edit.page.xml.ftl 7 Feb 2007 22:16:28 -0000 1.7
+++ edit.page.xml.ftl 9 Feb 2007 22:49:37 -0000 1.8
@@ -5,14 +5,21 @@
<#assign entityName = pojo.shortName>
<#assign componentName = util.lower(entityName)>
<#assign homeName = componentName + "Home">
-<#assign idName = componentName + util.upper(pojo.identifierProperty.name)>
<#assign masterPageName = entityName + "List">
<#assign pageName = entityName>
<page no-conversation-view-id="/${masterPageName}.xhtml">
<restrict>${'#'}{identity.loggedIn}</restrict>
<param name="${componentName}From"/>
+<#assign idName = componentName + util.upper(pojo.identifierProperty.name)>
+<#if c2j.isComponent(pojo.identifierProperty)>
+<#foreach componentProperty in pojo.identifierProperty.value.propertyIterator>
+<#assign cidName = componentName + util.upper(componentProperty.name)>
+ <param name="${cidName}" value="${'#'}{${homeName}.${idName}.${componentProperty.name}}"/>
+</#foreach>
+<#else>
<param name="${idName}" value="${'#'}{${homeName}.${idName}}"/>
+</#if>
<#include "param.xml.ftl">
<navigation from-action="${'#'}{${homeName}.persist}">
1.26 +3 -3 jboss-seam/seam-gen/view/edit.xhtml.ftl
(In the diff below, changes in quantity of whitespace are not shown.)
Index: edit.xhtml.ftl
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/seam-gen/view/edit.xhtml.ftl,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -b -r1.25 -r1.26
--- edit.xhtml.ftl 8 Feb 2007 16:30:10 -0000 1.25
+++ edit.xhtml.ftl 9 Feb 2007 22:49:37 -0000 1.26
@@ -26,7 +26,7 @@
<table>
<s:validateAll>
<#foreach property in pojo.allPropertiesIterator>
-<#if !c2h.isCollection(property) && !c2h.isManyToOne(property) && !c2h.isOneToMany(property) && property.columnSpan==1>
+<#if !c2h.isCollection(property) && !c2h.isManyToOne(property) && property.columnSpan==1>
<#assign propertyIsId = property.equals(pojo.identifierProperty)>
<#if !propertyIsId || property.value.identifierGeneratorStrategy == "assigned">
<#assign column = property.columnIterator.next()>
@@ -198,7 +198,7 @@
rowClasses="rvgRowOne,rvgRowTwo"
id="${property.name}">
<#foreach parentProperty in parentPojo.allPropertiesIterator>
-<#if !c2h.isCollection(parentProperty) && !c2h.isManyToOne(parentProperty) && !c2h.isOneToMany(parentProperty)>
+<#if !c2h.isCollection(parentProperty) && !c2h.isManyToOne(parentProperty)>
<h:column>
<f:facet name="header">${parentProperty.name}</f:facet>
${'#'}{${parentName}.${parentProperty.name}}
@@ -247,7 +247,7 @@
rowClasses="rvgRowOne,rvgRowTwo"
id="${property.name}">
<#foreach childProperty in childPojo.allPropertiesIterator>
-<#if !c2h.isCollection(childProperty) && !c2h.isManyToOne(childProperty) && !c2h.isOneToMany(childProperty)>
+<#if !c2h.isCollection(childProperty) && !c2h.isManyToOne(childProperty)>
<h:column>
<f:facet name="header">${childProperty.name}</f:facet>
<h:outputText value="${'#'}{${childName}.${childProperty.name}}"/>
1.4 +8 -0 jboss-seam/seam-gen/view/list.page.xml.ftl
(In the diff below, changes in quantity of whitespace are not shown.)
Index: list.page.xml.ftl
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/seam-gen/view/list.page.xml.ftl,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- list.page.xml.ftl 16 Dec 2006 13:26:10 -0000 1.3
+++ list.page.xml.ftl 9 Feb 2007 22:49:37 -0000 1.4
@@ -10,9 +10,17 @@
<param name="order" value="${'#'}{${listName}.order}"/>
<#foreach property in pojo.allPropertiesIterator>
<#if !c2h.isCollection(property) && !c2h.isManyToOne(property)>
+<#if c2j.isComponent(property)>
+<#foreach componentProperty in property.value.propertyIterator>
+<#if componentProperty.value.typeName == "string">
+ <param name="${componentProperty.name}" value="${'#'}{${listName}.${componentName}.${property.name}.${componentProperty.name}}"/>
+</#if>
+</#foreach>
+<#else>
<#if property.value.typeName == "string">
<param name="${property.name}" value="${'#'}{${listName}.${componentName}.${property.name}}"/>
</#if>
</#if>
+</#if>
</#foreach>
</page>
\ No newline at end of file
1.13 +33 -3 jboss-seam/seam-gen/view/list.xhtml.ftl
(In the diff below, changes in quantity of whitespace are not shown.)
Index: list.xhtml.ftl
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/seam-gen/view/list.xhtml.ftl,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- list.xhtml.ftl 7 Feb 2007 22:10:40 -0000 1.12
+++ list.xhtml.ftl 9 Feb 2007 22:49:37 -0000 1.13
@@ -26,7 +26,20 @@
<div class="dialog">
<table>
<#foreach property in pojo.allPropertiesIterator>
-<#if !c2h.isCollection(property) && !c2h.isManyToOne(property) && !c2h.isOneToMany(property)>
+<#if !c2h.isCollection(property) && !c2h.isManyToOne(property)>
+<#if c2j.isComponent(property)>
+<#foreach componentProperty in property.value.propertyIterator>
+<#if componentProperty.value.typeName == "string">
+ <tr class="prop">
+ <td class="name">${componentProperty.name}</td>
+ <td class="value">
+ <h:inputText id="${componentProperty.name}"
+ value="${'#'}{${listName}.${componentName}.${property.name}.${componentProperty.name}}"/>
+ </td>
+ </tr>
+</#if>
+</#foreach>
+<#else>
<#if property.value.typeName == "string">
<tr class="prop">
<td class="name">${property.name}</td>
@@ -37,6 +50,7 @@
</tr>
</#if>
</#if>
+</#if>
</#foreach>
</table>
</div>
@@ -59,7 +73,15 @@
value="${'#'}{${listName}.resultList}"
rendered="${'#'}{not empty ${listName}.resultList}">
<#foreach property in pojo.allPropertiesIterator>
-<#if !c2h.isCollection(property) && !c2h.isManyToOne(property) && !c2h.isOneToMany(property)>
+<#if !c2h.isCollection(property) && !c2h.isManyToOne(property)>
+<#if pojo.isComponent(property)>
+<#foreach componentProperty in property.value.propertyIterator>
+ <h:column>
+ <f:facet name="header">${componentProperty.name}</f:facet>
+ ${'#'}{${componentName}.${property.name}.${componentProperty.name}}
+ </h:column>
+</#foreach>
+<#else>
<h:column>
<f:facet name="header">
<s:link styleClass="columnHeader"
@@ -70,6 +92,7 @@
${'#'}{${componentName}.${property.name}}
</h:column>
</#if>
+</#if>
<#if c2h.isManyToOne(property)>
<#assign parentPojo = c2j.getPOJOClass(cfg.getClassMapping(property.value.referencedEntityName))>
<h:column>
@@ -89,8 +112,15 @@
<s:link view="/${pageName}.xhtml"
value="Select"
id="${componentName}">
+<#if pojo.isComponent(pojo.identifierProperty)>
+<#foreach componentProperty in pojo.identifierProperty.value.propertyIterator>
+ <f:param name="${componentName}${util.upper(componentProperty.name)}"
+ value="${'#'}{${componentName}.${pojo.identifierProperty.name}.${componentProperty.name}}"/>
+</#foreach>
+<#else>
<f:param name="${componentName}${util.upper(pojo.identifierProperty.name)}"
value="${'#'}{${componentName}.${pojo.identifierProperty.name}}"/>
+</#if>
</s:link>
</h:column>
</h:dataTable>
1.2 +8 -1 jboss-seam/seam-gen/view/view.page.xml.ftl
(In the diff below, changes in quantity of whitespace are not shown.)
Index: view.page.xml.ftl
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/seam-gen/view/view.page.xml.ftl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- view.page.xml.ftl 16 Dec 2006 14:51:30 -0000 1.1
+++ view.page.xml.ftl 9 Feb 2007 22:49:37 -0000 1.2
@@ -5,9 +5,16 @@
<#assign entityName = pojo.shortName>
<#assign componentName = util.lower(entityName)>
<#assign homeName = componentName + "Home">
-<#assign idName = componentName + util.upper(pojo.identifierProperty.name)>
<page>
<param name="${componentName}From"/>
+<#assign idName = componentName + util.upper(pojo.identifierProperty.name)>
+<#if c2j.isComponent(pojo.identifierProperty)>
+<#foreach componentProperty in pojo.identifierProperty.value.propertyIterator>
+<#assign cidName = componentName + util.upper(componentProperty.name)>
+ <param name="${cidName}" value="${'#'}{${homeName}.${idName}.${componentProperty.name}}"/>
+</#foreach>
+<#else>
<param name="${idName}" value="${'#'}{${homeName}.${idName}}"/>
+</#if>
<#include "param.xml.ftl">
</page>
\ No newline at end of file
1.11 +4 -34 jboss-seam/seam-gen/view/view.xhtml.ftl
(In the diff below, changes in quantity of whitespace are not shown.)
Index: view.xhtml.ftl
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/seam-gen/view/view.xhtml.ftl,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- view.xhtml.ftl 8 Feb 2007 16:30:10 -0000 1.10
+++ view.xhtml.ftl 9 Feb 2007 22:49:37 -0000 1.11
@@ -23,38 +23,8 @@
<div id="${componentName}" class="dialog">
<table>
<#foreach property in pojo.allPropertiesIterator>
-<#if !c2h.isCollection(property) && !c2h.isManyToOne(property) && !c2h.isOneToMany(property)>
-<#if !property.equals(pojo.identifierProperty) || property.value.identifierGeneratorStrategy == "assigned">
-
- <tr class="prop">
- <td class="name">${property.name}</td>
- <td class="value" id="${property.name}">
-<#if property.value.typeName == "date">
- <h:outputText value="${'#'}{${homeName}.instance.${property.name}}">
- <f:convertDateTime type="date" dateStyle="short"/>
- </h:outputText>
-<#elseif property.value.typeName == "time">
- <h:outputText value="${'#'}{${homeName}.instance.${property.name}}">
- <f:convertDateTime type="time"/>
- </h:outputText>
-<#elseif property.value.typeName == "timestamp">
- <h:outputText value="${'#'}{${homeName}.instance.${property.name}}">
- <f:convertDateTime type="both" dateStyle="short"/>
- </h:outputText>
-<#elseif property.value.typeName == "big_decimal">
- <h:outputText value="${'#'}{${homeName}.instance.${property.name}}">
- <f:convertNumber/>
- </h:outputText>
-<#elseif property.value.typeName == "big_integer">
- <h:outputText value="${'#'}{${homeName}.instance.${property.name}}">
- <f:convertNumber integerOnly="true"/>
- </h:outputText>
-<#else>
- ${'#'}{${homeName}.instance.${property.name}}
-</#if>
- </td>
- </tr>
-</#if>
+<#if !c2h.isCollection(property) && !c2h.isManyToOne(property)>
+<#include "viewproperty.xhtml.ftl">
</#if>
</#foreach>
@@ -92,7 +62,7 @@
rowClasses="rvgRowOne,rvgRowTwo"
id="${property.name}">
<#foreach parentProperty in parentPojo.allPropertiesIterator>
-<#if !c2h.isCollection(parentProperty) && !c2h.isManyToOne(parentProperty) && !c2h.isOneToMany(parentProperty)>
+<#if !c2h.isCollection(parentProperty) && !c2h.isManyToOne(parentProperty)>
<h:column>
<f:facet name="header">${parentProperty.name}</f:facet>
${'#'}{${parentName}.${parentProperty.name}}
@@ -139,7 +109,7 @@
rowClasses="rvgRowOne,rvgRowTwo"
id="${property.name}">
<#foreach childProperty in childPojo.allPropertiesIterator>
-<#if !c2h.isCollection(childProperty) && !c2h.isManyToOne(childProperty) && !c2h.isOneToMany(childProperty)>
+<#if !c2h.isCollection(childProperty) && !c2h.isManyToOne(childProperty)>
<h:column>
<f:facet name="header">${childProperty.name}</f:facet>
<h:outputText value="${'#'}{${childName}.${childProperty.name}}"/>
More information about the jboss-cvs-commits
mailing list