1 7 package org.exoplatform.services.portletcontainer.impl; 8 9 import java.util.List ; 10 import java.util.Locale ; 11 import java.util.ResourceBundle ; 12 import org.exoplatform.container.PortalContainer; 13 import org.exoplatform.services.portletcontainer.impl.portletAPIImp.bundle.ResourceBundleManager; 14 import org.exoplatform.services.portletcontainer.pci.PortletData; 15 import org.exoplatform.services.portletcontainer.pci.model.*; 16 17 18 22 public class PortletDataImp implements PortletData { 23 24 private List userAttributes_; 25 private Portlet portlet_; 26 private UserDataConstraint userDataConstraintType_; 27 28 public PortletDataImp(Portlet portlet, 29 UserDataConstraint userDataConstraintType, 30 List userAttributes) { 31 this.portlet_ = portlet; 32 this.userDataConstraintType_ = userDataConstraintType; 33 this.userAttributes_ = userAttributes; 34 } 35 36 public Portlet getWrappedPortletTyped() { return portlet_; } 37 38 public List getDisplayName() { return portlet_.getDisplayName(); } 39 40 public List getSecurityRoleRef() { return portlet_.getSecurityRoleRef(); } 41 42 public List getInitParam() { return portlet_.getInitParam(); } 43 44 public ResourceBundle getPortletInfo(Locale locale) { 45 ResourceBundleManager manager = (ResourceBundleManager)PortalContainer.getInstance(). 46 getComponentInstanceOfType(ResourceBundleManager.class); 47 try { 48 return manager.lookupBundle(portlet_, locale); 49 } catch (Exception e) { 50 return null; 51 } 52 } 53 54 public List getSupports() { return portlet_.getSupports(); } 55 56 public List getDescription() { return portlet_.getDescription(); } 57 58 public String getDescription(String lang) { return portlet_.getDescription(lang) ; } 59 60 public boolean isCacheGlobal() { 61 if ("true".equalsIgnoreCase(portlet_.getGlobalCache())) { 62 return true; 63 } 64 return false; 65 } 66 67 public String getExpirationCache() { 68 String s = portlet_.getExpirationCache(); ; 69 if(s == null) return "" ; 70 return s ; 71 } 72 73 public String getPortletName() { return portlet_.getPortletName(); } 74 75 public List getSupportedLocale() { return portlet_.getSupportedLocale(); } 76 77 public ExoPortletPreferences getPortletPreferences() { 78 return portlet_.getPortletPreferences(); 79 } 80 81 public boolean isSecure() { 82 if (userDataConstraintType_ != null) return true; 83 return false; 84 } 85 86 public List getUserAttributes() { return userAttributes_; } 87 } | Popular Tags |