juddi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ks...@apache.org
Subject svn commit: r818682 - in /webservices/juddi/trunk/juddi-console: juddi-portal/pluto/WEB-INF/ uddi-portlets/src/main/java/org/apache/juddi/portlets/ uddi-portlets/src/main/java/org/apache/juddi/portlets/client/ uddi-portlets/src/main/java/org/apache/jud...
Date Fri, 25 Sep 2009 00:46:49 GMT
Author: kstam
Date: Fri Sep 25 00:46:47 2009
New Revision: 818682

URL: http://svn.apache.org/viewvc?rev=818682&view=rev
Log:
JUDDI-204, adding the beginnings of the subscription portlet

Added:
    webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/UDDISubscription.gwt.xml
    webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/SubscriptionListPanel.java
    webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/SubscriptionPanel.java
    webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/UDDISubscription.java
    webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/model/Subscription.java
    webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/service/SubscriptionResponse.java
    webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/service/SubscriptionService.java
    webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/service/SubscriptionServiceAsync.java
    webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/public/UDDISubscription.html
    webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/UDDISubscriptionPortlet.java
    webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/model/
    webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/SubscriptionServiceImpl.java
    webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/resources/META-INF/
    webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/resources/META-INF/uddi.xml
Modified:
    webservices/juddi/trunk/juddi-console/juddi-portal/pluto/WEB-INF/pluto-portal-driver-config.xml
    webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/JUDDIPublisher.java
    webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/MenuBarPanel.java
    webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/FindServiceImpl.java
    webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/InquiryServiceImpl.java
    webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/JUDDIApiServiceImpl.java
    webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/PublicationServiceImpl.java
    webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/SecurityServiceImpl.java
    webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/webapp/WEB-INF/portlet.xml
    webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/webapp/WEB-INF/web.xml

Modified: webservices/juddi/trunk/juddi-console/juddi-portal/pluto/WEB-INF/pluto-portal-driver-config.xml
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-console/juddi-portal/pluto/WEB-INF/pluto-portal-driver-config.xml?rev=818682&r1=818681&r2=818682&view=diff
==============================================================================
--- webservices/juddi/trunk/juddi-console/juddi-portal/pluto/WEB-INF/pluto-portal-driver-config.xml (original)
+++ webservices/juddi/trunk/juddi-console/juddi-portal/pluto/WEB-INF/pluto-portal-driver-config.xml Fri Sep 25 00:46:47 2009
@@ -34,9 +34,8 @@
     <portlet-mode>edit</portlet-mode>
     <portlet-mode>help</portlet-mode>
     <portlet-mode>config</portlet-mode>
-
-    <window-state>normal</window-state>
     <window-state>maximized</window-state>
+    <window-state>normal</window-state>
     <window-state>minimized</window-state>
   </supports>
 

Added: webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/UDDISubscription.gwt.xml
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/UDDISubscription.gwt.xml?rev=818682&view=auto
==============================================================================
--- webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/UDDISubscription.gwt.xml (added)
+++ webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/UDDISubscription.gwt.xml Fri Sep 25 00:46:47 2009
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?><module>
+
+      <!-- Inherit the core Web Toolkit stuff.                        -->
+      <inherits name="com.google.gwt.user.User"/>   	
+    
+      <!-- Specify the app entry point class.                         -->
+      <entry-point class="org.apache.juddi.portlets.client.UDDISubscription"/>
+    
+      <!-- Specify the application specific style sheet.              -->
+      <stylesheet src="uddiportlets.css"/>
+
+	  <servlet class="org.apache.juddi.portlets.server.service.SecurityServiceImpl"     path="/security"/>
+	  <servlet class="org.apache.juddi.portlets.server.service.SubscriptionServiceImpl" path="/subscription"/>
+	 
+</module>
\ No newline at end of file

Modified: webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/JUDDIPublisher.java
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/JUDDIPublisher.java?rev=818682&r1=818681&r2=818682&view=diff
==============================================================================
--- webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/JUDDIPublisher.java (original)
+++ webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/JUDDIPublisher.java Fri Sep 25 00:46:47 2009
@@ -31,7 +31,7 @@
 
 	private static JUDDIPublisher singleton;
 	
-	private MenuBarPanel menuBar = new MenuBarPanel();
+	private MenuBarPanel menuBar = new MenuBarPanel(MenuBarPanel.PUBLISHER);
 	private DockPanel dockPanel = new DockPanel();
 	private LoginPanel loginPanel = new LoginPanel(this);
 	private PublisherListPanel publisherListPanel = new PublisherListPanel();

Modified: webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/MenuBarPanel.java
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/MenuBarPanel.java?rev=818682&r1=818681&r2=818682&view=diff
==============================================================================
--- webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/MenuBarPanel.java (original)
+++ webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/MenuBarPanel.java Fri Sep 25 00:46:47 2009
@@ -9,12 +9,17 @@
 
 public class MenuBarPanel extends FlowPanel implements ClickListener {
 
+	public static final String PUBLISHER = "publisher";
+	public static final String SUBSCRIPTION = "subscription";
 	public static final Images images = (Images) GWT.create(Images.class);
 	PushButton saveButton = new PushButton();
 	PushButton newButton = new PushButton();
 	PushButton deleteButton = new PushButton();
+	String context = PUBLISHER;
 
-	public MenuBarPanel() {
+	public MenuBarPanel(String context) {
+		
+		this.context = context;
 		HorizontalPanel pushPanel = new HorizontalPanel();
 	    pushPanel.setSpacing(7);
 
@@ -39,11 +44,14 @@
 
 	public void onClick(Widget sender) {
 		if (sender == saveButton) {
-			JUDDIPublisher.getInstance().savePublisher();
+			if (PUBLISHER.equals(context)) JUDDIPublisher.getInstance().savePublisher();
+			else if (SUBSCRIPTION.equals(context)) UDDISubscription.getInstance().saveSubscription();
 		} else if (sender == newButton) {
-			JUDDIPublisher.getInstance().newPublisher();
+			if (PUBLISHER.equals(context)) JUDDIPublisher.getInstance().newPublisher();
+			else if (SUBSCRIPTION.equals(context)) UDDISubscription.getInstance().newSubscription();
 		} else if (sender == deleteButton) {
-			JUDDIPublisher.getInstance().deletePublisher();
+			if (PUBLISHER.equals(context)) JUDDIPublisher.getInstance().deletePublisher();
+			else if (SUBSCRIPTION.equals(context)) UDDISubscription.getInstance().deleteSubscription();
 		}
 		
 	}

Added: webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/SubscriptionListPanel.java
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/SubscriptionListPanel.java?rev=818682&view=auto
==============================================================================
--- webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/SubscriptionListPanel.java (added)
+++ webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/SubscriptionListPanel.java Fri Sep 25 00:46:47 2009
@@ -0,0 +1,128 @@
+package org.apache.juddi.portlets.client;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.juddi.portlets.client.model.Subscription;
+import org.apache.juddi.portlets.client.service.SubscriptionResponse;
+import org.apache.juddi.portlets.client.service.SubscriptionService;
+import org.apache.juddi.portlets.client.service.SubscriptionServiceAsync;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.Window;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.FlexTable;
+import com.google.gwt.user.client.ui.SourcesTableEvents;
+import com.google.gwt.user.client.ui.TableListener;
+
+public class SubscriptionListPanel extends Composite implements TableListener {
+
+	private static final int VISIBLE_PUBLISHER_COUNT = 10;
+	private int selectedRow = -1;
+	private String selectedSubscription = "";
+
+	private FlexTable table = new FlexTable();
+	private List<Subscription> subscriptions =  new ArrayList<Subscription>();
+
+	private SubscriptionServiceAsync subscriptionServiceAsync = (SubscriptionServiceAsync) GWT.create(SubscriptionService.class);
+
+	public SubscriptionListPanel() {
+
+		table.setCellSpacing(0);
+		table.setCellPadding(0);
+		table.setWidth("100%");
+
+		initWidget(table);
+		// Hook up events.
+		table.addTableListener(this);
+		initTable();
+		setStyleName("List");
+
+	}
+
+	private void initTable() {
+		// Create the header row.
+		table.setText(0, 0, "Binding Key");
+		table.setText(0, 1, "Subscription Key");
+		table.getRowFormatter().setStyleName(0, "ListHeader");
+
+		// Initialize the rest of the rows.
+		for (int i = 0; i < VISIBLE_PUBLISHER_COUNT; ++i) {
+			table.setText(i + 1, 0, "");
+			table.setText(i + 1, 1, "");
+			table.getCellFormatter().setWordWrap(i + 1, 0, false);
+			table.getCellFormatter().setWordWrap(i + 1, 1, false);
+			table.getFlexCellFormatter().setColSpan(i + 1, 1, 1);
+		}
+		selectRow(0);
+	}
+
+	/**
+	 * Obtains list of Subscriptions
+	 * @param token
+	 */
+	protected List<Subscription> listSubscriptions(String token) {
+		subscriptionServiceAsync.getSubscriptions(token,  new AsyncCallback<SubscriptionResponse>() 
+				{
+			public void onFailure(Throwable caught) {
+				Window.alert("Could not connect to the UDDI registry. " + caught.getMessage());
+			}
+
+			public void onSuccess(SubscriptionResponse response) {
+				if (response.isSuccess()) {
+					subscriptions = response.getSubscriptions();
+					for (int row=1; row<table.getRowCount(); row++) {
+						table.removeRow(row);
+					}
+					for (int i=0; i < subscriptions.size(); i++) {
+						table.setText(i+1, 0, subscriptions.get(i).getBindingKey());
+						table.setText(i+1, 1, subscriptions.get(i).getSubscriptionKey());
+						//if (selectedRow==i+1 || selectedSubscription.equals(subscriptions.get(i).getAuthorizedName())) {
+						//	selectRow(i+1);
+						//}
+					}
+				} else {
+					Window.alert("error: " + response.getMessage() + ". Make sure the UDDI server is up and running.");
+				}
+			}
+				});
+		return subscriptions;
+	}
+
+	public void onCellClicked(SourcesTableEvents sender, int row, int cell) {
+		// Select the row that was clicked (-1 to account for header row).
+		if (row > 0) {
+			selectedSubscription="";
+			selectedRow=row;
+			UDDISubscription.getInstance().displaySubscription(subscriptions.get(row -1));
+		}
+	}
+
+	protected void selectRow(int selectedRow) {
+		for (int row=1; row < table.getRowCount(); row++) {
+			styleRow(row, false);
+		}
+		this.selectedRow=selectedRow;
+		if (selectedRow>0) {
+			styleRow(selectedRow, true);
+		}
+	}
+
+	private void styleRow(int row, boolean selected) {
+		if (row != -1) {
+			if (selected) {
+				table.getRowFormatter().addStyleName(row, "SelectedRow");
+			} else {
+				table.getRowFormatter().removeStyleName(row, "SelectedRow");
+			}
+		}
+	}
+
+	public void setSelectedSubscription(String selectedSubscription) {
+		this.selectedSubscription = selectedSubscription;
+	}
+
+
+
+}

Added: webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/SubscriptionPanel.java
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/SubscriptionPanel.java?rev=818682&view=auto
==============================================================================
--- webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/SubscriptionPanel.java (added)
+++ webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/SubscriptionPanel.java Fri Sep 25 00:46:47 2009
@@ -0,0 +1,168 @@
+package org.apache.juddi.portlets.client;
+
+import org.apache.juddi.portlets.client.model.Subscription;
+import org.apache.juddi.portlets.client.service.SubscriptionResponse;
+import org.apache.juddi.portlets.client.service.SubscriptionService;
+import org.apache.juddi.portlets.client.service.SubscriptionServiceAsync;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.Window;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.google.gwt.user.client.ui.CheckBox;
+import com.google.gwt.user.client.ui.FlexTable;
+import com.google.gwt.user.client.ui.FlowPanel;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.TextBox;
+
+public class SubscriptionPanel extends FlowPanel {
+
+	private SubscriptionServiceAsync subscriptionServiceAsync = (SubscriptionServiceAsync) GWT.create(SubscriptionService.class);
+	
+	private TextBox bindingKeyBox = new TextBox();
+	private CheckBox isBriefBox = new CheckBox();
+	private TextBox expiresAfterBox = new TextBox();
+	private TextBox maxEntitiesBox = new TextBox();
+	private TextBox notificationIntervalBox = new TextBox();
+	private TextBox subscriptionFilterBox = new TextBox();
+	private TextBox subscriptionKeyBox = new TextBox();
+	Subscription subscription = null;
+	
+	public SubscriptionPanel(Subscription subscription) {
+		
+		if (subscription==null) {
+			newSubscription();
+		} else {
+			this.subscription = subscription;
+		}
+		
+		FlexTable flexTable = new FlexTable();
+		add(flexTable);
+
+		Label id = new Label ("Binding Key:");
+		id.setStyleName("portlet-form-field-label");
+		flexTable.setWidget(0, 0, id);
+		bindingKeyBox.setText(this.subscription.getBindingKey());
+		bindingKeyBox.setStyleName("portlet-form-input-field");
+		flexTable.setWidget(0, 1, bindingKeyBox);
+		
+		Label isBrief = new Label ("Is Brief:");
+		isBrief.setStyleName("portlet-form-field-label");
+		flexTable.setWidget(1, 0,isBrief);
+		isBriefBox.setChecked(this.subscription.getBrief());
+		isBriefBox.setStyleName("portlet-form-input-field");
+		flexTable.setWidget(1, 1,isBriefBox);
+		
+		Label expiresAfter = new Label ("Expires After:");
+		expiresAfter.setStyleName("portlet-form-field-label");
+		flexTable.setWidget(2, 0, expiresAfter);
+		expiresAfterBox.setText(this.subscription.getExpiresAfter());
+		expiresAfterBox.setStyleName("portlet-form-input-field");
+		flexTable.setWidget(2, 1,expiresAfterBox);
+		
+		Label maxEntities = new Label ("Max Entities:");
+		maxEntities.setStyleName("portlet-form-field-label");
+		flexTable.setWidget(3, 0, maxEntities);
+		maxEntitiesBox.setText(String.valueOf(this.subscription.getMaxEntities()));
+		maxEntitiesBox.setStyleName("portlet-form-input-field");
+		flexTable.setWidget(3, 1,maxEntitiesBox);
+		
+		Label notificationInterval = new Label ("Notification Interval:");
+		notificationInterval.setStyleName("portlet-form-field-label");
+		flexTable.setWidget(4, 0, notificationInterval);
+		notificationIntervalBox.setText(String.valueOf(this.subscription.getNotificationInterval()));
+		notificationIntervalBox.setStyleName("portlet-form-input-field");
+		flexTable.setWidget(4, 1,notificationIntervalBox);
+		
+		Label subscriptionKey = new Label ("Subscription Key:");
+		subscriptionKey.setStyleName("portlet-form-field-label");
+		flexTable.setWidget(5, 0, subscriptionKey);
+		subscriptionKeyBox.setText(String.valueOf(this.subscription.getSubscriptionKey()));
+		subscriptionKeyBox.setStyleName("portlet-form-input-field");
+		flexTable.setWidget(5, 1,subscriptionKeyBox);
+		
+		Label subscriptionFilter = new Label ("Search Filter:");
+		subscriptionFilter.setStyleName("portlet-form-field-label");
+		flexTable.setWidget(6, 0, subscriptionFilter);
+		subscriptionFilterBox.setText(String.valueOf(this.subscription.getSubscriptionFilter()));
+		subscriptionFilterBox.setStyleName("portlet-form-input-field");
+		subscriptionFilterBox.setHeight("100px");
+		flexTable.setWidget(6, 1,subscriptionFilterBox);
+		
+	}
+	
+//	protected void deleteSubscription(String token){
+//		if (subscription!=null) {
+//			juddiApiService.deletePublisher(token, publisher.getAuthorizedName(), new AsyncCallback<JUDDIApiResponse>() 
+//			{
+//				public void onFailure(Throwable caught) {
+//					Window.alert("Could not connect to the UDDI registry. " + caught.getMessage());
+//				}
+//	
+//				public void onSuccess(JUDDIApiResponse response) {
+//					if (response.isSuccess()) {
+//						JUDDIPublisher.getInstance().hidePublisher();
+//					} else {
+//						Window.alert("error: " + response.getMessage() + ". Make sure the UDDI server is up and running.");
+//					}
+//				}
+//			});
+//		}
+//	}
+//	
+	protected void newSubscription(){
+		subscription = new Subscription();
+		subscription.setBindingKey("uddi:uddi.example.com:subscriptionone");
+		subscription.setBrief(true);
+		subscription.setMaxEntities(1000);
+		subscription.setNotificationInterval("P5D");
+		subscription.setSubscriptionKey("uddi:uddi.listeningforchanges.com:callthiskeytonotify");
+		subscription.setSubscriptionFilter(
+				  "<subscriptionFilter xmlns=\"urn:uddi-org:sub_v3\">"
+			    + "  <find_service xmlns=\"urn:uddi-org:api_v3\" xmlns:xml=\"http://www.w3.org/XML/1998/namespace\">"
+			    + "    <findQualifiers>"
+			    + "      <findQualifier>exactMatch</findQualifier>"
+			    + "    </findQualifiers>"
+			    + "    <name xml:lang=\"en\">Notifier One</name>"
+			    + "    <categoryBag>"
+			    + "      <keyedReference tModelKey=\"uddi:tmodelkey:categories\" keyName=\"category\" keyValue=\"peaches\" />"
+			    + "      <keyedReference tModelKey=\"uddi:tmodelkey:categories\" keyName=\"category\" keyValue=\"plums\" />"
+			    + "      <keyedReferenceGroup tModelKey=\"uddi:tmodelKey:group\">"
+			    + "        <keyedReference tModelKey=\"uddi:tmodelKey:blank\" keyName=\"blank\" keyValue=\"blank\" />"
+			    + "      </keyedReferenceGroup>"
+			    + "    </categoryBag>"
+			    + "    </find_service>"
+			    + "</subscriptionFilter>");
+				
+	}
+	
+	protected void saveSubscription(String token) {
+		if (subscription!=null) {
+			
+			subscription.setBindingKey(bindingKeyBox.getText());
+			subscription.setBrief(isBriefBox.isChecked());
+			subscription.setExpiresAfter(expiresAfterBox.getText());
+			subscription.setMaxEntities("".equals(maxEntitiesBox.getText())?null:Integer.valueOf(maxEntitiesBox.getText()));
+			subscription.setNotificationInterval(notificationIntervalBox.getText());
+			subscription.setSubscriptionFilter(subscriptionFilterBox.getText());
+			subscription.setSubscriptionKey(subscriptionKeyBox.getText());
+			
+			subscriptionServiceAsync.saveSubscription(token, subscription, new AsyncCallback<SubscriptionResponse>()
+			{
+				public void onFailure(Throwable caught) {
+					Window.alert("Could not connect to the UDDI registry. " + caught.getMessage());
+				}
+	
+				public void onSuccess(SubscriptionResponse response) {
+					if (response.isSuccess()) {
+						//Publisher publisher = response.getPublishers().get(0);
+						////JUDDIPublisher.getInstance().setSelectedPublisher(publisher.getAuthorizedName());
+						//JUDDIPublisher.getInstance().displayPublisher(publisher);
+					} else {
+						Window.alert("error: " + response.getMessage() + ". Make sure the UDDI server is up and running.");
+					}
+				}
+			}); 
+		}
+	}
+	
+}

Added: webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/UDDISubscription.java
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/UDDISubscription.java?rev=818682&view=auto
==============================================================================
--- webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/UDDISubscription.java (added)
+++ webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/UDDISubscription.java Fri Sep 25 00:46:47 2009
@@ -0,0 +1,125 @@
+/*
+ * Copyright 2001-2009 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.juddi.portlets.client;
+
+import org.apache.juddi.portlets.client.model.Subscription;
+
+import com.google.gwt.core.client.EntryPoint;
+import com.google.gwt.user.client.ui.DockPanel;
+import com.google.gwt.user.client.ui.RootPanel;
+
+/**
+ * Entry point classes define <code>onModuleLoad()</code>.
+ * 
+ *  @author <a href="mailto:kstam@apache.org">Kurt T Stam</a>
+ */
+public class UDDISubscription implements EntryPoint, Login {
+
+	private static UDDISubscription singleton;
+	
+	private MenuBarPanel menuBar = new MenuBarPanel(MenuBarPanel.SUBSCRIPTION);
+	private DockPanel dockPanel = new DockPanel();
+	private LoginPanel loginPanel = new LoginPanel(this);
+	private SubscriptionListPanel subscriptionListPanel = new SubscriptionListPanel();
+	private SubscriptionPanel subscriptionPanel = null;
+
+	public static UDDISubscription getInstance() {
+		return singleton;
+	}
+	/**
+	 * This is the entry point method.
+	 */
+	public void onModuleLoad() { 
+		singleton = this;
+		
+		dockPanel.setSpacing(8);
+		menuBar.setVisible(false);
+		menuBar.setHeight("20px");
+		dockPanel.add(menuBar,DockPanel.NORTH);
+		
+		loginPanel.setVisible(false);
+		dockPanel.add(loginPanel,DockPanel.WEST);
+		
+		subscriptionListPanel.setVisible(false);
+		dockPanel.add(subscriptionListPanel,DockPanel.CENTER);
+		
+		RootPanel.get("subscription").add(dockPanel);
+	}
+	
+	public void login() {
+		String token = loginPanel.getToken();
+		if (token == null ) {
+			loginPanel.setVisible(true);
+			subscriptionListPanel.setVisible(false);
+			menuBar.setVisible(false);
+		} else {
+			loginPanel.setVisible(false);
+			menuBar.setVisible(true);
+			subscriptionListPanel.setVisible(true);
+			subscriptionListPanel.listSubscriptions(token);
+		}
+	}
+	
+	public void displaySubscription(Subscription subscription) {
+		if (subscriptionPanel!=null ) dockPanel.remove(subscriptionPanel);
+		subscriptionPanel = new SubscriptionPanel(subscription);
+		dockPanel.add(subscriptionPanel,DockPanel.EAST);
+		String token = loginPanel.getToken();
+		subscriptionListPanel.listSubscriptions(token);
+	}
+	
+	public void setSelectedSubscription(String selectedSubscriptionId) {
+		subscriptionListPanel.setSelectedSubscription(selectedSubscriptionId);
+	}
+	
+	public void hideSubscription() {
+		subscriptionPanel.setVisible(false);
+		String token = loginPanel.getToken();
+		subscriptionListPanel.selectRow(0);
+		if (subscriptionPanel!=null ) dockPanel.remove(subscriptionPanel);
+		subscriptionPanel=null;
+		subscriptionListPanel.listSubscriptions(token);
+	}
+
+	public String getToken() {
+		return loginPanel.getToken();
+	}
+	
+	public void saveSubscription() {
+		if (subscriptionPanel!=null) {
+			subscriptionPanel.saveSubscription(getToken());
+		}
+	}
+	
+	public void newSubscription() {
+		if (subscriptionPanel!=null ) dockPanel.remove(subscriptionPanel);
+		subscriptionPanel = new SubscriptionPanel(null);
+		dockPanel.add(subscriptionPanel,DockPanel.EAST);
+		subscriptionListPanel.selectRow(0);
+	}
+	
+	public void deleteSubscription() {
+		if (subscriptionPanel!=null) {
+	//		subscriptionPanel.deleteSubscription(getToken());
+		}
+	}
+
+
+	
+	
+	
+}

Added: webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/model/Subscription.java
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/model/Subscription.java?rev=818682&view=auto
==============================================================================
--- webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/model/Subscription.java (added)
+++ webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/model/Subscription.java Fri Sep 25 00:46:47 2009
@@ -0,0 +1,117 @@
+/*
+ * Copyright 2001-2008 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.juddi.portlets.client.model;
+
+import java.io.Serializable;
+
+
+/**
+ * <p>Java class for Subscription type.
+ * 
+ * @author <a href="mailto:kstam@apache.org">Kurt T Stam</a> 
+ * 
+ */
+public class Subscription implements Serializable{
+
+	private static final long serialVersionUID = 1L;
+	protected String bindingKey;
+    protected Boolean brief;
+    protected String expiresAfter;
+    protected Integer maxEntities;
+	protected String notificationInterval;
+    protected String subscriptionFilter;
+    protected String subscriptionKey;
+    
+    public Subscription() {
+		super();
+    }
+    public Subscription(String bindingKey, Boolean brief, String expiresAfter,
+			Integer maxEntities, String notificationInterval, String subscriptionFilter, String subscriptionKey) {
+		super();
+		this.bindingKey = bindingKey;
+		this.brief = brief;
+		this.expiresAfter = expiresAfter;
+		this.maxEntities = maxEntities;
+		this.notificationInterval = notificationInterval;
+		this.subscriptionFilter = subscriptionFilter;
+		this.subscriptionKey = subscriptionKey;
+	}
+    
+	public String getBindingKey() {
+		return bindingKey;
+	}
+
+	public void setBindingKey(String bindingKey) {
+		this.bindingKey = bindingKey;
+	}
+
+	public Boolean getBrief() {
+		return brief;
+	}
+
+	public void setBrief(Boolean brief) {
+		this.brief = brief;
+	}
+
+	public Integer getMaxEntities() {
+		return maxEntities;
+	}
+
+	public void setMaxEntities(Integer maxEntities) {
+		this.maxEntities = maxEntities;
+	}
+
+	public String getSubscriptionKey() {
+		return subscriptionKey;
+	}
+
+	public void setSubscriptionKey(String subscriptionKey) {
+		this.subscriptionKey = subscriptionKey;
+	}
+
+	public static long getSerialVersionUID() {
+		return serialVersionUID;
+	}
+
+	public String getExpiresAfter() {
+		return expiresAfter;
+	}
+
+	public void setExpiresAfter(String expiresAfter) {
+		this.expiresAfter = expiresAfter;
+	}
+
+	public String getNotificationInterval() {
+		return notificationInterval;
+	}
+
+	public void setNotificationInterval(String notificationInterval) {
+		this.notificationInterval = notificationInterval;
+	}
+
+	public String getSubscriptionFilter() {
+		return subscriptionFilter;
+	}
+
+	public void setSubscriptionFilter(String subscriptionFilter) {
+		this.subscriptionFilter = subscriptionFilter;
+	}
+	
+}
+
\ No newline at end of file

Added: webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/service/SubscriptionResponse.java
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/service/SubscriptionResponse.java?rev=818682&view=auto
==============================================================================
--- webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/service/SubscriptionResponse.java (added)
+++ webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/service/SubscriptionResponse.java Fri Sep 25 00:46:47 2009
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2001-2009 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.juddi.portlets.client.service;
+
+import java.util.List;
+
+import org.apache.juddi.portlets.client.model.Subscription;
+
+/**
+ * 
+ *  @author <a href="mailto:kstam@apache.org">Kurt T Stam</a>
+ *
+ */
+public class SubscriptionResponse extends Response {
+	
+	private static final long serialVersionUID = 1L;
+	List<Subscription> subscriptions;
+	
+	public List<Subscription> getSubscriptions() {
+		return subscriptions;
+	}
+	public void setSubscriptions(List<Subscription> subscriptions) {
+		this.subscriptions = subscriptions;
+	}
+
+}

Added: webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/service/SubscriptionService.java
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/service/SubscriptionService.java?rev=818682&view=auto
==============================================================================
--- webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/service/SubscriptionService.java (added)
+++ webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/service/SubscriptionService.java Fri Sep 25 00:46:47 2009
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2001-2009 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.juddi.portlets.client.service;
+
+import org.apache.juddi.portlets.client.model.Subscription;
+
+import com.google.gwt.user.client.rpc.RemoteService;
+import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
+/**
+ * 
+ * @author <a href="mailto:kstam@apache.org">Kurt T Stam</a>
+ *
+ */
+@RemoteServiceRelativePath("subscription")
+public interface SubscriptionService extends RemoteService {
+	
+	public SubscriptionResponse getSubscriptions(String authToken);
+	public SubscriptionResponse saveSubscription(String authToken, Subscription subscription);
+}

Added: webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/service/SubscriptionServiceAsync.java
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/service/SubscriptionServiceAsync.java?rev=818682&view=auto
==============================================================================
--- webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/service/SubscriptionServiceAsync.java (added)
+++ webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/client/service/SubscriptionServiceAsync.java Fri Sep 25 00:46:47 2009
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2001-2009 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.juddi.portlets.client.service;
+
+import org.apache.juddi.portlets.client.model.Subscription;
+
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.google.gwt.user.client.rpc.RemoteService;
+/**
+ * 
+ *  @author <a href="mailto:kstam@apache.org">Kurt T Stam</a>
+ *
+ */
+public interface SubscriptionServiceAsync extends RemoteService {
+	public void getSubscriptions(String authToken, AsyncCallback<SubscriptionResponse> callback);
+	public void saveSubscription(String authToken, Subscription subscription, AsyncCallback<SubscriptionResponse> callback);
+}
+

Added: webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/public/UDDISubscription.html
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/public/UDDISubscription.html?rev=818682&view=auto
==============================================================================
--- webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/public/UDDISubscription.html (added)
+++ webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/public/UDDISubscription.html Fri Sep 25 00:46:47 2009
@@ -0,0 +1,34 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!-- /*
+ * Copyright 2001-2009 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.
+ *
+ */ -->
+
+<html>
+  <head>
+    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+    <title>UDDI Subscriptions</title>
+    <!--                                           -->
+    <!-- This script loads your compiled module.   -->
+    <!-- If you add any GWT meta tags, they must   -->
+    <!-- be added before this line.                -->
+    <!--                                           -->
+    <script type="text/javascript" language="javascript" src="org.apache.juddi.portlets.UDDISubscription.nocache.js"></script>
+  </head>
+  <body>
+    <div id="token"></div>
+    <div id="subscription"></div>
+  </body>
+</html>

Added: webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/UDDISubscriptionPortlet.java
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/UDDISubscriptionPortlet.java?rev=818682&view=auto
==============================================================================
--- webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/UDDISubscriptionPortlet.java (added)
+++ webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/UDDISubscriptionPortlet.java Fri Sep 25 00:46:47 2009
@@ -0,0 +1,48 @@
+package org.apache.juddi.portlets.server;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.GenericPortlet;
+import javax.portlet.PortletException;
+import javax.portlet.PortletSecurityException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.WindowState;
+
+public class UDDISubscriptionPortlet extends GenericPortlet 
+{
+	protected void doView(RenderRequest renderRequest, RenderResponse renderResponse) 
+		throws PortletException, PortletSecurityException, IOException
+	{
+	  renderResponse.setContentType("text/html");
+	  PrintWriter writer = renderResponse.getWriter();
+	  writer.println("<script type='text/javascript' language='javascript' src='" 
+			  + renderRequest.getContextPath() 
+			  + "/org.apache.juddi.portlets.UDDISubscription/org.apache.juddi.portlets.UDDISubscription.nocache.js'></script>");
+	  writer.println("<div id=\"token\"></div>");
+	  writer.println("<div id=\"subscription\"></div>");
+	  writer.close();
+	}
+
+	protected void doHelp(RenderRequest renderRequest, RenderResponse renderResponse) 
+		throws PortletException, PortletSecurityException, IOException
+	{
+	  renderResponse.setContentType("text/html");
+	  PrintWriter writer = renderResponse.getWriter();
+	  writer.write("Help");
+	  writer.close();
+	}
+	
+	@Override
+	public void processAction(ActionRequest request, ActionResponse response)
+			throws PortletException, IOException {
+		response.setWindowState(WindowState.MAXIMIZED);
+		System.out.println("ProcessAction");
+		super.processAction(request, response);
+	}
+	
+	
+}

Modified: webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/FindServiceImpl.java
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/FindServiceImpl.java?rev=818682&r1=818681&r2=818682&view=diff
==============================================================================
--- webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/FindServiceImpl.java (original)
+++ webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/FindServiceImpl.java Fri Sep 25 00:46:47 2009
@@ -26,7 +26,6 @@
 import org.apache.juddi.portlets.client.service.FindResponse;
 import org.apache.juddi.portlets.client.service.FindService;
 import org.apache.juddi.v3.client.config.ClientConfig;
-import org.apache.juddi.v3.client.config.Property;
 import org.apache.juddi.v3.client.i18n.EntityForLang;
 import org.apache.juddi.v3.client.transport.Transport;
 import org.apache.log4j.Logger;
@@ -71,7 +70,7 @@
 			logger.debug("FindBusiness " + findBusiness + " sending findBusinesses request..");
 			List<Business> businesses = new ArrayList<Business>();
 		
-	    	 String clazz = ClientConfig.getConfiguration().getString(Property.UDDI_PROXY_TRANSPORT,Property.DEFAULT_UDDI_PROXY_TRANSPORT);
+	    	 String clazz = ClientConfig.getInstance().getNodes().get("default").getProxyTransport();
 	         Class<?> transportClass = Loader.loadClass(clazz);
         	 Transport transport = (Transport) transportClass.newInstance(); 
         	 UDDIInquiryPortType inquiryService = transport.getUDDIInquiryService();

Modified: webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/InquiryServiceImpl.java
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/InquiryServiceImpl.java?rev=818682&r1=818681&r2=818682&view=diff
==============================================================================
--- webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/InquiryServiceImpl.java (original)
+++ webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/InquiryServiceImpl.java Fri Sep 25 00:46:47 2009
@@ -28,7 +28,6 @@
 import org.apache.juddi.portlets.client.service.InquiryResponse;
 import org.apache.juddi.portlets.client.service.InquiryService;
 import org.apache.juddi.v3.client.config.ClientConfig;
-import org.apache.juddi.v3.client.config.Property;
 import org.apache.juddi.v3.client.i18n.EntityForLang;
 import org.apache.juddi.v3.client.transport.Transport;
 import org.apache.log4j.Logger;
@@ -65,7 +64,7 @@
 	private Transport getTransport() 
 		throws ConfigurationException, ClassNotFoundException, InstantiationException, IllegalAccessException {
 		if (transport==null) {
-			String clazz = ClientConfig.getConfiguration().getString(Property.UDDI_PROXY_TRANSPORT,Property.DEFAULT_UDDI_PROXY_TRANSPORT);
+			String clazz = ClientConfig.getInstance().getNodes().get("default").getProxyTransport();
 	        Class<?> transportClass = Loader.loadClass(clazz);
 	   	 	transport = (Transport) transportClass.newInstance(); 
 		}

Modified: webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/JUDDIApiServiceImpl.java
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/JUDDIApiServiceImpl.java?rev=818682&r1=818681&r2=818682&view=diff
==============================================================================
--- webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/JUDDIApiServiceImpl.java (original)
+++ webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/JUDDIApiServiceImpl.java Fri Sep 25 00:46:47 2009
@@ -29,7 +29,6 @@
 import org.apache.juddi.portlets.client.service.JUDDIApiResponse;
 import org.apache.juddi.portlets.client.service.JUDDIApiService;
 import org.apache.juddi.v3.client.config.ClientConfig;
-import org.apache.juddi.v3.client.config.Property;
 import org.apache.juddi.v3.client.transport.Transport;
 import org.apache.juddi.v3_service.JUDDIApiPortType;
 import org.apache.log4j.Logger;
@@ -56,7 +55,7 @@
 		JUDDIApiResponse response = new JUDDIApiResponse();
 		List<Publisher> publishers = new ArrayList<Publisher>();
 		try {
-	    	 String clazz = ClientConfig.getConfiguration().getString(Property.UDDI_PROXY_TRANSPORT,Property.DEFAULT_UDDI_PROXY_TRANSPORT);
+	    	 String clazz = ClientConfig.getInstance().getNodes().get("default").getProxyTransport();
 	         Class<?> transportClass = Loader.loadClass(clazz);
         	 Transport transport = (Transport) transportClass.newInstance(); 
         	 JUDDIApiPortType apiService = transport.getJUDDIApiService();
@@ -93,7 +92,7 @@
 	public JUDDIApiResponse savePublisher(String token, Publisher publisher) {
 		JUDDIApiResponse response = new JUDDIApiResponse();
 		try {
-	    	 String clazz = ClientConfig.getConfiguration().getString(Property.UDDI_PROXY_TRANSPORT,Property.DEFAULT_UDDI_PROXY_TRANSPORT);
+	    	 String clazz = ClientConfig.getInstance().getNodes().get("default").getProxyTransport();
 	         Class<?> transportClass = Loader.loadClass(clazz);
 	       	 Transport transport = (Transport) transportClass.newInstance(); 
 	       	 JUDDIApiPortType apiService = transport.getJUDDIApiService();
@@ -128,7 +127,7 @@
 	public JUDDIApiResponse deletePublisher(String token, String publisherId) {
 		JUDDIApiResponse response = new JUDDIApiResponse();
 		try {
-	    	 String clazz = ClientConfig.getConfiguration().getString(Property.UDDI_PROXY_TRANSPORT,Property.DEFAULT_UDDI_PROXY_TRANSPORT);
+	    	 String clazz = ClientConfig.getInstance().getNodes().get("default").getProxyTransport();
 	         Class<?> transportClass = Loader.loadClass(clazz);
 	       	 Transport transport = (Transport) transportClass.newInstance(); 
 	       	 JUDDIApiPortType apiService = transport.getJUDDIApiService();

Modified: webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/PublicationServiceImpl.java
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/PublicationServiceImpl.java?rev=818682&r1=818681&r2=818682&view=diff
==============================================================================
--- webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/PublicationServiceImpl.java (original)
+++ webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/PublicationServiceImpl.java Fri Sep 25 00:46:47 2009
@@ -26,7 +26,6 @@
 import org.apache.juddi.portlets.client.service.PublicationResponse;
 import org.apache.juddi.portlets.client.service.PublicationService;
 import org.apache.juddi.v3.client.config.ClientConfig;
-import org.apache.juddi.v3.client.config.Property;
 import org.apache.juddi.v3.client.i18n.EntityForLang;
 import org.apache.juddi.v3.client.transport.Transport;
 import org.apache.log4j.Logger;
@@ -62,7 +61,7 @@
 		logger.debug("GetRegistrationInfo " + getRegistrationInfo + " sending get Busineses request..");
 		List<Business> businesses = new ArrayList<Business>();
 		try {
-	    	 String clazz = ClientConfig.getConfiguration().getString(Property.UDDI_PROXY_TRANSPORT,Property.DEFAULT_UDDI_PROXY_TRANSPORT);
+	    	 String clazz = ClientConfig.getInstance().getNodes().get("default").getProxyTransport();
 	         Class<?> transportClass = Loader.loadClass(clazz);
         	 Transport transport = (Transport) transportClass.newInstance(); 
         	 UDDIPublicationPortType publicationService = transport.getUDDIPublishService();

Modified: webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/SecurityServiceImpl.java
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/SecurityServiceImpl.java?rev=818682&r1=818681&r2=818682&view=diff
==============================================================================
--- webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/SecurityServiceImpl.java (original)
+++ webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/SecurityServiceImpl.java Fri Sep 25 00:46:47 2009
@@ -24,7 +24,6 @@
 import org.apache.juddi.portlets.client.service.SecurityResponse;
 import org.apache.juddi.portlets.client.service.SecurityService;
 import org.apache.juddi.v3.client.config.ClientConfig;
-import org.apache.juddi.v3.client.config.Property;
 import org.apache.juddi.v3.client.transport.Transport;
 import org.apache.log4j.Logger;
 import org.apache.log4j.helpers.Loader;
@@ -66,9 +65,7 @@
 				return response;
 			} else {
 				try {
-					String clazz = ClientConfig.getConfiguration().getString(
-							Property.UDDI_PROXY_TRANSPORT,
-							Property.DEFAULT_UDDI_PROXY_TRANSPORT);
+					String clazz = ClientConfig.getInstance().getNodes().get("default").getProxyTransport();
 					Class<?> transportClass = Loader.loadClass(clazz);
 					Transport transport = (Transport) transportClass.newInstance();
 					UDDISecurityPortType securityService = transport.getUDDISecurityService();

Added: webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/SubscriptionServiceImpl.java
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/SubscriptionServiceImpl.java?rev=818682&view=auto
==============================================================================
--- webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/SubscriptionServiceImpl.java (added)
+++ webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/java/org/apache/juddi/portlets/server/service/SubscriptionServiceImpl.java Fri Sep 25 00:46:47 2009
@@ -0,0 +1,138 @@
+/*
+ * Copyright 2001-2009 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.juddi.portlets.server.service;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.datatype.DatatypeFactory;
+import javax.xml.datatype.Duration;
+import javax.xml.datatype.XMLGregorianCalendar;
+import javax.xml.ws.Holder;
+
+import org.apache.juddi.jaxb.JAXBMarshaller;
+import org.apache.juddi.portlets.client.model.Subscription;
+import org.apache.juddi.portlets.client.service.SubscriptionResponse;
+import org.apache.juddi.portlets.client.service.SubscriptionService;
+import org.apache.juddi.v3.client.config.ClientConfig;
+import org.apache.juddi.v3.client.transport.Transport;
+import org.apache.log4j.Logger;
+import org.apache.log4j.helpers.Loader;
+import org.uddi.sub_v3.ObjectFactory;
+import org.uddi.sub_v3.SubscriptionFilter;
+import org.uddi.v3_service.UDDISubscriptionPortType;
+
+import com.google.gwt.user.server.rpc.RemoteServiceServlet;
+/**
+ * 
+ * @author <a href="mailto:kstam@apache.org">Kurt T Stam</a>
+ *
+ */
+public class SubscriptionServiceImpl extends RemoteServiceServlet implements SubscriptionService {
+
+	private Logger logger = Logger.getLogger(this.getClass());
+	private static final long serialVersionUID = 1L;
+	
+	public SubscriptionResponse getSubscriptions(String authToken) 
+	{
+		SubscriptionResponse response = new SubscriptionResponse();
+		logger.debug("Sending getSubscriptions request..");
+		List<Subscription> modelSubscriptions = new ArrayList<Subscription>();
+		try {
+	    	 String clazz = ClientConfig.getInstance().getNodes().get("default").getProxyTransport();
+	         Class<?> transportClass = Loader.loadClass(clazz);
+        	 Transport transport = (Transport) transportClass.newInstance(); 
+        	 UDDISubscriptionPortType subscriptionService = transport.getUDDISubscriptionService();
+        	 List<org.uddi.sub_v3.Subscription> subscriptions = subscriptionService.getSubscriptions(authToken);
+        	 for (org.uddi.sub_v3.Subscription subscription : subscriptions) {
+        		 String expiresAfter = null;
+        		 if (subscription.getExpiresAfter()!=null) expiresAfter = subscription.getExpiresAfter().toString();
+        		 String rawFilter = JAXBMarshaller.marshallToString(new ObjectFactory().createSubscriptionFilter(subscription.getSubscriptionFilter()), "org.uddi.sub_v3");
+        		 Subscription modelSubscription = new Subscription(
+        				 subscription.getBindingKey(),
+        				 subscription.isBrief(),
+        				 expiresAfter,
+        				 subscription.getMaxEntities(),
+        				 subscription.getNotificationInterval().toString(),
+        				 rawFilter,
+        				 subscription.getSubscriptionKey());
+        		 modelSubscriptions.add(modelSubscription);
+			 }
+        	 response.setSuccess(true);
+        	 response.setSubscriptions(modelSubscriptions);
+	     } catch (Exception e) {
+	    	 logger.error("Could not obtain subscription. " + e.getMessage(), e);
+	    	 response.setSuccess(false);
+	    	 response.setMessage(e.getMessage());
+	    	 response.setErrorCode("102");
+	     } catch (Throwable t) {
+	    	 logger.error("Could not obtain token subscription. " + t.getMessage(), t);
+	    	 response.setSuccess(false);
+	    	 response.setMessage(t.getMessage());
+	    	 response.setErrorCode("102");
+	     } 
+		 return response;
+	}
+	
+	public SubscriptionResponse saveSubscription(String authToken, Subscription modelSubscription) {
+		SubscriptionResponse response = new SubscriptionResponse();
+		logger.debug("Sending saveSubscriptions request..");
+		try {
+	    	 String clazz = ClientConfig.getInstance().getNodes().get("default").getProxyTransport();
+	         Class<?> transportClass = Loader.loadClass(clazz);
+	       	 Transport transport = (Transport) transportClass.newInstance(); 
+	       	 UDDISubscriptionPortType subscriptionService = transport.getUDDISubscriptionService();
+	       	 List<org.uddi.sub_v3.Subscription> subscriptionList = new ArrayList<org.uddi.sub_v3.Subscription>();
+	       	 org.uddi.sub_v3.Subscription subscription = new org.uddi.sub_v3.Subscription();
+	       	 subscription.setBindingKey(modelSubscription.getBindingKey());
+	       	 subscription.setBrief(modelSubscription.getBrief());
+	       	 if (!"".equals(modelSubscription.getExpiresAfter())) {
+	       		 XMLGregorianCalendar calendar = DatatypeFactory.newInstance().newXMLGregorianCalendar(modelSubscription.getExpiresAfter());
+	       		 subscription.setExpiresAfter(calendar);
+	       	 }
+	       	 subscription.setMaxEntities(modelSubscription.getMaxEntities());
+	       	 if (!"".equals(modelSubscription.getNotificationInterval())) {
+		       	 Duration duration = DatatypeFactory.newInstance().newDuration(modelSubscription.getNotificationInterval());
+		       	 subscription.setNotificationInterval(duration);
+	       	 }
+	       	 if (!"".equals(modelSubscription.getSubscriptionFilter())) {
+		       	 SubscriptionFilter subscriptionFilter = (SubscriptionFilter)JAXBMarshaller.unmarshallFromString(modelSubscription.getSubscriptionFilter(), JAXBMarshaller.PACKAGE_SUBSCRIPTION);
+		       	 subscription.setSubscriptionFilter(subscriptionFilter);
+	       	 }
+	       	 subscription.setSubscriptionKey(modelSubscription.getSubscriptionKey());
+			 subscriptionList.add(subscription);
+			 Holder<List<org.uddi.sub_v3.Subscription>> subscriptionHolder = new Holder<List<org.uddi.sub_v3.Subscription>>();
+			 subscriptionHolder.value = subscriptionList;
+	       	 subscriptionService.saveSubscription(authToken, subscriptionHolder);
+	       	 response.setSuccess(true);
+	       	 //TODO, do we get a response? response.setSubscriptions(modelSubscriptions);
+	     } catch (Exception e) {
+	    	 logger.error("Could not obtain subscription. " + e.getMessage(), e);
+	    	 response.setSuccess(false);
+	    	 response.setMessage(e.getMessage());
+	    	 response.setErrorCode("102");
+	     } catch (Throwable t) {
+	    	 logger.error("Could not obtain token subscription. " + t.getMessage(), t);
+	    	 response.setSuccess(false);
+	    	 response.setMessage(t.getMessage());
+	    	 response.setErrorCode("102");
+	     } 
+		
+		return response;
+	}
+
+}

Added: webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/resources/META-INF/uddi.xml
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/resources/META-INF/uddi.xml?rev=818682&view=auto
==============================================================================
--- webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/resources/META-INF/uddi.xml (added)
+++ webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/resources/META-INF/uddi.xml Fri Sep 25 00:46:47 2009
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+
+<uddi>
+    <reloadDelay>5001</reloadDelay>
+	<nodes>
+		<node>
+			<name>default</name>
+			<description>Main jUDDI node</description>
+			<!-- JAX-WS Transport -->
+			<proxyTransport>org.apache.juddi.v3.client.transport.JAXWSTransport</proxyTransport>
+			<custodyTransferUrl>http://localhost:8080/juddiv3/services/custody-transfer?wsdl</custodyTransferUrl>
+			<inquiryUrl>http://localhost:8080/juddiv3/services/inquiry?wsdl</inquiryUrl>
+	        <publishUrl>http://localhost:8080/juddiv3/services/publish?wsdl</publishUrl>
+	        <securityUrl>http://localhost:8080/juddiv3/services/security?wsdl</securityUrl>
+			<subscriptionUrl>http://localhost:8080/juddiv3/services/subscription?wsdl</subscriptionUrl>
+			<subscriptionListenerUrl>http://localhost:8080/juddiv3/services/subscription-listener?wsdl</subscriptionListenerUrl>
+			<juddiApiUrl>http://localhost:8080/juddiv3/services/juddi-api?wsdl</juddiApiUrl>
+			<!-- In VM Transport Settings 
+			<proxyTransport>org.apache.juddi.v3.client.transport.InVMTransport</proxyTransport>
+			<custodyTransferUrl>org.apache.juddi.api.impl.UDDICustodyTransferImpl</custodyTransferUrl>
+			<inquiryUrl>org.apache.juddi.api.impl.UDDIInquiryImpl</inquiryUrl>
+	        <publishUrl>org.apache.juddi.api.impl.UDDIPublicationImpl</publishUrl>
+	        <securityUrl>org.apache.juddi.api.impl.UDDISecurityImpl</securityUrl>
+			<subscriptionUrl>org.apache.juddi.api.impl.UDDISubscriptionImpl</subscriptionUrl>
+			<subscriptionListenerUrl>org.apache.juddi.api.impl.UDDISubscriptionListenerImpl</subscriptionListenerUrl>
+			<juddiApiUrl>org.apache.juddi.api.impl.JUDDIApiImpl</juddiApiUrl>
+			-->
+			<!-- RMI Transport Settings 
+			<proxyTransport>org.apache.juddi.v3.client.transport.RMITransport</proxyTransport>
+			<custodyTransferUrl>/juddiv3/UDDICustodyTransferService</custodyTransferUrl>
+			<inquiryUrl>/juddiv3/UDDIInquiryService</inquiryUrl>
+	        <publishUrl>/juddiv3/UDDIPublicationService</publishUrl>
+	        <securityUrl>/juddiv3/UDDISecurityService</securityUrl>
+			<subscriptionUrl>/juddiv3/UDDISubscriptionService</subscriptionUrl>
+			<subscriptionListenerUrl>/juddiv3/UDDISubscriptionListenerService</subscriptionListenerUrl>
+			<juddiApiUrl>/juddiv3/JUDDIApiService</juddiApiUrl>
+			<javaNamingFactoryInitial>org.jnp.interfaces.NamingContextFactory</javaNamingFactoryInitial>
+			<javaNamingFactoryUrlPkgs>org.jboss.naming</javaNamingFactoryUrlPkgs>
+			<javaNamingProviderUrl>jnp://localhost:1099</javaNamingProviderUrl>
+			-->
+		</node>
+		<node>
+			<name>node2</name>
+			<description>jUDDI node in other Department</description>
+			<proxyTransport>org.apache.juddi.v3.client.transport.JAXWSTransport</proxyTransport>
+			<custodyTransferUrl>http://med:8080/juddiv3/services/custody-transfer?wsdl</custodyTransferUrl>
+			<inquiryUrl>http://med:8080/juddiv3/services/inquiry?wsdl</inquiryUrl>
+	        <publishUrl>http://med:8080/juddiv3/services/publish?wsdl</publishUrl>
+	        <securityUrl>http://med:8080/juddiv3/services/security?wsdl</securityUrl>
+			<subscriptionUrl>http://med:8080/juddiv3/services/subscription?wsdl</subscriptionUrl>
+			<subscriptionListenerUrl>http://localhost:8080/juddiv3/services/subscription-listener?wsdl</subscriptionListenerUrl>
+			<juddiApiUrl>http://med:8080/juddiv3/services/juddi-api?wsdl</juddiApiUrl>
+		</node>
+	</nodes>
+	
+	
+</uddi>
\ No newline at end of file

Modified: webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/webapp/WEB-INF/portlet.xml
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/webapp/WEB-INF/portlet.xml?rev=818682&r1=818681&r2=818682&view=diff
==============================================================================
--- webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/webapp/WEB-INF/portlet.xml (original)
+++ webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/webapp/WEB-INF/portlet.xml Fri Sep 25 00:46:47 2009
@@ -30,9 +30,22 @@
 			<title>UDDISearch Portlet</title>
 	    </portlet-info>
 	</portlet>
+	<portlet>
+    	<description>UDDI Subscription as a portlet app</description>
+		<portlet-name>UDDISubscriptionPortlet</portlet-name>
+	    <display-name>UDDISubscriptionPortlet</display-name>
+		<portlet-class>org.apache.juddi.portlets.server.UDDISubscriptionPortlet</portlet-class>
+		<supports>
+			<mime-type>text/html</mime-type>
+            <portlet-mode>VIEW</portlet-mode>
+		</supports>
+	    <portlet-info>
+			<title>UDDISubscription Portlet</title>
+	    </portlet-info>
+	</portlet>
 
     <portlet>
-    <description>UDDI Subscription Notification as a portlet app</description>
+           <description>UDDI Subscription Notification as a portlet app</description>
            <portlet-name>UDDISubscriptionNotificationPortlet</portlet-name>
            <display-name>UDDISubscriptionNotification Portlet</display-name>
            <portlet-class>org.apache.juddi.portlets.server.UDDISubscriptionNotificationPortlet</portlet-class>

Modified: webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/webapp/WEB-INF/web.xml?rev=818682&r1=818681&r2=818682&view=diff
==============================================================================
--- webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/webapp/WEB-INF/web.xml (original)
+++ webservices/juddi/trunk/juddi-console/uddi-portlets/src/main/webapp/WEB-INF/web.xml Fri Sep 25 00:46:47 2009
@@ -10,6 +10,12 @@
 	</welcome-file-list>
 	
 	<servlet>
+		<servlet-name>UDDIClientServlet</servlet-name>
+		<servlet-class>org.apache.juddi.v3.client.UDDIClientServlet</servlet-class>
+		<load-on-startup>1</load-on-startup>
+	</servlet>
+	
+	<servlet>
 		<servlet-name>UDDIBrowserPortlet</servlet-name>
 		<servlet-class>org.apache.pluto.core.PortletServlet</servlet-class>
 		<init-param>
@@ -27,6 +33,16 @@
 		</init-param>
 		<load-on-startup>1</load-on-startup>
 	</servlet>
+	
+	<servlet>
+		<servlet-name>UDDISubscriptionPortlet</servlet-name>
+		<servlet-class>org.apache.pluto.core.PortletServlet</servlet-class>
+		<init-param>
+			<param-name>portlet-name</param-name>
+			<param-value>UDDISubscriptionPortlet</param-value>
+		</init-param>
+		<load-on-startup>1</load-on-startup>
+	</servlet>
 
 	<servlet>
 		<servlet-name>UDDISubscriptionNotificationPortlet</servlet-name>
@@ -49,6 +65,12 @@
 	</servlet>
 	
 	<servlet-mapping>
+		<servlet-name>UDDISubscriptionPortlet</servlet-name>
+		<url-pattern>/PlutoInvoker/UDDISubscriptionPortlet
+		</url-pattern>
+	</servlet-mapping>
+	
+	<servlet-mapping>
 		<servlet-name>UDDIBrowserPortlet</servlet-name>
 		<url-pattern>/PlutoInvoker/UDDIBrowserPortlet
 		</url-pattern>



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


Mime
View raw message