01: /* Copyright 2004 The JA-SIG Collaborative. All rights reserved.
02: * See license distributed with this file and
03: * available online at http://www.uportal.org/license.html
04: */
05:
06: package org.jasig.portal.container.om.portlet;
07:
08: import java.io.Serializable;
09: import java.util.ArrayList;
10: import java.util.Collection;
11: import java.util.Iterator;
12:
13: import javax.portlet.PortletMode;
14:
15: import org.apache.pluto.om.portlet.ContentType;
16:
17: /**
18: * Implementation of Apache Pluto object model.
19: * @author Ken Weiner, kweiner@unicon.net
20: * @version $Revision: 34757 $
21: */
22: public class ContentTypeImpl implements ContentType, Serializable {
23:
24: private String contentType = null;
25: private Collection portletModes = null;
26:
27: public ContentTypeImpl() {
28: portletModes = new ArrayList();
29: // All portlets must support the VIEW mode
30: // The spec doesn't require a portlet's deployment
31: // descriptor to declare that is supports VIEW - see PLT.8.6
32: portletModes.add(PortletMode.VIEW);
33: }
34:
35: public String getContentType() {
36: return contentType;
37: }
38:
39: public Iterator getPortletModes() {
40: return portletModes.iterator();
41: }
42:
43: public boolean supportsPortletMode(PortletMode portletMode) {
44: return portletModes.contains(portletMode);
45: }
46:
47: // Additional methods
48:
49: public void setContentType(String contentType) {
50: this .contentType = contentType;
51: }
52:
53: public void addPortletMode(PortletMode portletMode) {
54: portletModes.add(portletMode);
55: }
56:
57: }
|