View Javadoc

1   /*
2    * Copyright 2003,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  /* 
17  
18   */
19  
20  package org.apache.pluto.portalImpl.om.window.impl;
21  
22  import org.apache.pluto.om.window.*;
23  import org.apache.pluto.om.entity.*;
24  import org.apache.pluto.om.common.ObjectID;
25  
26  public class PortletWindowImpl implements PortletWindow, PortletWindowCtrl {
27          
28      
29      private ObjectID objectId;
30      private String id;
31      private PortletEntity portletEntity;
32  
33      //counter used to generate unique id's
34      private static int counter; 
35  
36      public PortletWindowImpl(String id) {
37          this.id = id;
38      }
39  
40      // PortletWindow implementation.
41  
42       /***
43       * Returns the identifier of this portlet instance window as object id
44       *
45       * @return the object identifier
46       **/
47      public ObjectID getId()
48      {
49          if (objectId==null)
50          {
51              objectId = org.apache.pluto.portalImpl.util.ObjectID.createFromString(id);
52          }
53          return objectId;
54      }
55      /***
56       * Returns the portlet entity
57       *
58       * @return the portlet entity
59       **/
60      public PortletEntity getPortletEntity()
61      {
62          return portletEntity;
63      }
64  
65      // PortletWindowCtrl implementation.
66      /***
67       * binds an identifier to this portlet window
68       *
69       * @param id the new identifier
70       */
71      public void setId(String id)
72      {
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  }