01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.cocoon.portal.pluto.om;
18:
19: import org.apache.cocoon.portal.layout.impl.CopletLayout;
20: import org.apache.pluto.om.common.ObjectID;
21: import org.apache.pluto.om.entity.PortletEntity;
22: import org.apache.pluto.om.window.PortletWindow;
23: import org.apache.pluto.om.window.PortletWindowCtrl;
24:
25: /**
26: *
27: *
28: * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
29: *
30: * @version CVS $Id: PortletWindowImpl.java 433543 2006-08-22 06:22:54Z crossley $
31: */
32: public class PortletWindowImpl implements PortletWindow,
33: PortletWindowCtrl {
34:
35: private ObjectID objectId;
36: private String id;
37: private PortletEntity portletEntity;
38: private CopletLayout layout;
39:
40: public PortletWindowImpl(String id) {
41: this .id = id;
42: }
43:
44: // PortletWindow implementation.
45:
46: /**
47: * Returns the identifier of this portlet instance window as object id
48: *
49: * @return the object identifier
50: **/
51: public ObjectID getId() {
52: if (objectId == null) {
53: objectId = org.apache.cocoon.portal.pluto.om.common.ObjectIDImpl
54: .createFromString(id);
55: }
56: return objectId;
57: }
58:
59: /**
60: * Returns the portlet entity
61: *
62: * @return the portlet entity
63: **/
64: public PortletEntity getPortletEntity() {
65: return portletEntity;
66: }
67:
68: // PortletWindowCtrl implementation.
69: /**
70: * binds an identifier to this portlet window
71: *
72: * @param id the new identifier
73: */
74: public void setId(String id) {
75: this .id = id;
76: objectId = null;
77: }
78:
79: /**
80: * binds a portlet instance to this portlet window
81: *
82: * @param portletEntity a portlet entity object
83: **/
84: public void setPortletEntity(PortletEntity portletEntity) {
85: this .portletEntity = portletEntity;
86: }
87:
88: public CopletLayout getLayout() {
89: return this .layout;
90: }
91:
92: public void setLayout(CopletLayout layout) {
93: this.layout = layout;
94: }
95: }
|