portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pau...@apache.org
Subject cvs commit: jakarta-jetspeed/docs/site changes.html
Date Thu, 08 Aug 2002 03:05:41 GMT
paulsp      2002/08/07 20:05:41

  Modified:    xdocs    changes.xml
               webapp/WEB-INF/templates/vm/portlets/html
                        customizer-portletset.vm
               src/java/org/apache/jetspeed/modules/actions/portlets
                        CustomizeSetAction.java
               docs/site changes.html
  Added:       webapp/WEB-INF/templates/vm/portlets/html
                        customizer-portletset-addref.vm
  Log:
  Customizer can now add reference.
  
  Notes:
  o  Only 1 reference will be displayed.  Looking into problem
  o  Need to add limits on references displayed
  
  Revision  Changes    Path
  1.59      +4 -1      jakarta-jetspeed/xdocs/changes.xml
  
  Index: changes.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/xdocs/changes.xml,v
  retrieving revision 1.58
  retrieving revision 1.59
  diff -u -r1.58 -r1.59
  --- changes.xml	5 Aug 2002 11:41:04 -0000	1.58
  +++ changes.xml	8 Aug 2002 03:05:41 -0000	1.59
  @@ -24,6 +24,9 @@
   -->
         </ul>
   <li>
  +  Add - 2002/08/07 - Customizer can now add a reference.
  +</li>
  +<li>
     Add - 2002/08/05 - Added cancel button to the MultiColumnController customizer
   </li>
   <li>
  
  
  
  1.12      +15 -0     jakarta-jetspeed/webapp/WEB-INF/templates/vm/portlets/html/customizer-portletset.vm
  
  Index: customizer-portletset.vm
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/webapp/WEB-INF/templates/vm/portlets/html/customizer-portletset.vm,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- customizer-portletset.vm	23 Jul 2002 00:03:57 -0000	1.11
  +++ customizer-portletset.vm	8 Aug 2002 03:05:41 -0000	1.12
  @@ -36,6 +36,21 @@
         </form>
      </td>
     
  +    <td nowrap align="center" width="20%">
  +      #if ($!mtype) 
  +        <form action="$jslink.Template.addPathInfo("mode","addref").addQueryData('mtype',
$mtype)" method="post">
  +      #else
  +        <form action="$jslink.Template" method="post">
  +      #end
  +
  +        #if ($allowportlet=="true")
  +          <input type="submit" value="$l10n.CUSTOMIZER_ADDREFERENCE" >
  +        #else
  +          <input type="submit" value="$l10n.CUSTOMIZER_ADDREFERENCE" disabled >
  +        #end
  +      </form>
  +   </td>
  +
      <td nowrap align="center" width="20%">
         #if ($!mtype) 
           <form action="$jslink.Template.addPathInfo("mode","addset").addQueryData('mtype',
$mtype)" method="post">
  
  
  
  1.1                  jakarta-jetspeed/webapp/WEB-INF/templates/vm/portlets/html/customizer-portletset-addref.vm
  
  Index: customizer-portletset-addref.vm
  ===================================================================
  #set ($mtype = $!data.Parameters.getString("mtype"))
  #if ($!mtype) 
      <form action="$jslink.Template.addQueryData('mtype', $mtype)" method="post">
  #else
      <form action="$jslink.Template" method="post">
  #end
    #if ($action) <input name="$jslink.ActionKey" type="hidden" value="$action" > #end

  
  <table width=100%" border="1" cellpadding="0" cellspacing="0">
  <tr>
      <td colspan="5"><img src="images/blank.gif" width="20%" height="1" border="0"></td>
      <td><img src="images/blank.gif" width="80%" height="1" border="0"></td>
  </tr>
  
  #foreach ( $entry in $psml )
  
      #if($!entry.GroupName)
          #set ($category = "Group")
          #set ($catName = $!entry.GroupName)
          #set ($link1 = $jslink.setGroup($catName))
      #elseif($!entry.RoleName)
          #set ($category = "Role")
          #set ($catName = $!entry.RoleName)
          #set ($link1 = $jslink.setRole($catName))
      #elseif($!entry.UserName)
          #set ($category = "User")
          #set ($catName = $!entry.UserName)
          #set ($link1 = $jslink.setUser($catName))
      #else
          #set ($category = "null")
          #set ($catName = "null")
      #end
  
      #if ($!entry.MediaType)
          #set ($mediaType = $entry.MediaType)
      #else
          #set ($mediaType = "null")
      #end
  
      #if ($!entry.Language)
          #set ($language = $!entry.Language)
      #else
          #set ($language = "null")
      #end
  
      #if ($!entry.Country)
          #set ($country = $!entry.Country)
      #else
          #set ($country = "null")
      #end
  
      #set ($blank = 1)
  
      #if($!entry.GroupName)
          #set ($link1 = $jslink.setGroup($catName,$entry.Name))
      #elseif($!entry.RoleName)
          #set ($link1 = $jslink.setRole($catName,$entry.Name))
      #elseif($!entry.UserName)
          #set ($link1 = $jslink.setUser($catName,$entry.Name))
      #end
  
      #if ($category != "null")
          #if ($prevCategory == $category)
          #else
              <tr>
                  <td style="font-size:10">$!category</td>
                  <td colspan=5><img src="images/blank.gif" height="1" border="0"></td>
              </tr>
          #end
      #end
  
      #if ($catName != "null")
          #if($prevCatName == $catName)
          #else
              <tr>
                  <td><img src="images/blank.gif"height="1" border="0"></td>
                  <td style="font-size:10">$!catName</td>
                  <td colspan=4><img src="images/blank.gif" height="1" border="0"></td>
              </tr>
          #end
      #end
  
      #if ($mediaType != "null")
          #set ($link1 = $link1.addPathInfo("mtype",$mediaType))
          #set ($link1 = $link1.addPathInfo("reset","on"))
          #set ($blank = $blank + 1 )
          #if($prevMediaType == $mediaType)
              #if($prevCatName == $catName)
              #else
              <tr>
                  #foreach ($index in [1..$blank])
                      <td><img src="images/blank.gif" height="1" border="0"></td>
                  #end
                  <td style="font-size:10">$mediaType</td>
                  <td colspan="3"><img src="images/blank.gif" height="1" border="0"></td>
          </tr>
              #end
          #else
              <tr>
                  #foreach ($index in [1..$blank])
                  <td><img src="images/blank.gif" height="1" border="0"></td>
                  #end
                  <td style="font-size:10">$mediaType</td>
                  <td colspan="3"><img src="images/blank.gif" height="1" border="0"></td>
              </tr>
          #end
      #end
  
      #if ($language != "null")
          #set ($link1 = $link1.addPathInfo("language",$language))
          #set ($blank = $blank + 1 )
          #if($prevLanguage == $language)
              #if ($prevMediaType == $mediaType)
              #else
              <tr>
                  #foreach ($index in [1..$blank])
                      <td style="font-size:10">&nbsp;</td>
                  #end
                  <td style="font-size:10">$language</td>
                  <td colspan="2"><img src="images/blank.gif"height="1" border="0"></td>
              </tr>
              #end
          #else
          <tr>
              #foreach ($index in [1..$blank])
                  <td style="font-size:10">&nbsp;</td>
              #end
                  <td style="font-size:10">$language</td>
                  <td colspan="2"><img src="images/blank.gif"height="1" border="0"></td>
          </tr>
          #end
      #else
          #set ($link1 = $link1.addPathInfo("language","-1"))
      #end
  
      #if ($country!= "null")
          #set ($link1 = $link1.addPathInfo("country",$country))
          #set ($blank = $blank + 1 )
          #if($prevCountry == $country)
              #if($prevLanguage == $language)
              #else
              <tr>
                  #foreach ($index in [1..$blank])
                      <td style="font-size:10">&nbsp;</td>
                  #end
                  <td style="font-size:10">$country</td>
                  <td><img src="images/blank.gif" height="1" border="0"></td>
              </tr>
              #end
          #else
          <tr>
              #foreach ($index in [1..$blank])
                  <td style="font-size:10">&nbsp;</td>
              #end
                  <td style="font-size:10">$country</td>
                  <td><img src="images/blank.gif" height="1" border="0"></td>
          </tr>
          #end
      #end
  
      #set ($link1 = $link1.setAction("controls.Customize"))
      <tr>
          #set ($blank = $blank + 1 )
          #foreach ($index in [1..$blank])
                  <td><img src="images/blank.gif"height="1" border="0"></td>
          #end
          #set ($number = 6 - $blank)
          <td colspan=$number>
          <table width="100%" border=0 cellpadding=0 cellspacing=0>
              <tr>
                  <td align=left>
                      $!entry.Name
                  </td>
                  <td align=right>
                     Add Reference &nbsp;&nbsp;<input type="checkbox" name="refname"
value="$entry.path" >
                  </td>
              </tr>
          </table>
          </td>
          
      </tr>
  
      #set ($prevCategory = $category)
      #set ($prevCatName = $catName)
      #set ($prevMediaType = $mediaType)
      #set ($prevLanguage = $language)
      #set ($prevCountry = $country)
  
  #end
  <tr/>
  </table>
  <center>
    <table cellspacing="2">
      <tr>
        <td>
          #if ($prev)
            #set ($mtype = $!data.Parameters.getString("mtype"))
            #if ($!mtype) 
              <a href="$jslink.setTemplate("Customize").addPathInfo("start",$prev).addQueryData('mtype',
$mtype)">$l10n.CUSTOMIZER_PREVIOUSBTN</a>
            #else
              <a href="$jslink.setTemplate("Customize").addPathInfo("start",$prev)">$l10n.CUSTOMIZER_PREVIOUSBTN</a>
            #end
  
          #else
          &nbsp;
          #end
        </td>
        <td>
          <input type="submit" name="eventSubmit_doAddRef" value="$l10n.CUSTOMIZER_APPLY">
        </td>
        <td>
          <input type="submit" name="eventSubmit_doCancel" value="$l10n.CUSTOMIZER_CANCEL">
        </td>
        <td>
          #if ($next)
            #set ($mtype = $!data.Parameters.getString("mtype"))
            #if ($!mtype) 
            <a href="$jslink.setTemplate("Customize").addPathInfo("start",$next).addQueryData('mtype',
$mtype)">$l10n.CUSTOMIZER_NEXTBTN</a>
            #else
            <a href="$jslink.setTemplate("Customize").addPathInfo("start",$next)">$l10n.CUSTOMIZER_NEXTBTN</a>
            #end
          #else
          &nbsp;
          #end
          </td>
        </tr>
      </table>
    </center>
  
  </form>
    
  
  
  
  1.24      +68 -1     jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/portlets/CustomizeSetAction.java
  
  Index: CustomizeSetAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/portlets/CustomizeSetAction.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- CustomizeSetAction.java	7 Aug 2002 06:02:15 -0000	1.23
  +++ CustomizeSetAction.java	8 Aug 2002 03:05:41 -0000	1.24
  @@ -60,6 +60,7 @@
   import org.apache.jetspeed.portal.PortletController;
   import org.apache.jetspeed.portal.PortletSetController;
   import org.apache.jetspeed.portal.portlets.VelocityPortlet;
  +import org.apache.jetspeed.services.Profiler;
   import org.apache.jetspeed.services.Registry;
   import org.apache.jetspeed.services.PortalToolkit;
   import org.apache.jetspeed.services.TemplateLocator;
  @@ -67,6 +68,7 @@
   import org.apache.jetspeed.om.BaseSecurityReference;
   import org.apache.jetspeed.om.SecurityReference;
   import org.apache.jetspeed.om.profile.Profile;
  +import org.apache.jetspeed.om.profile.QueryLocator;
   import org.apache.jetspeed.om.registry.RegistryEntry;
   import org.apache.jetspeed.om.registry.PortletEntry;
   import org.apache.jetspeed.om.registry.PortletInfoEntry;
  @@ -77,6 +79,8 @@
   import org.apache.jetspeed.om.profile.psml.PsmlPortlets;
   import org.apache.jetspeed.om.profile.Entry;
   import org.apache.jetspeed.om.profile.psml.PsmlEntry;
  +import org.apache.jetspeed.om.profile.Reference;
  +import org.apache.jetspeed.om.profile.psml.PsmlReference;
   import org.apache.jetspeed.om.profile.Skin;
   import org.apache.jetspeed.om.profile.psml.PsmlSkin;
   import org.apache.jetspeed.om.profile.MetaInfo;
  @@ -283,7 +287,41 @@
                   
               context.put("browser", portlets.subList(start,end));
           }
  -        else                         // build context for layout mode
  +        else if ("addref".equals(mode))
  +        {
  +            Iterator psmlIterator = null;
  +            psmlIterator = Profiler.query(new QueryLocator(QueryLocator.QUERY_ALL));
  +            int start = rundata.getParameters().getInt("start",0);                
  +            int size = 15;
  +                
  +            try
  +            {
  +                size = Integer.parseInt(portlet.getPortletConfig()
  +                                               .getInitParameter("size"));
  +            }
  +            catch (Exception e)
  +            {
  +                // ignore
  +            }
  +                
  +//            int end = Math.min(start+size, portlets.size());
  +            int end = Math.min(start+size, 100);
  +                
  +            if (start > 0)
  +            {
  +                context.put("prev",String.valueOf(Math.max(start - size,0)));
  +            }
  +                
  +//            if (start + size < portlets.size() )
  +            if (start + size < 100 )
  +            {
  +                context.put("next",String.valueOf(start + size));
  +            }
  +                
  +            //context.put("browser", portlets.subList(start,end));
  +            context.put("psml", psmlIterator);
  +        }
  +        else // build context for layout mode
           {
               // nothing specific to do
           }
  @@ -441,6 +479,35 @@
           }
            */
           
  +    }
  +
  +    /** Add new Reference in the customized set */
  +    public void doAddref(RunData rundata, Context context) throws Exception
  +    {
  +        AutoProfile.doIt (rundata, true);
  +
  +        PortletSet set = (PortletSet)((JetspeedRunData)rundata).getCustomized();
  +        String[] refNames = rundata.getParameters().getStrings("refname");
  +        
  +        // Create a ClearPortletControl
  +        Control ctrl = new PsmlControl();
  +        ctrl.setName ("ClearPortletControl");
  +
  +        
  +        if ( (refNames != null) && (set != null) )
  +        {
  +            Portlets portlets = ((JetspeedRunData)rundata).getProfile()
  +                                            .getDocument()
  +                                            .getPortletsById(set.getID());
  +
  +            for (int i = 0; i < refNames.length; i++)
  +            {
  +              Reference ref = new PsmlReference();
  +              ref.setPath( refNames[i]);
  +              portlets.addReference(ref);
  +            }
  +        }
  +        rundata.getUser().setTemp("mode","layout");
       }
       
       /** Sets the metainfo for this entry */
  
  
  
  1.41      +3 -0      jakarta-jetspeed/docs/site/changes.html
  
  Index: changes.html
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/docs/site/changes.html,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- changes.html	5 Aug 2002 11:41:04 -0000	1.40
  +++ changes.html	8 Aug 2002 03:05:41 -0000	1.41
  @@ -130,6 +130,9 @@
   -->
         </ul>
                                                   <li>
  +  Add - 2002/08/07 - Customizer can now add a reference.
  +</li>
  +                                                <li>
     Add - 2002/08/05 - Added cancel button to the MultiColumnController customizer
   </li>
                                                   <li>
  
  
  

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


Mime
View raw message