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-04-08 17:33:39
|
User: cwbrandon Date: 08/04/08 10:00:24 Modified: andromda-jsf2/src/main/resources/META-INF/andromda cartridge.xml Log: exclude 403 page from portlets Revision Changes Path 1.22 +2 -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.21 retrieving revision 1.22 diff -u -w -r1.21 -r1.22 --- cartridge.xml 7 Apr 2008 15:38:34 -0000 1.21 +++ cartridge.xml 8 Apr 2008 17:00:24 -0000 1.22 @@ -561,7 +561,8 @@ outlet="views" overwrite="true" outputToSingleFile="true" - outputOnEmptyElements="false"> + outputOnEmptyElements="false" + outputCondition="standalone"> <modelElements> <modelElement variable="applicationUseCases"> <type name="org.andromda.metafacades.uml.FrontEndUseCase"> |
From: Chad B. <cwb...@us...> - 2008-04-08 16:29:14
|
User: cwbrandon Date: 08/04/08 09:29:07 Modified: andromda-jsf2/src/main/resources/templates/jsf2/flow ViewPopulator.java.vsl LogOutServlet.java.vsl andromda-jsf2/src/main/resources/templates/jsf2/utils JsfUtils.java.vsl andromda-jsf2/src/main/resources/templates/jsf2/flow/crud ViewPopulator.java.vsl Log: more improvement to portlet form serialization Revision Changes Path 1.7 +9 -16 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/flow/ViewPopulator.java.vsl Index: ViewPopulator.java.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/flow/ViewPopulator.java.vsl,v retrieving revision 1.6 retrieving revision 1.7 diff -u -w -r1.6 -r1.7 --- ViewPopulator.java.vsl 8 Apr 2008 01:42:35 -0000 1.6 +++ ViewPopulator.java.vsl 8 Apr 2008 16:29:06 -0000 1.7 @@ -52,18 +52,11 @@ { // - we need to retrieve the faces context differently since we're outside of the // faces servlet - final LifecycleFactory lifecycleFactory = - (LifecycleFactory)FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY); - final Lifecycle lifecycle = lifecycleFactory.getLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE); - final FacesContextFactory facesContextFactory = - (FacesContextFactory)FactoryFinder.getFactory(FactoryFinder.FACES_CONTEXT_FACTORY); - final FacesContext facesContext = - facesContextFactory.getFacesContext( - this.config.getServletContext(), - request, - response, - lifecycle); - populateFormAndViewVariables(facesContext, null); +#set ($facesContextUtilsFullyQualifiedName = "FacesContextUtils") +#if ($stringUtils.isNotBlank($managedBeansPackage)) +#set($facesContextUtilsFullyQualifiedName = "${managedBeansPackage}.${facesContextUtilsFullyQualifiedName}") +#end + populateFormAndViewVariables(${facesContextUtilsFullyQualifiedName}.getFacesContext(request, response), null); chain.doFilter(request, response); } @@ -108,7 +101,7 @@ // - if the form is still null, see if we can get it from a serialized state if (form == null) { - form = ${managedBeansPackage}.JsfUtils.getSerializedForm(session); + form = ${managedBeansPackage}.JsfUtils.getSerializedForm(facesContext); } #end if (form != null) @@ -143,13 +136,13 @@ // - if the form is still null, see if we can get it from a serialized state if (form == null) { - form = ${managedBeansPackage}.JsfUtils.getSerializedForm(session); + form = ${managedBeansPackage}.JsfUtils.getSerializedForm(facesContext); } else { // - pass any properties from the serialized form along org.andromda.presentation.jsf2.FormPopulator.populateForm( - org.andromda.presentation.jsf2.JsfUtils.getSerializedForm(session), form); + org.andromda.presentation.jsf2.JsfUtils.getSerializedForm(facesContext), form); } #end } @@ -181,7 +174,7 @@ // - serialize the form if (form != null) { - ${managedBeansPackage}.JsfUtils.serializeForm(session, form); + ${managedBeansPackage}.JsfUtils.serializeForm(facesContext, form); } #end #if (!$view.variables.empty || !$view.backingValueVariables.empty) 1.2 +8 -1 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/flow/LogOutServlet.java.vsl Index: LogOutServlet.java.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/flow/LogOutServlet.java.vsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- LogOutServlet.java.vsl 5 Dec 2006 19:39:29 -0000 1.1 +++ LogOutServlet.java.vsl 8 Apr 2008 16:29:06 -0000 1.2 @@ -18,6 +18,8 @@ public class LogOutServlet extends HttpServlet { + private static final long serialVersionUID = 1L; + /** * @see javax.servlet.http.HttpServlet#doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) */ @@ -27,7 +29,12 @@ throws ServletException, IOException { #if ($formSerialization) - ${managedBeansPackage}.JsfUtils.deleteSerializedForm(request.getSession()); +#set ($facesContextUtilsFullyQualifiedName = "FacesContextUtils") +#if ($stringUtils.isNotBlank($managedBeansPackage)) +#set($facesContextUtilsFullyQualifiedName = "${managedBeansPackage}.${facesContextUtilsFullyQualifiedName}") +#end + ${managedBeansPackage}.JsfUtils.deleteSerializedForm( + ${facesContextUtilsFullyQualifiedName}.getFacesContext(request, response)); #end request.getSession().invalidate(); response.sendRedirect(request.getContextPath() + "${useCase.path}.${facesServletExtension}"); 1.4 +67 -29 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/utils/JsfUtils.java.vsl Index: JsfUtils.java.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/utils/JsfUtils.java.vsl,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -r1.3 -r1.4 --- JsfUtils.java.vsl 8 Apr 2008 01:20:28 -0000 1.3 +++ JsfUtils.java.vsl 8 Apr 2008 16:29:07 -0000 1.4 @@ -4,8 +4,6 @@ #end import org.apache.commons.lang.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; /** * Utilities used within the JSF Cartridge @@ -14,7 +12,8 @@ */ public class $className { - private static Log logger = LogFactory.getLog(JsfUtils.class); + private static org.apache.commons.logging.Log logger = + org.apache.commons.logging.LogFactory.getLog(JsfUtils.class); /** * The location of the temporary directoy used the JSF cartridge. @@ -45,15 +44,18 @@ /** * Attempts to serialize the given <code>form</code> to disk so that it * can later be retrieved when the user's session times out. - * @param session the session from which to create the serialization path. + * @param context the FacesContext from which to create the serialization path. * @param form the form to serialize. */ - public static void serializeForm(final $jsfUtils.sessionClassName session, final Object form) + public static void serializeForm(final javax.faces.context.FacesContext context, final Object form) { java.io.ObjectOutputStream objectStream = null; try { - final java.io.File serializationFile = new java.io.File(getFormSerializationPath(session)); + final String path = getFormSerializationPath(context); + if (StringUtils.isNotBlank(path)) + { + final java.io.File serializationFile = new java.io.File(getFormSerializationPath(context)); final java.io.File parent = serializationFile.getParentFile(); if (parent != null) { @@ -63,6 +65,7 @@ objectStream = new java.io.ObjectOutputStream(fileStream); objectStream.writeObject(form); } + } catch (final Exception exception) { logger.warn(exception); @@ -85,20 +88,24 @@ /** * Retrieves the current serialized form for the given session. - * @param session the session. + * @param context the FacesContext * @return the serialized form. * @throws Exception */ - public static Object getSerializedForm(final $jsfUtils.sessionClassName session) + public static Object getSerializedForm(final javax.faces.context.FacesContext context) { Object form = null; java.io.ObjectInputStream objectStream = null; try { - java.io.FileInputStream fileStream = new java.io.FileInputStream(getFormSerializationPath(session)); + final String path = getFormSerializationPath(context); + if (StringUtils.isNotBlank(path)) + { + java.io.FileInputStream fileStream = new java.io.FileInputStream(path); objectStream = new java.io.ObjectInputStream(fileStream); form = objectStream.readObject(); } + } catch (final Exception exception) { // - ignore if we couldn't retrieve the serialized form @@ -125,10 +132,13 @@ * * @param session the session for which to remove the serialized form. */ - public static void deleteSerializedForm(final $jsfUtils.sessionClassName session) + public static void deleteSerializedForm(final javax.faces.context.FacesContext context) + { + final String path = getFormSerializationPath(context); + if (StringUtils.isNotBlank(path)) { final java.io.File serializationFile = - new java.io.File(getFormSerializationPath(session)); + new java.io.File(getFormSerializationPath(context)); serializationFile.delete(); final java.io.File directory = serializationFile.getParentFile(); if (directory != null) @@ -136,20 +146,49 @@ directory.delete(); } } - + } +#if ($standalone) /** * The name of the file storing the serialized form. */ private static final String SERIALIZED_FORM_FILE_NAME = "/form.ser"; +#else + /** + * Pattern used to strip characters not used in the portlet serialization file. + */ + private static final String NAMESPACE_STRIP_PATTERN = "\\p{Punct}"; + + private static String getSerializationFileName(final Object response) + { + String fileName = null; + if (response instanceof javax.portlet.RenderResponse) + { + fileName = ((javax.portlet.RenderResponse)response).getNamespace().replaceAll(NAMESPACE_STRIP_PATTERN, ""); + } + return fileName; + } + +#end /** * Retrieves the path in which the serialized form will be stored. * @param session the session containing the unique id in which to create the path. * @return the path to which serialization occurs. */ - private static String getFormSerializationPath(final $jsfUtils.sessionClassName session) + private static String getFormSerializationPath(final javax.faces.context.FacesContext context) + { + final String sessionId = (($jsfUtils.sessionClassName)context.getExternalContext().getSession(true)).getId(); +#if ($standalone) + return TEMPORARY_DIRECTORY + sessionId + SERIALIZED_FORM_FILE_NAME; +#else + final String serializationFileName = getSerializationFileName(context.getExternalContext().getResponse()); + String path = null; + if (StringUtils.isNotBlank(serializationFileName)) { - return TEMPORARY_DIRECTORY + session.getId() + SERIALIZED_FORM_FILE_NAME; + path = TEMPORARY_DIRECTORY + sessionId + '/' + serializationFileName; + } + return path; +#end } /** @@ -201,5 +240,4 @@ } throw new RuntimeException("Parameter "+parameterName+" not found"); } - } 1.4 +8 -8 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/flow/crud/ViewPopulator.java.vsl Index: ViewPopulator.java.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/flow/crud/ViewPopulator.java.vsl,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -r1.3 -r1.4 --- ViewPopulator.java.vsl 18 Jan 2007 10:11:07 -0000 1.3 +++ ViewPopulator.java.vsl 8 Apr 2008 16:29:07 -0000 1.4 @@ -76,7 +76,7 @@ // - if the form is still null, see if we can get it from a serialized state if (form == null) { - form = ${managedBeansPackage}.JsfUtils.getSerializedForm(session); + form = ${managedBeansPackage}.JsfUtils.getSerializedForm(facesContext); } #end try @@ -95,7 +95,7 @@ // - serialize the form if (form != null) { - ${managedBeansPackage}.JsfUtils.serializeForm(session, form); + ${managedBeansPackage}.JsfUtils.serializeForm(facesContext, form); } #end } |
From: Chad B. <cwb...@us...> - 2008-04-08 01:42:33
|
User: cwbrandon Date: 08/04/07 18:42:36 Modified: andromda-jsf2/src/main/resources/templates/jsf2/flow ViewPopulator.java.vsl Log: portlet seralization improvements Revision Changes Path 1.6 +6 -0 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/flow/ViewPopulator.java.vsl Index: ViewPopulator.java.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/flow/ViewPopulator.java.vsl,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -r1.5 -r1.6 --- ViewPopulator.java.vsl 8 Apr 2008 01:20:28 -0000 1.5 +++ ViewPopulator.java.vsl 8 Apr 2008 01:42:35 -0000 1.6 @@ -145,6 +145,12 @@ { form = ${managedBeansPackage}.JsfUtils.getSerializedForm(session); } + else + { + // - pass any properties from the serialized form along + org.andromda.presentation.jsf2.FormPopulator.populateForm( + org.andromda.presentation.jsf2.JsfUtils.getSerializedForm(session), form); + } #end } else |
From: Chad B. <cwb...@us...> - 2008-04-08 01:22:14
|
User: cwbrandon Date: 08/04/07 18:20:28 Modified: andromda-jsf2/src/main/resources/templates/jsf2/utils PageableDataModel.java.vsl JsfUtils.java.vsl andromda-jsf2/src/main/resources/templates/jsf2/flow ViewPopulator.java.vsl andromda-jsf2/src/main/resources/templates/jsf2/utils/portlet PageableDataModel.java.vsl Log: enable form serialization for portlets Revision Changes Path 1.2 +1 -0 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/utils/PageableDataModel.java.vsl Index: PageableDataModel.java.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/utils/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:47 -0000 1.1 +++ PageableDataModel.java.vsl 8 Apr 2008 01:20:28 -0000 1.2 @@ -16,6 +16,7 @@ */ public abstract class $className extends org.apache.myfaces.trinidad.model.CollectionModel + implements java.io.Serializable { private int pageSize; private int rowIndex; 1.3 +23 -19 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/utils/JsfUtils.java.vsl Index: JsfUtils.java.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/utils/JsfUtils.java.vsl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- JsfUtils.java.vsl 25 Feb 2008 14:28:51 -0000 1.2 +++ JsfUtils.java.vsl 8 Apr 2008 01:20:28 -0000 1.3 @@ -4,6 +4,8 @@ #end import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; /** * Utilities used within the JSF Cartridge @@ -12,6 +14,8 @@ */ public class $className { + private static Log logger = LogFactory.getLog(JsfUtils.class); + /** * The location of the temporary directoy used the JSF cartridge. */ @@ -44,7 +48,7 @@ * @param session the session from which to create the serialization path. * @param form the form to serialize. */ - public static void serializeForm(final javax.servlet.http.HttpSession session, final Object form) + public static void serializeForm(final $jsfUtils.sessionClassName session, final Object form) { java.io.ObjectOutputStream objectStream = null; try @@ -61,7 +65,7 @@ } catch (final Exception exception) { - // - ignore if we couldn't serialize the form. + logger.warn(exception); } finally { @@ -85,7 +89,7 @@ * @return the serialized form. * @throws Exception */ - public static Object getSerializedForm(final javax.servlet.http.HttpSession session) + public static Object getSerializedForm(final $jsfUtils.sessionClassName session) { Object form = null; java.io.ObjectInputStream objectStream = null; @@ -121,7 +125,7 @@ * * @param session the session for which to remove the serialized form. */ - public static void deleteSerializedForm(final javax.servlet.http.HttpSession session) + public static void deleteSerializedForm(final $jsfUtils.sessionClassName session) { final java.io.File serializationFile = new java.io.File(getFormSerializationPath(session)); @@ -143,7 +147,7 @@ * @param session the session containing the unique id in which to create the path. * @return the path to which serialization occurs. */ - private static String getFormSerializationPath(final javax.servlet.http.HttpSession session) + private static String getFormSerializationPath(final $jsfUtils.sessionClassName session) { return TEMPORARY_DIRECTORY + session.getId() + SERIALIZED_FORM_FILE_NAME; } 1.5 +8 -1 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/flow/ViewPopulator.java.vsl Index: ViewPopulator.java.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/flow/ViewPopulator.java.vsl,v retrieving revision 1.4 retrieving revision 1.5 diff -u -w -r1.4 -r1.5 --- ViewPopulator.java.vsl 21 Mar 2008 16:07:12 -0000 1.4 +++ ViewPopulator.java.vsl 8 Apr 2008 01:20:28 -0000 1.5 @@ -139,6 +139,13 @@ { form = session.getAttribute("$view.formKey"); } +#if ($formSerialization) + // - if the form is still null, see if we can get it from a serialized state + if (form == null) + { + form = ${managedBeansPackage}.JsfUtils.getSerializedForm(session); + } +#end } else { @@ -164,7 +171,7 @@ #end } #end -#if ($standalone && $formSerialization) +#if ($formSerialization) // - serialize the form if (form != null) { 1.8 +1 -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.7 retrieving revision 1.8 diff -u -w -r1.7 -r1.8 --- PageableDataModel.java.vsl 3 Apr 2008 19:56:41 -0000 1.7 +++ PageableDataModel.java.vsl 8 Apr 2008 01:20:28 -0000 1.8 @@ -10,6 +10,7 @@ */ public abstract class $className extends javax.faces.model.DataModel + implements java.io.Serializable { private int pageSize; private int rowIndex; |
From: Chad B. <cwb...@us...> - 2008-04-07 15:38:34
|
User: cwbrandon Date: 08/04/07 08:38:36 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/uml JSFMetafacadeModel.xml.zip andromda-jsf2/src/main/resources/templates/jsf2/flow/portlet PortletPhaseListener.java.vsl Log: make the portlet phase listener handle all front end use cases in the model Revision Changes Path 1.21 +2 -4 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.20 retrieving revision 1.21 diff -u -w -r1.20 -r1.21 --- cartridge.xml 3 Apr 2008 22:21:20 -0000 1.20 +++ cartridge.xml 7 Apr 2008 15:38:34 -0000 1.21 @@ -1085,10 +1085,8 @@ outputCondition="portlet" outputOnEmptyElements="false"> <modelElements> - <modelElement variable="applicationUseCases"> - <type name="org.andromda.metafacades.uml.FrontEndUseCase"> - <property name="entryUseCase"/> - </type> + <modelElement variable="useCases"> + <type name="org.andromda.metafacades.uml.FrontEndUseCase"/> </modelElement> </modelElements> </template> 1.8 +15 -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.7 retrieving revision 1.8 diff -u -w -r1.7 -r1.8 --- JSFUseCaseLogicImpl.java 29 Mar 2008 00:05:32 -0000 1.7 +++ JSFUseCaseLogicImpl.java 7 Apr 2008 15:38:34 -0000 1.8 @@ -671,6 +671,7 @@ /** * @see org.andromda.cartridges.jsf2.metafacades.JSFUseCase#getRegistrationUseCases() */ + @SuppressWarnings("unchecked") protected List handleGetRegistrationUseCases() { final List useCases = new ArrayList(this.getAllUseCases()); @@ -708,6 +709,7 @@ /** * @see org.andromda.cartridges.jsf2.metafacades.JSFUseCase#getNavigationRules() */ + @SuppressWarnings("unchecked") protected Collection handleGetNavigationRules() { final Map rules = new LinkedHashMap(); @@ -768,6 +770,7 @@ { final JSFUseCase theUseCase = this; return CollectionUtils.select(getAllUseCases(),new Predicate() { + @SuppressWarnings("synthetic-access") public boolean evaluate(Object o) { final JSFUseCase useCase = (JSFUseCase)o; @@ -864,4 +867,16 @@ { return this.getInitialTargetPath(); } + + @SuppressWarnings("unchecked") + @Override + protected Collection handleGetAllViews() + { + final Set allViews = new LinkedHashSet(); + for (final Iterator iterator = this.getAllUseCases().iterator(); iterator.hasNext();) + { + allViews.addAll(((FrontEndUseCase)iterator.next()).getViews()); + } + return allViews; + } } 1.14 +213 -224 cartridges/andromda-jsf2/src/main/uml/JSFMetafacadeModel.xml.zip <<Binary file>> 1.6 +8 -3 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.5 retrieving revision 1.6 diff -u -w -r1.5 -r1.6 --- PortletPhaseListener.java.vsl 3 Apr 2008 23:53:23 -0000 1.5 +++ PortletPhaseListener.java.vsl 7 Apr 2008 15:38:36 -0000 1.6 @@ -22,9 +22,13 @@ { if (javax.faces.event.PhaseId.RENDER_RESPONSE.equals(event.getPhaseId())) { -#set ($useCase = ${applicationUseCases.iterator().next()}) +#foreach ($useCase in $useCases) #set ($controller = $useCase.controller) - if (viewId.equals("${useCase.initialTargetPath}.xhtml")) +#set ($ifClause = "if") +#if ($velocityCount > 1) +#set ($ifClause = "else $ifClause") +#end + $ifClause (viewId.equals("${useCase.initialTargetPath}.xhtml")) { final $controller.fullyQualifiedName controller = ($controller.fullyQualifiedName) event.getFacesContext().getApplication().getVariableResolver().resolveVariable( @@ -32,6 +36,7 @@ controller.${useCase.controllerAction}(); this.populateView(event, viewId); } +#end } else if (javax.faces.event.PhaseId.APPLY_REQUEST_VALUES.equals(event.getPhaseId())) { @@ -53,7 +58,7 @@ private void populateView(javax.faces.event.PhaseEvent event, String viewId) { -#foreach ($view in $useCase.views) +#foreach ($view in $useCases.iterator().next().allViews) #if ($view.populatorRequired) #set ($ifClause = "if") #if ($velocityCount > 1) |
From: Chad B. <cwb...@us...> - 2008-04-07 14:50:31
|
User: cwbrandon Date: 08/04/07 07:41:37 Modified: andromda-seam pom.xml Log: Fix andromda3.root (was pointing to some folder on Walter's computer), should be pointing to the directory on the build server Revision Changes Path 1.6 +1 -1 cartridges/andromda-seam/pom.xml Index: pom.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-seam/pom.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -r1.5 -r1.6 --- pom.xml 2 Mar 2008 20:59:19 -0000 1.5 +++ pom.xml 7 Apr 2008 14:41:36 -0000 1.6 @@ -299,7 +299,7 @@ </plugins> </reporting> <properties> - <andromda3.root>/home/walter/workspace/andromda-all</andromda3.root> + <andromda3.root>/var/andromda/builds/v3/andromda-all</andromda3.root> <maven.test.skip>true</maven.test.skip> <model.uri>jar:file:${pom.basedir}/src/main/uml/SeamMetafacadeModel.xml.zip!/SeamMetafacadeModel.xml</model.uri> <test.model.uri>jar:file:${pom.basedir}/src/test/uml/SeamCartridgeTestModel.xml.zip!/SeamCartridgeTestModel.xml</test.model.uri> |
From: Chad B. <cwb...@us...> - 2008-04-03 23:53:19
|
User: cwbrandon Date: 08/04/03 16:53:23 Modified: andromda-jsf2/src/main/resources/templates/jsf2/flow/portlet PortletPhaseListener.java.vsl Log: spacing fix Revision Changes Path 1.5 +1 -1 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.4 retrieving revision 1.5 diff -u -w -r1.4 -r1.5 |
From: Chad B. <cwb...@us...> - 2008-04-03 22:26:20
|
User: cwbrandon Date: 08/04/03 15:26:26 Modified: andromda-jsf2/src/main/resources/templates/jsf2/forms FormImpl.java.vsl Log: more cleanup Revision Changes Path 1.3 +3 -1 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.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- FormImpl.java.vsl 7 Mar 2008 16:48:49 -0000 1.2 +++ FormImpl.java.vsl 3 Apr 2008 22:26:26 -0000 1.3 @@ -124,7 +124,9 @@ /** * The current collection of messages stored within this form. */ - private java.util.Map $formMessagesProperty = new java.util.LinkedHashMap(); + private java.util.Map<java.lang.String, javax.faces.application.FacesMessage> $formMessagesProperty = + new java.util.LinkedHashMap<java.lang.String, javax.faces.application.FacesMessage>(); + /** * Adds a {@link javax.faces.application.FacesMessage} message to the current messages |
From: Chad B. <cwb...@us...> - 2008-04-03 22:21:14
|
User: cwbrandon Date: 08/04/03 15:21:21 Modified: andromda-jsf2/src/main/resources/META-INF/andromda cartridge.xml andromda-jsf2/src/main/resources/templates/jsf2/utils Messages.java.vsl andromda-jsf2/src/main/resources/templates/jsf2/exception PatternMatchingExceptionHandler.java.vsl andromda-jsf2/src/main/resources/templates/jsf2/flow UseCaseForwards.java.vsl Log: minor cleanup Revision Changes Path 1.20 +2 -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.19 retrieving revision 1.20 diff -u -w -r1.19 -r1.20 --- cartridge.xml 29 Mar 2008 00:05:31 -0000 1.19 +++ cartridge.xml 3 Apr 2008 22:21:20 -0000 1.20 @@ -390,7 +390,8 @@ outputPattern="$stringUtils.replace($managedBeansPackage, '.', '/')/${useCaseForwardsClassName}.java" outlet="managed-beans" overwrite="true" - outputToSingleFile="true"> + outputToSingleFile="true" + outputCondition="standalone"> <modelElements variable="useCases"> <modelElement> <type name="org.andromda.metafacades.uml.FrontEndUseCase"/> 1.2 +2 -0 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/utils/Messages.java.vsl Index: Messages.java.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/utils/Messages.java.vsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- Messages.java.vsl 5 Dec 2006 19:39:22 -0000 1.1 +++ Messages.java.vsl 3 Apr 2008 22:21:20 -0000 1.2 @@ -14,6 +14,8 @@ public class $className implements java.io.Serializable { + private static final long serialVersionUID = 1L; + /** * The messages bundle name. */ 1.3 +2 -0 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/exception/PatternMatchingExceptionHandler.java.vsl Index: PatternMatchingExceptionHandler.java.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/exception/PatternMatchingExceptionHandler.java.vsl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- PatternMatchingExceptionHandler.java.vsl 2 Mar 2008 20:59:24 -0000 1.2 +++ PatternMatchingExceptionHandler.java.vsl 3 Apr 2008 22:21:21 -0000 1.3 @@ -18,6 +18,8 @@ public class $patternMatchingExceptionHandler implements java.io.Serializable { + private static final long serialVersionUID = 1L; + private static final $patternMatchingExceptionHandler instance = new ${patternMatchingExceptionHandler}(); private static final java.util.regex.Pattern compiledPattern = java.util.regex.Pattern.compile("$exceptionHandlerPattern"); 1.3 +1 -1 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/flow/UseCaseForwards.java.vsl Index: UseCaseForwards.java.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/flow/UseCaseForwards.java.vsl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- UseCaseForwards.java.vsl 21 Mar 2008 16:07:12 -0000 1.2 +++ UseCaseForwards.java.vsl 3 Apr 2008 22:21:21 -0000 1.3 @@ -32,5 +32,5 @@ /** * Stores the keyed forward paths. */ - private static final java.util.Map forwards = new java.util.HashMap(); + private static final java.util.Map<String, String> forwards = new java.util.HashMap<String, String>(); } \ No newline at end of file |
From: Chad B. <cwb...@us...> - 2008-04-03 22:13:04
|
User: cwbrandon Date: 08/04/03 15:13:10 Modified: andromda-jsf2/src/main/resources/templates/jsf2/flow/portlet PortletPhaseListener.java.vsl Log: add another populateView call Revision Changes Path 1.4 +1 -0 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.3 retrieving revision 1.4 diff -u -w -r1.3 -r1.4 --- PortletPhaseListener.java.vsl 3 Apr 2008 01:04:00 -0000 1.3 +++ PortletPhaseListener.java.vsl 3 Apr 2008 22:13:10 -0000 1.4 @@ -30,6 +30,7 @@ event.getFacesContext().getApplication().getVariableResolver().resolveVariable( event.getFacesContext(), "$controller.beanName"); controller.${useCase.controllerAction}(); + this.populateView(event, viewId); } } else if (javax.faces.event.PhaseId.APPLY_REQUEST_VALUES.equals(event.getPhaseId())) |
From: Chad B. <cwb...@us...> - 2008-04-03 20:56:27
|
User: cwbrandon Date: 08/04/03 13:56:31 Modified: andromda-jsf2/src/main/resources/templates/jsf2/utils FormPopulator.java.vsl Log: add default serial version UID Revision Changes Path 1.4 +2 -0 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/utils/FormPopulator.java.vsl Index: FormPopulator.java.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/utils/FormPopulator.java.vsl,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -r1.3 -r1.4 --- FormPopulator.java.vsl 26 Sep 2007 17:59:28 -0000 1.3 +++ FormPopulator.java.vsl 3 Apr 2008 20:56:31 -0000 1.4 @@ -11,6 +11,8 @@ public class $formPopulatorName implements java.io.Serializable { + private static final long serialVersionUID = 1L; + /** * Copies the properties from the <code>fromForm</code> to the <code>toForm</code>. Only passes not-null values to the toForm. * |
From: Chad B. <cwb...@us...> - 2008-04-03 19:56:38
|
User: cwbrandon Date: 08/04/03 12:56:42 Modified: andromda-jsf2/src/main/resources/templates/jsf2/utils/portlet PageableDataModel.java.vsl Log: Reset the owner component's first value when the data model is created Revision Changes Path 1.7 +27 -8 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.6 retrieving revision 1.7 diff -u -w -r1.6 -r1.7 --- PageableDataModel.java.vsl 3 Apr 2008 16:23:47 -0000 1.6 +++ PageableDataModel.java.vsl 3 Apr 2008 19:56:41 -0000 1.7 @@ -71,6 +71,7 @@ */ public $paginationResultClassName getPage() { + this.initialize(); if (this.page == null || this.forcePageRefresh) { this.page = @@ -84,7 +85,7 @@ return this.page; } - private int getPageNumber() + protected int getPageNumber() { int pageNumber = 1; int rowIndex = this.rowIndex + 1; @@ -104,7 +105,7 @@ * * @return the first record number. */ - private int getFirst() + protected int getFirst() { final javax.faces.component.UIData owner = this.findOwner(); return owner != null ? owner.getFirst() : -1; @@ -120,14 +121,27 @@ private static final String SORT_ASCENDING = "sortAscending"; /** + * When this pageable data model is created a reset is required (i.e. + * setting first to 0 on the owner and resetting the rowIndex to 0 + */ + private boolean resetRequired = true; + + /** * Finds the component that "owns" this data model. * * @return the owne component (i.e. table). */ - private javax.faces.component.UIData findOwner() + protected javax.faces.component.UIData findOwner() + { + return (javax.faces.component.UIData)findOwner(javax.faces.context.FacesContext.getCurrentInstance().getViewRoot()); + } + + /** + * Performs any required initialization. + */ + protected void initialize() { - final javax.faces.component.UIData owner = - (javax.faces.component.UIData)findOwner(javax.faces.context.FacesContext.getCurrentInstance().getViewRoot()); + final javax.faces.component.UIData owner = this.findOwner(); if (owner != null) { final Object sortProperty = this.getProperty(owner, SORT_PROPERTY); @@ -140,11 +154,16 @@ { this.setSortAscending((Boolean)sortAscending); } + if (this.resetRequired) + { + owner.setFirst(0); + this.setRowIndex(0); + this.resetRequired = false; + } } - return owner; } - private Object getProperty(final javax.faces.component.UIData owner, String name) + protected Object getProperty(final javax.faces.component.UIData owner, String name) { Object property = null; if (owner != null) @@ -170,7 +189,7 @@ * @param component the component to start the search with. * @return the owne component (i.e. table). */ - private javax.faces.component.UIComponent findOwner(final javax.faces.component.UIComponent component) + protected javax.faces.component.UIComponent findOwner(final javax.faces.component.UIComponent component) { javax.faces.component.UIComponent owner = null; if (component instanceof javax.faces.component.UIData) |
From: Chad B. <cwb...@us...> - 2008-04-03 16:23:47
|
User: cwbrandon Date: 08/04/03 09:23:47 Modified: andromda-jsf2/src/main/resources/templates/jsf2/utils/portlet PageableDataModel.java.vsl Log: pull the sort properties from the owner component Revision Changes Path 1.6 +47 -2 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.5 retrieving revision 1.6 diff -u -w -r1.5 -r1.6 --- PageableDataModel.java.vsl 2 Apr 2008 23:11:04 -0000 1.5 +++ PageableDataModel.java.vsl 3 Apr 2008 16:23:47 -0000 1.6 @@ -115,9 +115,53 @@ * * @return the owne component (i.e. table). */ + private static final String SORT_PROPERTY = "sortProperty"; + + private static final String SORT_ASCENDING = "sortAscending"; + + /** + * Finds the component that "owns" this data model. + * + * @return the owne component (i.e. table). + */ private javax.faces.component.UIData findOwner() { - return (javax.faces.component.UIData)findOwner(javax.faces.context.FacesContext.getCurrentInstance().getViewRoot()); + final javax.faces.component.UIData owner = + (javax.faces.component.UIData)findOwner(javax.faces.context.FacesContext.getCurrentInstance().getViewRoot()); + if (owner != null) + { + final Object sortProperty = this.getProperty(owner, SORT_PROPERTY); + if (sortProperty instanceof String) + { + this.setSortProperty((String)sortProperty); + } + final Object sortAscending = this.getProperty(owner, SORT_ASCENDING); + if (sortAscending instanceof Boolean) + { + this.setSortAscending((Boolean)sortAscending); + } + } + return owner; + } + + private Object getProperty(final javax.faces.component.UIData owner, String name) + { + Object property = null; + if (owner != null) + { + try + { + if (org.apache.commons.beanutils.PropertyUtils.isReadable(owner, name)) + { + property = org.apache.commons.beanutils.PropertyUtils.getProperty(owner, name); + } + } + catch (Exception ex) + { + // - ignore if not available + } + } + return property; } /** @@ -170,11 +214,12 @@ throw new IllegalArgumentException("Invalid rowIndex: " + rowIndex + "; not within page"); } + // - we call getFirst() here to populate any 'owner' properties before the forcePageRefresh check is made + final int first = this.getFirst(); // 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) { - final int first = this.getFirst(); if (!this.forcePageRefresh) { this.forcePageRefresh = this.previousRowIndex != this.rowIndex && |
From: Chad B. <cwb...@us...> - 2008-04-03 01:03:54
|
User: cwbrandon Date: 08/04/02 18:04:00 Modified: andromda-jsf2/src/main/resources/templates/jsf2/flow/portlet PortletPhaseListener.java.vsl Log: remove uneeded try/catch Revision Changes Path 1.3 +8 -15 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.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- PortletPhaseListener.java.vsl 21 Mar 2008 16:15:27 -0000 1.2 +++ PortletPhaseListener.java.vsl 3 Apr 2008 01:04:00 -0000 1.3 @@ -20,8 +20,6 @@ final String viewId = this.getViewId(event); if (viewId != null && event.getFacesContext() != null) { - try - { if (javax.faces.event.PhaseId.RENDER_RESPONSE.equals(event.getPhaseId())) { #set ($useCase = ${applicationUseCases.iterator().next()}) @@ -39,11 +37,6 @@ this.populateView(event, viewId); } } - catch (Exception ex) - { - ex.printStackTrace(); - } - } } private String getViewId(javax.faces.event.PhaseEvent event) |
From: Chad B. <cwb...@us...> - 2008-04-02 23:14:45
|
User: cwbrandon Date: 08/04/02 16:11:04 Modified: andromda-jsf2/src/main/resources/templates/jsf2/utils/portlet PageableDataModel.java.vsl Log: find the owner component instead of setting it Revision Changes Path 1.5 +44 -6 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.4 retrieving revision 1.5 diff -u -w -r1.4 -r1.5 --- PageableDataModel.java.vsl 2 Apr 2008 22:37:48 -0000 1.4 +++ PageableDataModel.java.vsl 2 Apr 2008 23:11:04 -0000 1.5 @@ -99,19 +99,57 @@ return pageNumber; } - private javax.faces.component.UIData owner; + /** + * Gets the number of the first record. + * + * @return the first record number. + */ + private int getFirst() + { + final javax.faces.component.UIData owner = this.findOwner(); + return owner != null ? owner.getFirst() : -1; + } /** - * Sets the UIData owner of this pageable data model. + * Finds the component that "owns" this data model. + * + * @return the owne component (i.e. table). */ - public void setOwner(javax.faces.component.UIData owner) + private javax.faces.component.UIData findOwner() { - this.owner = owner; + return (javax.faces.component.UIData)findOwner(javax.faces.context.FacesContext.getCurrentInstance().getViewRoot()); } - private int getFirst() + /** + * Finds the component that "owns" this data model. + * + * @param component the component to start the search with. + * @return the owne component (i.e. table). + */ + private javax.faces.component.UIComponent findOwner(final javax.faces.component.UIComponent component) + { + javax.faces.component.UIComponent owner = null; + if (component instanceof javax.faces.component.UIData) { - return this.owner != null ? this.owner.getFirst() : -1; + final javax.faces.component.UIData uiData = (javax.faces.component.UIData)component; + if (this.equals(uiData.getValue())) + { + owner = component; + } + } + if (owner == null && component != null) + { + for (final java.util.Iterator iterator = component.getFacetsAndChildren(); iterator.hasNext();) + { + final javax.faces.component.UIComponent childComponent = (javax.faces.component.UIComponent)iterator.next(); + owner = this.findOwner(childComponent); + if (owner != null) + { + break; + } + } + } + return owner; } /** |
From: Chad B. <cwb...@us...> - 2008-04-02 22:37:42
|
User: cwbrandon Date: 08/04/02 15:37:48 Modified: andromda-jsf2/src/main/resources/templates/jsf2/views/portlet view-table.xhtml.vsl andromda-jsf2/src/main/resources/templates/jsf2/utils/portlet PageableDataModel.java.vsl Log: improvements to portlet table and pageable data model Revision Changes Path 1.7 +1 -1 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.6 retrieving revision 1.7 diff -u -w -r1.6 -r1.7 --- view-table.xhtml.vsl 27 Mar 2008 23:39:18 -0000 1.6 +++ view-table.xhtml.vsl 2 Apr 2008 22:37:47 -0000 1.7 @@ -71,7 +71,7 @@ #end <h:column> <f:facet name="header"> - <t:commandSortHeader columnName="$columnName" arrow="true"> + <t:commandSortHeader columnName="$columnName" arrow="true" propertyName="$columnName"> <h:outputText value="#{messages['$table.getTableColumnMessageKey($columnName)']}"/> </t:commandSortHeader> </f:facet> 1.4 +25 -38 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.3 retrieving revision 1.4 diff -u -w -r1.3 -r1.4 --- PageableDataModel.java.vsl 31 Mar 2008 22:48:57 -0000 1.3 +++ PageableDataModel.java.vsl 2 Apr 2008 22:37:48 -0000 1.4 @@ -71,7 +71,7 @@ */ public $paginationResultClassName getPage() { - if (this.page == null) + if (this.page == null || this.forcePageRefresh) { this.page = this.getPage( @@ -79,6 +79,7 @@ this.pageSize, this.sortProperty, this.sortAscending); + this.forcePageRefresh = false; } return this.page; } @@ -98,6 +99,21 @@ return pageNumber; } + private javax.faces.component.UIData owner; + + /** + * Sets the UIData owner of this pageable data model. + */ + public void setOwner(javax.faces.component.UIData owner) + { + this.owner = owner; + } + + private int getFirst() + { + return this.owner != null ? this.owner.getFirst() : -1; + } + /** * Keeps track of the previous row index (so that we don't search more than we need) */ @@ -120,15 +136,14 @@ final int listIndex = this.rowIndex % this.pageSize; if (this.forcePageRefresh || listIndex == 0 && this.previousRowIndex != this.rowIndex) { + final int first = this.getFirst(); + if (!this.forcePageRefresh) + { + this.forcePageRefresh = this.previousRowIndex != this.rowIndex && + (first == -1 || (this.rowIndex >= first && this.rowIndex <= (first + this.pageSize))); + } + page = this.getPage(); 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) @@ -188,34 +203,6 @@ 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; @@ -243,7 +230,7 @@ public void setSortAscending(boolean sortAscending) { - if (sortAscending != sortAscending) + if (this.sortAscending != sortAscending) { this.forcePageRefresh = true; } |
From: Chad B. <cwb...@us...> - 2008-03-31 22:48:58
|
User: cwbrandon Date: 08/03/31 15:48:58 Modified: andromda-jsf2/src/main/resources/templates/jsf2/utils/portlet PageableDataModel.java.vsl Log: fix setter name Revision Changes Path 1.3 +1 -1 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.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- PageableDataModel.java.vsl 27 Mar 2008 20:33:11 -0000 1.2 +++ PageableDataModel.java.vsl 31 Mar 2008 22:48:57 -0000 1.3 @@ -225,7 +225,7 @@ return this.sortProperty; } - public void setSortColumn(String sortProperty) + public void setSortProperty(String sortProperty) { if (sortProperty != null && !sortProperty.equals(this.sortProperty)) { |
From: Chad B. <cwb...@us...> - 2008-03-29 00:08:34
|
User: cwbrandon Date: 08/03/28 17:08:40 Modified: andromda-jsf2/src/main/resources/templates/jsf2/views/portlet help.xhtml.vsl Log: add missing prefix Revision Changes Path 1.5 +2 -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.4 retrieving revision 1.5 diff -u -w -r1.4 -r1.5 --- help.xhtml.vsl 28 Mar 2008 23:25:44 -0000 1.4 +++ help.xhtml.vsl 29 Mar 2008 00:08:40 -0000 1.5 @@ -1,5 +1,6 @@ <div xmlns="http://www.w3.org/1999/xhtml" - xmlns:h="http://java.sun.com/jsf/html"> + xmlns:h="http://java.sun.com/jsf/html" + xmlns:ui="http://java.sun.com/jsf/facelets"> <ui:composition template="/layout/layout.xhtml"> <ui:define name="content"> <strong><font size="4">Help with $useCase.name</font></strong><br/> |
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> |
From: Chad B. <cwb...@us...> - 2008-03-28 23:25:38
|
User: cwbrandon Date: 08/03/28 16:25:44 Modified: andromda-jsf2/src/main/resources/templates/jsf2/views/portlet help.xhtml.vsl edit.xhtml.vsl andromda-jsf2/src/main/resources/templates/jsf2/messages messages.properties.vsl Log: fix layout of edit/help pages Revision Changes Path 1.4 +1 -0 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.3 retrieving revision 1.4 diff -u -w -r1.3 -r1.4 --- help.xhtml.vsl 28 Mar 2008 23:17:35 -0000 1.3 +++ help.xhtml.vsl 28 Mar 2008 23:25:44 -0000 1.4 @@ -4,4 +4,5 @@ <ui:define name="content"> <strong><font size="4">Help with $useCase.name</font></strong><br/> </ui:define> +</ui:composition> </div> \ No newline at end of file 1.4 +2 -0 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.3 retrieving revision 1.4 diff -u -w -r1.3 -r1.4 --- edit.xhtml.vsl 28 Mar 2008 23:17:35 -0000 1.3 +++ edit.xhtml.vsl 28 Mar 2008 23:25:44 -0000 1.4 @@ -5,6 +5,7 @@ <ui:composition template="/layout/layout.xhtml"> <ui:define name="content"> <h:form> + <h:panelGrid columns="2"> #foreach ($attribute in $useCase.preferences.getAttributes(true)) <h:outputText value="#{messages['$attribute.messageKey']}:" style="font-weight: bold; text-align: right; width: 100%"/> <h:inputText value="#{${useCase.controller.beanName}.preferences.${attribute.name}}"/> @@ -13,4 +14,5 @@ <h:commandButton value="#{messages['action.save']}" action="#{${useCase.controller.beanName}.setPortletModeView}"/> </h:form> </ui:define> +</ui:composition> </div> \ No newline at end of file 1.10 +6 -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.9 retrieving revision 1.10 diff -u -w -r1.9 -r1.10 --- messages.properties.vsl 27 Mar 2008 20:59:52 -0000 1.9 +++ messages.properties.vsl 28 Mar 2008 23:25:44 -0000 1.10 @@ -221,6 +221,12 @@ #end #end #end +#if ($portlet) +# +# Messages related to portlets +# +action.save=Save +#end # CUSTOM MESSAGES # custom-messages merge-point |
From: Chad B. <cwb...@us...> - 2008-03-28 23:17:30
|
User: cwbrandon Date: 08/03/28 16:17:36 Modified: andromda-jsf2/src/main/resources/templates/jsf2/views/portlet help.xhtml.vsl edit.xhtml.vsl Log: fix layout of edit/help pages Revision Changes Path 1.3 +6 -3 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.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- help.xhtml.vsl 28 Mar 2008 21:28:41 -0000 1.2 +++ help.xhtml.vsl 28 Mar 2008 23:17:35 -0000 1.3 @@ -1,4 +1,7 @@ -<div xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"> +<div xmlns="http://www.w3.org/1999/xhtml" + xmlns:h="http://java.sun.com/jsf/html"> +<ui:composition template="/layout/layout.xhtml"> + <ui:define name="content"> <strong><font size="4">Help with $useCase.name</font></strong><br /> - + </ui:define> </div> \ No newline at end of file 1.3 +3 -3 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.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- edit.xhtml.vsl 28 Mar 2008 22:19:15 -0000 1.2 +++ edit.xhtml.vsl 28 Mar 2008 23:17:35 -0000 1.3 @@ -2,9 +2,9 @@ xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core"> - <f:view> +<ui:composition template="/layout/layout.xhtml"> + <ui:define name="content"> <h:form> - <h:panelGrid columns="2"> #foreach ($attribute in $useCase.preferences.getAttributes(true)) <h:outputText value="#{messages['$attribute.messageKey']}:" style="font-weight: bold; text-align: right; width: 100%"/> <h:inputText value="#{${useCase.controller.beanName}.preferences.${attribute.name}}"/> @@ -12,5 +12,5 @@ </h:panelGrid> <h:commandButton value="#{messages['action.save']}" action="#{${useCase.controller.beanName}.setPortletModeView}"/> </h:form> - </f:view> + </ui:define> </div> \ No newline at end of file |
From: Chad B. <cwb...@us...> - 2008-03-28 23:11:32
|
User: cwbrandon Date: 08/03/28 16:11:37 Modified: andromda-jsf2/src/main/resources/templates/jsf2/preferences/portlet Preferences.java.vsl Log: handle null when getting values from prefs Revision Changes Path 1.4 +2 -2 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.3 retrieving revision 1.4 diff -u -w -r1.3 -r1.4 --- Preferences.java.vsl 28 Mar 2008 20:46:35 -0000 1.3 +++ Preferences.java.vsl 28 Mar 2008 23:11:37 -0000 1.4 @@ -47,9 +47,9 @@ { 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); + final $attribute.type.wrapperName wrappedValue = value != null ? ${attribute.type.wrapperName}.valueOf(value) : null; #* *##if ($attribute.type.primitive) - return wrappedValue.${attribute.getterSetterTypeName}Value(); + return wrappedValue != null ? wrappedValue.${attribute.getterSetterTypeName}Value() : $attribute.type.javaNullString; #* *##else return wrappedValue; #* *##end |
From: Chad B. <cwb...@us...> - 2008-03-28 22:19:11
|
User: cwbrandon Date: 08/03/28 15:19:16 Modified: andromda-jsf2/src/main/resources/templates/jsf2/views/portlet edit.xhtml.vsl andromda-jsf2/src/main/resources/templates/jsf2/controllers Controller.java.vsl Log: expose some convience methods on the controller for portlets Revision Changes Path 1.2 +7 -9 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.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- edit.xhtml.vsl 21 Mar 2008 16:07:11 -0000 1.1 +++ edit.xhtml.vsl 28 Mar 2008 22:19:15 -0000 1.2 @@ -1,18 +1,16 @@ <div xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" - xmlns:f="http://java.sun.com/jsf/core" - xmlns:lr="http://www.liferay.com/jsf/facelets"> - + xmlns:f="http://java.sun.com/jsf/core"> <f:view> <h:form> - <!--h:panelGrid columns="2"> - - <h:outputText value="Editor height (in pixels)" style="font-weight: bold; text-align: right; width: 100%"/> - <h:inputText value="#{portletPreferences.editorHeight}"/> - + <h:panelGrid columns="2"> +#foreach ($attribute in $useCase.preferences.getAttributes(true)) + <h:outputText value="#{messages['$attribute.messageKey']}:" style="font-weight: bold; text-align: right; width: 100%"/> + <h:inputText value="#{${useCase.controller.beanName}.preferences.${attribute.name}}"/> +#end </h:panelGrid> - <lr:commandButton value="Save" action="#{editBackingBean.savePreferences}"/--> + <h:commandButton value="#{messages['action.save']}" action="#{${useCase.controller.beanName}.setPortletModeView}"/> </h:form> </f:view> </div> \ No newline at end of file 1.11 +57 -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.10 retrieving revision 1.11 diff -u -w -r1.10 -r1.11 --- Controller.java.vsl 28 Mar 2008 20:32:25 -0000 1.10 +++ Controller.java.vsl 28 Mar 2008 22:19:15 -0000 1.11 @@ -163,7 +163,7 @@ * * @return the JSF faces context instance. */ - protected javax.faces.context.FacesContext getContext() + public javax.faces.context.FacesContext getContext() { return javax.faces.context.FacesContext.getCurrentInstance(); } @@ -531,14 +531,68 @@ this.getRequest().setAttribute(ACTION_EVENT_ATTRIBUTES, event.getComponent(). getAttributes()); } -#if ($portlet && $controller.useCase.preferences) +#if ($portlet) +#if ($controller.useCase.preferences) /** * Gets the portlet preferences available to this controller. */ - protected $controller.useCase.preferences.name getPreferences() + public $controller.useCase.preferences.name getPreferences() { return ${controller.useCase.preferences.name}.getInstance(); } #end + + /** + * Gets the current action response. + * + * @return the current action response. + */ + protected javax.portlet.ActionResponse getActionResponse() + { + javax.portlet.ActionResponse actionResponse = null; + if (this.getResponse() instanceof javax.portlet.ActionResponse) + { + actionResponse = (javax.portlet.ActionResponse)this.getResponse(); + } + return actionResponse; + } + + protected void setPortletMode(final javax.portlet.PortletMode mode) + throws javax.portlet.PortletModeException + { + final javax.portlet.ActionResponse actionResponse = this.getActionResponse(); + if (actionResponse != null) + { + actionResponse.setPortletMode(mode); + } + } + + /** + * Sets the portlet to the {@link javax.portlet.PortletMode#VIEW} mode. + */ + public void setPortletModeView() + throws javax.portlet.PortletModeException + { + this.setPortletMode(javax.portlet.PortletMode.VIEW); + } + + /** + * Sets the portlet to the {@link javax.portlet.PortletMode#EDIT} mode. + */ + public void setPortletModeEdit() + throws javax.portlet.PortletModeException + { + this.setPortletMode(javax.portlet.PortletMode.EDIT); + } + + /** + * Sets the portlet to the {@link javax.portlet.PortletMode#HELP} mode. + */ + public void setPortletModeHelp() + throws javax.portlet.PortletModeException + { + this.setPortletMode(javax.portlet.PortletMode.HELP); + } +#end } \ No newline at end of file |
From: Chad B. <cwb...@us...> - 2008-03-28 21:49:50
|
User: cwbrandon Date: 08/03/28 14:49:54 Modified: andromda-jsf2/src/main/java/org/andromda/cartridges/jsf2/metafacades JSFUseCaseLogicImpl.java Log: include portlet pref message resources Revision Changes Path 1.6 +20 -2 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.5 retrieving revision 1.6 diff -u -w -r1.5 -r1.6 --- JSFUseCaseLogicImpl.java 28 Mar 2008 18:37:03 -0000 1.5 +++ JSFUseCaseLogicImpl.java 28 Mar 2008 21:49:53 -0000 1.6 @@ -118,11 +118,12 @@ /** * @see org.andromda.cartridges.jsf2.metafacades.JSFUseCase#getAllMessages() */ + @SuppressWarnings("unchecked") protected Map handleGetAllMessages() { - final boolean normalize = this.isNormalizeMessages(); - final Map messages = (normalize) ? (Map)new TreeMap() : (Map)new LinkedHashMap(); + final Map<String, String> messages = (normalize) ? + (Map<String, String>)new TreeMap() : (Map<String, String>)new LinkedHashMap<String, String>(); // - only retrieve the messages for the entry use case (i.e. the use case // where the application begins) @@ -368,6 +369,23 @@ } } + // - portlet preferences + final JSFPortletPreferences preferences = useCase.getPreferences(); + if (preferences != null) + { + final Collection attributes = preferences.getAttributes(true); + if (!attributes.isEmpty()) + { + for (final Iterator iterator = attributes.iterator(); iterator.hasNext();) + { + final JSFAttribute attribute = (JSFAttribute)iterator.next(); + messages.put( + attribute.getMessageKey(), + attribute.getMessageValue()); + } + } + } + // - exception forwards /* |
From: Chad B. <cwb...@us...> - 2008-03-28 21:30:33
|
User: cwbrandon Date: 08/03/28 14:30:33 Modified: andromda-jsf2/src/main/resources/templates/jsf2/configuration faces-config.xml.vsl Log: minor spacing fix Revision Changes Path 1.15 +1 -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.14 retrieving revision 1.15 diff -u -w -r1.14 -r1.15 |