You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wsrp4j-dev@portals.apache.org by cz...@apache.org on 2005/08/25 10:39:38 UTC
cvs commit: ws-wsrp4j/portlets/calc/lib dummy.txt
cziegeler 2005/08/25 01:39:38
Modified: portlets/wsrptest/war/jsp test1.jsp test4.jsp test2.jsp
test3.jsp
portlets/proxyportlet/war/WEB-INF portlet.xml web.xml
portlets/build build.xml wsrptest.include
proxyportlet.include.example
provider/pluto/war/WEB-INF/data portletentityregistry.xml
SwingConsumer/persistence/pages
org.apache.wsrp4j.consumer.app.driver.PageImpl@WSRP4JTestPortlets.xml
portlets/wsrptest/war/WEB-INF portlet.xml
Added: portlets/calc/src/org/apache/wsrp4j/calcportlet
JSR168Portlet.java
portlets/build calc.include
SwingConsumer/persistence/portlets
org.apache.wsrp4j.consumer.driver.WSRPPortletImpl@WSRP4J_calc_1_1.xml
org.apache.wsrp4j.consumer.driver.WSRPPortletImpl@WSRP4J_calc_1_2.xml
portlets/calc/war/jsp Calc.jsp CalcOK.jsp CalcError.jsp
portlets/calc build.properties.example .cvsignore README.txt
portlets/calc/war/WEB-INF portlet.xml web.xml
portlets/calc/war/WEB-INF/tld portlet.tld
portlets/calc/lib dummy.txt
Log:
Add new calculator test portlet submitted by Michel Alessandrini (wsrp@gmx-topmail.de)
Add missing licence headers to various files
Revision Changes Path
1.1 ws-wsrp4j/portlets/calc/src/org/apache/wsrp4j/calcportlet/JSR168Portlet.java
Index: JSR168Portlet.java
===================================================================
/*
* Copyright 2000-2001,2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.wsrp4j.calcportlet;
import javax.portlet.GenericPortlet;
import javax.portlet.PortletConfig;
import javax.portlet.PortletException;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import javax.portlet.PortletRequestDispatcher;
import javax.portlet.UnavailableException;
import java.io.IOException;
/**
* JSR168-implementation of a calculator
*
* @author <a href="mailto:Michel.Alessandrini@fhdw.de">Michel Alessandrini</a>
*
* @version $Id$
*/
public class JSR168Portlet extends GenericPortlet {
/**
* JSR168-method for initialising the application
*/
public void init(PortletConfig config) throws PortletException,
UnavailableException {
super.init(config);
// reads the information out of the portlet.xml <init-param>
String creator = config.getInitParameter("creator");
if (creator == null)
creator = "N.N.";
}
/**
* JSR168-method to be called after invoking the submit-button in the form
* In the jsp it is necessary to use the following line for forms <br />
* <code>
* <form action="<%=renderResponse.createActionURL()%>" method="post">
* </code>
*/
public void processAction(ActionRequest actionRequest,
ActionResponse actionResponse) throws PortletException,
java.io.IOException {
try {
// reads the information out of the portlet.xml
// <portlet-preferences>
// PortletPreferences prefs = actionRequest.getPreferences();
// reads the information out of the jsp-files
String a = actionRequest.getParameter("a");
String b = actionRequest.getParameter("b");
String calctype = actionRequest.getParameter("calctype");
String error = "0";
double result = 0;
int ca = Integer.parseInt(calctype);
double da = Double.parseDouble(a);
double db = Double.parseDouble(b);
switch (ca) {
case 1:
result = da+ db;
break;
case 2:
result = da - db;
break;
case 3:
result = da * db;
break;
case 4:
result = da / db;
break;
default: {
result = 0;
error = "1";
}
}
// for displaying/rendering the values in the jsp
actionResponse.setRenderParameter("a", Double.toString(da));
actionResponse.setRenderParameter("b", Double.toString(db));
actionResponse.setRenderParameter("calctype", calctype);
actionResponse.setRenderParameter("result", Double.toString(result));
actionResponse.setRenderParameter("error", error);
} catch (Exception e) {
// ignore the exception
}
}
/**
* JSR168-method for rendering in the portlet-mode <code>VIEW</code><br/>
* this method will be called after every action<br/>
*/
public void doView(RenderRequest renderRequest,
RenderResponse renderResponse) throws PortletException, IOException {
try {
// get the values out of the rederRequest-object
// which only exists after an actionProcess()-Call
// String a = renderRequest.getParameter("a");
// String b = renderRequest.getParameter("b");
// String calctype = renderRequest.getParameter("calctype");
// String result = renderRequest.getParameter("result");
String error = renderRequest.getParameter("error");
PortletRequestDispatcher requestDispatcher = null;
// at the first doView()-Call all values will be null
if (error == null) {
// the initial-jsp is selected for displaying
requestDispatcher = getPortletContext().getRequestDispatcher("/jsp/Calc.jsp");
} else if (Integer.parseInt(error) == 0) {
// the result-jsp is selected for displaying
requestDispatcher = getPortletContext().getRequestDispatcher("/jsp/CalcOK.jsp");
} else {
// the error-jsp is selected for displaying
requestDispatcher = getPortletContext().getRequestDispatcher("/jsp/CalcError.jsp");
}
requestDispatcher.include(renderRequest, renderResponse);
} catch (Exception e) {
// ignore the exception
}
}
}
1.3 +15 -0 ws-wsrp4j/portlets/wsrptest/war/jsp/test1.jsp
Index: test1.jsp
===================================================================
RCS file: /home/cvs/ws-wsrp4j/portlets/wsrptest/war/jsp/test1.jsp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- test1.jsp 25 Jun 2004 15:02:41 -0000 1.2
+++ test1.jsp 25 Aug 2005 08:39:22 -0000 1.3
@@ -1,3 +1,18 @@
+<!--
+ Copyright 2000-2001,2004 The Apache Software Foundation.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
<%@ page session="true" %>
<%@ taglib uri='/WEB-INF/tld/portlet.tld' prefix='portlet'%>
<%@ page import="javax.portlet.*"%>
1.3 +15 -0 ws-wsrp4j/portlets/wsrptest/war/jsp/test4.jsp
Index: test4.jsp
===================================================================
RCS file: /home/cvs/ws-wsrp4j/portlets/wsrptest/war/jsp/test4.jsp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- test4.jsp 18 Aug 2005 09:38:14 -0000 1.2
+++ test4.jsp 25 Aug 2005 08:39:23 -0000 1.3
@@ -1,3 +1,18 @@
+<!--
+ Copyright 2000-2001,2004 The Apache Software Foundation.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
<%@ page session="true" %>
<%@ taglib uri='/WEB-INF/tld/portlet.tld' prefix='portlet'%>
<%@ page import="javax.portlet.*"%>
1.2 +15 -0 ws-wsrp4j/portlets/wsrptest/war/jsp/test2.jsp
Index: test2.jsp
===================================================================
RCS file: /home/cvs/ws-wsrp4j/portlets/wsrptest/war/jsp/test2.jsp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- test2.jsp 31 Oct 2003 22:26:44 -0000 1.1
+++ test2.jsp 25 Aug 2005 08:39:24 -0000 1.2
@@ -1,3 +1,18 @@
+<!--
+ Copyright 2000-2001,2004 The Apache Software Foundation.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
<%@ page session="true" %>
<%@ taglib uri='/WEB-INF/tld/portlet.tld' prefix='portlet'%>
<%@ page import="javax.portlet.*"%>
1.2 +15 -0 ws-wsrp4j/portlets/wsrptest/war/jsp/test3.jsp
Index: test3.jsp
===================================================================
RCS file: /home/cvs/ws-wsrp4j/portlets/wsrptest/war/jsp/test3.jsp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- test3.jsp 31 Oct 2003 22:26:44 -0000 1.1
+++ test3.jsp 25 Aug 2005 08:39:25 -0000 1.2
@@ -1,3 +1,18 @@
+<!--
+ Copyright 2000-2001,2004 The Apache Software Foundation.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
<%@ page session="true" %>
<%@ taglib uri='/WEB-INF/tld/portlet.tld' prefix='portlet'%>
<%@ page import="javax.portlet.*"%>
1.3 +15 -0 ws-wsrp4j/portlets/proxyportlet/war/WEB-INF/portlet.xml
Index: portlet.xml
===================================================================
RCS file: /home/cvs/ws-wsrp4j/portlets/proxyportlet/war/WEB-INF/portlet.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- portlet.xml 19 Oct 2004 18:25:22 -0000 1.2
+++ portlet.xml 25 Aug 2005 08:39:29 -0000 1.3
@@ -1,4 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 1999-2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd">
<portlet>
<portlet-name>ProxyPortlet</portlet-name>
1.2 +15 -0 ws-wsrp4j/portlets/proxyportlet/war/WEB-INF/web.xml
Index: web.xml
===================================================================
RCS file: /home/cvs/ws-wsrp4j/portlets/proxyportlet/war/WEB-INF/web.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- web.xml 17 Dec 2003 13:50:05 -0000 1.1
+++ web.xml 25 Aug 2005 08:39:29 -0000 1.2
@@ -1,4 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 1999-2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
<!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>
1.4 +15 -0 ws-wsrp4j/portlets/build/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/ws-wsrp4j/portlets/build/build.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- build.xml 14 Jun 2004 16:16:30 -0000 1.3
+++ build.xml 25 Aug 2005 08:39:29 -0000 1.4
@@ -1,4 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 1999-2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
<project name="Portlets" default="build" basedir="../">
<property name="debug" value="on"/>
1.2 +14 -0 ws-wsrp4j/portlets/build/wsrptest.include
Index: wsrptest.include
===================================================================
RCS file: /home/cvs/ws-wsrp4j/portlets/build/wsrptest.include,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- wsrptest.include 31 Oct 2003 22:26:44 -0000 1.1
+++ wsrptest.include 25 Aug 2005 08:39:29 -0000 1.2
@@ -1,3 +1,17 @@
+# Copyright 1999-2004 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
# The existance of this file within the /portlets/build
# directory indicates the buildprocess to include a portlet
# with this name in the pluto build process.
1.2 +14 -0 ws-wsrp4j/portlets/build/proxyportlet.include.example
Index: proxyportlet.include.example
===================================================================
RCS file: /home/cvs/ws-wsrp4j/portlets/build/proxyportlet.include.example,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- proxyportlet.include.example 25 Jun 2004 14:50:50 -0000 1.1
+++ proxyportlet.include.example 25 Aug 2005 08:39:29 -0000 1.2
@@ -1,3 +1,17 @@
+# Copyright 1999-2004 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
# The existance of the proxyportlet.include file within the /portlets/build
# directory indicates the buildprocess to include the proxyportlet
# in the build process.
1.1 ws-wsrp4j/portlets/build/calc.include
Index: calc.include
===================================================================
# Copyright 2005 The Apache Software Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# The existance of this file within the /portlets/build
# directory indicates the buildprocess to include a portlet
# with this name in the pluto build process.
# The defined structure of all portlet files must exists.
1.1 ws-wsrp4j/SwingConsumer/persistence/portlets/org.apache.wsrp4j.consumer.driver.WSRPPortletImpl@WSRP4J_calc_1_1.xml
Index: org.apache.wsrp4j.consumer.driver.WSRPPortletImpl@WSRP4J_calc_1_1.xml
===================================================================
<?xml version="1.0"?>
<!--
Copyright 1999-2005 The Apache Software Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<Portlet>
<portlet-key>
<portlet-handle>calc_1.1</portlet-handle>
<producer-id>1</producer-id>
</portlet-key>
<parent-handle>calc_1.1</parent-handle>
</Portlet>
1.1 ws-wsrp4j/SwingConsumer/persistence/portlets/org.apache.wsrp4j.consumer.driver.WSRPPortletImpl@WSRP4J_calc_1_2.xml
Index: org.apache.wsrp4j.consumer.driver.WSRPPortletImpl@WSRP4J_calc_1_2.xml
===================================================================
<?xml version="1.0"?>
<!--
Copyright 1999-2005 The Apache Software Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<Portlet>
<portlet-key>
<portlet-handle>calc_1.2</portlet-handle>
<producer-id>1</producer-id>
</portlet-key>
<parent-handle>calc_1.2</parent-handle>
</Portlet>
1.3 +9 -0 ws-wsrp4j/provider/pluto/war/WEB-INF/data/portletentityregistry.xml
Index: portletentityregistry.xml
===================================================================
RCS file: /home/cvs/ws-wsrp4j/provider/pluto/war/WEB-INF/data/portletentityregistry.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- portletentityregistry.xml 5 Dec 2003 16:01:44 -0000 1.2
+++ portletentityregistry.xml 25 Aug 2005 08:39:30 -0000 1.3
@@ -10,6 +10,15 @@
<definition-id>wsrptest.WSRPTestPortlet</definition-id>
</portlet>
</application>
+ <application id="calc_1">
+ <definition-id>calc</definition-id>
+ <portlet id="1">
+ <definition-id>calc.JSR168CalcPortlet</definition-id>
+ </portlet>
+ <portlet id="2">
+ <definition-id>calc.JSR168CalcPortlet</definition-id>
+ </portlet>
+ </application>
<application id="99">
<definition-id>wsrptest</definition-id>
<portlet id="1">
1.1 ws-wsrp4j/portlets/calc/war/jsp/Calc.jsp
Index: Calc.jsp
===================================================================
<!--
Copyright 2000-2001,2004 The Apache Software Foundation.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<%@ page session="true" %>
<%@ taglib uri='/WEB-INF/tld/portlet.tld' prefix='portlet'%>
<%@ page import="javax.portlet.*"%>
<%@ page import="java.util.*"%>
<portlet:defineObjects/>
<h1>CALC Portlet (wsrp)</h1>
<br />
<h2>Some nice infos about this portlet</h2>
<table>
<tr>
<td>Time:</td>
<td>
<%=Calendar.getInstance().getTime().toString()%>
</td>
</tr>
<tr>
<td>Current Mode:</td>
<td>
<%=renderRequest.getPortletMode()%>
</td>
</tr>
<tr>
<td>Current Window State:</td>
<td>
<%=renderRequest.getWindowState()%>
</td>
</tr>
</table>
<br /><br />
<%
PortletPreferences preferences = renderRequest.getPreferences();
%>
<h2>CALCULATOR</h2>
<form action="<%=renderResponse.createActionURL()%>" method="post">
<table>
<tr>
<td>1) value a</td>
<td>
<INPUT type="text" name="a" size="10"/>
</td>
</tr>
<tr></tr>
<tr>
<td>2) value b</td>
<td>
<INPUT type="text" name="b" size="10"/>
</td>
</tr>
<tr></tr>
<tr>
<td>3) Calc-Type</td>
<td>
<select name="calctype">
<option selected value="1">addition</option>
<option value="2">subtraction</option>
<option value="3">multiplication</option>
<option value="4">dividision</option>
</select>
</td>
</tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr>
<td><INPUT type="submit" value="Start"/></td>
<td><INPUT type="reset" value="Reset"/></td>
</tr>
</table>
</form>
<br /><br />
<h2>Read the formdata:</h2>
<table>
<tr>
<td>a:</td>
<td>
<!-- **************************************************** -->
<!-- **************************************************** -->
<%
String prop1 = renderRequest.getParameter("a");
out.print(prop1);
%>
</td>
</tr>
<tr>
<td>b:</td>
<td>
<!-- **************************************************** -->
<!-- **************************************************** -->
<%
String prop2 = renderRequest.getParameter("b");
out.print(prop2);
%>
</td>
</tr>
<tr>
<td>calctype:</td>
<td>
<%
String prop3 = renderRequest.getParameter("calctype");
out.print(prop3);
%>
</td>
</tr>
<tr>
<td>result:</td>
<td>
<%
String prop4 = renderRequest.getParameter("result");
out.print(prop4);
%>
</td>
</tr>
<tr>
<td>error:</td>
<td>
<%
String prop5 = renderRequest.getParameter("error");
out.print(prop5);
%>
</td>
</tr>
</table>
<br /><br />
<x-small>
By Apache 2005
</x-small>
1.1 ws-wsrp4j/portlets/calc/war/jsp/CalcOK.jsp
Index: CalcOK.jsp
===================================================================
<!--
Copyright 2000-2001,2004 The Apache Software Foundation.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<%@ page session="true" %>
<%@ taglib uri='/WEB-INF/tld/portlet.tld' prefix='portlet'%>
<%@ page import="javax.portlet.*"%>
<%@ page import="java.util.*"%>
<portlet:defineObjects/>
<h1>CALC Portlet (wsrp)</h1>
<br />
<font color="blue">The process was successful!!!<br/>
<%
out.println("the result is: " + renderRequest.getParameter("result"));
%>
</font>
<br />
<h2>Some nice infos about this portlet</h2>
<table>
<tr>
<td>Time:</td>
<td>
<%=Calendar.getInstance().getTime().toString()%>
</td>
</tr>
<tr>
<td>Current Mode:</td>
<td>
<%=renderRequest.getPortletMode()%>
</td>
</tr>
<tr>
<td>Current Window State:</td>
<td>
<%=renderRequest.getWindowState()%>
</td>
</tr>
</table>
<br /><br />
<%
PortletPreferences preferences = renderRequest.getPreferences();
%>
<h2>CALCULATOR</h2>
<form action="<%=renderResponse.createActionURL()%>" method="post">
<table>
<tr>
<td>1) value a</td>
<td>
<INPUT type="text" name="a" size="10"/>
</td>
</tr>
<tr></tr>
<tr>
<td>2) value b</td>
<td>
<INPUT type="text" name="b" size="10"/>
</td>
</tr>
<tr></tr>
<tr>
<td>3) Calc-Type</td>
<td>
<select name="calctype">
<option selected value="1">addition</option>
<option value="2">subtraction</option>
<option value="3">multiplication</option>
<option value="4">dividision</option>
</select>
</td>
</tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr>
<td><INPUT type="submit" value="Start"/></td>
<td><INPUT type="reset" value="Reset"/></td>
</tr>
</table>
</form>
<br /><br />
<h2>Read the formdata:</h2>
<table>
<tr>
<td>a:</td>
<td>
<!-- **************************************************** -->
<!-- @todo: show the selected todo-point -->
<!-- **************************************************** -->
<%
String prop1 = renderRequest.getParameter("a");
out.print(prop1);
%>
</td>
</tr>
<tr>
<td>b:</td>
<td>
<!-- **************************************************** -->
<!-- @todo: show the selected todo-point -->
<!-- **************************************************** -->
<%
String prop2 = renderRequest.getParameter("b");
out.print(prop2);
%>
</td>
</tr>
<tr>
<td>calctype:</td>
<td>
<%
String prop3 = renderRequest.getParameter("calctype");
out.print(prop3);
%>
</td>
</tr>
<tr>
<td>result:</td>
<td>
<%
String prop4 = renderRequest.getParameter("result");
out.print(prop4);
%>
</td>
</tr>
<tr>
<td>error:</td>
<td>
<%
String prop5 = renderRequest.getParameter("error");
out.print(prop5);
%>
</td>
</tr>
</table>
<br /><br />
<x-small>
By Apache 2005
</x-small>
1.1 ws-wsrp4j/portlets/calc/war/jsp/CalcError.jsp
Index: CalcError.jsp
===================================================================
<!--
Copyright 2000-2001,2004 The Apache Software Foundation.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<%@ page session="true" %>
<%@ taglib uri='/WEB-INF/tld/portlet.tld' prefix='portlet'%>
<%@ page import="javax.portlet.*"%>
<%@ page import="java.util.*"%>
<portlet:defineObjects/>
<h1>CALC Portlet (wsrp)</h1>
<br />
<font color="red">The process was NOT successful!!!<br/>
<%
out.println("The meaningless errorcode is: " + renderRequest.getParameter("error"));
%>
</font>
<br />
<h2>Some nice infos about this portlet</h2>
<table>
<tr>
<td>Time:</td>
<td>
<%=Calendar.getInstance().getTime().toString()%>
</td>
</tr>
<tr>
<td>Current Mode:</td>
<td>
<%=renderRequest.getPortletMode()%>
</td>
</tr>
<tr>
<td>Current Window State:</td>
<td>
<%=renderRequest.getWindowState()%>
</td>
</tr>
</table>
<br /><br />
<%
PortletPreferences preferences = renderRequest.getPreferences();
%>
<h2>CALCULATOR</h2>
<form action="<%=renderResponse.createActionURL()%>" method="post">
<table>
<tr>
<td>1) value a</td>
<td>
<INPUT type="text" name="a" size="10"/>
</td>
</tr>
<tr></tr>
<tr>
<td>2) value b</td>
<td>
<INPUT type="text" name="b" size="10"/>
</td>
</tr>
<tr></tr>
<tr>
<td>3) Calc-Type</td>
<td>
<select name="calctype">
<option selected value="1">addition</option>
<option value="2">subtraction</option>
<option value="3">multiplication</option>
<option value="4">dividision</option>
</select>
</td>
</tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr>
<td><INPUT type="submit" value="Start"/></td>
<td><INPUT type="reset" value="Reset"/></td>
</tr>
</table>
</form>
<br /><br />
<h2>Read the formdata:</h2>
<table>
<tr>
<td>a:</td>
<td>
<!-- **************************************************** -->
<!-- @todo: show the selected todo-point -->
<!-- **************************************************** -->
<%
String prop1 = renderRequest.getParameter("a");
out.print(prop1);
%>
</td>
</tr>
<tr>
<td>b:</td>
<td>
<!-- **************************************************** -->
<!-- @todo: show the selected todo-point -->
<!-- **************************************************** -->
<%
String prop2 = renderRequest.getParameter("b");
out.print(prop2);
%>
</td>
</tr>
<tr>
<td>calctype:</td>
<td>
<%
String prop3 = renderRequest.getParameter("calctype");
out.print(prop3);
%>
</td>
</tr>
<tr>
<td>result:</td>
<td>
<%
String prop4 = renderRequest.getParameter("result");
out.print(prop4);
%>
</td>
</tr>
<tr>
<td>error:</td>
<td>
<%
String prop5 = renderRequest.getParameter("error");
out.print(prop5);
%>
</td>
</tr>
</table>
<br /><br />
<x-small>
By Apache 2005
</x-small>
1.1 ws-wsrp4j/portlets/calc/build.properties.example
Index: build.properties.example
===================================================================
# Copyright 2005 The Apache Software Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
## the name of the target jar file
jarfile=calc.jar
## the name of the target war file
warfile=calc.war
## the tomcat dir we want this portlet to be deployed to
TARGET_TOMCAT_HOME=C:/Tomcat4.1
## the webapp containing the portlet container we use for deployment
TARGET_WEBAPP_NAME=wsrp
1.1 ws-wsrp4j/portlets/calc/.cvsignore
Index: .cvsignore
===================================================================
classes
driver
build.properties
1.1 ws-wsrp4j/portlets/calc/README.txt
Index: README.txt
===================================================================
# Copyright 2005 The Apache Software Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
- build
1. copy build.properties.example to build.properties
2. edit build.properties according to your environment
1.3 +25 -0 ws-wsrp4j/SwingConsumer/persistence/pages/org.apache.wsrp4j.consumer.app.driver.PageImpl@WSRP4JTestPortlets.xml
Index: org.apache.wsrp4j.consumer.app.driver.PageImpl@WSRP4JTestPortlets.xml
===================================================================
RCS file: /home/cvs/ws-wsrp4j/SwingConsumer/persistence/pages/org.apache.wsrp4j.consumer.app.driver.PageImpl@WSRP4JTestPortlets.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- org.apache.wsrp4j.consumer.app.driver.PageImpl@WSRP4JTestPortlets.xml 5 Dec 2003 16:01:30 -0000 1.2
+++ org.apache.wsrp4j.consumer.app.driver.PageImpl@WSRP4JTestPortlets.xml 25 Aug 2005 08:39:32 -0000 1.3
@@ -1,4 +1,21 @@
<?xml version="1.0"?>
+
+<!--
+ Copyright 1999-2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
<page pageID="1" title="WSRP4J Test">
<portlet-key xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="java:org.apache.wsrp4j.consumer.driver.PortletKeyImpl">
<portlet-handle>0.1</portlet-handle>
@@ -9,6 +26,14 @@
<producer-id>1</producer-id>
</portlet-key>
<portlet-key xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="java:org.apache.wsrp4j.consumer.driver.PortletKeyImpl">
+ <portlet-handle>calc_1.1</portlet-handle>
+ <producer-id>1</producer-id>
+ </portlet-key>
+ <portlet-key xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="java:org.apache.wsrp4j.consumer.driver.PortletKeyImpl">
+ <portlet-handle>calc_1.2</portlet-handle>
+ <producer-id>1</producer-id>
+ </portlet-key>
+ <portlet-key xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="java:org.apache.wsrp4j.consumer.driver.PortletKeyImpl">
<portlet-handle>99.1</portlet-handle>
<producer-id>1</producer-id>
</portlet-key>
1.2 +15 -0 ws-wsrp4j/portlets/wsrptest/war/WEB-INF/portlet.xml
Index: portlet.xml
===================================================================
RCS file: /home/cvs/ws-wsrp4j/portlets/wsrptest/war/WEB-INF/portlet.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- portlet.xml 31 Oct 2003 22:26:44 -0000 1.1
+++ portlet.xml 25 Aug 2005 08:39:34 -0000 1.2
@@ -1,4 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 1999-2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd">
<portlet>
<description>WSRP Test Portlet</description>
1.1 ws-wsrp4j/portlets/calc/war/WEB-INF/portlet.xml
Index: portlet.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 1999-2005 The Apache Software Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd">
<portlet>
<description>JSR 168 Portlet: Calc</description>
<portlet-name>JSR168CalcPortlet</portlet-name>
<display-name>JSR 168 Calc Portlet</display-name>
<portlet-class>org.apache.wsrp4j.calcportlet.JSR168Portlet</portlet-class>
<init-param>
<name>creator</name>
<value>Alessandrini</value>
</init-param>
<expiration-cache>-1</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
<!-- <portlet-mode>EDIT</portlet-mode> -->
<!-- <portlet-mode>HELP</portlet-mode> -->
</supports>
<supported-locale>en</supported-locale>
<portlet-info>
<title>JSR 168 Calc Portlet</title>
<short-title>JSR 168 Calc</short-title>
<keywords>JSR168, WSRP, Calc</keywords>
</portlet-info>
<portlet-preferences>
<preference>
<name>calctype</name>
<value>1</value>
</preference>
</portlet-preferences>
<!--
<preferences-validator>
de.fhdw.calc.wsrp.PreferencesValidator
</preferences-validator>
-->
</portlet>
</portlet-app>
1.1 ws-wsrp4j/portlets/calc/war/WEB-INF/web.xml
Index: web.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 1999-2005 The Apache Software Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!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>
<display-name>JSR168 Portlet Calc</display-name>
<description>Calculation</description>
<servlet>
<servlet-name>JSR168CalcPortlet</servlet-name>
<display-name>Calc Portlet</display-name>
<description>Calc Portlet Description</description>
<servlet-class>org.apache.pluto.core.PortletServlet</servlet-class>
<init-param>
<param-name>portlet-class</param-name>
<param-value>org.apache.wsrp4j.calcportlet.JSR168Portlet</param-value>
</init-param>
<init-param>
<param-name>portlet-guid</param-name>
<param-value>calc.JSR168CalcPortlet</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>JSR168CalcPortlet</servlet-name>
<url-pattern>/JSR168CalcPortlet/*</url-pattern>
</servlet-mapping>
</web-app>
1.1 ws-wsrp4j/portlets/calc/war/WEB-INF/tld/portlet.tld
Index: portlet.tld
===================================================================
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE taglib PUBLIC
"-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
"http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
<taglib>
<tlibversion>1.0</tlibversion>
<jspversion>1.1</jspversion>
<shortname>Tags for portlets</shortname>
<tag>
<name>defineObjects</name>
<tagclass>org.apache.pluto.tags.DefineObjectsTag</tagclass>
<teiclass>org.apache.pluto.tags.DefineObjectsTag$TEI</teiclass>
<bodycontent>empty</bodycontent>
</tag>
<tag>
<name>param</name>
<tagclass>org.apache.pluto.tags.ParamTag</tagclass>
<bodycontent>empty</bodycontent>
<attribute>
<name>name</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>value</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
<tag>
<name>actionURL</name>
<tagclass>org.apache.pluto.tags.ActionURLTag</tagclass>
<teiclass>org.apache.pluto.tags.BasicURLTag$TEI</teiclass>
<bodycontent>JSP</bodycontent>
<attribute>
<name>windowState</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>portletMode</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>secure</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>var</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
<tag>
<name>renderURL</name>
<tagclass>org.apache.pluto.tags.RenderURLTag</tagclass>
<teiclass>org.apache.pluto.tags.BasicURLTag$TEI</teiclass>
<bodycontent>JSP</bodycontent>
<attribute>
<name>windowState</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>portletMode</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>secure</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>var</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
<tag>
<name>namespace</name>
<tagclass>org.apache.pluto.tags.NamespaceTag</tagclass>
<bodycontent>empty</bodycontent>
</tag>
</taglib>
1.1 ws-wsrp4j/portlets/calc/lib/dummy.txt
Index: dummy.txt
===================================================================
portlet specific libs needed for build go here