KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > infoglue > deliver > portal > om > PortletApplicationEntityImpl


1 /* ===============================================================================
2  *
3  * Part of the InfoGlue Content Management Platform (www.infoglue.org)
4  *
5  * ===============================================================================
6  *
7  * Copyright (C)
8  *
9  * This program is free software; you can redistribute it and/or modify it under
10  * the terms of the GNU General Public License version 2, as published by the
11  * Free Software Foundation. See the file LICENSE.html for more information.
12  *
13  * This program is distributed in the hope that it will be useful, but WITHOUT
14  * ANY WARRANTY, including the implied warranty of MERCHANTABILITY or FITNESS
15  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along with
18  * this program; if not, write to the Free Software Foundation, Inc. / 59 Temple
19  * Place, Suite 330 / Boston, MA 02111-1307 / USA.
20  *
21  * ===============================================================================
22  */

23 package org.infoglue.deliver.portal.om;
24
25 import java.util.ArrayList JavaDoc;
26 import java.util.List JavaDoc;
27
28 import org.apache.commons.logging.Log;
29 import org.apache.commons.logging.LogFactory;
30 import org.apache.pluto.om.common.ObjectID;
31 import org.apache.pluto.om.entity.PortletApplicationEntity;
32 import org.apache.pluto.om.entity.PortletEntity;
33 import org.apache.pluto.om.entity.PortletEntityList;
34 import org.apache.pluto.om.portlet.PortletApplicationDefinition;
35
36 /**
37  * @author jand
38  *
39  */

40 public class PortletApplicationEntityImpl implements PortletApplicationEntity {
41     private static final Log LOG = LogFactory.getLog(PortletApplicationEntityImpl.class);
42
43     private String JavaDoc warName;
44     private List JavaDoc entities = new ArrayList JavaDoc();
45     private PortletApplicationDefinition definition;
46
47     /*
48      * (non-Javadoc)
49      *
50      * @see org.apache.pluto.om.entity.PortletApplicationEntity#getId()
51      */

52     public ObjectID getId() {
53         return org.apache.pluto.portalImpl.util.ObjectID.createFromString(warName);
54     }
55
56     /*
57      * (non-Javadoc)
58      *
59      * @see org.apache.pluto.om.entity.PortletApplicationEntity#getPortletEntityList()
60      */

61     public PortletEntityList getPortletEntityList() {
62         return new PortletEntityListImpl(entities);
63     }
64
65     public void addPortletEntity(PortletEntity e) {
66         entities.add(e);
67     }
68
69     /*
70      * (non-Javadoc)
71      *
72      * @see org.apache.pluto.om.entity.PortletApplicationEntity#getPortletApplicationDefinition()
73      */

74     public PortletApplicationDefinition getPortletApplicationDefinition() {
75         return definition;
76     }
77
78     public void setPortletApplicationDefinition(PortletApplicationDefinition definition) {
79         this.definition = definition;
80     }
81
82     public void setId(String JavaDoc id) {
83         this.warName = id;
84     }
85
86     public String JavaDoc toString() {
87         StringBuffer JavaDoc buffer = new StringBuffer JavaDoc();
88         buffer.append("PortletApplicationEntityImpl[ id:");
89         buffer.append(this.warName);
90         buffer.append(" entities:");
91         buffer.append(this.entities);
92         buffer.append("]");
93
94         return buffer.toString();
95     }
96 }
Popular Tags