1 package org.exoplatform.services.portletcontainer.pci; 2 3 import org.apache.commons.lang.StringUtils; 4 5 10 public class ExoWindowID implements WindowID { 11 final static public String DEFAULT_PORTAL_CONFIG = "default-portal-config" ; 12 final static public String MOBILE_PORTAL_CONFIG = "default-portal-config" ; 13 14 private String owner; 15 private String portletApplicationName; 16 private String portletName; 17 private String uniqueID; 18 private String persistenceId ; 19 private String configurationSource = DEFAULT_PORTAL_CONFIG; 20 21 public ExoWindowID() { 22 } 23 24 public ExoWindowID(String persistenceId) { 25 this.persistenceId = persistenceId ; 26 int idx = persistenceId.indexOf(":/"); 27 owner = persistenceId.substring(0, idx); 28 persistenceId = persistenceId.substring(idx + 2, persistenceId.length()); 29 String [] keys = StringUtils.split(persistenceId, "/"); 30 portletApplicationName = keys[0]; 31 portletName = keys[1]; 32 uniqueID = keys[2]; 33 } 34 35 public String getOwner() { 36 return owner; 37 } 38 39 public void setOwner(String owner) { 40 this.owner = owner; 41 } 42 43 public String getPortletApplicationName() { 44 return portletApplicationName; 45 } 46 47 public void setPortletApplicationName(String portletApplicationName) { 48 this.portletApplicationName = portletApplicationName; 49 } 50 51 public String getPortletName() { 52 return portletName; 53 } 54 55 public void setPortletName(String portletName) { 56 this.portletName = portletName; 57 } 58 59 public String getUniqueID() { 60 return uniqueID; 61 } 62 63 public void setUniqueID(String uniqueID) { 64 this.uniqueID = uniqueID; 65 } 66 67 public String getPersistenceId() { 68 return this.persistenceId ; 69 } 70 71 public void setPersistenceId(String id) { 72 persistenceId = id ; 73 } 74 75 public String generatePersistenceId() { 76 return owner + ":/" + portletApplicationName + "/" + portletName + "/" + uniqueID ; 77 } 78 79 public String generateKey() { 80 return uniqueID; 81 } 82 83 87 public String getConfigurationSource() { return configurationSource ; } 88 public void setConfigurationSource(String source) { configurationSource = source; } 89 } | Popular Tags |