From: Walter M. <wal...@us...> - 2006-12-11 13:44:04
|
User: walterim Date: 06/12/11 05:44:00 Modified: andromda-jsf2/src/main/resources/templates/jsf2/views/facelets login.xhtml.vsl andromda-jsf2/src/main/resources/templates/jsf2/views/facelets/layout messages.xhtml.vsl menu.xhtml.vsl layout.xhtml.vsl andromda-jsf2/src/main/java/org/andromda/cartridges/jsf2/metafacades JSFEnumerationLogicImpl.java andromda-jsf2/src/main/uml JSFMetafacadeModel.xml.zip andromda-jsf2/src/main/resources/templates/jsf2/configuration validation.xml.vsl validation.xml.vm faces-config.xml.vsl web.xml.vsl andromda-jsf2/src/main/resources/META-INF/andromda cartridge.xml profile.xml metafacades.xml namespace.xml andromda-jsf2/src/main/resources/templates/jsf2/flow ViewPopulator.java.vsl andromda-jsf2/src/main/java/org/andromda/cartridges/jsf2 JSFUtils.java JSFGlobals.java JSFProfile.java andromda-jsf2 pom.xml andromda-jsf2/src/test/expected cartridge-output.zip andromda-jsf2/src/main/resources/templates/jsf2/views/facelets/preferences preferences.xhtml.vsl andromda-jsf2/src/main/resources/templates/jsf2/views/jsp index.jsp.vsl view.jsp.vsl andromda-jsf2/src/test/uml JSFCartridgeTestModel.xml.zip andromda-jsf2/src/main/resources/templates/jsf2/views renderActionFormInput.vm andromda-jsf2/src/main/resources/templates/jsf2/messages messages.properties.vsl Added: andromda-jsf2/src/main/java/org/andromda/cartridges/jsf2/metafacades JSFManageableEntityAssociationEndLogicImpl.java JSFManageableEntityLogicImpl.java JSFManageableEntityAttributeLogicImpl.java andromda-jsf2/src/main/resources/templates/jsf2/flow/crud ActionForward.java.vsl ViewPopulator.java.vsl andromda-jsf2/src/main/resources/resources/views/images load.gif delete.gif back.gif andromda-jsf2/src/main/resources/templates/jsf2/views/facelets/crud view.xhtml.vsl andromda-jsf2 jsf2061207105050.exc andromda-jsf2/src/main/resources/templates/jsf2/controllers/crud Controller.java.vsl andromda-jsf2/src/main/resources/resources/lib trinidad-impl-incubator-stable-06-nov-SNAPSHOT.jar trinidad-api-incubator-stable-06-nov-SNAPSHOT.jar andromda-jsf2/src/main/resources/templates/jsf2/forms/crud SearchForm.java.vsl Form.java.vsl Log: - Added manageable entities. Still broken waiting the spring cartridge changes. - depends andromda 3.2, the models were changed to the andromda profile 3.2 - myfaces and tomahawk jars removed. It is needed to update the POMs changing the following dependencies: <dependency> <groupId>myfaces</groupId> <artifactId>myfaces-api</artifactId> <version>1.1.1</version> </dependency> <dependency> <groupId>myfaces</groupId> <artifactId>myfaces-impl</artifactId> <version>1.1.1</version> </dependency> <dependency> <groupId>myfaces</groupId> <artifactId>tomahawk</artifactId> <version>1.1.1</version> </dependency> <dependency> <groupId>com.sun.facelets</groupId> <artifactId>jsf-facelets</artifactId> <version>1.1.9</version> </dependency> <dependency> <groupId>javax.el</groupId> <artifactId>el-api</artifactId> <version>1.0</version> </dependency> <dependency> <groupId>com.sun.el</groupId> <artifactId>el-ri</artifactId> <version>1.0</version> It is also needed to add the following repository to the main pom: <repository> <id>maven2-repository.dev.java.net</id> <name>Java.net Repository for Maven</name> <url>https://maven2-repository.dev.java.net/nonav/repository</url> <layout>default</layout> </repository> The Trinidad jar was updated to the 6-nov-stable. Revision Changes Path 1.2 +2 -2 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/views/facelets/login.xhtml.vsl Index: login.xhtml.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/views/facelets/login.xhtml.vsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- login.xhtml.vsl 5 Dec 2006 19:39:14 -0000 1.1 +++ login.xhtml.vsl 11 Dec 2006 13:43:57 -0000 1.2 @@ -65,12 +65,12 @@ <tr> <td colspan="2"/> <td> - <h:form> + <tr:subform> <tr:panelButtonBar> <tr:commandButton text="#{messages['login.submit']}" onclick="document.forms[0].submit();"/> <tr:commandButton text="#{messages['login.reset']}" onclick="document.forms[0].reset();"/> </tr:panelButtonBar> - </h:form> + </tr:subform> </td> </tr> #if (!$registrationUseCases.empty) 1.2 +1 -1 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/views/facelets/layout/messages.xhtml.vsl Index: messages.xhtml.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/views/facelets/layout/messages.xhtml.vsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- messages.xhtml.vsl 5 Dec 2006 19:39:25 -0000 1.1 +++ messages.xhtml.vsl 11 Dec 2006 13:43:57 -0000 1.2 @@ -3,6 +3,6 @@ xmlns:tr="http://myfaces.apache.org/trinidad" xmlns:h="http://java.sun.com/jsf/html"> <ui:composition> - <tr:messages globalOnly="false"/> + <tr:messages globalOnly="true" text="#{messages['errors.header']}"/> </ui:composition> </html> 1.2 +3 -0 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/views/facelets/layout/menu.xhtml.vsl Index: menu.xhtml.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/views/facelets/layout/menu.xhtml.vsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- menu.xhtml.vsl 5 Dec 2006 19:39:25 -0000 1.1 +++ menu.xhtml.vsl 11 Dec 2006 13:43:57 -0000 1.2 @@ -12,6 +12,9 @@ #foreach ($useCase in $useCases) <tr:commandNavigationItem text="#{messages['$useCase.titleKey']}" action="#{${useCase.controller.beanName}.${useCase.controllerAction}}"/> #end +#foreach($manageable in $manageables) + <tr:commandNavigationItem text="#{messages['$manageable.viewTitleKey']}" action="#{${manageable.controllerBeanName}.init}"/> +#end #if ($enablePreferences) <tr:commandNavigationItem text="#{messages['menu.preferences']}" action="preferences"/> #end 1.2 +5 -5 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/views/facelets/layout/layout.xhtml.vsl Index: layout.xhtml.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/views/facelets/layout/layout.xhtml.vsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- layout.xhtml.vsl 5 Dec 2006 19:39:25 -0000 1.1 +++ layout.xhtml.vsl 11 Dec 2006 13:43:57 -0000 1.2 @@ -38,21 +38,21 @@ <f:facet name="navigation1"> <tr:navigationPane hint="tabs" level="0" var="item" value="#{menuModel.model}"> <f:facet name="nodeStamp"> - <tr:commandNavigationItem text="#{item.label}" action="#{item.getAction}"/> + <tr:commandNavigationItem text="#{messages[item.label]}" action="#{item.getAction}"/> </f:facet> </tr:navigationPane> </f:facet> <f:facet name="navigation2"> <tr:navigationPane hint="bar" level="1" var="item" value="#{menuModel.model}"> <f:facet name="nodeStamp"> - <tr:commandNavigationItem text="#{item.label}" action="#{item.getAction}"/> + <tr:commandNavigationItem text="#{messages[item.label]}" action="#{item.getAction}"/> </f:facet> </tr:navigationPane> </f:facet> <f:facet name="navigation3"> <tr:navigationPane hint="list" level="2" var="item" value="#{menuModel.model}"> <f:facet name="nodeStamp"> - <tr:commandNavigationItem text="#{item.label}" action="#{item.getAction}"/> + <tr:commandNavigationItem text="#{messages[item.label]}" action="#{item.getAction}"/> </f:facet> </tr:navigationPane> </f:facet> @@ -61,7 +61,7 @@ <f:facet name="navigation3"> <tr:navigationTree var="item" value="#{menuModel.model}"> <f:facet name="nodeStamp"> - <tr:commandNavigationItem text="#{item.label}" action="#{item.getAction}"/> + <tr:commandNavigationItem text="#{messages[item.label]}" action="#{item.getAction}"/> </f:facet> </tr:navigationTree> </f:facet> @@ -79,7 +79,7 @@ <f:facet name="location"> <tr:breadCrumbs var="item" value="#{menuModel.model}"> <f:facet name="nodeStamp"> - <tr:commandNavigationItem text="#{item.label}" action="#{item.getAction}"/> + <tr:commandNavigationItem text="#{messages[item.label]}" action="#{item.getAction}"/> </f:facet> </tr:breadCrumbs> </f:facet> 1.2 +9 -0 cartridges/andromda-jsf2/src/main/java/org/andromda/cartridges/jsf2/metafacades/JSFEnumerationLogicImpl.java Index: JSFEnumerationLogicImpl.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/java/org/andromda/cartridges/jsf2/metafacades/JSFEnumerationLogicImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- JSFEnumerationLogicImpl.java 5 Dec 2006 19:39:13 -0000 1.1 +++ JSFEnumerationLogicImpl.java 11 Dec 2006 13:43:57 -0000 1.2 @@ -3,6 +3,7 @@ import org.andromda.cartridges.jsf2.JSFGlobals; import org.apache.commons.lang.ObjectUtils; import org.apache.commons.lang.StringUtils; +import org.andromda.utils.StringUtilsHelper; /** @@ -46,4 +47,12 @@ return this.getFullyQualifiedConverterName().replace('.', '/'); } + /** + * @see org.andromda.cartridges.jsf2.metafacades.JSFEnumeration#getMessageKey() + */ + protected String handleGetMessageKey() + { + return StringUtilsHelper.toResourceMessageKey(getName()); + } + } \ No newline at end of file 1.1 cartridges/andromda-jsf2/src/main/java/org/andromda/cartridges/jsf2/metafacades/JSFManageableEntityAssociationEndLogicImpl.java Index: JSFManageableEntityAssociationEndLogicImpl.java =================================================================== package org.andromda.cartridges.jsf2.metafacades; import org.andromda.utils.StringUtilsHelper; import org.andromda.metafacades.uml.ClassifierFacade; import org.andromda.metafacades.uml.Entity; import org.andromda.metafacades.uml.ManageableEntity; import org.andromda.cartridges.jsf2.JSFUtils; import org.andromda.cartridges.jsf2.JSFGlobals; import org.apache.commons.lang.ObjectUtils; import org.apache.commons.lang.StringUtils; /** * MetafacadeLogic implementation for org.andromda.cartridges.jsf2.metafacades.JSFManageableEntityAssociationEnd. * * @see org.andromda.cartridges.jsf2.metafacades.JSFManageableEntityAssociationEnd */ public class JSFManageableEntityAssociationEndLogicImpl extends JSFManageableEntityAssociationEndLogic { public JSFManageableEntityAssociationEndLogicImpl( Object metaObject, String context) { super(metaObject, context); } /** * @see org.andromda.cartridges.jsf2.metafacades.JSFManageableEntityAssociationEnd#getMessageKey() */ protected java.lang.String handleGetMessageKey() { final StringBuffer messageKeyBuffer = new StringBuffer(); final ClassifierFacade ownerType = this.getOtherEnd().getType(); if (ownerType instanceof ManageableEntity) { messageKeyBuffer.append(ownerType.getName()); } else { messageKeyBuffer.append(ownerType.getName()); } messageKeyBuffer.append('.'); messageKeyBuffer.append(this.getName()); return StringUtilsHelper.toResourceMessageKey(messageKeyBuffer.toString()); } /** * @see org.andromda.cartridges.jsf2.metafacades.JSFManageableEntityAssociationEnd#getMessageValue() */ protected java.lang.String handleGetMessageValue() { String messageValue = null; final ClassifierFacade type = this.getType(); if (type instanceof Entity) { messageValue = this.getName(); } return StringUtilsHelper.toPhrase(messageValue); } protected boolean handleIsSafeNamePresent() { return true; // TODO será que precisa desse método ? //return JSFUtils.isSafeName(this.getName()); } protected String handleGetOnlineHelpKey() { return this.getMessageKey() + ".online.help"; } protected String handleGetOnlineHelpValue() { final String value = StringUtilsHelper.toResourceMessage(this.getDocumentation("", 64, false)); return (value == null) ? "No field documentation has been specified" : value; } /** * @see org.andromda.cartridges.jsf2.metafacades.JSFAttribute#getBackingListName(org.andromda.metafacades.uml.ParameterFacade) */ protected String handleGetBackingListName() { final String backingListName = StringUtils.replace( ObjectUtils.toString(this.getConfiguredProperty(JSFGlobals.BACKING_LIST_PATTERN)), "{0}", this.getName()); return org.andromda.utils.StringUtilsHelper.lowerCamelCaseName(backingListName); } /** * @see org.andromda.cartridges.jsf2.metafacades.JSFParameter#getValueListName() */ protected String handleGetValueListName() { return ObjectUtils.toString(this.getConfiguredProperty(JSFGlobals.VALUE_LIST_PATTERN)).replaceAll( "\\{0\\}", this.getName()); } /** * @see org.andromda.cartridges.jsf2.metafacades.JSFParameter#getLabelListName() */ protected String handleGetLabelListName() { return ObjectUtils.toString(this.getConfiguredProperty(JSFGlobals.LABEL_LIST_PATTERN)).replaceAll( "\\{0\\}", this.getName()); } } 1.1 cartridges/andromda-jsf2/src/main/java/org/andromda/cartridges/jsf2/metafacades/JSFManageableEntityLogicImpl.java Index: JSFManageableEntityLogicImpl.java =================================================================== package org.andromda.cartridges.jsf2.metafacades; import org.andromda.cartridges.jsf2.JSFGlobals; import org.andromda.cartridges.jsf2.JSFUtils; import org.andromda.cartridges.jsf2.JSFProfile; import org.andromda.utils.StringUtilsHelper; import org.andromda.metafacades.uml.UMLMetafacadeProperties; import org.andromda.metafacades.uml.AttributeFacade; import org.apache.commons.lang.StringUtils; import java.util.Collection; import java.util.Iterator; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import org.andromda.metafacades.uml.ModelElementFacade; import org.apache.commons.lang.ObjectUtils; /** * MetafacadeLogic implementation for org.andromda.cartridges.jsf2.metafacades.JSFManageableEntity. * * @see org.andromda.cartridges.jsf2.metafacades.JSFManageableEntity */ public class JSFManageableEntityLogicImpl extends JSFManageableEntityLogic { /** * @return the configured property denoting the character sequence to use for the separation of namespaces */ private String getNamespaceProperty() { return (String)this.getConfiguredProperty(UMLMetafacadeProperties.NAMESPACE_SEPARATOR); } public JSFManageableEntityLogicImpl( Object metaObject, String context) { super(metaObject, context); } protected String handleGetFormBeanType() { return this.getManageablePackageName() + this.getNamespaceProperty() + this.getFormBeanClassName(); } protected String handleGetFormBeanClassName() { return this.getName() + JSFGlobals.FORM_SUFFIX; } protected String handleGetFormBeanFullPath() { return StringUtils.replace(this.getFormBeanType(), this.getNamespaceProperty(), "/"); } protected java.lang.String handleGetMessageKey() { return StringUtilsHelper.toResourceMessageKey(this.getName()); } protected java.lang.String handleGetMessageValue() { return StringUtilsHelper.toPhrase(this.getName()); } protected java.lang.String handleGetViewTitleKey() { return StringUtilsHelper.toResourceMessageKey(this.getName()) + ".view.title"; } protected java.lang.String handleGetViewTitleValue() { return StringUtilsHelper.toPhrase(getName()); } protected java.lang.String handleGetListName() { return "manageableList"; } protected java.lang.String handleGetListGetterName() { return "getManageableList"; } protected java.lang.String handleGetListSetterName() { return "setManageableList"; } protected java.lang.String handleGetActionPath() { return '/' + this.getName() + "/Manage"; } protected java.lang.String handleGetFormBeanName() { return "manage" + this.getName() + JSFGlobals.FORM_SUFFIX; } protected java.lang.String handleGetActionType() { return this.getManageablePackageName() + this.getNamespaceProperty() + this.getActionClassName(); } protected java.lang.String handleGetExceptionKey() { return StringUtilsHelper.toResourceMessageKey(this.getName()) + ".exception"; } protected java.lang.String handleGetExceptionPath() { return this.getViewFullPath(); } protected java.lang.String handleGetActionFullPath() { return '/' + StringUtils.replace(this.getActionType(), this.getNamespaceProperty(), "/"); } protected java.lang.String handleGetActionClassName() { return "Manage" + getName(); } protected boolean handleIsPreload() { return this.isCreate() || this.isRead() || this.isUpdate() || this.isDelete(); } protected String handleGetOnlineHelpKey() { return this.getMessageKey() + ".online.help"; } protected String handleGetOnlineHelpValue() { final String value = StringUtilsHelper.toResourceMessage(this.getDocumentation("", 64, false)); return (value == null) ? "No entity documentation has been specified" : value; } protected String handleGetOnlineHelpActionPath() { return this.getActionPath() + "Help"; } protected String handleGetOnlineHelpPagePath() { return '/' + this.getManageablePackagePath() + '/' + this.getName().toLowerCase() + "_help"; } protected boolean handleIsTableExportable() { return this.getTableExportTypes().indexOf("none") == -1; } protected String handleGetTableExportTypes() { return null; //TODO a resolver // return JSFUtils.getDisplayTagExportTypes( // this.findTaggedValues(JSFProfile.TAGGEDVALUE_TABLE_EXPORT), // (String)getConfiguredProperty(JSFGlobals.PROPERTY_DEFAULT_TABLE_EXPORT_TYPES) ); } protected boolean handleIsTableSortable() { final Object taggedValue = this.findTaggedValue(JSFProfile.TAGGEDVALUE_TABLE_SORTABLE); return (taggedValue == null) ? JSFProfile.TAGGEDVALUE_TABLE_SORTABLE_DEFAULT_VALUE : Boolean.valueOf(String.valueOf(taggedValue)).booleanValue(); } protected int handleGetTableMaxRows() { final Object taggedValue = this.findTaggedValue(JSFProfile.TAGGEDVALUE_TABLE_MAXROWS); int pageSize; try { pageSize = Integer.parseInt(String.valueOf(taggedValue)); } catch (Exception e) { pageSize = JSFProfile.TAGGEDVALUE_TABLE_MAXROWS_DEFAULT_COUNT; } return pageSize; } /** * @see org.andromda.cartridges.jsf2.metafacades.JSFManageableEntity#getControllerFullyQualifiedName() */ protected java.lang.String handleGetControllerType(){ return this.getManageablePackageName() + this.getNamespaceProperty() + this.getControllerName(); } /** * @see org.andromda.cartridges.jsf2.metafacades.JSFManageableEntity#getControllerBeanName() */ protected java.lang.String handleGetControllerBeanName(){ return StringUtils.uncapitalize(this.getName()) + "Controller"; } protected java.lang.String handleGetControllerFullPath() { return "/" + StringUtils.replace(this.getControllerType(), this.getNamespaceProperty(), "/"); } protected java.lang.String handleGetControllerName() { return this.getName() + "Controller"; } protected java.lang.String handleGetValueObjectClassName() { return this.getName() + "ValueObject"; //TODO rever return getName() + this.getConfiguredProperty(SpringGlobals.CRUD_VALUE_OBJECT_SUFFIX); } private void addSerialUIDData(StringBuffer buffer){ for (final Iterator iterator = this.getManageableAttributes().iterator(); iterator.hasNext();) { final ModelElementFacade parameter = (ModelElementFacade)iterator.next(); buffer.append(parameter.getName()); } for (final Iterator iterator = this.getManageableAssociationEnds().iterator(); iterator.hasNext();) { final ModelElementFacade parameter = (ModelElementFacade)iterator.next(); buffer.append(parameter.getName()); } } private String calcSerialVersionUID(StringBuffer buffer){ final String signature = buffer.toString(); String serialVersionUID = String.valueOf(0L); try { MessageDigest md = MessageDigest.getInstance("SHA"); byte[] hashBytes = md.digest(signature.getBytes()); long hash = 0; for (int ctr = Math.min( hashBytes.length, 8) - 1; ctr >= 0; ctr--) { hash = (hash << 8) | (hashBytes[ctr] & 0xFF); } serialVersionUID = String.valueOf(hash); } catch (final NoSuchAlgorithmException exception) { final String message = "Error performing JSFAction.getFormSerialVersionUID"; logger.error( message, exception); } return serialVersionUID; } /** * @see org.andromda.cartridges.jsf2.metafacades.JSFAction#getFormSerialVersionUID() */ protected String handleGetFormSerialVersionUID() { final StringBuffer buffer = new StringBuffer(); buffer.append(this.getFormBeanType()); addSerialUIDData(buffer); return calcSerialVersionUID(buffer); } /** * @see org.andromda.cartridges.jsf2.metafacades.JSFAction#getFormSerialVersionUID() */ protected String handleGetActionSerialVersionUID() { final StringBuffer buffer = new StringBuffer(); buffer.append(this.getActionFullPath()); addSerialUIDData(buffer); return calcSerialVersionUID(buffer); } /** * @see org.andromda.cartridges.jsf2.metafacades.JSFAction#getPopulator() */ protected String handleGetPopulatorName() { return ObjectUtils.toString(this.getConfiguredProperty(JSFGlobals.VIEW_POPULATOR_PATTERN)).replaceAll( "\\{0\\}", StringUtilsHelper.upperCamelCaseName(this.getFormBeanClassName())); } /** * @see org.andromda.cartridges.jsf2.metafacades.JSFAction#getPopulator() */ protected String handleGetPopulatorType() { return this.getManageablePackageName() + this.getNamespaceProperty() + this.getPopulatorName(); } /** * @see org.andromda.cartridges.jsf2.metafacades.JSFAction#getPopulator() */ protected String handleGetPopulatorFullPath() { return "/" + StringUtils.replace(this.getPopulatorType(), this.getNamespaceProperty(), "/"); } /** * @see org.andromda.cartridges.jsf2.metafacades.JSFView#getFormKey() */ protected String handleGetFormKey() { final Object formKeyValue = this.findTaggedValue(JSFProfile.TAGGEDVALUE_ACTION_FORM_KEY); return formKeyValue == null ? ObjectUtils.toString(this.getConfiguredProperty(JSFGlobals.ACTION_FORM_KEY)) : String.valueOf(formKeyValue); } protected String handleGetViewName() { return this.getName().toLowerCase() + "-crud"; } protected String handleGetViewFullPath() { return '/' + this.getManageablePackagePath() + '/' + this.getViewName(); } /** * @see org.andromda.cartridges.jsf2.metafacades.JSFAction#handleGetHiddenParameters() */ protected boolean handleIsValidationRequired() { for (final Iterator iterator = this.getManageableAttributes().iterator(); iterator.hasNext();) { final JSFManageableEntityAttribute attribute = (JSFManageableEntityAttribute)iterator.next(); if (attribute.isValidationRequired()) { return true; } } return false; } protected String handleGetSearchFormBeanType() { return this.getManageablePackageName() + this.getNamespaceProperty() + this.getSearchFormBeanClassName(); } protected String handleGetSearchFormBeanClassName() { return this.getName() + "Search" + JSFGlobals.FORM_SUFFIX; } protected String handleGetSearchFormBeanFullPath() { return StringUtils.replace(this.getSearchFormBeanType(), this.getNamespaceProperty(), "/"); } protected java.lang.String handleGetSearchFormBeanName() { return "manage" + this.getName() + "Search" + JSFGlobals.FORM_SUFFIX; } protected java.util.Collection handleGetManageableSearchAttributes(){ final Collection coll=new java.util.ArrayList(); for(final java.util.Iterator it=getManageableAttributes().iterator(); it.hasNext(); ){ final JSFManageableEntityAttribute attr=(JSFManageableEntityAttribute)it.next(); if(!attr.isHidden()) coll.add(attr); } return coll; } protected java.util.Collection handleGetManageableSearchAssociationEnds(){ return getManageableAssociationEnds(); } protected boolean handleIsSearchable(Object element){ // if(element instanceof JSFManageableEntityAttribute) // return getManageableSearchAttributes().contains(element); // else // return getManageableSearchAssociationEnds().contains(element); //TODO corrigir if(element instanceof JSFManageableEntityAttribute) return !((JSFManageableEntityAttribute)element).isHidden(); else return true; } } 1.1 cartridges/andromda-jsf2/src/main/java/org/andromda/cartridges/jsf2/metafacades/JSFManageableEntityAttributeLogicImpl.java Index: JSFManageableEntityAttributeLogicImpl.java =================================================================== package org.andromda.cartridges.jsf2.metafacades; import org.andromda.cartridges.jsf2.JSFGlobals; import org.andromda.cartridges.jsf2.JSFProfile; import org.andromda.cartridges.jsf2.JSFUtils; import org.andromda.utils.StringUtilsHelper; import org.andromda.metafacades.uml.ClassifierFacade; import org.andromda.metafacades.uml.ModelElementFacade; import org.apache.commons.lang.ObjectUtils; import org.apache.commons.lang.StringUtils; /** * MetafacadeLogic implementation for org.andromda.cartridges.jsf2.metafacades.JSFManageableEntityAttribute. * * @see org.andromda.cartridges.jsf2.metafacades.JSFManageableEntityAttribute */ public class JSFManageableEntityAttributeLogicImpl extends JSFManageableEntityAttributeLogic { public JSFManageableEntityAttributeLogicImpl( Object metaObject, String context) { super(metaObject, context); } /** * @see JSFManageableEntityAttribute#getMessageKey() */ protected java.lang.String handleGetMessageKey() { String titleKey = ""; final ClassifierFacade owner = getOwner(); if (owner != null) { titleKey += owner.getName() + '.'; } return StringUtilsHelper.toResourceMessageKey(titleKey + getName()); } /** * @see JSFManageableEntityAttribute#getMessageValue() */ protected java.lang.String handleGetMessageValue() { return StringUtilsHelper.toPhrase(getName()); } private String internalGetDateFormat() { String dateFormat = null; if (this.getType() != null && this.getType().isDateType()) { final Object taggedValueObject = this.findTaggedValue(JSFProfile.TAGGEDVALUE_INPUT_FORMAT); if (taggedValueObject == null) { dateFormat = (String)this.getConfiguredProperty(JSFGlobals.PROPERTY_DEFAULT_DATEFORMAT); } else { dateFormat = taggedValueObject.toString(); } } return dateFormat; } protected java.lang.String handleGetDateFormat() { String dateFormat = this.internalGetDateFormat(); if (dateFormat != null) { final String[] tokens = dateFormat.split("[\\s]+"); int tokenIndex = 0; if (tokenIndex < tokens.length && tokens[tokenIndex].trim().equals("strict")) { tokenIndex++; } if (tokenIndex < tokens.length) { dateFormat = tokens[tokenIndex].trim(); } } return dateFormat; } protected boolean handleIsStrictDateFormat() { final String dateFormat = this.internalGetDateFormat(); return (dateFormat != null && dateFormat.trim().startsWith("strict")); } protected boolean handleIsNeedsFileUpload() { return this.getType() != null && this.getType().isBlobType(); } protected boolean handleIsHidden() { return !this.isDisplay() || JSFProfile.TAGGEDVALUE_INPUT_TYPE_HIDDEN.equals(this.getWidgetType()); } protected String handleGetWidgetType() { final Object widgetTag = findTaggedValue(JSFProfile.TAGGEDVALUE_INPUT_TYPE); return (widgetTag == null) ? JSFProfile.TAGGEDVALUE_INPUT_TYPE_TEXT : widgetTag.toString(); } protected String handleGetOnlineHelpKey() { return this.getMessageKey() + ".online.help"; } protected String handleGetOnlineHelpValue() { final String value = StringUtilsHelper.toResourceMessage(this.getDocumentation("", 64, false)); return (value == null) ? "No field documentation has been specified" : value; } /** * @see org.andromda.cartridges.jsf2.metafacades.JSFAttribute#getFormat() */ protected String handleGetFormat() { return JSFUtils.getFormat( (ModelElementFacade)this.THIS(), this.getType(), this.getDefaultDateFormat(), this.getDefaultTimeFormat()); } /** * @return the default time format pattern as defined using the configured property */ protected String handleGetDefaultTimeFormat() { return (String)this.getConfiguredProperty(JSFGlobals.PROPERTY_DEFAULT_TIMEFORMAT); } /** * @return the default date format pattern as defined using the configured property */ protected String handleGetDefaultDateFormat() { return (String)this.getConfiguredProperty(JSFGlobals.PROPERTY_DEFAULT_DATEFORMAT); } /** * @see org.andromda.cartridges.jsf2.metafacades.JSFAttribute#getDateFormatter(org.andromda.cartridges.jsf2.metafacades.JSFParameter) */ protected String handleGetDateFormatter() { final ClassifierFacade type = this.getType(); return type != null && type.isDateType() ? this.getName() + "DateFormatter" : null; } /** * @see org.andromda.cartridges.jsf2.metafacades.JSFAttribute#getTimeFormatter(org.andromda.cartridges.jsf2.metafacades.JSFParameter) */ protected String handleGetTimeFormatter() { final ClassifierFacade type = this.getType(); return type != null && type.isTimeType() ? this.getName() + "TimeFormatter" : null; } /** * @see org.andromda.cartridges.jsf2.metafacades.JSFAttribute#getBackingListName(org.andromda.metafacades.uml.ParameterFacade) */ protected String handleGetBackingListName() { final String backingListName = StringUtils.replace( ObjectUtils.toString(this.getConfiguredProperty(JSFGlobals.BACKING_LIST_PATTERN)), "{0}", this.getName()); return org.andromda.utils.StringUtilsHelper.lowerCamelCaseName(backingListName); } /** * @see org.andromda.cartridges.jsf2.metafacades.JSFParameter#getValueListName() */ protected String handleGetValueListName() { return ObjectUtils.toString(this.getConfiguredProperty(JSFGlobals.VALUE_LIST_PATTERN)).replaceAll( "\\{0\\}", this.getName()); } /** * @see org.andromda.cartridges.jsf2.metafacades.JSFParameter#getLabelListName() */ protected String handleGetLabelListName() { return ObjectUtils.toString(this.getConfiguredProperty(JSFGlobals.LABEL_LIST_PATTERN)).replaceAll( "\\{0\\}", this.getName()); } /** * @see org.andromda.cartridges.jsf2.metafacades.JSFAttribute#isValidationRequired() */ protected boolean handleIsValidationRequired() { return !this.getValidatorTypes().isEmpty(); } /** * @see org.andromda.cartridges.jsf2.metafacades.JSFAttribute#getValidatorTypes() */ protected java.util.Collection handleGetValidatorTypes() { return JSFUtils.getValidatorTypes( (ModelElementFacade)this.THIS(), this.getType()); } /** * @see org.andromda.cartridges.jsf2.metafacades.JSFParameter#getValidatorVars() */ protected java.util.Collection handleGetValidatorVars() { return JSFUtils.getValidatorVars( ((ModelElementFacade)this.THIS()), this.getType()); } /** * @see org.andromda.cartridges.jsf2.metafacades.JSFAttribute#getValidWhen() */ protected java.lang.String handleGetValidWhen() { return JSFUtils.getValidWhen(this); } /** * @see org.andromda.cartridges.jsf2.metafacades.JSFAttribute#getValidatorArgs(java.lang.String) */ protected java.util.Collection handleGetValidatorArgs(final String validatorType) { return JSFUtils.getValidatorArgs( (ModelElementFacade)this.THIS(), validatorType); } /** * @see org.andromda.cartridges.jsf2.metafacades.JSFAttribute#isInputTextarea() */ protected boolean handleIsInputTextarea() { return this.isInputType(JSFGlobals.INPUT_TEXTAREA); } /** * @see org.andromda.cartridges.jsf2.metafacades.JSFAttribute#isInputSelect() */ protected boolean handleIsInputSelect() { return this.isInputType(JSFGlobals.INPUT_SELECT); } /** * @see org.andromda.cartridges.jsf2.metafacades.JSFAttribute#isInputSecret() */ protected boolean handleIsInputSecret() { return this.isInputType(JSFGlobals.INPUT_PASSWORD); } /** * @see org.andromda.cartridges.jsf2.metafacades.JSFAttribute#isInputHidden() */ protected boolean handleIsInputHidden() { return this.isInputType(JSFGlobals.INPUT_HIDDEN); } /** * @see org.andromda.cartridges.jsf2.metafacades.JSFAttribute#isPlaintext() */ protected boolean handleIsPlaintext() { return this.isInputType(JSFGlobals.PLAIN_TEXT); } /** * @see org.andromda.cartridges.jsf2.metafacades.JSFAttribute#isInputRadio() */ protected boolean handleIsInputRadio() { return this.isInputType(JSFGlobals.INPUT_RADIO); } /** * @see org.andromda.cartridges.jsf2.metafacades.JSFAttribute#isInputText() */ protected boolean handleIsInputText() { return this.isInputType(JSFGlobals.INPUT_TEXT); } /** * @see org.andromda.cartridges.jsf2.metafacades.JSFAttribute#isInputMultibox() */ protected boolean handleIsInputMultibox() { return this.isInputType(JSFGlobals.INPUT_MULTIBOX); } /** * @see org.andromda.cartridges.jsf2.metafacades.JSFAttribute#isInputTable() */ protected boolean handleIsInputTable() { return this.getInputTableIdentifierColumns().length() > 0 || this.isInputType(JSFGlobals.INPUT_TABLE); } /** * @see org.andromda.cartridges.jsf2.metafacades.JSFAttribute#isInputCheckbox() */ protected boolean handleIsInputCheckbox() { boolean checkbox = this.isInputType(JSFGlobals.INPUT_CHECKBOX); if (!checkbox && this.getInputType().length() == 0) { final ClassifierFacade type = this.getType(); checkbox = type != null ? type.isBooleanType() : false; } return checkbox; } /** * Gets the current value of the specified input type (or an empty string * if one isn't specified). * * @return the input type name. */ private final String getInputType() { return ObjectUtils.toString(this.findTaggedValue(JSFProfile.TAGGEDVALUE_INPUT_TYPE)).trim(); } /** * Indicates whether or not this parameter is of the given input type. * * @param inputType the name of the input type to check for. * @return true/false */ private final boolean isInputType(final String inputType) { return inputType.equalsIgnoreCase(this.getInputType()); } /** * @see org.andromda.cartridges.jsf2.metafacades.JSFAttribute#isInputFile() */ protected boolean handleIsInputFile() { boolean file = false; ClassifierFacade type = getType(); if (type != null) { file = type.isFileType() || type.isBlobType(); } return file; } /** * Overridden to provide consistent behavior with {@link JSFParameter#isReadOnly()}. * * @see org.andromda.metafacades.uml.AttributeFacade#isReadOnly() */ public boolean isReadOnly() { return JSFUtils.isReadOnly(this); } /** * @see org.andromda.cartridges.jsf2.metafacades.JSFAttribute#getValueListDummyValue() */ protected String handleGetValueListDummyValue() { return this.constructDummyArray(); } /** * @see org.andromda.cartridges.jsf2.metafacades.JSFAttribute#isEqualValidator() */ protected boolean handleIsEqualValidator() { final String equal = JSFUtils.getEqual((ModelElementFacade)this.THIS()); return equal != null && equal.trim().length() > 0; } /** * @see org.andromda.cartridges.jsf2.metafacades.JSFAttribute#isInputTypePresent() */ protected boolean handleIsInputTypePresent() { boolean present = false; final ClassifierFacade type = this.getType(); if (type != null) { present = (StringUtils.isNotBlank(this.getInputType()) || type.isDateType() || type.isBooleanType()) && !this.isPlaintext(); } return present; } /** * @see org.andromda.cartridges.jsf2.metafacades.JSFAttributer#getInputTableIdentifierColumns() */ protected String handleGetInputTableIdentifierColumns() { return ObjectUtils.toString(this.findTaggedValue(JSFProfile.TAGGEDVALUE_INPUT_TABLE_IDENTIFIER_COLUMNS)).trim(); } /** * @see org.andromda.cartridges.jsf2.metafacades.JSFAttribute#getDummyValue() */ protected String handleGetDummyValue() { final ClassifierFacade type = this.getType(); if (type != null) { final String typeName = type.getFullyQualifiedName(); final String name = this.getName(); if ("java.lang.String".equals(typeName)) { return "\"" + name + "-test" + "\""; } if ("java.util.Date".equals(typeName)) { return "new java.util.Date()"; } if ("java.sql.Date".equals(typeName)) { return "new java.sql.Date(new java.util.Date().getTime())"; } if ("java.sql.Timestamp".equals(typeName)) { return "new java.sql.Timestamp(new Date().getTime())"; } if ("java.util.Calendar".equals(typeName)) { return "java.util.Calendar.getInstance()"; } if ("int".equals(typeName)) { return "(int)" + name.hashCode(); } if ("boolean".equals(typeName)) { return "false"; } if ("long".equals(typeName)) { return "(long)" + name.hashCode(); } if ("char".equals(typeName)) { return "(char)" + name.hashCode(); } if ("float".equals(typeName)) { return "(float)" + name.hashCode() / hashCode(); } if ("double".equals(typeName)) { return "(double)" + name.hashCode() / hashCode(); } if ("short".equals(typeName)) { return "(short)" + name.hashCode(); } if ("byte".equals(typeName)) { return "(byte)" + name.hashCode(); } if ("java.lang.Integer".equals(typeName)) { return "new Integer((int)" + name.hashCode() + ")"; } if ("java.lang.Boolean".equals(typeName)) { return "Boolean.FALSE"; } if ("java.lang.Long".equals(typeName)) { return "new Long((long)" + name.hashCode() + ")"; } if ("java.lang.Character".equals(typeName)) { return "new Character(char)" + name.hashCode() + ")"; } if ("java.lang.Float".equals(typeName)) { return "new Float((float)" + name.hashCode() / hashCode() + ")"; } if ("java.lang.Double".equals(typeName)) { return "new Double((double)" + name.hashCode() / hashCode() + ")"; } if ("java.lang.Short".equals(typeName)) { return "new Short((short)" + name.hashCode() + ")"; } if ("java.lang.Byte".equals(typeName)) { return "new Byte((byte)" + name.hashCode() + ")"; } //if (type.isArrayType()) return constructDummyArray(); if (type.isSetType()) { return "new java.util.HashSet(java.util.Arrays.asList(" + constructDummyArray() + "))"; } if (type.isCollectionType()) { return "java.util.Arrays.asList(" + constructDummyArray() + ")"; } // maps and others types will simply not be treated } return "null"; } /** * Constructs a string representing an array initialization in Java. * * @return A String representing Java code for the initialization of an array. */ private final String constructDummyArray() { return JSFUtils.constructDummyArrayDeclaration( this.getName(), JSFGlobals.DUMMY_ARRAY_COUNT); } } 1.2 +180 -153 cartridges/andromda-jsf2/src/main/uml/JSFMetafacadeModel.xml.zip <<Binary file>> 1.2 +28 -1 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/configuration/validation.xml.vsl Index: validation.xml.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/configuration/validation.xml.vsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- validation.xml.vsl 5 Dec 2006 19:39:00 -0000 1.1 +++ validation.xml.vsl 11 Dec 2006 13:43:57 -0000 1.2 @@ -3,7 +3,13 @@ ## ## START TEMPLATE ## -#if ($applicationUseCase.applicationValidationRequired) +#set($manageableValidationRequired = false) +#foreach($manageable in $manageables) +#if($manageable.validationRequired) +#set($manageableValidationRequired = true) +#end +#end +#if ($applicationUseCase.applicationValidationRequired || $manageableValidationRequired) <?xml version="1.0" encoding="$xmlEncoding" ?> <!DOCTYPE form-validation PUBLIC @@ -13,6 +19,7 @@ <form-validation> <formset> +#if ($applicationUseCase.applicationValidationRequired) #foreach ($useCase in $useCases) #foreach ($action in $useCase.actions) #if ($action.validationRequired) @@ -40,6 +47,26 @@ #end #end #end +#end +#if($manageableValidationRequired) +<!-- crud forms --> +#foreach ($manageable in $manageables) +#if ($manageable.validationRequired) + <form name="$manageable.formBeanName"> +#foreach ($field in $manageable.manageableAttributes) +#if ($field.validationRequired) +#renderManageableField($field) +###foreach ($column in $field.tableColumns) +###if ($column.validationRequired) +###renderField($column $field) +###end +###end +#end +#end + </form> +#end +#end +#end </formset> </form-validation> 1.2 +32 -0 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/configuration/validation.xml.vm Index: validation.xml.vm =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/configuration/validation.xml.vm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- validation.xml.vm 5 Dec 2006 19:39:00 -0000 1.1 +++ validation.xml.vm 11 Dec 2006 13:43:57 -0000 1.2 @@ -34,3 +34,35 @@ #end </field> #end \ No newline at end of file +## +## This macro renders the <field/> elements of manageable forms +## +#macro (renderManageableField $field) +#set ($fieldName = $field.name) +#set ($validatorTypes = $field.validatorTypes) + <field property="$fieldName" depends="$stringUtils.join($validatorTypes.iterator(),",")"> + <arg position="0" key="$field.messageKey" /> +#if ($field.validWhen) + <msg name="validwhen" key="${field.messageKey}_validwhen" /> +#end +#foreach ($validatorType in $validatorTypes) +#foreach ($validatorArg in $field.getValidatorArgs($validatorType)) +#if ($validatorArg.type) + <arg position="$velocityCount" name="$validatorType" key="$validatorArg.messageKey" resource="true"/> +#else + <arg position="$velocityCount" name="$validatorType" key="$validatorArg" resource="false"/> +#end +#end +#end +#foreach ($validatorVar in $field.validatorVars) +#set ($varValue = $validatorVar.get(1)) +#if ($field.equalValidator) +#set ($varValue = "${manageable.formBeanName}:${varValue}") +#end + <var> + <var-name>$validatorVar.get(0)</var-name> + <var-value><![CDATA[$varValue]]></var-value> + </var> +#end + </field> +#end \ No newline at end of file 1.2 +66 -1 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/configuration/faces-config.xml.vsl Index: faces-config.xml.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/configuration/faces-config.xml.vsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- faces-config.xml.vsl 5 Dec 2006 19:39:00 -0000 1.1 +++ faces-config.xml.vsl 11 Dec 2006 13:43:57 -0000 1.2 @@ -31,6 +31,16 @@ #end #end #end + <!-- crud forms --> +#foreach ($manageable in $manageables) +#if (!$action.formFields.empty) + <managed-bean> + <managed-bean-name>${manageable.formBeanName}</managed-bean-name> + <managed-bean-class>${manageable.formBeanType}</managed-bean-class> + <managed-bean-scope>request</managed-bean-scope> + </managed-bean> +#end +#end <!-- controllers --> #foreach ($controller in $controllers) <managed-bean> @@ -40,6 +50,16 @@ </managed-bean> #end + <!-- crud controllers --> + +#foreach ($manageable in $manageables) + <managed-bean> + <managed-bean-name>$manageable.controllerBeanName</managed-bean-name> + <managed-bean-class>$manageable.controllerType</managed-bean-class> + <managed-bean-scope>application</managed-bean-scope> + </managed-bean> +#end + <!-- menuModel nodes --> #foreach ($useCase in $useCases) @@ -49,7 +69,7 @@ <managed-bean-scope>application</managed-bean-scope> <managed-property> <property-name>label</property-name> - <value>$useCase.titleValue</value> + <value>$useCase.titleKey</value> </managed-property> <managed-property> <property-name>viewId</property-name> @@ -82,6 +102,35 @@ </managed-bean> #end +#foreach ($manageable in $manageables) + <managed-bean> + <managed-bean-name>navItem_$manageable.actionClassName</managed-bean-name> + <managed-bean-class>${managedBeansPackage}.NavigationItem</managed-bean-class> + <managed-bean-scope>application</managed-bean-scope> + <managed-property> + <property-name>label</property-name> + <value>$manageable.viewTitleKey</value> + </managed-property> + <managed-property> + <property-name>viewId</property-name> + <value>${manageable.viewFullPath}.${jsfUtils.viewExtension}</value> + </managed-property> + <managed-property> + <property-name>controllerBean</property-name> + <value>#{${manageable.controllerBeanName}}</value> + </managed-property> + <managed-property> + <property-name>controllerAction</property-name> + <value>init</value> + </managed-property> + <managed-property> + <property-name>outcome</property-name> + <value>${manageable.viewFullPath}</value> + </managed-property> + </managed-bean> + +#end + <!-- setup the (root of the) treemodel --> <managed-bean> @@ -98,6 +147,9 @@ <value>#{navItem_$stringUtils.replace($useCase.forwardName, '-', '_')}</value> #end #end +#foreach ($manageable in $manageables) + <value>#{navItem_$manageable.actionClassName}</value> +#end </list-entries> </managed-bean> @@ -150,6 +202,10 @@ <value>${useCase.path}.${jsfUtils.viewExtension}</value> #end #end +#foreach($manageable in $manageables) + <value>${manageable.viewFullPath}.${jsfUtils.viewExtension}</value> + <value>${manageable.actionFullPath}.${jsfUtils.viewExtension}</value> +#end </list-entries> </managed-property> </managed-bean> @@ -176,6 +232,15 @@ </navigation-rule> #end #end +#foreach ($manageable in $manageables) + <navigation-rule> + <navigation-case> + <from-outcome>${manageable.viewFullPath}</from-outcome> + <to-view-id>${manageable.viewFullPath}.${jsfUtils.viewExtension}</to-view-id> + <redirect/> + </navigation-case> + </navigation-rule> +#end #if ($enablePreferences) <navigation-rule> 1.2 +85 -10 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/configuration/web.xml.vsl Index: web.xml.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/configuration/web.xml.vsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- web.xml.vsl 5 Dec 2006 19:39:00 -0000 1.1 +++ web.xml.vsl 11 Dec 2006 13:43:57 -0000 1.2 @@ -9,6 +9,16 @@ <distributable/> #end + <context-param> + <!-- Maximum memory per request (in bytes) --> + <param-name>org.apache.myfaces.trinidad.UPLOAD_MAX_MEMORY</param-name> + <param-value>$fileUploadMaxMemoryPerRequest</param-value> + </context-param> + <context-param> + <!-- Maximum disk space per request (in bytes) --> + <param-name>org.apache.myfaces.trinidad.UPLOAD_MAX_DISK_SPACE</param-name> + <param-value>$fileUploadMaxDiskSpacePerRequest</param-value> + </context-param> #if ($viewTypeIsFacelets) <context-param> <param-name>javax.faces.DEFAULT_SUFFIX</param-name> @@ -28,18 +38,18 @@ </param-value> </context-param> - <!-- ADF Faces has its own ViewHandler, which is a "decorating" + <!-- Trinidad has its own ViewHandler, which is a "decorating" view handler - for example, it needs to wrap methods like renderView() to perform some extra pre- and post-handling. Facelets, on the other hand, is more of a true ViewHandler - it actually implements renderView() (yeah, it decorates too, but forget about that for a second). As a result, the world is a better place if - the ADF Faces ViewHandler runs around the Facelets ViewHandler. + the Trinidad ViewHandler runs around the Facelets ViewHandler. But since Facelets is registered in WEB-INF/faces-config.xml, - and ADF's is registered from META-INF/faces-config.xml in its + and Trinidad's is registered from META-INF/faces-config.xml in its JAR, exactly the opposite happens as per the JSF spec. - Hence, the following config parameter, which ADF Faces + Hence, the following config parameter, which Trinidad exposes (as of EA19) to allow pushing a ViewHandler inside of ours. FWIW, you retain the entire delegation stack - just flipped around a bit - so that Facelets still decorates @@ -82,7 +92,7 @@ <context-param> <description> State saving method: "client" or "server" (= default) - See JSF Specification 2.5.2. In ADF Faces, it is an + See JSF Specification 2.5.2. In Trinidad, it is an optimized, token-based mechanism that is almost always a better choice than the standard JSF server-side state saving. </description> @@ -149,11 +159,7 @@ <!-- Extensions Filter --> <filter> <filter-name>MyFaces Extensions Filter</filter-name> -#if ($outputLibraries) - <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class> -#else <filter-class>org.apache.myfaces.component.html.util.ExtensionsFilter</filter-class> -#end ... [truncated message content] |