Author: dan.j.allen
Date: 2008-10-11 22:50:02 -0400 (Sat, 11 Oct 2008)
New Revision: 9263
Modified:
trunk/seam-gen/icefaces/view/edit.page.xml.ftl
trunk/seam-gen/icefaces/view/edit.xhtml.ftl
trunk/seam-gen/icefaces/view/editproperty.xhtml.ftl
trunk/seam-gen/icefaces/view/list.page.xml.ftl
trunk/seam-gen/icefaces/view/list.xhtml.ftl
trunk/seam-gen/icefaces/view/param.xml.ftl
trunk/seam-gen/icefaces/view/view.page.xml.ftl
trunk/seam-gen/icefaces/view/view.xhtml.ftl
trunk/seam-gen/icefaces/view/viewproperty.xhtml.ftl
trunk/seam-gen/src/EntityHome.java.ftl
trunk/seam-gen/src/EntityList.java.ftl
trunk/seam-gen/util/TypeInfo.ftl
trunk/seam-gen/view/edit.page.xml.ftl
trunk/seam-gen/view/edit.xhtml.ftl
trunk/seam-gen/view/editproperty.xhtml.ftl
trunk/seam-gen/view/list.page.xml.ftl
trunk/seam-gen/view/list.xhtml.ftl
trunk/seam-gen/view/param.xml.ftl
trunk/seam-gen/view/view.page.xml.ftl
trunk/seam-gen/view/view.xhtml.ftl
trunk/seam-gen/view/viewproperty.xhtml.ftl
Log:
fix generate-entities in JBossTools by making isToOne() a FreeMarker function
make labels out of property names by filtering them through label() function
Modified: trunk/seam-gen/icefaces/view/edit.page.xml.ftl
===================================================================
--- trunk/seam-gen/icefaces/view/edit.page.xml.ftl 2008-10-11 21:21:16 UTC (rev 9262)
+++ trunk/seam-gen/icefaces/view/edit.page.xml.ftl 2008-10-12 02:50:02 UTC (rev 9263)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<#assign entityName = pojo.shortName>
-<#assign componentName = util.lower(entityName)>
+<#assign componentName = entityName?uncap_first>
<#assign homeName = componentName + "Home">
<#assign masterPageName = entityName + "List">
<#assign pageName = entityName>
@@ -22,10 +22,10 @@
<action execute="${'#'}{${homeName}.wire}"/>
<param name="${componentName}From"/>
-<#assign idName = componentName + util.upper(pojo.identifierProperty.name)>
+<#assign idName = componentName + pojo.identifierProperty.name?cap_first>
<#if c2j.isComponent(pojo.identifierProperty)>
<#foreach componentProperty in pojo.identifierProperty.value.propertyIterator>
-<#assign cidName = componentName + util.upper(componentProperty.name)>
+<#assign cidName = componentName + componentProperty.name?cap_first>
<param name="${cidName}"
value="${'#'}{${homeName}.${idName}.${componentProperty.name}}"/>
</#foreach>
<#else>
Modified: trunk/seam-gen/icefaces/view/edit.xhtml.ftl
===================================================================
--- trunk/seam-gen/icefaces/view/edit.xhtml.ftl 2008-10-11 21:21:16 UTC (rev 9262)
+++ trunk/seam-gen/icefaces/view/edit.xhtml.ftl 2008-10-12 02:50:02 UTC (rev 9263)
@@ -1,7 +1,7 @@
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<#assign entityName = pojo.shortName>
-<#assign componentName = util.lower(entityName)>
+<#assign componentName = entityName?uncap_first>
<#assign homeName = componentName + "Home">
<#assign masterPageName = entityName + "List">
<#assign pageName = entityName>
@@ -73,7 +73,7 @@
</ice:form>
<#assign hasAssociations=false>
<#foreach property in pojo.allPropertiesIterator>
-<#if util.isToOne(property) || c2h.isOneToManyCollection(property)>
+<#if isToOne(property) || c2h.isOneToManyCollection(property)>
<#assign hasAssociations=true>
</#if>
</#foreach>
@@ -83,15 +83,15 @@
<ice:panelTabSet id="editPanelTab${homeName}Id"
styleClass="componentPanelTabSetLayout"
style="margin-bottom:5px;margin-top:10px;">
</#if>
<#foreach property in pojo.allPropertiesIterator>
-<#if util.isToOne(property)>
+<#if isToOne(property)>
<#assign parentPojo =
c2j.getPOJOClass(cfg.getClassMapping(property.value.referencedEntityName))>
<#assign parentPageName = parentPojo.shortName>
-<#assign parentName = util.lower(parentPojo.shortName)>
+<#assign parentName = parentPojo.shortName?uncap_first>
<#if property.optional>
- <ice:panelTab id="editTab${property.name}Id"
label="${property.name}">
+ <ice:panelTab id="editTab${property.name}Id"
label="${label(property.name)}">
<#else>
- <ice:panelTab id="editTab${property.name}Id" label="${property.name}
*" >
+ <ice:panelTab id="editTab${property.name}Id"
label="${label(property.name)} *" >
</#if>
<div class="association" id="${property.name}Parent">
@@ -104,51 +104,51 @@
columnClasses="allCols"
id="edit${property.name}TableId">
<#foreach parentProperty in parentPojo.allPropertiesIterator>
-<#if !c2h.isCollection(parentProperty) && !util.isToOne(parentProperty)
&& parentProperty != parentPojo.versionProperty!>
+<#if !c2h.isCollection(parentProperty) && !isToOne(parentProperty) &&
parentProperty != parentPojo.versionProperty!>
<#if parentPojo.isComponent(parentProperty)>
<#foreach componentProperty in parentProperty.value.propertyIterator>
<ice:column id="editColumn${componentProperty.name}Id">
- <f:facet
name="header">${componentProperty.name}</f:facet>
+ <f:facet
name="header">${label(componentProperty.name)}</f:facet>
${'#'}{${parentName}.${parentProperty.name}.${componentProperty.name}}
</ice:column>
</#foreach>
<#else>
<ice:column id="$editColumn${parentProperty.name}Id">
- <f:facet
name="header">${parentProperty.name}</f:facet>
+ <f:facet
name="header">${label(parentProperty.name)}</f:facet>
${'#'}{${parentName}.${parentProperty.name}}
</ice:column>
</#if>
</#if>
-<#if util.isToOne(parentProperty)>
+<#if isToOne(parentProperty)>
<#assign parentParentPojo =
c2j.getPOJOClass(cfg.getClassMapping(parentProperty.value.referencedEntityName))>
<#if parentParentPojo.isComponent(parentParentPojo.identifierProperty)>
<#foreach componentProperty in
parentParentPojo.identifierProperty.value.propertyIterator>
<ice:column id="$editColumn${parentProperty.name}Id">
- <f:facet name="header">${parentProperty.name}
${componentProperty.name}</f:facet>
+ <f:facet name="header">${label(parentProperty.name)}
${label(componentProperty.name)?uncap_first}</f:facet>
${'#'}{${parentName}.${parentProperty.name}.${parentParentPojo.identifierProperty.name}.${componentProperty.name}}
</ice:column>
</#foreach>
<#else>
<ice:column id="$editColumn${parentProperty.name}Id">
- <f:facet name="header">${parentProperty.name}
${parentParentPojo.identifierProperty.name}</f:facet>
+ <f:facet name="header">${label(parentProperty.name)}
${label(parentParentPojo.identifierProperty.name)?uncap_first}</f:facet>
${'#'}{${parentName}.${parentProperty.name}.${parentParentPojo.identifierProperty.name}}
</ice:column>
</#if>
</#if>
</#foreach>
<ice:column id="editColumn${parentName}LinkId">
- <f:facet name="header">action</f:facet>
+ <f:facet name="header">Action</f:facet>
<s:link view="/${parentPageName}.xhtml"
id="view${parentName}"
value="View"
propagation="none">
<#if parentPojo.isComponent(parentPojo.identifierProperty)>
<#foreach componentProperty in
parentPojo.identifierProperty.value.propertyIterator>
- <f:param
name="${parentName}${util.upper(componentProperty.name)}"
+ <f:param
name="${parentName}${componentProperty.name?cap_first}"
value="${'#'}{${parentName}.${parentPojo.identifierProperty.name}.${componentProperty.name}}"/>
</#foreach>
<#else>
- <f:param
name="${parentName}${util.upper(parentPojo.identifierProperty.name)}"
+ <f:param
name="${parentName}${parentPojo.identifierProperty.name?cap_first}"
value="${'#'}{${parentName}.${parentPojo.identifierProperty.name}}"/>
</#if>
</s:link>
@@ -168,13 +168,13 @@
</ice:panelTab>
</#if>
<#if c2h.isOneToManyCollection(property)>
- <ice:panelTab id="editPanelTab${property.name}Id"
label="${property.name}">
+ <ice:panelTab id="editPanelTab${property.name}Id"
label="${label(property.name)}">
<div class="association"
id="${property.name}Children">
<#assign childPojo = c2j.getPOJOClass(property.value.element.associatedClass)>
<#assign childPageName = childPojo.shortName>
<#assign childEditPageName = childPojo.shortName + "Edit">
-<#assign childName = util.lower(childPojo.shortName)>
+<#assign childName = childPojo.shortName?uncap_first>
<h:outputText value="There are no ${property.name} associated with
this ${componentName}."
id="edit${property.name}TextId"
rendered="${'#'}{empty
${homeName}.${property.name}}"/>
@@ -185,35 +185,35 @@
columnClasses="allCols"
id="edit${property.name}Table">
<#foreach childProperty in childPojo.allPropertiesIterator>
-<#if !c2h.isCollection(childProperty) && !util.isToOne(childProperty)
&& childProperty != childPojo.versionProperty!>
+<#if !c2h.isCollection(childProperty) && !isToOne(childProperty) &&
childProperty != childPojo.versionProperty!>
<#if childPojo.isComponent(childProperty)>
<#foreach componentProperty in childProperty.value.propertyIterator>
<ice:column id="edit${componentProperty.name}Id">
- <f:facet
name="header">${componentProperty.name}</f:facet>
+ <f:facet
name="header">${label(componentProperty.name)}</f:facet>
${'#'}{${childName}.${childProperty.name}.${componentProperty.name}}
</ice:column>
</#foreach>
<#else>
<ice:column id="edit${childProperty.name}Id">
- <f:facet
name="header">${childProperty.name}</f:facet>
+ <f:facet
name="header">${label(childProperty.name)}</f:facet>
<h:outputText id="edit${childProperty.name}TextId"
value="${'#'}{${childName}.${childProperty.name}}"/>
</ice:column>
</#if>
</#if>
</#foreach>
<ice:column id="edit${childName}Id">
- <f:facet name="header">action</f:facet>
+ <f:facet name="header">Action</f:facet>
<s:link view="/${childPageName}.xhtml"
id="select${childName}"
value="Select"
propagation="none">
<#if childPojo.isComponent(childPojo.identifierProperty)>
<#foreach componentProperty in
childPojo.identifierProperty.value.propertyIterator>
- <f:param
name="${childName}${util.upper(componentProperty.name)}"
+ <f:param
name="${childName}${componentProperty.name?cap_first}"
value="${'#'}{${childName}.${childPojo.identifierProperty.name}.${componentProperty.name}}"/>
</#foreach>
<#else>
- <f:param
name="${childName}${util.upper(childPojo.identifierProperty.name)}"
+ <f:param
name="${childName}${childPojo.identifierProperty.name?cap_first}"
value="${'#'}{${childName}.${childPojo.identifierProperty.name}}"/>
</#if>
<f:param name="${childName}From"
value="${entityName}"/>
@@ -227,7 +227,7 @@
value="Add ${childName}"
view="/${childEditPageName}.xhtml"
propagation="none">
- <f:param
name="${componentName}${util.upper(pojo.identifierProperty.name)}"
+ <f:param
name="${componentName}${pojo.identifierProperty.name?cap_first}"
value="${'#'}{${homeName}.instance.${pojo.identifierProperty.name}}"/>
<f:param name="${childName}From"
value="${entityName}"/>
</s:button>
Modified: trunk/seam-gen/icefaces/view/editproperty.xhtml.ftl
===================================================================
--- trunk/seam-gen/icefaces/view/editproperty.xhtml.ftl 2008-10-11 21:21:16 UTC (rev
9262)
+++ trunk/seam-gen/icefaces/view/editproperty.xhtml.ftl 2008-10-12 02:50:02 UTC (rev
9263)
@@ -1,6 +1,6 @@
<#include "../util/TypeInfo.ftl">
-<#if !c2h.isCollection(property) && !util.isToOne(property) &&
property != pojo.versionProperty!>
+<#if !c2h.isCollection(property) && !isToOne(property) && property !=
pojo.versionProperty!>
<#assign propertyIsId = property.equals(pojo.identifierProperty)>
<#if !propertyIsId || property.value.identifierGeneratorStrategy ==
"assigned">
<#if pojo.isComponent(property)>
@@ -8,7 +8,7 @@
<#assign column = componentProperty.columnIterator.next()>
<s:decorate id="${componentProperty.name}Decoration"
template="layout/edit.xhtml">
- <ui:define
name="label">${componentProperty.name}</ui:define>
+ <ui:define
name="label">${label(componentProperty.name)}</ui:define>
<#if isDate(componentProperty)>
<ice:selectInputDate
id="${componentProperty.name}Id"
renderAsPopup="true"
@@ -123,7 +123,7 @@
<#assign column = property.columnIterator.next()>
<s:decorate id="${property.name}Decoration"
template="layout/edit.xhtml">
- <ui:define
name="label">${property.name}</ui:define>
+ <ui:define
name="label">${label(property.name)}</ui:define>
<#if isDate(property)>
<ice:selectInputDate id="${property.name}Id"
renderAsPopup="true"
Modified: trunk/seam-gen/icefaces/view/list.page.xml.ftl
===================================================================
--- trunk/seam-gen/icefaces/view/list.page.xml.ftl 2008-10-11 21:21:16 UTC (rev 9262)
+++ trunk/seam-gen/icefaces/view/list.page.xml.ftl 2008-10-12 02:50:02 UTC (rev 9263)
@@ -10,7 +10,7 @@
<#include "../util/TypeInfo.ftl">
<#assign entityName = pojo.shortName>
-<#assign componentName = util.lower(entityName)>
+<#assign componentName = entityName?uncap_first>
<#assign listName = componentName + "List">
<param name="firstResult"
value="${'#'}{${listName}.firstResult}"/>
@@ -18,7 +18,7 @@
<param name="dir"
value="${'#'}{${listName}.orderDirection}"/>
<param name="from"/>
<#foreach property in pojo.allPropertiesIterator>
-<#if !c2h.isCollection(property) && !util.isToOne(property) &&
property != pojo.versionProperty!>
+<#if !c2h.isCollection(property) && !isToOne(property) && property !=
pojo.versionProperty!>
<#if c2j.isComponent(property)>
<#foreach componentProperty in property.value.propertyIterator>
<#if isString(componentProperty)>
Modified: trunk/seam-gen/icefaces/view/list.xhtml.ftl
===================================================================
--- trunk/seam-gen/icefaces/view/list.xhtml.ftl 2008-10-11 21:21:16 UTC (rev 9262)
+++ trunk/seam-gen/icefaces/view/list.xhtml.ftl 2008-10-12 02:50:02 UTC (rev 9263)
@@ -3,7 +3,7 @@
<#include "../util/TypeInfo.ftl">
<#assign entityName = pojo.shortName>
-<#assign componentName = util.lower(entityName)>
+<#assign componentName = entityName?uncap_first>
<#assign listName = componentName + "List">
<#assign pageName = entityName>
<#assign editPageName = entityName + "Edit">
@@ -31,12 +31,12 @@
<ice:panelGroup id="listPanelGroup${entityName}Id"
styleClass="edit">
<#foreach property in pojo.allPropertiesIterator>
-<#if !c2h.isCollection(property) && !util.isToOne(property) &&
property != pojo.versionProperty!>
+<#if !c2h.isCollection(property) && !isToOne(property) && property !=
pojo.versionProperty!>
<#if c2j.isComponent(property)>
<#foreach componentProperty in property.value.propertyIterator>
<#if isString(componentProperty)>
<s:decorate id="${componentProperty.name}decId"
template="layout/display.xhtml">
- <ui:define
name="label">${componentProperty.name}</ui:define>
+ <ui:define
name="label">${label(componentProperty.name)}</ui:define>
<ice:inputText id="${componentProperty.name}TextId"
value="${'#'}{${listName}.${componentName}.${property.name}.${componentProperty.name}}"
partialSubmit="true"/>
@@ -47,7 +47,7 @@
<#else>
<#if isString(property)>
<s:decorate id="${property.name}decId"
template="layout/display.xhtml">
- <ui:define
name="label">${property.name}</ui:define>
+ <ui:define
name="label">${label(property.name)}</ui:define>
<ice:inputText id="list${property.name}TextId"
value="${'#'}{${listName}.${componentName}.${property.name}}"
partialSubmit="true"/>
@@ -83,7 +83,7 @@
columnClasses="allCols"
rendered="${'#'}{not empty ${listName}.resultList}">
<#foreach property in pojo.allPropertiesIterator>
-<#if !c2h.isCollection(property) && !util.isToOne(property) &&
property != pojo.versionProperty!>
+<#if !c2h.isCollection(property) && !isToOne(property) && property !=
pojo.versionProperty!>
<#if pojo.isComponent(property)>
<#foreach componentProperty in property.value.propertyIterator>
<ice:column id="list${componentProperty.name}Id">
@@ -91,7 +91,7 @@
<#assign propertyPath = property.name + '.' + componentProperty.name>
<ui:include src="layout/sort.xhtml">
<ui:param name="entityList"
value="${'#'}{${listName}}"/>
- <ui:param name="propertyLabel"
value="${componentProperty.name}"/>
+ <ui:param name="propertyLabel"
value="${label(componentProperty.name)}"/>
<ui:param name="propertyPath"
value="${propertyPath}"/>
</ui:include>
</f:facet>
@@ -103,7 +103,7 @@
<f:facet name="header">
<ui:include src="layout/sort.xhtml">
<ui:param name="entityList"
value="${'#'}{${listName}}"/>
- <ui:param name="propertyLabel"
value="${property.name}"/>
+ <ui:param name="propertyLabel"
value="${label(property.name)}"/>
<ui:param name="propertyPath"
value="${property.name}"/>
</ui:include>
</f:facet>
@@ -111,7 +111,7 @@
</ice:column>
</#if>
</#if>
-<#if util.isToOne(property)>
+<#if isToOne(property)>
<#assign parentPojo =
c2j.getPOJOClass(cfg.getClassMapping(property.value.referencedEntityName))>
<#if parentPojo.isComponent(parentPojo.identifierProperty)>
<#foreach componentProperty in
parentPojo.identifierProperty.value.propertyIterator>
@@ -120,7 +120,7 @@
<#assign propertyPath = property.name + '.' +
parentPojo.identifierProperty.name + '.' + componentProperty.name>
<ui:include src="layout/sort.xhtml">
<ui:param name="entityList"
value="${'#'}{${listName}}"/>
- <ui:param name="propertyLabel"
value="${property.name} ${componentProperty.name}"/>
+ <ui:param name="propertyLabel"
value="${label(property.name)}
${label(componentProperty.name)?uncap_first}"/>
<ui:param name="propertyPath"
value="${propertyPath}"/>
</ui:include>
</f:facet>
@@ -133,7 +133,7 @@
<#assign propertyPath = property.name + '.' +
parentPojo.identifierProperty.name>
<ui:include src="layout/sort.xhtml">
<ui:param name="entityList"
value="${'#'}{${listName}}"/>
- <ui:param name="propertyLabel"
value="${property.name} ${parentPojo.identifierProperty.name}"/>
+ <ui:param name="propertyLabel"
value="${label(property.name)}
${label(parentPojo.identifierProperty.name)?uncap_first}"/>
<ui:param name="propertyPath"
value="${propertyPath}"/>
</ui:include>
</f:facet>
@@ -143,17 +143,17 @@
</#if>
</#foreach>
<ice:column id="listColumn${pageName}Id">
- <f:facet name="header">action</f:facet>
+ <f:facet name="header">Action</f:facet>
<s:link view="/${'#'}{empty from ? '${pageName}' :
from}.xhtml"
value="Select"
id="list${componentName}LinkId">
<#if pojo.isComponent(pojo.identifierProperty)>
<#foreach componentProperty in pojo.identifierProperty.value.propertyIterator>
- <f:param
name="${componentName}${util.upper(componentProperty.name)}"
+ <f:param
name="${componentName}${componentProperty.name?cap_first}"
value="${'#'}{${componentName}.${pojo.identifierProperty.name}.${componentProperty.name}}"/>
</#foreach>
<#else>
- <f:param
name="${componentName}${util.upper(pojo.identifierProperty.name)}"
+ <f:param
name="${componentName}${pojo.identifierProperty.name?cap_first}"
value="${'#'}{${componentName}.${pojo.identifierProperty.name}}"/>
</#if>
</s:link>
@@ -202,10 +202,10 @@
<s:button view="/${editPageName}.xhtml"
id="listCreate${componentName}Id"
value="Create ${componentName}">
-<#assign idName = componentName + util.upper(pojo.identifierProperty.name)>
+<#assign idName = componentName + pojo.identifierProperty.name?cap_first>
<#if c2j.isComponent(pojo.identifierProperty)>
<#foreach componentProperty in pojo.identifierProperty.value.propertyIterator>
-<#assign cidName = componentName + util.upper(componentProperty.name)>
+<#assign cidName = componentName + componentProperty.name?cap_first>
<f:param name="${cidName}"/>
</#foreach>
<#else>
Modified: trunk/seam-gen/icefaces/view/param.xml.ftl
===================================================================
--- trunk/seam-gen/icefaces/view/param.xml.ftl 2008-10-11 21:21:16 UTC (rev 9262)
+++ trunk/seam-gen/icefaces/view/param.xml.ftl 2008-10-12 02:50:02 UTC (rev 9263)
@@ -1,14 +1,15 @@
+<#include "../util/TypeInfo.ftl">
<#foreach property in pojo.allPropertiesIterator>
-<#if util.isToOne(property)>
+<#if isToOne(property)>
<#assign parentPojo =
c2j.getPOJOClass(cfg.getClassMapping(property.value.referencedEntityName))>
<#if entities.add(parentPojo.shortName)>
-<#assign parentComponentName = util.lower(parentPojo.shortName)>
+<#assign parentComponentName = parentPojo.shortName?uncap_first>
<#assign parentHomeName = parentComponentName + "Home">
<param name="${parentComponentName}From"/>
-<#assign parentIdName = parentComponentName +
util.upper(parentPojo.identifierProperty.name)>
+<#assign parentIdName = parentComponentName +
parentPojo.identifierProperty.name?cap_first>
<#if c2j.isComponent(parentPojo.identifierProperty)>
<#foreach parentComponentProperty in
parentPojo.identifierProperty.value.propertyIterator>
-<#assign parentCidName = parentComponentName +
util.upper(parentComponentProperty.name)>
+<#assign parentCidName = parentComponentName +
parentComponentProperty.name?cap_first>
<param name="${parentCidName}"
value="${'#'}{${parentHomeName}.${parentIdName}.${parentComponentProperty.name}}"/>
</#foreach>
<#else>
Modified: trunk/seam-gen/icefaces/view/view.page.xml.ftl
===================================================================
--- trunk/seam-gen/icefaces/view/view.page.xml.ftl 2008-10-11 21:21:16 UTC (rev 9262)
+++ trunk/seam-gen/icefaces/view/view.page.xml.ftl 2008-10-12 02:50:02 UTC (rev 9263)
@@ -9,14 +9,14 @@
<#assign entityName = pojo.shortName>
-<#assign componentName = util.lower(entityName)>
+<#assign componentName = entityName?uncap_first>
<#assign homeName = componentName + "Home">
<param name="${componentName}From"/>
-<#assign idName = componentName + util.upper(pojo.identifierProperty.name)>
+<#assign idName = componentName + pojo.identifierProperty.name?cap_first>
<#if c2j.isComponent(pojo.identifierProperty)>
<#foreach componentProperty in pojo.identifierProperty.value.propertyIterator>
-<#assign cidName = componentName + util.upper(componentProperty.name)>
+<#assign cidName = componentName + componentProperty.name?cap_first>
<param name="${cidName}"
value="${'#'}{${homeName}.${idName}.${componentProperty.name}}"/>
</#foreach>
<#else>
Modified: trunk/seam-gen/icefaces/view/view.xhtml.ftl
===================================================================
--- trunk/seam-gen/icefaces/view/view.xhtml.ftl 2008-10-11 21:21:16 UTC (rev 9262)
+++ trunk/seam-gen/icefaces/view/view.xhtml.ftl 2008-10-12 02:50:02 UTC (rev 9263)
@@ -1,7 +1,9 @@
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<#include "../util/TypeInfo.ftl">
+
<#assign entityName = pojo.shortName>
-<#assign componentName = util.lower(entityName)>
+<#assign componentName = entityName?uncap_first>
<#assign homeName = componentName + "Home">
<#assign masterPageName = entityName + "List">
<#assign editPageName = entityName + "Edit">
@@ -26,7 +28,7 @@
</table>
<#foreach property in pojo.allPropertiesIterator>
-<#if !c2h.isCollection(property) && !util.isToOne(property) &&
property != pojo.versionProperty!>
+<#if !c2h.isCollection(property) && !isToOne(property) && property !=
pojo.versionProperty!>
<#include "viewproperty.xhtml.ftl">
</#if>
</#foreach>
@@ -49,7 +51,7 @@
<#assign hasAssociations=false>
<#foreach property in pojo.allPropertiesIterator>
-<#if util.isToOne(property) || c2h.isOneToManyCollection(property)>
+<#if isToOne(property) || c2h.isOneToManyCollection(property)>
<#assign hasAssociations=true>
</#if>
</#foreach>
@@ -61,12 +63,12 @@
style="margin-bottom:5px;margin-top:10px;">
</#if>
<#foreach property in pojo.allPropertiesIterator>
-<#if util.isToOne(property)>
+<#if isToOne(property)>
<#assign parentPojo =
c2j.getPOJOClass(cfg.getClassMapping(property.value.referencedEntityName))>
<#assign parentPageName = parentPojo.shortName>
-<#assign parentName = util.lower(parentPojo.shortName)>
+<#assign parentName = parentPojo.shortName?uncap_first>
- <ice:panelTab id="view${property.name}panelTab"
label="${property.name}">
+ <ice:panelTab id="view${property.name}panelTab"
label="${label(property.name)}">
<div class="association" id="${property.name}Parent">
<h:outputText value="There is no ${property.name} associated with this
${componentName}."
@@ -80,50 +82,50 @@
columnClasses="allCols"
id="view${property.name}TableId">
<#foreach parentProperty in parentPojo.allPropertiesIterator>
-<#if !c2h.isCollection(parentProperty) && !util.isToOne(parentProperty)
&& parentProperty != parentPojo.versionProperty!>
+<#if !c2h.isCollection(parentProperty) && !isToOne(parentProperty) &&
parentProperty != parentPojo.versionProperty!>
<#if parentPojo.isComponent(parentProperty)>
<#foreach componentProperty in parentProperty.value.propertyIterator>
<ice:column id="viewColumn${componentProperty.name}Id">
- <f:facet
name="header">${componentProperty.name}</f:facet>
+ <f:facet
name="header">${label(componentProperty.name)}</f:facet>
${'#'}{${parentName}.${parentProperty.name}.${componentProperty.name}}
</ice:column>
</#foreach>
<#else>
<ice:column id="view${parentProperty.name}Id">
- <f:facet
name="header">${parentProperty.name}</f:facet>
+ <f:facet
name="header">${label(parentProperty.name)}</f:facet>
${'#'}{${parentName}.${parentProperty.name}}
</ice:column>
</#if>
</#if>
-<#if util.isToOne(parentProperty)>
+<#if isToOne(parentProperty)>
<#assign parentParentPojo =
c2j.getPOJOClass(cfg.getClassMapping(parentProperty.value.referencedEntityName))>
<#if parentParentPojo.isComponent(parentParentPojo.identifierProperty)>
<#foreach componentProperty in
parentParentPojo.identifierProperty.value.propertyIterator>
<ice:column id="view${parentProperty.name}ColumnId">
- <f:facet name="header">${parentProperty.name}
${componentProperty.name}</f:facet>
+ <f:facet name="header">${label(parentProperty.name)}
${label(componentProperty.name)?uncap_first}</f:facet>
${'#'}{${parentName}.${parentProperty.name}.${parentParentPojo.identifierProperty.name}.${componentProperty.name}}
</ice:column>
</#foreach>
<#else>
<ice:column
id="view${parentParentPojo.identifierProperty.name}ColumnName">
- <f:facet name="header">${parentProperty.name}
${parentParentPojo.identifierProperty.name}</f:facet>
+ <f:facet name="header">${label(parentProperty.name)}
${label(parentParentPojo.identifierProperty.name)?uncap_first}</f:facet>
${'#'}{${parentName}.${parentProperty.name}.${parentParentPojo.identifierProperty.name}}
</ice:column>
</#if>
</#if>
</#foreach>
<ice:column id="view${parentName}ColumnId">
- <f:facet name="header">action</f:facet>
+ <f:facet name="header">Action</f:facet>
<s:link id="view${parentName}LinkId"
value="View"
view="/${parentPageName}.xhtml">
<#if parentPojo.isComponent(parentPojo.identifierProperty)>
<#foreach componentProperty in
parentPojo.identifierProperty.value.propertyIterator>
- <f:param
name="${parentName}${util.upper(componentProperty.name)}"
+ <f:param
name="${parentName}${componentProperty.name?cap_first}"
value="${'#'}{${parentName}.${parentPojo.identifierProperty.name}.${componentProperty.name}}"/>
</#foreach>
<#else>
- <f:param
name="${parentName}${util.upper(parentPojo.identifierProperty.name)}"
+ <f:param
name="${parentName}${parentPojo.identifierProperty.name?cap_first}"
value="${'#'}{${parentName}.${parentPojo.identifierProperty.name}}"/>
</#if>
</s:link>
@@ -135,13 +137,13 @@
</#if>
<#if c2h.isOneToManyCollection(property)>
- <ice:panelTab label="${property.name}">
+ <ice:panelTab label="${label(property.name)}">
<div class="association"
id="view${property.name}ChildrenId">
<#assign childPojo = c2j.getPOJOClass(property.value.element.associatedClass)>
<#assign childPageName = childPojo.shortName>
<#assign childEditPageName = childPojo.shortName + "Edit">
-<#assign childName = util.lower(childPojo.shortName)>
+<#assign childName = childPojo.shortName?uncap_first>
<#assign childHomeName = childName + "Home">
<h:outputText value="There are no ${property.name} associated with this
${componentName}."
id="view${property.name}ChildTextId"
@@ -154,17 +156,17 @@
columnClasses="allCols"
id="view${property.name}TableId">
<#foreach childProperty in childPojo.allPropertiesIterator>
-<#if !c2h.isCollection(childProperty) && !util.isToOne(childProperty)
&& childProperty != childPojo.versionProperty!>
+<#if !c2h.isCollection(childProperty) && !isToOne(childProperty) &&
childProperty != childPojo.versionProperty!>
<#if childPojo.isComponent(childProperty)>
<#foreach componentProperty in childProperty.value.propertyIterator>
<ice:column id="view${componentProperty.name}Id">
- <f:facet
name="header">${componentProperty.name}</f:facet>
+ <f:facet
name="header">${label(componentProperty.name)}</f:facet>
${'#'}{${childName}.${childProperty.name}.${componentProperty.name}}
</ice:column>
</#foreach>
<#else>
<ice:column id="view${childProperty.name}Id">
- <f:facet
name="header">${childProperty.name}</f:facet>
+ <f:facet
name="header">${label(childProperty.name)}</f:facet>
<h:outputText id="view${childProperty.name}TextId"
value="${'#'}{${childName}.${childProperty.name}}"/>
</ice:column>
@@ -172,17 +174,17 @@
</#if>
</#foreach>
<ice:column>
- <f:facet name="header">action</f:facet>
+ <f:facet name="header">Action</f:facet>
<s:link id="select${childName}LinkId"
value="Select"
view="/${childPageName}.xhtml">
<#if childPojo.isComponent(childPojo.identifierProperty)>
<#foreach componentProperty in
childPojo.identifierProperty.value.propertyIterator>
- <f:param
name="${childName}${util.upper(componentProperty.name)}"
+ <f:param
name="${childName}${componentProperty.name?cap_first}"
value="${'#'}{${childName}.${childPojo.identifierProperty.name}.${componentProperty.name}}"/>
</#foreach>
<#else>
- <f:param
name="${childName}${util.upper(childPojo.identifierProperty.name)}"
+ <f:param
name="${childName}${childPojo.identifierProperty.name?cap_first}"
value="${'#'}{${childName}.${childPojo.identifierProperty.name}}"/>
</#if>
<f:param name="${childName}From"
value="${entityName}"/>
@@ -196,7 +198,7 @@
<s:button id="viewAdd${childName}ButtonId"
value="Add ${childName}"
view="/${childEditPageName}.xhtml">
- <f:param
name="${componentName}${util.upper(pojo.identifierProperty.name)}"
+ <f:param
name="${componentName}${pojo.identifierProperty.name?cap_first}"
value="${'#'}{${homeName}.instance.${pojo.identifierProperty.name}}"/>
<f:param name="${childName}From"
value="${entityName}"/>
</s:button>
Modified: trunk/seam-gen/icefaces/view/viewproperty.xhtml.ftl
===================================================================
--- trunk/seam-gen/icefaces/view/viewproperty.xhtml.ftl 2008-10-11 21:21:16 UTC (rev
9262)
+++ trunk/seam-gen/icefaces/view/viewproperty.xhtml.ftl 2008-10-12 02:50:02 UTC (rev
9263)
@@ -5,7 +5,7 @@
<#foreach componentProperty in property.value.propertyIterator>
<s:decorate id="${componentProperty.name}"
template="layout/display.xhtml">
- <ui:define
name="label">${componentProperty.name}</ui:define>
+ <ui:define
name="label">${label(componentProperty.name)}</ui:define>
<#if isDate(componentProperty)>
<ice:outputText id="view${componentProperty.name}TextId"
value="${'#'}{${homeName}.instance.${property.name}.${componentProperty.name}}">
@@ -39,7 +39,7 @@
<#else>
<s:decorate id="${property.name}"
template="layout/display.xhtml">
- <ui:define name="label">${property.name}</ui:define>
+ <ui:define
name="label">${label(property.name)}</ui:define>
<#if isDate(property)>
<ice:outputText id="view${property.name}TextId"
value="${'#'}{${homeName}.instance.${property.name}}">
Modified: trunk/seam-gen/src/EntityHome.java.ftl
===================================================================
--- trunk/seam-gen/src/EntityHome.java.ftl 2008-10-11 21:21:16 UTC (rev 9262)
+++ trunk/seam-gen/src/EntityHome.java.ftl 2008-10-12 02:50:02 UTC (rev 9263)
@@ -1,22 +1,23 @@
+<#include "../util/TypeInfo.ftl">
package ${actionPackage};
<#assign classbody>
<#assign entityName = pojo.shortName>
-<#assign componentName = util.lower(entityName)>
+<#assign componentName = entityName?uncap_first>
<#assign homeName = componentName + "Home">
@${pojo.importType("org.jboss.seam.annotations.Name")}("${homeName}")
public class ${entityName}Home extends
${pojo.importType("org.jboss.seam.framework.EntityHome")}<${entityName}>
{
<#foreach property in pojo.allPropertiesIterator>
-<#if util.isToOne(property)>
+<#if isToOne(property)>
<#assign parentPojo =
c2j.getPOJOClass(cfg.getClassMapping(property.value.referencedEntityName))>
-<#assign parentHomeName = util.lower(parentPojo.shortName) + "Home">
+<#assign parentHomeName = parentPojo.shortName?uncap_first + "Home">
@${pojo.importType("org.jboss.seam.annotations.In")}(create=true)
${parentPojo.shortName}Home ${parentHomeName};
</#if>
</#foreach>
-<#assign idName = entityName + util.upper(pojo.identifierProperty.name)>
+<#assign idName = entityName + pojo.identifierProperty.name?cap_first>
<#if c2j.isComponent(pojo.identifierProperty)>
<#assign idType = entityName + "Id">
<#else>
@@ -69,10 +70,10 @@
{
getInstance();
<#foreach property in pojo.allPropertiesIterator>
-<#if util.isToOne(property)>
+<#if isToOne(property)>
<#assign parentPojo =
c2j.getPOJOClass(cfg.getClassMapping(property.value.referencedEntityName))>
<#if parentPojo.shortName!=pojo.shortName>
-<#assign parentHomeName = util.lower(parentPojo.shortName) + "Home">
+<#assign parentHomeName = parentPojo.shortName?uncap_first + "Home">
<#assign setter = "set" + pojo.getPropertyName(property)>
${parentPojo.shortName} ${property.name}=${parentHomeName}.getDefinedInstance();
if ( ${property.name}!=null )
@@ -87,7 +88,7 @@
public boolean isWired()
{
<#foreach property in pojo.allPropertiesIterator>
-<#if (util.isToOne(property) && !property.optional)>
+<#if (isToOne(property) && !property.optional)>
<#assign getter = pojo.getGetterSignature(property)>
if ( getInstance().${getter}()==null ) return false;
</#if>
Modified: trunk/seam-gen/src/EntityList.java.ftl
===================================================================
--- trunk/seam-gen/src/EntityList.java.ftl 2008-10-11 21:21:16 UTC (rev 9262)
+++ trunk/seam-gen/src/EntityList.java.ftl 2008-10-12 02:50:02 UTC (rev 9263)
@@ -1,6 +1,6 @@
<#include "../util/TypeInfo.ftl">
<#assign entityName = pojo.shortName>
-<#assign componentName = util.lower(entityName)>
+<#assign componentName = entityName?uncap_first>
<#assign listName = componentName + "List">
package ${actionPackage};
@@ -19,7 +19,7 @@
private static final String[] RESTRICTIONS = {
<#foreach property in pojo.allPropertiesIterator>
-<#if !c2h.isCollection(property) && !util.isToOne(property)>
+<#if !c2h.isCollection(property) && !isToOne(property)>
<#if c2j.isComponent(property)>
<#foreach componentProperty in property.value.propertyIterator>
<#if isString(componentProperty)>
Modified: trunk/seam-gen/util/TypeInfo.ftl
===================================================================
(Binary files differ)
Modified: trunk/seam-gen/view/edit.page.xml.ftl
===================================================================
--- trunk/seam-gen/view/edit.page.xml.ftl 2008-10-11 21:21:16 UTC (rev 9262)
+++ trunk/seam-gen/view/edit.page.xml.ftl 2008-10-12 02:50:02 UTC (rev 9263)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<#assign entityName = pojo.shortName>
-<#assign componentName = util.lower(entityName)>
+<#assign componentName = entityName?uncap_first>
<#assign homeName = componentName + "Home">
<#assign masterPageName = entityName + "List">
<#assign pageName = entityName>
@@ -15,10 +15,10 @@
<action execute="${'#'}{${homeName}.wire}"/>
<param name="${componentName}From"/>
-<#assign idName = componentName + util.upper(pojo.identifierProperty.name)>
+<#assign idName = componentName + pojo.identifierProperty.name?cap_first>
<#if c2j.isComponent(pojo.identifierProperty)>
<#foreach componentProperty in pojo.identifierProperty.value.propertyIterator>
-<#assign cidName = componentName + util.upper(componentProperty.name)>
+<#assign cidName = componentName + componentProperty.name?cap_first>
<param name="${cidName}"
value="${'#'}{${homeName}.${idName}.${componentProperty.name}}"/>
</#foreach>
<#else>
Modified: trunk/seam-gen/view/edit.xhtml.ftl
===================================================================
--- trunk/seam-gen/view/edit.xhtml.ftl 2008-10-11 21:21:16 UTC (rev 9262)
+++ trunk/seam-gen/view/edit.xhtml.ftl 2008-10-12 02:50:02 UTC (rev 9263)
@@ -1,7 +1,7 @@
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<#assign entityName = pojo.shortName>
-<#assign componentName = util.lower(entityName)>
+<#assign componentName = entityName?uncap_first>
<#assign homeName = componentName + "Home">
<#assign masterPageName = entityName + "List">
<#assign pageName = entityName>
@@ -67,7 +67,7 @@
</h:form>
<#assign hasAssociations=false>
<#foreach property in pojo.allPropertiesIterator>
-<#if util.isToOne(property) || c2h.isOneToManyCollection(property)>
+<#if isToOne(property) || c2h.isOneToManyCollection(property)>
<#assign hasAssociations=true>
</#if>
</#foreach>
@@ -76,15 +76,15 @@
<rich:tabPanel switchType="ajax">
</#if>
<#foreach property in pojo.allPropertiesIterator>
-<#if util.isToOne(property)>
+<#if isToOne(property)>
<#assign parentPojo =
c2j.getPOJOClass(cfg.getClassMapping(property.value.referencedEntityName))>
<#assign parentPageName = parentPojo.shortName>
-<#assign parentName = util.lower(parentPojo.shortName)>
+<#assign parentName = parentPojo.shortName?uncap_first>
<#if property.optional>
- <rich:tab label="${property.name}">
+ <rich:tab label="${label(property.name)}">
<#else>
- <rich:tab label="${property.name} *"
labelClass="required">
+ <rich:tab label="${label(property.name)} *"
labelClass="required">
</#if>
<div class="association" id="${property.name}Parent">
@@ -97,51 +97,51 @@
rowClasses="rvgRowOne,rvgRowTwo"
id="${property.name}Table">
<#foreach parentProperty in parentPojo.allPropertiesIterator>
-<#if !c2h.isCollection(parentProperty) && !util.isToOne(parentProperty)
&& parentProperty != parentPojo.versionProperty!>
+<#if !c2h.isCollection(parentProperty) && !isToOne(parentProperty) &&
parentProperty != parentPojo.versionProperty!>
<#if parentPojo.isComponent(parentProperty)>
<#foreach componentProperty in parentProperty.value.propertyIterator>
<h:column>
- <f:facet
name="header">${componentProperty.name}</f:facet>
+ <f:facet
name="header">${label(componentProperty.name)}</f:facet>
${'#'}{${parentName}.${parentProperty.name}.${componentProperty.name}}
</h:column>
</#foreach>
<#else>
<h:column>
- <f:facet
name="header">${parentProperty.name}</f:facet>
+ <f:facet
name="header">${label(parentProperty.name)}</f:facet>
${'#'}{${parentName}.${parentProperty.name}}
</h:column>
</#if>
</#if>
-<#if util.isToOne(parentProperty)>
+<#if isToOne(parentProperty)>
<#assign parentParentPojo =
c2j.getPOJOClass(cfg.getClassMapping(parentProperty.value.referencedEntityName))>
<#if parentParentPojo.isComponent(parentParentPojo.identifierProperty)>
<#foreach componentProperty in
parentParentPojo.identifierProperty.value.propertyIterator>
<h:column>
- <f:facet name="header">${parentProperty.name}
${componentProperty.name}</f:facet>
+ <f:facet name="header">${label(parentProperty.name)}
${label(componentProperty.name)?uncap_first}</f:facet>
${'#'}{${parentName}.${parentProperty.name}.${parentParentPojo.identifierProperty.name}.${componentProperty.name}}
</h:column>
</#foreach>
<#else>
<h:column>
- <f:facet name="header">${parentProperty.name}
${parentParentPojo.identifierProperty.name}</f:facet>
+ <f:facet name="header">${label(parentProperty.name)}
${label(parentParentPojo.identifierProperty.name)?uncap_first}</f:facet>
${'#'}{${parentName}.${parentProperty.name}.${parentParentPojo.identifierProperty.name}}
</h:column>
</#if>
</#if>
</#foreach>
<h:column>
- <f:facet name="header">action</f:facet>
+ <f:facet name="header">Action</f:facet>
<s:link view="/${parentPageName}.xhtml"
id="view${parentName}"
value="View"
propagation="none">
<#if parentPojo.isComponent(parentPojo.identifierProperty)>
<#foreach componentProperty in
parentPojo.identifierProperty.value.propertyIterator>
- <f:param
name="${parentName}${util.upper(componentProperty.name)}"
+ <f:param
name="${parentName}${componentProperty.name?cap_first}"
value="${'#'}{${parentName}.${parentPojo.identifierProperty.name}.${componentProperty.name}}"/>
</#foreach>
<#else>
- <f:param
name="${parentName}${util.upper(parentPojo.identifierProperty.name)}"
+ <f:param
name="${parentName}${parentPojo.identifierProperty.name?cap_first}"
value="${'#'}{${parentName}.${parentPojo.identifierProperty.name}}"/>
</#if>
</s:link>
@@ -162,13 +162,13 @@
</#if>
<#if c2h.isOneToManyCollection(property)>
- <rich:tab label="${property.name}">
+ <rich:tab label="${label(property.name)}">
<div class="association"
id="${property.name}Children">
<#assign childPojo = c2j.getPOJOClass(property.value.element.associatedClass)>
<#assign childPageName = childPojo.shortName>
<#assign childEditPageName = childPojo.shortName + "Edit">
-<#assign childName = util.lower(childPojo.shortName)>
+<#assign childName = childPojo.shortName?uncap_first>
<h:outputText value="There are no ${property.name} associated with
this ${componentName}."
rendered="${'#'}{empty
${homeName}.${property.name}}"/>
@@ -178,35 +178,35 @@
rowClasses="rvgRowOne,rvgRowTwo"
id="${property.name}Table">
<#foreach childProperty in childPojo.allPropertiesIterator>
-<#if !c2h.isCollection(childProperty) && !util.isToOne(childProperty)
&& childProperty != childPojo.versionProperty!>
+<#if !c2h.isCollection(childProperty) && !isToOne(childProperty) &&
childProperty != childPojo.versionProperty!>
<#if childPojo.isComponent(childProperty)>
<#foreach componentProperty in childProperty.value.propertyIterator>
<h:column>
- <f:facet
name="header">${componentProperty.name}</f:facet>
+ <f:facet
name="header">${label(componentProperty.name)}</f:facet>
${'#'}{${childName}.${childProperty.name}.${componentProperty.name}}
</h:column>
</#foreach>
<#else>
<h:column>
- <f:facet
name="header">${childProperty.name}</f:facet>
+ <f:facet
name="header">${label(childProperty.name)}</f:facet>
<h:outputText
value="${'#'}{${childName}.${childProperty.name}}"/>
</h:column>
</#if>
</#if>
</#foreach>
<h:column>
- <f:facet name="header">action</f:facet>
+ <f:facet name="header">Action</f:facet>
<s:link view="/${childPageName}.xhtml"
id="select${childName}"
value="View"
propagation="none">
<#if childPojo.isComponent(childPojo.identifierProperty)>
<#foreach componentProperty in
childPojo.identifierProperty.value.propertyIterator>
- <f:param
name="${childName}${util.upper(componentProperty.name)}"
+ <f:param
name="${childName}${componentProperty.name?cap_first}"
value="${'#'}{${childName}.${childPojo.identifierProperty.name}.${componentProperty.name}}"/>
</#foreach>
<#else>
- <f:param
name="${childName}${util.upper(childPojo.identifierProperty.name)}"
+ <f:param
name="${childName}${childPojo.identifierProperty.name?cap_first}"
value="${'#'}{${childName}.${childPojo.identifierProperty.name}}"/>
</#if>
<f:param name="${childName}From"
value="${entityName}"/>
@@ -222,7 +222,7 @@
value="Add ${childName}"
view="/${childEditPageName}.xhtml"
propagation="none">
- <f:param
name="${componentName}${util.upper(pojo.identifierProperty.name)}"
+ <f:param
name="${componentName}${pojo.identifierProperty.name?cap_first}"
value="${'#'}{${homeName}.instance.${pojo.identifierProperty.name}}"/>
<f:param name="${childName}From"
value="${entityName}"/>
</s:button>
Modified: trunk/seam-gen/view/editproperty.xhtml.ftl
===================================================================
--- trunk/seam-gen/view/editproperty.xhtml.ftl 2008-10-11 21:21:16 UTC (rev 9262)
+++ trunk/seam-gen/view/editproperty.xhtml.ftl 2008-10-12 02:50:02 UTC (rev 9263)
@@ -1,6 +1,6 @@
<#include "../util/TypeInfo.ftl">
-<#if !c2h.isCollection(property) && !util.isToOne(property) &&
property != pojo.versionProperty!>
+<#if !c2h.isCollection(property) && !isToOne(property) && property !=
pojo.versionProperty!>
<#assign propertyIsId = property.equals(pojo.identifierProperty)>
<#if !propertyIsId || property.value.identifierGeneratorStrategy ==
"assigned">
<#if pojo.isComponent(property)>
@@ -8,7 +8,7 @@
<#assign column = componentProperty.columnIterator.next()>
<s:decorate id="${componentProperty.name}Field"
template="layout/edit.xhtml">
- <ui:define
name="label">${componentProperty.name}</ui:define>
+ <ui:define
name="label">${label(componentProperty.name)}</ui:define>
<#if isDate(componentProperty)>
<rich:calendar id="${componentProperty.name}"
<#if propertyIsId>
@@ -119,7 +119,7 @@
<#assign property = property.value.typeName>
<s:decorate id="${property.name}Field"
template="layout/edit.xhtml">
- <ui:define
name="label">${property.name}</ui:define>
+ <ui:define
name="label">${label(property.name)}</ui:define>
<#if isDate(property)>
<rich:calendar id="${property.name}"
<#if propertyIsId>
Modified: trunk/seam-gen/view/list.page.xml.ftl
===================================================================
--- trunk/seam-gen/view/list.page.xml.ftl 2008-10-11 21:21:16 UTC (rev 9262)
+++ trunk/seam-gen/view/list.page.xml.ftl 2008-10-12 02:50:02 UTC (rev 9263)
@@ -5,7 +5,7 @@
<#include "../util/TypeInfo.ftl">
<#assign entityName = pojo.shortName>
-<#assign componentName = util.lower(entityName)>
+<#assign componentName = entityName?uncap_first>
<#assign listName = componentName + "List">
<param name="firstResult"
value="${'#'}{${listName}.firstResult}"/>
<param name="sort"
value="${'#'}{${listName}.orderColumn}"/>
@@ -13,7 +13,7 @@
<param name="from"/>
<#foreach property in pojo.allPropertiesIterator>
-<#if !c2h.isCollection(property) && !util.isToOne(property) &&
property != pojo.versionProperty!>
+<#if !c2h.isCollection(property) && !isToOne(property) && property !=
pojo.versionProperty!>
<#if c2j.isComponent(property)>
<#foreach componentProperty in property.value.propertyIterator>
<#if isString(componentProperty)>
Modified: trunk/seam-gen/view/list.xhtml.ftl
===================================================================
--- trunk/seam-gen/view/list.xhtml.ftl 2008-10-11 21:21:16 UTC (rev 9262)
+++ trunk/seam-gen/view/list.xhtml.ftl 2008-10-12 02:50:02 UTC (rev 9263)
@@ -3,7 +3,7 @@
<#include "../util/TypeInfo.ftl">
<#assign entityName = pojo.shortName>
-<#assign componentName = util.lower(entityName)>
+<#assign componentName = entityName?uncap_first>
<#assign listName = componentName + "List">
<#assign pageName = entityName>
<#assign editPageName = entityName + "Edit">
@@ -24,12 +24,12 @@
<rich:simpleTogglePanel label="${entityName} search filter"
switchType="ajax">
<#foreach property in pojo.allPropertiesIterator>
-<#if !c2h.isCollection(property) && !util.isToOne(property) &&
property != pojo.versionProperty!>
+<#if !c2h.isCollection(property) && !isToOne(property) && property !=
pojo.versionProperty!>
<#if c2j.isComponent(property)>
<#foreach componentProperty in property.value.propertyIterator>
<#if isString(componentProperty)>
<s:decorate template="layout/display.xhtml">
- <ui:define
name="label">${componentProperty.name}</ui:define>
+ <ui:define
name="label">${label(componentProperty.name)}</ui:define>
<h:inputText id="${componentProperty.name}"
value="${'#'}{${listName}.${componentName}.${property.name}.${componentProperty.name}}"/>
</s:decorate>
@@ -38,7 +38,7 @@
<#else>
<#if isString(property)>
<s:decorate template="layout/display.xhtml">
- <ui:define
name="label">${property.name}</ui:define>
+ <ui:define
name="label">${label(property.name)}</ui:define>
<h:inputText id="${property.name}"
value="${'#'}{${listName}.${componentName}.${property.name}}"/>
</s:decorate>
@@ -67,7 +67,7 @@
value="${'#'}{${listName}.resultList}"
rendered="${'#'}{not empty ${listName}.resultList}">
<#foreach property in pojo.allPropertiesIterator>
-<#if !c2h.isCollection(property) && !util.isToOne(property) &&
property != pojo.versionProperty!>
+<#if !c2h.isCollection(property) && !isToOne(property) && property !=
pojo.versionProperty!>
<#if pojo.isComponent(property)>
<#foreach componentProperty in property.value.propertyIterator>
<h:column>
@@ -75,7 +75,7 @@
<#assign propertyPath = property.name + '.' + componentProperty.name>
<ui:include src="layout/sort.xhtml">
<ui:param name="entityList"
value="${'#'}{${listName}}"/>
- <ui:param name="propertyLabel"
value="${componentProperty.name}"/>
+ <ui:param name="propertyLabel"
value="${label(componentProperty.name)}"/>
<ui:param name="propertyPath"
value="${propertyPath}"/>
</ui:include>
</f:facet>
@@ -87,7 +87,7 @@
<f:facet name="header">
<ui:include src="layout/sort.xhtml">
<ui:param name="entityList"
value="${'#'}{${listName}}"/>
- <ui:param name="propertyLabel"
value="${property.name}"/>
+ <ui:param name="propertyLabel"
value="${label(property.name)}"/>
<ui:param name="propertyPath"
value="${property.name}"/>
</ui:include>
</f:facet>
@@ -95,7 +95,7 @@
</h:column>
</#if>
</#if>
-<#if util.isToOne(property)>
+<#if isToOne(property)>
<#assign parentPojo =
c2j.getPOJOClass(cfg.getClassMapping(property.value.referencedEntityName))>
<#if parentPojo.isComponent(parentPojo.identifierProperty)>
<#foreach componentProperty in
parentPojo.identifierProperty.value.propertyIterator>
@@ -104,7 +104,7 @@
<#assign propertyPath = property.name + '.' +
parentPojo.identifierProperty.name + '.' + componentProperty.name>
<ui:include src="layout/sort.xhtml">
<ui:param name="entityList"
value="${'#'}{${listName}}"/>
- <ui:param name="propertyLabel"
value="${property.name} ${componentProperty.name}"/>
+ <ui:param name="propertyLabel"
value="${label(property.name)}
${label(componentProperty.name)?uncap_first}"/>
<ui:param name="propertyPath"
value="${propertyPath}"/>
</ui:include>
</f:facet>
@@ -117,7 +117,7 @@
<#assign propertyPath = property.name + '.' +
parentPojo.identifierProperty.name>
<ui:include src="layout/sort.xhtml">
<ui:param name="entityList"
value="${'#'}{${listName}}"/>
- <ui:param name="propertyLabel"
value="${property.name} ${parentPojo.identifierProperty.name}"/>
+ <ui:param name="propertyLabel"
value="${label(property.name)}
${label(parentPojo.identifierProperty.name)?uncap_first}"/>
<ui:param name="propertyPath"
value="${propertyPath}"/>
</ui:include>
</f:facet>
@@ -127,17 +127,17 @@
</#if>
</#foreach>
<h:column>
- <f:facet name="header">action</f:facet>
+ <f:facet name="header">Action</f:facet>
<s:link view="/${'#'}{empty from ? '${pageName}' :
from}.xhtml"
value="${'#'}{empty from ? 'View' :
'Select'}"
id="${componentName}">
<#if pojo.isComponent(pojo.identifierProperty)>
<#foreach componentProperty in pojo.identifierProperty.value.propertyIterator>
- <f:param
name="${componentName}${util.upper(componentProperty.name)}"
+ <f:param
name="${componentName}${componentProperty.name?cap_first}"
value="${'#'}{${componentName}.${pojo.identifierProperty.name}.${componentProperty.name}}"/>
</#foreach>
<#else>
- <f:param
name="${componentName}${util.upper(pojo.identifierProperty.name)}"
+ <f:param
name="${componentName}${pojo.identifierProperty.name?cap_first}"
value="${'#'}{${componentName}.${pojo.identifierProperty.name}}"/>
</#if>
</s:link>
@@ -186,10 +186,10 @@
<s:button view="/${editPageName}.xhtml"
id="create"
value="Create ${componentName}">
-<#assign idName = componentName + util.upper(pojo.identifierProperty.name)>
+<#assign idName = componentName + pojo.identifierProperty.name?cap_first>
<#if c2j.isComponent(pojo.identifierProperty)>
<#foreach componentProperty in pojo.identifierProperty.value.propertyIterator>
-<#assign cidName = componentName + util.upper(componentProperty.name)>
+<#assign cidName = componentName + componentProperty.name?cap_first>
<f:param name="${cidName}"/>
</#foreach>
<#else>
Modified: trunk/seam-gen/view/param.xml.ftl
===================================================================
--- trunk/seam-gen/view/param.xml.ftl 2008-10-11 21:21:16 UTC (rev 9262)
+++ trunk/seam-gen/view/param.xml.ftl 2008-10-12 02:50:02 UTC (rev 9263)
@@ -1,14 +1,15 @@
+<#include "../util/TypeInfo.ftl">
<#foreach property in pojo.allPropertiesIterator>
-<#if util.isToOne(property)>
+<#if isToOne(property)>
<#assign parentPojo =
c2j.getPOJOClass(cfg.getClassMapping(property.value.referencedEntityName))>
<#if entities.add(parentPojo.shortName)>
-<#assign parentComponentName = util.lower(parentPojo.shortName)>
+<#assign parentComponentName = parentPojo.shortName?uncap_first>
<#assign parentHomeName = parentComponentName + "Home">
<param name="${parentComponentName}From"/>
-<#assign parentIdName = parentComponentName +
util.upper(parentPojo.identifierProperty.name)>
+<#assign parentIdName = parentComponentName +
parentPojo.identifierProperty.name?cap_first>
<#if c2j.isComponent(parentPojo.identifierProperty)>
<#foreach parentComponentProperty in
parentPojo.identifierProperty.value.propertyIterator>
-<#assign parentCidName = parentComponentName +
util.upper(parentComponentProperty.name)>
+<#assign parentCidName = parentComponentName +
parentComponentProperty.name?cap_first>
<param name="${parentCidName}"
value="${'#'}{${parentHomeName}.${parentIdName}.${parentComponentProperty.name}}"/>
</#foreach>
<#else>
Modified: trunk/seam-gen/view/view.page.xml.ftl
===================================================================
--- trunk/seam-gen/view/view.page.xml.ftl 2008-10-11 21:21:16 UTC (rev 9262)
+++ trunk/seam-gen/view/view.page.xml.ftl 2008-10-12 02:50:02 UTC (rev 9263)
@@ -4,13 +4,13 @@
xsi:schemaLocation="http://jboss.com/products/seam/pages
http://jboss.com/products/seam/pages-2.1.xsd">
<#assign entityName = pojo.shortName>
-<#assign componentName = util.lower(entityName)>
+<#assign componentName = entityName?uncap_first>
<#assign homeName = componentName + "Home">
<param name="${componentName}From"/>
-<#assign idName = componentName + util.upper(pojo.identifierProperty.name)>
+<#assign idName = componentName + pojo.identifierProperty.name?cap_first>
<#if c2j.isComponent(pojo.identifierProperty)>
<#foreach componentProperty in pojo.identifierProperty.value.propertyIterator>
-<#assign cidName = componentName + util.upper(componentProperty.name)>
+<#assign cidName = componentName + componentProperty.name?cap_first>
<param name="${cidName}"
value="${'#'}{${homeName}.${idName}.${componentProperty.name}}"/>
</#foreach>
<#else>
Modified: trunk/seam-gen/view/view.xhtml.ftl
===================================================================
--- trunk/seam-gen/view/view.xhtml.ftl 2008-10-11 21:21:16 UTC (rev 9262)
+++ trunk/seam-gen/view/view.xhtml.ftl 2008-10-12 02:50:02 UTC (rev 9263)
@@ -1,7 +1,8 @@
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<#include "../util/TypeInfo.ftl">
<#assign entityName = pojo.shortName>
-<#assign componentName = util.lower(entityName)>
+<#assign componentName = entityName?uncap_first>
<#assign homeName = componentName + "Home">
<#assign masterPageName = entityName + "List">
<#assign editPageName = entityName + "Edit">
@@ -19,7 +20,7 @@
<rich:panel>
<f:facet name="header">${entityName}</f:facet>
<#foreach property in pojo.allPropertiesIterator>
-<#if !c2h.isCollection(property) && !util.isToOne(property) &&
property != pojo.versionProperty!>
+<#if !c2h.isCollection(property) && !isToOne(property) && property !=
pojo.versionProperty!>
<#include "viewproperty.xhtml.ftl">
</#if>
</#foreach>
@@ -41,7 +42,7 @@
</div>
<#assign hasAssociations=false>
<#foreach property in pojo.allPropertiesIterator>
-<#if util.isToOne(property) || c2h.isOneToManyCollection(property)>
+<#if isToOne(property) || c2h.isOneToManyCollection(property)>
<#assign hasAssociations=true>
</#if>
</#foreach>
@@ -50,12 +51,12 @@
<rich:tabPanel switchType="ajax">
</#if>
<#foreach property in pojo.allPropertiesIterator>
-<#if util.isToOne(property)>
+<#if isToOne(property)>
<#assign parentPojo =
c2j.getPOJOClass(cfg.getClassMapping(property.value.referencedEntityName))>
<#assign parentPageName = parentPojo.shortName>
-<#assign parentName = util.lower(parentPojo.shortName)>
+<#assign parentName = parentPojo.shortName?uncap_first>
- <rich:tab label="${property.name}">
+ <rich:tab label="${label(property.name)}">
<div class="association" id="${property.name}Parent">
<h:outputText value="There is no ${property.name} associated with this
${componentName}."
@@ -67,50 +68,50 @@
rowClasses="rvgRowOne,rvgRowTwo"
id="${property.name}Table">
<#foreach parentProperty in parentPojo.allPropertiesIterator>
-<#if !c2h.isCollection(parentProperty) && !util.isToOne(parentProperty)
&& parentProperty != parentPojo.versionProperty!>
+<#if !c2h.isCollection(parentProperty) && !isToOne(parentProperty) &&
parentProperty != parentPojo.versionProperty!>
<#if parentPojo.isComponent(parentProperty)>
<#foreach componentProperty in parentProperty.value.propertyIterator>
<h:column>
- <f:facet
name="header">${componentProperty.name}</f:facet>
+ <f:facet
name="header">${label(componentProperty.name)}</f:facet>
${'#'}{${parentName}.${parentProperty.name}.${componentProperty.name}}
</h:column>
</#foreach>
<#else>
<h:column>
- <f:facet
name="header">${parentProperty.name}</f:facet>
+ <f:facet
name="header">${label(parentProperty.name)}</f:facet>
${'#'}{${parentName}.${parentProperty.name}}
</h:column>
</#if>
</#if>
-<#if util.isToOne(parentProperty)>
+<#if isToOne(parentProperty)>
<#assign parentParentPojo =
c2j.getPOJOClass(cfg.getClassMapping(parentProperty.value.referencedEntityName))>
<#if parentParentPojo.isComponent(parentParentPojo.identifierProperty)>
<#foreach componentProperty in
parentParentPojo.identifierProperty.value.propertyIterator>
<h:column>
- <f:facet name="header">${parentProperty.name}
${componentProperty.name}</f:facet>
+ <f:facet name="header">${label(parentProperty.name)}
${label(componentProperty.name)?uncap_first}</f:facet>
${'#'}{${parentName}.${parentProperty.name}.${parentParentPojo.identifierProperty.name}.${componentProperty.name}}
</h:column>
</#foreach>
<#else>
<h:column>
- <f:facet name="header">${parentProperty.name}
${parentParentPojo.identifierProperty.name}</f:facet>
+ <f:facet name="header">${label(parentProperty.name)}
${label(parentParentPojo.identifierProperty.name)?uncap_first}</f:facet>
${'#'}{${parentName}.${parentProperty.name}.${parentParentPojo.identifierProperty.name}}
</h:column>
</#if>
</#if>
</#foreach>
<h:column>
- <f:facet name="header">action</f:facet>
+ <f:facet name="header">Action</f:facet>
<s:link id="view${parentName}"
value="View"
view="/${parentPageName}.xhtml">
<#if parentPojo.isComponent(parentPojo.identifierProperty)>
<#foreach componentProperty in
parentPojo.identifierProperty.value.propertyIterator>
- <f:param
name="${parentName}${util.upper(componentProperty.name)}"
+ <f:param
name="${parentName}${componentProperty.name?cap_first}"
value="${'#'}{${parentName}.${parentPojo.identifierProperty.name}.${componentProperty.name}}"/>
</#foreach>
<#else>
- <f:param
name="${parentName}${util.upper(parentPojo.identifierProperty.name)}"
+ <f:param
name="${parentName}${parentPojo.identifierProperty.name?cap_first}"
value="${'#'}{${parentName}.${parentPojo.identifierProperty.name}}"/>
</#if>
</s:link>
@@ -122,13 +123,13 @@
</#if>
<#if c2h.isOneToManyCollection(property)>
- <rich:tab label="${property.name}">
+ <rich:tab label="${label(property.name)}">
<div class="association" id="${property.name}Children">
<#assign childPojo = c2j.getPOJOClass(property.value.element.associatedClass)>
<#assign childPageName = childPojo.shortName>
<#assign childEditPageName = childPojo.shortName + "Edit">
-<#assign childName = util.lower(childPojo.shortName)>
+<#assign childName = childPojo.shortName?uncap_first>
<#assign childHomeName = childName + "Home">
<h:outputText value="There are no ${property.name} associated with this
${componentName}."
rendered="${'#'}{empty
${homeName}.${property.name}}"/>
@@ -139,34 +140,34 @@
rowClasses="rvgRowOne,rvgRowTwo"
id="${property.name}Table">
<#foreach childProperty in childPojo.allPropertiesIterator>
-<#if !c2h.isCollection(childProperty) && !util.isToOne(childProperty)
&& childProperty != childPojo.versionProperty!>
+<#if !c2h.isCollection(childProperty) && !isToOne(childProperty) &&
childProperty != childPojo.versionProperty!>
<#if childPojo.isComponent(childProperty)>
<#foreach componentProperty in childProperty.value.propertyIterator>
<h:column>
- <f:facet
name="header">${componentProperty.name}</f:facet>
+ <f:facet
name="header">${label(componentProperty.name)}</f:facet>
${'#'}{${childName}.${childProperty.name}.${componentProperty.name}}
</h:column>
</#foreach>
<#else>
<h:column>
- <f:facet
name="header">${childProperty.name}</f:facet>
+ <f:facet
name="header">${label(childProperty.name)}</f:facet>
<h:outputText
value="${'#'}{${childName}.${childProperty.name}}"/>
</h:column>
</#if>
</#if>
</#foreach>
<h:column>
- <f:facet name="header">action</f:facet>
+ <f:facet name="header">Action</f:facet>
<s:link id="select${childName}"
value="Select"
view="/${childPageName}.xhtml">
<#if childPojo.isComponent(childPojo.identifierProperty)>
<#foreach componentProperty in
childPojo.identifierProperty.value.propertyIterator>
- <f:param
name="${childName}${util.upper(componentProperty.name)}"
+ <f:param
name="${childName}${componentProperty.name?cap_first}"
value="${'#'}{${childName}.${childPojo.identifierProperty.name}.${componentProperty.name}}"/>
</#foreach>
<#else>
- <f:param
name="${childName}${util.upper(childPojo.identifierProperty.name)}"
+ <f:param
name="${childName}${childPojo.identifierProperty.name?cap_first}"
value="${'#'}{${childName}.${childPojo.identifierProperty.name}}"/>
</#if>
<f:param name="${childName}From"
value="${entityName}"/>
@@ -180,7 +181,7 @@
<s:button
value="Add ${childName}"
view="/${childEditPageName}.xhtml">
- <f:param
name="${componentName}${util.upper(pojo.identifierProperty.name)}"
+ <f:param
name="${componentName}${pojo.identifierProperty.name?cap_first}"
value="${'#'}{${homeName}.instance.${pojo.identifierProperty.name}}"/>
<f:param name="${childName}From"
value="${entityName}"/>
</s:button>
Modified: trunk/seam-gen/view/viewproperty.xhtml.ftl
===================================================================
--- trunk/seam-gen/view/viewproperty.xhtml.ftl 2008-10-11 21:21:16 UTC (rev 9262)
+++ trunk/seam-gen/view/viewproperty.xhtml.ftl 2008-10-12 02:50:02 UTC (rev 9263)
@@ -5,7 +5,7 @@
<#foreach componentProperty in property.value.propertyIterator>
<s:decorate id="${componentProperty.name}"
template="layout/display.xhtml">
- <ui:define
name="label">${componentProperty.name}</ui:define>
+ <ui:define
name="label">${label(componentProperty.name)}</ui:define>
<#if isDate(componentProperty)>
<h:outputText
value="${'#'}{${homeName}.instance.${property.name}.${componentProperty.name}}">
<s:convertDateTime type="date"
dateStyle="short"/>
@@ -34,7 +34,7 @@
<#else>
<s:decorate id="${property.name}"
template="layout/display.xhtml">
- <ui:define name="label">${property.name}</ui:define>
+ <ui:define
name="label">${label(property.name)}</ui:define>
<#if isDate(property)>
<h:outputText
value="${'#'}{${homeName}.instance.${property.name}}">
<s:convertDateTime type="date"
dateStyle="short"/>