[ http://jira.andromda.org/browse/CORE-100?page=all ] Chad Brandon closed CORE-100: -----------------------------
Resolution: Fixed You can now define outputConditions. You can do it 1 one 2 ways: you can define global ones at the top of the cartridge.xml like this: <outputCondition name="viewTypeIsJsp">$viewType.equalsIgnoreCase('jsp')</outputCondition> and then reference the outputCondition by name in your template definition like this: <template path="templates/jsf/views/jsp/includes/includes.jspf.vsl" outputPattern="$jspIncludes" outlet="views" overwrite="true" generateEmptyFiles="true" outputCondition="viewTypeIsJsp"/> Or you can have the expression directly in the outputCondition attribute of the template like this: <template path="templates/jsf/views/jsp/includes/includes.jspf.vsl" outputPattern="$jspIncludes" outlet="views" overwrite="true" generateEmptyFiles="true" outputCondition="$viewType.equalsIgnoreCase('jsp')"/> Note, for the outputCondition to be true, the expression must result in a value of "true" > Allow for conditional template output based on conditions specified in > cartridge.xml > ------------------------------------------------------------------------------------ > > Key: CORE-100 > URL: http://jira.andromda.org/browse/CORE-100 > Project: AndroMDA Core > Type: Improvement > Versions: 3.2 RC1 > Reporter: Joel Kozikowski > Assignee: Chad Brandon > Priority: Minor > > Currently, a template's output can be suppressed by wrapping an #if statement > around the entire template contents, and setting the <template> attribute > outputOnEmptyElements to false. This requires a developer to examine the > contents of the template file for conditions of output (if any). Specifying > this in the <template> definiiton instead allows for easier enhancements to > the cartridge (only the cartridge.xml needs to be modified, not the > template), as well as offers a single place for a developer to look at when > trying to determine when a template will or will not be output. A > <modelElement> can contain a <property> that must match a metafacade's > property before output will take place. That handles the specific case of a > basing output on the property of a metafacade, but does not handle the more > general case of basing the output on a generic property (such as a namespace > property). Ideally, there would be a new <outputConditions> element that > could contain conditions that must be met before the template would be output > (e.g. only output template if namespace property X equals value "Y"). -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.andromda.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642