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; 26 import java.util.List; 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 warName; 44 private List entities = new ArrayList(); 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 id) { 83 this.warName = id; 84 } 85 86 public String toString() { 87 StringBuffer buffer = new StringBuffer(); 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 }