You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pubscribe-dev@ws.apache.org by sc...@apache.org on 2005/06/24 21:35:01 UTC

svn commit: r201670 - in /incubator/hermes/trunk/src: examples/consumer/notifconsumer.jsp site/content/tutorial/notifproducer.jsp

Author: scamp
Date: Fri Jun 24 12:35:00 2005
New Revision: 201670

URL: http://svn.apache.org/viewcvs?rev=201670&view=rev
Log: (empty)

Added:
    incubator/hermes/trunk/src/examples/consumer/notifconsumer.jsp
    incubator/hermes/trunk/src/site/content/tutorial/notifproducer.jsp

Added: incubator/hermes/trunk/src/examples/consumer/notifconsumer.jsp
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/examples/consumer/notifconsumer.jsp?rev=201670&view=auto
==============================================================================
--- incubator/hermes/trunk/src/examples/consumer/notifconsumer.jsp (added)
+++ incubator/hermes/trunk/src/examples/consumer/notifconsumer.jsp Fri Jun 24 12:35:00 2005
@@ -0,0 +1,138 @@
+
+
+
+<%@ page import="org.apache.ws.resource.example.RequestUtils,
+                 org.apache.ws.resource.example.notifConsumer.*"%>
+
+ <%
+  if(request.getParameter("page") == null)
+  {
+%>
+                
+
+<HTML>
+<head>
+<title>Notification Consumer Gui</title>
+</head>
+<BODY>
+<h1>Notification Consumer Gui</h1>
+<FORM METHOD=POST ACTION="notifconsumer.jsp">
+This form will subscribe the ConsumerPortResource for ResourcePropertyChangedNotifications from a NotificationProducer Resource's Property.  
+<P>ConsumerPortService Consumer EPR URL (a file on a URL which contains the 2004/08 EPR XML):  <input type="text" name="consumerurl"  value="http://localhost:8080/pubscribe/epr/consumer.txt" size="100"/></P>
+<P>Notification Producer EPR URL (a file on a URL which contains the 2004/08 EPR XML):  <input type="text" name="subscribeurl"  value="http://localhost:8080/pubscribe/epr/filesystem.txt" size="100"/></P>
+<P>Notification Producer's Simple Topic QName (Note: Must be in format usable from QName.valueOf(..) see example in textfield):  <input type="text" name="topicname"  value="{http://ws.apache.org/resource/example/filesystem}Comment" size="100"/></P>
+<P><INPUT TYPE="SUBMIT" value="SUBSCRIBE"/>
+<INPUT TYPE="hidden" name="page" value="subscribe"/>
+</P>
+</FORM>
+</BODY>
+</HTML>
+<%
+}
+
+else if(request.getParameter("page").equals("subscribe"))
+{
+   boolean bool = org.apache.ws.resource.example.RequestUtils.invokeSubscribe(request.getParameter("consumerurl"), request.getParameter("subscribeurl"), request.getParameter("topicname"));
+%>
+<HTML>
+<head>
+<title>Notification Consumer Gui</title>
+</head>
+<BODY>
+<h1>Notification Consumer Gui</h1>
+<%
+
+   if(bool)
+   {
+       out.println("Subscribe succeeded!");
+%>
+
+<FORM METHOD=POST ACTION="notifconsumer.jsp">
+<P><INPUT TYPE="SUBMIT" value="Go to Get Last Notif Form"/>
+<input type="hidden" name="consumerurl" value="<%= request.getParameter("consumerurl") %>"/>
+<input type="hidden" name="page" value="printnotif"/>
+</P>
+</FORM>
+
+<%
+   }//end if
+
+else
+{
+	out.println("Subscribe failed!");
+	out.println("Please try again");
+%>
+<FORM METHOD=POST ACTION="notifconsumer.jsp">
+<P><INPUT TYPE="SUBMIT" value="Return to Form"/></P>
+</FORM>
+</body>
+</html>
+<%
+   }//end else
+}//end else if
+
+else if(request.getParameter("page").equals("printnotif"))
+{
+%>
+<HTML>
+<head>
+<title>Notification Consumer Gui</title>
+</head>
+<BODY>
+<h1>Notification Consumer Gui</h1>
+<FORM METHOD=POST ACTION="notifconsumer.jsp">
+<P>Check the ConsumerPortResource to see if it has received notifications:</P>
+<P>ConsumerPortService Consumer EPR URL (a file on a URL which contains the 2004/08 EPR XML):  <input type="text" name="consumerurl"  value="<%= request.getParameter("consumerurl") %>" size="100"/></P>
+<P><INPUT TYPE="SUBMIT" value="Get Last Notification"/>
+<INPUT TYPE="hidden" name="page" value="getnotif"/>
+</body></html>
+<%
+}
+
+else if(request.getParameter("page").equals("getnotif"))
+{
+%>
+<HTML>
+<head>
+<title>Notification Consumer Gui</title>
+</head>
+<BODY>
+<h1>Notification Consumer Gui</h1>
+<%
+ //if successfulprint message...elseprint failed and go back to get notif
+  LastMessageType lastMessage = RequestUtils.getLastMessage(request.getParameter("consumerurl"));
+  if(lastMessage == null)
+    {
+       out.println("Notification was null!  Try again!");
+%>
+<FORM METHOD=POST ACTION="notifconsumer.jsp">
+<P><INPUT TYPE="SUBMIT" value="Go to GetLastNotification Form"/>
+<input type="hidden" name="page" value="printnotif"/>
+<input type="hidden" name="consumerurl" value="<%=request.getParameter("consumerurl")  %>"/>
+</P>
+</FORM>
+<%
+}//end if
+else
+{
+ out.println("<strong>The notification was recieved at: " + lastMessage.getOccurred().getTime().toString() + "</strong>");
+%>
+<form METHOD=POST ACTION="notifconsumer.jsp">
+<textarea rows="40" cols="100">
+<%
+ out.println(lastMessage.getNotification().toString());       
+%>
+ </textarea>
+<P>ConsumerPortService Consumer EPR URL (a file on a URL which contains the 2004/08 EPR XML):  <input type="text" name="consumerurl"  value="<%= request.getParameter("consumerurl") %>" size="100"/></P>
+<P><INPUT TYPE="SUBMIT" value="Get Last Notification"/>
+</P>
+<INPUT TYPE="hidden" name="page" value="printnotif"/>
+ </form>
+<%
+    }//end else
+	%>
+	</body></html>
+	<%
+}//end else if
+%>
+

Added: incubator/hermes/trunk/src/site/content/tutorial/notifproducer.jsp
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/site/content/tutorial/notifproducer.jsp?rev=201670&view=auto
==============================================================================
--- incubator/hermes/trunk/src/site/content/tutorial/notifproducer.jsp (added)
+++ incubator/hermes/trunk/src/site/content/tutorial/notifproducer.jsp Fri Jun 24 12:35:00 2005
@@ -0,0 +1,61 @@
+
+<%@ page import="example.NotifRequestUtils "%>
+
+<%
+  if(request.getParameter("page") == null)
+  {
+%>
+
+<HTML>
+<head>
+<title>Producer Resource Gui</title>
+</head>
+<BODY>
+<h1>Producer Resource Gui</h1>
+<FORM METHOD=POST ACTION="notifproducer.jsp">
+This form will trigger a ResourcePropertyChangedNotification on a Producer Resource's Simple-Type Resource Property.  Modify the Comment Message and click the button to trigger the event.
+<P>Notification Producer EPR URL (a file on a URL which contains the 2004/08 EPR XML):  <input type="text" name="serviceurl"  value="http://localhost:8080/pubscribe/epr/filesystem.txt" size="100"/></P>
+<P>Simple-Type Property to be Changed (Note: Must be in format usable from QName.valueOf(..) see example in textfield):  <input type="text" name="prop"  value="{http://ws.apache.org/resource/example/filesystem}Comment" size="100"/></P>
+<P>Value to be Changed:  <input type="text" name="msg"  value="Quick test!" size="100"/></P>
+<P><INPUT TYPE="SUBMIT" value="Trigger Notification!"/>
+</P>
+<INPUT TYPE="hidden" name="page" value="trigger"/>
+</FORM>
+</BODY>
+</HTML>
+
+<%
+}
+else
+{
+    boolean bool = NotifRequestUtils.invokeSetResourceProperty(request.getParameter( "prop" ), request.getParameter("msg") ,request.getParameter( "serviceurl" ));
+ %>
+ <HTML>
+<head>
+<title>Producer Resource Gui</title>
+</head>
+<BODY>
+<h1>Producer Resource Gui</h1>
+ <%   
+    if(!bool)
+    {
+        out.println("Invoke prop change failed!"); 		
+    }
+
+    else
+    {
+        out.println("Invoke prop change was successful!");
+		}
+ %>
+
+	<FORM METHOD=POST ACTION="notifproducer.jsp">
+<P><INPUT TYPE="SUBMIT" value="Return to Form"/>
+</P>
+</FORM>
+</BODY>
+ </HTML>
+<%
+
+}
+%>
+



---------------------------------------------------------------------
To unsubscribe, e-mail: pubscribe-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: pubscribe-dev-help@ws.apache.org