KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > jetspeed > portal > portlets > BogusPortlet


1 package org.apache.jetspeed.portal.portlets;
2
3 /*
4  * Copyright 2000-2001,2004 The Apache Software Foundation.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18
19 import org.apache.jetspeed.services.persistence.PersistenceManager;
20 import org.apache.jetspeed.portal.PortletInstance;
21
22  /**
23   * Bogus Portlet. Use to test portlet instance persistence
24   *
25   * @author <a HREF="mailto:taylor@apache.org">David Sean Taylor</a>
26   */

27 public class BogusPortlet extends AbstractInstancePortlet
28 {
29     
30     public org.apache.ecs.ConcreteElement getContent(org.apache.turbine.util.RunData data)
31     {
32         String JavaDoc s1 = "Config ID: " + getPortletConfig().getPortletId();
33         String JavaDoc s2 = ", Portlet ID: " + getID();
34         String JavaDoc s3 = ", Page ID: " + getPortletConfig().getPageId();
35         PortletInstance instance = PersistenceManager.getInstance(this,data);
36         String JavaDoc s4 = instance.getAttribute("country");
37         return new org.apache.jetspeed.util.JetspeedClearElement( s1 + s2 + s3 + ", " + s4);
38     }
39
40 }
41
42
Popular Tags