juddi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexo...@apache.org
Subject juddi git commit: JUDDI-907 adding basic ui components for entity history retrieval, fixing a test case
Date Fri, 09 Jan 2015 01:38:35 GMT
Repository: juddi
Updated Branches:
  refs/heads/master d63e9c19c -> 8c2196b1e


JUDDI-907 adding basic ui components for entity history retrieval, fixing a test case


Project: http://git-wip-us.apache.org/repos/asf/juddi/repo
Commit: http://git-wip-us.apache.org/repos/asf/juddi/commit/8c2196b1
Tree: http://git-wip-us.apache.org/repos/asf/juddi/tree/8c2196b1
Diff: http://git-wip-us.apache.org/repos/asf/juddi/diff/8c2196b1

Branch: refs/heads/master
Commit: 8c2196b1e810d00950057ff1bdb7f3d5f2a7bc79
Parents: d63e9c1
Author: Alex <alexoree@apache.org>
Authored: Thu Jan 8 20:38:28 2015 -0500
Committer: Alex <alexoree@apache.org>
Committed: Thu Jan 8 20:38:28 2015 -0500

----------------------------------------------------------------------
 .../apache/juddi/api/impl/API_141_JIRATest.java |  2 +-
 .../juddi/adminconsole/hub/UddiAdminHub.java    | 39 +++++++++++++++++++-
 juddiv3-war/src/main/webapp/admin/admin.jsp     |  8 ++++
 3 files changed, 46 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/juddi/blob/8c2196b1/juddi-core/src/test/java/org/apache/juddi/api/impl/API_141_JIRATest.java
----------------------------------------------------------------------
diff --git a/juddi-core/src/test/java/org/apache/juddi/api/impl/API_141_JIRATest.java b/juddi-core/src/test/java/org/apache/juddi/api/impl/API_141_JIRATest.java
index f5ba393..df25af0 100644
--- a/juddi-core/src/test/java/org/apache/juddi/api/impl/API_141_JIRATest.java
+++ b/juddi-core/src/test/java/org/apache/juddi/api/impl/API_141_JIRATest.java
@@ -1395,7 +1395,7 @@ public class API_141_JIRATest {
             Assert.assertFalse(entityHistory.getChangeRecords().getChangeRecord().isEmpty());
     }
     
-      @Test(expected = DispositionReportFaultMessage.class)
+      @Test
     public void testJUDDI907_ChangeHistory4() throws Exception{
             
             JUDDIApiImpl j = new JUDDIApiImpl();

http://git-wip-us.apache.org/repos/asf/juddi/blob/8c2196b1/juddiv3-war/src/main/java/org/apache/juddi/adminconsole/hub/UddiAdminHub.java
----------------------------------------------------------------------
diff --git a/juddiv3-war/src/main/java/org/apache/juddi/adminconsole/hub/UddiAdminHub.java
b/juddiv3-war/src/main/java/org/apache/juddi/adminconsole/hub/UddiAdminHub.java
index 792fffb..5cbd061 100644
--- a/juddiv3-war/src/main/java/org/apache/juddi/adminconsole/hub/UddiAdminHub.java
+++ b/juddiv3-war/src/main/java/org/apache/juddi/adminconsole/hub/UddiAdminHub.java
@@ -72,6 +72,8 @@ import org.apache.juddi.api_v3.ClerkList;
 import org.apache.juddi.api_v3.ClientSubscriptionInfo;
 import org.apache.juddi.api_v3.DeleteClerk;
 import org.apache.juddi.api_v3.DeleteNode;
+import org.apache.juddi.api_v3.GetEntityHistoryMessageRequest;
+import org.apache.juddi.api_v3.GetEntityHistoryMessageResponse;
 import org.apache.juddi.api_v3.NodeList;
 import org.apache.juddi.api_v3.SubscriptionWrapper;
 import org.apache.juddi.model.BindingTemplate;
@@ -396,6 +398,9 @@ public class UddiAdminHub {
                         if (action.equalsIgnoreCase("admin_SaveSubscription")) {
                                 return adminSaveSubscription(parameters);
                         }
+                        if (action.equalsIgnoreCase("get_EntityHistory")) {
+                                return getEntityHistory(parameters);
+                        }
                 } catch (Exception ex) {
                         return "Error!" + HandleException(ex);
                 }
@@ -769,14 +774,44 @@ public class UddiAdminHub {
                                 return HandleException(ex);
                         }
                 }
-                AdminSaveSubscriptionResponse res = new AdminSaveSubscriptionResponse()
-                        ;
+                AdminSaveSubscriptionResponse res = new AdminSaveSubscriptionResponse();
                 res.getSubscriptions().addAll(holder.value);
                 StringWriter sw = new StringWriter();
                 JAXB.marshal(res, sw);
                 return StringEscapeUtils.escapeHtml(sw.toString());
         }
 
+        private String getEntityHistory(HttpServletRequest parameters) {
+                GetEntityHistoryMessageRequest sn = new GetEntityHistoryMessageRequest();
+                sn.setAuthInfo(GetToken());
+                sn.setEntityKey(parameters.getParameter("get_EntityHistoryKey"));
+                GetEntityHistoryMessageResponse entityHistory = null;
+                try {
+                        sn.setMaxRecords(Long.parseLong(parameters.getParameter("get_EntityHistoryMaxCount")));
+                        sn.setOffset(Long.parseLong(parameters.getParameter("get_EntityHistoryOffset")));
+                        entityHistory = juddi.getEntityHistory(sn);
+                } catch (Exception ex) {
+                        if (isExceptionExpiration(ex)) {
+                                token = null;
+                                sn.setAuthInfo(GetToken());
+                                try {
+                                        entityHistory = juddi.getEntityHistory(sn);
+                                } catch (Exception ex1) {
+                                        return "Error!" + HandleException(ex1);
+                                }
+
+                        } else {
+                                return "Error!" + HandleException(ex);
+                        }
+                }
+                if (entityHistory == null) {
+                        return "Something went wrong!";
+                }
+                StringWriter sw = new StringWriter();
+                JAXB.marshal(entityHistory, sw);
+                return StringEscapeUtils.escapeHtml(sw.toString());
+        }
+
         public enum AuthStyle {
 
                 /**

http://git-wip-us.apache.org/repos/asf/juddi/blob/8c2196b1/juddiv3-war/src/main/webapp/admin/admin.jsp
----------------------------------------------------------------------
diff --git a/juddiv3-war/src/main/webapp/admin/admin.jsp b/juddiv3-war/src/main/webapp/admin/admin.jsp
index e33d2c4..fa38558 100644
--- a/juddiv3-war/src/main/webapp/admin/admin.jsp
+++ b/juddiv3-war/src/main/webapp/admin/admin.jsp
@@ -67,6 +67,7 @@
                                 <option>------ Node Management -----</option>
                                 <option>set_ReplicationNodes</option>
                                 <option>get_ReplicationNodes</option>
+                                <option>get_EntityHistory</option>
 
                                 <option>------ Backup/Restore Management -----</option>
                                 <option>admin_SaveBusiness</option>
@@ -206,6 +207,12 @@
                                         <textarea rows="4" cols="80" id="admin_SaveSubscriptionXML"
class="forminput" placeholder="Enter save subscription XML"></textarea>
 
                                 </div>
+                                        <div id="get_EntityHistory" style="display:none">
+                                   Entity Key <input type="text" id="get_EntityHistoryKey"
 class="forminput" placeholder="Entity Key"><br>
+                                   Records to fetch <input type="text" id="get_EntityHistoryMaxCount"
 class="forminput" value="25"><br>
+                                   Offset <input type="text" id="get_EntityHistoryOffset"
 class="forminput" value="0"><br>
+                                </div>
+                                        
                                 
                                
 
@@ -239,6 +246,7 @@
                                         $("#set_ReplicationNodes").hide();
                                         $("#get_ReplicationNodes").hide();
                                         $("#admin_SaveSubscription").hide();
+                                        $("#get_EntityHistory").hide();
                                        
                         
                                         $("#" + x).show();


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


Mime
View raw message