From: Chad B. <cwb...@us...> - 2005-06-01 21:25:34
|
User: cwbrandon Date: 05/06/01 14:25:28 Modified: andromda-bpm4struts/src/test/expected cartridge-output.zip andromda-bpm4struts/src/templates/bpm4struts/pages page.jsp.vsl andromda-bpm4struts/src/META-INF andromda-cartridge.xml Added: andromda-bpm4struts/src/templates/bpm4struts/pages page-javascript.jspf.vsl Log: extrac out the javascript tile into its own include (so we don't have to worry about it when editing a page) Revision Changes Path 1.256 +1452 -1367cartridges/andromda-bpm4struts/src/test/expected/cartridge-output.zip <<Binary file>> 1.23 +1 -53 cartridges/andromda-bpm4struts/src/templates/bpm4struts/pages/page.jsp.vsl Index: page.jsp.vsl =================================================================== RCS file: /cvsroot/andromda/cartridges/andromda-bpm4struts/src/templates/bpm4struts/pages/page.jsp.vsl,v retrieving revision 1.22 retrieving revision 1.23 diff -u -w -r1.22 -r1.23 --- page.jsp.vsl 18 May 2005 16:20:49 -0000 1.22 +++ page.jsp.vsl 1 Jun 2005 21:25:27 -0000 1.23 @@ -1,10 +1,6 @@ #parse("templates/bpm4struts/pages/page.jsp.vm") #set ($generatedFile = "${jsp.fullPath}.jsp") ## -## CONSTANTS -## -#set ($hints = $hints == "true") -## ## START TEMPLATE ## #set ($hasTable = false) @@ -46,55 +42,7 @@ #end </tiles:put> -## -## SETS THE JAVASCRIPT CONTENT -## - <tiles:put name="javascript" type="string"> -## only load the calendar javascript when actually needed -#if ($jsp.calendarRequired) - <script type="text/javascript" src="<html:rewrite page="/layout/calendar-js.jsp"/>"></script> -#end -## only load the static javascript when it will actually be used -#set ($validationDesired = ($clientValidation=='true')) -#if ($jsp.validationRequired && $validationDesired) - <script type="text/javascript" language="Javascript1.1" src="<html:rewrite page="/form-validation.jsp"/>"></script> -#foreach ($action in $jsp.actions) -#if ($action.validationRequired) - <html:javascript formName="$action.formBeanName" method="$action.formValidationMethodName" dynamicJavascript="true" staticJavascript="false"#if($xhtml=="true") cdata="true"#else htmlComment="true" cdata="false"#end/> -#end -#end -#end -#if ($hints) - <script type="text/javascript" language="Javascript1.1" src="<html:rewrite page="/layout/hints.js"/>"></script> - <script type="text/javascript" language="Javascript1.1"> -#if ($xhtml == "true") - //<![CDATA[ -#else - //<!-- -#end - var HINTS_ITEMS = { -#foreach ($parameter in $jsp.allActionParameters) - '$parameter.titleKey':'<formatting:escape language="javascript"><bean:message key="$parameter.titleKey"/></formatting:escape>', -#end -#foreach ($action in $jsp.actions) -#set ($trigger = $action.actionTrigger) - '${trigger.name}':'<formatting:escape language="javascript"><bean:message key="$trigger.titleKey"/></formatting:escape>', - '${trigger.name}_no':'<formatting:escape language="javascript"><bean:message key="$trigger.notAllowedTitleKey"/></formatting:escape>', - '${trigger.name}_reset':'<formatting:escape language="javascript"><bean:message key="$trigger.resetTitleKey"/></formatting:escape>', - '${trigger.name}_noreset':'<formatting:escape language="javascript"><bean:message key="$trigger.resetNotAllowedTitleKey"/></formatting:escape>', -#end - 'calendar.popup':'<formatting:escape language="javascript"><bean:message key="calendar.popup"/></formatting:escape>' - }; - - var hints = new THints (HINTS_CFG, HINTS_ITEMS); -#if ($xhtml == "true") - //]]> -#else - //--> -#end - </script> -#end - </tiles:put> + <%@ include file="${jsp.fullPath}-javascript.jspf" %> ## ## SETS THE BODY OF THIS PAGE 1.1 cartridges/andromda-bpm4struts/src/templates/bpm4struts/pages/page-javascript.jspf.vsl Index: page-javascript.jspf.vsl =================================================================== #parse("templates/bpm4struts/pages/page.jsp.vm") #set ($generatedFile = "${jsp.fullPath}-javascript.jspf") ## ## CONSTANTS ## #set ($hints = $hints == "true") ## ## SETS THE JAVASCRIPT CONTENT ## <tiles:put name="javascript" type="string"> ## only load the calendar javascript when actually needed #if ($jsp.calendarRequired) <script type="text/javascript" src="<html:rewrite page="/layout/calendar-js.jsp"/>"></script> #end ## only load the static javascript when it will actually be used #set ($validationDesired = ($clientValidation=='true')) #if ($jsp.validationRequired && $validationDesired) <script type="text/javascript" language="Javascript1.1" src="<html:rewrite page="/form-validation.jsp"/>"></script> #foreach ($action in $jsp.actions) #if ($action.validationRequired) <html:javascript formName="$action.formBeanName" method="$action.formValidationMethodName" dynamicJavascript="true" staticJavascript="false"#if($xhtml=="true") cdata="true"#else htmlComment="true" cdata="false"#end/> #end #end #end #if ($hints) <script type="text/javascript" language="Javascript1.1" src="<html:rewrite page="/layout/hints.js"/>"></script> <script type="text/javascript" language="Javascript1.1"> #if ($xhtml == "true") //<![CDATA[ #else //<!-- #end var HINTS_ITEMS = { #foreach ($parameter in $jsp.allActionParameters) '$parameter.titleKey':'<formatting:escape language="javascript"><bean:message key="$parameter.titleKey"/></formatting:escape>', #end #foreach ($action in $jsp.actions) #set ($trigger = $action.actionTrigger) '${trigger.name}':'<formatting:escape language="javascript"><bean:message key="$trigger.titleKey"/></formatting:escape>', '${trigger.name}_no':'<formatting:escape language="javascript"><bean:message key="$trigger.notAllowedTitleKey"/></formatting:escape>', '${trigger.name}_reset':'<formatting:escape language="javascript"><bean:message key="$trigger.resetTitleKey"/></formatting:escape>', '${trigger.name}_noreset':'<formatting:escape language="javascript"><bean:message key="$trigger.resetNotAllowedTitleKey"/></formatting:escape>', #end 'calendar.popup':'<formatting:escape language="javascript"><bean:message key="calendar.popup"/></formatting:escape>' }; var hints = new THints (HINTS_CFG, HINTS_ITEMS); #if ($xhtml == "true") //]]> #else //--> #end </script> #end </tiles:put> 1.114 +12 -0 cartridges/andromda-bpm4struts/src/META-INF/andromda-cartridge.xml Index: andromda-cartridge.xml =================================================================== RCS file: /cvsroot/andromda/cartridges/andromda-bpm4struts/src/META-INF/andromda-cartridge.xml,v retrieving revision 1.113 retrieving revision 1.114 diff -u -w -r1.113 -r1.114 --- andromda-cartridge.xml 12 May 2005 16:33:44 -0000 1.113 +++ andromda-cartridge.xml 1 Jun 2005 21:25:28 -0000 1.114 @@ -201,6 +201,18 @@ </template> <template + path="templates/bpm4struts/pages/page-javascript.jspf.vsl" + outputPattern="$generatedFile" + outlet="pages" + overwrite="true"> + <modelElements variable="jsp"> + <modelElement> + <type name="org.andromda.cartridges.bpm4struts.metafacades.StrutsJsp"/> + </modelElement> + </modelElements> + </template> + + <template path="templates/bpm4struts/pages/page-variables.jspf.vsl" outputPattern="$generatedFile" outlet="pages" |
From: Wouter Z. <dra...@us...> - 2005-06-14 14:28:32
|
User: draftdog Date: 05/06/14 07:28:26 Modified: andromda-bpm4struts/src/templates/bpm4struts/pages page-variables.jspf.vsl page.jsp.vsl andromda-bpm4struts/src/META-INF andromda-cartridge.xml Log: BPM-201: page variables and tables now have their own jsp fragment Revision Changes Path 1.4 +13 -7 cartridges/andromda-bpm4struts/src/templates/bpm4struts/pages/page-variables.jspf.vsl Index: page-variables.jspf.vsl =================================================================== RCS file: /cvsroot/andromda/cartridges/andromda-bpm4struts/src/templates/bpm4struts/pages/page-variables.jspf.vsl,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -r1.3 -r1.4 --- page-variables.jspf.vsl 18 Apr 2005 21:13:38 -0000 1.3 +++ page-variables.jspf.vsl 14 Jun 2005 14:28:26 -0000 1.4 @@ -1,10 +1,16 @@ #set ($generatedFile = "${jsp.fullPath}-vars.jspf") +#if ($jsp.pageVariables.size() > 0) +<div id="pageVariables"> #foreach ($variable in $jsp.pageVariables) -#set ($variableName = $variable.name) -#set ($formVariableName = "${formName}.${variableName}") -## Surround with catch so that if the property doesn't exist -## on the form no exceptions will be thrown (since we don't want that) +#set ($formVariableName = "${formName}.${variable.name}") <c:catch> - <c:set var="$variableName" value="${${formVariableName}}" scope="request"/> +#if ($setPageVariablesInPageScope=="true") + <c:set var="$variable.name" value="${${formVariableName}}"/> +#end +#if (!$variable.table) + <c:out value="${${formVariableName}}"/> +#end </c:catch> #end \ No newline at end of file +</div> +#end \ No newline at end of file 1.24 +4 -72 cartridges/andromda-bpm4struts/src/templates/bpm4struts/pages/page.jsp.vsl Index: page.jsp.vsl =================================================================== RCS file: /cvsroot/andromda/cartridges/andromda-bpm4struts/src/templates/bpm4struts/pages/page.jsp.vsl,v retrieving revision 1.23 retrieving revision 1.24 diff -u -w -r1.23 -r1.24 --- page.jsp.vsl 1 Jun 2005 21:25:27 -0000 1.23 +++ page.jsp.vsl 14 Jun 2005 14:28:26 -0000 1.24 @@ -5,14 +5,11 @@ ## #set ($hasTable = false) <%@ include file="/taglib-imports.jspf" %> -#if (!$jsp.pageVariables.empty) -<%@ include file="${jsp.fullPath}-vars.jspf" %> #foreach ($variable in $jsp.pageVariables) #if ($variable.table) #set ($hasTable = true) #end #end -#end #if ($maxBreadCrumbs != "0") <breadcrumbs:resize size="$maxBreadCrumbs"/> @@ -59,81 +56,16 @@ </div> #if ($jsp.pageVariables.size() > 0) - <div id="pageVariables"> -#foreach ($variable in $jsp.pageVariables) -#if (!$variable.table) - <c:choose> - <c:when test="${!empty ${formName}.${variable.name}}"> - <bean:write name="$formName" property="$variable.name"/> - </c:when> - <c:otherwise> - Missing from request : ${variable.name} <br/> - </c:otherwise> - </c:choose> -#end -#end - </div> -#end + <%@ include file="${jsp.fullPath}-vars.jspf" %> +#end #foreach ($action in $jsp.nonTableActions) <tiles:insert page="${action.fullTilePath}.jsp" flush="false"/> -#end +#end #foreach ($variable in $jsp.pageVariables) #if ($variable.table) -#set ($targetColumns = $variable.targettedTableColumnNames) -#set ($sortable = $variable.tableSortable) -#set ($exportable = $variable.tableExportable) - <div id="${variable.name}" class="table"> - <display:table name="${${variable.name}}" id="row" - requestURI="${pageContext.request.requestURI}" -#if ($variable.tableDecoratorRequired) - decorator="${variable.tableDecoratorFullyQualifiedName}" -#end - export="$exportable" pagesize="$variable.tableMaxRows" sort="list"> -#if ($exportable) -#set ($exportFileName = "${jsp.name}-${variable.name}") -#set ($exportFileName = "$stringUtils.toWebFileName($exportFileName)") - <display:setProperty name="export.pdf.filename" value="${exportFileName}.pdf" /> -#end -#foreach ($column in $variable.tableColumns) -#if($column.actionParameter)#set($columnName=$column.name)#else#set($columnName=$column)#end -#if ($exportable) - <display:column media="$variable.tableExportTypes" - titleKey="$variable.getTableColumnMessageKey($columnName)" - property="$columnName" autolink="true" paramId="$columnName" /> -#end - <display:column media="html" - headerClass="$columnName" paramId="$columnName" -#if (!$variable.tableDecoratorRequired && $variable.tableSortable && (!$column.actionParameter || $column.sortableBy)) - sortProperty="$columnName" sortable="true" -#end - titleKey="$variable.getTableColumnMessageKey($columnName)"> -#if ($column.actionParameter) - <div class="$columnName"> -#renderFormField($column.action $column " " '${row_rowNum}') - </div> -#else## just render as text since the column is in fact a simple String -#set ($columnValue = "row.$columnName") - <div class="$columnName">${${columnValue}}</div> -#end - </display:column> -#end -#foreach ($tableAction in $variable.tableHyperlinkActions) -#if (!$tableAction.tableLinkColumnName) - <display:column media="html"> -#renderTableHyperlink($tableAction " ") - </display:column> -#end -#end -#foreach ($tableAction in $variable.tableFormActions) - <display:column media="html"> -#renderTableButton($tableAction " " '${row_rowNum}') - </display:column> -#end - </display:table> - </div> - + <%@ include file="${jsp.fullPath}-${variable.name}.jspf" %> #end #end 1.115 +18 -1 cartridges/andromda-bpm4struts/src/META-INF/andromda-cartridge.xml Index: andromda-cartridge.xml =================================================================== RCS file: /cvsroot/andromda/cartridges/andromda-bpm4struts/src/META-INF/andromda-cartridge.xml,v retrieving revision 1.114 retrieving revision 1.115 diff -u -w -r1.114 -r1.115 --- andromda-cartridge.xml 1 Jun 2005 21:25:28 -0000 1.114 +++ andromda-cartridge.xml 14 Jun 2005 14:28:26 -0000 1.115 @@ -37,6 +37,8 @@ <!-- the name of the form passed along with the application flow (normally stored within the session) --> <property reference="formName" default="form"/> + <!-- whether or not form page variables are copied into page scope --> + <property reference="setPageVariablesInPageScope" default="true"/> <!-- the name of the form passed along with the application flow (normally stored within the session), only used for manageable entities --> <property reference="manageableFormName" default="manageableForm"/> @@ -216,7 +218,8 @@ path="templates/bpm4struts/pages/page-variables.jspf.vsl" outputPattern="$generatedFile" outlet="pages" - overwrite="true"> + overwrite="true" + generateEmptyFiles="false"> <modelElements variable="jsp"> <modelElement> <type name="org.andromda.cartridges.bpm4struts.metafacades.StrutsJsp"/> @@ -225,6 +228,20 @@ </template> <template + path="templates/bpm4struts/pages/page-table.jspf.vsl" + outputPattern="$generatedFile" + outlet="pages" + overwrite="true"> + <modelElements variable="table"> + <modelElement> + <type name="org.andromda.cartridges.bpm4struts.metafacades.StrutsParameter"> + <property name="table"/> + </type> + </modelElement> + </modelElements> + </template> + + <template path="templates/bpm4struts/pages/form-validation.jsp.vsl" outputPattern="form-validation.jsp" outlet="pages" |
From: Chad B. <cwb...@us...> - 2005-06-20 23:20:07
|
User: cwbrandon Date: 05/06/20 16:20:01 Modified: andromda-bpm4struts/src/test/expected cartridge-output.zip andromda-bpm4struts/src/java/org/andromda/cartridges/bpm4struts/metafacades StrutsActionLogicImpl.java StrutsParameterLogicImpl.java andromda-bpm4struts/src/uml BPM4StrutsMetafacadeModel.xml.zip andromda-bpm4struts/src/templates/bpm4struts/pages action.jsp.vsl andromda-bpm4struts/src/META-INF andromda-cartridge.xml Added: andromda-bpm4struts/src/templates/bpm4struts/pages page-hidden-parameters.jspf.vsl Log: move hidden parameters into their own JSPF Revision Changes Path 1.268 +543 -542 cartridges/andromda-bpm4struts/src/test/expected/cartridge-output.zip <<Binary file>> 1.74 +19 -0 cartridges/andromda-bpm4struts/src/java/org/andromda/cartridges/bpm4struts/metafacades/StrutsActionLogicImpl.java Index: StrutsActionLogicImpl.java =================================================================== RCS file: /cvsroot/andromda/cartridges/andromda-bpm4struts/src/java/org/andromda/cartridges/bpm4struts/metafacades/StrutsActionLogicImpl.java,v retrieving revision 1.73 retrieving revision 1.74 diff -u -w -r1.73 -r1.74 --- StrutsActionLogicImpl.java 14 Jun 2005 22:25:00 -0000 1.73 +++ StrutsActionLogicImpl.java 20 Jun 2005 23:19:50 -0000 1.74 @@ -20,6 +20,8 @@ import org.andromda.metafacades.uml.PseudostateFacade; import org.andromda.metafacades.uml.StateVertexFacade; import org.andromda.metafacades.uml.TransitionFacade; +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections.Predicate; import org.apache.commons.lang.ObjectUtils; import org.apache.commons.lang.StringUtils; @@ -933,4 +935,21 @@ { return this.getFormScope().equalsIgnoreCase(FORM_SCOPE_NONE); } + + /** + * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsActionLogic#handleGetHiddenActionParameters() + */ + protected List handleGetHiddenActionParameters() + { + final List hiddenActionParameters = new ArrayList(this.getActionParameters()); + CollectionUtils.filter(hiddenActionParameters, + new Predicate() + { + public boolean evaluate(final Object object) + { + return StrutsParameterLogicImpl.HIDDEN_INPUT_TYPE.equals(((StrutsParameter)object).getWidgetType()); + } + }); + return hiddenActionParameters; + } } 1.115 +6 -1 cartridges/andromda-bpm4struts/src/java/org/andromda/cartridges/bpm4struts/metafacades/StrutsParameterLogicImpl.java Index: StrutsParameterLogicImpl.java =================================================================== RCS file: /cvsroot/andromda/cartridges/andromda-bpm4struts/src/java/org/andromda/cartridges/bpm4struts/metafacades/StrutsParameterLogicImpl.java,v retrieving revision 1.114 retrieving revision 1.115 diff -u -w -r1.114 -r1.115 --- StrutsParameterLogicImpl.java 15 Jun 2005 16:34:22 -0000 1.114 +++ StrutsParameterLogicImpl.java 20 Jun 2005 23:19:50 -0000 1.115 @@ -953,7 +953,7 @@ } else if (Bpm4StrutsProfile.TAGGEDVALUE_INPUT_TYPE_HIDDEN.equalsIgnoreCase(fieldType)) { - widgetType = "hidden"; + widgetType = HIDDEN_INPUT_TYPE; } else if (fieldType.toLowerCase().startsWith(Bpm4StrutsProfile.TAGGEDVALUE_INPUT_TYPE_RADIO)) { @@ -997,6 +997,11 @@ return widgetType; } + /** + * The input type representing a 'hidden' parameter. + */ + static final String HIDDEN_INPUT_TYPE = "hidden"; + protected boolean handleIsFile() { boolean file = false; 1.149 +243 -262 cartridges/andromda-bpm4struts/src/uml/BPM4StrutsMetafacadeModel.xml.zip <<Binary file>> 1.5 +2 -5 cartridges/andromda-bpm4struts/src/templates/bpm4struts/pages/action.jsp.vsl Index: action.jsp.vsl =================================================================== RCS file: /cvsroot/andromda/cartridges/andromda-bpm4struts/src/templates/bpm4struts/pages/action.jsp.vsl,v retrieving revision 1.4 retrieving revision 1.5 diff -u -w -r1.4 -r1.5 --- action.jsp.vsl 10 May 2005 19:39:13 -0000 1.4 +++ action.jsp.vsl 20 Jun 2005 23:20:00 -0000 1.5 @@ -31,11 +31,8 @@ #set ($onsubmit = "") #end <html:form action="${action.actionPath}" method="post" enctype="multipart/form-data" onsubmit="$onsubmit"> - -#foreach ($field in $actionParameters) -#if ($field.widgetType == "hidden") -#renderFormField($action $field " " '') -#end +#if (!$action.hiddenActionParameters.empty) + <%@ include file="${action.fullTilePath}-hidden-params.jsp" %> #end <table> <tbody> 1.1 cartridges/andromda-bpm4struts/src/templates/bpm4struts/pages/page-hidden-parameters.jspf.vsl Index: page-hidden-parameters.jspf.vsl =================================================================== ## ## ## This JSP fragment stores all hidden parameters. ## ## #set ($generatedFile = "${action.fullTilePath}-hidden-params.jsp") #foreach ($field in $action.hiddenActionParameters) <html:hidden name="$formName" property="$field.name" styleId="$field.styleId"/> #end 1.120 +15 -0 cartridges/andromda-bpm4struts/src/META-INF/andromda-cartridge.xml Index: andromda-cartridge.xml =================================================================== RCS file: /cvsroot/andromda/cartridges/andromda-bpm4struts/src/META-INF/andromda-cartridge.xml,v retrieving revision 1.119 retrieving revision 1.120 diff -u -w -r1.119 -r1.120 --- andromda-cartridge.xml 18 Jun 2005 15:54:55 -0000 1.119 +++ andromda-cartridge.xml 20 Jun 2005 23:20:00 -0000 1.120 @@ -215,6 +215,21 @@ </template> <template + path="templates/bpm4struts/pages/page-hidden-parameters.jspf.vsl" + outputPattern="$generatedFile" + outlet="pages" + overwrite="true"> + <modelElements variable="action"> + <modelElement> + <type name="org.andromda.cartridges.bpm4struts.metafacades.StrutsAction"> + <property name="tableLink">false</property> + <property name="hiddenActionParameters"/> + </type> + </modelElement> + </modelElements> + </template> + + <template path="templates/bpm4struts/pages/page-table.jspf.vsl" outputPattern="$generatedFile" outlet="pages" |