Author: lischke
Date: Wed Mar 23 18:09:10 2005
New Revision: 158858
URL: http://svn.apache.org/viewcvs?view=rev&rev=158858
Log:
changed GUI design
Added:
incubator/hermes/trunk/src/examples/pubsubclient/ConsumerPanel.java
incubator/hermes/trunk/src/examples/pubsubclient/NotificationListModel.java
incubator/hermes/trunk/src/examples/pubsubclient/SubscriptionListModel.java
incubator/hermes/trunk/src/examples/pubsubclient/WEB-INF/server-config_wsn.wsdd
Removed:
incubator/hermes/trunk/src/examples/pubsubclient/NotListModel.java
incubator/hermes/trunk/src/examples/pubsubclient/SubListModel.java
incubator/hermes/trunk/src/examples/pubsubclient/SubscribePanel.java
Modified:
incubator/hermes/trunk/src/examples/pubsubclient/GUIConsumer.java
incubator/hermes/trunk/src/examples/pubsubclient/GUIEndConsumer.java
incubator/hermes/trunk/src/examples/pubsubclient/PubSubClient.java
incubator/hermes/trunk/src/examples/pubsubclient/PubSubWSmanager.java
incubator/hermes/trunk/src/examples/pubsubclient/PublisherPanel.java
incubator/hermes/trunk/src/examples/pubsubclient/TopicSpaceTree.java
incubator/hermes/trunk/src/examples/pubsubclient/WEB-INF/server-config.wsdd
Added: incubator/hermes/trunk/src/examples/pubsubclient/ConsumerPanel.java
URL:
http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/examples/pubsubclient/ConsumerPanel.java?view=auto&rev=158858
==============================================================================
--- incubator/hermes/trunk/src/examples/pubsubclient/ConsumerPanel.java (added)
+++ incubator/hermes/trunk/src/examples/pubsubclient/ConsumerPanel.java Wed Mar
23 18:09:10 2005
@@ -0,0 +1,247 @@
+/*
+ * spanel.java
+ *
+ * Created on 24. MÃrz 2005, 01:01
+ */
+import java.util.Calendar;
+import javax.swing.JTabbedPane;
+import javax.swing.tree.*;
+
+import org.apache.ws.pubsub.*;
+import org.apache.ws.notification.topics.Topic;
+/**
+ *
+ * @author Administrator
+ */
+public class ConsumerPanel extends javax.swing.JPanel {
+ private PubSubWSmanager pman;
+ private Calendar time=Calendar.getInstance();
+
+ private SubscriptionListModel sublistmodel;
+ private NotificationListModel notlistmodel;
+ /** Creates new form spanel */
+ public ConsumerPanel(JTabbedPane notebook, PubSubWSmanager _pman) {
+ this.pman=_pman;
+ initComponents();
+ timeSlider.setMinimum(0);
+ timeSlider.setMaximum(100);
+ timeSlider.setValue(0);
+
+ sublistmodel=new SubscriptionListModel();
+ notlistmodel=new NotificationListModel();
+ subs.setModel(sublistmodel);
+ nots.setModel(notlistmodel);
+
+ DefaultTreeCellRenderer renderer2 = new DefaultTreeCellRenderer();
+ renderer2.setOpenIcon(null);
+ renderer2.setClosedIcon(null);
+ renderer2.setLeafIcon(null);
+ tree.setCellRenderer(renderer2);
+
+ notebook.addTab( "Consumer", this );
+
+
+ }
+
+ /** This method is called from within the constructor to
+ * initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is
+ * always regenerated by the Form Editor.
+ */
+ private void initComponents() {//GEN-BEGIN:initComponents
+ cXfilter = new javax.swing.JCheckBox();
+ filterstr = new javax.swing.JTextField();
+ cTermtime = new javax.swing.JCheckBox();
+ termtime = new javax.swing.JTextField();
+ cTfilter = new javax.swing.JCheckBox();
+ jList1 = new javax.swing.JList();
+ jButton1 = new javax.swing.JButton();
+ cSubend = new javax.swing.JCheckBox();
+ jScrollPane1 = new javax.swing.JScrollPane();
+ tree = new TopicSpaceTree(pman).getTree();
+
+ jSeparator1 = new javax.swing.JSeparator();
+ jScrollPane2 = new javax.swing.JScrollPane();
+ subs = new javax.swing.JList();
+ jScrollPane3 = new javax.swing.JScrollPane();
+ nots = new javax.swing.JList();
+ renewButton = new javax.swing.JButton();
+ unsubscribeButton = new javax.swing.JButton();
+ jLabel1 = new javax.swing.JLabel();
+ jLabel2 = new javax.swing.JLabel();
+ timeSlider = new javax.swing.JSlider();
+
+ setLayout(null);
+
+ cXfilter.setText("XPath Filter");
+ cXfilter.setToolTipText("If you want to make a XPath Subscription
click here");
+ add(cXfilter);
+ cXfilter.setBounds(10, 20, 93, 27);
+
+ filterstr.setText("//a/b");
+ filterstr.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ filterstrActionPerformed(evt);
+ }
+ });
+
+ add(filterstr);
+ filterstr.setBounds(10, 50, 290, 24);
+
+ cTermtime.setText("Termination Time");
+ add(cTermtime);
+ cTermtime.setBounds(10, 80, 130, 27);
+
+ termtime.setText("jTextField2");
+ termtime.setEnabled(false);
+ add(termtime);
+ termtime.setBounds(10, 110, 290, 24);
+
+ cTfilter.setText("jCheckBox3");
+ add(cTfilter);
+ cTfilter.setBounds(340, 20, 150, 27);
+
+ jList1.setBackground(new java.awt.Color(255, 51, 51));
+ add(jList1);
+ jList1.setBounds(70, 280, 0, 0);
+
+ jButton1.setText("Subscribe");
+ jButton1.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ subscribeButton(evt);
+ }
+ });
+
+ add(jButton1);
+ jButton1.setBounds(10, 200, 290, 27);
+
+ cSubend.setText("Subscription End Notification");
+ add(cSubend);
+ cSubend.setBounds(10, 170, 290, 27);
+
+ jScrollPane1.setViewportView(tree);
+
+ add(jScrollPane1);
+ jScrollPane1.setBounds(340, 50, 200, 180);
+
+ add(jSeparator1);
+ jSeparator1.setBounds(10, 240, 530, 2);
+
+ jScrollPane2.setViewportView(subs);
+
+ add(jScrollPane2);
+ jScrollPane2.setBounds(10, 270, 240, 110);
+
+ jScrollPane3.setViewportView(nots);
+
+ add(jScrollPane3);
+ jScrollPane3.setBounds(280, 270, 260, 140);
+
+ renewButton.setText("Renew");
+ renewButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ renewButtonActionPerformed(evt);
+ }
+ });
+
+ add(renewButton);
+ renewButton.setBounds(10, 390, 80, 27);
+
+ unsubscribeButton.setText("Unsubscribe");
+ unsubscribeButton.addActionListener(new
java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ unsubscribeEvent(evt);
+ }
+ });
+
+ add(unsubscribeButton);
+ unsubscribeButton.setBounds(140, 390, 110, 27);
+
+ jLabel1.setText("Subscriptions");
+ add(jLabel1);
+ jLabel1.setBounds(10, 250, 170, 18);
+
+ jLabel2.setText("Notifications");
+ add(jLabel2);
+ jLabel2.setBounds(280, 250, 170, 18);
+
+ timeSlider.addChangeListener(new javax.swing.event.ChangeListener() {
+ public void stateChanged(javax.swing.event.ChangeEvent evt) {
+ timeSliderHandler(evt);
+ }
+ });
+
+ add(timeSlider);
+ timeSlider.setBounds(10, 130, 290, 40);
+
+ }//GEN-END:initComponents
+
+ private void unsubscribeEvent(java.awt.event.ActionEvent evt)
{//GEN-FIRST:event_unsubscribeEvent
+ if(subs.getSelectedIndex()!=-1){
+ org.apache.ws.pubsub.Subscription s =
(org.apache.ws.pubsub.Subscription)sublistmodel.getElementAt(subs.getSelectedIndex());
+ s.unsubscribe();
+ }
+ }//GEN-LAST:event_unsubscribeEvent
+
+ private void timeSliderHandler(javax.swing.event.ChangeEvent evt)
{//GEN-FIRST:event_timeSliderHandler
+ time = Calendar.getInstance();
+ time.add(Calendar.MINUTE,timeSlider.getValue());
+ termtime.setText(time.getTime().toString());
+ }//GEN-LAST:event_timeSliderHandler
+
+ private void renewButtonActionPerformed(java.awt.event.ActionEvent evt)
{//GEN-FIRST:event_renewButtonActionPerformed
+ if(subs.getSelectedIndex()!=-1){
+ org.apache.ws.pubsub.Subscription s =
(org.apache.ws.pubsub.Subscription)sublistmodel.getElementAt(subs.getSelectedIndex());
+ s.setTerminationTime(time);
+ }
+ }//GEN-LAST:event_renewButtonActionPerformed
+
+ private void subscribeButton(java.awt.event.ActionEvent evt)
{//GEN-FIRST:event_subscribeButton
+ Topic t=null;
+ String xpath=null;
+ Calendar expire=null;
+ boolean subend = (cSubend.getSelectedObjects()!=null);
+ if(cTfilter.getSelectedObjects()!=null){
+ TreePath[] ts =tree.getSelectionModel().getSelectionPaths();
+ if(ts!=null)
+ t =
(org.apache.ws.notification.topics.Topic)((DefaultMutableTreeNode)
ts[ts.length-1].getLastPathComponent()).getUserObject();
+ }
+ if(cXfilter.getSelectedObjects()!=null){
+ xpath= filterstr.getText();
+ }
+ if(cTermtime.getSelectedObjects()!=null){
+ expire = time;
+ }
+ Subscription s = pman.subscribe(sublistmodel,notlistmodel,xpath,t,
expire,subend);
+ sublistmodel.addData(s);
+ }//GEN-LAST:event_subscribeButton
+
+ private void filterstrActionPerformed(java.awt.event.ActionEvent evt)
{//GEN-FIRST:event_filterstrActionPerformed
+ // TODO add your handling code here:
+ }//GEN-LAST:event_filterstrActionPerformed
+
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JCheckBox cSubend;
+ private javax.swing.JCheckBox cTermtime;
+ private javax.swing.JCheckBox cTfilter;
+ private javax.swing.JCheckBox cXfilter;
+ private javax.swing.JTextField filterstr;
+ private javax.swing.JButton jButton1;
+ private javax.swing.JLabel jLabel1;
+ private javax.swing.JLabel jLabel2;
+ private javax.swing.JList jList1;
+ private javax.swing.JScrollPane jScrollPane1;
+ private javax.swing.JScrollPane jScrollPane2;
+ private javax.swing.JScrollPane jScrollPane3;
+ private javax.swing.JSeparator jSeparator1;
+ private javax.swing.JList nots;
+ private javax.swing.JButton renewButton;
+ private javax.swing.JList subs;
+ private javax.swing.JTextField termtime;
+ private javax.swing.JSlider timeSlider;
+ private javax.swing.JTree tree;
+ private javax.swing.JButton unsubscribeButton;
+ // End of variables declaration//GEN-END:variables
+
+}
Modified: incubator/hermes/trunk/src/examples/pubsubclient/GUIConsumer.java
URL:
http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/examples/pubsubclient/GUIConsumer.java?view=diff&r1=158857&r2=158858
==============================================================================
--- incubator/hermes/trunk/src/examples/pubsubclient/GUIConsumer.java (original)
+++ incubator/hermes/trunk/src/examples/pubsubclient/GUIConsumer.java Wed Mar
23 18:09:10 2005
@@ -21,22 +21,22 @@
* @author Stefan Lischke
*/
public class GUIConsumer implements org.apache.ws.pubsub.NotificationConsumer{
- SubListModel comp;
+ NotificationListModel comp;
private EndpointReference epr;
public GUIConsumer(String epr){
//TODO decouple epr
- //org.xmlsoap.schemas.ws.x2004.x08.addressing.EndpointReferenceType e
=
org.xmlsoap.schemas.ws.x2004.x08.addressing.EndpointReferenceType.Factory.newInstance();
- //org.xmlsoap.schemas.ws.x2004.x08.addressing.AttributedURI auri =
org.xmlsoap.schemas.ws.x2004.x08.addressing.AttributedURI.Factory.newInstance();
- org.xmlsoap.schemas.ws.x2003.x03.addressing.EndpointReferenceType e =
org.xmlsoap.schemas.ws.x2003.x03.addressing.EndpointReferenceType.Factory.newInstance();
- org.xmlsoap.schemas.ws.x2003.x03.addressing.AttributedURI auri =
org.xmlsoap.schemas.ws.x2003.x03.addressing.AttributedURI.Factory.newInstance();
+ org.xmlsoap.schemas.ws.x2004.x08.addressing.EndpointReferenceType e =
org.xmlsoap.schemas.ws.x2004.x08.addressing.EndpointReferenceType.Factory.newInstance();
+ org.xmlsoap.schemas.ws.x2004.x08.addressing.AttributedURI auri =
org.xmlsoap.schemas.ws.x2004.x08.addressing.AttributedURI.Factory.newInstance();
+ //org.xmlsoap.schemas.ws.x2003.x03.addressing.EndpointReferenceType e
=
org.xmlsoap.schemas.ws.x2003.x03.addressing.EndpointReferenceType.Factory.newInstance();
+ //org.xmlsoap.schemas.ws.x2003.x03.addressing.AttributedURI auri =
org.xmlsoap.schemas.ws.x2003.x03.addressing.AttributedURI.Factory.newInstance();
auri.setStringValue(epr);
e.setAddress(auri);
//wrapper
this.epr= new XmlBeansEndpointReference(e);
}
/** Creates a new instance of PopUpConsumer */
- public GUIConsumer(String epr, SubListModel comp) {
+ public GUIConsumer(String epr, NotificationListModel comp) {
this(epr);
this.comp=comp;
}
Modified: incubator/hermes/trunk/src/examples/pubsubclient/GUIEndConsumer.java
URL:
http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/examples/pubsubclient/GUIEndConsumer.java?view=diff&r1=158857&r2=158858
==============================================================================
--- incubator/hermes/trunk/src/examples/pubsubclient/GUIEndConsumer.java
(original)
+++ incubator/hermes/trunk/src/examples/pubsubclient/GUIEndConsumer.java Wed
Mar 23 18:09:10 2005
@@ -21,7 +21,7 @@
* @author Stefan Lischke
*/
public class GUIEndConsumer implements
org.apache.ws.pubsub.SubscriptionEndConsumer{
- NotListModel comp;
+ SubscriptionListModel comp;
private EndpointReference epr;
public GUIEndConsumer(String epr){
@@ -36,7 +36,7 @@
this.epr= new XmlBeansEndpointReference(e);
}
/** Creates a new instance of PopUpConsumer */
- public GUIEndConsumer(String epr, NotListModel comp) {
+ public GUIEndConsumer(String epr, SubscriptionListModel comp) {
this(epr);
this.comp=comp;
}
Added:
incubator/hermes/trunk/src/examples/pubsubclient/NotificationListModel.java
URL:
http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/examples/pubsubclient/NotificationListModel.java?view=auto&rev=158858
==============================================================================
--- incubator/hermes/trunk/src/examples/pubsubclient/NotificationListModel.java
(added)
+++ incubator/hermes/trunk/src/examples/pubsubclient/NotificationListModel.java
Wed Mar 23 18:09:10 2005
@@ -0,0 +1,37 @@
+import javax.swing.AbstractListModel;
+
+class NotificationListModel extends AbstractListModel {
+ private java.util.Vector myData;
+
+ public NotificationListModel() {
+ myData=new java.util.Vector();
+ }
+
+ public int getSize() { return myData.size();}
+ public Object getElementAt(int i) { return myData.elementAt(i);}
+
+ public void addData(Object obj) {
+ myData.add(obj); //Add data to the vector.
+ fireContentsChanged(this,0,myData.size()-1); //fire event so that
List updates itself.
+ }
+
+ public void removeData(Object obj) {
+ myData.remove(obj); //Add data to the vector.
+ fireContentsChanged(this,0,myData.size()-1); //fire event so that
List updates itself.
+ }
+ /*
+ public class notentry{
+ public String id;
+ public String content;
+ public notentry(String id, Object message)throws Exception{
+ this.id=id;
+
this.content=((org.apache.axis.message.SOAPEnvelope)message).getBody().toString();
+ }
+
+ public String toString(){
+ return id;//+" "+content;
+ }
+
+ }
+ */
+}
Modified: incubator/hermes/trunk/src/examples/pubsubclient/PubSubClient.java
URL:
http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/examples/pubsubclient/PubSubClient.java?view=diff&r1=158857&r2=158858
==============================================================================
--- incubator/hermes/trunk/src/examples/pubsubclient/PubSubClient.java
(original)
+++ incubator/hermes/trunk/src/examples/pubsubclient/PubSubClient.java Wed Mar
23 18:09:10 2005
@@ -1430,9 +1430,9 @@
PubSubWSmanager pman = new PubSubWSmanager(hermes_home);
- SubscribePanel app = new SubscribePanel(notebook,pman);
- PublisherPanel app2 = new PublisherPanel(notebook,pman);
-
+ ConsumerPanel cpan = new ConsumerPanel(notebook,pman);
+ PublisherPanel app2 = new PublisherPanel(notebook,pman);
+
Listener outgoing= new Listener( notebook, "Producer", pman.outport,
"localhost", 8080, false,null);
Listener subman = new Listener( notebook, "SubscriptionManger",
12345, "localhost", 8080, false,null);
Listener incoming= new Listener( notebook, "Incoming", pman.inportL,
"localhost", pman.inportS, false,null);
Modified: incubator/hermes/trunk/src/examples/pubsubclient/PubSubWSmanager.java
URL:
http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/examples/pubsubclient/PubSubWSmanager.java?view=diff&r1=158857&r2=158858
==============================================================================
--- incubator/hermes/trunk/src/examples/pubsubclient/PubSubWSmanager.java
(original)
+++ incubator/hermes/trunk/src/examples/pubsubclient/PubSubWSmanager.java Wed
Mar 23 18:09:10 2005
@@ -37,15 +37,15 @@
NotificationProducerFactory nprodF =
NotificationProducerFactory.getInstance();
//TODO
- nprod=
nprodF.createNotificationProducer("http://localhost:"+outport+"/axis/services/NotificationProducer","jndi-config_wsn.xml");
- // nprod=
nprodF.createNotificationProducer("http://localhost:"+outport+"/axis/services/NotificationProducer","jndi-config_wse.xml");
+ //nprod=
nprodF.createNotificationProducer("http://localhost:"+outport+"/axis/services/NotificationProducer","jndi-config_wsn.xml");
+ nprod=
nprodF.createNotificationProducer("http://localhost:"+outport+"/axis/services/NotificationProducer","jndi-config_wse.xml");
topicSpace =
org.apache.ws.notification.topics.util.TopicSpaceParser.parse(Thread.currentThread().getContextClassLoader().getResourceAsStream("topicspace.xml"));
System.out.println("topicSpace : "+topicSpace);
}
- public Subscription subscribe(SubListModel sl, NotListModel nl, String
xpath, Topic t, java.util.Date termtime, boolean subend){
+ public Subscription subscribe(SubscriptionListModel sl,
NotificationListModel nl, String xpath, Topic t, java.util.Calendar termtime,
boolean subend){
try{
TopicFilter tf = null;
XPathFilter xf = null;
@@ -54,10 +54,10 @@
if(t!=null)
tf= new TopicFilter(t);
- NotificationConsumer c = new
GUIConsumer("http://localhost:"+inportL+"/axis/services/NotificationPort",sl);
- SubscriptionEndConsumer ec = new
GUIEndConsumer("http://localhost:"+inportL+"/axis/services/SubscriptionEndPort",nl);
- Calendar termTime= Calendar.getInstance();
- org.apache.ws.pubsub.Subscription s =
nprod.subscribe(c,ec,tf,xf,termTime,true);
+ NotificationConsumer c = new
GUIConsumer("http://localhost:"+inportL+"/axis/services/NotificationPort",nl);
+ SubscriptionEndConsumer ec = new
GUIEndConsumer("http://localhost:"+inportL+"/axis/services/SubscriptionEndPort",sl);
+
+ org.apache.ws.pubsub.Subscription s =
nprod.subscribe(c,ec,tf,xf,termtime,true);
return s;
}catch(Exception e){
e.printStackTrace();
Modified: incubator/hermes/trunk/src/examples/pubsubclient/PublisherPanel.java
URL:
http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/examples/pubsubclient/PublisherPanel.java?view=diff&r1=158857&r2=158858
==============================================================================
--- incubator/hermes/trunk/src/examples/pubsubclient/PublisherPanel.java
(original)
+++ incubator/hermes/trunk/src/examples/pubsubclient/PublisherPanel.java Wed
Mar 23 18:09:10 2005
@@ -1,112 +1,104 @@
-/*
- * Copyright 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.
- */
-import javax.swing.*;
-import java.awt.*;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
+import javax.swing.JTabbedPane;
import javax.swing.tree.*;
-import java.util.Calendar;
-import java.util.Date;
-import java.text.DateFormat;
-
import org.apache.ws.pubsub.*;
import org.apache.ws.notification.topics.Topic;
-public class PublisherPanel extends JPanel{
- public JTabbedPane notebook = null ;
-
- public JButton publishButton= null;
- public JTextArea pubtext=null;
- public JTree tree=null;
-
- public JCheckBox cXfilter=null;
- public JCheckBox cTfilter=null;
- public JCheckBox cSubend=null;
- public JCheckBox cTermtime=null;
-
- private PubSubWSmanager pman;
- private Calendar time;
-
- public PublisherPanel(JTabbedPane _notebook, PubSubWSmanager _pman) {
- try{
- this.pman=_pman;
- notebook = _notebook ;
-
-
- this.setLayout( new BoxLayout(this, BoxLayout.Y_AXIS) );
-
- // 1st component is just a row of labels and 1-line entry fields
-
/////////////////////////////////////////////////////////////////////
- JPanel top = new JPanel();
-
- top.setLayout( new FlowLayout() );
- top.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
-
- JPanel top2 = new JPanel();
- //topictree
- top2.add( cTfilter = new JCheckBox("Topic"));
- DefaultTreeCellRenderer renderer2 = new DefaultTreeCellRenderer();
- renderer2.setOpenIcon(null);
- renderer2.setClosedIcon(null);
- renderer2.setLeafIcon(null);
- tree = new TopicSpaceTree(pman).getTree();
- tree.setCellRenderer(renderer2);
- top2.add(tree);
- this.add(top2 );
-
- JPanel top3 = new JPanel();
- top3.add(pubtext = new JTextArea("<?xml version=\"1.0\"
?>\n<a><b/></a>",10,30) );
- this.add(top3);
-
- JPanel top4 = new JPanel();
-
- //publish button
- top4.add(publishButton = new JButton("Publish"));
- this.add(top4);
-
- publishButton.addActionListener( new ActionListener() {
- public void actionPerformed(ActionEvent event) {
- Topic t=null;
- if(cTfilter.getSelectedObjects()!=null){
- TreePath[] ts
=tree.getSelectionModel().getSelectionPaths();
- if(ts!=null)
- t =
(org.apache.ws.notification.topics.Topic)((DefaultMutableTreeNode)
ts[ts.length-1].getLastPathComponent()).getUserObject();
- }
- pman.publish(pubtext.getText(),t);
- }
- }
- );
-
- notebook.addTab( "Publisher", this );
- // start();
- }catch(Exception e){
- e.printStackTrace();
- }
+/**
+ *
+ * @author Administrator
+ */
+public class PublisherPanel extends javax.swing.JPanel {
+ private PubSubWSmanager pman;
+ /** Creates new form PublisherPanel2 */
+ public PublisherPanel(JTabbedPane notebook, PubSubWSmanager _pman) {
+ this.pman=_pman;
+ initComponents();
+ DefaultTreeCellRenderer renderer2 = new DefaultTreeCellRenderer();
+ renderer2.setOpenIcon(null);
+ renderer2.setClosedIcon(null);
+ renderer2.setLeafIcon(null);
+ tree.setCellRenderer(renderer2);
+ message.setText("<?xml version=\"1.0\" ?>\n<a><b/></a>");
+ notebook.addTab( "Publisher", this );
}
- private void updateTime(){
- time=Calendar.getInstance();
- time.add(Calendar.MINUTE,1);
- }
-}
+ /** This method is called from within the constructor to
+ * initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is
+ * always regenerated by the Form Editor.
+ */
+ private void initComponents() {//GEN-BEGIN:initComponents
+ cTopic = new javax.swing.JCheckBox();
+ jScrollPane1 = new javax.swing.JScrollPane();
+ tree = new TopicSpaceTree(pman).getTree();
+ jScrollPane2 = new javax.swing.JScrollPane();
+ message = new javax.swing.JTextArea();
+ publishButton = new javax.swing.JButton();
+ jLabel1 = new javax.swing.JLabel();
+
+ setLayout(null);
+
+ cTopic.setText("Topic Metainformation");
+ cTopic.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ cTopicActionPerformed(evt);
+ }
+ });
+
+ add(cTopic);
+ cTopic.setBounds(20, 20, 210, 27);
+
+ jScrollPane1.setViewportView(tree);
+
+ add(jScrollPane1);
+ jScrollPane1.setBounds(20, 50, 210, 240);
+
+ jScrollPane2.setViewportView(message);
+
+ add(jScrollPane2);
+ jScrollPane2.setBounds(260, 50, 290, 240);
+ publishButton.setText("Publish");
+ publishButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ publishEvent(evt);
+ }
+ });
+
+ add(publishButton);
+ publishButton.setBounds(20, 300, 530, 27);
+ jLabel1.setText("Message");
+ add(jLabel1);
+ jLabel1.setBounds(260, 20, 130, 30);
+
+ }//GEN-END:initComponents
+
+ private void publishEvent(java.awt.event.ActionEvent evt)
{//GEN-FIRST:event_publishEvent
+ Topic t=null;
+ if(cTopic.getSelectedObjects()!=null){
+ TreePath[] ts =tree.getSelectionModel().getSelectionPaths();
+ if(ts!=null)
+ t =
(org.apache.ws.notification.topics.Topic)((DefaultMutableTreeNode)
ts[ts.length-1].getLastPathComponent()).getUserObject();
+ }
+ pman.publish(message.getText(),t);
+ }//GEN-LAST:event_publishEvent
+ private void cTopicActionPerformed(java.awt.event.ActionEvent evt)
{//GEN-FIRST:event_cTopicActionPerformed
+ // TODO add your handling code here:
+ }//GEN-LAST:event_cTopicActionPerformed
+
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JCheckBox cTopic;
+ private javax.swing.JLabel jLabel1;
+ private javax.swing.JScrollPane jScrollPane1;
+ private javax.swing.JScrollPane jScrollPane2;
+ private javax.swing.JTextArea message;
+ private javax.swing.JButton publishButton;
+ private javax.swing.JTree tree;
+ // End of variables declaration//GEN-END:variables
+
+}
Added:
incubator/hermes/trunk/src/examples/pubsubclient/SubscriptionListModel.java
URL:
http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/examples/pubsubclient/SubscriptionListModel.java?view=auto&rev=158858
==============================================================================
--- incubator/hermes/trunk/src/examples/pubsubclient/SubscriptionListModel.java
(added)
+++ incubator/hermes/trunk/src/examples/pubsubclient/SubscriptionListModel.java
Wed Mar 23 18:09:10 2005
@@ -0,0 +1,37 @@
+import javax.swing.AbstractListModel;
+
+class SubscriptionListModel extends AbstractListModel {
+ private java.util.Vector myData;
+
+ public SubscriptionListModel() {
+ myData=new java.util.Vector();
+ }
+
+ public int getSize() { return myData.size();}
+ public Object getElementAt(int i) { return myData.elementAt(i);}
+
+ public void addData(Object obj) {
+ myData.add(obj); //Add data to the vector.
+ fireContentsChanged(this,0,myData.size()-1); //fire event so that
List updates itself.
+ }
+
+ public void removeData(Object obj) {
+ myData.remove(obj); //Add data to the vector.
+ fireContentsChanged(this,0,myData.size()-1); //fire event so that
List updates itself.
+ }
+ /*
+ public class notentry{
+ public String id;
+ public String content;
+ public notentry(String id, Object message)throws Exception{
+ this.id=id;
+
this.content=((org.apache.axis.message.SOAPEnvelope)message).getBody().toString();
+ }
+
+ public String toString(){
+ return id;//+" "+content;
+ }
+
+ }
+ */
+}
Modified: incubator/hermes/trunk/src/examples/pubsubclient/TopicSpaceTree.java
URL:
http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/examples/pubsubclient/TopicSpaceTree.java?view=diff&r1=158857&r2=158858
==============================================================================
--- incubator/hermes/trunk/src/examples/pubsubclient/TopicSpaceTree.java
(original)
+++ incubator/hermes/trunk/src/examples/pubsubclient/TopicSpaceTree.java Wed
Mar 23 18:09:10 2005
@@ -10,7 +10,7 @@
private JTree tree;
/** Creates a new instance of TopicSpaceTree */
public TopicSpaceTree(PubSubWSmanager pman) {
- DefaultMutableTreeNode root = new DefaultMutableTreeNode();
+ DefaultMutableTreeNode root = new DefaultMutableTreeNode("TopicSpace");
Iterator rootit =pman.topicSpace.topicIterator();
while(rootit.hasNext()){
Modified:
incubator/hermes/trunk/src/examples/pubsubclient/WEB-INF/server-config.wsdd
URL:
http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/examples/pubsubclient/WEB-INF/server-config.wsdd?view=diff&r1=158857&r2=158858
==============================================================================
--- incubator/hermes/trunk/src/examples/pubsubclient/WEB-INF/server-config.wsdd
(original)
+++ incubator/hermes/trunk/src/examples/pubsubclient/WEB-INF/server-config.wsdd
Wed Mar 23 18:09:10 2005
@@ -33,7 +33,7 @@
<service name="SubscriptionEndPort" provider="java:WSRF" style="document"
use="literal">
</service>
- <service name="NotificationPort" provider="java:WSRF" style="document"
use="literal">
+ <service name="NotificationPort" provider="java:WSRFMsg" style="message"
use="literal">
</service>
<transport name="http">
Added:
incubator/hermes/trunk/src/examples/pubsubclient/WEB-INF/server-config_wsn.wsdd
URL:
http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/examples/pubsubclient/WEB-INF/server-config_wsn.wsdd?view=auto&rev=158858
==============================================================================
---
incubator/hermes/trunk/src/examples/pubsubclient/WEB-INF/server-config_wsn.wsdd
(added)
+++
incubator/hermes/trunk/src/examples/pubsubclient/WEB-INF/server-config_wsn.wsdd
Wed Mar 23 18:09:10 2005
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
+ <globalConfiguration>
+ <parameter name="adminPassword" value="admin"/>
+ <parameter name="disablePrettyXML" value="true"/>
+ <parameter name="sendXsiTypes" value="true"/>
+ <parameter name="sendMultiRefs" value="true"/>
+ <parameter name="sendXMLDeclaration" value="true"/>
+ <requestFlow>
+ <handler
type="java:org.apache.axis.message.addressing.handler.AddressingHandler"/>
+ </requestFlow>
+ <responseFlow>
+ <handler
type="java:org.apache.axis.message.addressing.handler.AddressingHandler"/>
+ </responseFlow>
+ </globalConfiguration>
+ <handler name="LocalResponder"
type="java:org.apache.axis.transport.local.LocalResponder"/>
+ <handler name="URLMapper"
type="java:org.apache.axis.handlers.http.URLMapper"/>
+ <handler name="Authenticate"
type="java:org.apache.axis.handlers.SimpleAuthenticationHandler"/>
+
+ <service name="AdminService" provider="java:MSG">
+ <parameter name="allowedMethods" value="AdminService"/>
+ <parameter name="enableRemoteAdmin" value="false"/>
+ <parameter name="className" value="org.apache.axis.utils.Admin"/>
+ <namespace>http://xml.apache.org/axis/wsdd/</namespace>
+ <namespace>http://xml.apache.org/axis/wsdd/</namespace>
+ </service>
+
+ <service name="Version" provider="java:RPC">
+ <parameter name="allowedMethods" value="getVersion"/>
+ <parameter name="className" value="org.apache.axis.Version"/>
+ </service>
+
+ <service name="SubscriptionEndPort" provider="java:WSRF" style="document"
use="literal">
+</service>
+
+ <service name="NotificationPort" provider="java:WSRF" style="document"
use="literal">
+ </service>
+
+ <transport name="http">
+ <requestFlow>
+ <handler type="URLMapper"/>
+ <handler type="java:org.apache.axis.handlers.http.HTTPAuthHandler"/>
+ </requestFlow>
+ <parameter name="qs:list"
value="org.apache.axis.transport.http.QSListHandler"/>
+ <parameter name="qs:wsdl"
value="org.apache.axis.transport.http.QSWSDLHandler"/>
+ <parameter name="qs.list"
value="org.apache.axis.transport.http.QSListHandler"/>
+ <parameter name="qs.method"
value="org.apache.axis.transport.http.QSMethodHandler"/>
+ <parameter name="qs:method"
value="org.apache.axis.transport.http.QSMethodHandler"/>
+ <parameter name="qs.wsdl"
value="org.apache.axis.transport.http.QSWSDLHandler"/>
+ </transport>
+
+ <transport name="local">
+ <responseFlow>
+ <handler type="LocalResponder"/>
+ </responseFlow>
+ </transport>
+
+</deployment>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]