diff --git a/src/web/core/src/main/java/org/geoserver/web/GeoServerRequestEncodingStrategy.java b/src/web/core/src/main/java/org/geoserver/web/GeoServerRequestEncodingStrategy.java deleted file mode 100644 index f259c149127..00000000000 --- a/src/web/core/src/main/java/org/geoserver/web/GeoServerRequestEncodingStrategy.java +++ /dev/null @@ -1,112 +0,0 @@ -/* (c) 2014 - 2015 Open Source Geospatial Foundation - all rights reserved - * (c) 2001 - 2013 OpenPlans - * This code is licensed under the GPL 2.0 license, available at the root - * application directory. - */ - -package org.geoserver.web; - -import org.apache.wicket.request.Request; -import org.apache.wicket.request.cycle.RequestCycle; -import org.geoserver.platform.GeoServerExtensions; -import org.geoserver.security.GeoServerSecurityManager; - -/** - * Implementation of {@link IRequestCodingStrategy} multiplexing - * between {@link WebRequestCodingStrategy} and {@link CryptedUrlWebRequestCodingStrategy} - * - * @author christian - * - */ -public class GeoServerRequestEncodingStrategy implements IRequestCodingStrategy { - WebRequestCodingStrategy strategy; - CryptedUrlWebRequestCodingStrategy cryptedStrategy; - GeoServerSecurityManager manager; - - public GeoServerRequestEncodingStrategy() { - - strategy=new WebRequestCodingStrategy(); - cryptedStrategy = new CryptedUrlWebRequestCodingStrategy(strategy); - manager= GeoServerExtensions.bean(GeoServerSecurityManager.class); - } - - - @Override - public void mount(IRequestTargetUrlCodingStrategy urlCodingStrategy) { - - if (manager.isEncryptingUrlParams()) - cryptedStrategy.mount(urlCodingStrategy); - else - strategy.mount(urlCodingStrategy); - } - - @Override - public void addIgnoreMountPath(String path) { - - if (manager.isEncryptingUrlParams()) - cryptedStrategy.addIgnoreMountPath(path); - else - strategy.addIgnoreMountPath(path); - - } - - @Override - public CharSequence pathForTarget(IRequestTarget requestTarget) { - if (manager.isEncryptingUrlParams()) - return cryptedStrategy.pathForTarget(requestTarget); - else - return strategy.pathForTarget(requestTarget); - } - - @Override - public IRequestTarget targetForRequest(RequestParameters requestParameters) { - if (manager.isEncryptingUrlParams()) - return cryptedStrategy.targetForRequest(requestParameters); - else - return strategy.targetForRequest(requestParameters); - - } - - @Override - public void unmount(String path) { - if (manager.isEncryptingUrlParams()) - cryptedStrategy.unmount(path); - else - strategy.unmount(path); - } - - @Override - public IRequestTargetUrlCodingStrategy urlCodingStrategyForPath(String path) { - if (manager.isEncryptingUrlParams()) - return cryptedStrategy.urlCodingStrategyForPath(path); - else - return strategy.urlCodingStrategyForPath(path); - } - - @Override - public RequestParameters decode(Request request) { - if (manager.isEncryptingUrlParams()) - return cryptedStrategy.decode(request); - else - return strategy.decode(request); - } - - @Override - public CharSequence encode(RequestCycle requestCycle, IRequestTarget requestTarget) { - if (manager.isEncryptingUrlParams()) - return cryptedStrategy.encode(requestCycle, requestTarget); - else - return strategy.encode(requestCycle, requestTarget); - - } - - @Override - public String rewriteStaticRelativeUrl(String string) { - if (manager.isEncryptingUrlParams()) - return cryptedStrategy.rewriteStaticRelativeUrl(string); - else - return strategy.rewriteStaticRelativeUrl(string); - - } - -} diff --git a/src/web/core/src/main/java/org/geoserver/web/wicket/GeoServerTablePanel.java b/src/web/core/src/main/java/org/geoserver/web/wicket/GeoServerTablePanel.java index 91594d70a79..0ea9e25e7f1 100644 --- a/src/web/core/src/main/java/org/geoserver/web/wicket/GeoServerTablePanel.java +++ b/src/web/core/src/main/java/org/geoserver/web/wicket/GeoServerTablePanel.java @@ -545,16 +545,16 @@ protected abstract Component getComponentForProperty(String id, IModel itemModel protected void onPopulateItem(Property property, ListItem item) { } - IModel showingAllRecords(int first, int last, int size) { + IModel showingAllRecords(long first, long last, long size) { return new ParamResourceModel("showingAllRecords", this, first, last, size); } - IModel matchedXOutOfY(int first, int last, int size, int fullSize) { + IModel matchedXOutOfY(long first, long last, long size, long fullSize) { return new ParamResourceModel("matchedXOutOfY", this, first, last, size, fullSize); } protected class PagerDelegate implements Serializable { - int fullSize, size, first, last; + long fullSize, size, first, last; public PagerDelegate() { updateMatched(); @@ -583,8 +583,8 @@ public IModel model() { /** * User oriented index of the first item in the current page */ - int first(int fullSize) { - int size = fullSize; + long first(long fullSize) { + long size = fullSize; if (dataProvider.getKeywords() != null) { size = dataView.getDataProvider().size(); } @@ -597,11 +597,11 @@ int first(int fullSize) { /** * User oriented index of the last item in the current page */ - int last(int fullSize) { + long last(long fullSize) { - int count = dataProvider.getKeywords() != null ? + long count = dataProvider.getKeywords() != null ? dataView.getPageCount() : optGetPageCount(fullSize); - int page = dataView.getCurrentPage(); + long page = dataView.getCurrentPage(); if (page < (count - 1)) return dataView.getItemsPerPage() * (page + 1); else { @@ -609,9 +609,9 @@ int last(int fullSize) { } } - int optGetPageCount(int total) { - int page = dataView.getItemsPerPage(); - int count = total / page; + long optGetPageCount(long total) { + long page = dataView.getItemsPerPage(); + long count = total / page; if (page * count < total) { diff --git a/src/web/wms/src/main/java/org/geoserver/wms/web/publish/AttributionLayerConfigPanel.java b/src/web/wms/src/main/java/org/geoserver/wms/web/publish/AttributionLayerConfigPanel.java index dcfeaf65b69..5112f122143 100644 --- a/src/web/wms/src/main/java/org/geoserver/wms/web/publish/AttributionLayerConfigPanel.java +++ b/src/web/wms/src/main/java/org/geoserver/wms/web/publish/AttributionLayerConfigPanel.java @@ -17,7 +17,7 @@ import org.apache.wicket.markup.html.form.TextField; import org.apache.wicket.model.IModel; import org.apache.wicket.model.PropertyModel; -import org.apache.wicket.validation.validator.NumberValidator; +import org.apache.wicket.validation.validator.RangeValidator; import org.apache.wicket.validation.validator.UrlValidator; import org.geoserver.catalog.LayerInfo; import org.geoserver.catalog.PublishedInfo; @@ -70,7 +70,7 @@ public AttributionLayerConfigPanel(String id, IModel mo new PropertyModel(model, "attribution.logoHeight"), Integer.class ); - height.add(NumberValidator.minimum(0)); + height.add(RangeValidator.minimum(0)); height.setOutputMarkupId(true); add(height); @@ -78,7 +78,7 @@ public AttributionLayerConfigPanel(String id, IModel mo new PropertyModel(model, "attribution.logoWidth"), Integer.class ); - width.add(NumberValidator.minimum(0)); + width.add(RangeValidator.minimum(0)); width.setOutputMarkupId(true); add(width); diff --git a/src/web/wms/src/main/java/org/geoserver/wms/web/publish/WMSLayerConfig.java b/src/web/wms/src/main/java/org/geoserver/wms/web/publish/WMSLayerConfig.java index 762f7307646..f9be5f7c9a5 100644 --- a/src/web/wms/src/main/java/org/geoserver/wms/web/publish/WMSLayerConfig.java +++ b/src/web/wms/src/main/java/org/geoserver/wms/web/publish/WMSLayerConfig.java @@ -5,7 +5,6 @@ */ package org.geoserver.wms.web.publish; -import java.util.List; import java.util.Set; import org.apache.wicket.Component; @@ -21,7 +20,7 @@ import org.apache.wicket.model.IModel; import org.apache.wicket.model.PropertyModel; import org.apache.wicket.model.ResourceModel; -import org.apache.wicket.validation.validator.NumberValidator; +import org.apache.wicket.validation.validator.RangeValidator; import org.geoserver.catalog.CoverageInfo; import org.geoserver.catalog.FeatureTypeInfo; import org.geoserver.catalog.LayerInfo;