[jboss-svn-commits] JBoss PortletSwap SVN: r76 - in portlets/2_4/src: . CalcPortlet CalcPortlet/lib CalcPortlet/src CalcPortlet/src/main CalcPortlet/src/main/org CalcPortlet/src/main/org/jboss CalcPortlet/src/main/org/jboss/portlet CalcPortlet/src/main/org/jboss/portlet/calc CalcPortlet/src/resources CalcPortlet/src/resources/calcportlet-war CalcPortlet/src/resources/calcportlet-war/WEB-INF CalcPortlet/src/resources/calcportlet-war/WEB-INF/calc CalcPortlet/src/resources/calcportlet-war/WEB-INF/classes CalcPortlet/src/resources/calcportlet-war/WEB-INF/classes/org CalcPortlet/src/resources/calcportlet-war/WEB-INF/classes/org/jboss CalcPortlet/src/resources/calcportlet-war/WEB-INF/classes/org/jboss/portlet CalcPortlet/src/resources/calcportlet-war/WEB-INF/classes/org/jboss/portlet/calc

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Jul 24 12:49:44 EDT 2006


Author: roy.russo at jboss.com
Date: 2006-07-24 12:49:34 -0400 (Mon, 24 Jul 2006)
New Revision: 76

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



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


Added: portlets/2_4/src/CalcPortlet/LICENSES.txt
===================================================================
--- portlets/2_4/src/CalcPortlet/LICENSES.txt	2006-07-06 16:35:37 UTC (rev 75)
+++ portlets/2_4/src/CalcPortlet/LICENSES.txt	2006-07-24 16:49:34 UTC (rev 76)
@@ -0,0 +1 @@
+LGPL: explode.jar, portal-common.jar, portlet-api.jar

Added: portlets/2_4/src/CalcPortlet/README.txt
===================================================================
--- portlets/2_4/src/CalcPortlet/README.txt	2006-07-06 16:35:37 UTC (rev 75)
+++ portlets/2_4/src/CalcPortlet/README.txt	2006-07-24 16:49:34 UTC (rev 76)
@@ -0,0 +1,6 @@
+This portlet works with JBoss Portal 2.2+. It allows for a ui-based calculator. 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 calcportlet.war file to your /deploy directory where JBoss Portal resides.
+
+

Added: portlets/2_4/src/CalcPortlet/build.xml
===================================================================
--- portlets/2_4/src/CalcPortlet/build.xml	2006-07-06 16:35:37 UTC (rev 75)
+++ portlets/2_4/src/CalcPortlet/build.xml	2006-07-24 16:49:34 UTC (rev 76)
@@ -0,0 +1,86 @@
+<project name="JBoss Calculator 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"/>
+
+   <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}/calcportlet-war/WEB-INF/classes"/>
+   </target>
+
+   <target name="clean">
+      <delete dir="${build.dir}"/>
+      <delete dir="${build.resources}/calcportlet-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}/calcportlet-war/WEB-INF/classes">
+      </copydir>
+
+      <!-- calcportlet.war -->
+      <jar jarfile="calcportlet.war">
+         <manifest>
+            <attribute name="Manifest-Version" value="1.0"/>
+         </manifest>
+         <fileset dir="${build.resources}/calcportlet-war"/>
+      </jar>
+   </target>
+
+   <target name="explode" depends="deploy">
+      <taskdef classname="org.jboss.nukes.common.ant.Explode"
+               name="explode"
+               classpath="${libs}"/>
+      <explode
+            file="calcportlet.war"
+            todir="${build.lib}/exploded"
+            name="calcportlet.war"/>
+   </target>
+   <target name="all" depends="deploy"/>
+</project>
+

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


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

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


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

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


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

Added: portlets/2_4/src/CalcPortlet/src/main/org/jboss/portlet/calc/CalcPortlet.java
===================================================================
--- portlets/2_4/src/CalcPortlet/src/main/org/jboss/portlet/calc/CalcPortlet.java	2006-07-06 16:35:37 UTC (rev 75)
+++ portlets/2_4/src/CalcPortlet/src/main/org/jboss/portlet/calc/CalcPortlet.java	2006-07-24 16:49:34 UTC (rev 76)
@@ -0,0 +1,49 @@
+/*
+* 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.calc;
+
+import javax.portlet.GenericPortlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * User: Chris Mills (millsy at jboss.com)
+ * Date: 03-Mar-2006
+ * Time: 19:28:04
+ */
+public class CalcPortlet extends GenericPortlet
+{
+   public void doView(RenderRequest request, RenderResponse response)
+   {
+      try
+      {
+         response.setContentType("text/html");
+         javax.portlet.PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/WEB-INF/calc/calc.jsp");
+         prd.include(request, response);
+      }
+      catch(Exception e)
+      {
+         e.printStackTrace();
+      }
+   }
+
+}

Added: portlets/2_4/src/CalcPortlet/src/resources/calcportlet-war/WEB-INF/calc/calc.jsp
===================================================================
--- portlets/2_4/src/CalcPortlet/src/resources/calcportlet-war/WEB-INF/calc/calc.jsp	2006-07-06 16:35:37 UTC (rev 75)
+++ portlets/2_4/src/CalcPortlet/src/resources/calcportlet-war/WEB-INF/calc/calc.jsp	2006-07-24 16:49:34 UTC (rev 76)
@@ -0,0 +1,112 @@
+<!--
+  User: Chris Mills (millsy at jboss.com)
+  Date: 03-Mar-2006
+  Time: 22:38:07
+-->
+<html>
+<head>
+    <style type="text/css">
+        .result-field{
+            font-family: monospace;
+            color: black;
+            text-align: right;
+            background-color: white;
+        }
+
+        .calc-button{
+            width: 30px;
+            height: 18px;
+        }
+    </style>
+    <script language-="JavaScript">
+        var op = '';
+        var firstValue = '';
+        var clearField = false;
+
+        function numberPushed(number) {
+            if ((clearField == true) || (document.calc.resultField.value == '0' && number != '.')) {
+                document.calc.resultField.value = number;
+                clearField = false;
+            } else {
+                document.calc.resultField.value = document.calc.resultField.value + number;
+            }
+        }
+
+        function operatorPushed(operator) {
+            if (firstValue != '') {
+                equals();
+            }
+            firstValue = document.calc.resultField.value;
+            op = operator;
+            clearField = true;
+        }
+
+        function equals() {
+            if (op == '*') {
+                document.calc.resultField.value = firstValue * document.calc.resultField.value;
+            }
+            if (op == '/') {
+                document.calc.resultField.value = firstValue / document.calc.resultField.value;
+            }
+            if (op == '-') {
+                document.calc.resultField.value = firstValue - document.calc.resultField.value;
+            }
+            if (op == '+') {
+                document.calc.resultField.value = parseFloat(firstValue) + parseFloat(document.calc.resultField.value);
+            }
+            clearField = true;
+            firstValue = '';
+        }
+
+        function empty() {
+            op = '';
+            firstValue = '';
+            document.calc.resultField.value = '0';
+        }
+
+    </script>
+</head>
+
+<body>
+<form name="calc">
+    <table width="140px" align="center">
+        <tr>
+            <td>
+                <table border="1">
+                    <tr>
+                        <td colspan="4"><input readonly="true" type="text" value="0" name="resultField" class="result-field"/></td>
+                    </tr>
+                    <tr>
+                        <td><input type="button" value="7" class="calc-button" onclick="numberPushed('7');"/></td>
+                        <td><input type="button" value="8" class="calc-button" onclick="numberPushed('8');"/></td>
+                        <td><input type="button" value="9" class="calc-button" onclick="numberPushed('9');"/></td>
+                        <td><input type="button" value="*" class="calc-button" onclick="operatorPushed('*');"/></td>
+                    </tr>
+                    <tr>
+                        <td><input type="button" value="4" class="calc-button" onclick="numberPushed('4');"/></td>
+                        <td><input type="button" value="5" class="calc-button" onclick="numberPushed('5');"/></td>
+                        <td><input type="button" value="6" class="calc-button" onclick="numberPushed('6');"/></td>
+                        <td><input type="button" value="/" class="calc-button" onclick="operatorPushed('/');"/></td>
+                    </tr>
+                    <tr>
+                        <td><input type="button" value="1" class="calc-button" onclick="numberPushed('1');"/></td>
+                        <td><input type="button" value="2" class="calc-button" onclick="numberPushed('2');"/></td>
+                        <td><input type="button" value="3" class="calc-button" onclick="numberPushed('3');"/></td>
+                        <td><input type="button" value="+" class="calc-button" onclick="operatorPushed('+');"/></td>
+                    </tr>
+                    <tr>
+                        <td><input type="button" value="." class="calc-button" onclick="numberPushed('.');"/></td>
+                        <td><input type="button" value="0" class="calc-button" onclick="numberPushed('0');"/></td>
+                        <td><input type="button" value="=" class="calc-button" onclick="equals();"/></td>
+                        <td><input type="button" value="-" class="calc-button" onclick="operatorPushed('-');"/></td>
+                    </tr>
+                    <tr>
+                        <td><input type="button" value="C" class="calc-button" onclick="empty();"/></td>
+                    </tr>
+                </table>
+            </td>
+        </tr>
+    </table>
+</form>
+</body>
+</html>

Added: portlets/2_4/src/CalcPortlet/src/resources/calcportlet-war/WEB-INF/calc-object.xml
===================================================================
--- portlets/2_4/src/CalcPortlet/src/resources/calcportlet-war/WEB-INF/calc-object.xml	2006-07-06 16:35:37 UTC (rev 75)
+++ portlets/2_4/src/CalcPortlet/src/resources/calcportlet-war/WEB-INF/calc-object.xml	2006-07-24 16:49:34 UTC (rev 76)
@@ -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>Calculator</page-name>
+         <window>
+            <window-name>CalculatorPortletWindow</window-name>
+            <instance-ref>CalculatorPortletInstance</instance-ref>
+            <region>center</region>
+            <height>0</height>
+         </window>
+      </page>
+   </deployment>
+</deployments>
\ No newline at end of file

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


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

Added: portlets/2_4/src/CalcPortlet/src/resources/calcportlet-war/WEB-INF/jboss-app.xml
===================================================================
--- portlets/2_4/src/CalcPortlet/src/resources/calcportlet-war/WEB-INF/jboss-app.xml	2006-07-06 16:35:37 UTC (rev 75)
+++ portlets/2_4/src/CalcPortlet/src/resources/calcportlet-war/WEB-INF/jboss-app.xml	2006-07-24 16:49:34 UTC (rev 76)
@@ -0,0 +1,3 @@
+<jboss-app>
+    <app-name>calcportlet</app-name>
+</jboss-app>
\ No newline at end of file

Added: portlets/2_4/src/CalcPortlet/src/resources/calcportlet-war/WEB-INF/jboss-web.xml
===================================================================
--- portlets/2_4/src/CalcPortlet/src/resources/calcportlet-war/WEB-INF/jboss-web.xml	2006-07-06 16:35:37 UTC (rev 75)
+++ portlets/2_4/src/CalcPortlet/src/resources/calcportlet-war/WEB-INF/jboss-web.xml	2006-07-24 16:49:34 UTC (rev 76)
@@ -0,0 +1,3 @@
+<?xml version="1.0"?>
+<jboss-web>
+</jboss-web>

Added: portlets/2_4/src/CalcPortlet/src/resources/calcportlet-war/WEB-INF/portlet-instances.xml
===================================================================
--- portlets/2_4/src/CalcPortlet/src/resources/calcportlet-war/WEB-INF/portlet-instances.xml	2006-07-06 16:35:37 UTC (rev 75)
+++ portlets/2_4/src/CalcPortlet/src/resources/calcportlet-war/WEB-INF/portlet-instances.xml	2006-07-24 16:49:34 UTC (rev 76)
@@ -0,0 +1,9 @@
+<?xml version="1.0" standalone="yes"?>
+<deployments>
+   <deployment>
+      <instance>
+         <instance-id>CalculatorPortletInstance</instance-id>
+         <portlet-ref>CalcPortlet</portlet-ref>
+      </instance>
+   </deployment>
+</deployments>

Added: portlets/2_4/src/CalcPortlet/src/resources/calcportlet-war/WEB-INF/portlet.xml
===================================================================
--- portlets/2_4/src/CalcPortlet/src/resources/calcportlet-war/WEB-INF/portlet.xml	2006-07-06 16:35:37 UTC (rev 75)
+++ portlets/2_4/src/CalcPortlet/src/resources/calcportlet-war/WEB-INF/portlet.xml	2006-07-24 16:49:34 UTC (rev 76)
@@ -0,0 +1,17 @@
+<?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>CalcPortlet</portlet-name>
+      <portlet-class>org.jboss.portlet.calc.CalcPortlet</portlet-class>
+      <supports>
+         <mime-type>text/html</mime-type>
+         <portlet-mode>VIEW</portlet-mode>
+      </supports>
+      <portlet-info>
+         <title>Calculator</title>
+      </portlet-info>
+   </portlet>
+</portlet-app>

Added: portlets/2_4/src/CalcPortlet/src/resources/calcportlet-war/WEB-INF/web.xml
===================================================================
--- portlets/2_4/src/CalcPortlet/src/resources/calcportlet-war/WEB-INF/web.xml	2006-07-06 16:35:37 UTC (rev 75)
+++ portlets/2_4/src/CalcPortlet/src/resources/calcportlet-war/WEB-INF/web.xml	2006-07-24 16:49:34 UTC (rev 76)
@@ -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