portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject cvs commit: jakarta-jetspeed/xdocs security.xml
Date Wed, 07 Aug 2002 06:02:16 GMT
taylor      2002/08/06 23:02:16

  Modified:    docs/site security.html
               src/java/org/apache/jetspeed/modules/actions/controls
                        Info.java
               src/java/org/apache/jetspeed/modules/actions/portlets
                        CustomizeSetAction.java
               src/java/org/apache/jetspeed/om/dbpsml/map
                        JetspeedGroupProfileMapBuilder.java
                        JetspeedRoleProfileMapBuilder.java
                        JetspeedUserProfileMapBuilder.java
               src/java/org/apache/jetspeed/portal/controls
                        VelocityPortletControl.java
               src/java/org/apache/jetspeed/util/template JetspeedTool.java
               webapp/WEB-INF/conf JetspeedSecurity.properties
               webapp/WEB-INF/templates/vm/screens/html Info.vm
               xdocs    security.xml
  Log:
  Patch from Mark Orciuch to fix Info mode
  
  Revision  Changes    Path
  1.5       +144 -0    jakarta-jetspeed/docs/site/security.html
  
  Index: security.html
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/docs/site/security.html,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- security.html	2 Aug 2002 10:57:29 -0000	1.4
  +++ security.html	7 Aug 2002 06:02:15 -0000	1.5
  @@ -780,6 +780,150 @@
               </table>
                                                   <br />
                                                   <p>
  +The tables below defines default access actions and their corresponding icons (as shown
in the TitlePortletControl):
  +</p>
  +                                                <table>
  +                        <tr>
  +                        <td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
  +    <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  +                
  +			<b>Access Actions</b>
  +		
  +            </font>
  +</td>
  +            </tr>
  +                                <tr>
  +                        <td bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
  +    <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  +                Icon
  +            </font>
  +</td>
  +                                <td bgcolor="#039acc" colspan="" rowspan="" valign="top"
align="left">
  +    <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  +                Action
  +            </font>
  +</td>
  +                                <td bgcolor="#039acc" colspan="" rowspan="" valign="top"
align="left">
  +    <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  +                Description
  +            </font>
  +</td>
  +            </tr>
  +                                <tr>
  +                        <td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
  +    <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  +                N/A
  +            </font>
  +</td>
  +                                <td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top"
align="left">
  +    <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  +                view
  +            </font>
  +</td>
  +                                <td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top"
align="left">
  +    <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  +                Allows to select a portlet in customizer and view its contents
  +            </font>
  +</td>
  +            </tr>
  +                                <tr>
  +                        <td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
  +    <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  +                
  +			<img src="../../webapp/images/customize.gif" />
  +		
  +            </font>
  +</td>
  +                                <td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top"
align="left">
  +    <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  +                customize
  +            </font>
  +</td>
  +                                <td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top"
align="left">
  +    <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  +                Allows to customize a portlet once selected in profile
  +            </font>
  +</td>
  +            </tr>
  +                                <tr>
  +                        <td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
  +    <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  +                
  +			<img src="../../webapp/images/info.gif" />
  +		
  +            </font>
  +</td>
  +                                <td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top"
align="left">
  +    <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  +                info
  +            </font>
  +</td>
  +                                <td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top"
align="left">
  +    <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  +                Allows to view any additional information about a portlet
  +            </font>
  +</td>
  +            </tr>
  +                                <tr>
  +                        <td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
  +    <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  +                
  +			<img src="../../webapp/images/maximize.gif" />
  +		
  +            </font>
  +</td>
  +                                <td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top"
align="left">
  +    <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  +                maximize
  +            </font>
  +</td>
  +                                <td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top"
align="left">
  +    <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  +                Allows to view portlet in full screen mode
  +            </font>
  +</td>
  +            </tr>
  +                                <tr>
  +                        <td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
  +    <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  +                
  +			<img src="../../webapp/images/minimize.gif" />
  +		
  +            </font>
  +</td>
  +                                <td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top"
align="left">
  +    <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  +                minimize
  +            </font>
  +</td>
  +                                <td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top"
align="left">
  +    <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  +                Allows to minimize portlet (hide its content) and display its caption only
  +            </font>
  +</td>
  +            </tr>
  +                                <tr>
  +                        <td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
  +    <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  +                
  +			<img src="../../webapp/images/close.gif" />
  +		
  +            </font>
  +</td>
  +                                <td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top"
align="left">
  +    <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  +                close
  +            </font>
  +</td>
  +                                <td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top"
align="left">
  +    <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  +                Allows to temporarily close a portlet (hide its caption and content)
  +            </font>
  +</td>
  +            </tr>
  +            </table>
  +                                                <br />
  +                                                <p>
   Here is some examples:
   </p>
                                                       <div align="left">
  
  
  
  1.3       +7 -2      jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/controls/Info.java
  
  Index: Info.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/controls/Info.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Info.java	16 Jun 2001 09:40:36 -0000	1.2
  +++ Info.java	7 Aug 2002 06:02:15 -0000	1.3
  @@ -57,24 +57,29 @@
   // Turbine stuff
   import org.apache.turbine.modules.Action;
   import org.apache.turbine.util.RunData;
  +import org.apache.turbine.util.Log;
   import org.apache.jetspeed.services.rundata.JetspeedRunData;
   
   /**
    * Display information about the selected portlet
    * 
    * @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
  + * @author <a href="mailto:mark_orciuch@ngsltd.com">Mark Orciuch</a>
    */
   public class Info extends Action
   {
       public void doPerform( RunData rundata ) throws Exception
       {
   
  -        String name = ((JetspeedRunData)rundata).getPortlet();
  -        if ( name == null )
  +        String peid = rundata.getParameters().getString("js_peid");
  +        if ( peid == null )
           {
               rundata.setScreenTemplate("Ecs");
               return;
           }
  +
  +         JetspeedRunData jdata = (JetspeedRunData)rundata;
  +         jdata.setJs_peid(peid);
   
           // redirect to the info template
           rundata.setScreenTemplate("Info");
  
  
  
  1.23      +1 -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.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- CustomizeSetAction.java	23 Jul 2002 04:54:36 -0000	1.22
  +++ CustomizeSetAction.java	7 Aug 2002 06:02:15 -0000	1.23
  @@ -648,7 +648,7 @@
               //Make a master portlet list, we will eventually us this to build a category
list
               allPortlets.add(entry);
               // MODIFIED: Selection now takes care of the specified mediatype!
  -            if (JetspeedSecurity.checkPermission((JetspeedUser) data.getUser(), new PortalResource(entry),
JetspeedSecurity.PERMISSION_CUSTOMIZE) &&
  +            if (JetspeedSecurity.checkPermission((JetspeedUser) data.getUser(), new PortalResource(entry),
JetspeedSecurity.PERMISSION_VIEW) &&
                  ((!entry.isHidden()) 
                   && (!entry.getType().equals(PortletEntry.TYPE_ABSTRACT))
                   && entry.hasMediaType(mediaType)))
  
  
  
  1.11      +1 -1      jakarta-jetspeed/src/java/org/apache/jetspeed/om/dbpsml/map/JetspeedGroupProfileMapBuilder.java
  
  Index: JetspeedGroupProfileMapBuilder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/dbpsml/map/JetspeedGroupProfileMapBuilder.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- JetspeedGroupProfileMapBuilder.java	29 Jul 2002 02:25:27 -0000	1.10
  +++ JetspeedGroupProfileMapBuilder.java	7 Aug 2002 06:02:15 -0000	1.11
  @@ -11,7 +11,7 @@
   /**
     *  This class was autogenerated by Torque on: 
     *
  -  * [Thu Jul 25 18:56:56 PDT 2002]
  +  * [Mon Aug 05 12:13:35 PDT 2002]
     *
     */
   public class JetspeedGroupProfileMapBuilder implements MapBuilder
  
  
  
  1.11      +1 -1      jakarta-jetspeed/src/java/org/apache/jetspeed/om/dbpsml/map/JetspeedRoleProfileMapBuilder.java
  
  Index: JetspeedRoleProfileMapBuilder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/dbpsml/map/JetspeedRoleProfileMapBuilder.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- JetspeedRoleProfileMapBuilder.java	29 Jul 2002 02:25:27 -0000	1.10
  +++ JetspeedRoleProfileMapBuilder.java	7 Aug 2002 06:02:15 -0000	1.11
  @@ -11,7 +11,7 @@
   /**
     *  This class was autogenerated by Torque on: 
     *
  -  * [Thu Jul 25 18:56:56 PDT 2002]
  +  * [Mon Aug 05 12:13:35 PDT 2002]
     *
     */
   public class JetspeedRoleProfileMapBuilder implements MapBuilder
  
  
  
  1.11      +1 -1      jakarta-jetspeed/src/java/org/apache/jetspeed/om/dbpsml/map/JetspeedUserProfileMapBuilder.java
  
  Index: JetspeedUserProfileMapBuilder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/dbpsml/map/JetspeedUserProfileMapBuilder.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- JetspeedUserProfileMapBuilder.java	29 Jul 2002 02:25:27 -0000	1.10
  +++ JetspeedUserProfileMapBuilder.java	7 Aug 2002 06:02:15 -0000	1.11
  @@ -11,7 +11,7 @@
   /**
     *  This class was autogenerated by Torque on: 
     *
  -  * [Thu Jul 25 18:56:56 PDT 2002]
  +  * [Mon Aug 05 12:13:35 PDT 2002]
     *
     */
   public class JetspeedUserProfileMapBuilder implements MapBuilder
  
  
  
  1.20      +7 -1      jakarta-jetspeed/src/java/org/apache/jetspeed/portal/controls/VelocityPortletControl.java
  
  Index: VelocityPortletControl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/portal/controls/VelocityPortletControl.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- VelocityPortletControl.java	24 Jul 2002 03:21:18 -0000	1.19
  +++ VelocityPortletControl.java	7 Aug 2002 06:02:15 -0000	1.20
  @@ -110,6 +110,7 @@
    * 
    * @author <a href="mailto:re_carrasco@bco011.sonda.cl">Roberto Carrasco</a>
    * @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
  + * @author <a href="mark_orciuch@ngsltd.com">Mark Orciuch</a> 
    *
    * @version $Id$
    *
  @@ -244,6 +245,11 @@
                   {
                       actions.add( new PortletAction("info") );
                   }
  +            }
  +
  +            if ( (!customized) &&  state.allowInfo( rundata ) && (!actions.contains("info"))
)
  +            {
  +                actions.add( new PortletAction("info") );
               }
                          
               if ( (!customized) && (!maximized) && state.allowClose( rundata
) )
  
  
  
  1.20      +113 -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.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- JetspeedTool.java	29 Jul 2002 02:25:27 -0000	1.19
  +++ JetspeedTool.java	7 Aug 2002 06:02:15 -0000	1.20
  @@ -87,6 +87,7 @@
    *
    * @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
    * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
  + * @author <a href="mark_orciuch@ngsltd.com">Mark Orciuch</a>
    *
    * @version $Id$
    */
  @@ -311,6 +312,117 @@
               
           return customizer;
       }
  +
  +    /** This method retrieves the appropriate information portlet for the 
  +      *  current portlet
  +      *
  +      *  @param p the portlet to display information about
  +      *  @param data the RunData for this request
  +      *  @return the portlet object of the appropriate customizer
  +      */
  +     public static Portlet getPortletInfoPortlet(RunData data)
  +     {
  +         Portlet info = null;
  +         
  +         String name = JetspeedResources.getString("PortletInfoPortlet.name", "PortletInfoPortlet");
  + 
  +         try {
  + 
  +             if (null != data)
  +             {
  +                 JetspeedRunData jdata = (JetspeedRunData)data;
  +                 Profile profile = jdata.getProfile();
  + 
  +                 if (null == profile)
  +                 {
  +                     Log.warn("JetspeedTool: profile is null");
  +                     profile = Profiler.getProfile(jdata);
  +                     jdata.setProfile(profile);
  +                 }
  + 
  +                 Portlet source = findPortlet(data);
  +                 if (source != null) {
  +                     jdata.setPortlet(source.getName());
  +                     info = PortletFactory.getPortlet(name, "PortletInfoPortlet");
  +                     info.getPortletConfig().setPortletSkin(source.getPortletConfig().getPortletSkin());
  +                     PortletControl control = PortalToolkit.getControl((String)null);
  +                     if (control != null) 
  +                     {
  +                         control.setPortlet(info);
  +                         control.init();
  +                         return control;
  +                     }
  +                 }
  +             }
  +         } catch (Exception e) {
  +             Log.error(e);
  +         }
  +             
  +         return info;
  +     }
  + 
  +     /**
  +      * Finds portlet identified by js_peid in the current user's profile
  +      * 
  +      * @param rundata for this request
  +      * @return portlet identified by js_peid
  +      */
  +     private static Portlet findPortlet(RunData rundata) {
  + 
  +         Portlet found = null;
  +         JetspeedRunData jdata = (JetspeedRunData)rundata;
  +         String peid = jdata.getJs_peid();
  +         if (peid != null) 
  +         {
  +             Stack sets = new Stack();
  +             sets.push(jdata.getProfile().getRootSet());
  + 
  +             while ((found==null) && (sets.size() > 0))
  +             {
  +                 PortletSet set = (PortletSet)sets.pop();
  + 
  +                 if (set.getID().equals(peid))
  +                 {
  +                     found = set;
  +                 }
  +                 else
  +                 {
  +                     Enumeration en = set.getPortlets();
  +                     while((found==null) && en.hasMoreElements())
  +                     {
  +                         Portlet p = (Portlet)en.nextElement();
  + 
  +                         // unstack the controls to find the real PortletSets
  +                         Portlet real = p;
  +                         while (real instanceof PortletControl)
  +                         {
  +                             real = ((PortletControl)p).getPortlet();
  +                         }
  + 
  +                         if (real instanceof PortletSet)
  +                         {
  +                             if (real.getID().equals(peid))
  +                             {
  +                                 found=real;
  +                             }
  +                             else
  +                             {
  +                                 // we'll explore this set afterwards
  +                                 sets.push(real);
  +                             }
  +                         }
  +                         else if (p.getID().equals(peid))
  +                         {                        
  +                             found = p;
  +                         }
  +                     }
  +                 }
  +             }
  +         }
  + 
  +         return found;
  +     }
  +
   
       /** 
        * Return the content of a portal element given the id of the element. 
  
  
  
  1.26      +0 -0      jakarta-jetspeed/webapp/WEB-INF/conf/JetspeedSecurity.properties
  
  Index: JetspeedSecurity.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/webapp/WEB-INF/conf/JetspeedSecurity.properties,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  
  
  
  1.2       +3 -1      jakarta-jetspeed/webapp/WEB-INF/templates/vm/screens/html/Info.vm
  
  Index: Info.vm
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/webapp/WEB-INF/templates/vm/screens/html/Info.vm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Info.vm	11 Feb 2001 22:54:05 -0000	1.1
  +++ Info.vm	7 Aug 2002 06:02:15 -0000	1.2
  @@ -1 +1,3 @@
  -$jetspeed.getPane("info")
  \ No newline at end of file
  +<!-- WEB-INF\templates\vm\screens\html\Info.vm -->
  +$data.setMode("customize")
  +$jetspeed.getPortletInfoPortlet($data).getContent($data)
  
  
  
  1.3       +56 -0     jakarta-jetspeed/xdocs/security.xml
  
  Index: security.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/xdocs/security.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- security.xml	17 Jul 2002 07:07:24 -0000	1.2
  +++ security.xml	7 Aug 2002 06:02:16 -0000	1.3
  @@ -290,6 +290,62 @@
   </table>
   <br/>
   <p>
  +The tables below defines default access actions and their corresponding icons (as shown
in the TitlePortletControl):
  +</p>
  +<table>
  +	<tr>
  +		<td>
  +			<b>Access Actions</b>
  +		</td>
  +	</tr>
  +	<tr>
  +		<th>Icon</th>
  +		<th>Action</th>
  +		<th>Description</th>
  +	</tr>
  +	<tr>
  +		<td>N/A</td>
  +		<td>view</td>
  +		<td>Allows to select a portlet in customizer and view its contents</td>
  +	</tr>
  +	<tr>
  +		<td>
  +			<img src="../../webapp/images/customize.gif"/>
  +		</td>
  +		<td>customize</td>
  +		<td>Allows to customize a portlet once selected in profile</td>
  +	</tr>
  +	<tr>
  +		<td>
  +			<img src="../../webapp/images/info.gif"/>
  +		</td>
  +		<td>info</td>
  +		<td>Allows to view any additional information about a portlet</td>
  +	</tr>
  +	<tr>
  +		<td>
  +			<img src="../../webapp/images/maximize.gif"/>
  +		</td>
  +		<td>maximize</td>
  +		<td>Allows to view portlet in full screen mode</td>
  +	</tr>
  +	<tr>
  +		<td>
  +			<img src="../../webapp/images/minimize.gif"/>
  +		</td>
  +		<td>minimize</td>
  +		<td>Allows to minimize portlet (hide its content) and display its caption only</td>
  +	</tr>
  +	<tr>
  +		<td>
  +			<img src="../../webapp/images/close.gif"/>
  +		</td>
  +		<td>close</td>
  +		<td>Allows to temporarily close a portlet (hide its caption and content)</td>
  +	</tr>
  +</table>
  +<br/>
  +<p>
   Here is some examples:
   </p>
   <source><![CDATA[
  
  
  

--
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