|
From: Chad B. <cwb...@us...> - 2008-03-29 00:05:26
|
User: cwbrandon
Date: 08/03/28 17:05:32
Modified: andromda-jsf2/src/main/resources/META-INF/andromda
cartridge.xml
andromda-jsf2/src/main/java/org/andromda/cartridges/jsf2/metafacades
JSFUseCaseLogicImpl.java
andromda-jsf2/src/main/resources/templates/jsf2/views/portlet
edit.xhtml.vsl
andromda-jsf2/src/main/uml JSFMetafacadeModel.xml.zip
andromda-jsf2/src/main/resources/templates/jsf2/configuration
faces-config.xml.vsl
andromda-jsf2/src/main/resources/templates/jsf2/controllers
Controller.java.vsl
andromda-jsf2/src/main/resources/templates/jsf2/configuration/portlet
portlet.xml.vsl
Log:
put portlet mode help/view/edit into the metafacades model and use those attributes
Revision Changes Path
1.19 +2 -2 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.18
retrieving revision 1.19
diff -u -w -r1.18 -r1.19
--- cartridge.xml 28 Mar 2008 21:28:40 -0000 1.18
+++ cartridge.xml 29 Mar 2008 00:05:31 -0000 1.19
@@ -1094,7 +1094,7 @@
<template
path="templates/jsf2/views/portlet/help.xhtml.vsl"
- outputPattern="${useCase.pathRoot}/${jsfUtils.toWebResourceName($useCase.name)}-portlet-help.xhtml"
+ outputPattern="${useCase.portletHelpPath}.xhtml"
outlet="views"
overwrite="true"
outputCondition="portlet">
@@ -1107,7 +1107,7 @@
<template
path="templates/jsf2/views/portlet/edit.xhtml.vsl"
- outputPattern="${useCase.pathRoot}/${jsfUtils.toWebResourceName($useCase.name)}-portlet-edit.xhtml"
+ outputPattern="${useCase.portletEditPath}.xhtml"
outlet="views"
overwrite="true"
outputCondition="portlet">
1.7 +41 -0 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.6
retrieving revision 1.7
diff -u -w -r1.6 -r1.7
--- JSFUseCaseLogicImpl.java 28 Mar 2008 21:49:53 -0000 1.6
+++ JSFUseCaseLogicImpl.java 29 Mar 2008 00:05:32 -0000 1.7
@@ -823,4 +823,45 @@
}
return preferences;
}
+
+ @Override
+ protected String handleGetPortletEditForwardName()
+ {
+ return this.getWebResourceName() + "-portlet-edit";
+ }
+
+ @Override
+ protected String handleGetPortletEditPath()
+ {
+ return this.getPathRoot() + "/" + this.getPortletEditForwardName();
+ }
+
+ @Override
+ protected String handleGetPortletHelpForwardName()
+ {
+ return this.getWebResourceName() + "-portlet-help";
+ }
+
+ @Override
+ protected String handleGetPortletHelpPath()
+ {
+ return this.getPathRoot() + "/" + this.getPortletHelpForwardName();
+ }
+
+ @Override
+ protected String handleGetPortletViewForwardName()
+ {
+ return this.getWebResourceName() + "-portlet-view";
+ }
+
+ private String getWebResourceName()
+ {
+ return JSFUtils.toWebResourceName(this.getName());
+ }
+
+ @Override
+ protected String handleGetPortletViewPath()
+ {
+ return this.getInitialTargetPath();
+ }
}
1.5 +1 -1 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/views/portlet/edit.xhtml.vsl
Index: edit.xhtml.vsl
===================================================================
RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/views/portlet/edit.xhtml.vsl,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -r1.4 -r1.5
--- edit.xhtml.vsl 28 Mar 2008 23:25:44 -0000 1.4
+++ edit.xhtml.vsl 29 Mar 2008 00:05:32 -0000 1.5
@@ -11,7 +11,7 @@
<h:inputText value="#{${useCase.controller.beanName}.preferences.${attribute.name}}"/>
#end
</h:panelGrid>
- <h:commandButton value="#{messages['action.save']}" action="#{${useCase.controller.beanName}.setPortletModeView}"/>
+ <h:commandButton value="#{messages['action.save']}" action="#{${useCase.controller.beanName}.portletModeView}"/>
</h:form>
</ui:define>
</ui:composition>
1.13 +225 -204 cartridges/andromda-jsf2/src/main/uml/JSFMetafacadeModel.xml.zip
<<Binary file>>
1.16 +23 -0 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.15
retrieving revision 1.16
diff -u -w -r1.15 -r1.16
--- faces-config.xml.vsl 28 Mar 2008 21:30:29 -0000 1.15
+++ faces-config.xml.vsl 29 Mar 2008 00:05:32 -0000 1.16
@@ -258,6 +258,29 @@
<redirect/>
</navigation-case>
</navigation-rule>
+#if ($portlet)
+ <navigation-rule>
+ <navigation-case>
+ <from-outcome>$useCase.portletViewForwardName</from-outcome>
+ <to-view-id>${useCase.portletViewPath}.${jsfUtils.viewExtension}</to-view-id>
+ <redirect/>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <navigation-case>
+ <from-outcome>$useCase.portletEditForwardName</from-outcome>
+ <to-view-id>${useCase.portletEditPath}.${jsfUtils.viewExtension}</to-view-id>
+ <redirect/>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <navigation-case>
+ <from-outcome>$useCase.portletHelpForwardName</from-outcome>
+ <to-view-id>${useCase.portletHelpPath}.${jsfUtils.viewExtension}</to-view-id>
+ <redirect/>
+ </navigation-case>
+ </navigation-rule>
+#end
#end
#foreach ($useCase in $useCases)
#foreach ($rule in $useCase.navigationRules)
1.12 +6 -3 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.11
retrieving revision 1.12
diff -u -w -r1.11 -r1.12
--- Controller.java.vsl 28 Mar 2008 22:19:15 -0000 1.11
+++ Controller.java.vsl 29 Mar 2008 00:05:32 -0000 1.12
@@ -571,28 +571,31 @@
/**
* Sets the portlet to the {@link javax.portlet.PortletMode#VIEW} mode.
*/
- public void setPortletModeView()
+ public java.lang.String portletModeView()
throws javax.portlet.PortletModeException
{
this.setPortletMode(javax.portlet.PortletMode.VIEW);
+ return "${controller.useCase.portletViewForwardName}";
}
/**
* Sets the portlet to the {@link javax.portlet.PortletMode#EDIT} mode.
*/
- public void setPortletModeEdit()
+ public java.lang.String portletModeEdit()
throws javax.portlet.PortletModeException
{
this.setPortletMode(javax.portlet.PortletMode.EDIT);
+ return "${controller.useCase.portletEditForwardName}";
}
/**
* Sets the portlet to the {@link javax.portlet.PortletMode#HELP} mode.
*/
- public void setPortletModeHelp()
+ public java.lang.String portletModeHelp()
throws javax.portlet.PortletModeException
{
this.setPortletMode(javax.portlet.PortletMode.HELP);
+ return "${controller.useCase.portletHelpForwardName}";
}
#end
}
\ No newline at end of file
1.4 +3 -3 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.3
retrieving revision 1.4
diff -u -w -r1.3 -r1.4
--- portlet.xml.vsl 28 Mar 2008 21:28:42 -0000 1.3
+++ portlet.xml.vsl 29 Mar 2008 00:05:32 -0000 1.4
@@ -9,15 +9,15 @@
<portlet-class>$portletClass</portlet-class>
<init-param>
<name>EditPage</name>
- <value>${useCase.pathRoot}/${jsfUtils.toWebResourceName($useCase.name)}-portlet-edit.xhtml</value>
+ <value>${useCase.portletEditPath}.xhtml</value>
</init-param>
<init-param>
<name>HelpPage</name>
- <value>${useCase.pathRoot}/${jsfUtils.toWebResourceName($useCase.name)}-portlet-help.xhtml</value>
+ <value>${useCase.portletHelpPath}.xhtml</value>
</init-param>
<init-param>
<name>ViewPage</name>
- <value>${useCase.initialTargetPath}.xhtml</value>
+ <value>${useCase.portletViewPath}.xhtml</value>
</init-param>
<supports>
<mime-type>text/html</mime-type>
|