juddi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexo...@apache.org
Subject svn commit: r1558290 - in /juddi/trunk: juddi-client/src/main/java/org/apache/juddi/v3/client/config/ juddi-examples/more-uddi-samples/src/main/java/org/apache/juddi/samples/ juddi-gui/src/main/webapp/user/
Date Wed, 15 Jan 2014 03:49:45 GMT
Author: alexoree
Date: Wed Jan 15 03:49:44 2014
New Revision: 1558290

URL: http://svn.apache.org/r1558290
Log:
JUDDI-775 adding example banners/warnings, ones for the cloud instance
JUDDI-717 updating javadoc, deprecating an unused function, removing a sample that is now
OBE

Added:
    juddi/trunk/juddi-gui/src/main/webapp/user/demo.jsp
      - copied, changed from r1558239, juddi/trunk/juddi-gui/src/main/webapp/user/banner.jsp
    juddi/trunk/juddi-gui/src/main/webapp/user/warningbanner.jsp
      - copied, changed from r1558239, juddi/trunk/juddi-gui/src/main/webapp/user/banner.jsp
Removed:
    juddi/trunk/juddi-examples/more-uddi-samples/src/main/java/org/apache/juddi/samples/UddiSubscribeGet.java
Modified:
    juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/config/ClientConfig.java
    juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/config/UDDIClerk.java
    juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/config/UDDIClient.java
    juddi/trunk/juddi-examples/more-uddi-samples/src/main/java/org/apache/juddi/samples/UddiSubscribeValidate.java

Modified: juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/config/ClientConfig.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/config/ClientConfig.java?rev=1558290&r1=1558289&r2=1558290&view=diff
==============================================================================
--- juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/config/ClientConfig.java
(original)
+++ juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/config/ClientConfig.java
Wed Jan 15 03:49:44 2014
@@ -349,10 +349,12 @@ public class ClientConfig 
             return clientName;
         }
         
+        @Deprecated
         public String getClientCallbackUrl() {
         	return clientCallbackUrl;
         }
 
+        
         public String getConfigurationFile() {
             return configurationFile;
         }

Modified: juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/config/UDDIClerk.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/config/UDDIClerk.java?rev=1558290&r1=1558289&r2=1558290&view=diff
==============================================================================
--- juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/config/UDDIClerk.java
(original)
+++ juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/config/UDDIClerk.java
Wed Jan 15 03:49:44 2014
@@ -1189,6 +1189,21 @@ public class UDDIClerk implements Serial
          * <br>
          * Notice: never log auth tokens! Treat it like a password
          *
+         * Calls 
+         * @return  getAuthToken(getUDDINode().getSecurityUrl());
+         * @throws TransportException
+         * @throws DispositionReportFaultMessage
+         * @throws RemoteException
+         * @since 3.2
+         */
+        public String getAuthToken() throws TransportException, DispositionReportFaultMessage,
RemoteException {
+                return getAuthToken(getUDDINode().getSecurityUrl());
+        }
+        /**
+         * Gets an auth token from the uddi server using the uddi auth token
+         * <br>
+         * Notice: never log auth tokens! Treat it like a password
+         *
          * notes: changed to public to have access from the subscription
          * callback API 8/20/2013 AO
          *

Modified: juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/config/UDDIClient.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/config/UDDIClient.java?rev=1558290&r1=1558289&r2=1558290&view=diff
==============================================================================
--- juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/config/UDDIClient.java
(original)
+++ juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/config/UDDIClient.java
Wed Jan 15 03:49:44 2014
@@ -352,7 +352,13 @@ public class UDDIClient {
     public String getName() {
         return clientConfig.getClientName();
     }
-    
+    /**
+     * maps to config file
+     * client[@callbackUrl]
+     * Not currently used
+     * @return 
+     */
+    @Deprecated
     public String getClientCallbackUrl() {
         return clientConfig.getClientCallbackUrl();
     }

Modified: juddi/trunk/juddi-examples/more-uddi-samples/src/main/java/org/apache/juddi/samples/UddiSubscribeValidate.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-examples/more-uddi-samples/src/main/java/org/apache/juddi/samples/UddiSubscribeValidate.java?rev=1558290&r1=1558289&r2=1558290&view=diff
==============================================================================
--- juddi/trunk/juddi-examples/more-uddi-samples/src/main/java/org/apache/juddi/samples/UddiSubscribeValidate.java
(original)
+++ juddi/trunk/juddi-examples/more-uddi-samples/src/main/java/org/apache/juddi/samples/UddiSubscribeValidate.java
Wed Jan 15 03:49:44 2014
@@ -21,7 +21,6 @@ import java.util.GregorianCalendar;
 import javax.xml.datatype.DatatypeFactory;
 import javax.xml.datatype.XMLGregorianCalendar;
 import org.apache.juddi.v3.client.config.UDDIClient;
-import org.apache.juddi.v3.client.config.UDDIClientContainer;
 import org.apache.juddi.v3.client.transport.Transport;
 import org.apache.juddi.v3_service.JUDDIApiPortType;
 import org.uddi.api_v3.*;
@@ -42,71 +41,83 @@ import org.uddi.v3_service.UDDISubscript
  */
 public class UddiSubscribeValidate {
 
-    private static UDDISecurityPortType security = null;
-    private static JUDDIApiPortType juddiApi = null;
-    private static UDDIPublicationPortType publish = null;
-    private static UDDIInquiryPortType uddiInquiryService = null;
-    private static UDDISubscriptionPortType uddiSubscriptionService = null;
-    private static UDDISubscriptionListenerPortType uddiSubscriptionListenerService = null;
-
-    public UddiSubscribeValidate() {
-        try {
-            // create a manager and read the config in the archive; 
-            // you can use your config file name
-            UDDIClient clerkManager = new UDDIClient("META-INF/simple-publish-uddi.xml");
-            Transport transport = clerkManager.getTransport();
-            // Now you create a reference to the UDDI API
-            security = transport.getUDDISecurityService();
-            juddiApi = transport.getJUDDIApiService();
-            publish = transport.getUDDIPublishService();
-            uddiInquiryService = transport.getUDDIInquiryService();
-            uddiSubscriptionService = transport.getUDDISubscriptionService();
-            uddiSubscriptionListenerService = transport.getUDDISubscriptionListenerService();
-        } catch (Exception e) {
-            e.printStackTrace();
+        private static UDDISecurityPortType security = null;
+        private static JUDDIApiPortType juddiApi = null;
+        private static UDDIPublicationPortType publish = null;
+        private static UDDIInquiryPortType uddiInquiryService = null;
+        private static UDDISubscriptionPortType uddiSubscriptionService = null;
+        private static UDDISubscriptionListenerPortType uddiSubscriptionListenerService =
null;
+
+        public UddiSubscribeValidate() {
+                try {
+                        // create a manager and read the config in the archive; 
+                        // you can use your config file name
+                        UDDIClient clerkManager = new UDDIClient("META-INF/simple-publish-uddi.xml");
+                        Transport transport = clerkManager.getTransport();
+                        // Now you create a reference to the UDDI API
+                        security = transport.getUDDISecurityService();
+                        juddiApi = transport.getJUDDIApiService();
+                        publish = transport.getUDDIPublishService();
+                        uddiInquiryService = transport.getUDDIInquiryService();
+                        uddiSubscriptionService = transport.getUDDISubscriptionService();
+                        uddiSubscriptionListenerService = transport.getUDDISubscriptionListenerService();
+                } catch (Exception e) {
+                        e.printStackTrace();
+                }
         }
-    }
 
-    private void publish() {
-        try {
-            // Setting up the values to get an authentication token for the 'root' user ('root'
user has admin privileges
-            // and can save other publishers).
-            GetAuthToken getAuthTokenRoot = new GetAuthToken();
-            getAuthTokenRoot.setUserID("root");
-            getAuthTokenRoot.setCred("root");
-
-            // Making API call that retrieves the authentication token for the 'root' user.
-            AuthToken rootAuthToken = security.getAuthToken(getAuthTokenRoot);
-            System.out.println("root AUTHTOKEN = " + rootAuthToken.getAuthInfo());
-
-            DatatypeFactory df = DatatypeFactory.newInstance();
-            GregorianCalendar gcal = new GregorianCalendar();
-            gcal.setTimeInMillis(System.currentTimeMillis());
-            XMLGregorianCalendar xcal = df.newXMLGregorianCalendar(gcal);
-            for (int i = 0; i < 1; i++) {
-                //
-                GetSubscriptionResults req = new GetSubscriptionResults();
-                req.setAuthInfo(rootAuthToken.getAuthInfo());
-                //TODO insert your subscription key values here
-                req.setSubscriptionKey("uddi:juddi.apache.org:72619170-d391-41cb-99a0-238cb0b76eb9");
-                req.setCoveragePeriod(new CoveragePeriod());
-                req.getCoveragePeriod().setEndPoint(xcal);
-
-
-                gcal = new GregorianCalendar();
-                //Time range that we want change logs on
-                gcal.add(Calendar.MONTH, -1);
-                req.getCoveragePeriod().setStartPoint(df.newXMLGregorianCalendar(gcal));
-                SubscriptionResultsList subscriptionResults = uddiSubscriptionService.getSubscriptionResults(req);
-                System.out.println("items modified: " + subscriptionResults.getBusinessDetail().getBusinessEntity().size());
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
+        /**
+         * gets subscription results synchronously
+         *
+         * @param authtoken
+         * @param key
+         */
+        public void go(String authtoken, String key) {
+                if (key == null) {
+                        System.out.println("No key was specified!");
+                        return;
+                }
+                try {
+
+                        // Setting up the values to get an authentication token for the 'root'
user ('root' user has admin privileges
+                        // and can save other publishers).
+                        if (authtoken == null) {
+                                GetAuthToken getAuthTokenRoot = new GetAuthToken();
+                                getAuthTokenRoot.setUserID("root");
+                                getAuthTokenRoot.setCred("root");
+
+                                // Making API call that retrieves the authentication token
for the 'root' user.
+                                AuthToken rootAuthToken = security.getAuthToken(getAuthTokenRoot);
+                                System.out.println("root AUTHTOKEN = " + "don't log 'em");
+                                authtoken = rootAuthToken.getAuthInfo();
+                        }
+                        DatatypeFactory df = DatatypeFactory.newInstance();
+                        GregorianCalendar gcal = new GregorianCalendar();
+                        gcal.setTimeInMillis(System.currentTimeMillis());
+                        XMLGregorianCalendar xcal = df.newXMLGregorianCalendar(gcal);
+
+                        //
+                        GetSubscriptionResults req = new GetSubscriptionResults();
+                        req.setAuthInfo(authtoken);
+                        //TODO insert your subscription key values here
+                        req.setSubscriptionKey(key);
+                        req.setCoveragePeriod(new CoveragePeriod());
+                        req.getCoveragePeriod().setEndPoint(xcal);
+
+                        gcal = new GregorianCalendar();
+                        //Time range that we want change logs on
+                        gcal.add(Calendar.MONTH, -1);
+                        req.getCoveragePeriod().setStartPoint(df.newXMLGregorianCalendar(gcal));
+                        SubscriptionResultsList subscriptionResults = uddiSubscriptionService.getSubscriptionResults(req);
+                        System.out.println("items modified: " + subscriptionResults.getBusinessDetail().getBusinessEntity().size());
+
+                } catch (Exception e) {
+                        e.printStackTrace();
+                }
         }
-    }
 
-    public static void main(String args[]) {
-        UddiSubscribeValidate sp = new UddiSubscribeValidate();
-        sp.publish();
-    }
+        public static void main(String args[]) {
+                UddiSubscribeValidate sp = new UddiSubscribeValidate();
+                sp.go(null, null);
+        }
 }

Copied: juddi/trunk/juddi-gui/src/main/webapp/user/demo.jsp (from r1558239, juddi/trunk/juddi-gui/src/main/webapp/user/banner.jsp)
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-gui/src/main/webapp/user/demo.jsp?p2=juddi/trunk/juddi-gui/src/main/webapp/user/demo.jsp&p1=juddi/trunk/juddi-gui/src/main/webapp/user/banner.jsp&r1=1558239&r2=1558290&rev=1558290&view=diff
==============================================================================
--- juddi/trunk/juddi-gui/src/main/webapp/user/banner.jsp (original)
+++ juddi/trunk/juddi-gui/src/main/webapp/user/demo.jsp Wed Jan 15 03:49:44 2014
@@ -1,16 +1,75 @@
 <%-- 
-    Document   : banner
-    Created on : Nov 5, 2013, 6:08:15 PM
+    Document   : demp
+    Created on : Jan 14, 2014, 6:08:15 PM
     Author     : Alex O'Ree
 
-Hello World!
+This is used for the jUDDI demo instance
 
-If you want to really customize your juddi-gui instance, feel free to edit this file.
-You can use it to append html, javascript or whatever else you want onto every visible
-page of the juddi-gui. 
-
-Often companies and government agencies need to insert banners, warnings or 
-classification information on their web sites. This can be used to insert it
-painlessly. enjoy
 --%>
 
+<%@page import="org.apache.juddi.webconsole.resources.ResourceLoader"%>
+<div class="modal hide fade container " id="banner">
+        <div class="modal-header">
+                <a href="javascript:$('#banner').modal('hide');" class="close" data-dismiss="modal"
aria-hidden="true">&times;</a>
+                <h3>Welcome</h3>
+        </div>
+        <div class="modal-body" align="center">
+		
+                <i class="icon-thumbs-up icon-4x"></i><br>
+                Hi there! Thank's for checking out jUDDI's cloud instance. You are free to
do whatever you want here.<br>
+				
+				<br>
+				<i class="icon-warning-sign icon-4x"></i><br>
+                As such, do not rely on any information provided here. It's probably all
made up by people just like you.<br><br>
+                In order to create, update or delete content, you'll need to <b>sign
in</b>. Just make up a username and stick with it. Passwords are not validated.<br><br>
+                If you run into a problem, please file a <a href="http://juddi.apache.org/issue-tracking.html"
target="_newtab">bug report</a> so that we can fix it.
+
+
+
+        </div>
+        <div class="modal-footer">
+                <a href="javascript:$('#banner').modal('hide');" class="btn btn-primary"
data-dismiss="modal"><%=ResourceLoader.GetResource(session, "modal.close")%></a>
+        </div>
+</div>
+
+<script type="text/javascript">
+        function setCookieBanner(cname, cvalue, exdays)
+        {
+                var d = new Date();
+                d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
+                var expires = "expires=" + d.toGMTString();
+                document.cookie = cname + "=" + cvalue + "; " + expires;
+        }
+        function getCookieBanner(cname)
+        {
+                var name = cname + "=";
+                var ca = document.cookie.split(';');
+                for (var i = 0; i < ca.length; i++)
+                {
+                        var c = ca[i].trim();
+                        if (c.indexOf(name) == 0)
+                                return c.substring(name.length, c.length);
+                }
+                return "";
+        }
+        function checkCookieBanner()
+        {
+                var username = getCookieBanner("bannerseen");
+                if (username != "")
+                {
+                        //alert("Welcome again " + username);
+                }
+                else
+                {
+                        $('#banner').modal();
+
+                        setCookieBanner("username", username, 365);
+
+                }
+        }
+
+        $(document).ready(function() {
+                checkCookieBanner();
+        });
+        
+</script>
\ No newline at end of file

Copied: juddi/trunk/juddi-gui/src/main/webapp/user/warningbanner.jsp (from r1558239, juddi/trunk/juddi-gui/src/main/webapp/user/banner.jsp)
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-gui/src/main/webapp/user/warningbanner.jsp?p2=juddi/trunk/juddi-gui/src/main/webapp/user/warningbanner.jsp&p1=juddi/trunk/juddi-gui/src/main/webapp/user/banner.jsp&r1=1558239&r2=1558290&rev=1558290&view=diff
==============================================================================
--- juddi/trunk/juddi-gui/src/main/webapp/user/banner.jsp (original)
+++ juddi/trunk/juddi-gui/src/main/webapp/user/warningbanner.jsp Wed Jan 15 03:49:44 2014
@@ -1,16 +1,13 @@
 <%-- 
     Document   : banner
-    Created on : Nov 5, 2013, 6:08:15 PM
+    Created on : Jan 14 2014, 6:08:15 PM
     Author     : Alex O'Ree
 
-Hello World!
-
-If you want to really customize your juddi-gui instance, feel free to edit this file.
-You can use it to append html, javascript or whatever else you want onto every visible
-page of the juddi-gui. 
-
-Often companies and government agencies need to insert banners, warnings or 
-classification information on their web sites. This can be used to insert it
-painlessly. enjoy
+Here's an example of an always on top banner, similiar to what's used by government agencys
 --%>
 
+<div style="top:0px; background-color: lime; background-image: none; position: fixed;
left:50%; z-index: 9000; padding-left: 5px; padding-right:5px">
+Your Banner or Disclaimer goes here</div>
+
+<div style="bottom:0px; background-color: lime; background-image: none; position: fixed;
left:50%; z-index: 9000; padding-left: 5px; padding-right:5px">
+Your Banner or Disclaimer goes here</div>
\ No newline at end of file



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


Mime
View raw message