1 package org.apache.jetspeed.modules.actions.portlets; 2 3 import org.apache.jetspeed.portal.portlets.AbstractVTLPortlet; 4 5 import org.apache.turbine.util.RunData; 7 import org.apache.turbine.modules.Action; 8 9 import org.apache.velocity.context.Context; 11 12 13 20 public abstract class AbstractVTLPortletAction extends Action 21 { 22 public void doPerform( RunData rundata ) 23 { 24 Context context = (Context)rundata.getTemplateInfo().getTemplateContext( "VTLPortletContext" ); 25 AbstractVTLPortlet xPortlet = (AbstractVTLPortlet)context.get( "portlet" ); 26 boolean loggedUser = rundata.getUser() != null && rundata.getUser().hasLoggedIn(); 27 28 29 if( xPortlet.isButtonConfigure( rundata ) ) 31 { 32 if( loggedUser ) 33 { 34 setConfigureContent( xPortlet, context, rundata ); 35 } 36 return; 37 } 38 39 if( xPortlet.isButtonMaximize( rundata ) ) 41 { 42 setMaximizedContent( xPortlet, context, rundata, loggedUser ); 43 return; 44 } 45 46 if( xPortlet.isMinimized( rundata ) ) 48 { 49 if( loggedUser ) 50 { 51 setMinimizedContent( xPortlet, context, rundata ); 52 } 53 return; 54 } 55 56 setNormalContent( xPortlet, context, rundata, loggedUser ); 58 } 59 60 abstract void setConfigureContent( AbstractVTLPortlet xPortlet, 62 Context context, RunData rundata ); 63 64 abstract void setMaximizedContent( AbstractVTLPortlet xPortlet, 66 Context context, RunData rundata, boolean loggedUser ); 67 68 abstract void setMinimizedContent( AbstractVTLPortlet xPortlet, 70 Context context, RunData rundata ); 71 72 abstract void setNormalContent( AbstractVTLPortlet xPortlet, 74 Context context, RunData rundata, boolean loggedUser ); 75 76 } 77 | Popular Tags |