portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From morci...@apache.org
Subject cvs commit: jakarta-jetspeed/webapp/WEB-INF/templates/vm/parameters/html MyPagesListBox.vm
Date Thu, 19 Jun 2003 19:19:33 GMT
morciuch    2003/06/19 12:19:32

  Modified:    src/java/org/apache/jetspeed/modules/actions/portlets
                        PsmlManagerAction.java
               src/java/org/apache/jetspeed/modules/localization
                        JetspeedLocalization_de.properties
                        JetspeedLocalization_el.properties
                        JetspeedLocalization_en.properties
                        JetspeedLocalization_es.properties
                        JetspeedLocalization_fr.properties
                        JetspeedLocalization_it.properties
                        JetspeedLocalization_ja.properties
                        JetspeedLocalization_my.properties
                        JetspeedLocalization_nl.properties
                        JetspeedLocalization_no.properties
                        JetspeedLocalization_pl.properties
                        JetspeedLocalization_tr.properties
               src/java/org/apache/jetspeed/modules/parameters
                        MyPagesListBox.java
                        VelocityParameterPresentationStyle.java
               src/java/org/apache/jetspeed/util/template JetspeedTool.java
               webapp/WEB-INF/templates/vm/parameters/html
                        MyPagesListBox.vm
  Log:
  More changes to "My Pages" feature (see Bugzilla bug# 20458).
  
  1. Profiles listed in the My Pages list box are now cached
  2. Localized "-- Manage Pages --" string
  3. Localization tool from the velocity parameter style context is now properly initialized
  4. Added reference to "portlet" in parameter styles context
  
  Revision  Changes    Path
  1.3       +20 -6     jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/portlets/PsmlManagerAction.java
  
  Index: PsmlManagerAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/portlets/PsmlManagerAction.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PsmlManagerAction.java	4 Jun 2003 20:59:32 -0000	1.2
  +++ PsmlManagerAction.java	19 Jun 2003 19:19:31 -0000	1.3
  @@ -130,7 +130,7 @@
    */
   public class PsmlManagerAction extends GenericMVCAction
   {
  -
  +    public static final String CACHED_PSML = "PsmlManagerAction.cached.psml";
       protected static final String PSML_REFRESH_FLAG = "psmlRefreshFlag";
       protected static final String TRUE = "true";
       protected static final String FALSE = "false";
  @@ -262,8 +262,7 @@
           //check to see if resultset has changed due to PsmlUpdateAction
           //if so reconstruct the iterator and reset the flag
   
  -        boolean refreshFlag = (rundata.getUser().getTemp(PSML_REFRESH_FLAG, FALSE)).equals(TRUE);
  -        rundata.getUser().setTemp(PSML_REFRESH_FLAG, FALSE);
  +        boolean refreshFlag = getRefreshPsmlFlag(rundata);
   
           // By default, only return psml pages for the current user
           String defaultSearch = PortletConfigState.getParameter(portlet, rundata, DEFAULT_SEARCH,
"true");
  @@ -273,6 +272,7 @@
           (DatabaseBrowserIterator) PortletSessionState.getAttribute(portlet, rundata, PROFILE_ITERATOR);
           if (refreshFlag)
           {
  +            setRefreshPsmlFlag(rundata, FALSE);
               PortletSessionState.clearAttribute(portlet, rundata, PROFILE_ITERATOR);
   
               // Use last used search value to refresh
  @@ -1015,9 +1015,23 @@
        * @param rundata
        * @param value
        */
  -    public void setRefreshPsmlFlag(RunData rundata, String value)
  +    private void setRefreshPsmlFlag(RunData rundata, String value)
  +    {
  +        rundata.getUser().setTemp(PSML_REFRESH_FLAG, value);
  +        if (value.equals(TRUE))
  +        {
  +            rundata.getUser().removeTemp(CACHED_PSML);
  +        }
  +    }
  +
  +    /**
  +     * 
  +     * @param rundata
  +     * @return 
  +     */
  +    private boolean getRefreshPsmlFlag(RunData rundata)
       {
  -        rundata.getUser().setTemp(PSML_REFRESH_FLAG, TRUE);
  +        return (rundata.getUser().getTemp(PSML_REFRESH_FLAG, FALSE)).equals(TRUE);
       }
   
       /**
  
  
  
  1.14      +2 -1      jakarta-jetspeed/src/java/org/apache/jetspeed/modules/localization/JetspeedLocalization_de.properties
  
  Index: JetspeedLocalization_de.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/localization/JetspeedLocalization_de.properties,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- JetspeedLocalization_de.properties	5 Jun 2003 18:25:26 -0000	1.13
  +++ JetspeedLocalization_de.properties	19 Jun 2003 19:19:31 -0000	1.14
  @@ -237,3 +237,4 @@
   BOTTOM_SUPPORT_MSG=Support and Additional Information
   
   PSML_MANAGER_MY_PAGES=My Pages:
  +PSML_MANAGER_MANAGE_PAGES=Manage Pages
  
  
  
  1.6       +1 -0      jakarta-jetspeed/src/java/org/apache/jetspeed/modules/localization/JetspeedLocalization_el.properties
  
  Index: JetspeedLocalization_el.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/localization/JetspeedLocalization_el.properties,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- JetspeedLocalization_el.properties	5 Jun 2003 18:25:26 -0000	1.5
  +++ JetspeedLocalization_el.properties	19 Jun 2003 19:19:31 -0000	1.6
  @@ -244,3 +244,4 @@
   BOTTOM_SUPPORT_MSG=Support and Additional Information
   
   PSML_MANAGER_MY_PAGES=My Pages:
  +PSML_MANAGER_MANAGE_PAGES=Manage Pages
  
  
  
  1.35      +2 -1      jakarta-jetspeed/src/java/org/apache/jetspeed/modules/localization/JetspeedLocalization_en.properties
  
  Index: JetspeedLocalization_en.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/localization/JetspeedLocalization_en.properties,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- JetspeedLocalization_en.properties	6 Jun 2003 17:52:49 -0000	1.34
  +++ JetspeedLocalization_en.properties	19 Jun 2003 19:19:31 -0000	1.35
  @@ -266,3 +266,4 @@
   REGISTRY_EDITOR_PORTLET_CATEGORY_GROUP=Category Group
   
   PSML_MANAGER_MY_PAGES=My Pages:
  +PSML_MANAGER_MANAGE_PAGES=Manage Pages
  
  
  
  1.13      +2 -1      jakarta-jetspeed/src/java/org/apache/jetspeed/modules/localization/JetspeedLocalization_es.properties
  
  Index: JetspeedLocalization_es.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/localization/JetspeedLocalization_es.properties,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- JetspeedLocalization_es.properties	5 Jun 2003 18:25:26 -0000	1.12
  +++ JetspeedLocalization_es.properties	19 Jun 2003 19:19:31 -0000	1.13
  @@ -55,3 +55,4 @@
   REGISTRY_EDITOR_PORTLET_CATEGORY_GROUP=Category Group
   
   PSML_MANAGER_MY_PAGES=My Pages:
  +PSML_MANAGER_MANAGE_PAGES=Manage Pages
  
  
  
  1.20      +2 -1      jakarta-jetspeed/src/java/org/apache/jetspeed/modules/localization/JetspeedLocalization_fr.properties
  
  Index: JetspeedLocalization_fr.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/localization/JetspeedLocalization_fr.properties,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- JetspeedLocalization_fr.properties	5 Jun 2003 18:25:26 -0000	1.19
  +++ JetspeedLocalization_fr.properties	19 Jun 2003 19:19:31 -0000	1.20
  @@ -265,3 +265,4 @@
   BOTTOM_SUPPORT_MSG=Support and Additional Information
   
   PSML_MANAGER_MY_PAGES=My Pages:
  +PSML_MANAGER_MANAGE_PAGES=Manage Pages
  
  
  
  1.12      +1 -0      jakarta-jetspeed/src/java/org/apache/jetspeed/modules/localization/JetspeedLocalization_it.properties
  
  Index: JetspeedLocalization_it.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/localization/JetspeedLocalization_it.properties,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- JetspeedLocalization_it.properties	5 Jun 2003 18:25:26 -0000	1.11
  +++ JetspeedLocalization_it.properties	19 Jun 2003 19:19:31 -0000	1.12
  @@ -263,3 +263,4 @@
   BOTTOM_SUPPORT_MSG=Assistenza e Informazioni aggiuntive
   
   PSML_MANAGER_MY_PAGES=My Pages:
  +PSML_MANAGER_MANAGE_PAGES=Manage Pages
  
  
  
  1.12      +2 -1      jakarta-jetspeed/src/java/org/apache/jetspeed/modules/localization/JetspeedLocalization_ja.properties
  
  Index: JetspeedLocalization_ja.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/localization/JetspeedLocalization_ja.properties,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- JetspeedLocalization_ja.properties	5 Jun 2003 18:25:26 -0000	1.11
  +++ JetspeedLocalization_ja.properties	19 Jun 2003 19:19:31 -0000	1.12
  @@ -261,3 +261,4 @@
   BOTTOM_SUPPORT_MSG=Support and Additional Information
   
   PSML_MANAGER_MY_PAGES=My Pages:
  +PSML_MANAGER_MANAGE_PAGES=Manage Pages
  
  
  
  1.8       +1 -0      jakarta-jetspeed/src/java/org/apache/jetspeed/modules/localization/JetspeedLocalization_my.properties
  
  Index: JetspeedLocalization_my.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/localization/JetspeedLocalization_my.properties,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- JetspeedLocalization_my.properties	5 Jun 2003 18:25:26 -0000	1.7
  +++ JetspeedLocalization_my.properties	19 Jun 2003 19:19:31 -0000	1.8
  @@ -55,4 +55,5 @@
   REGISTRY_EDITOR_PORTLET_CATEGORY_GROUP=Category Group
   
   PSML_MANAGER_MY_PAGES=My Pages:
  +PSML_MANAGER_MANAGE_PAGES=Manage Pages
   
  
  
  
  1.10      +2 -1      jakarta-jetspeed/src/java/org/apache/jetspeed/modules/localization/JetspeedLocalization_nl.properties
  
  Index: JetspeedLocalization_nl.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/localization/JetspeedLocalization_nl.properties,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- JetspeedLocalization_nl.properties	5 Jun 2003 18:25:26 -0000	1.9
  +++ JetspeedLocalization_nl.properties	19 Jun 2003 19:19:31 -0000	1.10
  @@ -263,3 +263,4 @@
   BOTTOM_SUPPORT_MSG=Support and Additional Information
   
   PSML_MANAGER_MY_PAGES=My Pages:
  +PSML_MANAGER_MANAGE_PAGES=Manage Pages
  
  
  
  1.12      +2 -1      jakarta-jetspeed/src/java/org/apache/jetspeed/modules/localization/JetspeedLocalization_no.properties
  
  Index: JetspeedLocalization_no.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/localization/JetspeedLocalization_no.properties,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- JetspeedLocalization_no.properties	5 Jun 2003 18:25:26 -0000	1.11
  +++ JetspeedLocalization_no.properties	19 Jun 2003 19:19:31 -0000	1.12
  @@ -268,3 +268,4 @@
   BOTTOM_SUPPORT_MSG=Brukerst\u00F8tte og ytterligere informasjon
   
   PSML_MANAGER_MY_PAGES=My Pages:
  +PSML_MANAGER_MANAGE_PAGES=Manage Pages
  
  
  
  1.6       +5 -4      jakarta-jetspeed/src/java/org/apache/jetspeed/modules/localization/JetspeedLocalization_pl.properties
  
  Index: JetspeedLocalization_pl.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/localization/JetspeedLocalization_pl.properties,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- JetspeedLocalization_pl.properties	10 Jun 2003 16:05:23 -0000	1.5
  +++ JetspeedLocalization_pl.properties	19 Jun 2003 19:19:31 -0000	1.6
  @@ -8,8 +8,8 @@
   #
   # Polish characters and their equivalent codes:
   #
  -#   &#260
  -#   &#261
  +#   &#260 
  +#   &#261 \u0105
   #   &#262
   #   &#263
   #   &#280
  @@ -48,7 +48,7 @@
   PASSWORDREMINDER_EMAIL_BODY1=Has\u0142o do Twojego konta w Jetspeed:
   PASSWORDREMINDER_EMAIL_BODY2=Teraz mo\u017Cesz zalogowa\u0107 si\u0119 do systemu.
   PASSWORDREMINDER_EMAIL_FOOTER=Pozdrowienia,
  -PASSWORDREMINDER_EMAIL_PS=Pamitaj, Twoje imi\u0119 u\u017Cytkownika to:
  +PASSWORDREMINDER_EMAIL_PS=Pami\u0119taj, Twoje imi\u0119 u\u017Cytkownika to:
   PASSWORDREMINDER_EMAIL_SUBJECT=Powiadomienie o ha\u015Ble
   
   CREATENEWUSERANDCONFIRM_PWNOTMATCH=Przepraszamy, ale podane przez Ciebie has\u0142a nie
s\u0105 takie same.
  @@ -290,3 +290,4 @@
   REGISTRY_EDITOR_PORTLET_CATEGORY_GROUP=Category Group
   
   PSML_MANAGER_MY_PAGES=Moje Strony:
  +PSML_MANAGER_MANAGE_PAGES=Zarz\u0105dzaj Stronami
  
  
  
  1.4       +1 -0      jakarta-jetspeed/src/java/org/apache/jetspeed/modules/localization/JetspeedLocalization_tr.properties
  
  Index: JetspeedLocalization_tr.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/localization/JetspeedLocalization_tr.properties,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- JetspeedLocalization_tr.properties	5 Jun 2003 18:25:26 -0000	1.3
  +++ JetspeedLocalization_tr.properties	19 Jun 2003 19:19:31 -0000	1.4
  @@ -263,3 +263,4 @@
   BOTTOM_SUPPORT_MSG=Destek ve Ek Bilgiler
   
   PSML_MANAGER_MY_PAGES=My Pages:
  +PSML_MANAGER_MANAGE_PAGES=Manage Pages
  
  
  
  1.2       +31 -16    jakarta-jetspeed/src/java/org/apache/jetspeed/modules/parameters/MyPagesListBox.java
  
  Index: MyPagesListBox.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/parameters/MyPagesListBox.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MyPagesListBox.java	4 Jun 2003 16:00:32 -0000	1.1
  +++ MyPagesListBox.java	19 Jun 2003 19:19:32 -0000	1.2
  @@ -65,6 +65,7 @@
   import org.apache.jetspeed.services.Profiler;
   import org.apache.jetspeed.services.rundata.JetspeedRunData;
   import org.apache.jetspeed.util.PortletUtils;
  +import org.apache.jetspeed.modules.actions.portlets.PsmlManagerAction;
   
   // Turbine stuff
   import org.apache.turbine.util.Log;
  @@ -81,6 +82,7 @@
   
   public class MyPagesListBox extends VelocityParameterPresentationStyle
   {
  +
       /**
        * Put custom objects in the velocity context
        * 
  @@ -92,29 +94,42 @@
        */
       public void buildContext(RunData rundata, String name, String value, Map parms, Context
context)
       {
  -        // Initialize the query locator
  -        QueryLocator ql = new QueryLocator(QueryLocator.QUERY_USER);
  +        ArrayList entries = null;
  +
           try
           {
  -            JetspeedRunData jdata = (JetspeedRunData) rundata;
  -            ql.setUser(jdata.getJetspeedUser());
  -            //ql.setMediaType(jdata.getCapability().getPreferredMediaType());
  -            ArrayList entries = new ArrayList();
  -            Iterator i = Profiler.query(ql);
  -            while (i.hasNext())
  -            {
  -                Profile profile = (Profile) i.next();
  -                //System.out.println("MyPagesListBox: " + profile.getPath());
  +            entries = (ArrayList) rundata.getUser().getTemp(PsmlManagerAction.CACHED_PSML);
  +            if (entries == null)
  +            {            
  +                // Initialize the query locator
  +                QueryLocator ql = new QueryLocator(QueryLocator.QUERY_USER);
   
  -                String mediaType = profile.getMediaType();
  -                if (mediaType != null && mediaType.equals(jdata.getCapability().getPreferredMediaType()))
  +                JetspeedRunData jdata = (JetspeedRunData) rundata;
  +                ql.setUser(jdata.getJetspeedUser());
  +                //ql.setMediaType(jdata.getCapability().getPreferredMediaType());
  +                entries = new ArrayList();
  +                Iterator i = Profiler.query(ql);
  +                while (i.hasNext())
                   {
  -                    if (PortletUtils.canAccessProfile(rundata, profile))
  +                    Profile profile = (Profile) i.next();
  +
  +                    String mediaType = profile.getMediaType();
  +                    if (mediaType != null && mediaType.equals(jdata.getCapability().getPreferredMediaType()))
                       {
  -                        entries.add(profile);                
  +                        if (PortletUtils.canAccessProfile(rundata, profile))
  +                        {
  +                            if (Log.getLogger().isDebugEnabled())
  +                            {
  +                                Log.debug("MyPagesListBox: refreshing user profile list:
" + profile.getPath());
  +                            }
  +                            entries.add(profile);                
  +                        }
                       }
                   }
  +
  +                rundata.getUser().setTemp(PsmlManagerAction.CACHED_PSML, entries);
               }
  +
               context.put("pages", entries);
           }
           catch (Exception e)
  
  
  
  1.4       +4 -2      jakarta-jetspeed/src/java/org/apache/jetspeed/modules/parameters/VelocityParameterPresentationStyle.java
  
  Index: VelocityParameterPresentationStyle.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/parameters/VelocityParameterPresentationStyle.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- VelocityParameterPresentationStyle.java	27 Nov 2002 17:56:38 -0000	1.3
  +++ VelocityParameterPresentationStyle.java	19 Jun 2003 19:19:32 -0000	1.4
  @@ -117,7 +117,9 @@
           context.put("value", value);
           context.put("parms", parms);
           context.put("events", this.getJavascriptEvents());
  -        context.put("l10n", new LocalizationTool());
  +        LocalizationTool lt = new LocalizationTool();
  +        lt.init(data);
  +        context.put("l10n", lt);
           context.put("jslink", new BaseJetspeedLink(data));
   
           try
  
  
  
  1.34      +5 -1      jakarta-jetspeed/src/java/org/apache/jetspeed/util/template/JetspeedTool.java
  
  Index: JetspeedTool.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/util/template/JetspeedTool.java,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- JetspeedTool.java	16 Jun 2003 20:24:14 -0000	1.33
  +++ JetspeedTool.java	19 Jun 2003 19:19:32 -0000	1.34
  @@ -765,6 +765,10 @@
                                                                        JetspeedSecurity.PERMISSION_CUSTOMIZE);
                   Map portletParms = portlet.getPortletConfig().getInitParameters();
                   String parmStyle = portlet.getPortletConfig().getInitParameter(parmName
+ ".style");
  +
  +                // Add portlet reference
  +                portletParms.put(parmName.concat(".style.portlet"), portlet);
  +
                   if (canAccess)
                   {
                       if (parmStyle != null) 
  
  
  
  1.3       +2 -2      jakarta-jetspeed/webapp/WEB-INF/templates/vm/parameters/html/MyPagesListBox.vm
  
  Index: MyPagesListBox.vm
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/webapp/WEB-INF/templates/vm/parameters/html/MyPagesListBox.vm,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MyPagesListBox.vm	5 Jun 2003 18:25:28 -0000	1.2
  +++ MyPagesListBox.vm	19 Jun 2003 19:19:32 -0000	1.3
  @@ -4,7 +4,7 @@
           #foreach($event in $events.keySet()) $event="$events.get($event)" #end 
           onchange="location.href=this.options[this.selectedIndex].value">
     <!--option value="$!defaultEntry">-- Default --</OPTION-->
  -  <OPTION VALUE="$jslink.setRole("user","psml-manager")">-- Manage Pages --</OPTION>
  +  <OPTION VALUE="$jslink.setRole("user","psml-manager")">-- $l10n.PSML_MANAGER_MANAGE_PAGES
--</OPTION>
   #foreach ($entry in $pages)
   
       #if($!entry.GroupName)
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Mime
View raw message