KickJava   Java API By Example, From Geeks To Geeks.

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


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 java.util.HashMap JavaDoc;
19 import java.util.Iterator JavaDoc;
20 import java.util.Map JavaDoc;
21
22 import org.apache.pluto.om.common.ObjectID;
23 import org.apache.pluto.om.entity.PortletApplicationEntity;
24 import org.apache.pluto.om.entity.PortletApplicationEntityList;
25 import org.apache.pluto.om.entity.PortletApplicationEntityListCtrl;
26 import org.apache.pluto.om.portlet.PortletApplicationDefinition;
27 import org.apache.pluto.om.portlet.PortletApplicationDefinitionList;
28
29 /**
30  *
31  *
32  * @author <a HREF="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
33  *
34  * @version CVS $Id: PortletApplicationEntityListImpl.java 30932 2004-07-29 17:35:38Z vgritsenko $
35  */

36 public class PortletApplicationEntityListImpl
37 implements PortletApplicationEntityList, PortletApplicationEntityListCtrl {
38
39     /** the portlet application entities */
40     protected Map JavaDoc portletApplicationEntities = new HashMap JavaDoc();
41     
42     /** The registry */
43     protected PortletDefinitionRegistry registry;
44     
45     /**
46      * Constructor
47      */

48     public PortletApplicationEntityListImpl(PortletDefinitionRegistry pdr) {
49         this.registry = pdr;
50     }
51     
52     /* (non-Javadoc)
53      * @see org.apache.pluto.om.entity.PortletApplicationEntityList#iterator()
54      */

55     public Iterator JavaDoc iterator() {
56         return this.portletApplicationEntities.values().iterator();
57     }
58
59     /* (non-Javadoc)
60      * @see org.apache.pluto.om.entity.PortletApplicationEntityListCtrl#add(java.lang.String)
61      */

62     public PortletApplicationEntity add(String JavaDoc definitionId) {
63         PortletApplicationDefinitionList padl = this.registry.getPortletApplicationDefinitionList();
64         PortletApplicationDefinition pad = padl.get(org.apache.cocoon.portal.pluto.om.common.ObjectIDImpl.createFromString(definitionId));
65         PortletApplicationEntityImpl pae = new PortletApplicationEntityImpl(definitionId, pad);
66         this.portletApplicationEntities.put(pae.getId(), pae);
67         return pae;
68     }
69
70     /* (non-Javadoc)
71      * @see org.apache.pluto.om.entity.PortletApplicationEntityList#get(org.apache.pluto.om.common.ObjectID)
72      */

73     public PortletApplicationEntity get(ObjectID objectId) {
74         final PortletApplicationEntity pae = (PortletApplicationEntity) this.portletApplicationEntities.get(objectId);
75         return pae;
76     }
77
78 }
79
Popular Tags