Commit b3c7b463 authored by Andrea Aime's avatar Andrea Aime
Browse files

Full compile and build passing with wicket 1.5 (haven't tried interactively)

parent 6e5da766
......@@ -137,7 +137,7 @@ public class ArcSDECoverageStoreEditPanelTest extends GeoServerWicketTestSupport
// this is a TextParamPanel instead of a RasterTableSelectionPanel when editing instead of
// adding
tester.assertComponent(base + "tableNamePanel", TextParamPanel.class);
tester.assertModelValue(base + "tableNamePanel:border:paramValue", "FAKE.TABLE");
tester.assertModelValue(base + "tableNamePanel:border:border_body:paramValue", "FAKE.TABLE");
}
/**
......@@ -237,7 +237,7 @@ public class ArcSDECoverageStoreEditPanelTest extends GeoServerWicketTestSupport
//print(page, true, true);
final String dropDownPath = base + "tableNamePanel:border:rasterTable";
final String dropDownPath = base + "tableNamePanel:border:border_body:rasterTable";
final DropDownChoice choice = (DropDownChoice) tester
.getComponentFromLastRenderedPage(dropDownPath);
assertTrue(choice.getChoices().isEmpty());
......
......@@ -15,7 +15,6 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.apache.wicket.PageParameters;
import org.apache.wicket.WicketRuntimeException;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.AjaxLink;
......@@ -25,7 +24,6 @@ import org.apache.wicket.extensions.markup.html.tabs.AbstractTab;
import org.apache.wicket.extensions.markup.html.tabs.ITab;
import org.apache.wicket.extensions.markup.html.tabs.PanelCachingTab;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.panel.EmptyPanel;
import org.apache.wicket.markup.html.panel.FeedbackPanel;
import org.apache.wicket.markup.html.panel.Fragment;
import org.apache.wicket.markup.html.panel.Panel;
......@@ -34,6 +32,8 @@ import org.apache.wicket.model.CompoundPropertyModel;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
import org.apache.wicket.model.PropertyModel;
import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.apache.wicket.util.string.StringValue;
import org.geoscript.geocss.CssParser;
import org.geoscript.geocss.Translator;
import org.geoserver.catalog.Catalog;
......@@ -73,8 +73,9 @@ public class CssDemoPage extends GeoServerSecuredPage {
}
private static LayerInfo extractLayer(PageParameters params, Catalog catalog) {
if (params.containsKey("layer")) {
String name = params.getString("layer");
StringValue layerParam = params.get("layer");
if (layerParam != null && !layerParam.isEmpty()) {
String name = layerParam.toString();
return catalog.getLayerByName(name);
} else {
// TODO: Revisit this behavior
......@@ -95,8 +96,9 @@ public class CssDemoPage extends GeoServerSecuredPage {
}
private static StyleInfo extractStyle(PageParameters params, Catalog catalog, LayerInfo layer) {
if (params.containsKey("style")) {
String style = params.getString("style");
StringValue styleParam = params.get("style");
if (styleParam != null && !styleParam.isEmpty()) {
String style = styleParam.toString();
String[] parts = style.split(":", 2);
if (parts.length == 1) {
return catalog.getStyleByName(parts[0]);
......@@ -194,7 +196,7 @@ public class CssDemoPage extends GeoServerSecuredPage {
mainContent.add(new Label("layer.name", new PropertyModel(layer, "name")));
mainContent.add(new AjaxLink("change.style", new ParamResourceModel("CssDemoPage.changeStyle", this)) {
public void onClick(AjaxRequestTarget target) {
target.appendJavascript("Wicket.Window.unloadConfirmation = false;");
target.appendJavaScript("Wicket.Window.unloadConfirmation = false;");
popup.setInitialHeight(400);
popup.setInitialWidth(600);
popup.setTitle(new Model("Choose style to edit"));
......@@ -204,7 +206,7 @@ public class CssDemoPage extends GeoServerSecuredPage {
});
mainContent.add(new AjaxLink("change.layer", new ParamResourceModel("CssDemoPage.changeLayer", this)) {
public void onClick(AjaxRequestTarget target) {
target.appendJavascript("Wicket.Window.unloadConfirmation = false;");
target.appendJavaScript("Wicket.Window.unloadConfirmation = false;");
popup.setInitialHeight(400);
popup.setInitialWidth(600);
popup.setTitle(new Model("Choose layer to edit"));
......@@ -214,7 +216,7 @@ public class CssDemoPage extends GeoServerSecuredPage {
});
mainContent.add(new AjaxLink("create.style", new ParamResourceModel("CssDemoPage.createStyle", this)) {
public void onClick(AjaxRequestTarget target) {
target.appendJavascript("Wicket.Window.unloadConfirmation = false;");
target.appendJavaScript("Wicket.Window.unloadConfirmation = false;");
popup.setInitialHeight(200);
popup.setInitialWidth(300);
popup.setTitle(new Model("Choose name for new style"));
......@@ -224,7 +226,7 @@ public class CssDemoPage extends GeoServerSecuredPage {
});
mainContent.add(new AjaxLink("associate.styles", new ParamResourceModel("CssDemoPage.associateStyles", this)) {
public void onClick(AjaxRequestTarget target) {
target.appendJavascript("Wicket.Window.unloadConfirmation = false;");
target.appendJavaScript("Wicket.Window.unloadConfirmation = false;");
popup.setInitialHeight(400);
popup.setInitialWidth(600);
popup.setTitle(new Model("Choose layers to associate"));
......
......@@ -43,8 +43,8 @@ class CssSubmitButton extends AjaxButton {
page.catalog().getResourcePool().writeStyle(
page.getStyleInfo(), new ByteArrayInputStream(sld.getBytes()));
page.catalog().save(page.getStyleInfo());
if (page.sldPreview != null) target.addComponent(page.sldPreview);
if (page.map != null) target.appendJavascript(page.map.getUpdateCommand());
if (page.sldPreview != null) target.add(page.sldPreview);
if (page.map != null) target.appendJavaScript(page.map.getUpdateCommand());
} catch (Exception e) {
throw new WicketRuntimeException(e);
}
......
......@@ -8,7 +8,6 @@ import java.util.Arrays;
import java.util.List;
import org.apache.wicket.Component;
import org.apache.wicket.PageParameters;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.AjaxLink;
import org.apache.wicket.markup.html.basic.Label;
......@@ -16,6 +15,7 @@ import org.apache.wicket.markup.html.panel.Fragment;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.geoserver.catalog.LayerInfo;
import org.geoserver.catalog.WorkspaceInfo;
import org.geoserver.web.wicket.GeoServerDataProvider;
......@@ -85,12 +85,12 @@ public class LayerChooser extends Panel {
@Override
public void onClick(AjaxRequestTarget target) {
PageParameters params = new PageParameters();
params.put("layer", layer.prefixedName());
params.add("layer", layer.prefixedName());
WorkspaceInfo workspace= demo.getStyleInfo().getWorkspace();
if (workspace == null) {
params.put("style", demo.getStyleInfo().getName());
params.add("style", demo.getStyleInfo().getName());
} else {
params.put("style", workspace.getName() + ":" + demo.getStyleInfo().getName());
params.add("style", workspace.getName() + ":" + demo.getStyleInfo().getName());
}
setResponsePage(CssDemoPage.class, params);
}
......
......@@ -4,7 +4,9 @@
*/
package org.geoserver.community.css.web;
import org.apache.wicket.PageParameters;
import java.util.ArrayList;
import java.util.List;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.form.AjaxButton;
import org.apache.wicket.markup.html.form.ChoiceRenderer;
......@@ -14,15 +16,12 @@ import org.apache.wicket.markup.html.form.IChoiceRenderer;
import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.PropertyModel;
import org.apache.wicket.validation.IValidator;
import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.apache.wicket.validation.IValidatable;
import org.apache.wicket.validation.IValidator;
import org.apache.wicket.validation.ValidationError;
import org.geoserver.catalog.WorkspaceInfo;
import java.util.ArrayList;
import java.util.List;
public class LayerNameInput extends Panel {
String workspace = null;
String name = "";
......@@ -85,11 +84,11 @@ public class LayerNameInput extends Panel {
demo.createCssTemplate(name);
PageParameters params = new PageParameters();
params.put("layer", demo.getLayer().prefixedName());
params.add("layer", demo.getLayer().prefixedName());
if (workspace == null) {
params.put("style", name);
params.add("style", name);
} else {
params.put("style", workspace + ":" + name);
params.add("style", workspace + ":" + name);
}
setResponsePage(CssDemoPage.class, params);
}
......
......@@ -114,8 +114,8 @@ class OpenLayersMapPanel extends Panel implements IHeaderContributor {
Template template = templates.getTemplate("ol-load.ftl");
StringWriter script = new java.io.StringWriter();
template.process(context, script);
header.renderJavascriptReference("../openlayers/OpenLayers.js");
header.renderOnLoadJavascript(script.toString());
header.renderJavaScriptReference("../openlayers/OpenLayers.js");
header.renderOnLoadJavaScript(script.toString());
}
public String getUpdateCommand() throws IOException, TemplateException {
......
......@@ -8,7 +8,6 @@ import java.util.Arrays;
import java.util.List;
import org.apache.wicket.Component;
import org.apache.wicket.PageParameters;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.AjaxLink;
import org.apache.wicket.markup.html.basic.Label;
......@@ -16,6 +15,7 @@ import org.apache.wicket.markup.html.panel.Fragment;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.geoserver.catalog.StyleInfo;
import org.geoserver.catalog.WorkspaceInfo;
import org.geoserver.web.wicket.GeoServerDataProvider;
......@@ -64,15 +64,15 @@ public class StyleChooser extends Panel {
public void onClick(AjaxRequestTarget target) {
PageParameters params = new PageParameters();
params.put(
params.add(
"layer",
demo.getLayer().prefixedName()
);
WorkspaceInfo workspace = style.getWorkspace();
if (workspace == null) {
params.put("style", style.getName());
params.add("style", style.getName());
} else {
params.put("style", workspace.getName() + ":" + style.getName());
params.add("style", workspace.getName() + ":" + style.getName());
}
setResponsePage(CssDemoPage.class, params);
}
......
......@@ -2,7 +2,6 @@ package org.geoserver.community.css.web;
import org.apache.wicket.ajax.markup.html.AjaxLink;
import org.apache.wicket.extensions.ajax.markup.html.tabs.AjaxTabbedPanel;
import org.apache.wicket.markup.html.panel.EmptyPanel;
import org.geoserver.web.GeoServerWicketTestSupport;
import org.geoserver.web.wicket.GeoServerTablePanel;
import org.junit.Test;
......
......@@ -4,9 +4,9 @@
*/
package org.geoserver.csw.web;
import org.apache.wicket.PageParameters;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.model.IModel;
import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.geoserver.csw.CSWInfo;
import org.geoserver.web.services.BaseServiceAdminPage;
......
......@@ -44,10 +44,10 @@ public class UniqueResourceIdentifiersEditorTest extends GeoServerWicketTestSupp
// print(tester.getLastRenderedPage(), true, true);
tester.assertComponent("form", Form.class);
tester.assertModelValue("form:panel:container:identifiers:listContainer:items:1:itemProperties:0:component:border:txt", "one");
tester.assertModelValue("form:panel:container:identifiers:listContainer:items:1:itemProperties:1:component:border:txt", "http://www.geoserver.org/one");
tester.assertModelValue("form:panel:container:identifiers:listContainer:items:2:itemProperties:0:component:border:txt", "two");
tester.assertModelValue("form:panel:container:identifiers:listContainer:items:2:itemProperties:1:component:border:txt", "http://www.geoserver.org/two");
tester.assertModelValue("form:panel:container:identifiers:listContainer:items:1:itemProperties:0:component:border:border_body:txt", "one");
tester.assertModelValue("form:panel:container:identifiers:listContainer:items:1:itemProperties:1:component:border:border_body:txt", "http://www.geoserver.org/one");
tester.assertModelValue("form:panel:container:identifiers:listContainer:items:2:itemProperties:0:component:border:border_body:txt", "two");
tester.assertModelValue("form:panel:container:identifiers:listContainer:items:2:itemProperties:1:component:border:border_body:txt", "http://www.geoserver.org/two");
}
@Test
......@@ -55,18 +55,18 @@ public class UniqueResourceIdentifiersEditorTest extends GeoServerWicketTestSupp
// print(tester.getLastRenderedPage(), true, true);
tester.assertComponent("form", Form.class);
tester.assertModelValue("form:panel:container:identifiers:listContainer:items:1:itemProperties:0:component:border:txt", "one");
tester.assertModelValue("form:panel:container:identifiers:listContainer:items:2:itemProperties:0:component:border:txt", "two");
tester.assertModelValue("form:panel:container:identifiers:listContainer:items:1:itemProperties:0:component:border:border_body:txt", "one");
tester.assertModelValue("form:panel:container:identifiers:listContainer:items:2:itemProperties:0:component:border:border_body:txt", "two");
// remove the first identifier
tester.executeAjaxEvent("form:panel:container:identifiers:listContainer:items:1:itemProperties:2:component:remove", "onclick");
assertNull(tester.getLastRenderedPage().get("form:panel:container:identifiers:listContainer:items:1:itemProperties:0:component:border:txt"));
tester.assertModelValue("form:panel:container:identifiers:listContainer:items:2:itemProperties:0:component:border:txt", "two");
assertNull(tester.getLastRenderedPage().get("form:panel:container:identifiers:listContainer:items:1:itemProperties:0:component:border:border_body:txt"));
tester.assertModelValue("form:panel:container:identifiers:listContainer:items:2:itemProperties:0:component:border:border_body:txt", "two");
// remove the second as well
tester.executeAjaxEvent("form:panel:container:identifiers:listContainer:items:2:itemProperties:2:component:remove", "onclick");
assertNull(tester.getLastRenderedPage().get("form:panel:container:identifiers:listContainer:items:1:itemProperties:0:component:border:txt"));
assertNull(tester.getLastRenderedPage().get("form:panel:container:identifiers:listContainer:items:2:itemProperties:0:component:border:txt"));
assertNull(tester.getLastRenderedPage().get("form:panel:container:identifiers:listContainer:items:1:itemProperties:0:component:border:border_body:txt"));
assertNull(tester.getLastRenderedPage().get("form:panel:container:identifiers:listContainer:items:2:itemProperties:0:component:border:border_body:txt"));
// print(tester.getLastRenderedPage(), true, true);
......@@ -82,8 +82,8 @@ public class UniqueResourceIdentifiersEditorTest extends GeoServerWicketTestSupp
tester.executeAjaxEvent("form:panel:addIdentifier", "onclick");
// new empty line
tester.assertModelValue("form:panel:container:identifiers:listContainer:items:3:itemProperties:0:component:border:txt", null);
tester.assertModelValue("form:panel:container:identifiers:listContainer:items:3:itemProperties:1:component:border:txt", null);
tester.assertModelValue("form:panel:container:identifiers:listContainer:items:3:itemProperties:0:component:border:border_body:txt", null);
tester.assertModelValue("form:panel:container:identifiers:listContainer:items:3:itemProperties:1:component:border:border_body:txt", null);
// try to submit, should complain about invalid code
FormTester ft = tester.newFormTester("form");
......@@ -96,24 +96,24 @@ public class UniqueResourceIdentifiersEditorTest extends GeoServerWicketTestSupp
// submit with just code, that is fine
ft = tester.newFormTester("form");
ft.setValue("panel:container:identifiers:listContainer:items:3:itemProperties:0:component:border:txt", "code");
ft.setValue("panel:container:identifiers:listContainer:items:3:itemProperties:0:component:border:border_body:txt", "code");
ft.submit();
tester.assertNoErrorMessage();
tester.assertModelValue("form:panel:container:identifiers:listContainer:items:3:itemProperties:0:component:border:txt", "code");
tester.assertModelValue("form:panel:container:identifiers:listContainer:items:3:itemProperties:0:component:border:border_body:txt", "code");
// now provide an invalid namespace (not a valid URI)
ft = tester.newFormTester("form");
ft.setValue("panel:container:identifiers:listContainer:items:3:itemProperties:1:component:border:txt", "invalid uri");
ft.setValue("panel:container:identifiers:listContainer:items:3:itemProperties:1:component:border:border_body:txt", "invalid uri");
ft.submit();
messages = tester.getMessages(FeedbackMessage.ERROR);
assertEquals(1, messages.size());
// finally, set a valid namespace
ft = tester.newFormTester("form");
ft.setValue("panel:container:identifiers:listContainer:items:3:itemProperties:1:component:border:txt", "http://www.geoserver.org/meta");
ft.setValue("panel:container:identifiers:listContainer:items:3:itemProperties:1:component:border:border_body:txt", "http://www.geoserver.org/meta");
ft.submit();
tester.assertNoErrorMessage();
tester.assertModelValue("form:panel:container:identifiers:listContainer:items:3:itemProperties:1:component:border:txt", "http://www.geoserver.org/meta");
tester.assertModelValue("form:panel:container:identifiers:listContainer:items:3:itemProperties:1:component:border:border_body:txt", "http://www.geoserver.org/meta");
}
......
......@@ -106,11 +106,13 @@ public class ComplexInputPanel extends Panel {
// data as plain text
Fragment f = new Fragment("editor", "text", this);
DropDownChoice mimeChoice = new DropDownChoice("mime", new PropertyModel(
DropDownChoice<String> mimeChoice = new DropDownChoice<String>("mime", new PropertyModel(
getDefaultModel(), "mime"), mimeTypes);
f.add(mimeChoice);
f.add(new TextArea("textarea", valueModel));
TextArea<String> ta = new TextArea<String>("textarea", valueModel);
ta.setType(String.class); // work around for https://issues.apache.org/jira/browse/WICKET-4755
f.add(ta);
add(f);
} else if (pt == ParameterType.VECTOR_LAYER) {
// an internal vector layer
......
......@@ -69,14 +69,14 @@ public class WPSAdminPage extends BaseServiceAdminPage<WPSInfo> {
WPSInfo wpsInfo = (WPSInfo) info.getObject();
processFactories = cloneFactoryInfos(wpsInfo.getProcessGroups());
ProcessFactoryInfoProvider provider = new ProcessFactoryInfoProvider(processFactories, getLocale());
GeoServerTablePanel<ProcessGroupInfo> processFilterEditor = new GeoServerTablePanel<ProcessGroupInfo>("processFilterTable", provider) {
final GeoServerTablePanel<ProcessGroupInfo> processFilterEditor = new GeoServerTablePanel<ProcessGroupInfo>("processFilterTable", provider) {
@Override
protected Component getComponentForProperty(String id, final IModel itemModel,
Property<ProcessGroupInfo> property) {
if(property.getName().equals("enabled")) {
Fragment fragment = new Fragment(id, "enabledFragment", WPSAdminPage.this);
Fragment fragment = new Fragment(id, "enabledFragment", form);
CheckBox enabled = new CheckBox("enabled", property.getModel(itemModel));
enabled.setOutputMarkupId(true);
fragment.add(enabled);
......@@ -88,7 +88,7 @@ public class WPSAdminPage extends BaseServiceAdminPage<WPSInfo> {
} else if(property.getName().equals("summary")) {
return new Label(id, property.getModel(itemModel));
} else if(property.getName().equals("edit")) {
Fragment fragment = new Fragment(id, "linkFragment", WPSAdminPage.this);
Fragment fragment = new Fragment(id, "linkFragment", form);
// we use a submit link to avoid losing the other edits in the form
SubmitLink link = new SubmitLink("link") {
......
......@@ -150,7 +150,7 @@ public class WPSRequestBuilderPanel extends Panel {
item.add(input);
} else {
Fragment f = new Fragment("paramValue", "literal", WPSRequestBuilderPanel.this);
FormComponent literal = new TextField("literalValue", property);
FormComponent literal = new TextField("literalValue", property, String.class);
literal.setRequired(p.minOccurs > 0);
literal.setLabel(new Model<String>(p.key));
f.add(literal);
......
......@@ -72,10 +72,10 @@ public class WPSRequestBuilderTest extends GeoServerWicketTestSupport {
form.submit();
tester.clickLink("form:execute", true);
// print(tester.getLastRenderedPage(), true, true);
print(tester.getLastRenderedPage(), true, true);
assertTrue(tester.getComponentFromLastRenderedPage("responseWindow")
.getDefaultModelObjectAsString().contains("wps:Execute"));
String ms = tester.getComponentFromLastRenderedPage("responseWindow").getDefaultModelObjectAsString();
assertTrue(ms.contains("wps:Execute"));
// unfortunately the wicket tester does not allow us to get work with the popup window
// contents,
......
This diff is collapsed.
......@@ -4,7 +4,8 @@
*/
package org.geoserver.web;
import static org.apache.wicket.RuntimeConfigurationType.*;
import static org.apache.wicket.RuntimeConfigurationType.DEPLOYMENT;
import static org.apache.wicket.RuntimeConfigurationType.DEVELOPMENT;
import java.io.File;
import java.net.URI;
......@@ -20,6 +21,8 @@ import org.apache.wicket.IConverterLocator;
import org.apache.wicket.Page;
import org.apache.wicket.RuntimeConfigurationType;
import org.apache.wicket.Session;
import org.apache.wicket.markup.html.IPackageResourceGuard;
import org.apache.wicket.markup.html.SecurePackageResourceGuard;
import org.apache.wicket.protocol.http.PageExpiredException;
import org.apache.wicket.request.IRequestHandler;
import org.apache.wicket.request.IRequestMapper;
......
......@@ -22,7 +22,6 @@ import org.apache.wicket.model.LoadableDetachableModel;
import org.apache.wicket.model.Model;
import org.apache.wicket.model.ResourceModel;
import org.apache.wicket.model.StringResourceModel;
import org.apache.wicket.protocol.http.WebRequest;
import org.geoserver.catalog.Catalog;
import org.geoserver.catalog.LayerInfo;
import org.geoserver.catalog.StoreInfo;
......@@ -31,7 +30,6 @@ import org.geoserver.config.ContactInfo;
import org.geoserver.config.GeoServer;
import org.geoserver.config.ServiceInfo;
import org.geoserver.platform.GeoServerExtensions;
import org.geoserver.security.GeoServerSecurityFilterChainProxy;
import org.geoserver.security.GeoServerSecurityManager;
import org.geoserver.web.data.layer.LayerPage;
import org.geoserver.web.data.layer.NewLayerPage;
......@@ -41,7 +39,6 @@ import org.geoserver.web.data.workspace.WorkspaceNewPage;
import org.geoserver.web.data.workspace.WorkspacePage;
import org.opengis.filter.Filter;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.GrantedAuthority;
import com.google.common.base.Stopwatch;
......
......@@ -8,14 +8,13 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.apache.wicket.protocol.http.servlet.ServletWebRequest;
import org.geoserver.security.GeoServerSecurityFilterChainProxy;
import org.springframework.security.authentication.AnonymousAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.authentication.AnonymousAuthenticationToken;
import org.springframework.security.web.PortResolverImpl;
import org.springframework.security.web.savedrequest.DefaultSavedRequest;
import org.springframework.security.web.savedrequest.SavedRequest;
import org.apache.wicket.protocol.http.WebRequest;
import org.geoserver.security.GeoServerSecurityFilterChainProxy;
/**
......
......@@ -138,7 +138,8 @@ public class LayerGroupEntryPanel extends Panel {
Component layerLink(String id, IModel itemModel) {
LayerGroupEntry entry = (LayerGroupEntry) itemModel.getObject();
return new Label( id, entry.getLayer().prefixedName());
PublishedInfo layer = entry.getLayer();
return new Label( id, layer.prefixedName());
}
Component defaultStyleCheckbox(String id, IModel itemModel) {
......
......@@ -8,7 +8,7 @@ import org.apache.wicket.markup.html.form.CheckBox;
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.geoserver.catalog.ResourceInfo;
import org.geoserver.web.util.MapModel;
......@@ -21,7 +21,7 @@ public class HTTPLayerConfig extends LayerConfigurationPanel {
super(id, model);
add(new CheckBox(ResourceInfo.CACHING_ENABLED, new MapModel(new PropertyModel(model, "resource.metadata"), "cachingEnabled")));
TextField maxAge = new TextField(ResourceInfo.CACHE_AGE_MAX, new MapModel(new PropertyModel(model, "resource.metadata"), "cacheAgeMax"), Long.class);
maxAge.add(NumberValidator.range(0, Long.MAX_VALUE));
maxAge.add(new RangeValidator<Long>(0l, Long.MAX_VALUE));
add(maxAge);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment