[jboss-svn-commits] JBoss PortletSwap SVN: r79 - in portlets/2_4/src: . FlashPortlet FlashPortlet/lib FlashPortlet/src FlashPortlet/src/main FlashPortlet/src/main/org FlashPortlet/src/main/org/jboss FlashPortlet/src/main/org/jboss/portlet FlashPortlet/src/main/org/jboss/portlet/flash FlashPortlet/src/resources FlashPortlet/src/resources/flash-war FlashPortlet/src/resources/flash-war/WEB-INF FlashPortlet/src/resources/flash-war/WEB-INF/classes FlashPortlet/src/resources/flash-war/WEB-INF/classes/org FlashPortlet/src/resources/flash-war/WEB-INF/classes/org/jboss FlashPortlet/src/resources/flash-war/WEB-INF/classes/org/jboss/portlet FlashPortlet/src/resources/flash-war/WEB-INF/classes/org/jboss/portlet/flash FlashPortlet/src/resources/flash-war/WEB-INF/jsp FlashPortlet/src/resources/flash-war/WEB-INF/jsp/flash

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Jul 24 13:20:22 EDT 2006


Author: roy.russo at jboss.com
Date: 2006-07-24 13:20:11 -0400 (Mon, 24 Jul 2006)
New Revision: 79

Added:
   portlets/2_4/src/FlashPortlet/
   portlets/2_4/src/FlashPortlet/LICENSES.txt
   portlets/2_4/src/FlashPortlet/README.txt
   portlets/2_4/src/FlashPortlet/build.xml
   portlets/2_4/src/FlashPortlet/flash.war
   portlets/2_4/src/FlashPortlet/lib/
   portlets/2_4/src/FlashPortlet/lib/explode.jar
   portlets/2_4/src/FlashPortlet/lib/portal-common-lib.jar
   portlets/2_4/src/FlashPortlet/lib/portlet-api-lib.jar
   portlets/2_4/src/FlashPortlet/src/
   portlets/2_4/src/FlashPortlet/src/bin/
   portlets/2_4/src/FlashPortlet/src/main/
   portlets/2_4/src/FlashPortlet/src/main/org/
   portlets/2_4/src/FlashPortlet/src/main/org/jboss/
   portlets/2_4/src/FlashPortlet/src/main/org/jboss/portlet/
   portlets/2_4/src/FlashPortlet/src/main/org/jboss/portlet/flash/
   portlets/2_4/src/FlashPortlet/src/main/org/jboss/portlet/flash/FlashPortlet.java
   portlets/2_4/src/FlashPortlet/src/resources/
   portlets/2_4/src/FlashPortlet/src/resources/flash-war/
   portlets/2_4/src/FlashPortlet/src/resources/flash-war/WEB-INF/
   portlets/2_4/src/FlashPortlet/src/resources/flash-war/WEB-INF/classes/
   portlets/2_4/src/FlashPortlet/src/resources/flash-war/WEB-INF/classes/org/
   portlets/2_4/src/FlashPortlet/src/resources/flash-war/WEB-INF/classes/org/jboss/
   portlets/2_4/src/FlashPortlet/src/resources/flash-war/WEB-INF/classes/org/jboss/portlet/
   portlets/2_4/src/FlashPortlet/src/resources/flash-war/WEB-INF/classes/org/jboss/portlet/flash/
   portlets/2_4/src/FlashPortlet/src/resources/flash-war/WEB-INF/classes/org/jboss/portlet/flash/FlashPortlet.class
   portlets/2_4/src/FlashPortlet/src/resources/flash-war/WEB-INF/flash-object.xml
   portlets/2_4/src/FlashPortlet/src/resources/flash-war/WEB-INF/jboss-app.xml
   portlets/2_4/src/FlashPortlet/src/resources/flash-war/WEB-INF/jboss-web.xml
   portlets/2_4/src/FlashPortlet/src/resources/flash-war/WEB-INF/jsp/
   portlets/2_4/src/FlashPortlet/src/resources/flash-war/WEB-INF/jsp/flash/
   portlets/2_4/src/FlashPortlet/src/resources/flash-war/WEB-INF/jsp/flash/edit.jsp
   portlets/2_4/src/FlashPortlet/src/resources/flash-war/WEB-INF/jsp/flash/flash.jsp
   portlets/2_4/src/FlashPortlet/src/resources/flash-war/WEB-INF/portlet-instances.xml
   portlets/2_4/src/FlashPortlet/src/resources/flash-war/WEB-INF/portlet.xml
   portlets/2_4/src/FlashPortlet/src/resources/flash-war/WEB-INF/web.xml
   portlets/2_4/src/FlashPortlet/src/resources/flash-war/images/
Log:



Property changes on: portlets/2_4/src/FlashPortlet
___________________________________________________________________
Name: svn:ignore
   + output


Added: portlets/2_4/src/FlashPortlet/LICENSES.txt
===================================================================
--- portlets/2_4/src/FlashPortlet/LICENSES.txt	2006-07-24 17:13:29 UTC (rev 78)
+++ portlets/2_4/src/FlashPortlet/LICENSES.txt	2006-07-24 17:20:11 UTC (rev 79)
@@ -0,0 +1 @@
+LGPL: explode.jar, portal-common.jar, portal-core-lib.jar, portlet-api.jar

Added: portlets/2_4/src/FlashPortlet/README.txt
===================================================================
--- portlets/2_4/src/FlashPortlet/README.txt	2006-07-24 17:13:29 UTC (rev 78)
+++ portlets/2_4/src/FlashPortlet/README.txt	2006-07-24 17:20:11 UTC (rev 79)
@@ -0,0 +1,6 @@
+This portlet works with JBoss Portal 2.2+. It allows for a user-defined url pointing to a Flash (.swf) movie to be displayed and sized within a portlet window. This software is distributed under the LGPL, unless otherwise noted in the LICENSES.txt.
+
+- To build the war file, use ant to execute the build.xml at the root of this bundle, ie.  "ant deploy"
+- To deploy this portlet, simply copy the contact.war file to your /deploy directory where JBoss Portal resides.
+
+

Added: portlets/2_4/src/FlashPortlet/build.xml
===================================================================
--- portlets/2_4/src/FlashPortlet/build.xml	2006-07-24 17:13:29 UTC (rev 78)
+++ portlets/2_4/src/FlashPortlet/build.xml	2006-07-24 17:20:11 UTC (rev 79)
@@ -0,0 +1,86 @@
+<project name="JBoss Flash Portlet"
+         default="deploy"
+         basedir=".">
+
+   <property name="app.name" value="flash"/>
+
+   <property name="src.dir" value="${basedir}/src"/>
+
+   <property name="lib.dir" value="${basedir}/lib"/>
+
+   <property name="build.dir" value="${basedir}/output"/>
+
+   <property name="build.lib" value="${build.dir}/lib"/>
+
+   <property name="build.resources" value="${src.dir}/resources"/>
+
+   <property name="build.etc" value="${src.dir}/etc"/>
+
+   <property name="classes.dir" value="${build.dir}/classes"/>
+
+   <property name="dist.dir" value="${src.dir}/resources"/>
+
+   <property name="libs.api" value="${lib.dir}/portlet-api-lib.jar"/>
+
+   <property name="libs.ant"
+             value="${lib.dir}/explode.jar;${lib.dir}/portal-common-lib.jar;${lib.dir}/portal-core-lib.jar"/>
+
+   <property name="libs" value="${libs.api};${libs.ant}"/>
+
+   <available property="clover.available" classname="org.apache.tools.ant.taskdefs.CloverCompilerAdapter"/>
+
+   <target name="clover-yes" depends="prepare" if="clover.available">
+      <property name="compiler" value="org.apache.tools.ant.taskdefs.CloverCompilerAdapter"/>
+   </target>
+
+   <target name="clover-no" depends="prepare" unless="clover.available">
+      <property name="compiler" value="modern"/>
+   </target>
+
+   <target name="prepare">
+      <mkdir dir="${classes.dir}"/>
+      <mkdir dir="${build.lib}"/>
+      <mkdir dir="${build.lib}/exploded"/>
+      <mkdir dir="${build.resources}/flash-war/WEB-INF/classes"/>
+   </target>
+
+   <target name="clean">
+      <delete dir="${build.dir}"/>
+      <delete dir="${build.resources}/flash-war/WEB-INF/classes"/>
+   </target>
+
+   <target name="deploy" depends="clover-yes, clover-no">
+      <javac srcdir="${src.dir}"
+             destdir="${classes.dir}"
+             classpath="${libs}"
+             debug="off"
+             optimize="on"
+             deprecation="on"
+             compiler="${compiler}">
+         <include name="main/org/jboss/portlet/**/*.java"/>
+      </javac>
+
+      <copydir src="${classes.dir}" dest="${build.resources}/flash-war/WEB-INF/classes">
+      </copydir>
+
+      <!-- flash.war -->
+      <jar jarfile="flash.war">
+         <manifest>
+            <attribute name="Manifest-Version" value="1.0"/>
+         </manifest>
+         <fileset dir="${build.resources}/flash-war"/>
+      </jar>
+   </target>
+
+   <target name="explode" depends="deploy">
+      <taskdef classname="org.jboss.nukes.common.ant.Explode"
+               name="explode"
+               classpath="${libs}"/>
+      <explode
+            file="flash.war"
+            todir="${build.lib}/exploded"
+            name="flash.war"/>
+   </target>
+   <target name="all" depends="deploy"/>
+</project>
+

Added: portlets/2_4/src/FlashPortlet/flash.war
===================================================================
(Binary files differ)


Property changes on: portlets/2_4/src/FlashPortlet/flash.war
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: portlets/2_4/src/FlashPortlet/lib/explode.jar
===================================================================
(Binary files differ)


Property changes on: portlets/2_4/src/FlashPortlet/lib/explode.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: portlets/2_4/src/FlashPortlet/lib/portal-common-lib.jar
===================================================================
(Binary files differ)


Property changes on: portlets/2_4/src/FlashPortlet/lib/portal-common-lib.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: portlets/2_4/src/FlashPortlet/lib/portlet-api-lib.jar
===================================================================
(Binary files differ)


Property changes on: portlets/2_4/src/FlashPortlet/lib/portlet-api-lib.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: portlets/2_4/src/FlashPortlet/src/main/org/jboss/portlet/flash/FlashPortlet.java
===================================================================
--- portlets/2_4/src/FlashPortlet/src/main/org/jboss/portlet/flash/FlashPortlet.java	2006-07-24 17:13:29 UTC (rev 78)
+++ portlets/2_4/src/FlashPortlet/src/main/org/jboss/portlet/flash/FlashPortlet.java	2006-07-24 17:20:11 UTC (rev 79)
@@ -0,0 +1,110 @@
+/*
+* 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.portlet.flash;
+
+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.PortletSecurityException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import java.io.IOException;
+
+/**
+ * User: Chris Mills (millsy at jboss.com)
+ * Date: 07-Mar-2006
+ * Time: 21:14:06
+ */
+public class FlashPortlet extends GenericPortlet
+{
+   public void processAction(ActionRequest request, ActionResponse response) throws PortletException, PortletSecurityException, IOException
+   {
+      String op = request.getParameter("op");
+      StringBuffer message = new StringBuffer(1024);
+      if((op != null) && (op.trim().length() > 0))
+      {
+         if(op.equalsIgnoreCase("update"))
+         {
+            PortletPreferences prefs = request.getPreferences();
+            String url = request.getParameter("url");
+            String height = request.getParameter("height");
+            String width = request.getParameter("width");
+            prefs.setValue("flashurl", url);
+            prefs.setValue("flashheight", height);
+            prefs.setValue("flashwidth", width);
+            prefs.store();
+            response.setPortletMode(PortletMode.VIEW);
+            return;
+         }
+         else if(op.equalsIgnoreCase("cancel"))
+         {
+            response.setPortletMode(PortletMode.VIEW);
+            return;
+         }
+      }
+      response.setPortletMode(PortletMode.EDIT);
+   }
+
+   public void doView(RenderRequest request, RenderResponse response)
+   {
+      try
+      {
+         setRenderParameters(request);
+         response.setContentType("text/html");
+         PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/WEB-INF/jsp/flash/flash.jsp");
+         prd.include(request, response);
+      }
+      catch(Exception e)
+      {
+         e.printStackTrace();
+      }
+   }
+
+   public void doEdit(RenderRequest request, RenderResponse response)
+   {
+      try
+      {
+         setRenderParameters(request);
+         response.setContentType("text/html");
+         PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/WEB-INF/jsp/flash/edit.jsp");
+         prd.include(request, response);
+      }
+      catch(Exception e)
+      {
+         e.printStackTrace();
+      }
+   }
+
+   private void setRenderParameters(RenderRequest request)
+   {
+      PortletPreferences prefs = request.getPreferences();
+      request.setAttribute("flashurl", prefs.getValue("flashurl", "http://www.jboss.com/images/flash/next_now_movie.swf"));
+      request.setAttribute("flashheight", prefs.getValue("flashheight", "171"));
+      request.setAttribute("flashwidth", prefs.getValue("flashwidth", "493"));
+   }
+}
+

Added: portlets/2_4/src/FlashPortlet/src/resources/flash-war/WEB-INF/classes/org/jboss/portlet/flash/FlashPortlet.class
===================================================================
(Binary files differ)


Property changes on: portlets/2_4/src/FlashPortlet/src/resources/flash-war/WEB-INF/classes/org/jboss/portlet/flash/FlashPortlet.class
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: portlets/2_4/src/FlashPortlet/src/resources/flash-war/WEB-INF/flash-object.xml
===================================================================
--- portlets/2_4/src/FlashPortlet/src/resources/flash-war/WEB-INF/flash-object.xml	2006-07-24 17:13:29 UTC (rev 78)
+++ portlets/2_4/src/FlashPortlet/src/resources/flash-war/WEB-INF/flash-object.xml	2006-07-24 17:20:11 UTC (rev 79)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deployments>
+   <deployment>
+      <if-exists>overwrite</if-exists>
+      <parent-ref>default</parent-ref>
+      <page>
+         <page-name>Flash</page-name>
+         <window>
+            <window-name>FlashPortletWindow</window-name>
+            <instance-ref>FlashPortletInstance</instance-ref>
+            <region>center</region>
+            <height>0</height>
+         </window>
+      </page>
+   </deployment>
+</deployments>
\ No newline at end of file

Added: portlets/2_4/src/FlashPortlet/src/resources/flash-war/WEB-INF/jboss-app.xml
===================================================================
--- portlets/2_4/src/FlashPortlet/src/resources/flash-war/WEB-INF/jboss-app.xml	2006-07-24 17:13:29 UTC (rev 78)
+++ portlets/2_4/src/FlashPortlet/src/resources/flash-war/WEB-INF/jboss-app.xml	2006-07-24 17:20:11 UTC (rev 79)
@@ -0,0 +1,3 @@
+<jboss-app>
+    <app-name>flashportlet</app-name>
+</jboss-app>
\ No newline at end of file

Added: portlets/2_4/src/FlashPortlet/src/resources/flash-war/WEB-INF/jboss-web.xml
===================================================================
--- portlets/2_4/src/FlashPortlet/src/resources/flash-war/WEB-INF/jboss-web.xml	2006-07-24 17:13:29 UTC (rev 78)
+++ portlets/2_4/src/FlashPortlet/src/resources/flash-war/WEB-INF/jboss-web.xml	2006-07-24 17:20:11 UTC (rev 79)
@@ -0,0 +1,3 @@
+<?xml version="1.0"?>
+<jboss-web>
+</jboss-web>

Added: portlets/2_4/src/FlashPortlet/src/resources/flash-war/WEB-INF/jsp/flash/edit.jsp
===================================================================
--- portlets/2_4/src/FlashPortlet/src/resources/flash-war/WEB-INF/jsp/flash/edit.jsp	2006-07-24 17:13:29 UTC (rev 78)
+++ portlets/2_4/src/FlashPortlet/src/resources/flash-war/WEB-INF/jsp/flash/edit.jsp	2006-07-24 17:20:11 UTC (rev 79)
@@ -0,0 +1,35 @@
+<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %>
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+
+<!--
+/**
+ * User: Chris Mills (millsy at jboss.com)
+ * Date: 27-Feb-2006
+ * Time: 22:02:11
+ */
+-->
+<portlet:defineObjects/>
+
+<form method="post" action="<portlet:actionURL/>">
+	<table>
+        <tr class="portlet-msg-alert">
+            <td colspan="2"><%= request.getParameter("message") != null ?  request.getParameter("message") : ""%></td>
+        </tr>
+        <tr class="portlet-section-body">
+			<td>Source URL</td>
+			<td><input type="text" name="url" value="<%= request.getAttribute("flashurl") %>" size="50"/></td>
+		</tr>
+        <tr class="portlet-section-body">
+			<td>Height (px)</td>
+			<td><input type="text" name="height" value="<%= request.getAttribute("flashheight") %>"/></td>
+		</tr>
+        <tr class="portlet-section-body">
+			<td>Width (px)</td>
+			<td><input type="text" name="width" value="<%= request.getAttribute("flashwidth") %>"/></td>
+		</tr>
+        <tr class="portlet-section-body">
+			<td align="right"><input type="submit" name="op" value="Update"/></td>
+            <td align="left"><input type="submit" name="op" value="Cancel"/></td>
+        </tr>
+    </table>
+</form>

Added: portlets/2_4/src/FlashPortlet/src/resources/flash-war/WEB-INF/jsp/flash/flash.jsp
===================================================================
--- portlets/2_4/src/FlashPortlet/src/resources/flash-war/WEB-INF/jsp/flash/flash.jsp	2006-07-24 17:13:29 UTC (rev 78)
+++ portlets/2_4/src/FlashPortlet/src/resources/flash-war/WEB-INF/jsp/flash/flash.jsp	2006-07-24 17:20:11 UTC (rev 79)
@@ -0,0 +1,10 @@
+<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %>
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+
+<center>
+    <object width="<%= request.getAttribute("flashwidth") %>" height="<%= request.getAttribute("flashheight") %>">
+        <param name="movie" value="<%= request.getAttribute("flashurl") %>"/>
+        <embed src="<%= request.getAttribute("flashurl") %>" width="<%= request.getAttribute("flashwidth") %>" height="<%= request.getAttribute("flashheight") %>"/>
+    </object>
+</center>
+

Added: portlets/2_4/src/FlashPortlet/src/resources/flash-war/WEB-INF/portlet-instances.xml
===================================================================
--- portlets/2_4/src/FlashPortlet/src/resources/flash-war/WEB-INF/portlet-instances.xml	2006-07-24 17:13:29 UTC (rev 78)
+++ portlets/2_4/src/FlashPortlet/src/resources/flash-war/WEB-INF/portlet-instances.xml	2006-07-24 17:20:11 UTC (rev 79)
@@ -0,0 +1,9 @@
+<?xml version="1.0" standalone="yes"?>
+<deployments>
+   <deployment>
+      <instance>
+         <instance-id>FlashPortletInstance</instance-id>
+         <portlet-ref>FlashPortlet</portlet-ref>
+      </instance>
+   </deployment>
+</deployments>
\ No newline at end of file

Added: portlets/2_4/src/FlashPortlet/src/resources/flash-war/WEB-INF/portlet.xml
===================================================================
--- portlets/2_4/src/FlashPortlet/src/resources/flash-war/WEB-INF/portlet.xml	2006-07-24 17:13:29 UTC (rev 78)
+++ portlets/2_4/src/FlashPortlet/src/resources/flash-war/WEB-INF/portlet.xml	2006-07-24 17:20:11 UTC (rev 79)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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_0.xsd /opt/SUNWps/dtd/portlet.xsd"
+             version="1.0">
+   <portlet>
+      <portlet-name>FlashPortlet</portlet-name>
+      <portlet-class>org.jboss.portlet.flash.FlashPortlet</portlet-class>
+      <supports>
+         <mime-type>text/html</mime-type>
+         <portlet-mode>VIEW</portlet-mode>
+         <portlet-mode>EDIT</portlet-mode>
+      </supports>
+      <portlet-info>
+         <title>Flash Portlet</title>
+      </portlet-info>
+      <portlet-preferences>
+         <preference>
+            <name>flashurl</name>
+            <value>http://www.jboss.com/images/flash/next_now_movie.swf</value>
+         </preference>
+         <preference>
+            <name>flashheight</name>
+            <value>171</value>
+         </preference>
+         <preference>
+            <name>flashwidth</name>
+            <value>493</value>
+         </preference>
+      </portlet-preferences>
+   </portlet>
+</portlet-app>

Added: portlets/2_4/src/FlashPortlet/src/resources/flash-war/WEB-INF/web.xml
===================================================================
--- portlets/2_4/src/FlashPortlet/src/resources/flash-war/WEB-INF/web.xml	2006-07-24 17:13:29 UTC (rev 78)
+++ portlets/2_4/src/FlashPortlet/src/resources/flash-war/WEB-INF/web.xml	2006-07-24 17:20:11 UTC (rev 79)
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<!DOCTYPE web-app PUBLIC
+   "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+   "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+</web-app>




More information about the jboss-svn-commits mailing list