]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1610] Use Jackson as jaxrs provider for cxf for performance reasons
authorOlivier Lamy <olamy@apache.org>
Thu, 1 Mar 2012 10:29:25 +0000 (10:29 +0000)
committerOlivier Lamy <olamy@apache.org>
Thu, 1 Mar 2012 10:29:25 +0000 (10:29 +0000)
fix some javascript mapping for archiva part.

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1295500 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/network-proxies.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repository-groups.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/search.html

index 401c2b8607ffede0ff8013208fbe132963402498..4e3fe76d7cb213843bcf0803d9f3894221c217f5 100644 (file)
@@ -178,7 +178,7 @@ $(function() {
                        source: function(request, response){
         $.get("restServices/archivaServices/searchService/quickSearch?queryString="+encodeURIComponent(request.term),
            function(data) {
-             var res = $.map(data.artifact,function(item){
+             var res = $.map(data,function(item){
                return item.artifactId;
              });
              var uniqId = [];
index f96253a29350f4e4ad20cfe258e44346da96e4ef..1127d1e9a32d3040e0d768d5cbd6539fc34482e4 100644 (file)
@@ -71,7 +71,7 @@ $(function() {
           {
             type: "POST",
             contentType: 'application/json',
-            data: "{\"networkProxy\": " + ko.toJSON(networkProxy)+"}",
+            data: ko.toJSON(networkProxy),
             dataType: 'json',
             success: function(data) {
               $.log("update proxy id:"+self.networkProxy.id());
@@ -94,7 +94,7 @@ $(function() {
           {
             type: "POST",
             contentType: 'application/json',
-            data: "{\"networkProxy\": " + ko.toJSON(networkProxy)+"}",
+            data: ko.toJSON(networkProxy),
             dataType: 'json',
             success: function(data) {
               self.networkProxy.modified(false);
@@ -313,7 +313,7 @@ $(function() {
   }
 
   mapNetworkProxies=function(data){
-    var mappedNetworkProxies = $.map(data.networkProxy, function(item) {
+    var mappedNetworkProxies = $.map(data, function(item) {
       return mapNetworkProxy(item);
     });
     return mappedNetworkProxies;
index 863d84a44ea9c35513bdc47b0c54096444c1f59f..dbd73ec98a9a43c9c83cf082f88565140b76ecbf 100644 (file)
@@ -189,7 +189,7 @@ $(function() {
         $.ajax("restServices/archivaServices/proxyConnectorService/updateProxyConnector",
           {
             type: "POST",
-            data: "{\"proxyConnector\": " + ko.toJSON(self.proxyConnector)+"}",
+            data: ko.toJSON(self.proxyConnector),
             contentType: 'application/json',
             dataType: 'json',
             success: function(data) {
@@ -208,7 +208,7 @@ $(function() {
         $.ajax("restServices/archivaServices/proxyConnectorService/addProxyConnector",
           {
             type: "POST",
-            data: "{\"proxyConnector\": " + ko.toJSON(self.proxyConnector)+"}",
+            data: ko.toJSON(self.proxyConnector),
             contentType: 'application/json',
             dataType: 'json',
             success: function(data) {
@@ -608,7 +608,7 @@ $(function() {
   }
 
   mapProxyConnectors=function(data){
-    var mappedProxyConnectors = $.map(data.proxyConnector, function(item) {
+    var mappedProxyConnectors = $.map(data, function(item) {
       return mapProxyConnector(item);
     });
     return mappedProxyConnectors;
@@ -622,7 +622,7 @@ $(function() {
   }
 
   mapPolicyInformations=function(data){
-    return $.map(data.policyInformation, function(item) {
+    return $.map(data, function(item) {
               return mapPolicyInformation(item);
            });
   }
index 2c4159f3ed9e178f6635d9aae640bdfec2b641cc..76cc3f046521d974ea9732861ae193fe168e5e21 100644 (file)
@@ -140,7 +140,7 @@ $(function() {
   }
 
   mapManagedRepositories=function(data){
-    var mappedManagedRepositories = $.map(data.managedRepository, function(item) {
+    var mappedManagedRepositories = $.map(data, function(item) {
       return mapManagedRepository(item);
     });
     return mappedManagedRepositories;
@@ -149,11 +149,11 @@ $(function() {
     if (data==null){
       return null;
     }
-    return new ManagedRepository(data.id,data.name,data.layout,data.indexDirectory,data.location,data.snapshots=='true'
-                                 ,data.releases=='true',
-                                 data.blockRedeployments=='true',data.cronExpression,
-                                 data.scanned=='true',data.daysOlder,data.retentionCount,data.deleteReleasedSnapshots=='true',
-                                 data.stageRepoNeeded=='true');
+    return new ManagedRepository(data.id,data.name,data.layout,data.indexDirectory,data.location,data.snapshots
+                                 ,data.releases,
+                                 data.blockRedeployments,data.cronExpression,
+                                 data.scanned,data.daysOlder,data.retentionCount,data.deleteReleasedSnapshots,
+                                 data.stageRepoNeeded);
   }
 
   mapArchivaRepositoryStatistics=function(data){
@@ -185,7 +185,7 @@ $(function() {
         $.ajax("restServices/archivaServices/managedRepositoriesService/updateManagedRepository",
           {
             type: "POST",
-            data: "{\"managedRepository\": " + ko.toJSON(this.managedRepository)+"}",
+            data: ko.toJSON(this.managedRepository),
             contentType: 'application/json',
             dataType: 'json',
             success: function(data) {
@@ -229,7 +229,7 @@ $(function() {
         {
           type: "POST",
           contentType: 'application/json',
-          data: "{\"managedRepository\": " + ko.toJSON(managedRepository)+"}",
+          data: ko.toJSON(managedRepository),
           dataType: 'json',
           success: function(data) {
             curManagedRepository.location(data.managedRepository.location);
@@ -426,10 +426,10 @@ $(function() {
           type: "GET",
           dataType: 'json',
           success: function(data) {
-            if (data.archivaRepositoryStatistics==null){
+            if (data==null){
               return;
             }
-            var archivaRepositoryStatistics=mapArchivaRepositoryStatistics(data.archivaRepositoryStatistics);
+            var archivaRepositoryStatistics=mapArchivaRepositoryStatistics(data);
             archivaRepositoryStatistics.managedRepository=curRepo;
             var mainContent = $("#main-content");
             mainContent.find("#managedrepository-stats-"+curRepo.id()).append($("#managed-repository-stats-tmpl").tmpl(archivaRepositoryStatistics));
@@ -593,12 +593,12 @@ $(function() {
       return null;
     }
     return new RemoteRepository(data.id,data.name,data.layout,data.indexDirectory,data.url,data.userName,data.password,
-                                data.timeout,data.downloadRemoteIndex=='true',data.remoteIndexUrl,data.remoteDownloadNetworkProxyId,
-                                data.cronExpression,data.remoteDownloadTimeout,data.downloadRemoteIndexOnStartup=='true');
+                                data.timeout,data.downloadRemoteIndex,data.remoteIndexUrl,data.remoteDownloadNetworkProxyId,
+                                data.cronExpression,data.remoteDownloadTimeout,data.downloadRemoteIndexOnStartup);
   }
 
   mapRemoteRepositories=function(data){
-    var mappedRemoteRepositories = $.map(data.remoteRepository, function(item) {
+    var mappedRemoteRepositories = $.map(data, function(item) {
       return mapRemoteRepository(item);
     });
     return mappedRemoteRepositories;
@@ -624,7 +624,7 @@ $(function() {
         $.ajax("restServices/archivaServices/remoteRepositoriesService/updateRemoteRepository",
           {
             type: "POST",
-            data: "{\"remoteRepository\": " + ko.toJSON(this.remoteRepository)+"}",
+            data: ko.toJSON(this.remoteRepository),
             contentType: 'application/json',
             dataType: 'json',
             success: function(data) {
@@ -642,7 +642,7 @@ $(function() {
         $.ajax("restServices/archivaServices/remoteRepositoriesService/addRemoteRepository",
           {
             type: "POST",
-            data: "{\"remoteRepository\": " + ko.toJSON(this.remoteRepository)+"}",
+            data: ko.toJSON(this.remoteRepository),
             contentType: 'application/json',
             dataType: 'json',
             success: function(data) {
@@ -691,7 +691,7 @@ $(function() {
     removeRemoteRepository=function(remoteRepository){
       clearUserMessages();
       openDialogConfirm(
-          function(){$.ajax("restServices/archivaServices/remoteRepositoriesService/deleteRemoteRepository/"+remoteRepository.id(),
+          function(){$.ajax("restServices/archivaServices/remoteRepositoriesService/deleteRemoteRepository/"+encodeURIComponent(remoteRepository.id()),
                   {
                     type: "GET",
                     success: function(data) {
index 611023ac81f33f46943950b30aaf8a4097b8d27b..8707d9dae328ff0a684a1f904fd35d8ded25921b 100644 (file)
@@ -119,7 +119,7 @@ $(function() {
           {
             type: "POST",
             contentType: 'application/json',
-            data: "{\"repositoryGroup\": " + ko.toJSON(repositoryGroup)+"}",
+            data:ko.toJSON(repositoryGroup),
             dataType: 'json',
             success: function(data) {
               $.log("update repositoryGroup id:"+repositoryGroup.id());
@@ -142,7 +142,7 @@ $(function() {
         {
           type: "POST",
           contentType: 'application/json',
-          data: "{\"repositoryGroup\": " + ko.toJSON(repositoryGroup)+"}",
+          data: ko.toJSON(repositoryGroup),
           dataType: 'json',
           success: function(data) {
             $.log("update repositoryGroup id:"+repositoryGroup.id());
@@ -258,7 +258,7 @@ $(function() {
     if (data == null){
       return new Array();
     }
-    var mappedRepositoryGroups = $.map(data.repositoryGroup, function(item) {
+    var mappedRepositoryGroups = $.map(data, function(item) {
       return mapRepositoryGroup(item);
     });
     return mappedRepositoryGroups;
index 90a1f9c7c3b33f18df0a541038c304ec21d13b21..2cf3133474329e05025771680536709e6f11a0c8 100644 (file)
@@ -238,7 +238,7 @@ $(function() {
       },
       select: function( event, ui ) {
         $.log("ui.item.label:"+ui.item.name);
-        if (ui.item.project=='true'){
+        if (ui.item.project){
           // value org.apache.maven/maven-archiver
           // split this org.apache.maven and maven-archiver
           var id=ui.item.name;
@@ -583,8 +583,8 @@ $(function() {
   }
 
   mapArtifacts=function(data){
-    if (data.artifact){
-      return $.isArray(data.artifact )? $.map(data.artifact,function(item){return mapArtifact(item)}) : [data.artifact];
+    if (data){
+      return $.isArray(data )? $.map(data.artifact,function(item){return mapArtifact(item)}) : [data];
     }
     return [];
   }
index e24694035ffad282f5c5ae17b7d6b9c5ad288078..99cda9a87d1f3f13f05202ddc76559f8b19cd55d 100644 (file)
@@ -49,7 +49,7 @@
         </li>
       {{/if}}
       {{each(i,browseResultEntry) browseResultEntries}}
-        {{if browseResultEntry.project=='true'}}
+        {{if browseResultEntry.project}}
           <li class="browse-list-project" title="artifact" data-bind="click:function(){displayProjectEntry(browseResultEntry.name)}">
         {{else}}
           <li class="browse-list" data-bind="click:function(){displayGroupId(browseResultEntry.name)}">