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 import org.apache.jetspeed.services.JetspeedSecurity; 30 import org.apache.jetspeed.services.logging.JetspeedLogFactoryService; 31 import org.apache.jetspeed.services.logging.JetspeedLogger; 32 import org.apache.jetspeed.services.security.JetspeedSecurityException; 33 import org.apache.jetspeed.services.resources.JetspeedResources; 34 35 import org.apache.jetspeed.modules.actions.portlets.VelocityPortletAction; 37 import org.apache.jetspeed.portal.portlets.VelocityPortlet; 38 39 40 46 public class PermissionBrowserAction extends VelocityPortletAction 47 { 48 51 private static final JetspeedLogger logger = JetspeedLogFactoryService.getLogger(PermissionBrowserAction.class.getName()); 52 53 60 protected void buildMaximizedContext( VelocityPortlet portlet, 61 Context context, 62 RunData rundata ) 63 { 64 buildNormalContext( portlet, context, rundata); 65 } 66 67 75 protected void buildConfigureContext( VelocityPortlet portlet, 76 Context context, 77 RunData rundata ) 78 { 79 80 buildNormalContext( portlet, context, rundata); 81 } 82 83 90 protected void buildNormalContext( VelocityPortlet portlet, 91 Context context, 92 RunData rundata ) 93 { 94 try 95 { 96 Iterator permissions = JetspeedSecurity.getPermissions(); 97 context.put(SecurityConstants.CONTEXT_PERMISSIONS, permissions); 98 } 99 catch (JetspeedSecurityException e) 100 { 101 logger.error("Exception", e); 103 104 rundata.setMessage("Error in Jetspeed Permission Security: " + e.toString()); 105 rundata.setStackTrace(StringUtils.stackTrace(e), e); 106 rundata.setScreenTemplate(JetspeedResources.getString("template.error","Error")); 107 } 108 } 109 110 } | Popular Tags |