1 16 17 package org.apache.jetspeed.modules.actions.portlets.security; 18 19 import java.util.Iterator ; 20 21 import org.apache.velocity.context.Context; 23 24 import org.apache.turbine.util.RunData; 26 import org.apache.turbine.util.StringUtils; 27 28 29 import org.apache.jetspeed.services.JetspeedSecurity; 31 32 import org.apache.jetspeed.services.logging.JetspeedLogFactoryService; 34 import org.apache.jetspeed.services.logging.JetspeedLogger; 35 import org.apache.jetspeed.services.resources.JetspeedResources; 36 37 import org.apache.jetspeed.modules.actions.portlets.VelocityPortletAction; 39 import org.apache.jetspeed.portal.portlets.VelocityPortlet; 40 41 42 48 49 public class GroupBrowserAction extends VelocityPortletAction 50 { 51 54 private static final JetspeedLogger logger = JetspeedLogFactoryService.getLogger(GroupBrowserAction.class.getName()); 55 56 63 protected void buildMaximizedContext( VelocityPortlet portlet, 64 Context context, 65 RunData rundata ) 66 { 67 buildNormalContext( portlet, context, rundata); 68 } 69 70 78 protected void buildConfigureContext( VelocityPortlet portlet, 79 Context context, 80 RunData rundata ) 81 { 82 83 buildNormalContext( portlet, context, rundata); 84 } 85 86 93 protected void buildNormalContext( VelocityPortlet portlet, 94 Context context, 95 RunData rundata ) 96 { 97 try 98 { 99 Iterator groups = JetspeedSecurity.getGroups(); 100 context.put(SecurityConstants.CONTEXT_GROUPS, groups); 101 } 102 catch (Exception e) 103 { 104 logger.error("Exception", e); 106 107 rundata.setMessage("Error in Jetspeed Group Security: " + e.toString()); 108 rundata.setStackTrace(StringUtils.stackTrace(e), e); 109 rundata.setScreenTemplate(JetspeedResources.getString("template.error","Error")); 110 } 111 } 112 113 } 114 | Popular Tags |