You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(6) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(178) |
Feb
(169) |
Mar
(286) |
Apr
(117) |
May
(98) |
Jun
(68) |
Jul
(63) |
Aug
(121) |
Sep
(88) |
Oct
(124) |
Nov
(2) |
Dec
(111) |
2007 |
Jan
(224) |
Feb
(69) |
Mar
(10) |
Apr
(72) |
May
(7) |
Jun
(21) |
Jul
(33) |
Aug
(35) |
Sep
(12) |
Oct
(22) |
Nov
(5) |
Dec
(6) |
2008 |
Jan
(2) |
Feb
(10) |
Mar
(39) |
Apr
(58) |
May
(34) |
Jun
(9) |
Jul
(27) |
Aug
(10) |
Sep
(3) |
Oct
|
Nov
|
Dec
|
From: Chad B. <cwb...@us...> - 2008-03-28 21:28:38
|
User: cwbrandon Date: 08/03/28 14:28:42 Modified: andromda-jsf2/src/main/resources/META-INF/andromda cartridge.xml andromda-jsf2/src/main/resources/templates/jsf2/views/portlet help.xhtml.vsl andromda-jsf2/src/main/resources/templates/jsf2/configuration/portlet liferay-portlet.xml.vsl portlet.xml.vsl Log: improvements to help and edit generation Revision Changes Path 1.18 +28 -10 cartridges/andromda-jsf2/src/main/resources/META-INF/andromda/cartridge.xml Index: cartridge.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/META-INF/andromda/cartridge.xml,v retrieving revision 1.17 retrieving revision 1.18 diff -u -w -r1.17 -r1.18 --- cartridge.xml 28 Mar 2008 18:37:02 -0000 1.17 +++ cartridge.xml 28 Mar 2008 21:28:40 -0000 1.18 @@ -1053,11 +1053,9 @@ outputToSingleFile="true" outputCondition="portlet" outputOnEmptyElements="false"> - <modelElements> - <modelElement variable="applicationUseCases"> - <type name="org.andromda.metafacades.uml.FrontEndUseCase"> - <property name="entryUseCase"/> - </type> + <modelElements variable="useCases"> + <modelElement> + <type name="org.andromda.metafacades.uml.FrontEndUseCase"/> </modelElement> </modelElements> </template> @@ -1067,7 +1065,15 @@ outputPattern="WEB-INF/liferay-portlet.xml" outlet="configuration" overwrite="true" - outputCondition="liferayPortlet"/> + outputToSingleFile="true" + outputCondition="liferayPortlet" + outputOnEmptyElements="false"> + <modelElements variable="useCases"> + <modelElement> + <type name="org.andromda.metafacades.uml.FrontEndUseCase"/> + </modelElement> + </modelElements> + </template> <template path="templates/jsf2/flow/portlet/PortletPhaseListener.java.vsl" @@ -1088,17 +1094,29 @@ <template path="templates/jsf2/views/portlet/help.xhtml.vsl" - outputPattern="portlet-help.xhtml" + outputPattern="${useCase.pathRoot}/${jsfUtils.toWebResourceName($useCase.name)}-portlet-help.xhtml" outlet="views" overwrite="true" - outputCondition="portlet"/> + outputCondition="portlet"> + <modelElements variable="useCase"> + <modelElement> + <type name="org.andromda.metafacades.uml.FrontEndUseCase"/> + </modelElement> + </modelElements> + </template> <template path="templates/jsf2/views/portlet/edit.xhtml.vsl" - outputPattern="portlet-edit.xhtml" + outputPattern="${useCase.pathRoot}/${jsfUtils.toWebResourceName($useCase.name)}-portlet-edit.xhtml" outlet="views" overwrite="true" - outputCondition="portlet"/> + outputCondition="portlet"> + <modelElements variable="useCase"> + <modelElement> + <type name="org.andromda.metafacades.uml.FrontEndUseCase"/> + </modelElement> + </modelElements> + </template> <template path="templates/jsf2/views/portlet/layout.xhtml.vsl" 1.2 +1 -1 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/views/portlet/help.xhtml.vsl Index: help.xhtml.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/views/portlet/help.xhtml.vsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- help.xhtml.vsl 21 Mar 2008 16:07:11 -0000 1.1 +++ help.xhtml.vsl 28 Mar 2008 21:28:41 -0000 1.2 @@ -1,4 +1,4 @@ <div xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"> -<strong><font size="4">Help with $applicationName</font></strong><br /> +<strong><font size="4">Help with $useCase.name</font></strong><br /> </div> \ No newline at end of file 1.2 +3 -1 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/configuration/portlet/liferay-portlet.xml.vsl Index: liferay-portlet.xml.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/configuration/portlet/liferay-portlet.xml.vsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- liferay-portlet.xml.vsl 21 Mar 2008 16:07:13 -0000 1.1 +++ liferay-portlet.xml.vsl 28 Mar 2008 21:28:41 -0000 1.2 @@ -2,10 +2,12 @@ <!DOCTYPE liferay-portlet-app PUBLIC "-//Liferay//DTD Portlet Application 4.3.0//EN" "http://www.liferay.com/dtd/liferay-portlet-app_4_3_0.dtd"> <liferay-portlet-app> +#foreach ($useCase in $useCases) <portlet> - <portlet-name>$jsfUtils.toWebResourceName($applicationName)</portlet-name> + <portlet-name>$jsfUtils.toWebResourceName($useCase.name)</portlet-name> <instanceable>true</instanceable> <header-css>/css/custom.css</header-css> <header-javascript>/js/custom.js</header-javascript> </portlet> +#end </liferay-portlet-app> \ No newline at end of file 1.3 +11 -10 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/configuration/portlet/portlet.xml.vsl Index: portlet.xml.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/configuration/portlet/portlet.xml.vsl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- portlet.xml.vsl 28 Mar 2008 20:46:35 -0000 1.2 +++ portlet.xml.vsl 28 Mar 2008 21:28:42 -0000 1.3 @@ -2,22 +2,22 @@ <portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"> -#set ($useCase = $applicationUseCases.iterator().next()) +#foreach ($useCase in $useCases) <portlet> - <portlet-name>$jsfUtils.toWebResourceName($applicationName)</portlet-name> - <display-name>$applicationName</display-name> + <portlet-name>$jsfUtils.toWebResourceName($useCase.name)</portlet-name> + <display-name>$useCase.name</display-name> <portlet-class>$portletClass</portlet-class> <init-param> <name>EditPage</name> - <value>/portlet-edit.xhtml</value> + <value>${useCase.pathRoot}/${jsfUtils.toWebResourceName($useCase.name)}-portlet-edit.xhtml</value> </init-param> <init-param> <name>HelpPage</name> - <value>/portlet-help.xhtml</value> + <value>${useCase.pathRoot}/${jsfUtils.toWebResourceName($useCase.name)}-portlet-help.xhtml</value> </init-param> <init-param> <name>ViewPage</name> - <value>${$useCase.initialTargetPath}.xhtml</value> + <value>${useCase.initialTargetPath}.xhtml</value> </init-param> <supports> <mime-type>text/html</mime-type> @@ -27,9 +27,9 @@ <!--supported-locale>en</supported-locale> <resource-bundle>com.lighthousepmg.portlet.dental.msgconfig.resources.language.Language</resource-bundle--> <portlet-info> - <title>$applicationName</title> - <short-title>$applicationName</short-title> - <keywords>$applicationName</keywords> + <title>$useCase.name</title> + <short-title>$useCase.name</short-title> + <keywords>$useCase.name</keywords> </portlet-info> #if ($useCase.preferences) <portlet-preferences> @@ -45,4 +45,5 @@ </portlet-preferences> #end </portlet> +#end </portlet-app> |
From: Chad B. <cwb...@us...> - 2008-03-28 20:46:31
|
User: cwbrandon Date: 08/03/28 13:46:36 Modified: andromda-jsf2/src/main/resources/templates/jsf2/preferences/portlet Preferences.java.vsl andromda-jsf2/src/main/resources/templates/jsf2/configuration/portlet portlet.xml.vsl Log: generate portlet prefs config Revision Changes Path 1.3 +1 -1 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/preferences/portlet/Preferences.java.vsl Index: Preferences.java.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/preferences/portlet/Preferences.java.vsl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- Preferences.java.vsl 28 Mar 2008 20:30:59 -0000 1.2 +++ Preferences.java.vsl 28 Mar 2008 20:46:35 -0000 1.3 @@ -38,7 +38,7 @@ { return ((javax.portlet.PortletRequest)javax.faces.context.FacesContext.getCurrentInstance().getExternalContext().getRequest()).getPreferences(); } -#foreach ($attribute in $class.attributes) +#foreach ($attribute in $class.getAttributes(true)) /** $attribute.getDocumentation(" * ") 1.2 +14 -6 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/configuration/portlet/portlet.xml.vsl Index: portlet.xml.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/configuration/portlet/portlet.xml.vsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- portlet.xml.vsl 21 Mar 2008 16:07:13 -0000 1.1 +++ portlet.xml.vsl 28 Mar 2008 20:46:35 -0000 1.2 @@ -2,6 +2,7 @@ <portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"> +#set ($useCase = $applicationUseCases.iterator().next()) <portlet> <portlet-name>$jsfUtils.toWebResourceName($applicationName)</portlet-name> <display-name>$applicationName</display-name> @@ -16,7 +17,7 @@ </init-param> <init-param> <name>ViewPage</name> - <value>${applicationUseCases.iterator().next().initialTargetPath}.xhtml</value> + <value>${$useCase.initialTargetPath}.xhtml</value> </init-param> <supports> <mime-type>text/html</mime-type> @@ -30,11 +31,18 @@ <short-title>$applicationName</short-title> <keywords>$applicationName</keywords> </portlet-info> - <!--portlet-preferences> +#if ($useCase.preferences) + <portlet-preferences> +#foreach ($attribute in $useCase.preferences.getAttributes(true)) <preference> - <name>editorHeight</name> - <value>500</value> + <name>$attribute.name</name> +#if ($attribute.defaultValue) + <value>$attribute.defaultValue</value> +#end + <read-only>$attribute.readOnly</read-only> </preference> - </portlet-preferences--> +#end + </portlet-preferences> +#end </portlet> </portlet-app> |
From: Chad B. <cwb...@us...> - 2008-03-28 20:32:21
|
User: cwbrandon Date: 08/03/28 13:32:25 Modified: andromda-jsf2/src/main/resources/templates/jsf2/controllers Controller.java.vsl Log: typo Revision Changes Path 1.10 +1 -1 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/controllers/Controller.java.vsl Index: Controller.java.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/controllers/Controller.java.vsl,v retrieving revision 1.9 retrieving revision 1.10 diff -u -w -r1.9 -r1.10 --- Controller.java.vsl 28 Mar 2008 20:31:00 -0000 1.9 +++ Controller.java.vsl 28 Mar 2008 20:32:25 -0000 1.10 @@ -401,7 +401,7 @@ } /** - * If the given <code>component</code> has an child input elements, this method findds + * If the given <code>component</code> has an child input elements, this method finds * them all and populates them. This is to get around the fact that when immediate is set to true * on a button that submits the form that the form isn't populated. * |
From: Chad B. <cwb...@us...> - 2008-03-28 20:30:54
|
User: cwbrandon Date: 08/03/28 13:31:00 Modified: andromda-jsf2/src/main/resources/templates/jsf2/preferences/portlet Preferences.java.vsl andromda-jsf2/src/main/resources/templates/jsf2/controllers Controller.java.vsl Log: finish implementing facade portlet prefs class Revision Changes Path 1.2 +58 -120 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/preferences/portlet/Preferences.java.vsl Index: Preferences.java.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/preferences/portlet/Preferences.java.vsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- Preferences.java.vsl 28 Mar 2008 18:37:03 -0000 1.1 +++ Preferences.java.vsl 28 Mar 2008 20:30:59 -0000 1.2 @@ -8,164 +8,102 @@ #end /** + * Provides access to portlet preferences for: $class.useCase.name. $class.getDocumentation(" * ") */ -public#if($class.abstract) abstract#end class $class.name -#if($class.generalization) - extends $class.generalization.fullyQualifiedName -#end -#if ($serializable) - implements java.io.Serializable -#end +public class $class.name { -#if ($serializable) /** - * The serial version UID of this class. Needed for serialization. + * The shared instance of this class. */ - private static final long serialVersionUID = ${class.serialVersionUID}L; + private static $class.name instance; -#end -## -## default constructor -## -#if ($class.requiredConstructorParameters.size() > 0 || $class.allRequiredConstructorParameters.size() > $class.requiredConstructorParameters.size()) - public ${class.name}() + /** + * Gets the shared instance of this class. + */ + public static $class.name getInstance() { -#if($class.generalization) - super(); -#end + if (instance == null) + { + instance = new ${class.name}(); + } + return instance; } -#end -## -## constructor taking only required properties -## -#if ($class.allProperties.size() > $class.allRequiredConstructorParameters.size() && ($class.allRequiredConstructorParameters.size() != 1 || !$class.allRequiredConstructorParameters.get(0).getterSetterTypeName.equals($class.fullyQualifiedName))) - public ${class.name}(## no newline -#set ($comma = "") -#foreach ($property in $class.allRequiredConstructorParameters) -${comma}${property.getterSetterTypeName} ${property.name}## no newline -#set ($comma = ", ") -#end -) + private ${class.name}() { -#if($class.generalization) - super(## no newline -#set ($comma = "") -#foreach ($property in $class.generalization.allRequiredConstructorParameters) -${comma}${property.name}## no newline -#set ($comma = ", ") -#end -); -#end -#foreach ($property in $class.requiredConstructorParameters) - this.${property.name} = ${property.name}; -#end } -#end -## -## constructor taking all properties -## -#if ($class.allProperties.size() != 1 || !$class.allProperties.get(0).getterSetterTypeName.equals($class.fullyQualifiedName)) - public ${class.name}(## no newline -#set ($comma = "") -#foreach ($property in $class.allProperties) -${comma}${property.getterSetterTypeName} ${property.name}## no newline -#set ($comma = ", ") -#end -) + protected javax.portlet.PortletPreferences getPreferences() { -#if($class.generalization) - super(## no newline -#set ($comma = "") -#foreach ($property in $class.generalization.allProperties) -${comma}${property.name}## no newline -#set ($comma = ", ") -#end -); -#end -#foreach ($property in $class.properties) - this.${property.name} = ${property.name}; -#end + return ((javax.portlet.PortletRequest)javax.faces.context.FacesContext.getCurrentInstance().getExternalContext().getRequest()).getPreferences(); } +#foreach ($attribute in $class.attributes) -#end /** - * Copies constructor from other ${class.name} - * - * @param otherBean, cannot be <code>null</code> - * @throws java.lang.NullPointerException if the argument is <code>null</code> +$attribute.getDocumentation(" * ") */ - public ${class.name}(${class.name} otherBean) + public $attribute.getterSetterTypeName ${attribute.getterName}() { - this(## no newline -#set ($comma = "") -#foreach ($property in $class.allProperties) -${comma}otherBean.${property.getterName}()## no newline -#set ($comma = ", ") + final java.lang.String value = this.getPreferences().getValue("$attribute.name", null); +#if (!$attribute.type.stringType) + final $attribute.type.wrapperName wrappedValue = ${attribute.type.wrapperName}.valueOf(value); +#* *##if ($attribute.type.primitive) + return wrappedValue.${attribute.getterSetterTypeName}Value(); +#* *##else + return wrappedValue; +#* *##end +#else + return value; #end -); } /** - * Copies all properties from the argument value object into this value object. + * Associates the value of the specified <code>${attribute.name}</code> + * with the '${attribute.name}' preference and persists the change if <code>store</code> + * is specified as <code>true</code>. + * + * @param $attribute.name the value to give the $attribute.name preference. */ - public void copy(${class.name} otherBean) + public void ${attribute.setterName}(final $attribute.getterSetterTypeName $attribute.name, final boolean store) + throws Exception { - if (otherBean != null) +#if ($attribute.type.primitive) + final java.lang.String value = java.lang.String.valueOf($attribute.name); +#else + java.lang.String value = null; + if ($attribute.name != null) { -#foreach ($property in $class.allProperties) - this.${property.setterName}(otherBean.${property.getterName}()); -#end - } + value = java.lang.String.valueOf($attribute.name); } - -#foreach ($attribute in $class.attributes) - private $attribute.getterSetterTypeName $attribute.name#if ($attribute.defaultValuePresent) = $attribute.defaultValue#end; - - /** -$attribute.getDocumentation(" * ") - */ - public $attribute.getterSetterTypeName ${attribute.getterName}() +#end + this.getPreferences().setValue("$attribute.name", value); + if (store) { - return this.${attribute.name}; + this.store(); } - -## - always have as public, having read-only causes too many issues when attempting to -## use in other cartridges - public void ${attribute.setterName}($attribute.getterSetterTypeName $attribute.name) - { - this.${attribute.name} = $attribute.name; } -#end -## Generate the relation methods. -#foreach ($associationEnd in $class.associationEnds) -#set ($target = $associationEnd.otherEnd) -#if ($target.navigable) - private $target.getterSetterTypeName $target.name; - /** - * Get the $target.name -$target.getDocumentation(" * ") + * Associates the value of the specified <code>${attribute.name}</code> + * with the '${attribute.name}' preference and persists the change. + * + * @param $attribute.name the value to give the $attribute.name preference. */ - public $target.getterSetterTypeName ${target.getterName}() + public void ${attribute.setterName}(final $attribute.getterSetterTypeName $attribute.name) + throws Exception { - return this.${target.name}; + this.${attribute.setterName}($attribute.name, true); } -## - always have as public, having read-only causes too many issues when attempting to -## use in other cartridges +#end /** - * Sets the $target.name + * Commits any pending portlet preference changes. */ - public void ${target.setterName}($target.getterSetterTypeName $target.name) + public void store() throws Exception { - this.${target.name} = ${target.name}; + this.getPreferences().store(); } -#end -#end - // ${class.fullyQualifiedName} value-object java merge-point + // ${class.fullyQualifiedName} portlet-preferences merge-point } \ No newline at end of file 1.9 +10 -0 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/controllers/Controller.java.vsl Index: Controller.java.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/controllers/Controller.java.vsl,v retrieving revision 1.8 retrieving revision 1.9 diff -u -w -r1.8 -r1.9 --- Controller.java.vsl 21 Mar 2008 16:07:13 -0000 1.8 +++ Controller.java.vsl 28 Mar 2008 20:31:00 -0000 1.9 @@ -531,4 +531,14 @@ this.getRequest().setAttribute(ACTION_EVENT_ATTRIBUTES, event.getComponent(). getAttributes()); } +#if ($portlet && $controller.useCase.preferences) + + /** + * Gets the portlet preferences available to this controller. + */ + protected $controller.useCase.preferences.name getPreferences() + { + return ${controller.useCase.preferences.name}.getInstance(); + } +#end } \ No newline at end of file |
From: Chad B. <cwb...@us...> - 2008-03-28 18:36:59
|
User: cwbrandon Date: 08/03/28 11:37:04 Modified: andromda-jsf2/src/main/resources/META-INF/andromda cartridge.xml metafacades.xml andromda-jsf2/src/main/java/org/andromda/cartridges/jsf2/metafacades JSFUseCaseLogicImpl.java andromda-jsf2/src/main/uml JSFMetafacadeModel.xml.zip Added: andromda-jsf2/src/main/resources/templates/jsf2/preferences/portlet Preferences.java.vsl andromda-jsf2/src/main/java/org/andromda/cartridges/jsf2/metafacades JSFPortletPreferencesLogicImpl.java andromda-jsf2/src/main/resources/templates/jsf2/preferences Preferences.java.vsl Removed: andromda-jsf2/src/main/resources/templates/jsf2/views/preferences Preferences.java.vsl Log: start on support for modeling portlet prefs Revision Changes Path 1.17 +14 -1 cartridges/andromda-jsf2/src/main/resources/META-INF/andromda/cartridge.xml Index: cartridge.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/META-INF/andromda/cartridge.xml,v retrieving revision 1.16 retrieving revision 1.17 diff -u -w -r1.16 -r1.17 --- cartridge.xml 27 Mar 2008 21:58:35 -0000 1.16 +++ cartridge.xml 28 Mar 2008 18:37:02 -0000 1.17 @@ -443,7 +443,7 @@ </template> <template - path="templates/jsf2/views/preferences/Preferences.java.vsl" + path="templates/jsf2/preferences/Preferences.java.vsl" outputPattern="$generatedFile" outlet="managed-beans" overwrite="true" @@ -1209,6 +1209,19 @@ </template> <template + path="templates/jsf2/preferences/portlet/Preferences.java.vsl" + outputPattern="{0}/{1}.java" + outlet="controllers" + overwrite="true" + outputCondition="portlet"> + <modelElements variable="class"> + <modelElement> + <type name="org.andromda.cartridges.jsf2.metafacades.JSFPortletPreferences"/> + </modelElement> + </modelElements> + </template> + + <template path="templates/jsf2/utils/portlet/PageableDataModel.java.vsl" outputPattern="$stringUtils.replace($managedBeansPackage, '.', '/')/${className}.java" outlet="managed-beans" 1.4 +8 -3 cartridges/andromda-jsf2/src/main/resources/META-INF/andromda/metafacades.xml Index: metafacades.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/META-INF/andromda/metafacades.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -r1.3 -r1.4 --- metafacades.xml 20 Feb 2007 10:10:32 -0000 1.3 +++ metafacades.xml 28 Mar 2008 18:37:02 -0000 1.4 @@ -51,6 +51,11 @@ </mapping> <property reference="controllerImplementationPattern"/> </metafacade> + <metafacade class="org.andromda.cartridges.jsf2.metafacades.JSFPortletPreferencesLogicImpl"> + <mapping> + <property name="useCase"/> + </mapping> + </metafacade> <metafacade class="org.andromda.cartridges.jsf2.metafacades.JSFUseCaseLogicImpl"> <mapping> <stereotype>FRONT_END_APPLICATION</stereotype> 1.1 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/preferences/portlet/Preferences.java.vsl Index: Preferences.java.vsl =================================================================== // license-header java merge-point // // Attention: Generated code! Do not modify by hand! // Generated by: Preferences.vsl in andromda-jsf2-cartridge. // #if ($stringUtils.isNotBlank($class.packageName)) package $class.packageName; #end /** $class.getDocumentation(" * ") */ public#if($class.abstract) abstract#end class $class.name #if($class.generalization) extends $class.generalization.fullyQualifiedName #end #if ($serializable) implements java.io.Serializable #end { #if ($serializable) /** * The serial version UID of this class. Needed for serialization. */ private static final long serialVersionUID = ${class.serialVersionUID}L; #end ## ## default constructor ## #if ($class.requiredConstructorParameters.size() > 0 || $class.allRequiredConstructorParameters.size() > $class.requiredConstructorParameters.size()) public ${class.name}() { #if($class.generalization) super(); #end } #end ## ## constructor taking only required properties ## #if ($class.allProperties.size() > $class.allRequiredConstructorParameters.size() && ($class.allRequiredConstructorParameters.size() != 1 || !$class.allRequiredConstructorParameters.get(0).getterSetterTypeName.equals($class.fullyQualifiedName))) public ${class.name}(## no newline #set ($comma = "") #foreach ($property in $class.allRequiredConstructorParameters) ${comma}${property.getterSetterTypeName} ${property.name}## no newline #set ($comma = ", ") #end ) { #if($class.generalization) super(## no newline #set ($comma = "") #foreach ($property in $class.generalization.allRequiredConstructorParameters) ${comma}${property.name}## no newline #set ($comma = ", ") #end ); #end #foreach ($property in $class.requiredConstructorParameters) this.${property.name} = ${property.name}; #end } #end ## ## constructor taking all properties ## #if ($class.allProperties.size() != 1 || !$class.allProperties.get(0).getterSetterTypeName.equals($class.fullyQualifiedName)) public ${class.name}(## no newline #set ($comma = "") #foreach ($property in $class.allProperties) ${comma}${property.getterSetterTypeName} ${property.name}## no newline #set ($comma = ", ") #end ) { #if($class.generalization) super(## no newline #set ($comma = "") #foreach ($property in $class.generalization.allProperties) ${comma}${property.name}## no newline #set ($comma = ", ") #end ); #end #foreach ($property in $class.properties) this.${property.name} = ${property.name}; #end } #end /** * Copies constructor from other ${class.name} * * @param otherBean, cannot be <code>null</code> * @throws java.lang.NullPointerException if the argument is <code>null</code> */ public ${class.name}(${class.name} otherBean) { this(## no newline #set ($comma = "") #foreach ($property in $class.allProperties) ${comma}otherBean.${property.getterName}()## no newline #set ($comma = ", ") #end ); } /** * Copies all properties from the argument value object into this value object. */ public void copy(${class.name} otherBean) { if (otherBean != null) { #foreach ($property in $class.allProperties) this.${property.setterName}(otherBean.${property.getterName}()); #end } } #foreach ($attribute in $class.attributes) private $attribute.getterSetterTypeName $attribute.name#if ($attribute.defaultValuePresent) = $attribute.defaultValue#end; /** $attribute.getDocumentation(" * ") */ public $attribute.getterSetterTypeName ${attribute.getterName}() { return this.${attribute.name}; } ## - always have as public, having read-only causes too many issues when attempting to ## use in other cartridges public void ${attribute.setterName}($attribute.getterSetterTypeName $attribute.name) { this.${attribute.name} = $attribute.name; } #end ## Generate the relation methods. #foreach ($associationEnd in $class.associationEnds) #set ($target = $associationEnd.otherEnd) #if ($target.navigable) private $target.getterSetterTypeName $target.name; /** * Get the $target.name $target.getDocumentation(" * ") */ public $target.getterSetterTypeName ${target.getterName}() { return this.${target.name}; } ## - always have as public, having read-only causes too many issues when attempting to ## use in other cartridges /** * Sets the $target.name */ public void ${target.setterName}($target.getterSetterTypeName $target.name) { this.${target.name} = ${target.name}; } #end #end // ${class.fullyQualifiedName} value-object java merge-point } 1.5 +24 -1 cartridges/andromda-jsf2/src/main/java/org/andromda/cartridges/jsf2/metafacades/JSFUseCaseLogicImpl.java Index: JSFUseCaseLogicImpl.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/java/org/andromda/cartridges/jsf2/metafacades/JSFUseCaseLogicImpl.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -w -r1.4 -r1.5 --- JSFUseCaseLogicImpl.java 5 Jul 2007 20:20:27 -0000 1.4 +++ JSFUseCaseLogicImpl.java 28 Mar 2008 18:37:03 -0000 1.5 @@ -9,11 +9,13 @@ import java.util.Map; import java.util.Set; import java.util.TreeMap; + import org.andromda.cartridges.jsf2.JSFGlobals; import org.andromda.cartridges.jsf2.JSFProfile; import org.andromda.cartridges.jsf2.JSFUtils; import org.andromda.metafacades.uml.AssociationEndFacade; import org.andromda.metafacades.uml.ClassifierFacade; +import org.andromda.metafacades.uml.DependencyFacade; import org.andromda.metafacades.uml.FrontEndAction; import org.andromda.metafacades.uml.FrontEndActivityGraph; import org.andromda.metafacades.uml.FrontEndFinalState; @@ -22,13 +24,13 @@ import org.andromda.metafacades.uml.FrontEndView; import org.andromda.metafacades.uml.IncludeFacade; import org.andromda.metafacades.uml.ModelElementFacade; +import org.andromda.metafacades.uml.Role; import org.andromda.utils.StringUtilsHelper; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.Predicate; import org.apache.commons.collections.Transformer; import org.apache.commons.lang.ObjectUtils; import org.apache.commons.lang.StringUtils; -import org.andromda.metafacades.uml.Role; /** @@ -782,4 +784,25 @@ } return rolesBuffer.toString(); } + + @Override + protected Object handleGetPreferences() + { + JSFPortletPreferences preferences = null; + final Collection dependencies = this.getSourceDependencies(); + if (dependencies != null && !dependencies.isEmpty()) + { + for (final Iterator iterator = dependencies.iterator(); iterator.hasNext();) + { + final DependencyFacade dependency = (DependencyFacade)iterator.next(); + final Object target = dependency.getTargetElement(); + if (dependency.getTargetElement() instanceof JSFPortletPreferences) + { + preferences = (JSFPortletPreferences)target; + break; + } + } + } + return preferences; + } } 1.1 cartridges/andromda-jsf2/src/main/java/org/andromda/cartridges/jsf2/metafacades/JSFPortletPreferencesLogicImpl.java Index: JSFPortletPreferencesLogicImpl.java =================================================================== package org.andromda.cartridges.jsf2.metafacades; import java.util.Collection; import java.util.Iterator; import org.andromda.metafacades.uml.DependencyFacade; import org.andromda.metafacades.uml.UseCaseFacade; /** * MetafacadeLogic implementation for org.andromda.cartridges.jsf2.metafacades.JSFPortletPreferences. * * @see org.andromda.cartridges.jsf2.metafacades.JSFPortletPreferences */ public class JSFPortletPreferencesLogicImpl extends JSFPortletPreferencesLogic { public JSFPortletPreferencesLogicImpl (Object metaObject, String context) { super (metaObject, context); } /** * @see org.andromda.cartridges.jsf2.metafacades.JSFPortletPreferences#getUseCase() */ protected java.lang.Object handleGetUseCase() { UseCaseFacade useCase = null; final Collection dependencies = this.getTargetDependencies(); if (dependencies != null && !dependencies.isEmpty()) { for (final Iterator iterator = dependencies.iterator(); iterator.hasNext();) { final DependencyFacade dependency = (DependencyFacade)iterator.next(); final Object source = dependency.getSourceElement(); if (source instanceof UseCaseFacade) { useCase = (UseCaseFacade)source; break; } } } return useCase; } } 1.1 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/preferences/Preferences.java.vsl Index: Preferences.java.vsl =================================================================== #set ($generatedFile = "$stringUtils.replace($managedBeansPackage, '.', '/')/${preferencesClassName}.java") #if ($stringUtils.isNotEmpty($managedBeansPackage)) package $managedBeansPackage; #end /** * Provides dynamically changeable preferences for changing the application * display. */ public class $preferencesClassName implements java.io.Serializable { /** * The skin to apply. */ private String skin; public String getSkin() { return this.skin; } public void setSkin(final String skin) { this.skin = skin; } /** * The maximum rows displayed in a table. */ private int maxTableRows; public void setMaxTableRows(final int maxTableRows) { this.maxTableRows = maxTableRows; } public void setMaxTableRows(final String maxTableRows) { try { this.maxTableRows = Integer.parseInt(maxTableRows); } catch (Exception ex) { this.maxTableRows = 1; } } public int getMaxTableRows() { return this.maxTableRows; } } 1.12 +202 -205 cartridges/andromda-jsf2/src/main/uml/JSFMetafacadeModel.xml.zip <<Binary file>> |
From: Chad B. <cwb...@us...> - 2008-03-28 18:36:53
|
User: cwbrandon Date: 08/03/28 11:36:57 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/preferences/portlet - New directory |
From: Chad B. <cwb...@us...> - 2008-03-28 18:36:52
|
User: cwbrandon Date: 08/03/28 11:36:57 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/preferences - New directory |
From: Chad B. <cwb...@us...> - 2008-03-28 18:33:32
|
User: cwbrandon Date: 08/03/28 11:33:37 Modified: . pom.xml Log: make source java 5 Revision Changes Path 1.14 +8 -0 plugins/pom.xml Index: pom.xml =================================================================== RCS file: /cvsroot/andromdaplugins/plugins/pom.xml,v retrieving revision 1.13 retrieving revision 1.14 diff -u -w -r1.13 -r1.14 --- pom.xml 12 Jun 2007 16:23:15 -0000 1.13 +++ pom.xml 28 Mar 2008 18:33:37 -0000 1.14 @@ -135,6 +135,14 @@ <pluginManagement> <plugins> <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <source>1.5</source> + <target>1.5</target> + </configuration> + </plugin> + <plugin> <groupId>org.andromda.maven.plugins</groupId> <artifactId>andromda-maven-plugin</artifactId> <version>3.3-SNAPSHOT</version> |
From: Chad B. <cwb...@us...> - 2008-03-27 23:39:13
|
User: cwbrandon Date: 08/03/27 16:39:18 Modified: andromda-jsf2/src/main/resources/templates/jsf2/views/portlet view-table.xhtml.vsl Log: fix button support in portlet table Revision Changes Path 1.6 +4 -7 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/views/portlet/view-table.xhtml.vsl Index: view-table.xhtml.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/views/portlet/view-table.xhtml.vsl,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -r1.5 -r1.6 --- view-table.xhtml.vsl 27 Mar 2008 21:58:35 -0000 1.5 +++ view-table.xhtml.vsl 27 Mar 2008 23:39:18 -0000 1.6 @@ -78,8 +78,7 @@ #set ($tableColumnActions = $table.getTableColumnActions($columnName)) #if (!$tableColumnActions.empty) #set ($action = $tableColumnActions.iterator().next()) - <h:commandLink action="#{${action.controller.beanName}.${action.triggerName}}" styleClass="columnLink"> - <h:outputText value="#{row.${columnName}}"> + <h:commandLink value="#{row.${columnName}}" action="#{${action.controller.beanName}.${action.triggerName}}"> #if ($column.type.dateType) <a:convertDateTime pattern="$defaultDateFormat"/> #end @@ -108,8 +107,7 @@ #foreach ($action in $table.tableHyperlinkActions) #if (!$action.tableLinkColumnName) <h:column> - <h:commandLink action="#{${action.controller.beanName}.${action.triggerName}}"> - <h:outputText value="#{messages['$action.trigger.messageKey']}"/> + <h:commandLink value="#{messages['$action.trigger.messageKey']}" action="#{${action.controller.beanName}.${action.triggerName}}"> #renderTableCommandLinkParameters(false) </h:commandLink> </h:column> @@ -119,10 +117,9 @@ #foreach ($action in $table.tableFormActions) #if (!$action.tableLinkColumnName) <h:column> - <h:commandLink action="#{${action.controller.beanName}.${action.triggerName}}" styleClass="buttonLink"> - <h:outputText value="#{messages['$action.trigger.messageKey']}" /> + <h:commandButton value="#{messages['$action.trigger.messageKey']}" action="#{${action.controller.beanName}.${action.triggerName}}" actionListener="#{${action.controller.beanName}.action}"> #renderTableCommandLinkParameters(true) - </h:commandLink> + </h:commandButton> </h:column> #end #end |
From: Chad B. <cwb...@us...> - 2008-03-27 21:58:29
|
User: cwbrandon Date: 08/03/27 14:58:35 Modified: andromda-jsf2/src/main/resources/META-INF/andromda cartridge.xml andromda-jsf2/src/main/resources/templates/jsf2/views/jsp/includes view-table.jspf.vsl andromda-jsf2/src/main/resources/templates/jsf2/views/facelets view-table.xhtml.vsl andromda-jsf2/src/main/resources/templates/jsf2/views/portlet view-table.xhtml.vsl Added: andromda-jsf2/src/main/resources/templates/jsf2/views renderTableCommandLinkParameters.vm Log: move renderTableCommandLinkParameters into its on vm file Revision Changes Path 1.16 +3 -1 cartridges/andromda-jsf2/src/main/resources/META-INF/andromda/cartridge.xml Index: cartridge.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/META-INF/andromda/cartridge.xml,v retrieving revision 1.15 retrieving revision 1.16 diff -u -w -r1.15 -r1.16 --- cartridge.xml 27 Mar 2008 18:34:45 -0000 1.15 +++ cartridge.xml 27 Mar 2008 21:58:35 -0000 1.16 @@ -4,6 +4,7 @@ <macrolibrary name="templates/jsf2/controllers/Controller.java.vm"/> <macrolibrary name="templates/jsf2/views/renderActionFormInput.vm"/> <macrolibrary name="templates/jsf2/views/renderActionCommandLinkParameter.vm"/> + <macrolibrary name="templates/jsf2/views/renderTableCommandLinkParameters.vm"/> <macrolibrary name="templates/jsf2/forms/formMacros.vm"/> <macrolibrary name="templates/jsf2/forms/formImplMacros.vm"/> <macrolibrary name="templates/jsf2/configuration/validation.xml.vm"/> @@ -1074,7 +1075,8 @@ outlet="managed-beans" overwrite="true" outputToSingleFile="true" - outputCondition="portlet"> + outputCondition="portlet" + outputOnEmptyElements="false"> <modelElements> <modelElement variable="applicationUseCases"> <type name="org.andromda.metafacades.uml.FrontEndUseCase"> 1.5 +0 -18 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/views/jsp/includes/view-table.jspf.vsl Index: view-table.jspf.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/views/jsp/includes/view-table.jspf.vsl,v retrieving revision 1.4 retrieving revision 1.5 diff -u -w -r1.4 -r1.5 --- view-table.jspf.vsl 25 Feb 2008 14:35:32 -0000 1.4 +++ view-table.jspf.vsl 27 Mar 2008 21:58:35 -0000 1.5 @@ -1,21 +1,3 @@ -## -## This macro renders the <f:param> elements for a command link -## -#macro (renderTableCommandLinkParameters $attribute) -#foreach ($parameter in $action.parameters) -#if ($table.tableColumnNames.contains($parameter.name) || $table.tableAttributeNames.contains($parameter.name)) -#set ($parameterValue = "row.${parameter.name}") -#else -#set ($parameterValue = "$parameter.name") -#end -#if($attribute) -#set ($elementType = "attribute") -#else -#set ($elementType = "param") -#end - <f:$elementType name="$parameter.name" value="#{${parameterValue}}"/> -#end -#end <h:form> #set ($targetColumns = $table.targettedTableColumnNames) <tr:table allDetailsEnabled="true" var="row" rowBandingInterval="1" value="#{${table.name}}" rows="#{${preferencesBeanName}.maxTableRows}" width="90%"> 1.1 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/views/renderTableCommandLinkParameters.vm Index: renderTableCommandLinkParameters.vm =================================================================== ## ## This macro renders the <f:param> elements for a command link ## #macro (renderTableCommandLinkParameters $attribute) #foreach ($parameter in $action.parameters) #if ($table.tableColumnNames.contains($parameter.name) || $table.tableAttributeNames.contains($parameter.name)) #set ($parameterValue = "row.${parameter.name}") #else #set ($parameterValue = "$parameter.name") #end #if($attribute) #set ($elementType = "attribute") #else #set ($elementType = "param") #end <f:$elementType name="$parameter.name" value="#{${parameterValue}}"/> #end #end 1.7 +0 -18 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/views/facelets/view-table.xhtml.vsl Index: view-table.xhtml.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/views/facelets/view-table.xhtml.vsl,v retrieving revision 1.6 retrieving revision 1.7 diff -u -w -r1.6 -r1.7 --- view-table.xhtml.vsl 25 Feb 2008 14:32:34 -0000 1.6 +++ view-table.xhtml.vsl 27 Mar 2008 21:58:35 -0000 1.7 @@ -1,21 +1,3 @@ -## -## This macro renders the <f:param> elements for a command link -## -#macro (renderTableCommandLinkParameters $attribute) -#foreach ($parameter in $action.parameters) -#if ($table.tableColumnNames.contains($parameter.name) || $table.tableAttributeNames.contains($parameter.name)) -#set ($parameterValue = "row.${parameter.name}") -#else -#set ($parameterValue = "$parameter.name") -#end -#if($attribute) -#set ($elementType = "attribute") -#else -#set ($elementType = "param") -#end - <f:$elementType name="$parameter.name" value="#{${parameterValue}}"/> -#end -#end <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" 1.5 +0 -18 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/views/portlet/view-table.xhtml.vsl Index: view-table.xhtml.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/views/portlet/view-table.xhtml.vsl,v retrieving revision 1.4 retrieving revision 1.5 diff -u -w -r1.4 -r1.5 --- view-table.xhtml.vsl 27 Mar 2008 21:46:14 -0000 1.4 +++ view-table.xhtml.vsl 27 Mar 2008 21:58:35 -0000 1.5 @@ -1,21 +1,3 @@ -## -## This macro renders the <f:param> elements for a command link -## -#macro (renderTableCommandLinkParameters $attribute) -#foreach ($parameter in $action.parameters) -#if ($table.tableColumnNames.contains($parameter.name) || $table.tableAttributeNames.contains($parameter.name)) -#set ($parameterValue = "row.${parameter.name}") -#else -#set ($parameterValue = "$parameter.name") -#end -#if($attribute) -#set ($elementType = "attribute") -#else -#set ($elementType = "param") -#end - <f:$elementType name="$parameter.name" value="#{${parameterValue}}"/> -#end -#end <div xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" |
From: Chad B. <cwb...@us...> - 2008-03-27 21:46:08
|
User: cwbrandon Date: 08/03/27 14:46:14 Modified: andromda-jsf2/src/main/resources/templates/jsf2/views/portlet view-table.xhtml.vsl Log: fix render table link params Revision Changes Path 1.4 +12 -7 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/views/portlet/view-table.xhtml.vsl Index: view-table.xhtml.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/views/portlet/view-table.xhtml.vsl,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -r1.3 -r1.4 --- view-table.xhtml.vsl 27 Mar 2008 20:59:52 -0000 1.3 +++ view-table.xhtml.vsl 27 Mar 2008 21:46:14 -0000 1.4 @@ -1,14 +1,19 @@ ## ## This macro renders the <f:param> elements for a command link ## -#macro (renderTableCommandLinkParameters) +#macro (renderTableCommandLinkParameters $attribute) #foreach ($parameter in $action.parameters) #if ($table.tableColumnNames.contains($parameter.name) || $table.tableAttributeNames.contains($parameter.name)) #set ($parameterValue = "row.${parameter.name}") #else -#set ($parameterValue = "${actionFormKey}.${parameter.name}") +#set ($parameterValue = "$parameter.name") #end - <f:param name="$parameter.name" value="#{${parameterValue}}"/> +#if($attribute) +#set ($elementType = "attribute") +#else +#set ($elementType = "param") +#end + <f:$elementType name="$parameter.name" value="#{${parameterValue}}"/> #end #end <div xmlns="http://www.w3.org/1999/xhtml" @@ -85,7 +90,7 @@ <h:column> <f:facet name="header"> <t:commandSortHeader columnName="$columnName" arrow="true"> - <h:outputText value="#{renderTable}"/> + <h:outputText value="#{messages['$table.getTableColumnMessageKey($columnName)']}"/> </t:commandSortHeader> </f:facet> #set ($tableColumnActions = $table.getTableColumnActions($columnName)) @@ -97,7 +102,7 @@ <a:convertDateTime pattern="$defaultDateFormat"/> #end </h:outputText> -#renderTableCommandLinkParameters() +#renderTableCommandLinkParameters(false) </h:commandLink> #else <h:outputText value="#{row.${columnName}}"> @@ -123,7 +128,7 @@ <h:column> <h:commandLink action="#{${action.controller.beanName}.${action.triggerName}}"> <h:outputText value="#{messages['$action.trigger.messageKey']}"/> -#renderTableCommandLinkParameters() +#renderTableCommandLinkParameters(false) </h:commandLink> </h:column> #end @@ -134,7 +139,7 @@ <h:column> <h:commandLink action="#{${action.controller.beanName}.${action.triggerName}}" styleClass="buttonLink"> <h:outputText value="#{messages['$action.trigger.messageKey']}" /> -#renderTableCommandLinkParameters() +#renderTableCommandLinkParameters(true) </h:commandLink> </h:column> #end |
From: Chad B. <cwb...@us...> - 2008-03-27 20:59:48
|
User: cwbrandon Date: 08/03/27 13:59:52 Modified: andromda-jsf2/src/main/resources/templates/jsf2/messages messages.properties.vsl andromda-jsf2/src/main/resources/templates/jsf2/views/portlet view-table.xhtml.vsl Log: improvements to portlet table Revision Changes Path 1.9 +1 -0 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/messages/messages.properties.vsl Index: messages.properties.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/messages/messages.properties.vsl,v retrieving revision 1.8 retrieving revision 1.9 diff -u -w -r1.8 -r1.9 --- messages.properties.vsl 25 Feb 2008 14:23:20 -0000 1.8 +++ messages.properties.vsl 27 Mar 2008 20:59:52 -0000 1.9 @@ -149,6 +149,7 @@ return.link.text=Return to AndroMDA Home table.results={0} Items found, displaying {1}, from {2} to {3}. Page {4} / {5} +table.results.none.found=No Items Found #foreach ($message in $applicationUseCase.allMessages.entrySet()) $message.key=$message.value 1.3 +6 -4 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/views/portlet/view-table.xhtml.vsl Index: view-table.xhtml.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/views/portlet/view-table.xhtml.vsl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- view-table.xhtml.vsl 21 Mar 2008 22:46:03 -0000 1.2 +++ view-table.xhtml.vsl 27 Mar 2008 20:59:52 -0000 1.3 @@ -23,7 +23,7 @@ <h:form> #set ($targetColumns = $table.targettedTableColumnNames) -<h:panelGroup rendered="#{!empty $table.name}"> +<h:panelGroup> <lr:portletScroller id="${table.name}Scroller1" for="$table.name" fastStep="10" @@ -54,6 +54,7 @@ <t:graphicImage url="/images/arrow-fr.gif" border="1" /> </f:facet> </lr:portletScroller> + <c:set var="renderTable" value="#{${table.name} != null and !${table.name}['empty']}"/> <lr:portletScroller id="${table.name}Scroller2" for="$table.name" rowsCountVar="rowsCount" @@ -63,7 +64,7 @@ pageCountVar="pageCount" immediate="true" pageIndexVar="pageIndex"> - <h:outputFormat value="#{messages['table.results']}"> + <h:outputFormat value="#{messages['table.results']}" rendered="#{renderTable}"> <f:param value="#{rowsCount}" /> <f:param value="#{displayedRowsCountVar}" /> <f:param value="#{firstRowIndex}" /> @@ -71,8 +72,9 @@ <f:param value="#{pageIndex}" /> <f:param value="#{pageCount}" /> </h:outputFormat> + <h:outputText value="#{messages['table.results.none.found']}" rendered="#{${table.name} != null and !renderTable}"/> </lr:portletScroller> - <lr:table value="#{${table.name}}" var="row" id="$table.name" sortable="true" rows="10"> + <lr:table value="#{${table.name}}" var="row" id="$table.name" sortable="true" rows="10" rendered="#{renderTable}"> #if (!$table.tableColumns.empty) #foreach ($column in $table.tableColumns) #if($column.name) @@ -83,7 +85,7 @@ <h:column> <f:facet name="header"> <t:commandSortHeader columnName="$columnName" arrow="true"> - <h:outputText value="#{messages['$table.getTableColumnMessageKey($columnName)']}"/> + <h:outputText value="#{renderTable}"/> </t:commandSortHeader> </f:facet> #set ($tableColumnActions = $table.getTableColumnActions($columnName)) |
From: Chad B. <cwb...@us...> - 2008-03-27 20:33:07
|
User: cwbrandon Date: 08/03/27 13:33:11 Modified: andromda-jsf2/src/main/resources/templates/jsf2/utils/portlet PageableDataModel.java.vsl Log: add isEmpty method Revision Changes Path 1.2 +10 -0 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/utils/portlet/PageableDataModel.java.vsl Index: PageableDataModel.java.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/utils/portlet/PageableDataModel.java.vsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- PageableDataModel.java.vsl 27 Mar 2008 18:34:52 -0000 1.1 +++ PageableDataModel.java.vsl 27 Mar 2008 20:33:11 -0000 1.2 @@ -249,4 +249,14 @@ } this.sortAscending = sortAscending; } + + /** + * Provides ability to check whether or not the + * data is empty in JSTL (this this class wraps a collection + * when the collection is pageable). + */ + public boolean isEmpty() + { + return this.getRowCount() == 0; + } } \ No newline at end of file |
From: Chad B. <cwb...@us...> - 2008-03-27 18:34:47
|
User: cwbrandon Date: 08/03/27 11:34:53 Modified: andromda-jsf2/src/main/resources/META-INF/andromda cartridge.xml namespace.xml profile.xml andromda-jsf2/src/main/resources/templates/jsf2/forms Form.java.vsl andromda-jsf2/src/main/uml JSFMetafacadeModel.xml.zip andromda-jsf2/src/main/java/org/andromda/cartridges/jsf2 JSFProfile.java andromda-jsf2/src/main/java/org/andromda/cartridges/jsf2/metafacades JSFParameterLogicImpl.java Added: andromda-jsf2/src/main/resources/templates/jsf2/utils PageableDataModel.java.vsl andromda-jsf2/src/main/resources/templates/jsf2/utils/portlet PageableDataModel.java.vsl Log: move paginated data model support from JSF cartridge and add portlet specific support as well Revision Changes Path 1.15 +22 -0 cartridges/andromda-jsf2/src/main/resources/META-INF/andromda/cartridge.xml Index: cartridge.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/META-INF/andromda/cartridge.xml,v retrieving revision 1.14 retrieving revision 1.15 diff -u -w -r1.14 -r1.15 --- cartridge.xml 21 Mar 2008 16:07:12 -0000 1.14 +++ cartridge.xml 27 Mar 2008 18:34:45 -0000 1.15 @@ -74,6 +74,7 @@ <property reference="crudValueObjectSuffix"/> <property reference="portletContainer"/> <property reference="portletClass"/> + <property reference="paginationResultClassName"/> <!-- cartridge-property merge-point --> @@ -95,6 +96,13 @@ <condition name="standaloneFaceletsApplication"> #if ($viewType.equalsIgnoreCase("facelets") && $stringUtils.isBlank($portletContainer))true#end </condition> + <condition name="paginationSupportEnabled">$stringUtils.isNotBlank($paginationResultClassName)</condition> + <condition name="standalonePaginationSupportEnabled"> + #if ($stringUtils.isNotBlank($paginationResultClassName) && $stringUtils.isBlank($portletContainer))true#end + </condition> + <condition name="portletPaginationSupportEnabled"> + #if ($stringUtils.isNotBlank($paginationResultClassName) && $stringUtils.isNotBlank($portletContainer))true#end + </condition> <!-- condition merge-point--> @@ -519,6 +527,13 @@ overwrite="true"/> <template + path="templates/jsf2/utils/PageableDataModel.java.vsl" + outputPattern="$stringUtils.replace($managedBeansPackage, '.', '/')/${className}.java" + outlet="managed-beans" + outputCondition="standalonePaginationSupportEnabled" + overwrite="true"/> + + <template path="templates/jsf2/views/jsp/index.jsp.vsl" outputPattern="$welcomeFileName" outlet="views" @@ -1191,6 +1206,13 @@ </modelElements> </template> + <template + path="templates/jsf2/utils/portlet/PageableDataModel.java.vsl" + outputPattern="$stringUtils.replace($managedBeansPackage, '.', '/')/${className}.java" + outlet="managed-beans" + outputCondition="portletPaginationSupportEnabled" + overwrite="true"/> + <!-- cartridge-template merge-point --> </cartridge> \ No newline at end of file 1.8 +13 -0 cartridges/andromda-jsf2/src/main/resources/META-INF/andromda/namespace.xml Index: namespace.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/META-INF/andromda/namespace.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -u -w -r1.7 -r1.8 --- namespace.xml 21 Mar 2008 16:07:12 -0000 1.7 +++ namespace.xml 27 Mar 2008 18:34:45 -0000 1.8 @@ -309,6 +309,19 @@ </documentation> </property> </propertyGroup> + <propertyGroup name="Table Paging (DB paging)"> + <documentation> + These properties provide the ability to configure DB paging support for tables used by the cartridge (this is very. + </documentation> + <property name="paginationResultClassName" required="false"> + <documentation> + This is the fully qualified name of the class that provides the pagination results supplied from the middle tier; like a service operation. + (i.e. if using the Spring cartridge, you'd set this as <em>name.of.your.model.package.PaginationResult</em> where "name.of.your.model.package" is + the name of your model's root package). This must be defined in order for the PageableDataModel class to be generated (which is required + for DB backed paging support). + </documentation> + </property> + </propertyGroup> <propertyGroup name="Other"> <documentation> Other various properties that couldn't be classified into another category. 1.3 +22 -11 cartridges/andromda-jsf2/src/main/resources/META-INF/andromda/profile.xml Index: profile.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/META-INF/andromda/profile.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- profile.xml 11 Dec 2006 13:43:58 -0000 1.2 +++ profile.xml 27 Mar 2008 18:34:46 -0000 1.3 @@ -301,6 +301,17 @@ <value>Comma-separated list of column names</value> </allowedValues> </element> + <element name="TABLE_PAGEABLE"> + <documentation> + A flag indicating whether or not a table is "pageable". When a table is flagged as "pageable", support for DB paging is generated. + </documentation> + <value>@andromda.presentation.view.table.pageable</value> + <appliedOnElement>A collection type parameter going into an action state carrying the <![CDATA[<<FrontEndView>>]]> stereotype</appliedOnElement> + <allowedValues> + <value>true</value> + <value default="true">false</value> + </allowedValues> + </element> <element name="INPUT_REQUIRED"> <documentation> Denotes whether or not this is a required field. If a field is required its type will always be 1.1 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/utils/PageableDataModel.java.vsl Index: PageableDataModel.java.vsl =================================================================== #set ($className = "PageableDataModel") #if ($stringUtils.isNotEmpty($managedBeansPackage)) package $managedBeansPackage; #end import java.util.Collections; import java.util.List; import org.apache.myfaces.trinidad.model.SortCriterion; /** * A type of JSF DataModel that allows a table * to page through a large set of data without having to hold the entire * set of data in memory at once. */ public abstract class $className extends org.apache.myfaces.trinidad.model.CollectionModel { private int pageSize; private int rowIndex; private $paginationResultClassName page; /** * Create a datamodel that pages through the data showing the specified * number of rows on each page. */ public $className(int pageSize) { super(); this.pageSize = pageSize; this.rowIndex = -1; this.page = null; } /** * Not used in this class; data is fetched via a callback to the * fetchData method rather than by explicitly assigning a list. */ @Override public void setWrappedData(Object wrappedData) { throw new UnsupportedOperationException(); } @Override public int getRowIndex() { return rowIndex; } /** * Specify what the "current row" within the dataset is. Note that * the UIData component will repeatedly call this method followed * by getRowData to obtain the objects to render in the table. */ @Override public void setRowIndex(int rowIndex) { this.rowIndex = rowIndex; } /** * Return the total number of rows of data available (not just the * number of rows in the current page!). */ @Override public int getRowCount() { return (int)getPage().getTotalSize(); } /** * Return a DataPage object; if one is not currently available then * fetch one. Note that this doesn't ensure that the datapage * returned includes the current rowIndex row; see getRowData. */ public $paginationResultClassName getPage() { if (page == null) { page = this.getPage( this.getPageNumber(), pageSize, this.sortProperty, this.sortAscending); } return page; } private int getPageNumber() { int pageNumber = 1; int rowIndex = this.rowIndex + 1; if (rowIndex >= this.pageSize) { pageNumber = this.rowIndex / this.pageSize; if ((rowIndex % this.pageSize) > 0) { pageNumber++; } } return pageNumber; } /** * Keeps track of the previous row index (so that we don't search more than we need) */ private int previousRowIndex; /** * Return the object corresponding to the current rowIndex. * If the DataPage object currently cached doesn't include that * index then fetchPage is called to retrieve the appropriate page. */ @Override public Object getRowData() { if (rowIndex < 0) { throw new IllegalArgumentException("Invalid rowIndex: " + rowIndex + "; not within page"); } // don't perform any new operations if the same index is used over again final int listIndex = this.rowIndex % this.pageSize; if (this.forcePageRefresh || listIndex == 0 && this.previousRowIndex != this.rowIndex) { this.previousRowIndex = this.rowIndex; // - only search if the listIndex is 0 (that is its a multiple of the page size) page = this.getPage( this.getPageNumber(), pageSize, this.sortProperty, this.sortAscending); this.forcePageRefresh = false; } Object rowData = null; if (page.getData() != null) { if (page.getData().length > listIndex) { rowData = page.getData()[listIndex]; } } return rowData; } @Override public Object getWrappedData() { return page.getData(); } /** * Return true if the rowIndex value is currently set to a * value that matches some element in the dataset. Note that * it may match a row that is not in the currently cached * DataPage; if so then when getRowData is called the * required DataPage will be fetched by calling fetchData. */ @Override public boolean isRowAvailable() { final $paginationResultClassName page = getPage(); if (page == null) { return false; } int rowIndex = getRowIndex(); if (rowIndex < 0) { return false; } else if (rowIndex >= page.getTotalSize()) { return false; } else { return true; } } /** * Method which must be implemented in cooperation with the * managed bean class to fetch data on demand. */ public abstract $paginationResultClassName getPage( int pageNumber, int pageSize, String sortProperty, boolean sortAscending); public Object getRowKey() { return isRowAvailable() ? String.valueOf(getRowIndex()) : null; } public void setRowKey(Object key) { setRowIndex(this.toRowIndex((String)key)); } /** * Creates a row index for the given row key */ private int toRowIndex(String rowKey) { int rowIndex = -1; try { rowIndex = Integer.parseInt(rowKey); } catch (NumberFormatException exception) { // - ignore } return rowIndex; } private SortCriterion sortCriterion = null; private String sortProperty; private boolean sortAscending; private boolean forcePageRefresh; @Override public void setSortCriteria(List criteria) { if (criteria == null || criteria.isEmpty()) { this.sortCriterion = null; } else { SortCriterion criterion = (SortCriterion)criteria.get(0); if ((this.sortCriterion == null) || (!sortCriterion.equals(criterion))) { this.sortCriterion = criterion; this.sortProperty = this.sortCriterion.getProperty(); this.sortAscending = this.sortCriterion.isAscending(); this.forcePageRefresh = true; } } } @Override public List getSortCriteria() { return this.sortCriterion == null ? Collections.EMPTY_LIST : Collections.singletonList(this.sortCriterion); } @Override public boolean isSortable(String property) { return true; } } 1.2 +5 -3 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/forms/Form.java.vsl Index: Form.java.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/forms/Form.java.vsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- Form.java.vsl 5 Dec 2006 19:39:26 -0000 1.1 +++ Form.java.vsl 27 Mar 2008 18:34:50 -0000 1.2 @@ -14,7 +14,9 @@ public interface $operation.formName { #foreach ($field in $operation.formFields) -#if ($field.type.collectionType) +#if ($field.pageableTable) +#set ($fieldTypeName = "javax.faces.model.DataModel") +#elseif ($field.type.collectionType) #set ($fieldTypeName = "java.util.List") #elseif ($field.type.fileType) #set ($fieldTypeName = "$fileTypeName") 1.11 +207 -174 cartridges/andromda-jsf2/src/main/uml/JSFMetafacadeModel.xml.zip <<Binary file>> 1.3 +4 -3 cartridges/andromda-jsf2/src/main/java/org/andromda/cartridges/jsf2/JSFProfile.java Index: JSFProfile.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/java/org/andromda/cartridges/jsf2/JSFProfile.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- JSFProfile.java 11 Dec 2006 13:43:58 -0000 1.2 +++ JSFProfile.java 27 Mar 2008 18:34:51 -0000 1.3 @@ -36,6 +36,7 @@ public static final String TAGGEDVALUE_INPUT_VALIDATORS = profile.get("INPUT_VALIDATORS"); public static final String TAGGEDVALUE_INPUT_FORMAT = profile.get("INPUT_FORMAT"); public static final String TAGGEDVALUE_INPUT_RESET = profile.get("INPUT_RESET"); + public static final String TAGGEDVALUE_TABLE_PAGEABLE = profile.get("TABLE_PAGEABLE"); public static final String TAGGEDVALUE_VIEW_TYPE = profile.get("VIEW_TYPE"); public static final String TAGGEDVALUE_ACTION_FORM_RESET = profile.get("ACTION_FORM_RESET"); public static final String TAGGEDVALUE_ACTION_SUCCESS_MESSAGE = profile.get("ACTION_SUCCESS_MESSAGE"); 1.1 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/utils/portlet/PageableDataModel.java.vsl Index: PageableDataModel.java.vsl =================================================================== #set ($className = "PageableDataModel") #if ($stringUtils.isNotEmpty($managedBeansPackage)) package $managedBeansPackage; #end /** * A type of JSF DataModel that allows a table * to page through a large set of data without having to hold the entire * set of data in memory at once. */ public abstract class $className extends javax.faces.model.DataModel { private int pageSize; private int rowIndex; private $paginationResultClassName page; /** * Create a datamodel that pages through the data showing the specified * number of rows on each page. */ public $className(int pageSize) { super(); this.pageSize = pageSize; this.rowIndex = -1; this.page = null; } /** * Not used in this class; data is fetched via a callback to the * fetchData method rather than by explicitly assigning a list. */ @Override public void setWrappedData(Object wrappedData) { throw new UnsupportedOperationException(); } @Override public int getRowIndex() { return rowIndex; } /** * Specify what the "current row" within the dataset is. Note that * the UIData component will repeatedly call this method followed * by getRowData to obtain the objects to render in the table. */ @Override public void setRowIndex(int rowIndex) { this.rowIndex = rowIndex; } /** * Return the total number of rows of data available (not just the * number of rows in the current page!). */ @Override public int getRowCount() { return (int)getPage().getTotalSize(); } /** * Return a DataPage object; if one is not currently available then * fetch one. Note that this doesn't ensure that the datapage * returned includes the current rowIndex row; see getRowData. */ public $paginationResultClassName getPage() { if (this.page == null) { this.page = this.getPage( this.getPageNumber(), this.pageSize, this.sortProperty, this.sortAscending); } return this.page; } private int getPageNumber() { int pageNumber = 1; int rowIndex = this.rowIndex + 1; if (rowIndex >= this.pageSize) { pageNumber = this.rowIndex / this.pageSize; if ((rowIndex % this.pageSize) > 0) { pageNumber++; } } return pageNumber; } /** * Keeps track of the previous row index (so that we don't search more than we need) */ private int previousRowIndex; /** * Return the object corresponding to the current rowIndex. * If the DataPage object currently cached doesn't include that * index then fetchPage is called to retrieve the appropriate page. */ @Override public Object getRowData() { if (rowIndex < 0) { throw new IllegalArgumentException("Invalid rowIndex: " + rowIndex + "; not within page"); } // don't perform any new operations if the same index is used over again final int listIndex = this.rowIndex % this.pageSize; if (this.forcePageRefresh || listIndex == 0 && this.previousRowIndex != this.rowIndex) { this.previousRowIndex = this.rowIndex; // - only search if the listIndex is 0 (that is its a multiple of the page size) page = this.getPage( this.getPageNumber(), pageSize, this.sortProperty, this.sortAscending); this.forcePageRefresh = false; } Object rowData = null; if (page.getData() != null) { if (page.getData().length > listIndex) { rowData = page.getData()[listIndex]; } } return rowData; } @Override public Object getWrappedData() { return page.getData(); } /** * Return true if the rowIndex value is currently set to a * value that matches some element in the dataset. Note that * it may match a row that is not in the currently cached * DataPage; if so then when getRowData is called the * required DataPage will be fetched by calling fetchData. */ @Override public boolean isRowAvailable() { final $paginationResultClassName page = getPage(); if (page == null) { return false; } int rowIndex = getRowIndex(); if (rowIndex < 0) { return false; } else if (rowIndex >= page.getTotalSize()) { return false; } else { return true; } } /** * Method which must be implemented in cooperation with the * managed bean class to fetch data on demand. */ public abstract $paginationResultClassName getPage( int pageNumber, int pageSize, String sortProperty, boolean sortAscending); /* Used by ADF public Object getRowKey() { return isRowAvailable() ? String.valueOf(getRowIndex()) : null; } public void setRowKey(Object key) { setRowIndex(this.toRowIndex((String)key)); } /** * Creates a row index for the given row key * private int toRowIndex(String rowKey) { int rowIndex = -1; try { rowIndex = Integer.parseInt(rowKey); } catch (NumberFormatException exception) { // - ignore } return rowIndex; }*/ private boolean forcePageRefresh; private String sortProperty; public String getSortProperty() { return this.sortProperty; } public void setSortColumn(String sortProperty) { if (sortProperty != null && !sortProperty.equals(this.sortProperty)) { this.forcePageRefresh = true; } this.sortProperty = sortProperty; } private boolean sortAscending = true; public boolean isSortAscending() { return this.sortAscending; } public void setSortAscending(boolean sortAscending) { if (sortAscending != sortAscending) { this.forcePageRefresh = true; } this.sortAscending = sortAscending; } } 1.3 +11 -1 cartridges/andromda-jsf2/src/main/java/org/andromda/cartridges/jsf2/metafacades/JSFParameterLogicImpl.java Index: JSFParameterLogicImpl.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/java/org/andromda/cartridges/jsf2/metafacades/JSFParameterLogicImpl.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- JSFParameterLogicImpl.java 7 Sep 2007 16:42:48 -0000 1.2 +++ JSFParameterLogicImpl.java 27 Mar 2008 18:34:52 -0000 1.3 @@ -47,7 +47,17 @@ */ public boolean isTable() { - return super.isTable() && !this.isInputTable(); + return (super.isTable() || this.isPageableTable()) && !this.isSelectable() + && !this.isInputTable() && !this.isInputHidden(); + } + + /** + * @see org.andromda.cartridges.jsf2.metafacades.JSFParameter#isPageableTable() + */ + protected boolean handleIsPageableTable() + { + final Object value = this.findTaggedValue(JSFProfile.TAGGEDVALUE_TABLE_PAGEABLE); + return Boolean.valueOf(ObjectUtils.toString(value)).booleanValue(); } /** |
From: Chad B. <cwb...@us...> - 2008-03-27 18:34:29
|
User: cwbrandon Date: 08/03/27 11:34:34 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/utils/portlet - New directory |
From: Chad B. <cwb...@us...> - 2008-03-21 22:46:06
|
User: cwbrandon Date: 08/03/21 15:46:03 Modified: andromda-jsf2/src/main/resources/templates/jsf2/views/portlet view-table.xhtml.vsl Log: add sortable flag Revision Changes Path 1.2 +5 -5 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/views/portlet/view-table.xhtml.vsl Index: view-table.xhtml.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/views/portlet/view-table.xhtml.vsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- view-table.xhtml.vsl 21 Mar 2008 16:07:12 -0000 1.1 +++ view-table.xhtml.vsl 21 Mar 2008 22:46:03 -0000 1.2 @@ -24,7 +24,7 @@ <h:form> #set ($targetColumns = $table.targettedTableColumnNames) <h:panelGroup rendered="#{!empty $table.name}"> - <t:dataScroller id="${table.name}Scroller1" + <lr:portletScroller id="${table.name}Scroller1" for="$table.name" fastStep="10" pageCountVar="pageCount" @@ -53,8 +53,8 @@ <f:facet name="fastrewind"> <t:graphicImage url="/images/arrow-fr.gif" border="1" /> </f:facet> - </t:dataScroller> - <t:dataScroller id="${table.name}Scroller2" + </lr:portletScroller> + <lr:portletScroller id="${table.name}Scroller2" for="$table.name" rowsCountVar="rowsCount" displayedRowsCountVar="displayedRowsCountVar" @@ -71,8 +71,8 @@ <f:param value="#{pageIndex}" /> <f:param value="#{pageCount}" /> </h:outputFormat> - </t:dataScroller> - <lr:table value="#{${table.name}}" var="row" id="$table.name" rows="10"> + </lr:portletScroller> + <lr:table value="#{${table.name}}" var="row" id="$table.name" sortable="true" rows="10"> #if (!$table.tableColumns.empty) #foreach ($column in $table.tableColumns) #if($column.name) |
From: Chad B. <cwb...@us...> - 2008-03-21 16:16:00
|
User: cwbrandon Date: 08/03/21 09:15:27 Modified: andromda-jsf2/src/main/resources/templates/jsf2/flow/portlet PortletPhaseListener.java.vsl Log: fix comment Revision Changes Path 1.2 +2 -2 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/flow/portlet/PortletPhaseListener.java.vsl Index: PortletPhaseListener.java.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/flow/portlet/PortletPhaseListener.java.vsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- PortletPhaseListener.java.vsl 21 Mar 2008 16:07:12 -0000 1.1 +++ PortletPhaseListener.java.vsl 21 Mar 2008 16:15:27 -0000 1.2 @@ -4,8 +4,8 @@ #end /** - * Used to pass messages to the current faces context (this allows messages to live beyond - * a request, which is very useful when redirecting). + * A phase listener which handles the pre-population of the form that is passed + * from view to view. * * @author Chad Brandon */ |
From: Chad B. <cwb...@us...> - 2008-03-21 16:06:58
|
User: cwbrandon Date: 08/03/21 09:07:01 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/flow/portlet - New directory |
From: Chad B. <cwb...@us...> - 2008-03-21 16:06:57
|
User: cwbrandon Date: 08/03/21 09:07:04 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/views/portlet - New directory |
From: Chad B. <cwb...@us...> - 2008-03-21 16:06:54
|
User: cwbrandon Date: 08/03/21 09:07:00 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/configuration/portlet - New directory |
From: Walter M. <wal...@us...> - 2008-03-13 13:14:09
|
User: walterim Date: 08/03/13 06:14:13 Modified: andromda-jsf2/src/main/resources/templates/jsf2/views/facelets/crud view.xhtml.vsl Log: added a message inside the table when the search result set is empty. Revision Changes Path 1.15 +1 -1 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/views/facelets/crud/view.xhtml.vsl Index: view.xhtml.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/views/facelets/crud/view.xhtml.vsl,v retrieving revision 1.14 retrieving revision 1.15 diff -u -w -r1.14 -r1.15 --- view.xhtml.vsl 5 Mar 2008 18:00:58 -0000 1.14 +++ view.xhtml.vsl 13 Mar 2008 13:14:13 -0000 1.15 @@ -145,7 +145,7 @@ </tr:panelButtonBar> </f:facet> </tr:panelFormLayout> - <tr:table id="searchResult" allDetailsEnabled="true" var="row" rowBandingInterval="1" value="#{${formName}.${manageable.listName}}" rows="#{${preferencesBeanName}.maxTableRows}" width="90%" rendered="#{not empty ${formName}.${manageable.listName}}" partialTriggers="searchResult:deleteAction"> + <tr:table id="searchResult" allDetailsEnabled="true" var="row" rowBandingInterval="1" value="#{${formName}.${manageable.listName}}" rows="#{${preferencesBeanName}.maxTableRows}" width="90%" rendered="#{${formName}.${manageable.listName} != null}" partialTriggers="searchResult:deleteAction" emptyText="#{messages['empty.result.set']}"> <tr:column width="46px"> <f:facet name="header"> <h:panelGroup><tr:image source="/images/space.gif"/></h:panelGroup> |
From: Walter M. <wal...@us...> - 2008-03-13 13:13:19
|
User: walterim Date: 08/03/13 06:13:25 Modified: andromda-jsf2/src/main/resources/templates/jsf2/views/facelets/components autocomplete.xhtml.vsl autocompleteMulti.xhtml.vsl Log: The double click does not open the list anymore, to avoid misbehavior when the user wants to selected the text. Revision Changes Path 1.3 +0 -1 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/views/facelets/components/autocomplete.xhtml.vsl Index: autocomplete.xhtml.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/views/facelets/components/autocomplete.xhtml.vsl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- autocomplete.xhtml.vsl 5 Mar 2008 17:59:25 -0000 1.2 +++ autocomplete.xhtml.vsl 13 Mar 2008 13:13:23 -0000 1.3 @@ -155,7 +155,6 @@ </trh:script> <h:inputText id="#{editId}" autocomplete="off" required="#{required}" style="#{contentStyle}" readOnly="#{readOnly}" - ondblclick="document.getElementById('#{jsActionId}').click(); return false;" onkeydown="return #{editKeydownFunc}(event);" onchange="document.getElementById('#{jsHiddenId}').value=''; return true;" onblur="window.clearTimeout(#{timeoutVar}); #{checkEmptyEditFunc}(); #{timeoutVar}=window.setTimeout('#{hideResultTableFunc}();',100);" 1.2 +0 -1 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/views/facelets/components/autocompleteMulti.xhtml.vsl Index: autocompleteMulti.xhtml.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/views/facelets/components/autocompleteMulti.xhtml.vsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- autocompleteMulti.xhtml.vsl 2 Mar 2008 20:59:19 -0000 1.1 +++ autocompleteMulti.xhtml.vsl 13 Mar 2008 13:13:24 -0000 1.2 @@ -185,7 +185,6 @@ <h:panelGrid columns="1"> <h:panelGrid columns="4"> <h:inputText id="#{editId}" autocomplete="off" readOnly="#{readOnly}" - ondblclick="document.getElementById('#{jsActionId}').click(); return false;" onkeydown="return #{editKeydown}(event);" onchange="document.getElementById('#{jsHiddenId}').value=''; return true;" onblur="window.clearTimeout(#{timeoutName}); #{checkEmptyEdit}(); #{timeoutName}=window.setTimeout('#{hideResultTable}();',100);" /> |
From: Walter M. <wal...@us...> - 2008-03-13 13:12:04
|
User: walterim Date: 08/03/13 06:12:07 Modified: andromda-jsf2/src/main/resources/templates/jsf2/controllers/crud Controller.java.vsl ControllerImpl.java.vsl Log: Added a merge point. The serializable stuff moved to the Impl Revision Changes Path 1.14 +15 -10 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/controllers/crud/Controller.java.vsl Index: Controller.java.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/controllers/crud/Controller.java.vsl,v retrieving revision 1.13 retrieving revision 1.14 diff -u -w -r1.13 -r1.14 --- Controller.java.vsl 2 Mar 2008 20:59:16 -0000 1.13 +++ Controller.java.vsl 13 Mar 2008 13:12:06 -0000 1.14 @@ -2,13 +2,8 @@ // license-header java merge-point package $manageable.manageablePackageName; -public class ${manageable.controllerName} - implements java.io.Serializable +public abstract class ${manageable.controllerName} { - /** - * The serial version UID of this class. Needed for serialization. - */ - private static final long serialVersionUID = ${manageable.actionSerialVersionUID}L; public String init(){ final ${managedBeansPackage}.AdfFacesContextWrapper contextWrapper = new ${managedBeansPackage}.AdfFacesContextWrapper(); @@ -49,6 +44,9 @@ saveMaxResultsWarning(); #end +#else + form.${manageable.listSetterName}(null); + #end #if (!$useAutocompleteLookup) #if (!$manageable.manageableAssociationEnds.empty) @@ -257,16 +255,20 @@ #if ($manageable.create) if(form.${manageable.manageableIdentifier.getterName}() == null){ + form.${manageable.manageableIdentifier.setterName}( ${manageable.manageableServiceAccessorCall}.create( #set ($comma = '') #foreach ($member in $manageable.manageableMembers) -#if ($member.inputFile) +#if ($member.name == $manageable.manageableIdentifier.name) + ${comma}null +#elseif ($member.inputFile) ${comma}form.${member.getterName}()==null?null:org.apache.commons.io.IOUtils.toByteArray(form.${member.getterName}().getInputStream()) #else ${comma}form.${member.getterName}() #end #set ($comma = ', ') #end + ).${manageable.manageableIdentifier.getterName}() ); } else{ @@ -666,4 +668,7 @@ } } } + + // crud-controller merge-point + } \ No newline at end of file 1.2 +8 -2 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/controllers/crud/ControllerImpl.java.vsl Index: ControllerImpl.java.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/controllers/crud/ControllerImpl.java.vsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- ControllerImpl.java.vsl 20 Feb 2007 10:14:55 -0000 1.1 +++ ControllerImpl.java.vsl 13 Mar 2008 13:12:07 -0000 1.2 @@ -3,10 +3,16 @@ package $manageable.manageablePackageName; /** - * @see $controller.fullyQualifiedName + * @see ${manageable.manageablePackageName}.${manageable.controllerName} */ public class ${manageable.controllerName}Impl extends ${manageable.controllerName} + implements java.io.Serializable { + /** + * The serial version UID of this class. Needed for serialization. + */ + private static final long serialVersionUID = ${manageable.actionSerialVersionUID}L; + } |
From: Chad B. <cwb...@us...> - 2008-03-07 16:53:19
|
User: cwbrandon Date: 08/03/07 08:53:25 Removed: andromda-jsf2/src/main/resources/templates/jsf2/utils CollectionSorter.java.vsl Log: get rid of unneeded collection sorter (this was for the old myfaces tables) |
From: Chad B. <cwb...@us...> - 2008-03-07 16:48:44
|
User: cwbrandon Date: 08/03/07 08:48:50 Modified: andromda-jsf2/src/main/resources/templates/jsf2/forms/crud Form.java.vsl SearchForm.java.vsl andromda-jsf2/src/main/resources/META-INF/andromda cartridge.xml andromda-jsf2/src/main/resources/templates/jsf2/forms FormImpl.java.vsl Log: get rid of unneeded collection sorter (this was for the old myfaces tables) Revision Changes Path 1.5 +21 -40 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/forms/crud/Form.java.vsl Index: Form.java.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/forms/crud/Form.java.vsl,v retrieving revision 1.4 retrieving revision 1.5 diff -u -w -r1.4 -r1.5 --- Form.java.vsl 2 Mar 2008 20:59:16 -0000 1.4 +++ Form.java.vsl 7 Mar 2008 16:48:49 -0000 1.5 @@ -121,24 +121,6 @@ */ public $fieldTypeName ${field.getterName}() { -#if ($field.type.collectionType || $field.type.arrayType) -#set ($upperCaseFieldName = $stringUtils.capitalize($field.name)) - if (this.$field.name != null) - { -#if ($field.type.arrayType) - this.$field.name = ($field.type.fullyQualifiedName)${managedBeansPackage}.CollectionSorter.sort( - java.util.Arrays.asList(this.$field.name), - this.get${stringUtils.capitalize($field.tableSortColumnProperty)}(), - this.is${upperCaseFieldName}SortAscending()).toArray(new ${field.type.fullyQualifiedName}{}); -#else - this.$field.name = ${managedBeansPackage}.CollectionSorter.sort( - this.$field.name, - this.get${stringUtils.capitalize($field.tableSortColumnProperty)}(), - this.is${upperCaseFieldName}SortAscending()); -#end - } - return this.$field.name; -#else #if ($field.complex) if (this.$field.name == null) { @@ -146,7 +128,6 @@ } #end return this.${field.name}; -#end } /** 1.4 +7 -20 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/forms/crud/SearchForm.java.vsl Index: SearchForm.java.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/forms/crud/SearchForm.java.vsl,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -r1.3 -r1.4 --- SearchForm.java.vsl 2 Mar 2008 20:59:16 -0000 1.3 +++ SearchForm.java.vsl 7 Mar 2008 16:48:49 -0000 1.4 @@ -33,26 +33,13 @@ public $fieldTypeName ${field.getterName}() { -#if ($field.type.collectionType || $field.type.arrayType) -#set ($upperCaseFieldName = $stringUtils.capitalize($field.name)) - if (this.$field.name != null) +#if ($field.complex) + if (this.$field.name == null) { -#if ($field.type.arrayType) - this.$field.name = ($field.type.fullyQualifiedName)${managedBeansPackage}.CollectionSorter.sort( - java.util.Arrays.asList(this.$field.name), - this.get${stringUtils.capitalize($field.tableSortColumnProperty)}(), - this.is${upperCaseFieldName}SortAscending()).toArray(new ${field.type.fullyQualifiedName}{}); -#else - this.$field.name = ${managedBeansPackage}.CollectionSorter.sort( - this.$field.name, - this.get${stringUtils.capitalize($field.tableSortColumnProperty)}(), - this.is${upperCaseFieldName}SortAscending()); -#end + this.$field.name = new ${field.type.fullyQualifiedName}(); } - return this.$field.name; -#else - return this.${field.name}; #end + return this.${field.name}; } public void ${field.setterName}($fieldTypeName $field.name) 1.13 +0 -6 cartridges/andromda-jsf2/src/main/resources/META-INF/andromda/cartridge.xml Index: cartridge.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/META-INF/andromda/cartridge.xml,v retrieving revision 1.12 retrieving revision 1.13 diff -u -w -r1.12 -r1.13 --- cartridge.xml 2 Mar 2008 20:59:17 -0000 1.12 +++ cartridge.xml 7 Mar 2008 16:48:49 -0000 1.13 @@ -464,12 +464,6 @@ overwrite="true"/> <template - path="templates/jsf2/utils/CollectionSorter.java.vsl" - outputPattern="$stringUtils.replace($managedBeansPackage, '.', '/')/${className}.java" - outlet="managed-beans" - overwrite="true"/> - - <template path="templates/jsf2/utils/AdfFacesContextWrapper.java.vsl" outputPattern="$stringUtils.replace($managedBeansPackage, '.', '/')/${className}.java" outlet="managed-beans" 1.2 +37 -87 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/forms/FormImpl.java.vsl Index: FormImpl.java.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/forms/FormImpl.java.vsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- FormImpl.java.vsl 5 Dec 2006 19:39:26 -0000 1.1 +++ FormImpl.java.vsl 7 Mar 2008 16:48:49 -0000 1.2 @@ -12,7 +12,7 @@ public ${action.formImplementationName}() { #foreach ($field in $action.formFields) -#if (!$field.complex || $field.type.enumeration) +#if (!$field.complex) #renderDateTimeFormatters($field "") #end #foreach ($attribute in $field.attributes) @@ -26,7 +26,9 @@ } #foreach ($field in $action.formFields) -#if ($field.type.collectionType) +#if ($field.pageableTable) +#set ($fieldTypeName = "javax.faces.model.DataModel") +#elseif ($field.type.collectionType) #set ($fieldTypeName = "java.util.List") #elseif ($field.type.fileType) #set ($fieldTypeName = "$fileTypeName") @@ -40,32 +42,13 @@ */ public $fieldTypeName ${field.getterName}() { -#if ($field.type.collectionType || $field.type.arrayType) -#set ($upperCaseFieldName = $stringUtils.capitalize($field.name)) - if (this.$field.name != null) - { -#if ($field.type.arrayType) - this.$field.name = ($field.type.fullyQualifiedName)${managedBeansPackage}.CollectionSorter.sort( - java.util.Arrays.asList(this.$field.name), - this.get${stringUtils.capitalize($field.tableSortColumnProperty)}(), - this.is${upperCaseFieldName}SortAscending()).toArray(new ${field.type.fullyQualifiedName}{}); -#else - this.$field.name = ${managedBeansPackage}.CollectionSorter.sort( - this.$field.name, - this.get${stringUtils.capitalize($field.tableSortColumnProperty)}(), - this.is${upperCaseFieldName}SortAscending()); -#end - } - return this.$field.name; -#else -#if ($field.complex && !$field.type.enumeration) +#if ($field.complex) if (this.$field.name == null) { this.$field.name = new ${field.type.fullyQualifiedName}(); } #end return this.${field.name}; -#end } /** @@ -93,69 +76,12 @@ this.$field.name = $field.name; this.$field.formAttributeSetProperty = true; } -#if ($field.type.collectionType || $field.type.arrayType) - - /** - * The name of the sort column for the {@link #${field.name}} collection. - */ - private String $field.tableSortColumnProperty; - - /** - * Gets the name of the sort column for the {@link #${field.name}} collection. - * - * @return the name of the sort column. - */ - public String get${stringUtils.capitalize($field.tableSortColumnProperty)}() - { - return this.$field.tableSortColumnProperty; - } - - /** - * Sets the name of the {@link #${field.name}} sort column. - * - * @param $field.tableSortColumnProperty the name of the column by which {@link #${field.name}} - * are sorted by. - */ - public void set${stringUtils.capitalize($field.tableSortColumnProperty)}(final String $field.tableSortColumnProperty) - { - this.$field.tableSortColumnProperty = $field.tableSortColumnProperty; - } - - /** - * The flag indicating whether or not {@link #${field.name}} should be sorted - * ascending. - */ - private boolean $field.tableSortAscendingProperty = false; - - /** - * Indicates whether or not {@link #${field.name}} should be sorted ascending - * or not. - * - * @return true/false - */ - public boolean is${stringUtils.capitalize($field.tableSortAscendingProperty)}() - { - return this.$field.tableSortAscendingProperty; - } - - /** - * Sets whether or not {@link #${field.name}} should be sorted ascending. - * - * @param $field.tableSortAscendingProperty true/false - */ - public void set${stringUtils.capitalize($field.tableSortAscendingProperty)}(final boolean $field.tableSortAscendingProperty) - { - this.$field.tableSortAscendingProperty = $field.tableSortAscendingProperty; - } -#end -#if ( (!$field.complex || $field.type.enumeration) && !$field.defaultValuePresent) +#if (!$field.complex && !$field.defaultValuePresent) #renderBackingListImplSupport($field "") #end -#if (!$field.type.enumeration) #foreach ($attribute in $field.attributes) #renderBackingListImplSupport($attribute $field) #end -#end #end #if ($action.formResetRequired) @@ -168,6 +94,12 @@ #foreach($field in $action.parameters) #if ($field.reset) this.$field.name = $field.type.javaNullString; +#elseif ($field.complex) +#foreach ($attribute in $field.type.getAttributes(true)) +#if ($attribute.reset) + this.${field.name}.${attribute.setterName}($attribute.type.javaNullString); +#end +#end #end #end } @@ -220,6 +152,24 @@ } /** + * Sets the current {@link javax.faces.application.FacesMessage} message + * instances stored within this form. + * + * @param messages a collection of the current Faces messages. + */ + public void set${stringUtils.capitalize($formMessagesProperty)}(final java.util.Collection messages) + { + if (messages != null) + { + for (final java.util.Iterator iterator = messages.iterator(); iterator.hasNext();) + { + javax.faces.application.FacesMessage jsfMessage = (javax.faces.application.FacesMessage)iterator.next(); + this.${formMessagesProperty}.put(jsfMessage.getDetail(), jsfMessage); + } + } + } + + /** * Clear the current {@link javax.faces.application.FacesMessage} message * instances stored within this form. * |