You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by ta...@apache.org on 2004/05/11 05:54:18 UTC

cvs commit: jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/velocity JetspeedPowerTool.java

taylor      2004/05/10 20:54:18

  Modified:    portal/src/java/org/apache/jetspeed/velocity
                        JetspeedPowerTool.java
  Log:
  portlet modes implemented, needs some optimization and to be tied in with configuration still
  
  PR:
  Obtained from:
  Submitted by:	
  Reviewed by:	
  CVS: ----------------------------------------------------------------------
  CVS: PR:
  CVS:   If this change addresses a PR in the problem report tracking
  CVS:   database, then enter the PR number(s) here.
  CVS: Obtained from:
  CVS:   If this change has been taken from another system, such as NCSA,
  CVS:   then name the system in this line, otherwise delete it.
  CVS: Submitted by:
  CVS:   If this code has been contributed to Apache by someone else; i.e.,
  CVS:   they sent us a patch or a new module, then include their name/email
  CVS:   address here. If this is your work then delete this line.
  CVS: Reviewed by:
  CVS:   If we are doing pre-commit code reviews and someone else has
  CVS:   reviewed your changes, include their name(s) here.
  CVS:   If you have not had it reviewed then delete this line.
  
  Revision  Changes    Path
  1.14      +28 -1     jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/velocity/JetspeedPowerTool.java
  
  Index: JetspeedPowerTool.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/velocity/JetspeedPowerTool.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- JetspeedPowerTool.java	8 May 2004 02:14:03 -0000	1.13
  +++ JetspeedPowerTool.java	11 May 2004 03:54:18 -0000	1.14
  @@ -638,6 +638,24 @@
               actions.add(createAction(ACTION_MAXIMIZE));
               actions.add(createAction(ACTION_NORMAL));                        
           }
  +        
  +        PortletMode mode = getPortletMode();
  +        String m = mode.toString();
  +        if (m.equals(PortletMode.VIEW.toString()))
  +        {
  +            actions.add(createAction(ACTION_EDIT));
  +            actions.add(createAction(ACTION_HELP));            
  +        }
  +        else if (m.equals(PortletMode.EDIT.toString()))
  +        {
  +            actions.add(createAction(ACTION_VIEW));
  +            actions.add(createAction(ACTION_HELP));                        
  +        }
  +        else // help 
  +        {
  +            actions.add(createAction(ACTION_VIEW));
  +            actions.add(createAction(ACTION_EDIT));                        
  +        }
           return actions;
       }
       
  @@ -660,6 +678,15 @@
               case ACTION_NORMAL:
                   url.setWindowState(WindowState.NORMAL);
                   break;
  +            case ACTION_VIEW:
  +                url.setPortletMode(PortletMode.VIEW);
  +                break;
  +            case ACTION_EDIT:
  +                url.setPortletMode(PortletMode.EDIT);
  +                break;
  +            case ACTION_HELP:
  +                url.setPortletMode(PortletMode.HELP);
  +                break;                                
           }
           
           action.setAction(url.toString());
  
  
  

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