KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > portal > pluto > om > PortletWindowImpl


1 /*
2  * Copyright 2004,2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.cocoon.portal.pluto.om;
17
18 import org.apache.cocoon.portal.layout.impl.CopletLayout;
19 import org.apache.pluto.om.common.ObjectID;
20 import org.apache.pluto.om.entity.PortletEntity;
21 import org.apache.pluto.om.window.PortletWindow;
22 import org.apache.pluto.om.window.PortletWindowCtrl;
23
24 /**
25  *
26  *
27  * @author <a HREF="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
28  *
29  * @version CVS $Id: PortletWindowImpl.java 123407 2004-12-27 13:51:59Z cziegeler $
30  */

31 public class PortletWindowImpl implements PortletWindow, PortletWindowCtrl {
32         
33     
34     private ObjectID objectId;
35     private String JavaDoc id;
36     private PortletEntity portletEntity;
37     private CopletLayout layout;
38     
39     public PortletWindowImpl(String JavaDoc id) {
40         this.id = id;
41     }
42
43     // PortletWindow implementation.
44

45      /**
46      * Returns the identifier of this portlet instance window as object id
47      *
48      * @return the object identifier
49      **/

50     public ObjectID getId() {
51         if (objectId==null) {
52             objectId = org.apache.cocoon.portal.pluto.om.common.ObjectIDImpl.createFromString(id);
53         }
54         return objectId;
55     }
56     
57     /**
58      * Returns the portlet entity
59      *
60      * @return the portlet entity
61      **/

62     public PortletEntity getPortletEntity() {
63         return portletEntity;
64     }
65
66     // PortletWindowCtrl implementation.
67
/**
68      * binds an identifier to this portlet window
69      *
70      * @param id the new identifier
71      */

72     public void setId(String JavaDoc id) {
73         this.id = id;
74         objectId = null;
75     }
76     
77     /**
78      * binds a portlet instance to this portlet window
79      *
80      * @param portletEntity a portlet entity object
81      **/

82     public void setPortletEntity(PortletEntity portletEntity) {
83         this.portletEntity = portletEntity;
84     }
85
86     public CopletLayout getLayout() {
87         return this.layout;
88     }
89     
90     public void setLayout(CopletLayout layout) {
91         this.layout = layout;
92     }
93 }
94
Popular Tags