1 5 6 13 package org.exoplatform.services.portletcontainer.impl.portletAPIImp.utils; 14 15 import javax.portlet.PortletSession; 16 17 18 24 public class PortletSessionImpUtil { 25 26 private static final String PORTLET_SCOPE_NAMESPACE = "javax.portlet.p."; 27 28 public static String encodePortletSessionAttribute(String id, 29 String attributeName, 30 int scope) { 31 StringBuffer sB = new StringBuffer (); 32 if (PortletSession.APPLICATION_SCOPE == scope) { 33 sB.append(attributeName); 34 return sB.toString(); 35 } else if (PortletSession.PORTLET_SCOPE == scope) { 36 sB.append(PORTLET_SCOPE_NAMESPACE); 37 sB.append(id); 38 sB.append("?"); 39 sB.append(attributeName); 40 return sB.toString(); 41 } else { 42 return null; 43 } 44 } 45 46 } 47 | Popular Tags |