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/xdocs changes.xml
Date Fri, 15 Nov 2002 17:27:19 GMT
morciuch    2002/11/15 09:27:18

  Modified:    docs/site changes.html
               src/java/org/apache/jetspeed/modules/actions/controllers
                        MultiColumnControllerAction.java
               src/java/org/apache/jetspeed/modules/parameters
                        RegistryEntryListBox.java
               webapp/WEB-INF/conf admin.xreg controls.xreg
               webapp/WEB-INF/templates/vm/controllers/html
                        multicolumn-customize.vm
               webapp/WEB-INF/templates/vm/portlets/html
                        customizer-portletset-layout.vm
               xdocs    changes.xml
  Log:
  Allow to customize control for each portlet in the layout customizer (see Bugzilla bug #
13252).
  
  List of available controls is limited to ones with parameter "simple" set to "true" in control
registry. Currently, there are 3 available controls: TitlePortletControl, BoxControl and ClearPortletControl.
  
  Revision  Changes    Path
  1.71      +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.70
  retrieving revision 1.71
  diff -u -r1.70 -r1.71
  --- changes.html	14 Nov 2002 22:43:32 -0000	1.70
  +++ changes.html	15 Nov 2002 17:27:17 -0000	1.71
  @@ -133,6 +133,9 @@
   </li>
   -->
   <li>
  +  Add - Bug # 13252 - 2002/11/15 - Allow to customize control for each portlet in layout
customizer (MO)
  +</li>
  +<li>
     Add - 2002/11/14 - Jetspeed/Axis Integration, ChangeLanguagePortlet (DT)
   </li>
   <li>
  
  
  
  1.24      +36 -0     jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/controllers/MultiColumnControllerAction.java
  
  Index: MultiColumnControllerAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/controllers/MultiColumnControllerAction.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- MultiColumnControllerAction.java	8 Nov 2002 23:13:44 -0000	1.23
  +++ MultiColumnControllerAction.java	15 Nov 2002 17:27:17 -0000	1.24
  @@ -58,6 +58,8 @@
   import org.apache.jetspeed.om.registry.PortletEntry;
   import org.apache.jetspeed.om.profile.IdentityElement;
   import org.apache.jetspeed.om.profile.Entry;
  +import org.apache.jetspeed.om.profile.psml.PsmlControl;
  +import org.apache.jetspeed.services.PortalToolkit;
   import org.apache.jetspeed.om.profile.MetaInfo;
   import org.apache.jetspeed.om.profile.Layout;
   import org.apache.jetspeed.om.profile.Parameter;
  @@ -557,6 +559,40 @@
           if ((col > -1) && (row > -1) && (row < columns[col].size()
- 1))
           {
               move(columns, col, row, col, row + 1);
  +        }
  +    }
  +
  +    public void doControl(RunData data, Context context)
  +    {
  +        JetspeedRunData jdata = (JetspeedRunData) data;
  +
  +        String controlName = data.getParameters().getString("control");
  +        String id = data.getParameters().getString("js_peid");
  +
  +        try
  +        {
  +            Entry entry = jdata.getCustomizedProfile().getDocument().getEntryById(id);
  +
  +            if (entry != null)
  +            {
  +                if (controlName != null && controlName.trim().length() > 0)
  +                {
  +                    PsmlControl control = new PsmlControl();
  +                    control.setName(controlName);
  +                    if (control != null)
  +                    {
  +                        entry.setControl(control);
  +                    }
  +                }
  +                else
  +                {
  +                    entry.setControl(null);
  +                }
  +            }
  +        }
  +        catch (Exception e)
  +        {
  +            Log.error(e);
           }
       }
   
  
  
  
  1.2       +29 -3     jakarta-jetspeed/src/java/org/apache/jetspeed/modules/parameters/RegistryEntryListBox.java
  
  Index: RegistryEntryListBox.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/parameters/RegistryEntryListBox.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RegistryEntryListBox.java	12 Nov 2002 22:19:00 -0000	1.1
  +++ RegistryEntryListBox.java	15 Nov 2002 17:27:17 -0000	1.2
  @@ -64,6 +64,7 @@
   import org.apache.jetspeed.om.profile.ProfileLocator;
   import org.apache.jetspeed.om.registry.PortletInfoEntry;
   import org.apache.jetspeed.om.registry.RegistryEntry;
  +import org.apache.jetspeed.om.registry.Parameter;
   import org.apache.jetspeed.om.security.JetspeedUser;
   import org.apache.jetspeed.services.JetspeedSecurity;
   import org.apache.jetspeed.services.Registry;
  @@ -83,6 +84,7 @@
    * <LI><code>null-if-empty</code> [<strong>true</strong>|false]
- do not return a select control if item list is empty</LI>   
    * <LI><code>set-label</code> [<strong>false</strong>|true]
- put label in front of the list box based on the registry name</LI>    
    * <LI><code>disabled-if-wml</code> [<strong>false</strong>|true]
- set disabled attribute for the list box if using wml</LI>     
  + * <LI><code>select-if-simple</code> [<strong>false</strong>|true]
- select only entries with parameter "simple" set to true</LI>   
    * </UL> 
    * @author <a href="morciuch@apache.org">Mark Orciuch</a>
    * @version $Id$  
  @@ -96,6 +98,7 @@
       public static final String OPTION_NULL_IF_EMPTY = "null-if-empty";
       public static final String OPTION_SET_LABEL = "set-label";
       public static final String OPTION_DISABLED_IF_WML = "disabled-if-wml";
  +    public static final String OPTION_SELECT_IF_SIMPLE = "select-if-simple";
   
       /**
        * Put custom objects in the velocity context
  @@ -117,6 +120,7 @@
           String nullIfEmpty = (String)getParm(OPTION_NULL_IF_EMPTY, "true");
           boolean setLabel = (new Boolean((String)getParm(OPTION_SET_LABEL, "false"))).booleanValue();
           boolean disabledIfWML = (new Boolean((String)getParm(OPTION_DISABLED_IF_WML, "false"))).booleanValue();
  +        boolean selectIfSimple = (new Boolean((String)getParm(OPTION_SELECT_IF_SIMPLE,
"false"))).booleanValue();
   
           // Iterate thru entries from selected registry
           List list = new ArrayList();
  @@ -124,13 +128,31 @@
           {
               RegistryEntry entry = Registry.getEntry(regName, (String)i.next());
               boolean selected = false;
  -            selected = JetspeedSecurity.checkPermission((JetspeedUser)data.getUser(), new
PortalResource(entry), "customize");
  +            selected = JetspeedSecurity.checkPermission((JetspeedUser) data.getUser(),
new PortalResource(entry), "customize");
               if (selected && !selectHidden)
  +            {
                   selected = !entry.isHidden();
  +            }
               if (selected && (entry instanceof PortletInfoEntry))
  -                selected = ((PortletInfoEntry)entry).hasMediaType(mediaType);
  +            {
  +                selected = ((PortletInfoEntry) entry).hasMediaType(mediaType);
  +            }
  +            if (selected && selectIfSimple)
  +            {
  +                Parameter simpleParam = ((PortletInfoEntry) entry).getParameter("simple");
  +                if (simpleParam != null)
  +                {
  +                    selected = new Boolean(simpleParam.getValue()).booleanValue();
  +                }
  +                else
  +                {
  +                    selected = false;
  +                }
  +            }
               if (selected)
  +            {
                   list.add(entry);
  +            }
           }
   
           // Perform optional sort of list box items
  @@ -172,6 +194,10 @@
           else if (regName.equals(Registry.PORTLET_CONTROL))
           {
               label = Localization.getString("CUSTOMIZER_DECORATION");
  +        }
  +        else if (regName.equals(Registry.CLIENT))
  +        {
  +            label = "Client";
           }
           else
           {
  
  
  
  1.27      +8 -0      jakarta-jetspeed/webapp/WEB-INF/conf/admin.xreg
  
  Index: admin.xreg
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/webapp/WEB-INF/conf/admin.xreg,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- admin.xreg	12 Nov 2002 22:19:00 -0000	1.26
  +++ admin.xreg	15 Nov 2002 17:27:17 -0000	1.27
  @@ -47,6 +47,14 @@
       <parameter name="skin.style.registry" value="Skin" hidden="false" cachedOnName="true"
cachedOnValue="true"/>
       <parameter name="skin.style.disabled-if-wml" value="true" hidden="false" cachedOnName="true"
cachedOnValue="true"/>
       <parameter name="skin.style.javascript:onchange" value="document.skins.submit()"
hidden="false" cachedOnName="true" cachedOnValue="true"/>    
  +    <parameter name="control" value="" type="style" hidden="false" cachedOnName="true"
cachedOnValue="true"/>
  +    <parameter name="control.style" value="RegistryEntryListBox" hidden="false" cachedOnName="true"
cachedOnValue="true"/>
  +    <parameter name="control.style.registry" value="PortletControl" hidden="false" cachedOnName="true"
cachedOnValue="true"/>
  +    <parameter name="control.style.disabled-if-wml" value="true" hidden="false" cachedOnName="true"
cachedOnValue="true"/>
  +    <parameter name="control.style.select-hidden" value="true" hidden="false" cachedOnName="true"
cachedOnValue="true"/>
  +    <parameter name="control.style.select-if-simple" value="true" hidden="false" cachedOnName="true"
cachedOnValue="true"/>
  +    <parameter name="control.style.set-label" value="true" hidden="false" cachedOnName="true"
cachedOnValue="true"/>
  +    <parameter name="control.style.javascript:onchange" value="this.form.submit()" hidden="false"
cachedOnName="true" cachedOnValue="true"/>    
       <meta-info>
         <title>Customize pane</title>
       </meta-info>
  
  
  
  1.7       +3 -0      jakarta-jetspeed/webapp/WEB-INF/conf/controls.xreg
  
  Index: controls.xreg
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/webapp/WEB-INF/conf/controls.xreg,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- controls.xreg	23 Jul 2001 21:46:44 -0000	1.6
  +++ controls.xreg	15 Nov 2002 17:27:18 -0000	1.7
  @@ -5,6 +5,7 @@
     <portlet-control-entry name="ClearPortletControl" hidden="true">
       <classname>org.apache.jetspeed.portal.controls.VelocityPortletControl</classname>
       <parameter name="theme" value="clear.vm"/>
  +    <parameter name="simple" value="true" hidden="false"/>    
       <meta-info>
         <title>ClearPortletControl</title>
       </meta-info>
  @@ -26,6 +27,7 @@
       <classname>org.apache.jetspeed.portal.controls.VelocityPortletControl</classname>
       <parameter name="theme" value="jetspeed-box.vm"/>
       <parameter name="thickness" value="2"/>
  +    <parameter name="simple" value="true" hidden="false"/>    
       <meta-info>
         <title>Boxed titled control</title>
       </meta-info>
  @@ -35,6 +37,7 @@
     <portlet-control-entry name="TitlePortletControl">
       <classname>org.apache.jetspeed.portal.controls.VelocityPortletControl</classname>
       <parameter name="theme" value="jetspeed.vm"/>
  +    <parameter name="simple" value="true" hidden="false"/>    
       <meta-info>
         <title>Simple titled control</title>
       </meta-info>
  
  
  
  1.15      +37 -2     jakarta-jetspeed/webapp/WEB-INF/templates/vm/controllers/html/multicolumn-customize.vm
  
  Index: multicolumn-customize.vm
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/webapp/WEB-INF/templates/vm/controllers/html/multicolumn-customize.vm,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- multicolumn-customize.vm	2 Sep 2002 18:33:08 -0000	1.14
  +++ multicolumn-customize.vm	15 Nov 2002 17:27:18 -0000	1.15
  @@ -3,6 +3,7 @@
   <br>
   <table border="0" cellpadding="2" cellspacing="0" width="100%">
   <tr>
  +#set ($ndx = 0)
   #set ($col = 0)
   #foreach ( $column in $portlets )
   #set ($row = 0)
  @@ -110,10 +111,44 @@
                 </td>
               </tr>
   #end
  +</form>
  +#if ($portlet.Control.Name) 
  +   #set ($controlListBox = $jetspeed.getPortletParameter($data, $data.User.getTemp("customizer"),
"control", $portlet.Control.Name))
  + #else 
  +   #set ($controlListBox = $jetspeed.getPortletParameter($data, $data.User.getTemp("customizer"),
"control")) 
  +#end
  +
  +#if (!$portlet.Path && $controlListBox)      
  +      
  +            <tr>
  +              <td#if(${skin.ContentStyleClass}) class="${skin.ContentStyleClass}" #end
#if(${skin.BackgroundColor}) style="background-color: ${skin.BackgroundColor}" #end>
  +                <table width="100%"> ## Including table to match alignment.
  +                  <tr>
  +                    <td>
  +        #if ($!mtype) 
  +                        <form name="decorations$ndx" action="$jslink.Template.addQueryData('mtype',
$mtype)" method="post">
  +        #else
  +                        <form name="decorations$ndx" action="$jslink.Template" method="post">
  +        #end
  +        #if ($action) 
  +                                <input name="$jslink.ActionKey" type="hidden" value="$action">

  +        #end
  +                                <input name="js_peid" type="hidden" value="$portlet.id">

  +                                <input type="hidden" name="eventSubmit_doControl" value="doControl">
       
  +                                $controlListBox
  +                        </form>
  +        #set ($ndx = $ndx + 1)            
  +                    </td>
  +                  </tr>
  +                </table>
  +              </td>
  +            </tr>
  +#end
  +
             </table>
             </td></tr>
             </table>
  -          </form>
  +          ##</form>
           </td>
         </tr>
   #set ($row = $row + 1)
  
  
  
  1.12      +2 -0      jakarta-jetspeed/webapp/WEB-INF/templates/vm/portlets/html/customizer-portletset-layout.vm
  
  Index: customizer-portletset-layout.vm
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/webapp/WEB-INF/templates/vm/portlets/html/customizer-portletset-layout.vm,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- customizer-portletset-layout.vm	12 Nov 2002 22:19:00 -0000	1.11
  +++ customizer-portletset-layout.vm	15 Nov 2002 17:27:18 -0000	1.12
  @@ -128,4 +128,6 @@
       </tr>
     </table>
   </center>
  +## Set reference to customizer for access from the individual controller customizers
  +$data.User.setTemp("customizer",$customizer)
   $!set.Controller.getContent($data)
  
  
  
  1.92      +4 -1      jakarta-jetspeed/xdocs/changes.xml
  
  Index: changes.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/xdocs/changes.xml,v
  retrieving revision 1.91
  retrieving revision 1.92
  diff -u -r1.91 -r1.92
  --- changes.xml	14 Nov 2002 22:43:09 -0000	1.91
  +++ changes.xml	15 Nov 2002 17:27:18 -0000	1.92
  @@ -23,6 +23,9 @@
   </li>
   -->
   <li>
  +  Add - Bug # 13252 - 2002/11/15 - Allow to customize control for each portlet in layout
customizer (MO)
  +</li>
  +<li>
     Add - 2002/11/14 - Jetspeed/Axis Integration, ChangeLanguagePortlet (DT)
   </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