1 16 package org.apache.cocoon.portal.pluto.om; 17 18 import java.io.IOException ; 19 import java.util.Locale ; 20 21 import org.apache.cocoon.portal.PortalService; 22 import org.apache.cocoon.portal.coplet.CopletInstanceData; 23 import org.apache.cocoon.portal.profile.ProfileManager; 24 import org.apache.pluto.om.common.Description; 25 import org.apache.pluto.om.common.ObjectID; 26 import org.apache.pluto.om.common.PreferenceSet; 27 import org.apache.pluto.om.entity.PortletApplicationEntity; 28 import org.apache.pluto.om.entity.PortletEntity; 29 import org.apache.pluto.om.entity.PortletEntityCtrl; 30 import org.apache.pluto.om.portlet.PortletDefinition; 31 import org.apache.pluto.om.window.PortletWindowList; 32 33 40 public class PortletEntityImpl implements PortletEntity, PortletEntityCtrl { 41 42 protected final PortletWindowList portletWindows; 43 protected final ObjectID objectId; 44 protected final PortletDefinition definition; 45 protected final CopletInstanceData coplet; 46 protected final PortletApplicationEntity applicationEntity; 47 protected final PortalService service; 48 49 52 PortletEntityImpl(PortletApplicationEntity pae, 53 CopletInstanceData cid, 54 PortletDefinition pd, 55 PortalService service) { 56 this.objectId = org.apache.cocoon.portal.pluto.om.common.ObjectIDImpl.createFromString("CID" + cid.hashCode()); 57 this.portletWindows = new PortletWindowListImpl(); 58 this.coplet = cid; 59 this.definition = pd; 60 this.applicationEntity = pae; 61 this.service = service; 62 } 63 64 67 public Description getDescription(Locale locale) { 68 return this.definition.getDescription(locale); 69 } 70 71 74 public ObjectID getId() { 75 return this.objectId; 76 } 77 78 81 public PortletApplicationEntity getPortletApplicationEntity() { 82 return this.applicationEntity; 83 } 84 85 88 public PortletDefinition getPortletDefinition() { 89 return this.definition; 90 } 91 92 95 public PortletWindowList getPortletWindowList() { 96 return this.portletWindows; 97 } 98 99 102 public PreferenceSet getPreferenceSet() { 103 return this.coplet.getPreferences(); 104 } 105 106 109 public CopletInstanceData getCopletInstanceData() { 110 return this.coplet; 111 } 112 113 114 117 public void reset() throws IOException { 118 } 120 121 124 public void setId(String id) { 125 } 127 128 131 public void setPortletDefinition(PortletDefinition portletDefinition) { 132 } 134 135 138 public void store() throws IOException { 139 final ProfileManager manager = this.service.getComponentManager().getProfileManager(); 140 manager.saveUserCopletInstanceDatas(null); 141 } 142 143 } 144 | Popular Tags |