Skip to content

Commit 10da1c7

Browse files
committed
upstream: b=master,r=0ab52b4755d2750c7c0edbee0999770cfe8d5552,t=2018-01-19-1711-12417
1 parent c26cffc commit 10da1c7

File tree

77 files changed

+918
-418
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+918
-418
lines changed

assemblies/nexus-base-template/src/main/resources/overlay/bin/nexus

+5
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,11 @@ setupDefaults() {
269269

270270
DEFAULT_JAVA_OPTS="-Xms$JAVA_MIN_MEM -Xmx$JAVA_MAX_MEM -XX:MaxDirectMemorySize=$DIRECT_MAX_MEM -XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass -XX:+LogVMOutput -XX:LogFile=../sonatype-work/nexus3/log/jvm.log -XX:-OmitStackTraceInFastThrow "
271271

272+
if [ "$darwin" = "true" ] && [ "$JVM_VENDOR" = "SUN" ] && [ `ulimit -n` -gt 10240 ]; then
273+
# NEXUS-14184 - Open up OSX file descriptor limit
274+
DEFAULT_JAVA_OPTS="$DEFAULT_JAVA_OPTS -XX:-MaxFDLimit "
275+
fi
276+
272277
#Set the JVM_VENDOR specific JVM flags
273278
if [ "$JVM_VENDOR" = "SUN" ]; then
274279
# SONATYPE: removed -XX:PermSize and -XX:MaxPermSize

components/nexus-quartz/src/main/java/org/sonatype/nexus/quartz/internal/task/QuartzTaskInfo.java

+5
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,11 @@ public String getName() {
168168
return getConfiguration().getName();
169169
}
170170

171+
@Override
172+
public String getTypeId() {
173+
return getConfiguration().getTypeId();
174+
}
175+
171176
@Override
172177
public String getMessage() {
173178
return getConfiguration().getMessage();

components/nexus-rapture/src/main/resources/static/rapture/NX/controller/Drilldown.js

+26-52
Original file line numberDiff line numberDiff line change
@@ -797,63 +797,37 @@ Ext.define('NX.controller.Drilldown', {
797797

798798
/*
799799
* @private
800-
* Reduce the width of a set of buttons, longest first, to a specified width
800+
* Reduce the width of a set of buttons to fit a specified target width. The buttons are processed in
801+
* ascending order by width until the first button with a width > the remaining target width / remaining buttons
802+
* (i.e. equalPartsButtonWidth) is found. The equalPartsButtonWidth is then applied to all remaining buttons.
801803
*
802804
* @param buttons The list of buttons to resize
803-
* @param width The desired resize width (sum of all buttons)
804-
* @param minPerButton The minimum to resize each button (until all buttons are at this minimum)
805-
*/
806-
reduceButtonWidth: function(buttons, width, minPerButton) {
807-
var me = this,
808-
currentWidth = 0,
809-
setToWidth;
810-
811-
// Sort the buttons by width
812-
buttons = buttons.sort(function(a,b) {
813-
return b.getWidth() - a.getWidth();
814-
});
815-
816-
// Calculate the current width of the buttons
817-
for (var i = 0; i < buttons.length; ++i) {
818-
currentWidth += buttons[i].getWidth();
819-
}
820-
821-
// Find the next button to resize
822-
for (var i = 0; i < buttons.length; ++i) {
823-
824-
// Shorten the longest button
825-
if (i < buttons.length - 1 && buttons[i].getWidth() > buttons[i+1].getWidth()) {
826-
827-
// Will resizing this button make it fit?
828-
if (currentWidth - (buttons[i].getWidth() - buttons[i+1].getWidth()) <= width) {
829-
830-
// Yes.
831-
setToWidth = width;
832-
for (var j = i + 1; j < buttons.length; ++j) {
833-
setToWidth -= buttons[j].getWidth();
834-
}
835-
buttons[i].setWidth(setToWidth);
836-
837-
// Exit the algorithm
838-
break;
839-
}
840-
else {
841-
// No. Set the width of this button to that of the next button, and re-run the algorithm.
842-
buttons[i].setWidth(buttons[i+1].getWidth());
843-
me.reduceButtonWidth(buttons, width, minPerButton);
844-
}
805+
* @param targetWidth The desired resize width (sum of all buttons)
806+
*/
807+
reduceButtonWidth: function(buttons, targetWidth) {
808+
var currentButtonWidth,
809+
equalPartsButtonWidth,
810+
adjustedButtonWidth,
811+
totalButtons = buttons.length,
812+
byWidthAscending = function(button, anotherButton) {
813+
return button.getWidth() - anotherButton.getWidth();
814+
};
815+
816+
buttons.sort(byWidthAscending).forEach(function(button, buttonIndex) {
817+
if (adjustedButtonWidth) {
818+
button.setWidth(adjustedButtonWidth);
819+
return;
845820
}
846-
else {
847-
// All buttons are the same length, shorten all by the same length
848-
setToWidth = Math.floor(width / buttons.length);
849-
for (var j = 0; j < buttons.length; ++j) {
850-
buttons[j].setWidth(setToWidth);
851-
}
852821

853-
// Exit the algorithm
854-
break;
822+
equalPartsButtonWidth = Math.floor(targetWidth / (totalButtons - buttonIndex));
823+
currentButtonWidth = button.getWidth();
824+
targetWidth -= currentButtonWidth;
825+
826+
if (equalPartsButtonWidth < currentButtonWidth) {
827+
adjustedButtonWidth = equalPartsButtonWidth;
828+
button.setWidth(adjustedButtonWidth);
855829
}
856-
}
830+
});
857831
},
858832

859833
/**

components/nexus-repository/src/main/java/org/sonatype/nexus/repository/browse/internal/resources/AssetMapUtils.java

-65
This file was deleted.

components/nexus-repository/src/main/java/org/sonatype/nexus/repository/browse/ComponentsResourceExtension.java components/nexus-repository/src/main/java/org/sonatype/nexus/repository/rest/ComponentsResourceExtension.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
1111
* Eclipse Foundation. All other trademarks are the property of their respective owners.
1212
*/
13-
package org.sonatype.nexus.repository.browse;
13+
package org.sonatype.nexus.repository.rest;
1414

15-
import org.sonatype.nexus.repository.browse.api.ComponentXO;
16-
import org.sonatype.nexus.repository.browse.internal.resources.ComponentsResource;
15+
import org.sonatype.nexus.repository.rest.api.ComponentXO;
16+
import org.sonatype.nexus.repository.rest.internal.resources.ComponentsResource;
1717
import org.sonatype.nexus.repository.storage.Component;
1818

1919
/**

components/nexus-repository/src/main/java/org/sonatype/nexus/repository/search/SearchMapping.java components/nexus-repository/src/main/java/org/sonatype/nexus/repository/rest/SearchMapping.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
1111
* Eclipse Foundation. All other trademarks are the property of their respective owners.
1212
*/
13-
package org.sonatype.nexus.repository.search;
13+
package org.sonatype.nexus.repository.rest;
1414

1515
import static com.google.common.base.Preconditions.checkNotNull;
1616

components/nexus-repository/src/main/java/org/sonatype/nexus/repository/search/SearchMappings.java components/nexus-repository/src/main/java/org/sonatype/nexus/repository/rest/SearchMappings.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
1111
* Eclipse Foundation. All other trademarks are the property of their respective owners.
1212
*/
13-
package org.sonatype.nexus.repository.search;
13+
package org.sonatype.nexus.repository.rest;
1414

1515
/**
1616
* Provide a set of {@link SearchMapping}s.

components/nexus-repository/src/main/java/org/sonatype/nexus/repository/search/SearchMappingsService.java components/nexus-repository/src/main/java/org/sonatype/nexus/repository/rest/SearchMappingsService.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
1111
* Eclipse Foundation. All other trademarks are the property of their respective owners.
1212
*/
13-
package org.sonatype.nexus.repository.search;
13+
package org.sonatype.nexus.repository.rest;
1414

1515
/**
1616
* Provide a listing of all {@link SearchMapping}s that have been contributed via {@link SearchMappings}.

components/nexus-repository/src/main/java/org/sonatype/nexus/repository/browse/SearchResourceExtension.java components/nexus-repository/src/main/java/org/sonatype/nexus/repository/rest/SearchResourceExtension.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
1111
* Eclipse Foundation. All other trademarks are the property of their respective owners.
1212
*/
13-
package org.sonatype.nexus.repository.browse;
13+
package org.sonatype.nexus.repository.rest;
1414

15-
import org.sonatype.nexus.repository.browse.api.ComponentXO;
16-
import org.sonatype.nexus.repository.browse.internal.resources.SearchResource;
15+
import org.sonatype.nexus.repository.rest.api.ComponentXO;
16+
import org.sonatype.nexus.repository.rest.internal.resources.SearchResource;
1717

1818
import org.elasticsearch.search.SearchHit;
1919

components/nexus-repository/src/main/java/org/sonatype/nexus/repository/search/SearchUtils.java components/nexus-repository/src/main/java/org/sonatype/nexus/repository/rest/SearchUtils.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
1111
* Eclipse Foundation. All other trademarks are the property of their respective owners.
1212
*/
13-
package org.sonatype.nexus.repository.search;
13+
package org.sonatype.nexus.repository.rest;
1414

1515
import java.util.Map;
1616
import java.util.Map.Entry;
@@ -23,7 +23,7 @@
2323

2424
import org.sonatype.goodies.common.ComponentSupport;
2525
import org.sonatype.nexus.repository.Repository;
26-
import org.sonatype.nexus.repository.browse.internal.resources.RepositoryManagerRESTAdapter;
26+
import org.sonatype.nexus.repository.rest.internal.resources.RepositoryManagerRESTAdapter;
2727
import org.sonatype.nexus.repository.group.GroupFacet;
2828
import org.sonatype.nexus.repository.types.GroupType;
2929

@@ -136,4 +136,8 @@ public boolean isAssetSearchParam(final String assetSearchParam) {
136136
public boolean isFullAssetAttributeName(final String assetSearchParam) {
137137
return assetSearchParam.startsWith(ASSET_PREFIX);
138138
}
139+
140+
public String getFullAssetAttributeName(final String key) {
141+
return isFullAssetAttributeName(key) ? key : getAssetSearchParameters().get(key);
142+
}
139143
}

components/nexus-repository/src/main/java/org/sonatype/nexus/repository/browse/api/AssetXO.groovy components/nexus-repository/src/main/java/org/sonatype/nexus/repository/rest/api/AssetXO.groovy

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
1111
* Eclipse Foundation. All other trademarks are the property of their respective owners.
1212
*/
13-
package org.sonatype.nexus.repository.browse.api
13+
package org.sonatype.nexus.repository.rest.api
1414

1515
import org.sonatype.nexus.repository.Repository
16-
import org.sonatype.nexus.repository.browse.internal.api.RepositoryItemIDXO
16+
import org.sonatype.nexus.repository.rest.internal.api.RepositoryItemIDXO
1717
import org.sonatype.nexus.repository.storage.Asset
1818

1919
import groovy.transform.CompileStatic

components/nexus-repository/src/main/java/org/sonatype/nexus/repository/browse/api/ComponentXO.groovy components/nexus-repository/src/main/java/org/sonatype/nexus/repository/rest/api/ComponentXO.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
1111
* Eclipse Foundation. All other trademarks are the property of their respective owners.
1212
*/
13-
package org.sonatype.nexus.repository.browse.api
13+
package org.sonatype.nexus.repository.rest.api
1414

1515
import com.fasterxml.jackson.annotation.JsonAnyGetter
1616
import com.fasterxml.jackson.annotation.JsonPropertyOrder

components/nexus-repository/src/main/java/org/sonatype/nexus/repository/browse/api/ComponentXODecorator.java components/nexus-repository/src/main/java/org/sonatype/nexus/repository/rest/api/ComponentXODecorator.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
1111
* Eclipse Foundation. All other trademarks are the property of their respective owners.
1212
*/
13-
package org.sonatype.nexus.repository.browse.api;
13+
package org.sonatype.nexus.repository.rest.api;
1414

1515
/**
1616
* Decorator interface for the {@link ComponentXO} class

components/nexus-repository/src/main/java/org/sonatype/nexus/repository/browse/api/ComponentXODeserializer.java components/nexus-repository/src/main/java/org/sonatype/nexus/repository/rest/api/ComponentXODeserializer.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
1111
* Eclipse Foundation. All other trademarks are the property of their respective owners.
1212
*/
13-
package org.sonatype.nexus.repository.browse.api;
13+
package org.sonatype.nexus.repository.rest.api;
1414

1515
import java.io.IOException;
1616
import java.util.Set;
+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
1111
* Eclipse Foundation. All other trademarks are the property of their respective owners.
1212
*/
13-
package org.sonatype.nexus.repository.browse.api;
13+
package org.sonatype.nexus.repository.rest.api;
1414

1515
import com.fasterxml.jackson.databind.JsonNode;
1616

components/nexus-repository/src/main/java/org/sonatype/nexus/repository/browse/api/ComponentXOFactory.java components/nexus-repository/src/main/java/org/sonatype/nexus/repository/rest/api/ComponentXOFactory.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
1111
* Eclipse Foundation. All other trademarks are the property of their respective owners.
1212
*/
13-
package org.sonatype.nexus.repository.browse.api;
13+
package org.sonatype.nexus.repository.rest.api;
1414

1515
import java.util.Set;
1616

components/nexus-repository/src/main/java/org/sonatype/nexus/repository/browse/api/DecoratedComponentXO.groovy components/nexus-repository/src/main/java/org/sonatype/nexus/repository/rest/api/DecoratedComponentXO.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
1111
* Eclipse Foundation. All other trademarks are the property of their respective owners.
1212
*/
13-
package org.sonatype.nexus.repository.browse.api
13+
package org.sonatype.nexus.repository.rest.api
1414

1515
import org.sonatype.nexus.common.decorator.DecoratedObject
1616

components/nexus-repository/src/main/java/org/sonatype/nexus/repository/browse/api/DefaultComponentXO.groovy components/nexus-repository/src/main/java/org/sonatype/nexus/repository/rest/api/DefaultComponentXO.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
1111
* Eclipse Foundation. All other trademarks are the property of their respective owners.
1212
*/
13-
package org.sonatype.nexus.repository.browse.api
13+
package org.sonatype.nexus.repository.rest.api
1414

1515
import groovy.transform.CompileStatic
1616
import groovy.transform.EqualsAndHashCode

components/nexus-repository/src/main/java/org/sonatype/nexus/repository/search/internal/DefaultSearchMappings.java components/nexus-repository/src/main/java/org/sonatype/nexus/repository/rest/internal/DefaultSearchMappings.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@
1010
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
1111
* Eclipse Foundation. All other trademarks are the property of their respective owners.
1212
*/
13-
package org.sonatype.nexus.repository.search.internal;
13+
package org.sonatype.nexus.repository.rest.internal;
1414

1515
import java.util.List;
1616

1717
import javax.inject.Named;
1818
import javax.inject.Singleton;
1919

2020
import org.sonatype.goodies.common.ComponentSupport;
21-
import org.sonatype.nexus.repository.search.SearchMapping;
22-
import org.sonatype.nexus.repository.search.SearchMappings;
21+
import org.sonatype.nexus.repository.rest.SearchMapping;
22+
import org.sonatype.nexus.repository.rest.SearchMappings;
2323

2424
import com.google.common.collect.ImmutableList;
2525

components/nexus-repository/src/main/java/org/sonatype/nexus/repository/search/internal/SearchMappingsServiceImpl.java components/nexus-repository/src/main/java/org/sonatype/nexus/repository/rest/internal/SearchMappingsServiceImpl.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
1111
* Eclipse Foundation. All other trademarks are the property of their respective owners.
1212
*/
13-
package org.sonatype.nexus.repository.search.internal;
13+
package org.sonatype.nexus.repository.rest.internal;
1414

1515
import java.util.Collection;
1616
import java.util.Map;
@@ -20,9 +20,9 @@
2020
import javax.inject.Singleton;
2121

2222
import org.sonatype.goodies.common.ComponentSupport;
23-
import org.sonatype.nexus.repository.search.SearchMapping;
24-
import org.sonatype.nexus.repository.search.SearchMappings;
25-
import org.sonatype.nexus.repository.search.SearchMappingsService;
23+
import org.sonatype.nexus.repository.rest.SearchMapping;
24+
import org.sonatype.nexus.repository.rest.SearchMappings;
25+
import org.sonatype.nexus.repository.rest.SearchMappingsService;
2626

2727
import com.google.common.collect.ImmutableList;
2828
import com.google.common.collect.ImmutableList.Builder;

0 commit comments

Comments
 (0)