You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@juddi.apache.org by al...@apache.org on 2013/05/03 14:12:12 UTC

svn commit: r1478745 [7/9] - in /juddi/branches/juddi-3.2.x: juddi-core/src/main/java/org/apache/juddi/api/impl/ juddi-examples/subscription-notification-handler/ juddi-examples/subscription-notification-handler/nbproject/ juddi-examples/subscription-n...

Modified: juddi/branches/juddi-3.2.x/juddi-gui/src/java/org/apache/juddi/webconsole/hub/UddiHub.java
URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.2.x/juddi-gui/src/java/org/apache/juddi/webconsole/hub/UddiHub.java?rev=1478745&r1=1478744&r2=1478745&view=diff
==============================================================================
--- juddi/branches/juddi-3.2.x/juddi-gui/src/java/org/apache/juddi/webconsole/hub/UddiHub.java (original)
+++ juddi/branches/juddi-3.2.x/juddi-gui/src/java/org/apache/juddi/webconsole/hub/UddiHub.java Fri May  3 12:12:10 2013
@@ -26,13 +26,11 @@ import java.security.cert.CertificateFac
 import java.security.cert.X509Certificate;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Calendar;
 import java.util.GregorianCalendar;
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
 import java.util.concurrent.atomic.AtomicReference;
-import java.util.logging.Logger;
 import javax.servlet.ServletContext;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpSession;
@@ -72,16 +70,24 @@ import sun.misc.BASE64Encoder;
 /**
  * UddiHub - The hub acts as a single point for managing browser to uddi
  * services. At most 1 instance is allowed per http session. In general, all
- * methods in the class trigger web service call outs
+ * methods in the class trigger web service call outs. All callouts also support
+ * expired UDDI tokens and will attempt to reauthenticate and retry the request.
  *
  * @author Alex O'Ree
  */
 public class UddiHub {
 
+    /**
+     * The logger name
+     */
     public static final String LOGGER_NAME = "org.apache.juddi";
     URL propertiesurl = null;
     Properties properties = null;
     AuthStyle style = null;
+    /**
+     * The Log4j logger. This is also referenced from the Builders class, thus
+     * it is public
+     */
     public static final org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(LOGGER_NAME);
     private DatatypeFactory df;
 
@@ -99,6 +105,10 @@ public class UddiHub {
         // token = null;
     }
 
+    /**
+     * This kills any authentication tokens, logs the user out and nulls out all
+     * services
+     */
     public void die() {
         DiscardAuthToken da = new DiscardAuthToken();
         da.setAuthInfo(token);
@@ -117,6 +127,15 @@ public class UddiHub {
         subscription = null;
     }
 
+    /**
+     * This is the singleton accessor UddiHub. There should be at most 1
+     * instance per HTTP Session (user login)
+     *
+     * @param application
+     * @param _session
+     * @return
+     * @throws Exception
+     */
     public static UddiHub getInstance(ServletContext application, HttpSession _session) throws Exception {
         Object j = _session.getAttribute("hub");
         if (j == null) {
@@ -129,10 +148,22 @@ public class UddiHub {
     }
     String locale = "en";
 
+    /**
+     * Provides access to the configuration file for the Hub. useful for I/O
+     * changes to the config
+     *
+     * @return
+     * @throws URISyntaxException
+     */
     public String GetRawConfigurationPath() throws URISyntaxException {
         return propertiesurl.toString();
     }
 
+    /**
+     *
+     * @return Provides access to the configuration file for the Hub. useful for
+     * I/O changes to the config
+     */
     public Properties GetRawConfiguration() {
         return properties;
     }
@@ -197,17 +228,6 @@ public class UddiHub {
         }
     }
     private HttpSession session;
-    /*
-     public boolean IsJuddiRegistry() {
-     String type = properties.getProperty("registryType");
-     if (type == null) {
-     return false;
-     }
-     if (type.equalsIgnoreCase("juddi")) {
-     return true;
-     }
-     return false;
-     }*/
 
     private String GetToken() {
         if (style != AuthStyle.UDDI_AUTH) {
@@ -259,6 +279,12 @@ public class UddiHub {
         return token;
     }
 
+    /**
+     * Returns true if the current user has a token and is signed in. Does not
+     * apply to non-UDDI security API logins
+     *
+     * @return
+     */
     public boolean getUddiIsAuthenticated() {
         return (token != null && !token.isEmpty());
     }
@@ -270,6 +296,16 @@ public class UddiHub {
     //private JUDDIApiPortType juddi = null;
     private String token = null;
 
+    /**
+     * Performs a find_business call in the inquiry API
+     *
+     * @param offset
+     * @param maxrecords
+     * @param keyword
+     * @param lang
+     * @param isChooser
+     * @return
+     */
     public PagableContainer GetBusinessListAsHtml(int offset, int maxrecords, String keyword, String lang, boolean isChooser) {
         PagableContainer ret = new PagableContainer();
         ret.offset = offset;
@@ -341,7 +377,7 @@ public class UddiHub {
             GetRegisteredInfo r = new GetRegisteredInfo();
             r.setAuthInfo(GetToken());
             if (r.getAuthInfo() == null) {
-                return null;
+                return "<h1>" + ResourceLoader.GetResource(session, "errors.notsignedin") + "</h1>";
             }
             r.setInfoSelection(InfoSelection.ALL);
 
@@ -361,7 +397,7 @@ public class UddiHub {
             }
 
         } catch (Exception ex) {
-            return HandleException(ex);
+            return ToErrorAlert(HandleException(ex));
         }
 
 
@@ -401,6 +437,12 @@ public class UddiHub {
 
     }
 
+    /**
+     * Performs Inquiry Find_service API
+     *
+     * @param serviceid
+     * @return
+     */
     public String GetServiceDetailAsHtml(String serviceid) {
         if (serviceid == null || serviceid.length() == 0) {
             return "No business id specified";
@@ -501,6 +543,12 @@ public class UddiHub {
         return sb.toString();
     }
 
+    /**
+     * Performs a getServiceDetails in Inquiry API
+     *
+     * @param serviceid
+     * @return
+     */
     public BusinessService GetServiceDetail(String serviceid) {
         if (serviceid == null || serviceid.length() == 0) {
             return null;
@@ -537,6 +585,12 @@ public class UddiHub {
         return null;
     }
 
+    /**
+     * Calls Publisher Save Service API
+     *
+     * @param be
+     * @return
+     */
     public String SaveService(BusinessService be) {
         try {
             SaveService sb = new SaveService();
@@ -595,6 +649,13 @@ public class UddiHub {
         }
     }
 
+    /**
+     * This method will rebuild a Service entity from the HTTP request from the
+     * Service Editor page and will then attempt to save it.
+     *
+     * @param request
+     * @return a localized Saved or an error message
+     */
     public String SaveServiceDetails(HttpServletRequest request) {
 
         BusinessService be = new BusinessService();
@@ -628,6 +689,12 @@ public class UddiHub {
         return SaveServiceDetails(be);
     }
 
+    /**
+     * Saves a Service
+     *
+     * @param be
+     * @return a readable error message or, success
+     */
     public String SaveServiceDetails(BusinessService be) {
         try {
             SaveService sb = new SaveService();
@@ -657,7 +724,7 @@ public class UddiHub {
      * Saves a business entity
      *
      * @param be
-     * @return
+     * @return a readable error message
      */
     public String SaveBusinessDetails(BusinessEntity be) {
         try {
@@ -697,19 +764,23 @@ public class UddiHub {
      */
     public String SaveBusinessDetails(HttpServletRequest request) {
 
-        BusinessEntity GetBusinessDetails = GetBusinessDetails(request.getParameter(PostBackConstants.BUSINESSKEY).trim());
+
 
         BusinessEntity be = new BusinessEntity();
         be.setBusinessKey(request.getParameter(PostBackConstants.BUSINESSKEY).trim());
         if (be.getBusinessKey().equalsIgnoreCase(ResourceLoader.GetResource(session, "items.clicktoedit"))) {
             be.setBusinessKey(null);
-        }
-        be.getName().addAll(Builders.BuildNames(Builders.MapFilter(request.getParameterMap(), PostBackConstants.NAME), PostBackConstants.NAME, ResourceLoader.GetResource(session, "items.clicktoedit")));
-        if (GetBusinessDetails == null) //this is a new business
-        {
         } else {
-            be.setBusinessServices(GetBusinessDetails.getBusinessServices());
+            BusinessEntity GetBusinessDetails = GetBusinessDetails(be.getBusinessKey());
+            if (GetBusinessDetails == null) //this is a new business
+            {
+            } else {
+                //copy over the existing child element, business
+                be.setBusinessServices(GetBusinessDetails.getBusinessServices());
+            }
         }
+        be.getName().addAll(Builders.BuildNames(Builders.MapFilter(request.getParameterMap(), PostBackConstants.NAME), PostBackConstants.NAME, ResourceLoader.GetResource(session, "items.clicktoedit")));
+
 
         be.setContacts(Builders.BuildContacts(request.getParameterMap(), ResourceLoader.GetResource(session, "items.clicktoedit")));
 
@@ -726,7 +797,15 @@ public class UddiHub {
         return SaveBusinessDetails(be);
     }
 
-    public String GetBusinessDetailsAsHtml(String bizid) throws Exception {
+    /**
+     * Returns
+     *
+     * @param bizid
+     * @return
+     * @throws Exception
+     */
+    @Deprecated
+    private String GetBusinessDetailsAsHtml(String bizid) throws Exception {
         if (bizid == null || bizid.isEmpty()) {
             return ResourceLoader.GetResource(session, "errors.noinput.businesskey");
         }
@@ -821,15 +900,47 @@ public class UddiHub {
 
     }
 
+    private String ToErrorAlert(String HandleException) {
+        return "<div class=\"alert alert-error\">" + HandleException + "</div>";
+    }
+
+    /**
+     * AuthStyles for the Hub to use, default is UDDI_AUTH
+     */
     public enum AuthStyle {
 
+        /**
+         * Http Basic
+         */
         HTTP_BASIC,
+        /**
+         * Http Digest
+         */
         HTTP_DIGEST,
+        /**
+         * HTTP NTLM
+         */
         HTTP_NTLM,
+        /**
+         * UDDI Authentication via the Security API
+         */
         UDDI_AUTH,
+        /**
+         * HTTP Client Certificate Authentication
+         */
         HTTP_CLIENT_CERT
     }
 
+    /**
+     * Search for services using find_services
+     *
+     * @param keyword
+     * @param lang
+     * @param maxrecords
+     * @param offset
+     * @param isChooser
+     * @return
+     */
     public PagableContainer SearchForServices(String keyword, String lang, int maxrecords, int offset, boolean isChooser) {
         PagableContainer ret = new PagableContainer();
         ret.displaycount = 0;
@@ -885,61 +996,6 @@ public class UddiHub {
     }
 
     /**
-     * not used yet?
-     *
-     * @param request
-     * @return
-     * @ deprecated
-     *
-     * @ Deprecated public String AddPublisher(HttpServletRequest request) { try
-     * { SavePublisher sp = new SavePublisher(); sp.setAuthInfo(GetToken());
-     * Publisher p = new Publisher(); //TODO code sp.getPublisher().add(p);
-     * PublisherDetail savePublisher = juddi.savePublisher(sp); return
-     * "Success"; //TODO resource this } catch (Exception ex) { return
-     * HandleException(ex); }
-     *
-     *
-     * }
-     */
-    /**
-     * returns an html listing of Juddi authorized publishers
-     *
-     * @return
-     *
-     * public String GetPublisherListAsHtml() { if (!this.IsJuddiRegistry()) {
-     * return "This function is only available on Juddi registries"; } try {
-     * GetAllPublisherDetail gpd = new GetAllPublisherDetail();
-     * gpd.setAuthInfo(GetToken()); PublisherDetail allPublisherDetail =
-     * juddi.getAllPublisherDetail(gpd); StringBuilder sb = new StringBuilder();
-     * for (int i = 0; i < allPublisherDetail.getPublisher().size(); i++) {
-     * sb.append(ResourceLoader.GetResource(session, "items.pubisher.name"))
-     * .append(" =
-     * ").append(allPublisherDetail.getPublisher().get(i).getPublisherName()).append("<br>");
-     * sb.append(ResourceLoader.GetResource(session,
-     * "items.pubisher.authname")).append(" =
-     * ").append(allPublisherDetail.getPublisher().get(i).getAuthorizedName()).append("<br>");
-     * sb.append(ResourceLoader.GetResource(session, "items.email"));
-     * sb.append(" =
-     * ").append(allPublisherDetail.getPublisher().get(i).getEmailAddress()).append("<br>");
-     * sb.append(ResourceLoader.GetResource(session, "items.publisher.admin"))
-     * .append(" =
-     * ").append(allPublisherDetail.getPublisher().get(i).getIsAdmin()).append("<br>");
-     * sb.append("Is Enabled? =
-     * ").append(allPublisherDetail.getPublisher().get(i).getIsEnabled()).append("<br>");
-     * sb.append("Max bindings per service =
-     * ").append(allPublisherDetail.getPublisher().get(i).getMaxBindingsPerService()).append("<br>");
-     * sb.append("Max businesses =
-     * ").append(allPublisherDetail.getPublisher().get(i).getMaxBusinesses()).append("<br>");
-     * sb.append("Max Services per Business =
-     * ").append(allPublisherDetail.getPublisher().get(i).getMaxServicePerBusiness()).append("<br>");
-     * sb.append("Max tModels =
-     * ").append(allPublisherDetail.getPublisher().get(i).getMaxTModels()).append("<br><br>");
-     *
-     * }
-     * return sb.toString(); } catch (Exception ex) { return
-     * HandleException(ex); } }
-     */
-    /**
      * Adds a special tModel key generator keyGenerator: Marking a tModel with
      * this categorization designates it as one whose tModelKey identifies a key
      * generator partition that can be used by its owner to derive and assign
@@ -987,7 +1043,15 @@ public class UddiHub {
         }
     }
 
-    String HandleException(Exception ex) {
+    /**
+     * This function provides a basic error handling rutine that will pull out
+     * the true error message in a UDDI fault message, returning bootstrap
+     * stylized html error message
+     *
+     * @param ex
+     * @return
+     */
+    private String HandleException(Exception ex) {
         if (ex instanceof DispositionReportFaultMessage) {
             DispositionReportFaultMessage f = (DispositionReportFaultMessage) ex;
             log.log(Level.ERROR, null, ex);
@@ -999,7 +1063,10 @@ public class UddiHub {
             return ResourceLoader.GetResource(session, "errors.generic") + " " + ex.getMessage() + " " + f.detail.getMessage();
         }
         log.log(Level.ERROR, null, ex);
-        return ResourceLoader.GetResource(session, "errors.generic") + " " + ex.getMessage();
+        return //"<div class=\"alert alert-error\" ><h3><i class=\"icon-warning-sign\"></i> "
+                ResourceLoader.GetResource(session, "errors.generic") + " " + StringEscapeUtils.escapeHtml(ex.getMessage());
+        //+ "</h3></div>";
+
     }
 
     /**
@@ -1108,14 +1175,32 @@ public class UddiHub {
         return null;
     }
 
+    /**
+     * A convenience function for GetBusinessDetails
+     *
+     * @param key
+     * @return
+     */
     public BusinessEntity GetBusinessDetailsAsObject(String key) {
         return GetBusinessDetails(key);
     }
 
+    /**
+     * A convenience function for GetServiceDetail
+     *
+     * @param key
+     * @return
+     */
     public BusinessService GetServiceDetailsAsObject(String key) {
         return GetServiceDetail(key);
     }
 
+    /**
+     * Returns a specific binding template as an object
+     *
+     * @param key
+     * @return null if not found
+     */
     public BindingTemplate GetBindingDetailsAsObject(String key) {
         try {
             GetBindingDetail r = new GetBindingDetail();
@@ -1143,6 +1228,12 @@ public class UddiHub {
         return null;
     }
 
+    /**
+     * Returns a tmodel given the key
+     *
+     * @param key
+     * @return null if not found
+     */
     public TModel GettModelDetailsAsObject(String key) {
         try {
             GetTModelDetail r = new GetTModelDetail();
@@ -1171,16 +1262,70 @@ public class UddiHub {
         return null;
     }
 
+    /**
+     * An enum to help make UDDI searching easier to work with
+     */
     public enum FindType {
 
-        Business, RelatedBusiness, Service, tModel, BindingTemplate
+        /**
+         * search for a business
+         */
+        Business,
+        /**
+         * search for a related business
+         */
+        RelatedBusiness,
+        /**
+         * search for a business
+         */
+        Service,
+        /**
+         * search for a tmodel
+         */
+        tModel,
+        /**
+         * search for a binding template
+         */
+        BindingTemplate
     }
 
+    /**
+     * An enum to help make UDDI searching easier to work with
+     */
     public enum CriteriaType {
 
-        Name, Category, uid, tmodel, identbag
+        /**
+         * search by name
+         */
+        Name,
+        /**
+         * by category
+         */
+        Category,
+        /**
+         * by key
+         */
+        uid,
+        /**
+         * by tmodel
+         */
+        tmodel,
+        /**
+         * by identifier bag
+         */
+        identbag
     }
 
+    /**
+     * Provides a simple search interface for the complex UDDI search APIs
+     *
+     * @param type
+     * @param criteria
+     * @param parameters
+     * @param lang
+     * @param findqualifier
+     * @return stylized html
+     */
     public String Search(FindType type, CriteriaType criteria, String parameters, String lang, String[] findqualifier) {
         switch (type) {
             case BindingTemplate:
@@ -1195,7 +1340,7 @@ public class UddiHub {
             case tModel:
                 return FindtModels(criteria, parameters, lang, findqualifier);
         }
-        return "unknown error";
+        return ResourceLoader.GetResource(session, "items.unknown");
     }
 
     private String FindBindingTemplateToHtml(CriteriaType criteria, String parameters, String lang, String[] fq) {
@@ -1604,6 +1749,12 @@ public class UddiHub {
         return deleteBusiness(x);
     }
 
+    /**
+     * delete a service
+     *
+     * @param serviceId
+     * @return
+     */
     public String deleteService(String serviceId) {
         if (serviceId == null || serviceId.length() == 0) {
             return ResourceLoader.GetResource(session, "errors.noinput");
@@ -1613,6 +1764,12 @@ public class UddiHub {
         return deleteService(x);
     }
 
+    /**
+     * deletes a list of services
+     *
+     * @param serviceId
+     * @return
+     */
     public String deleteService(List<String> serviceId) {
         if (serviceId == null || serviceId.isEmpty()) {
             return ResourceLoader.GetResource(session, "errors.noinput");
@@ -1675,6 +1832,12 @@ public class UddiHub {
         return ResourceLoader.GetResource(session, "actions.delete.business");
     }
 
+    /**
+     * delete a tmodel
+     *
+     * @param bizid
+     * @return
+     */
     public String deleteTmodel(String bizid) {
         if (bizid == null || bizid.length() == 0) {
             return ResourceLoader.GetResource(session, "errors.noinput");
@@ -1807,6 +1970,13 @@ public class UddiHub {
 
     }
 
+    /**
+     * Converts a UDDI Signature to a readable representation of the signing
+     * certificate subject name
+     *
+     * @param sig
+     * @return
+     */
     public static String SignatureToReadable(SignatureType sig) {
         StringBuilder sb = new StringBuilder();
         // X509Certificate signingcert = null;
@@ -1947,6 +2117,12 @@ public class UddiHub {
         return null;
     }
 
+    /**
+     * attempts to save subscription
+     *
+     * @param sub
+     * @return a success or fail message
+     */
     public String AddSubscription(Subscription sub) {
         Holder<List<Subscription>> data = new Holder<List<Subscription>>();
         data.value = new ArrayList<Subscription>();
@@ -1966,11 +2142,17 @@ public class UddiHub {
                 }
             }
         } catch (Exception ex) {
-            HandleException(ex);
+            return HandleException(ex);
         }
-        return null;
+        return ResourceLoader.GetResource(session, "messages.success");
     }
 
+    /**
+     * Removes/deletes a subscription
+     *
+     * @param key
+     * @return sucess or failure message
+     */
     public String RemoveSubscription(String key) {
         DeleteSubscription ds = new DeleteSubscription();
         ds.setAuthInfo(GetToken());
@@ -1995,7 +2177,7 @@ public class UddiHub {
         } catch (Exception ex) {
             return HandleException(ex);
         }
-        return null;
+        return ResourceLoader.GetResource(session, "messages.success");
     }
 
     /**
@@ -2080,6 +2262,7 @@ public class UddiHub {
     }
 
     /**
+     * This function returns all businesses that the current user owns<br><br>
      * The get_registeredInfo API call is used to get an abbreviated list of all
      * businessEntity and tModel data that are controlled by a publisher. When
      * the registry distinguishes between publishers, this is the individual
@@ -2121,38 +2304,25 @@ public class UddiHub {
         return null;
     }
 
+    /**
+     * Gets a list of all assertions for all businesses owned by the current
+     * user
+     *
+     * The get_assertionStatusReport API call provides administrative support
+     * for determining the status of current and outstanding publisher
+     * assertions that involve any of the business registrations managed by the
+     * individual publisher. Using this API, a publisher can see the status of
+     * assertions that they have made, as well as see assertions that others
+     * have made that involve businessEntity structures controlled by the
+     * requesting publisher. See Appendix A Relationships and Publisher
+     * Assertions for more information.
+     *
+     * @param msg
+     * @return
+     */
     public List<AssertionStatusItem> GetPublisherAssertions(AtomicReference<String> msg) {
         List<AssertionStatusItem> out = new ArrayList<AssertionStatusItem>();
-        //first, get all the assertions
-/*
-         List<PublisherAssertion> publisherAssertions = null;
-         try {
-         try {
-         publisherAssertions = publish.getPublisherAssertions(GetToken());
-         } catch (Exception ex) {
-         if (ex instanceof DispositionReportFaultMessage) {
-         DispositionReportFaultMessage f = (DispositionReportFaultMessage) ex;
-         if (f.getFaultInfo().countainsErrorCode(DispositionReport.E_AUTH_TOKEN_EXPIRED)) {
-         token = null;
-         publisherAssertions = publish.getPublisherAssertions(GetToken());
-         }
-         } else {
-         throw ex;
-         }
-         }
-         } catch (Exception ex) {
-         msg.set(HandleException(ex));
-         }
-         */
-        //then, all of the status of each item
-        /*
-         * The get_assertionStatusReport API call provides administrative support for determining 
-         * the status of current and outstanding publisher assertions that involve any of the business 
-         * registrations managed by the individual publisher.  Using this API, a publisher can see the 
-         * status of assertions that they have made, as well as see assertions that others have made that 
-         * involve businessEntity structures controlled by the requesting publisher.   See Appendix A 
-         * Relationships and Publisher Assertions for more information.
-         */
+
         List<AssertionStatusItem> STATUS_COMPLETE = null;
 
         try {
@@ -2226,6 +2396,16 @@ public class UddiHub {
         //return publisherAssertions;
     }
 
+    /**
+     * deletes a publisher assertion, all fields must match exactly
+     *
+     * @param tokey
+     * @param fromkey
+     * @param tmodelkey
+     * @param keyname
+     * @param keyvalue
+     * @return
+     */
     public String DeletePublisherAssertion(String tokey, String fromkey, String tmodelkey, String keyname, String keyvalue) {
         DeletePublisherAssertions dp = new DeletePublisherAssertions();
         dp.setAuthInfo(GetToken());
@@ -2259,6 +2439,7 @@ public class UddiHub {
     }
 
     /**
+     * Adds a new publisher assertion
      *
      * @param tokey
      * @param fromkey
@@ -2301,6 +2482,12 @@ public class UddiHub {
         return ResourceLoader.GetResource(session, "actions.saved");
     }
 
+    /**
+     * Returns bootstrap stylized html representing all changes in the last refresh
+     * @param lastRefresh
+     * @return
+     * @throws DatatypeConfigurationException 
+     */
     public String GetNewsFeed(XMLGregorianCalendar lastRefresh) throws DatatypeConfigurationException {
         if (df == null) {
             df = DatatypeFactory.newInstance();
@@ -2366,7 +2553,7 @@ public class UddiHub {
                 //    subscriptionResults.getAssertionStatusReport().
                 if (subscriptionResults.getAssertionStatusReport() != null) {
                     sb.append(ResourceLoader.GetResource(session, "items.subscriptions.assertion")).
-                            append("<br><table class=\"table table-hover\">");
+                            append("<table class=\"table table-hover\">");
                     for (int i = 0; i < subscriptionResults.getAssertionStatusReport().getAssertionStatusItem().size(); i++) {
                         sb.append("<tr><td>");
                         sb.append(StringEscapeUtils.escapeHtml(subscriptionResults.getAssertionStatusReport().getAssertionStatusItem().get(i).getFromKey()));
@@ -2376,10 +2563,11 @@ public class UddiHub {
                         sb.append(StringEscapeUtils.escapeHtml(subscriptionResults.getAssertionStatusReport().getAssertionStatusItem().get(i).getCompletionStatus().toString()));
                         sb.append("</td></tr>");
                     }
-                    sb.append("</table><br><br>");
-                } else if (subscriptionResults.getBindingDetail() != null) {
+                    sb.append("</table><br>");
+                }
+                if (subscriptionResults.getBindingDetail() != null) {
                     sb.append(ResourceLoader.GetResource(session, "items.subscriptions.bindings")).
-                            append("<br><table class=\"table table-hover\">");
+                            append("<table class=\"table table-hover\">");
                     for (int i = 0; i < subscriptionResults.getBindingDetail().getBindingTemplate().size(); i++) {
                         sb.append("<tr><td>");
                         sb.append(StringEscapeUtils.escapeHtml(subscriptionResults.getBindingDetail().getBindingTemplate().get(i).getServiceKey()));
@@ -2387,45 +2575,56 @@ public class UddiHub {
                         sb.append(StringEscapeUtils.escapeHtml(subscriptionResults.getBindingDetail().getBindingTemplate().get(i).getBindingKey()));
                         sb.append("</td></tr>");
                     }
-                    sb.append("</table><br><br>");
-                } else if (subscriptionResults.getBusinessDetail() != null) {
+                    sb.append("</table><br>");
+                }
+                if (subscriptionResults.getBusinessDetail() != null) {
                     sb.append(ResourceLoader.GetResource(session, "items.subscriptions.business")).
-                            append("<br><table class=\"table table-hover\">");
+                            append("<table class=\"table table-hover\">");
                     for (int i = 0; i < subscriptionResults.getBusinessDetail().getBusinessEntity().size(); i++) {
-                        sb.append("<tr><td>");
+                        sb.append("<tr><td><a href=\"businessEditor2.jsp?id=");
                         sb.append(StringEscapeUtils.escapeHtml(subscriptionResults.getBusinessDetail().getBusinessEntity().get(i).getBusinessKey()));
-                        sb.append("</td></tr>");
+                        sb.append("\">");
+                        sb.append(StringEscapeUtils.escapeHtml(subscriptionResults.getBusinessDetail().getBusinessEntity().get(i).getBusinessKey()));
+                        sb.append("<i class=\"icon-large icon-edit\"></i></a></td></tr>");
                     }
-                    sb.append("</table><br><br>");
-                } else if (subscriptionResults.getRelatedBusinessesList() != null) {
+                    sb.append("</table><br>");
+                }
+                if (subscriptionResults.getRelatedBusinessesList() != null) {
                     sb.append(ResourceLoader.GetResource(session, "items.subscriptions.assertion2")).
-                            append("<br><table class=\"table table-hover\">");
+                            append("<table class=\"table table-hover\">");
                     // for (int i = 0; i < subscriptionResults.getRelatedBusinessesList().getBusinessKey().size(); i++) {
                     sb.append("<tr><td>");
                     sb.append(StringEscapeUtils.escapeHtml(subscriptionResults.getRelatedBusinessesList().getBusinessKey()));
                     sb.append("</td></tr>");
                     //}
-                    sb.append("</table><br><br>");
-                } else if (subscriptionResults.getServiceDetail() != null) {
+                    sb.append("</table><br>");
+                }
+                if (subscriptionResults.getServiceDetail() != null) {
                     sb.append(ResourceLoader.GetResource(session, "items.subscriptions.services")).
-                            append("d<br><table class=\"table table-hover\">");
+                            append("<table class=\"table table-hover\">");
                     for (int i = 0; i < subscriptionResults.getServiceDetail().getBusinessService().size(); i++) {
-                        sb.append("<tr><td>");
+                        sb.append("<tr><td><a href=\"serviceEditor.jsp?id=");
                         sb.append(StringEscapeUtils.escapeHtml(subscriptionResults.getServiceDetail().getBusinessService().get(i).getServiceKey()));
-                        sb.append("</td></tr>");
+                        sb.append("\">");
+                        sb.append(StringEscapeUtils.escapeHtml(subscriptionResults.getServiceDetail().getBusinessService().get(i).getServiceKey()));
+                        sb.append("<i class=\"icon-large icon-edit\"></i></a></td></tr>");
                     }
-                    sb.append("</table><br><br>");
-                } else if (subscriptionResults.getServiceList() != null) {
-                    sb.append(ResourceLoader.GetResource(session, "items.subscriptions.servicelist")).append("<br><table class=\"table table-hover\">");
+                    sb.append("</table><br>");
+                }
+                if (subscriptionResults.getServiceList() != null) {
+                    sb.append(ResourceLoader.GetResource(session, "items.subscriptions.servicelist")).
+                            append("<table class=\"table table-hover\">");
                     for (int i = 0; i < subscriptionResults.getServiceList().getServiceInfos().getServiceInfo().size(); i++) {
                         sb.append("<tr><td>");
                         sb.append(StringEscapeUtils.escapeHtml(subscriptionResults.getServiceList().getServiceInfos().getServiceInfo().get(i).getServiceKey()));
+
                         sb.append("</td><td>");
                         sb.append(StringEscapeUtils.escapeHtml(Printers.ListNamesToString(subscriptionResults.getServiceList().getServiceInfos().getServiceInfo().get(i).getName())));
                         sb.append("</td></tr>");
                     }
-                    sb.append("</table><br><br>");
-                } else if (subscriptionResults.getTModelDetail() != null) {
+                    sb.append("</table><br>");
+                }
+                if (subscriptionResults.getTModelDetail() != null) {
                     sb.append(ResourceLoader.GetResource(session, "items.subscriptions.tmodels")).append("<br><table class=\"table table-hover\">");
                     for (int i = 0; i < subscriptionResults.getTModelDetail().getTModel().size(); i++) {
                         sb.append("<tr><td>");
@@ -2434,18 +2633,21 @@ public class UddiHub {
                         sb.append(StringEscapeUtils.escapeHtml((subscriptionResults.getTModelDetail().getTModel().get(i).getName().getValue())));
                         sb.append("</td></tr>");
                     }
-                    sb.append("</table><br><br>");
-                } else if (subscriptionResults.getTModelList() != null) {
+                    sb.append("</table><br>");
+                }
+                if (subscriptionResults.getTModelList() != null) {
                     sb.append(ResourceLoader.GetResource(session, "items.subscriptions.tmodels2"))
-                            .append("<br><table class=\"table table-hover\">");
+                            .append("<table class=\"table table-hover\">");
                     for (int i = 0; i < subscriptionResults.getTModelList().getTModelInfos().getTModelInfo().size(); i++) {
-                        sb.append("<tr><td>");
+                        sb.append("<tr><td><a href=\"serviceEditor.jsp?id=");
                         sb.append(StringEscapeUtils.escapeHtml(subscriptionResults.getTModelList().getTModelInfos().getTModelInfo().get(i).getTModelKey()));
-                        sb.append("</td><td>");
+                        sb.append("\">");
+                        sb.append(StringEscapeUtils.escapeHtml(subscriptionResults.getTModelList().getTModelInfos().getTModelInfo().get(i).getTModelKey()));
+                        sb.append("<i class=\"icon-large icon-edit\"></i></a></td><td>");
                         sb.append(StringEscapeUtils.escapeHtml((subscriptionResults.getTModelList().getTModelInfos().getTModelInfo().get(i).getName().getValue())));
                         sb.append("</td></tr>");
                     }
-                    sb.append("</table><br><br>");
+                    sb.append("</table>");
                 }
 
             }
@@ -2453,6 +2655,16 @@ public class UddiHub {
         return sb.toString();
     }
 
+    /**
+     * Searches first for a service, then iterates through to identify bindings matching the specified criteria.
+     * Since UDDI does not have a find_binding API, this is as good as it gets.
+     * @param keyword
+     * @param lang
+     * @param offset
+     * @param maxrecords
+     * @param isChooser
+     * @return 
+     */
     public PagableContainer SearchForBinding(String keyword, String lang, int offset, int maxrecords, boolean isChooser) {
         PagableContainer ret = new PagableContainer();
         ret.displaycount = 0;
@@ -2521,7 +2733,7 @@ public class UddiHub {
                 ret.renderedHtml = ResourceLoader.GetResource(session, "errors.norecordsfound");
                 return ret;
             }
-            
+
 
 
             StringBuilder sb = new StringBuilder();
@@ -2579,7 +2791,7 @@ public class UddiHub {
     }
 
     /**
-     *
+     * Get a custody transfer token for giving away control of the specified business or tmodel keys
      *
      * authInfo: This OPTIONAL argument is an element that contains an
      * authentication token. Authentication tokens are obtained using the
@@ -2672,6 +2884,12 @@ public class UddiHub {
 
     }
 
+    /**
+     * Accepts a transfer token and transfers the entities.
+     * @param tokenXML
+     * @param keyBagXML
+     * @return 
+     */
     public String AcceptCustodyTranferToken(String tokenXML, String keyBagXML) {
         try {
             TransferEntities te = new TransferEntities();
@@ -2701,6 +2919,12 @@ public class UddiHub {
 
     }
 
+    /**
+     * returns a subscription by id, since UDDI does not provide this function, it simply gets all of them for the current user
+     * then filters out the requested item
+     * @param id
+     * @return null if not found
+     */
     public Subscription GetSubscriptionDetails(String id) {
         if (id == null) {
             return null;

Modified: juddi/branches/juddi-3.2.x/juddi-gui/src/java/org/apache/juddi/webconsole/hub/builders/Builders.java
URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.2.x/juddi-gui/src/java/org/apache/juddi/webconsole/hub/builders/Builders.java?rev=1478745&r1=1478744&r2=1478745&view=diff
==============================================================================
--- juddi/branches/juddi-3.2.x/juddi-gui/src/java/org/apache/juddi/webconsole/hub/builders/Builders.java (original)
+++ juddi/branches/juddi-3.2.x/juddi-gui/src/java/org/apache/juddi/webconsole/hub/builders/Builders.java Fri May  3 12:12:10 2013
@@ -16,7 +16,12 @@
  */
 package org.apache.juddi.webconsole.hub.builders;
 
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
 import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
@@ -24,15 +29,17 @@ import java.util.Map;
 import java.util.concurrent.atomic.AtomicReference;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
-import org.apache.commons.lang.StringEscapeUtils;
+import javax.servlet.http.HttpSession;
+import javax.xml.datatype.DatatypeFactory;
 import org.apache.juddi.webconsole.PostBackConstants;
 import org.apache.juddi.webconsole.hub.UddiHub;
+import org.apache.juddi.webconsole.resources.ResourceLoader;
 import org.uddi.api_v3.*;
 import org.uddi.sub_v3.Subscription;
 import org.uddi.sub_v3.SubscriptionFilter;
 
 /**
- *
+ * This class provides functions for building UDDI entities from Http request parameters
  * @author Alex O'Ree
  */
 public class Builders {
@@ -99,6 +106,13 @@ public class Builders {
         return ret;
     }
 
+    /**
+     * overview docs
+     * @param map
+     * @param prefix
+     * @param cte
+     * @return 
+     */
     public static List<OverviewDoc> BuildOverviewDocs(Map map, String prefix, String cte) {
         List<OverviewDoc> ret = new ArrayList<OverviewDoc>();
         Iterator it = map.keySet().iterator();
@@ -127,6 +141,12 @@ public class Builders {
         return ret;
     }
 
+    /**
+     * phone numbers
+     * @param map
+     * @param prefix
+     * @return 
+     */
     public static List<Phone> BuildPhone(Map map, String prefix) {
         List<Phone> ret = new ArrayList();
         Iterator it = map.keySet().iterator();
@@ -153,6 +173,13 @@ public class Builders {
         return ret;
     }
 
+    /**
+     * builds a contact
+     * @param m
+     * @param prefix
+     * @param cte
+     * @return 
+     */
     public static Contact BuildSingleContact(Map m, String prefix, String cte) {
         Contact c = new Contact();
         String[] t = (String[]) m.get(prefix + PostBackConstants.TYPE);
@@ -165,6 +192,13 @@ public class Builders {
         return c;
     }
 
+    /**
+     * name elements
+     * @param map
+     * @param prefix
+     * @param cte
+     * @return 
+     */
     public static List<Name> BuildNames(Map map, String prefix, String cte) {
         List<Name> ret = new ArrayList();
         Iterator it = map.keySet().iterator();
@@ -195,6 +229,12 @@ public class Builders {
         return ret;
     }
 
+    /**
+     * builds a compelte category bag
+     * @param map
+     * @param prefix
+     * @return 
+     */
     public static CategoryBag BuildCatBag(Map map, String prefix) {
         CategoryBag ret = new CategoryBag();
         Iterator it = map.keySet().iterator();
@@ -222,7 +262,13 @@ public class Builders {
         }
         return ret;
     }
-
+    
+/**
+ * identifier bag
+ * @param map
+ * @param prefix
+ * @return 
+ */
     public static IdentifierBag BuildIdentBag(Map map, String prefix) {
         IdentifierBag ret = new IdentifierBag();
         ret.getKeyedReference().addAll(BuildKeyedReference(map, prefix));
@@ -231,7 +277,12 @@ public class Builders {
         }
         return ret;
     }
-
+/**
+ * discovery urls
+ * @param map
+ * @param prefix
+ * @return 
+ */
     public static DiscoveryURLs BuildDisco(Map map, String prefix) {
         DiscoveryURLs list = new DiscoveryURLs();
         Iterator it = map.keySet().iterator();
@@ -261,6 +312,13 @@ public class Builders {
         return list;
     }
 
+    /**
+     * addresses
+     * @param map
+     * @param prefix
+     * @param cte
+     * @return 
+     */
     public static List<Address> BuildAddress(Map map, String prefix, String cte) {
         List<Address> ret = new ArrayList();
         Iterator it = map.keySet().iterator();
@@ -308,6 +366,12 @@ public class Builders {
         return ret;
     }
 
+    /**
+     * keyed reference group
+     * @param map
+     * @param prefix
+     * @return 
+     */
     public static List<KeyedReferenceGroup> BuildKeyedReferenceGroup(Map map, String prefix) {
         List<KeyedReferenceGroup> ret = new ArrayList<KeyedReferenceGroup>();
         Iterator it = map.keySet().iterator();
@@ -368,6 +432,12 @@ public class Builders {
         return cb;
     }
 
+    /**
+     * email
+     * @param map
+     * @param prefix
+     * @return 
+     */
     public static List<Email> BuildEmail(Map map, String prefix) {
         List<Email> list = new ArrayList<Email>();
         Iterator it = map.keySet().iterator();
@@ -394,6 +464,13 @@ public class Builders {
         return list;
     }
 
+    /**
+     * description
+     * @param map
+     * @param prefix
+     * @param cte
+     * @return 
+     */
     public static List<Description> BuildDescription(Map map, String prefix, String cte) {
         List<Description> ret = new ArrayList();
         Iterator it = map.keySet().iterator();
@@ -424,6 +501,12 @@ public class Builders {
         return ret;
     }
 
+    /**
+     * keyed references
+     * @param map
+     * @param prefix
+     * @return 
+     */
     public static List<KeyedReference> BuildKeyedReference(Map map, String prefix) {
         List<KeyedReference> ret = new ArrayList<KeyedReference>();
         Iterator it = map.keySet().iterator();
@@ -454,6 +537,12 @@ public class Builders {
         return ret;
     }
 
+    /**
+     * address lines
+     * @param map
+     * @param prefix
+     * @return 
+     */
     public static List<AddressLine> BuildAddressLine(Map map, String prefix) {
         List<AddressLine> ret = new ArrayList();
         Iterator it = map.keySet().iterator();
@@ -482,6 +571,13 @@ public class Builders {
         return ret;
     }
 
+    /**
+     * binding templates
+     * @param map
+     * @param prefix
+     * @param cte
+     * @return 
+     */
     public static List<BindingTemplate> BuildBindingTemplates(Map map, String prefix, String cte) {
         List<BindingTemplate> ret = new ArrayList();
         Iterator it = map.keySet().iterator();
@@ -598,92 +694,247 @@ public class Builders {
         return ret;
     }
 
-    public static Subscription BuildClientSubscription(Map map, AtomicReference<String> outmsg) {
+    /**
+     * client subscription api
+     * @param map
+     * @param outmsg
+     * @param session
+     * @return 
+     */
+    public static Subscription BuildClientSubscription(Map map, AtomicReference<String> outmsg, HttpSession session) {
         Subscription sub = new Subscription();
         if (outmsg == null) {
             outmsg = new AtomicReference<String>();
         }
 
-        String alertType = ((String[]) map.get("alertType"))[0];
-        if (alertType == null) {
-            outmsg.set("alertType not defined");
-            return null;
-        }
-        if (alertType.equalsIgnoreCase("specificItem")) {
-            sub = BuildClientSubscriptionSpecificItem(map, outmsg);
-        } else if (alertType.equalsIgnoreCase("searchResults")) {
-            sub = BuildClientSubscriptionSearchResults(map);
-        } else {
-            outmsg.set("alertType invalid");
-            return null;
-        }
-        if (sub == null) {
-            return null;
-        }
-
-        String alertTransport = ((String[]) map.get("alertTransport"))[0];
-        if (alertTransport == null) {
-            
-        } else {
-            if (alertTransport.equalsIgnoreCase("bindingTemplate")) {
-                sub.setBindingKey(((String[]) map.get("bindingKey"))[0]);
+        try {
+            String alertType = ((String[]) map.get("alertType"))[0];
+            if (alertType == null) {
+                outmsg.set("alertType not defined");
+                return null;
+            }
+            if (alertType.equalsIgnoreCase("specificItem")) {
+                sub = BuildClientSubscriptionSpecificItem(map, outmsg);
+            } else if (alertType.equalsIgnoreCase("searchResults")) {
+                sub = BuildClientSubscriptionSearchResults(map, outmsg);
             } else {
-                sub.setBindingKey(null);
+                outmsg.set("alertType invalid");
+                return null;
+            }
+            if (sub == null) {
+                return null;
             }
-        }
-        //options
 
+            String alertTransport = ((String[]) map.get("alertTransport"))[0];
+            if (alertTransport == null) {
+            } else {
+                if (alertTransport.equalsIgnoreCase("bindingTemplate")) {
+                    sub.setBindingKey(((String[]) map.get("bindingKey"))[0]);
+                } else {
+                    sub.setBindingKey(null);
+                }
+            }
+            if (map.get("subkey") != null) {
+                String subkey = ((String[]) map.get("subkey"))[0];
+                if (subkey != null && !subkey.equalsIgnoreCase(ResourceLoader.GetResource(session, "items.clicktoedit"))) {
+                    sub.setSubscriptionKey(subkey);
+                }
+            }
+            //options
+            sub = BuildSubscriptionOptions(map, sub);
+            return sub;
+        } catch (Exception ex) {
+            outmsg.set(ex.getMessage());
+            return null;
+        }
 
-        return sub;
     }
 
     private static Subscription BuildClientSubscriptionSpecificItem(Map map, AtomicReference<String> outmsg) {
-        Subscription sub = new Subscription();
-        boolean ok = true;
-
-        String alertCritera = ((String[]) map.get("alertCriteraSingleItem"))[0];
+        try {
+            Subscription sub = new Subscription();
+            String alertCritera = ((String[]) map.get("alertCriteraSingleItem"))[0];
+
+            List<String> keys = new ArrayList<String>();
+            String ItemKey = ((String[]) map.get("itemKey"))[0];
+            if (ItemKey == null) {
+                outmsg.set("no item defined");
+                return null;
+            }
+            //TODO this is an issue. Unknown if commas can be included within UDDI keys
+            if (ItemKey.contains(",")) {
+                String[] k2 = ItemKey.split(",");
+                for (int i = 0; i < k2.length; i++) {
+                    if (k2[i] == null) {
+                        continue;
+                    }
+                    if (k2[i].trim().isEmpty()) {
+                        continue;
+                    }
+                    keys.add(k2[i].trim());
+                }
+            } else {
+                keys.add(ItemKey);
+            }
 
 
-        String ItemKey = ((String[]) map.get("itemKey"))[0];
-        if (ItemKey == null) {
-            outmsg.set("no item defined");
+            sub.setSubscriptionFilter(new SubscriptionFilter());
+
+            if (alertCritera != null) {
+
+                if (alertCritera.equalsIgnoreCase("binding")) {
+                    sub.getSubscriptionFilter().setGetBindingDetail(new GetBindingDetail());
+                    sub.getSubscriptionFilter().getGetBindingDetail().getBindingKey().addAll(keys);
+                } else if (alertCritera.equalsIgnoreCase("service")) {
+                    sub.getSubscriptionFilter().setGetServiceDetail(new GetServiceDetail());
+                    sub.getSubscriptionFilter().getGetServiceDetail().getServiceKey().addAll(keys);
+                } else if (alertCritera.equalsIgnoreCase("business")) {
+                    sub.getSubscriptionFilter().setGetBusinessDetail(new GetBusinessDetail());
+                    sub.getSubscriptionFilter().getGetBusinessDetail().getBusinessKey().addAll(keys);
+                } else if (alertCritera.equalsIgnoreCase("publisherAssertion")) {
+                    //unknow if this will work
+                    sub.getSubscriptionFilter().setGetAssertionStatusReport(new GetAssertionStatusReport());
+                    sub.getSubscriptionFilter().getGetAssertionStatusReport().setCompletionStatus(CompletionStatus.valueOf(((String[]) map.get("assertionStatus"))[0]));
+                } else if (alertCritera.equalsIgnoreCase("relatedBusiness")) {
+                    outmsg.set("relatedBusiness is not supported for single item subscriptions");
+                    return null;
+                } else if (alertCritera.equalsIgnoreCase("tmodel")) {
+                    sub.getSubscriptionFilter().setGetTModelDetail(new GetTModelDetail());
+                    sub.getSubscriptionFilter().getGetTModelDetail().getTModelKey().addAll(keys);
+                } else {
+                    outmsg.set("alert critera invalid");
+                    return null;
+                }
+            } else {
+                outmsg.set("alert critera not defined");
+                return null;
+            }
+            return sub;
+        } catch (Exception ex) {
+            UddiHub.log.warn(null, ex);
+            outmsg.set("error parsing");
             return null;
         }
-        sub.setSubscriptionFilter(new SubscriptionFilter());
+    }
 
-        if (alertCritera != null) {
-            if (alertCritera.equalsIgnoreCase("service")) {
-            } else if (alertCritera.equalsIgnoreCase("binding")) {
-                sub.getSubscriptionFilter().setGetBindingDetail(new GetBindingDetail());
-                sub.getSubscriptionFilter().getGetBindingDetail().getBindingKey().add(ItemKey);
-            } else if (alertCritera.equalsIgnoreCase("service")) {
-                sub.getSubscriptionFilter().setGetServiceDetail(new GetServiceDetail());
-                sub.getSubscriptionFilter().getGetServiceDetail().getServiceKey().add(ItemKey);
-            } else if (alertCritera.equalsIgnoreCase("business")) {
-                sub.getSubscriptionFilter().setGetBusinessDetail(new GetBusinessDetail());
-                sub.getSubscriptionFilter().getGetBusinessDetail().getBusinessKey().add(ItemKey);
-            } else if (alertCritera.equalsIgnoreCase("publisherAssertion")) {
-                //unknow if this will work
-                sub.getSubscriptionFilter().setGetAssertionStatusReport(new GetAssertionStatusReport());
-                sub.getSubscriptionFilter().getGetAssertionStatusReport();
-            } else if (alertCritera.equalsIgnoreCase("relatedBusiness")) {
-                outmsg.set("relatedBusiness is not supported for single item subscriptions");
-                return null;
-            } else if (alertCritera.equalsIgnoreCase("tmodel")) {
-                sub.getSubscriptionFilter().setGetTModelDetail(new GetTModelDetail());
-                sub.getSubscriptionFilter().getGetTModelDetail().getTModelKey().add(ItemKey);
+    private static Subscription BuildClientSubscriptionSearchResults(Map map, AtomicReference<String> outmsg) {
+        try {
+            Subscription sub = new Subscription();
+            String alertCritera = ((String[]) map.get("alertCriteraMultipleItem"))[0];
+
+            sub.setSubscriptionFilter(new SubscriptionFilter());
+            Name name = new Name();
+            name.setValue(((String[]) map.get("searchcontent"))[0]);
+            name.setLang(((String[]) map.get("searchlang"))[0]);
+            FindQualifiers fq = new FindQualifiers();
+            String[] fqs = (String[]) map.get("findqualifier");
+            if (fqs != null) {
+                for (int i = 0; i < fqs.length; i++) {
+                    fq.getFindQualifier().add(fqs[i]);
+                }
+            }
+            if (fq.getFindQualifier().isEmpty()) {
+                fq = null;
+            }
+            if (alertCritera != null) {
+                if (alertCritera.equalsIgnoreCase("binding")) {
+                    //sub.getSubscriptionFilter().setFindBinding(new FindBinding());
+                    //sub.getSubscriptionFilter().getFindBinding().
+                } else if (alertCritera.equalsIgnoreCase("service")) {
+                    sub.getSubscriptionFilter().setFindService(new FindService());
+                    sub.getSubscriptionFilter().getFindService().getName().add(name);
+                    sub.getSubscriptionFilter().getFindService().setFindQualifiers(fq);
+                } else if (alertCritera.equalsIgnoreCase("business")) {
+                    sub.getSubscriptionFilter().setFindBusiness(new FindBusiness());
+                    sub.getSubscriptionFilter().getFindBusiness().setFindQualifiers(fq);
+                    sub.getSubscriptionFilter().getFindBusiness().getName().add(name);
+                    //              sub.getSubscriptionFilter().getGetBusinessDetail().getBusinessKey().addAll(keys);
+                } else if (alertCritera.equalsIgnoreCase("publisherAssertion")) {
+                    //unknow if this will work
+                    sub.getSubscriptionFilter().setGetAssertionStatusReport(new GetAssertionStatusReport());
+                    sub.getSubscriptionFilter().getGetAssertionStatusReport().setCompletionStatus(CompletionStatus.valueOf(((String[]) map.get("assertionStatus"))[0]));
+                } else if (alertCritera.equalsIgnoreCase("relatedBusiness")) {
+                    sub.getSubscriptionFilter().setFindRelatedBusinesses(new FindRelatedBusinesses());
+                    sub.getSubscriptionFilter().getFindRelatedBusinesses().setFindQualifiers(fq);
+                    sub.getSubscriptionFilter().getFindRelatedBusinesses().setBusinessKey(((String[]) map.get("searchcontent"))[0]);
+                } else if (alertCritera.equalsIgnoreCase("tmodel")) {
+                    sub.getSubscriptionFilter().setFindTModel(new FindTModel());
+                    sub.getSubscriptionFilter().getFindTModel().setFindQualifiers(fq);
+                    sub.getSubscriptionFilter().getFindTModel().setName(name);
+                } else {
+                    outmsg.set("alert critera invalid");
+                    return null;
+                }
             } else {
-                outmsg.set("alert critera invalid");
+                outmsg.set("alert critera not defined");
                 return null;
             }
-        } else {
-            outmsg.set("alert critera not defined");
+            return sub;
+        } catch (Exception ex) {
+            UddiHub.log.warn(null, ex);
+            outmsg.set("error parsing");
             return null;
         }
-        return sub;
     }
 
-    private static Subscription BuildClientSubscriptionSearchResults(Map map) {
-        throw new UnsupportedOperationException("Not yet implemented");
+    private static Subscription BuildSubscriptionOptions(Map map, Subscription sub) {
+        if (sub == null) {
+            return null;
+        }
+        try {
+            sub.setBrief(Boolean.parseBoolean(((String[]) map.get("brief"))[0]));
+        } catch (Exception x) {
+            sub.setBrief(false);
+        }
+
+        try {
+            sub.setMaxEntities(Integer.parseInt(((String[]) map.get("maxRecords"))[0]));
+        } catch (Exception x) {
+            sub.setBrief(false);
+        }
+
+        try {
+            DatatypeFactory df = DatatypeFactory.newInstance();
+            DateFormat dformat = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss a");
+            Date parsed = dformat.parse(((String[]) map.get("expires"))[0]);
+
+            GregorianCalendar gcal = new GregorianCalendar();
+            gcal.setTime(parsed);
+            sub.setExpiresAfter(df.newXMLGregorianCalendar(gcal));
+        } catch (Exception ex) {
+            UddiHub.log.warn("Unexpected parsing error ", ex);
+        }
+
+
+        try {
+            DatatypeFactory df = DatatypeFactory.newInstance();
+            DateFormat dformat = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss a");
+            Date parsed = dformat.parse(((String[]) map.get("expires"))[0]);
+
+            GregorianCalendar gcal = new GregorianCalendar();
+            gcal.setTime(parsed);
+            sub.setExpiresAfter(df.newXMLGregorianCalendar(gcal));
+        } catch (Exception ex) {
+            UddiHub.log.warn("Unexpected parsing error ", ex);
+        }
+
+        try {
+            long durationInMilliSeconds = 0;
+            DatatypeFactory df = DatatypeFactory.newInstance();
+            String interval = ((String[]) map.get("interval"))[0];
+            String[] tokens = interval.split(":");
+            durationInMilliSeconds += Integer.parseInt(tokens[0]) * 60 * 60 * 1000;
+            durationInMilliSeconds += Integer.parseInt(tokens[1]) * 60 * 1000;
+            durationInMilliSeconds += Integer.parseInt(tokens[2]) * 1000;
+
+
+            sub.setNotificationInterval(df.newDuration(durationInMilliSeconds));
+
+        } catch (Exception ex) {
+            UddiHub.log.warn("Unexpected parsing error ", ex);
+        }
+
+
+        return sub;
     }
 }

Modified: juddi/branches/juddi-3.2.x/juddi-gui/src/java/org/apache/juddi/webconsole/hub/builders/Printers.java
URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.2.x/juddi-gui/src/java/org/apache/juddi/webconsole/hub/builders/Printers.java?rev=1478745&r1=1478744&r2=1478745&view=diff
==============================================================================
--- juddi/branches/juddi-3.2.x/juddi-gui/src/java/org/apache/juddi/webconsole/hub/builders/Printers.java (original)
+++ juddi/branches/juddi-3.2.x/juddi-gui/src/java/org/apache/juddi/webconsole/hub/builders/Printers.java Fri May  3 12:12:10 2013
@@ -316,6 +316,13 @@ public class Printers {
         return sb.toString();
     }
 
+    /**
+     * service list as html
+     * @param findService
+     * @param chooser
+     * @param session
+     * @return 
+     */
     public static String ServiceListAsHtml(ServiceList findService, boolean chooser, HttpSession session) {
         StringBuilder sb = new StringBuilder();
         sb.append("<table class=\"table\"><tr><th>");
@@ -341,10 +348,14 @@ public class Printers {
                     append("\" title=\"").
                     append(StringEscapeUtils.escapeHtml(findService.getServiceInfos().getServiceInfo().get(i).getServiceKey()))
                     .append("\">");
-            sb.append(Printers.ListNamesToString(findService.getServiceInfos().getServiceInfo().get(i).getName())).append("</a></td><td>");
+            sb.append(Printers.ListNamesToString(findService.getServiceInfos().getServiceInfo().get(i).getName())).append("<i class=\"icon-edit icon-large\"></i<</a></td><td>");
+           
             sb.append((findService.getServiceInfos().getServiceInfo().get(i).getServiceKey())).append("</td><td>");
+             sb.append("<a href=\"businessEditor2.jsp?id=")
+                    .append(StringEscapeUtils.escapeHtml((findService.getServiceInfos().getServiceInfo().get(i).getBusinessKey())))
+                    .append("\">");
             sb.append(StringEscapeUtils.escapeHtml((findService.getServiceInfos().getServiceInfo().get(i).getBusinessKey())))
-                    .append("</td></tr>");
+                    .append("<i class=\"icon-edit icon-large\"></i<</a></td></tr>");
         }
         sb.append("</table>");
         return sb.toString();

Modified: juddi/branches/juddi-3.2.x/juddi-gui/src/java/org/apache/juddi/webconsole/hub/builders/SubscriptionHelper.java
URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.2.x/juddi-gui/src/java/org/apache/juddi/webconsole/hub/builders/SubscriptionHelper.java?rev=1478745&r1=1478744&r2=1478745&view=diff
==============================================================================
--- juddi/branches/juddi-3.2.x/juddi-gui/src/java/org/apache/juddi/webconsole/hub/builders/SubscriptionHelper.java (original)
+++ juddi/branches/juddi-3.2.x/juddi-gui/src/java/org/apache/juddi/webconsole/hub/builders/SubscriptionHelper.java Fri May  3 12:12:10 2013
@@ -4,14 +4,66 @@
  */
 package org.apache.juddi.webconsole.hub.builders;
 
+import java.util.List;
+import org.apache.commons.lang.StringEscapeUtils;
 import org.uddi.sub_v3.Subscription;
 
 /**
+ * Provides some basic helper functions for the edit Subscription page
  *
  * @author Alex O'Ree
  */
 public class SubscriptionHelper {
 
+    public static String getItemKeySpecific(Subscription sub) {
+        if (sub == null) {
+            return "";
+        }
+        if (sub.getSubscriptionFilter() == null) {
+            return "";
+        }
+        if (sub.getSubscriptionFilter().getGetAssertionStatusReport() != null && sub.getSubscriptionFilter().getGetAssertionStatusReport().getCompletionStatus() != null) {
+            return sub.getSubscriptionFilter().getGetAssertionStatusReport().getCompletionStatus().toString();
+        }
+
+        if (sub.getSubscriptionFilter().getGetBindingDetail() != null) {
+            return ToHtmlOption(sub.getSubscriptionFilter().getGetBindingDetail().getBindingKey());
+        }
+
+        if (sub.getSubscriptionFilter().getGetBusinessDetail() != null) {
+            return ToHtmlOption(sub.getSubscriptionFilter().getGetBusinessDetail().getBusinessKey());
+        }
+
+        if (sub.getSubscriptionFilter().getGetServiceDetail() != null) {
+            return ToHtmlOption(sub.getSubscriptionFilter().getGetServiceDetail().getServiceKey());
+        }
+
+        if (sub.getSubscriptionFilter().getGetTModelDetail() != null) {
+            return ToHtmlOption(sub.getSubscriptionFilter().getGetTModelDetail().getTModelKey());
+        }
+        return "";
+    }
+
+    public static String ToHtmlOption(List<String> items) {
+        StringBuilder sb = new StringBuilder();
+        if (items == null || items.isEmpty()) {
+            return null;
+        }
+        for (int i = 0; i < items.size(); i++) {
+            if (items.get(i) == null) {
+                continue;
+            }
+            if (items.get(i).trim().isEmpty()) {
+                continue;
+            }
+            sb.append("<option value\"").append(StringEscapeUtils.escapeHtml(items.get(i).trim()))
+                    .append("\">")
+                    .append(StringEscapeUtils.escapeHtml(items.get(i)))
+                    .append("</option>");
+        }
+        return sb.toString();
+    }
+
     public static boolean isSpecificItem(Subscription sub) {
         if (sub == null) {
             throw new IllegalArgumentException();
@@ -25,4 +77,69 @@ public class SubscriptionHelper {
                 || sub.getSubscriptionFilter().getGetServiceDetail() != null
                 || sub.getSubscriptionFilter().getGetTModelDetail() != null);
     }
+
+    public static String isBindingSpecific(Subscription sub) {
+        if (sub == null) {
+            return "";
+        }
+        if (sub.getSubscriptionKey() == null) {
+            return "";
+        }
+        if (sub.getSubscriptionFilter().getGetBindingDetail() != null && !sub.getSubscriptionFilter().getGetBindingDetail().getBindingKey().isEmpty()) {
+            return " active ";
+        }
+        return "";
+    }
+
+    public static String isBusinessSpecific(Subscription sub) {
+        if (sub == null) {
+            return "";
+        }
+        if (sub.getSubscriptionKey() == null) {
+            return "";
+        }
+        if (sub.getSubscriptionFilter().getGetBusinessDetail() != null && !sub.getSubscriptionFilter().getGetBusinessDetail().getBusinessKey().isEmpty()) {
+            return " active ";
+        }
+        return "";
+    }
+
+    public static String isServiceSpecific(Subscription sub) {
+        if (sub == null) {
+            return "";
+        }
+        if (sub.getSubscriptionKey() == null) {
+            return "";
+        }
+        if (sub.getSubscriptionFilter().getGetServiceDetail() != null && !sub.getSubscriptionFilter().getGetServiceDetail().getServiceKey().isEmpty()) {
+            return " active ";
+        }
+        return "";
+    }
+
+    public static String isTModelSpecific(Subscription sub) {
+        if (sub == null) {
+            return "";
+        }
+        if (sub.getSubscriptionKey() == null) {
+            return "";
+        }
+        if (sub.getSubscriptionFilter().getGetTModelDetail() != null && !sub.getSubscriptionFilter().getGetTModelDetail().getTModelKey().isEmpty()) {
+            return " active ";
+        }
+        return "";
+    }
+
+    public static String isPublisherAssertionSpecific(Subscription sub) {
+        if (sub == null) {
+            return "";
+        }
+        if (sub.getSubscriptionKey() == null) {
+            return "";
+        }
+        if (sub.getSubscriptionFilter().getGetAssertionStatusReport() != null && sub.getSubscriptionFilter().getGetAssertionStatusReport().getCompletionStatus() != null) {
+            return " active ";
+        }
+        return "";
+    }
 }

Modified: juddi/branches/juddi-3.2.x/juddi-gui/src/java/org/apache/juddi/webconsole/resources/web.properties
URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.2.x/juddi-gui/src/java/org/apache/juddi/webconsole/resources/web.properties?rev=1478745&r1=1478744&r2=1478745&view=diff
==============================================================================
--- juddi/branches/juddi-3.2.x/juddi-gui/src/java/org/apache/juddi/webconsole/resources/web.properties (original)
+++ juddi/branches/juddi-3.2.x/juddi-gui/src/java/org/apache/juddi/webconsole/resources/web.properties Fri May  3 12:12:10 2013
@@ -287,3 +287,41 @@ pages.about.content=This website is part
 items.binding.chooser=Binding Chooser
 items.service.chooser=Service Chooser
 items.business.chooser=Business Chooser
+items.assertion.chooser=Publisher Assertion Status
+items.subscription.CompletionStatus.STATUS_COMPLETE=This means that there is a visible relationship between two businesses.
+items.subscription.CompletionStatus.STATUS_FROM_KEY_INCOMPLETE=This indicates that a business has has asserted a relationship with one of your businesses, but you have not reciprocated the relationship.
+items.subscription.CompletionStatus.STATUS_TO_KEY_INCOMPLETE=This indicates that the owner of the business has asserted a relationship with another business, but it has not be reciprocated.
+items.subscription.CompletionStatus.STATUS_BOTH_INCOMPLETE=This indicates that the publisher assertion embedded in the assertion Status Item has been deleted from both ends of the business relationship.
+pages.subscription.content=UDDI has a feature that allows you to be alerted of updates to either specific UDDI entries or to search results. This page will help you setup a subscription to meet your needs. Note: only one type of subscription filter can be defined per subscription. Normally, users can make as many subscriptions as they want, however it may be effectively limited by the registry implementation.
+pages.subscription.step1=Step 1 - What do you type of information to you want alerts on?
+pages.subscription.step2=Step 2 - Which items do you want alerts on?
+pages.subscription.step1.specific=Changes to a specific item
+pages.subscription.step1.search=Changes to search results, such as a new item
+items.publisherassertion.status=Publisher Assertion Status
+actions.add=Add
+actions.remove=Remove
+items.findqualifiers=Find Qualifiers
+pages.subscription.step3=Step 3 - How do want to receive the alerts?
+pages.subscription.step3.direct=Send me alerts directly
+pages.subscription.step3.direct.tooltip=Either via a UDDI Subscription Client API, Email or some other notifier
+pages.subscription.step3.pickup=I'll pick them up
+pages.subscription.step3.pickup.tooltip=Either via this website or from your own software that periodically checks for updates
+pages.subscription.step3.content=In order for a UDDI server to notify you of updates asynchronously, you first have to define a business, with a service, with a binding template that tells UDDI where to send the notification (Access Point value). Some UDDI servers (such as Apache jUDDI) require you to also add a tModel Instance defining the transport parameter, such as 
+pages.subscription.step4=Step 4 - Options
+items.notificationinterval=Notification Interval (hh:mm:ss)
+items.expiration=Expiration
+items.subscriptionbrief=Brief Subscription
+items.maxrecords.callback=Max records per callback
+navbar.subscriptions.feed.content=The news feed provides you a list of all updated content per your subscription settings
+pages.transfer.content=\ UDDI supports the transfer the ownership of Businesses (and all their child objects including services, binding templates) and tModel entities to another publisher. Publishers represent one or more logins or usernames.<br><Br>Transfers can occur within a UDDI registry node (intra-node) and between multiple registries nodes (inter-node). This utility will help you setup intra-node transfers only. No known UDDI implementations support inter-node transfers (replication API's are not implemented.<br><br>The process is straightforward, select what entities you want to transfer, then click OK. A token will be presented to you which then need to give to the other publisher. The other publisher then needs to accept the token and transfer the ownership to the publisher. Finally, the token is then destroyed to prevent any inadvertent transfers.<br>Transfers can be aborted (token invalidated) before the other publisher transfers the ownership over. Once it's be
 en transfered and you want to undo the transfer, contact the registry administrator and the other publisher.
+pages.transfer.createtoken=Create a new Token
+pages.transfer.discardtoken=Discard a transfer token (abort the transfer)
+pages.transfer.accepttransfer=Accept a Transfer
+actions.refresh=Refresh
+pages.transfer.gettoken=Get a Transfer Token
+items.token=Token
+actions.accept=Accept
+pages.transfer.createtoken.content=This tab will help you create a transfer token. Once you have created it, copy the entire contents of the token and give it to the person you're transfering ownership to.
+pages.transfer.discardtoken.content=Made a mistake? No problem. Enter the token below along with the keys to be transfered and it will be removed from the system, preventing any future transfer. It must match exactly. Note: both fields require XML content.
+pages.transfer.accepttransfer.content=If another UDDI publisher gave you a transfer token and you all agreed to transfer ownership of a business or tModel, it can be done here. Enter the transfer token. It must match exactly.
+actions.savethis=Copy and save this information to your computer. There's no way to retrieve this information again! 

Modified: juddi/branches/juddi-3.2.x/juddi-gui/src/java/org/apache/juddi/webconsole/resources/web_es.properties
URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.2.x/juddi-gui/src/java/org/apache/juddi/webconsole/resources/web_es.properties?rev=1478745&r1=1478744&r2=1478745&view=diff
==============================================================================
--- juddi/branches/juddi-3.2.x/juddi-gui/src/java/org/apache/juddi/webconsole/resources/web_es.properties (original)
+++ juddi/branches/juddi-3.2.x/juddi-gui/src/java/org/apache/juddi/webconsole/resources/web_es.properties Fri May  3 12:12:10 2013
@@ -175,7 +175,7 @@ pages.tmodelpart.title=tModel clave Gene
 pages.tmodelpart.content=Generadores TModel clave son un tipo especial de tModel que permite definir nuevas estructuras tModel con cualquier prefijo arbitrario tModel que desea. Por ejemplo, si usted quiere un tModel define como "uddi: www.mycompany.com:ServiceAuthenticationMethod", primero tendr\u00eda que crear un generador de claves tModel con el valor de "uddi: www.mycompany.com:keyGenerator". Esto es parte de la especificaci\u00f3n UDDI y act\u00faa como un mecanismo de gobernanza. Tambi\u00e9n puede crear un generador de claves tModel mediante la opci\u00f3n de men\u00fa tModel Creat y a\u00f1adiendo los valores adecuados.
 pages.tmodelpart.juddinote=Para implementaciones jUDDI de UDDI, la cuenta "root" no se puede utilizar para crear un keygenerator.
 pages.tmodelpart.key=El tModel UDDI clave
-pages.thmodepart.name=A name describing the key
+pages.thmodepart.name=Un nombre de describir la tecla
 pages.viewsubscriptions.content=UDDI ofrece la posibilidad a los usuarios a suscribirse para la notificaci\u00f3n de los cambios en la mayor\u00eda de las entidades en un registro UDDI. Sin embargo, la parte de notificaci\u00f3n es un poco extra\u00f1o. Los usuarios de los estrictos UDDIv3 registros tienen una sola opci\u00f3n, sondean peri\u00f3dicamente el registro UDDI para los cambios a trav\u00e9s de la API de Suscripci\u00f3n. Aunque hay tipos de datos definidos en la especificaci\u00f3n UDDI v3, no hay m\u00e9todo de la API para la creaci\u00f3n de un estilo de devoluci\u00f3n de llamada de suscripci\u00f3n, donde el usuario recibe un registro de servicios web que espera para las notificaciones. En una suscripci\u00f3n de devoluci\u00f3n de llamada, los que necesitan la informaci\u00f3n se notificar\u00e1 de inmediato. <br> <br> Registros basados \u200b\u200bjUDDI tener una extensi\u00f3n de la especificaci\u00f3n UDDIv3 que permite llamar de nuevo tipo de comunicaci\
 u00f3n y por lo tanto mecanismo preferido.
 pages.serviceeditor.title=Servicio Editor
 errors.generic=Error
@@ -288,3 +288,41 @@ pages.about.content=Este sitio es parte 
 items.binding.chooser=Binding Selector
 items.service.chooser=Servicio de Selector
 items.business.chooser=Negocio Selector
+items.assertion.chooser=Editorial Status Aserci\u00f3n
+items.subscription.CompletionStatus.STATUS_COMPLETE=Esto significa que existe una relaci\u00f3n visible entre dos empresas.
+items.subscription.CompletionStatus.STATUS_FROM_KEY_INCOMPLETE=Esto indica que un negocio se ha sostenido una relaci\u00f3n con una de sus empresas, pero no ha correspondido a la relaci\u00f3n.
+items.subscription.CompletionStatus.STATUS_TO_KEY_INCOMPLETE=Esto indica que el propietario de la empresa ha afirmado una relaci\u00f3n con otra empresa, pero no se ha correspondido.
+items.subscription.CompletionStatus.STATUS_BOTH_INCOMPLETE=Esto indica que la afirmaci\u00f3n editor incrustado en el Estado afirmaci\u00f3n art\u00edculo ha sido borrado de ambos extremos de la relaci\u00f3n de negocios.
+pages.subscription.content=UDDI tiene una caracter\u00edstica que le permite ser alertado de cambios a cualquiera de las entradas espec\u00edficas UDDI o para los resultados de b\u00fasqueda. Esta p\u00e1gina le ayudar\u00e1 a configurar una suscripci\u00f3n para satisfacer sus necesidades. Nota: s\u00f3lo un tipo de filtro de suscripci\u00f3n puede ser definido por suscripci\u00f3n. Normalmente, los usuarios pueden hacer tantas suscripciones como quieren, sin embargo, puede ser efectivamente limitado por la aplicaci\u00f3n de registro.
+pages.subscription.step1=Paso 1 - \u00bfQu\u00e9 tipo de informaci\u00f3n que desea recibir alertas sobre?
+pages.subscription.step2=Paso 2 - \u00bfA qu\u00e9 elementos desea que las alertas en?
+pages.subscription.step1.specific=Los cambios en un elemento espec\u00edfico
+pages.subscription.step1.search=Los cambios en los resultados de b\u00fasqueda, tales como un nuevo elemento
+items.publisherassertion.status=Editorial Status aserci\u00f3n
+actions.add=A\u00f1adir
+actions.remove=Eliminar
+items.findqualifiers=Encontrar Calificadores
+pages.subscription.step3=Paso 3 - \u00bfC\u00f3mo desea recibir las alertas?
+pages.subscription.step3.direct=Recibir avisos directamente
+pages.subscription.step3.direct.tooltip=O a trav\u00e9s de una suscripci\u00f3n de cliente API UDDI, correo electr\u00f3nico o cualquier otro notificador
+pages.subscription.step3.pickup=Yo recoger\u00e9
+pages.subscription.step3.pickup.tooltip=O a trav\u00e9s de este sitio web o de su propio software que comprueba peri\u00f3dicamente si hay actualizaciones
+pages.subscription.step3.content=Para que un servidor UDDI para notificarle de cambios de forma as\u00edncrona, primero hay que definir un negocio con una empresa, con una plantilla de enlace que dice UDDI donde enviar la notificaci\u00f3n (valor del punto de acceso). Algunos servidores UDDI (como Apache jUDDI) requieren que usted agregue tambi\u00e9n una instancia tModel definir el par\u00e1metro de transporte, tales como
+pages.subscription.step4=Paso 4 - Opciones
+items.notificationinterval=Notificaci\u00f3n Intervalo (hh: mm: ss)
+items.expiration=Vencimiento
+items.subscriptionbrief=Breve Suscripci\u00f3n
+items.maxrecords.callback=Registros m\u00e1ximos por devoluci\u00f3n de llamada
+navbar.subscriptions.feed.content=El servicio de noticias que proporciona una lista de todo el contenido actualizado por la configuraci\u00f3n de suscripci\u00f3n
+pages.transfer.content=UDDI soporta la transferencia de la propiedad de las empresas (y todos sus objetos secundarios, incluidos los servicios, las plantillas de uni\u00f3n) y entidades tModel a otro editor. Editores representan una o m\u00e1s conexiones o nombres de usuario. <br> Transferencias <Br> pueden ocurrir dentro de un nodo de registro UDDI (intra-nodo) y entre varios nodos de registros (entre nodos). Esta utilidad le ayudar\u00e1 a configurar las transferencias intra-nodo \u00fanico. No se conocen las implementaciones UDDI soportan transferencias entre nodos (API de replicaci\u00f3n no se implementan. <br> El proceso es sencillo, seleccionar qu\u00e9 entidades que desea transferir y haga clic en Aceptar. Una muestra se presentar\u00e1 para que luego tenga que dar al otro editor. el otro editor debe entonces aceptar el token y transferir la propiedad a \u00e9l. Finalmente, el token se destruye para evitar cualquier transferencia involuntaria. <br> transferencias pue
 den ser abortados (token invalide) antes de que el otro editor transfiere la propiedad de. Una vez que se ha trasladado y desea deshacer la transferencia, p\u00f3ngase en contacto con el administrador del registro y el otro editor.
+pages.transfer.createtoken=Crear un nuevo Token
+pages.transfer.discardtoken=Descartar un token de transferencia (abortar la transferencia)
+pages.transfer.accepttransfer=Aceptar una transferencia
+actions.refresh=Refrescar
+pages.transfer.gettoken=Obtener un token de transferencia
+items.token=Token
+actions.accept=Accept
+pages.transfer.createtoken.content=Esta ficha le ayudar\u00e1 a crear un token de transferencia. Una vez que haya creado, copiar todo el contenido de la ficha y d\u00e1rselo a la persona que est\u00e1 transfiriendo la propiedad a.
+pages.transfer.discardtoken.content=Cometido un error? No hay problema. Introduzca el token a continuaci\u00f3n junto con las claves para ser transferidos y se elimina del sistema, impedir cualquier transferencia de futuro. Debe coincidir exactamente. Nota: los campos requieren contenido XML.
+pages.transfer.accepttransfer.content=Si otro editor UDDI le dio un token de transferencia y todos ustedes se comprometi\u00f3 a transferir la propiedad de un negocio o tModel, se puede hacer aqu\u00ed. Introduzca el token de transferencia. Debe coincidir exactamente.
+actions.savethis=Copie y guarde esta informaci\u00f3n a su ordenador. No hay manera de recuperar esta informaci\u00f3n de nuevo!

Modified: juddi/branches/juddi-3.2.x/juddi-gui/web/ajax/businessAsSelect.jsp
URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.2.x/juddi-gui/web/ajax/businessAsSelect.jsp?rev=1478745&r1=1478744&r2=1478745&view=diff
==============================================================================
--- juddi/branches/juddi-3.2.x/juddi-gui/web/ajax/businessAsSelect.jsp (original)
+++ juddi/branches/juddi-3.2.x/juddi-gui/web/ajax/businessAsSelect.jsp Fri May  3 12:12:10 2013
@@ -1,5 +1,5 @@
 <%-- 
-    Document   : businessAsSelect
+    Document   : businessAsSelect This actually returns a list of all businesses and/or tmodel keys owned by the current user
     Created on : Apr 27, 2013, 10:05:21 AM
     Author     : Alex O'Ree
 --%>
@@ -11,16 +11,6 @@
 <%
     UddiHub x = UddiHub.getInstance(application, session);
 
-    String lang = request.getParameter("lang");
-    if (lang == null || lang.length() == 0) {
-        lang = null;
-    }
-    if (lang != null && lang.equalsIgnoreCase(ResourceLoader.GetResource(session, "items.clicktoedit"))) {
-        lang = null;
-    }
-  
-   
-
-    out.write(x.GetMyTransferableKeys(true,true));
+    out.write(x.GetMyTransferableKeys(true, true));
 
 %>
\ No newline at end of file

Modified: juddi/branches/juddi-3.2.x/juddi-gui/web/ajax/businesssearch.jsp
URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.2.x/juddi-gui/web/ajax/businesssearch.jsp?rev=1478745&r1=1478744&r2=1478745&view=diff
==============================================================================
--- juddi/branches/juddi-3.2.x/juddi-gui/web/ajax/businesssearch.jsp (original)
+++ juddi/branches/juddi-3.2.x/juddi-gui/web/ajax/businesssearch.jsp Fri May  3 12:12:10 2013
@@ -55,9 +55,9 @@
     out.write(ret.renderedHtml);
 %>
 <script type="text/javascript">
-    totalrecords=<%=ret.totalrecords%>;
-    $("#totalrecords").text(totalrecords);
-    $("#offset").text(<%=offset%>);
-    $("#displayreco rds").text (<%=ret.displaycount%>);
+    totalrecordsBusiness=<%=ret.totalrecords%>;
+    $("#totalrecordsBusiness").text(totalrecordsBusiness);
+    $("#offsetBusiness").text(<%=offset%>);
+    $("#displayrecordsBusiness").text (<%=ret.displaycount%>);
     refresh();
 </script>
\ No newline at end of file

Modified: juddi/branches/juddi-3.2.x/juddi-gui/web/ajax/getTransferToken.jsp
URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.2.x/juddi-gui/web/ajax/getTransferToken.jsp?rev=1478745&r1=1478744&r2=1478745&view=diff
==============================================================================
--- juddi/branches/juddi-3.2.x/juddi-gui/web/ajax/getTransferToken.jsp (original)
+++ juddi/branches/juddi-3.2.x/juddi-gui/web/ajax/getTransferToken.jsp Fri May  3 12:12:10 2013
@@ -53,6 +53,7 @@
             String msg = x.GetCustodyTransferToken(keys, transferTo, outXcal, outToken);
             if (msg != null) {
                 out.write(msg);
+                response.setStatus(400);
             } else {
                 TransferToken tt = new TransferToken();
                 tt.setExpirationTime(outXcal.value);
@@ -60,16 +61,19 @@
                 tt.setOpaqueToken(outToken.value);
                 try {
                     StringWriter sw = new StringWriter();
-                    sw.write(ResourceLoader.GetResource(session, "items.transfertoken") + ": ");
+//BREAK is replaced via javascript in a popup
+                    sw.write(ResourceLoader.GetResource(session, "actions.savethis") + "  BREAK  ");
+                    sw.write(ResourceLoader.GetResource(session, "items.transfertoken") + ": BREAK ");
                     JAXB.marshal(tt, sw);
-                    
 
-                    sw.write(ResourceLoader.GetResource(session, "items.transferkeys") + ": ");
+
+                    sw.write(" BREAK BREAK" + ResourceLoader.GetResource(session, "items.transferkeys") + ": BREAK ");
                     JAXB.marshal(keys, sw);
                     out.write(sw.toString());
 
 
                 } catch (Exception ex) {
+                    response.setStatus(400);
                     out.write(ex.getMessage());
                 }
 

Modified: juddi/branches/juddi-3.2.x/juddi-gui/web/ajax/servicesearch.jsp
URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.2.x/juddi-gui/web/ajax/servicesearch.jsp?rev=1478745&r1=1478744&r2=1478745&view=diff
==============================================================================
--- juddi/branches/juddi-3.2.x/juddi-gui/web/ajax/servicesearch.jsp (original)
+++ juddi/branches/juddi-3.2.x/juddi-gui/web/ajax/servicesearch.jsp Fri May  3 12:12:10 2013
@@ -53,9 +53,9 @@
 
 %>
 <script type="text/javascript">
-    totalrecords=<%=ret.totalrecords%>;
-    $("#totalrecords").text(totalrecords);
-    $("#offset").text(<%=offset%>);
-    $("#displayrecords").text (<%=ret.displaycount%>);
+    totalrecordsService=<%=ret.totalrecords%>;
+    $("#totalrecordsService").text(totalrecordsService);
+    $("#offsetService").text(<%=offset%>);
+    $("#displayrecordsService").text (<%=ret.displaycount%>);
     refresh();
 </script>
\ No newline at end of file

Modified: juddi/branches/juddi-3.2.x/juddi-gui/web/ajax/subscription.jsp
URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.2.x/juddi-gui/web/ajax/subscription.jsp?rev=1478745&r1=1478744&r2=1478745&view=diff
==============================================================================
--- juddi/branches/juddi-3.2.x/juddi-gui/web/ajax/subscription.jsp (original)
+++ juddi/branches/juddi-3.2.x/juddi-gui/web/ajax/subscription.jsp Fri May  3 12:12:10 2013
@@ -9,15 +9,20 @@
 <%@page import="org.uddi.sub_v3.Subscription"%>
 <%@page import="org.apache.juddi.webconsole.hub.UddiHub"%>
 <%@page contentType="text/html" pageEncoding="UTF-8"%>
+<jsp:include page="../csrf.jsp"></jsp:include>
 <%
     if (request.getMethod().equalsIgnoreCase("POST")) {
         UddiHub x = UddiHub.getInstance(application, session);
-        AtomicReference<String> outmsg = new AtomicReference<String>();
-        Subscription sub = Builders.BuildClientSubscription(request.getParameterMap(), outmsg);
-        if (sub == null) {
-            out.write(outmsg.get());
+        if (request.getParameter("DELETE") != null) {
+          out.write( x.RemoveSubscription(request.getParameter("DELETE")));
         } else {
-            out.write(x.AddSubscription(sub));
+            AtomicReference<String> outmsg = new AtomicReference<String>();
+            Subscription sub = Builders.BuildClientSubscription(request.getParameterMap(), outmsg, session);
+            if (sub == null) {
+                out.write(outmsg.get());
+            } else {
+                out.write(x.AddSubscription(sub));
+            }
         }
     } else {
         response.setStatus(500);

Modified: juddi/branches/juddi-3.2.x/juddi-gui/web/ajax/subscriptionFeed.jsp
URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.2.x/juddi-gui/web/ajax/subscriptionFeed.jsp?rev=1478745&r1=1478744&r2=1478745&view=diff
==============================================================================
--- juddi/branches/juddi-3.2.x/juddi-gui/web/ajax/subscriptionFeed.jsp (original)
+++ juddi/branches/juddi-3.2.x/juddi-gui/web/ajax/subscriptionFeed.jsp Fri May  3 12:12:10 2013
@@ -16,6 +16,7 @@
     DatatypeFactory df = DatatypeFactory.newInstance();
     GregorianCalendar gcal = new GregorianCalendar();
     gcal.setTimeInMillis(System.currentTimeMillis());
+    //TODO get/set cookie data
     gcal.add(Calendar.DATE, -1);
     XMLGregorianCalendar xcal = df.newXMLGregorianCalendar(gcal);
     out.write(x.GetNewsFeed(xcal));

Modified: juddi/branches/juddi-3.2.x/juddi-gui/web/ajax/toXML.jsp
URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.2.x/juddi-gui/web/ajax/toXML.jsp?rev=1478745&r1=1478744&r2=1478745&view=diff
==============================================================================
--- juddi/branches/juddi-3.2.x/juddi-gui/web/ajax/toXML.jsp (original)
+++ juddi/branches/juddi-3.2.x/juddi-gui/web/ajax/toXML.jsp Fri May  3 12:12:10 2013
@@ -20,6 +20,9 @@
         } else if (type.equalsIgnoreCase("tModel")) {
             j = x.GettModelDetailsAsObject(id);
         }
+        else if (type.equalsIgnoreCase("subscription")) {
+            j = x.GetSubscriptionDetails(id);
+        }
         if (j != null) {
             JAXB.marshal(j, out);
          //   out.write(JAXBMarshaller.marshallToString(j, JAXBMarshaller.PACKAGE_UDDIAPI));



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