Author: julien(a)jboss.com
Date: 2007-06-26 11:22:59 -0400 (Tue, 26 Jun 2007)
New Revision: 7551
Added:
trunk/core-samples/src/bin/portal-jsp-samples-war/
trunk/core-samples/src/bin/portal-jsp-samples-war/images/
trunk/core-samples/src/bin/portal-jsp-samples-war/images/accessorize.gif
trunk/core-samples/src/bin/portal-jsp-samples-war/images/dodemo.gif
trunk/core-samples/src/bin/portal-jsp-samples-war/images/getcode.gif
trunk/core-samples/src/main/org/jboss/portal/core/portlet/basic/event/EventPortlet.java
trunk/core-samples/src/main/org/jboss/portal/core/samples/
trunk/core-samples/src/main/org/jboss/portal/core/samples/jsp/
trunk/core-samples/src/main/org/jboss/portal/core/samples/jsp/JSPPortlet.java
trunk/core-samples/src/main/org/jboss/portal/core/samples/news/
trunk/core-samples/src/main/org/jboss/portal/core/samples/news/NewsPortlet.java
trunk/core-samples/src/main/org/jboss/portal/core/samples/weather/
trunk/core-samples/src/main/org/jboss/portal/core/samples/weather/WeatherPortlet.java
trunk/core-samples/src/resources/portal-jsp-samples-war/
trunk/core-samples/src/resources/portal-jsp-samples-war/WEB-INF/
trunk/core-samples/src/resources/portal-jsp-samples-war/WEB-INF/portlet-instances.xml
trunk/core-samples/src/resources/portal-jsp-samples-war/WEB-INF/portlet.xml
trunk/core-samples/src/resources/portal-news-samples-war/
trunk/core-samples/src/resources/portal-news-samples-war/WEB-INF/
trunk/core-samples/src/resources/portal-news-samples-war/WEB-INF/jsp/
trunk/core-samples/src/resources/portal-news-samples-war/WEB-INF/jsp/news/
trunk/core-samples/src/resources/portal-news-samples-war/WEB-INF/jsp/news/edit.jsp
trunk/core-samples/src/resources/portal-news-samples-war/WEB-INF/portlet-instances.xml
trunk/core-samples/src/resources/portal-news-samples-war/WEB-INF/portlet.xml
trunk/core-samples/src/resources/portal-weather-samples-war/
trunk/core-samples/src/resources/portal-weather-samples-war/WEB-INF/
trunk/core-samples/src/resources/portal-weather-samples-war/WEB-INF/jsp/
trunk/core-samples/src/resources/portal-weather-samples-war/WEB-INF/jsp/weather/
trunk/core-samples/src/resources/portal-weather-samples-war/WEB-INF/jsp/weather/edit.jsp
trunk/core-samples/src/resources/portal-weather-samples-war/WEB-INF/portlet-instances.xml
trunk/core-samples/src/resources/portal-weather-samples-war/WEB-INF/portlet.xml
Removed:
trunk/core-samples/src/resources/portal-basic-samples-war/WEB-INF/jsp/news/edit.jsp
trunk/core-samples/src/resources/portal-basic-samples-war/WEB-INF/jsp/weather/edit.jsp
Modified:
trunk/core-samples/build.xml
trunk/core-samples/src/resources/portal-basic-samples-war/WEB-INF/jboss-portlet.xml
trunk/core-samples/src/resources/portal-basic-samples-war/WEB-INF/portlet-instances.xml
trunk/core-samples/src/resources/portal-basic-samples-war/WEB-INF/portlet.xml
Log:
make the samples more consistent
Modified: trunk/core-samples/build.xml
===================================================================
--- trunk/core-samples/build.xml 2007-06-26 13:42:32 UTC (rev 7550)
+++ trunk/core-samples/build.xml 2007-06-26 15:22:59 UTC (rev 7551)
@@ -191,31 +191,21 @@
<mkdir dir="${build.lib}"/>
- <!-- portal-core-samples-lib.jar -->
+ <!-- portal-basic-samples-lib.jar -->
<jar jarfile="${build.lib}/portal-basic-samples-lib.jar">
- <fileset dir="${build.classes}">
+ <fileset dir="${build.classes}"
includes="org/jboss/portal/core/portlet/basic/**">
</fileset>
</jar>
-
- <!-- portal-samples.sar -->
<copy todir="${build.resources}/portal-basic-samples">
<fileset dir="${build.resources}/portal-basic-samples-sar"/>
</copy>
-
- <!-- portal-samples.war -->
<copy
todir="${build.resources}/portal-samples/portal-basic-samples.war">
<fileset dir="${source.bin}/portal-basic-samples-war"/>
<fileset dir="${build.resources}/portal-basic-samples-war"/>
</copy>
-
- <!-- -->
<copy todir="${build.resources}/portal-basic-samples/lib">
<fileset dir="${build.lib}"
includes="portal-basic-samples-lib.jar"/>
</copy>
- </target>
-
- <!-- Build the portal-basic-samples.sar -->
- <target name="output" depends="artifacts">
<copy todir="${build.resources}/portal-basic-samples.sar">
<fileset dir="${build.resources}/portal-basic-samples"
excludes="**/*.xml"/>
</copy>
@@ -225,9 +215,51 @@
</filterset>
<fileset dir="${build.resources}/portal-basic-samples"
includes="**/*.xml"/>
</copy>
- <implode
- dir="${build.resources}/portal-basic-samples.sar"
- tofile="${build.lib}/portal-basic-samples.sar"/>
+
+ <!-- portal-jsp-samples.war -->
+ <copy todir="${build.resources}/portal-jsp-samples.war">
+ <fileset dir="${source.bin}/portal-jsp-samples-war"/>
+ <fileset dir="${build.resources}/portal-jsp-samples-war"/>
+ </copy>
+ <mkdir
dir="${build.resources}/portal-jsp-samples.war/WEB-INF/lib/"/>
+ <jar
jarfile="${build.resources}/portal-jsp-samples.war/WEB-INF/lib/portal-jsp-samples-lib.jar">
+ <fileset dir="${build.classes}"
includes="org/jboss/portal/core/samples/jsp/**"/>
+ </jar>
+
+ <!-- portal-news-samples.war -->
+ <copy todir="${build.resources}/portal-news-samples.war">
+ <fileset dir="${build.resources}/portal-news-samples-war"/>
+ </copy>
+ <mkdir
dir="${build.resources}/portal-news-samples.war/WEB-INF/lib/"/>
+ <jar
jarfile="${build.resources}/portal-news-samples.war/WEB-INF/lib/portal-news-samples-lib.jar">
+ <fileset dir="${build.classes}"
includes="org/jboss/portal/core/samples/news/**"/>
+ </jar>
+
+ <!-- portal-weather-samples.war -->
+ <copy todir="${build.resources}/portal-weather-samples.war">
+ <fileset dir="${build.resources}/portal-weather-samples-war"/>
+ </copy>
+ <mkdir
dir="${build.resources}/portal-weather-samples.war/WEB-INF/lib/"/>
+ <jar
jarfile="${build.resources}/portal-weather-samples.war/WEB-INF/lib/portal-weather-samples-lib.jar">
+ <fileset dir="${build.classes}"
includes="org/jboss/portal/core/samples/weather/**"/>
+ </jar>
+
+ </target>
+
+ <!-- Build the portal-basic-samples.sar -->
+ <target name="output" depends="artifacts">
+ <implode
+ dir="${build.resources}/portal-basic-samples.sar"
+ tofile="${build.lib}/portal-basic-samples.sar"/>
+ <implode
+ dir="${build.resources}/portal-jsp-samples.war"
+ tofile="${build.lib}/portal-jsp-samples.war"/>
+ <implode
+ dir="${build.resources}/portal-news-samples.war"
+ tofile="${build.lib}/portal-news-samples.war"/>
+ <implode
+ dir="${build.resources}/portal-weather-samples.war"
+ tofile="${build.lib}/portal-weather-samples.war"/>
</target>
<!-- create artifacts for running the portlet tests (except TCK) target output
should have already been executed -->
Added: trunk/core-samples/src/bin/portal-jsp-samples-war/images/accessorize.gif
===================================================================
--- trunk/core-samples/src/bin/portal-jsp-samples-war/images/accessorize.gif
(rev 0)
+++ trunk/core-samples/src/bin/portal-jsp-samples-war/images/accessorize.gif 2007-06-26
15:22:59 UTC (rev 7551)
@@ -0,0 +1,23 @@
+GIF89aP
+
+L��������)1o��;�|��j�����w7���҈��6em�خ��:u�h�����V��&v�^M$8��TT~��Պ-���S��0g�$�B�ګ��������tDaS[�J3)y .��S\���T��
+ �S�����������XX�//}��_�"�i!0�=e��3A}��������.a���A���������
2���ȋ��w����=b�������i'n~®���pp��D�Xc���lɱ$�^ ���B1�X��ahu[1/o_����_b�<wMMN���$?�MOy�����������p�������z��)m������
����������\d��
+u�Xϣ=+�aQ�Pu�Դ*��Q���u��U�:��4f�(Rd�V}Z�B(\�j�Ņ,g�
+,@@3��&�@BuL(���)��?�RNju�� is�
+T�IdsG��J���bH&�d��`1� ���"W*�4q�1)dॗD~)���(
+��@0����2�B^���Js"�)��2L{d�qjl�� O@H"��a�*�k��Y�$M*��ӎ
+��`��7�����3RpB�8C��1-�/>���PG
+�P+bh���YK"G$���Y��̼!��X0��X�6,/�,\o-�'V`����
+D7���?ar�"���$/����\�
+,8��7���8[�
+����=��C���BE3��$v� �/���K!����8₡��T
+\�Q�a'?�l~� 4���h�3�nhC�A"n�@���0���e8�
+�Uf��E�A�c` q�(�p�%p@B|@�<�ЋG@� $.h�1�X
+o�A�R�$� ��ʹ"���I��^0����+�b�BP�[����F6�
+KL"{�<`@@>�A
+y@� ���mT�;,|B"�xp�@k��K\G#
+ң��^D�Rq�b� F
+��$F1
+���@�@-�IZx��X�5����@��� �H@���b+��� q((�����1%AqF�
+� y����kX�ߐ0��[�*o"�w��ċA��X;Z�*$"P���0TИ��<.� 6q�#��u;|8�\
+da.p�F}
\ No newline at end of file
Added: trunk/core-samples/src/bin/portal-jsp-samples-war/images/dodemo.gif
===================================================================
--- trunk/core-samples/src/bin/portal-jsp-samples-war/images/dodemo.gif
(rev 0)
+++ trunk/core-samples/src/bin/portal-jsp-samples-war/images/dodemo.gif 2007-06-26
15:22:59 UTC (rev 7551)
@@ -0,0 +1,22 @@
+GIF89aP
+�S
+�Cddo�y��om�������܅�����K�����/f�l1W�f��0M����������e��������p�����@P�������E��h�iii������/K�����,���������tttsU��&�����T�������ꬬ�Ut����<BY�����'��Ꞷ������EE�����������Fz�Q�����q�����3C����>>>p�����
2����^���z�$3����NYn�����X��������|�Ј��������7���p��E�ڞ��hI{+����F�����m�؏�����,=�Cb�-c�v�����������������
+�\O������M`�~}�2^ܧ�1"�ɞ��7�zʵ���Q�EzP�5V���-�`�o� �.Z$��s*$8߂`���,�B�%A���y�m�އ!�7�e��AXԷb�@I�H&�eX#.*�^�"�h�?f
+��&��\qE*o���HdщMs��E(d6�$������S�yI���h�"a�UR/��}�����W�Ih��*˨�jd�4�`L:<���m4��@ ��a姸n������+L^��G�G �F�l���G>�R{E��^���������4l�L�AtrA)�`��R��D��#ں��!g����1�)� ��1+�$'�p�<|m��2q�$1"A!>�L�d��:5�Nd���)�|s� ������b2@����*
+{L@K)("��8��(��!�H�K�0B�u̇���.��@�P�C~�(��2A.���(T�)}��
+�ų��*����>�CF��3�����1�h�͢�����@Р�x�.�7�!Hov��!`0�HD#��B�A��`Q���T��c ����*A�1��UB�������?r�KL�
+�$��0�' ��������8��
+Af0�%�h�@�p�?��(H�V�(_�G�Ѯ����PH+�B�HP':q @��?
+�#��@C'c�GQ����c
+e�JɕB�p�b)NYIq�������Q��PLQ���4e�i��;E!�M�P?`����qx�>�4�i�c>�w(�����4��U!h�DUP�]�
+���@�jT�ޤ*�����<hB��N�@��)f*��6 8�i����0��(���R�� ��ĥ�F�0<X��X���:%x[����
+# ���0<�é#�D9�p"�c
+A"� ܈�:�'
+�M�z������D
+h!(�^P,�%B���������
+���@C��@
+è�&L�
+[����
+�
+��~
+��iD�c ��t���HS�Ҝ�t�EMjGWԑ���3=�S��~v5� "�U�։a5�-}�[�מ���M�b;
\ No newline at end of file
Added: trunk/core-samples/src/bin/portal-jsp-samples-war/images/getcode.gif
===================================================================
--- trunk/core-samples/src/bin/portal-jsp-samples-war/images/getcode.gif
(rev 0)
+++ trunk/core-samples/src/bin/portal-jsp-samples-war/images/getcode.gif 2007-06-26
15:22:59 UTC (rev 7551)
@@ -0,0 +1,28 @@
+GIF89aP
+�
+������v����������h}{������(()yz�������&8&��듛����P^����p|�
2����NOY��ݼӼ����uz�������W�_���DXM�����蘘�mpZ���[�[�����매����!�!tw����9
//4�����������ӽ��Zc�����������7�>oo}!����
+ȗE<�ß͛8c�H��χPp
+�MϟH��fiےJ-��)S#�Z���W�|�.��/���4�N� �$�;���9fZ"V�M Ϡ�QCJ4�"� ��*NF�&@���3
��0! ϩSxZ��BD��
+��ú�k:�a�Zb�rAs���C�ȗ &�{F��2e����s\`,[@�v� D�|�3� ���U��d:�2��SYO�����@���
+���Q0���``��2���!F��,��)m
+�(0�܀�!'Ti�Xb *{`S�<ı&*�4C��t�N�P�!m�Y�\tm O�t�(&X@D���9�ix@!���"���� TZ���E!�̂J}8�$�Y�B
+h
+��/�X��\ �2��VXqŭW8��#l��.!��G�PDw���F�8���8�@`���`E(-d;ƶc��b`C�
+��)�%� �M�,��6�
+�M7v{��&B�#D��@�)�!�9�C��$l��⤛��]4��&�䰆
����7㎓��"G3^�㨟�E�4��&����|�y���dDY q=���z�Q��L�tK-��C$ԇ�m��lL��~��,�A~��G���OM��9�
++)�@���&��H�$�I�`
+q�@%6�~���@>� ��x��p,Ԣ�
+�����9:Q�N"٘��2��<����1J@���ȅX�\\��p�,�)�\`��p�
+`����'}
+p)��L���B���
+>��5oZ'X3�@5�W�SM(�9φ�b��+m`�$�͟���3� Pg�@��-j QXƲ�
+eFz���68�2�I?��6��36z� �p$C��o`*8�"*0�]��3�/@Qya9թ`�i�!���Xc�^���8�$�A��3�@�N��A�"?��L@Ѿj
+��eN�?���M�r�k��:��{��t��|��a���;TB�
+�x���W���z^l�>8≌�
+I(`��o~G����������<`�q�E:�.��� �$��i��R� �S�p*Ha��� v���#p� �0�`P���f�,���@ �Q�pLa�
�<.�YOxBkH2t93=A����Q
+�8r��'89�C��/R!�,C�H�&��
+9D�u8�'��((أ(�1�X�B �\Yd(v��%F}�s�@
+�+91 �o�z�ߘ%
+��
+\�`�g v�^�!����-
+��"�$�����v����n��1������$���~���
\ No newline at end of file
Added:
trunk/core-samples/src/main/org/jboss/portal/core/portlet/basic/event/EventPortlet.java
===================================================================
---
trunk/core-samples/src/main/org/jboss/portal/core/portlet/basic/event/EventPortlet.java
(rev 0)
+++
trunk/core-samples/src/main/org/jboss/portal/core/portlet/basic/event/EventPortlet.java 2007-06-26
15:22:59 UTC (rev 7551)
@@ -0,0 +1,45 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.portal.core.portlet.basic.event;
+
+import javax.portlet.GenericPortlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletException;
+import javax.portlet.UnavailableException;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:roy@jboss.org">Roy Russo</a>
+ */
+public class EventPortlet extends GenericPortlet
+{
+ private static final String JSP_PATH = "/WEB-INF/jsp/event";
+
+ protected void doView(RenderRequest rRequest, RenderResponse rResponse) throws
PortletException, IOException, UnavailableException
+ {
+ rResponse.setContentType("text/html");
+ javax.portlet.PortletRequestDispatcher pRD =
this.getPortletContext().getRequestDispatcher(JSP_PATH + "/view.jsp");
+ pRD.include(rRequest, rResponse);
+ }
+}
Added: trunk/core-samples/src/main/org/jboss/portal/core/samples/jsp/JSPPortlet.java
===================================================================
--- trunk/core-samples/src/main/org/jboss/portal/core/samples/jsp/JSPPortlet.java
(rev 0)
+++
trunk/core-samples/src/main/org/jboss/portal/core/samples/jsp/JSPPortlet.java 2007-06-26
15:22:59 UTC (rev 7551)
@@ -0,0 +1,44 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.portal.core.samples.jsp;
+
+import javax.portlet.GenericPortlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletException;
+import javax.portlet.UnavailableException;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:roy@jboss.org">Roy Russo</a>
+ */
+public class JSPPortlet extends GenericPortlet
+{
+ private static final String JSP_PATH = "/WEB-INF/jsp/info";
+
+ protected void doView(RenderRequest rRequest, RenderResponse rResponse) throws
PortletException, IOException, UnavailableException
+ {
+ rResponse.setContentType("text/html");
+ javax.portlet.PortletRequestDispatcher pRD =
this.getPortletContext().getRequestDispatcher(JSP_PATH + "/view.jsp");
+ pRD.include(rRequest, rResponse);
+ }
+}
\ No newline at end of file
Property changes on:
trunk/core-samples/src/main/org/jboss/portal/core/samples/jsp/JSPPortlet.java
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/core-samples/src/main/org/jboss/portal/core/samples/news/NewsPortlet.java
===================================================================
--- trunk/core-samples/src/main/org/jboss/portal/core/samples/news/NewsPortlet.java
(rev 0)
+++
trunk/core-samples/src/main/org/jboss/portal/core/samples/news/NewsPortlet.java 2007-06-26
15:22:59 UTC (rev 7551)
@@ -0,0 +1,250 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+
+package org.jboss.portal.core.samples.news;
+
+import org.apache.log4j.Logger;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.GenericPortlet;
+import javax.portlet.PortletException;
+import javax.portlet.PortletMode;
+import javax.portlet.PortletPreferences;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.Source;
+import javax.xml.transform.Templates;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.PrintWriter;
+import java.net.URL;
+
+/**
+ * Adapted from JBoss Weather Portlet to deal with RSS News Feeds using RSS 1.0 or RSS
2.0 format.
+ *
+ * @author <a href="mailto:roy@jboss.org">Roy Russo</a>
+ */
+public class NewsPortlet extends GenericPortlet
+{
+ /**
+ * Logger
+ */
+ public static Logger log = Logger.getLogger(NewsPortlet.class);
+
+ /**
+ * Edit page
+ */
+ private static final String JSP_EDIT = "/WEB-INF/jsp/news/edit.jsp";
+
+ /**
+ * RSS 2.0 XSL page for output
+ */
+ private static final String RSS2_XSL = "/WEB-INF/xsl/news/Rss2.xsl";
+
+ /**
+ * RSS 1.0 XSL page for output
+ */
+ private static final String RSS1_XSL = "/WEB-INF/xsl/news/Rss1.xsl";
+
+ /**
+ * Compiled Template for output RSS 2.0
+ */
+ private Templates template_2_0;
+
+ /**
+ * Compiled Template for output RSS 1.0
+ */
+ private Templates template_1_0;
+
+ /**
+ * Base URL of News RSS
+ */
+ private String RSS_URL;
+
+ private static final String E_XSL_UNREADABLE = "Unable to prepare XSL
files.";
+ private static final String E_UNREADABLE = "Unable to read XML Source.";
+ private static final String E_UNPARSEABLE = "Unable to parse XML Source.";
+
+ /**
+ * Compile the XSL File.
+ */
+ public void init()
+ {
+ try
+ {
+ InputStream inputstream_2 =
getPortletContext().getResourceAsStream(NewsPortlet.RSS2_XSL);
+ StreamSource xslSource_2 = new StreamSource(inputstream_2);
+ TransformerFactory tFactory_2 = TransformerFactory.newInstance();
+ this.template_2_0 = tFactory_2.newTemplates(xslSource_2);
+
+ InputStream inputstream_1 =
getPortletContext().getResourceAsStream(NewsPortlet.RSS1_XSL);
+ StreamSource xslSource_1 = new StreamSource(inputstream_1);
+ TransformerFactory tFactory_1 = TransformerFactory.newInstance();
+ this.template_1_0 = tFactory_1.newTemplates(xslSource_1);
+
+ this.RSS_URL = getInitParameter("base_url");
+ }
+ catch(TransformerConfigurationException tce)
+ {
+ log.error(E_XSL_UNREADABLE, tce);
+ }
+ }
+
+ protected void doView(RenderRequest request, RenderResponse response) throws
IOException, PortletException
+ {
+ response.setProperty("expiration-cache",
request.getPreferences().getValue("expires", "180"));
+
+ InputStream xmlInputStream = null;
+ InputStream xslInputStream = null;
+
+ String newURL = null;
+ try
+ {
+ newURL = request.getParameter("newurl");
+ response.setContentType("text/html");
+
+ if(null == newURL)
+ {
+ newURL = request.getPreferences().getValue("RssXml", RSS_URL);
+ }
+
+ xmlInputStream = new URL(newURL).openStream();
+ if(xmlInputStream == null)
+ {
+ log.error(E_UNREADABLE);
+ throw new PortletException(E_UNREADABLE);
+ }
+
+ // Ready the parsers
+ DocumentBuilderFactory docBuilderFactory =
DocumentBuilderFactory.newInstance();
+ DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
+ Transformer transformer = this.template_2_0.newTransformer();
+
+ Source xmlSource = null;
+ try
+ {
+ Document document = docBuilder.parse(xmlInputStream);
+ transformer = this.template_2_0.newTransformer();
+ xmlSource = new DOMSource(document);
+
+ // added 1.0 check
+ Element element = document.getDocumentElement();
+ if(element.hasAttribute("version") &&
element.getAttribute("version").equals("1.0"))
+ {
+ transformer = this.template_1_0.newTransformer();
+ }
+ }
+ catch(TransformerConfigurationException tce)
+ {
+ log.error(E_UNPARSEABLE, tce);
+ throw new PortletException(E_UNPARSEABLE, tce);
+ }
+
+ // Transform document
+ PrintWriter writer = response.getWriter();
+ StreamResult outStream = new StreamResult(writer);
+ transformer.transform(xmlSource, outStream);
+ }
+ catch(Exception e)
+ {
+ log.error("Fatal Error reading/parsing XML Source.",e);
+ PrintWriter writer = response.getWriter();
+ writer.write("Failed to retrieve News Feed!");
+ writer.close();
+ }
+ finally // close all streams
+ {
+ if(xmlInputStream != null)
+ {
+ xmlInputStream.close();
+ }
+
+ if(xslInputStream != null)
+ {
+ xslInputStream.close();
+ }
+ }
+ }
+
+ /**
+ * Allow edit of RSS Feed.
+ *
+ * @param request
+ * @param response
+ * @throws java.io.IOException
+ * @throws javax.portlet.PortletException
+ */
+ protected void doEdit(RenderRequest request, RenderResponse response) throws
IOException, PortletException
+ {
+ response.setContentType("text/html");
+ PortletRequestDispatcher dispatcher =
getPortletContext().getRequestDispatcher(JSP_EDIT);
+ dispatcher.include(request, response);
+ }
+
+ /**
+ * Process RSS Feed edit.
+ *
+ * @param request
+ * @param response
+ * @throws javax.portlet.PortletException
+ */
+ public void processAction(ActionRequest request, ActionResponse response) throws
PortletException
+ {
+ String newURL = request.getParameter("newurl");
+
+ if(null != newURL)
+ {
+ PortletPreferences prefs = request.getPreferences();
+ try
+ {
+ if(!prefs.isReadOnly("RssXml"))
+ {
+ prefs.setValue("RssXml", newURL);
+ prefs.store();
+ }
+ }
+ catch(Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ //store as the selected xml so that it shows up selected as displays
+ response.setRenderParameter("newurl", newURL);
+
+ //set the portlet mode back to view
+ response.setPortletMode(PortletMode.VIEW);
+ }
+}
\ No newline at end of file
Property changes on:
trunk/core-samples/src/main/org/jboss/portal/core/samples/news/NewsPortlet.java
___________________________________________________________________
Name: svn:executable
+ *
Added:
trunk/core-samples/src/main/org/jboss/portal/core/samples/weather/WeatherPortlet.java
===================================================================
--- trunk/core-samples/src/main/org/jboss/portal/core/samples/weather/WeatherPortlet.java
(rev 0)
+++
trunk/core-samples/src/main/org/jboss/portal/core/samples/weather/WeatherPortlet.java 2007-06-26
15:22:59 UTC (rev 7551)
@@ -0,0 +1,231 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.portal.core.samples.weather;
+
+import org.apache.log4j.Logger;
+import org.w3c.dom.Document;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.GenericPortlet;
+import javax.portlet.PortletException;
+import javax.portlet.PortletMode;
+import javax.portlet.PortletPreferences;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.Source;
+import javax.xml.transform.Templates;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.PrintWriter;
+import java.net.URL;
+
+/**
+ * Simple weather portlet that redads Yahoo RSS Weather feeds and uses XSLT for
presentation.
+ *
+ * @author <a href="mailto:roy@jboss.org">Roy Russo</a>
+ */
+public class WeatherPortlet extends GenericPortlet
+{
+ /**
+ * Logger
+ */
+ public static Logger log = Logger.getLogger(WeatherPortlet.class);
+
+ /**
+ * Edit page
+ */
+ private static final String JSP_EDIT = "/WEB-INF/jsp/weather/edit.jsp";
+
+ /**
+ * Default zip set in init param.
+ */
+ private String DEFAULT_ZIP;
+
+ /**
+ * RSS 2.0 XSL page for output
+ */
+ private static final String RSS_XSL = "/WEB-INF/xsl/weather/Rss.xsl";
+
+ /**
+ * Compiled Template for output
+ */
+ private Templates template_2_0;
+
+ /**
+ * Base URL of Weather RSS
+ */
+ private String RSS_URL_PREFIX;
+
+ private static final String E_XSL_UNREADABLE = "Unable to prepare XSL
files.";
+ private static final String E_UNREADABLE = "Unable to read XML Source.";
+ private static final String E_UNPARSEABLE = "Unable to parse XML Source.";
+
+ /**
+ * Compile the XSL File.
+ */
+ public void init()
+ {
+ try
+ {
+ InputStream inputstream =
getPortletContext().getResourceAsStream(WeatherPortlet.RSS_XSL);
+ StreamSource xslSource = new StreamSource(inputstream);
+ TransformerFactory tFactory = TransformerFactory.newInstance();
+ this.template_2_0 = tFactory.newTemplates(xslSource);
+
+ this.DEFAULT_ZIP = getInitParameter("default_zipcode");
+ this.RSS_URL_PREFIX = getInitParameter("base_url");
+ }
+ catch(TransformerConfigurationException tce)
+ {
+ log.error(E_XSL_UNREADABLE, tce);
+ }
+ }
+
+ protected void doView(RenderRequest request, RenderResponse response) throws
IOException, PortletException
+ {
+ response.setProperty("expiration-cache",
request.getPreferences().getValue("expires", "180"));
+
+ InputStream xmlInputStream = null;
+ InputStream xslInputStream = null;
+
+ String newZip = null;
+ try
+ {
+ newZip = request.getParameter("newzip");
+ response.setContentType("text/html");
+
+ if(null == newZip)
+ {
+ newZip = request.getPreferences().getValue("RssXml", RSS_URL_PREFIX
+ DEFAULT_ZIP);
+ }
+
+ xmlInputStream = new URL(newZip).openStream();
+ if(xmlInputStream == null)
+ {
+ log.error(E_UNREADABLE);
+ throw new PortletException(E_UNREADABLE);
+ }
+
+ // Ready the parsers
+ DocumentBuilderFactory docBuilderFactory =
DocumentBuilderFactory.newInstance();
+ DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
+ Transformer transformer = this.template_2_0.newTransformer();
+
+ Source xmlSource = null;
+ try
+ {
+ Document document = docBuilder.parse(xmlInputStream);
+ transformer = this.template_2_0.newTransformer();
+ xmlSource = new DOMSource(document);
+ }
+ catch(TransformerConfigurationException tce)
+ {
+ log.error(E_UNPARSEABLE, tce);
+ throw new PortletException(E_UNPARSEABLE, tce);
+ }
+
+ // Transform document
+ PrintWriter writer = response.getWriter();
+ StreamResult outStream = new StreamResult(writer);
+ transformer.transform(xmlSource, outStream);
+ }
+ catch(Exception e)
+ {
+ log.error("Fatal Error reading/parsing XML Source.",e);
+ PrintWriter writer = response.getWriter();
+ writer.write("Failed to retrieve Weather Feed!");
+ writer.close();
+ }
+ finally // close all streams
+ {
+ if(xmlInputStream != null)
+ {
+ xmlInputStream.close();
+ }
+
+ if(xslInputStream != null)
+ {
+ xslInputStream.close();
+ }
+ }
+ }
+
+ /**
+ * Allow edit of weather location.
+ *
+ * @param request
+ * @param response
+ * @throws IOException
+ * @throws PortletException
+ */
+ protected void doEdit(RenderRequest request, RenderResponse response) throws
IOException, PortletException
+ {
+ response.setContentType("text/html");
+ PortletRequestDispatcher dispatcher =
getPortletContext().getRequestDispatcher(JSP_EDIT);
+ dispatcher.include(request, response);
+ }
+
+ /**
+ * Process weather location edit and store in user preferences.
+ *
+ * @param request
+ * @param response
+ * @throws PortletException
+ */
+ public void processAction(ActionRequest request, ActionResponse response) throws
PortletException
+ {
+ String newZip = request.getParameter("newzip");
+
+ if(null != newZip)
+ {
+ PortletPreferences prefs = request.getPreferences();
+ try
+ {
+ prefs.setValue("RssXml", RSS_URL_PREFIX + newZip);
+ prefs.store();
+ }
+ catch(Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ // TODO: error checking for URL + NewZIP
+
+ //store as the selected xml so that it shows up selected as displays
+ response.setRenderParameter("newzip", RSS_URL_PREFIX + newZip);
+
+ //set the portlet mode back to view
+ response.setPortletMode(PortletMode.VIEW);
+ }
+}
\ No newline at end of file
Property changes on:
trunk/core-samples/src/main/org/jboss/portal/core/samples/weather/WeatherPortlet.java
___________________________________________________________________
Name: svn:executable
+ *
Modified:
trunk/core-samples/src/resources/portal-basic-samples-war/WEB-INF/jboss-portlet.xml
===================================================================
---
trunk/core-samples/src/resources/portal-basic-samples-war/WEB-INF/jboss-portlet.xml 2007-06-26
13:42:32 UTC (rev 7550)
+++
trunk/core-samples/src/resources/portal-basic-samples-war/WEB-INF/jboss-portlet.xml 2007-06-26
15:22:59 UTC (rev 7551)
@@ -66,15 +66,6 @@
<portlet-name>SecuredTestPortlet</portlet-name>
</portlet>
<portlet>
- <portlet-name>WeatherPortlet</portlet-name>
- </portlet>
- <portlet>
- <portlet-name>NewsPortlet</portlet-name>
- </portlet>
- <portlet>
- <portlet-name>JSPPortlet</portlet-name>
- </portlet>
- <portlet>
<portlet-name>TestPortlet</portlet-name>
</portlet>
<portlet>
Deleted:
trunk/core-samples/src/resources/portal-basic-samples-war/WEB-INF/jsp/news/edit.jsp
===================================================================
---
trunk/core-samples/src/resources/portal-basic-samples-war/WEB-INF/jsp/news/edit.jsp 2007-06-26
13:42:32 UTC (rev 7550)
+++
trunk/core-samples/src/resources/portal-basic-samples-war/WEB-INF/jsp/news/edit.jsp 2007-06-26
15:22:59 UTC (rev 7551)
@@ -1,37 +0,0 @@
-<%--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ JBoss, a division of Red Hat ~
- ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
- ~ contributors as indicated by the @authors tag. See the ~
- ~ copyright.txt in the distribution for a full listing of ~
- ~ individual contributors. ~
- ~ ~
- ~ This is free software; you can redistribute it and/or modify it ~
- ~ under the terms of the GNU Lesser General Public License as ~
- ~ published by the Free Software Foundation; either version 2.1 of ~
- ~ the License, or (at your option) any later version. ~
- ~ ~
- ~ This software is distributed in the hope that it will be useful, ~
- ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
- ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
- ~ Lesser General Public License for more details. ~
- ~ ~
- ~ You should have received a copy of the GNU Lesser General Public ~
- ~ License along with this software; if not, write to the Free ~
- ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
- ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--%>
-
-<%@ taglib
uri="http://java.sun.com/portlet" prefix="portlet"
%>
-<%@ page isELIgnored="false" %>
-
-<portlet:defineObjects/>
-
-<div align="center">
- <br/>
- <font class="portlet-font">Change News Feed URL:</font>
- <form method="post" action="
-<portlet:actionURL></portlet:actionURL>">
- <input class="portlet-form-input-field" type="text"
value="<%= renderRequest.getPreferences().getValue("RssXml",
"") %>" size="25" name="newurl">
- <input class="portlet-form-button" type="submit"
name="submit" value="submit">
- </form>
-</div>
\ No newline at end of file
Deleted:
trunk/core-samples/src/resources/portal-basic-samples-war/WEB-INF/jsp/weather/edit.jsp
===================================================================
---
trunk/core-samples/src/resources/portal-basic-samples-war/WEB-INF/jsp/weather/edit.jsp 2007-06-26
13:42:32 UTC (rev 7550)
+++
trunk/core-samples/src/resources/portal-basic-samples-war/WEB-INF/jsp/weather/edit.jsp 2007-06-26
15:22:59 UTC (rev 7551)
@@ -1,40 +0,0 @@
-<%--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ JBoss, a division of Red Hat ~
- ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
- ~ contributors as indicated by the @authors tag. See the ~
- ~ copyright.txt in the distribution for a full listing of ~
- ~ individual contributors. ~
- ~ ~
- ~ This is free software; you can redistribute it and/or modify it ~
- ~ under the terms of the GNU Lesser General Public License as ~
- ~ published by the Free Software Foundation; either version 2.1 of ~
- ~ the License, or (at your option) any later version. ~
- ~ ~
- ~ This software is distributed in the hope that it will be useful, ~
- ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
- ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
- ~ Lesser General Public License for more details. ~
- ~ ~
- ~ You should have received a copy of the GNU Lesser General Public ~
- ~ License along with this software; if not, write to the Free ~
- ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
- ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--%>
-
-<%@ taglib
uri="http://java.sun.com/portlet" prefix="portlet"
%>
-<%@ page isELIgnored="false" %>
-
-<portlet:defineObjects/>
-
-<div align="center">
- <br/>
- <font class="portlet-font">Change Weather Location:</font>
-
- <form method="post" action="
-<portlet:actionURL></portlet:actionURL>">
- <font class="portlet-font">Zip Code:</font><br/>
- <input class="portlet-form-input-field" type="text"
value="" size="12" name="newzip">
- <br/>
- <input class="portlet-form-input-field" type="submit"
name="submit" value="submit">
- </form>
-</div>
\ No newline at end of file
Modified:
trunk/core-samples/src/resources/portal-basic-samples-war/WEB-INF/portlet-instances.xml
===================================================================
---
trunk/core-samples/src/resources/portal-basic-samples-war/WEB-INF/portlet-instances.xml 2007-06-26
13:42:32 UTC (rev 7550)
+++
trunk/core-samples/src/resources/portal-basic-samples-war/WEB-INF/portlet-instances.xml 2007-06-26
15:22:59 UTC (rev 7551)
@@ -27,52 +27,14 @@
"http://www.jboss.org/portal/dtd/portlet-instances_2_6.dtd">
<deployments>
-<!--
<deployment>
<instance>
- <instance-id>JSPPortletInstance</instance-id>
- <portlet-ref>JSPPortlet</portlet-ref>
- </instance>
- </deployment>
- <deployment>
- <instance>
<instance-id>EventPortletInstance</instance-id>
<portlet-ref>EventPortlet</portlet-ref>
</instance>
</deployment>
<deployment>
<instance>
- <instance-id>NewsPortletInstance</instance-id>
- <portlet-ref>NewsPortlet</portlet-ref>
- </instance>
- </deployment>
- <deployment>
- <if-exists>overwrite</if-exists>
- <instance>
- <instance-id>NewsPortletInstance2</instance-id>
- <portlet-ref>NewsPortlet</portlet-ref>
- <preferences>
- <preference>
- <name>expires</name>
- <value>180</value>
- </preference>
- <preference>
- <name>RssXml</name>
- <
value>http://finance.yahoo.com/rss/headline?s=rhat</value>
- </preference>
- </preferences>
- </instance>
- </deployment>
- <deployment>
- <instance>
- <instance-id>WeatherPortletInstance</instance-id>
- <portlet-ref>WeatherPortlet</portlet-ref>
- </instance>
- </deployment>
--->
-
- <deployment>
- <instance>
<instance-id>HeaderContentPortletInstance</instance-id>
<portlet-ref>HeaderContentPortlet</portlet-ref>
</instance>
Modified: trunk/core-samples/src/resources/portal-basic-samples-war/WEB-INF/portlet.xml
===================================================================
---
trunk/core-samples/src/resources/portal-basic-samples-war/WEB-INF/portlet.xml 2007-06-26
13:42:32 UTC (rev 7550)
+++
trunk/core-samples/src/resources/portal-basic-samples-war/WEB-INF/portlet.xml 2007-06-26
15:22:59 UTC (rev 7551)
@@ -27,25 +27,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1...
http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
version="1.0">
-<!--
<portlet>
- <description>Simple JSP portlet</description>
- <portlet-name>JSPPortlet</portlet-name>
- <display-name>JSP Portlet</display-name>
-
<portlet-class>org.jboss.samples.portlet.jsp.JSPPortlet</portlet-class>
- <supports>
- <mime-type>text/html</mime-type>
- <portlet-mode>VIEW</portlet-mode>
- </supports>
- <portlet-info>
- <title>Greetings!</title>
- <keywords>sample,test</keywords>
- </portlet-info>
- </portlet>
--->
-
-<!--
- <portlet>
<description>Event Portlet</description>
<portlet-name>EventPortlet</portlet-name>
<display-name>Event Portlet</display-name>
@@ -59,8 +41,6 @@
<keywords>event, sample,test</keywords>
</portlet-info>
</portlet>
--->
-
<portlet>
<description>Portlet to test modification of head
content</description>
<portlet-name>HeaderContentPortlet</portlet-name>
@@ -246,92 +226,7 @@
<keywords>sample,test</keywords>
</portlet-info>
</portlet>
-<!--
<portlet>
- <description>Portlet providing weather forecast</description>
- <portlet-name>WeatherPortlet</portlet-name>
- <display-name>Weather Portlet</display-name>
-
<portlet-class>org.jboss.samples.portlet.weather.WeatherPortlet</portlet-class>
- <init-param>
- <name>default_zipcode</name>
- <value>33145</value>
- </init-param>
- <init-param>
- <name>RSS_XSL</name>
- <value>/WEB-INF/xsl/weather/Rss.xsl</value>
- </init-param>
- <init-param>
- <name>base_url</name>
- <
value>http://xml.weather.yahoo.com/forecastrss?p=</value>
- </init-param>
- <expiration-cache>180</expiration-cache>
- <supports>
- <mime-type>text/html</mime-type>
- <portlet-mode>VIEW</portlet-mode>
- <portlet-mode>EDIT</portlet-mode>
- </supports>
- <portlet-info>
- <title>Weather Portlet</title>
- <keywords>sample,news</keywords>
- </portlet-info>
- <portlet-preferences>
- <preference>
- <name>expires</name>
- <value>180</value>
- </preference>
- <preference>
- <name>RssXml</name>
- <
value>http://xml.weather.yahoo.com/forecastrss?p=33145</value>
- <read-only>false</read-only>
- </preference>
- </portlet-preferences>
- </portlet>
--->
-<!--
- <portlet>
- <description>Portlet aggregating news from different
feeds</description>
- <portlet-name>NewsPortlet</portlet-name>
- <display-name>News Portlet</display-name>
-
<portlet-class>org.jboss.samples.portlet.news.NewsPortlet</portlet-class>
- <init-param>
- <name>RSS1_XSL</name>
- <value>/WEB-INF/Rss1.xsl</value>
- </init-param>
- <init-param>
- <name>RSS2_XSL</name>
- <value>/WEB-INF/Rss2.xsl</value>
- </init-param>
- <init-param>
- <name>base_url</name>
- <
value>http://feeds.feedburner.com/JBossPortal</value>
- </init-param>
- <expiration-cache>180</expiration-cache>
- <supports>
- <mime-type>text/html</mime-type>
- <portlet-mode>VIEW</portlet-mode>
- <portlet-mode>EDIT</portlet-mode>
- </supports>
- <supported-locale>en</supported-locale>
- <supported-locale>fr</supported-locale>
- <resource-bundle>NewsResource</resource-bundle>
- <portlet-info>
- <title>News Feeds</title>
- <keywords>sample,news</keywords>
- </portlet-info>
- <portlet-preferences>
- <preference>
- <name>expires</name>
- <value>180</value>
- </preference>
- <preference>
- <name>RssXml</name>
- <
value>http://feeds.feedburner.com/JBossPortal</value>
- <read-only>false</read-only>
- </preference>
- </portlet-preferences>
- </portlet>
--->
- <portlet>
<description>URL Portlet</description>
<portlet-name>URLPortlet</portlet-name>
<display-name>URL Portlet</display-name>
Added:
trunk/core-samples/src/resources/portal-jsp-samples-war/WEB-INF/portlet-instances.xml
===================================================================
--- trunk/core-samples/src/resources/portal-jsp-samples-war/WEB-INF/portlet-instances.xml
(rev 0)
+++
trunk/core-samples/src/resources/portal-jsp-samples-war/WEB-INF/portlet-instances.xml 2007-06-26
15:22:59 UTC (rev 7551)
@@ -0,0 +1,36 @@
+<?xml version="1.0" standalone="yes"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE deployments PUBLIC
+ "-//JBoss Portal//DTD Portlet Instances 2.6//EN"
+ "http://www.jboss.org/portal/dtd/portlet-instances_2_6.dtd">
+
+<deployments>
+ <deployment>
+ <instance>
+ <instance-id>JSPPortletInstance</instance-id>
+ <portlet-ref>JSPPortlet</portlet-ref>
+ </instance>
+ </deployment>
+</deployments>
\ No newline at end of file
Added: trunk/core-samples/src/resources/portal-jsp-samples-war/WEB-INF/portlet.xml
===================================================================
--- trunk/core-samples/src/resources/portal-jsp-samples-war/WEB-INF/portlet.xml
(rev 0)
+++ trunk/core-samples/src/resources/portal-jsp-samples-war/WEB-INF/portlet.xml 2007-06-26
15:22:59 UTC (rev 7551)
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<portlet-app
+
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1...
http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+ version="1.0">
+ <portlet>
+ <description>Simple JSP portlet</description>
+ <portlet-name>JSPPortlet</portlet-name>
+ <display-name>JSP Portlet</display-name>
+
<portlet-class>org.jboss.samples.portlet.jsp.JSPPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>Greetings!</title>
+ <keywords>sample,test</keywords>
+ </portlet-info>
+ </portlet>
+</portlet-app>
Added: trunk/core-samples/src/resources/portal-news-samples-war/WEB-INF/jsp/news/edit.jsp
===================================================================
--- trunk/core-samples/src/resources/portal-news-samples-war/WEB-INF/jsp/news/edit.jsp
(rev 0)
+++
trunk/core-samples/src/resources/portal-news-samples-war/WEB-INF/jsp/news/edit.jsp 2007-06-26
15:22:59 UTC (rev 7551)
@@ -0,0 +1,37 @@
+<%--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--%>
+
+<%@ taglib
uri="http://java.sun.com/portlet" prefix="portlet"
%>
+<%@ page isELIgnored="false" %>
+
+<portlet:defineObjects/>
+
+<div align="center">
+ <br/>
+ <font class="portlet-font">Change News Feed URL:</font>
+ <form method="post" action="
+<portlet:actionURL></portlet:actionURL>">
+ <input class="portlet-form-input-field" type="text"
value="<%= renderRequest.getPreferences().getValue("RssXml",
"") %>" size="25" name="newurl">
+ <input class="portlet-form-button" type="submit"
name="submit" value="submit">
+ </form>
+</div>
\ No newline at end of file
Added:
trunk/core-samples/src/resources/portal-news-samples-war/WEB-INF/portlet-instances.xml
===================================================================
---
trunk/core-samples/src/resources/portal-news-samples-war/WEB-INF/portlet-instances.xml
(rev 0)
+++
trunk/core-samples/src/resources/portal-news-samples-war/WEB-INF/portlet-instances.xml 2007-06-26
15:22:59 UTC (rev 7551)
@@ -0,0 +1,53 @@
+<?xml version="1.0" standalone="yes"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE deployments PUBLIC
+ "-//JBoss Portal//DTD Portlet Instances 2.6//EN"
+ "http://www.jboss.org/portal/dtd/portlet-instances_2_6.dtd">
+
+<deployments>
+ <deployment>
+ <instance>
+ <instance-id>NewsPortletInstance</instance-id>
+ <portlet-ref>NewsPortlet</portlet-ref>
+ </instance>
+ </deployment>
+ <deployment>
+ <if-exists>overwrite</if-exists>
+ <instance>
+ <instance-id>NewsPortletInstance2</instance-id>
+ <portlet-ref>NewsPortlet</portlet-ref>
+ <preferences>
+ <preference>
+ <name>expires</name>
+ <value>180</value>
+ </preference>
+ <preference>
+ <name>RssXml</name>
+ <
value>http://finance.yahoo.com/rss/headline?s=rhat</value>
+ </preference>
+ </preferences>
+ </instance>
+ </deployment>
+</deployments>
\ No newline at end of file
Added: trunk/core-samples/src/resources/portal-news-samples-war/WEB-INF/portlet.xml
===================================================================
--- trunk/core-samples/src/resources/portal-news-samples-war/WEB-INF/portlet.xml
(rev 0)
+++
trunk/core-samples/src/resources/portal-news-samples-war/WEB-INF/portlet.xml 2007-06-26
15:22:59 UTC (rev 7551)
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<portlet-app
+
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1...
http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+ version="1.0">
+ <portlet>
+ <description>Portlet aggregating news from different
feeds</description>
+ <portlet-name>NewsPortlet</portlet-name>
+ <display-name>News Portlet</display-name>
+
<portlet-class>org.jboss.samples.portlet.news.NewsPortlet</portlet-class>
+ <init-param>
+ <name>RSS1_XSL</name>
+ <value>/WEB-INF/Rss1.xsl</value>
+ </init-param>
+ <init-param>
+ <name>RSS2_XSL</name>
+ <value>/WEB-INF/Rss2.xsl</value>
+ </init-param>
+ <init-param>
+ <name>base_url</name>
+ <
value>http://feeds.feedburner.com/JBossPortal</value>
+ </init-param>
+ <expiration-cache>180</expiration-cache>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ <portlet-mode>EDIT</portlet-mode>
+ </supports>
+ <supported-locale>en</supported-locale>
+ <supported-locale>fr</supported-locale>
+ <resource-bundle>NewsResource</resource-bundle>
+ <portlet-info>
+ <title>News Feeds</title>
+ <keywords>sample,news</keywords>
+ </portlet-info>
+ <portlet-preferences>
+ <preference>
+ <name>expires</name>
+ <value>180</value>
+ </preference>
+ <preference>
+ <name>RssXml</name>
+ <
value>http://feeds.feedburner.com/JBossPortal</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+ </portlet>
+</portlet-app>
Added:
trunk/core-samples/src/resources/portal-weather-samples-war/WEB-INF/jsp/weather/edit.jsp
===================================================================
---
trunk/core-samples/src/resources/portal-weather-samples-war/WEB-INF/jsp/weather/edit.jsp
(rev 0)
+++
trunk/core-samples/src/resources/portal-weather-samples-war/WEB-INF/jsp/weather/edit.jsp 2007-06-26
15:22:59 UTC (rev 7551)
@@ -0,0 +1,40 @@
+<%--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--%>
+
+<%@ taglib
uri="http://java.sun.com/portlet" prefix="portlet"
%>
+<%@ page isELIgnored="false" %>
+
+<portlet:defineObjects/>
+
+<div align="center">
+ <br/>
+ <font class="portlet-font">Change Weather Location:</font>
+
+ <form method="post" action="
+<portlet:actionURL></portlet:actionURL>">
+ <font class="portlet-font">Zip Code:</font><br/>
+ <input class="portlet-form-input-field" type="text"
value="" size="12" name="newzip">
+ <br/>
+ <input class="portlet-form-input-field" type="submit"
name="submit" value="submit">
+ </form>
+</div>
\ No newline at end of file
Added:
trunk/core-samples/src/resources/portal-weather-samples-war/WEB-INF/portlet-instances.xml
===================================================================
---
trunk/core-samples/src/resources/portal-weather-samples-war/WEB-INF/portlet-instances.xml
(rev 0)
+++
trunk/core-samples/src/resources/portal-weather-samples-war/WEB-INF/portlet-instances.xml 2007-06-26
15:22:59 UTC (rev 7551)
@@ -0,0 +1,36 @@
+<?xml version="1.0" standalone="yes"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE deployments PUBLIC
+ "-//JBoss Portal//DTD Portlet Instances 2.6//EN"
+ "http://www.jboss.org/portal/dtd/portlet-instances_2_6.dtd">
+
+<deployments>
+ <deployment>
+ <instance>
+ <instance-id>WeatherPortletInstance</instance-id>
+ <portlet-ref>WeatherPortlet</portlet-ref>
+ </instance>
+ </deployment>
+</deployments>
\ No newline at end of file
Added: trunk/core-samples/src/resources/portal-weather-samples-war/WEB-INF/portlet.xml
===================================================================
--- trunk/core-samples/src/resources/portal-weather-samples-war/WEB-INF/portlet.xml
(rev 0)
+++
trunk/core-samples/src/resources/portal-weather-samples-war/WEB-INF/portlet.xml 2007-06-26
15:22:59 UTC (rev 7551)
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<portlet-app
+
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1...
http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+ version="1.0">
+ <portlet>
+ <description>Portlet providing weather forecast</description>
+ <portlet-name>WeatherPortlet</portlet-name>
+ <display-name>Weather Portlet</display-name>
+
<portlet-class>org.jboss.samples.portlet.weather.WeatherPortlet</portlet-class>
+ <init-param>
+ <name>default_zipcode</name>
+ <value>33145</value>
+ </init-param>
+ <init-param>
+ <name>RSS_XSL</name>
+ <value>/WEB-INF/xsl/weather/Rss.xsl</value>
+ </init-param>
+ <init-param>
+ <name>base_url</name>
+ <
value>http://xml.weather.yahoo.com/forecastrss?p=</value>
+ </init-param>
+ <expiration-cache>180</expiration-cache>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ <portlet-mode>EDIT</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>Weather Portlet</title>
+ <keywords>sample,news</keywords>
+ </portlet-info>
+ <portlet-preferences>
+ <preference>
+ <name>expires</name>
+ <value>180</value>
+ </preference>
+ <preference>
+ <name>RssXml</name>
+ <
value>http://xml.weather.yahoo.com/forecastrss?p=33145</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+ </portlet>
+</portlet-app>