1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.jetspeed.om.window.impl;
18
19 import java.io.Serializable;
20
21 import org.apache.pluto.om.window.PortletWindow;
22 import org.apache.pluto.om.window.PortletWindowCtrl;
23 import org.apache.pluto.om.window.PortletWindowListCtrl;
24 import org.apache.pluto.om.entity.PortletEntity;
25 import org.apache.pluto.om.common.ObjectID;
26 import org.apache.jetspeed.util.JetspeedObjectID;
27
28 /***
29 * <P>
30 * The <CODE>PortletWindow</CODE> implementation represents a single window
31 * of an portlet instance as it can be shown only once on a single page.
32 * Adding the same portlet e.g. twice on a page results in two different windows.
33 * </P>
34 *
35 * @author <a href="mailto:david@bluesunrise.com">David Sean Taylor</a>
36 * @version $Id: PortletWindowImpl.java 553014 2007-07-03 23:10:53Z ate $
37 **/
38 public class PortletWindowImpl implements PortletWindow, PortletWindowCtrl, Serializable
39 {
40 private ObjectID objectId = null;
41 private transient PortletEntity portletEntity = null;
42
43 public PortletWindowImpl(String id)
44 {
45 this.objectId = JetspeedObjectID.createFromString(id);
46 }
47
48 public PortletWindowImpl(ObjectID oid)
49 {
50 this.objectId = oid;
51 }
52
53 public PortletWindowImpl()
54 {
55 super();
56 }
57
58 /***
59 * Returns the identifier of this portlet instance window as object id
60 *
61 * @return the object identifier
62 **/
63 public ObjectID getId()
64 {
65 return objectId;
66 }
67 /***
68 * Returns the portlet entity
69 *
70 * @return the portlet entity
71 **/
72 public PortletEntity getPortletEntity()
73 {
74 return portletEntity;
75 }
76
77
78 /***
79 * binds an identifier to this portlet window
80 *
81 * @param id the new identifier
82 */
83 public void setId(String id)
84 {
85 objectId = JetspeedObjectID.createFromString(id);
86 }
87
88 /***
89 * binds a portlet instance to this portlet window
90 *
91 * @param portletEntity a portlet entity object
92 **/
93 public void setPortletEntity(PortletEntity portletEntity)
94 {
95 this.portletEntity = portletEntity;
96 ((PortletWindowListCtrl)portletEntity.getPortletWindowList()).add(this);
97 }
98
99 }