mirror of https://github.com/apache/archiva.git
[MRM-1610] Use Jackson as jaxrs provider for cxf for performance reasons
fix some javascript mapping for archiva part. git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1295500 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
d0eaad0341
commit
b96bf22f52
|
@ -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 = [];
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 [];
|
||||
}
|
||||
|
|
|
@ -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)}">
|
||||
|
|
Loading…
Reference in New Issue