Skip to content

Commit

Permalink
Web/Security/Core compiles
Browse files Browse the repository at this point in the history
  • Loading branch information
aaime committed Jan 18, 2016
1 parent f268b3e commit 84ac7d8
Show file tree
Hide file tree
Showing 20 changed files with 44 additions and 43 deletions.
Expand Up @@ -140,7 +140,7 @@ List<SecurityNamedServicePanelInfo> lookupPanelInfos(Class<S> serviceClass) {

static abstract class AjaxLinkGroup<T> extends ListView<T> {

public AjaxLinkGroup(String id, List<? extends T> list) {
public AjaxLinkGroup(String id, List<T> list) {
super(id, list);
}

Expand Down
Expand Up @@ -224,7 +224,7 @@ public SecurityNamedServiceTablePanel(String id, SecurityNamedServiceProvider<T>
}

@Override
protected Component getComponentForProperty(String id, IModel itemModel, Property<T> property) {
protected Component getComponentForProperty(String id, IModel<T> itemModel, Property<T> property) {
if (property == NAME) {
return createEditLink(id, itemModel, property);
}
Expand Down
Expand Up @@ -121,7 +121,7 @@ void handleException(Exception e, Component target) {
Serializable msg = null;
if (e instanceof SecurityConfigException) {
SecurityConfigException sce = (SecurityConfigException)e;
msg = new StringResourceModel("security."+sce.getId(),null,sce.getArgs()).getObject();
msg = new StringResourceModel("security."+sce.getId()).setParameters(sce.getArgs()).getObject();
}
else {
msg = e;
Expand Down Expand Up @@ -174,7 +174,7 @@ protected void onClick(AjaxRequestTarget target) {
}

@Override
protected Component getComponentForProperty(String id, IModel itemModel,
protected Component getComponentForProperty(String id, IModel<RequestFilterChain> itemModel,
Property<RequestFilterChain> property) {

if (property == NAME) {
Expand Down
Expand Up @@ -52,7 +52,7 @@ public DataAccessRulePage() {
add(rules = new GeoServerTablePanel<DataAccessRule>("table", provider, true) {

@Override
protected Component getComponentForProperty(String id, IModel itemModel,
protected Component getComponentForProperty(String id, IModel<DataAccessRule> itemModel,
Property<DataAccessRule> property) {
if (property == DataAccessRuleProvider.RULEKEY) {
return editRuleLink(id, itemModel, property);
Expand Down
Expand Up @@ -53,7 +53,7 @@ public DataSecurityPage() {
add(rules = new GeoServerTablePanel<DataAccessRule>("table", provider, true) {

@Override
protected Component getComponentForProperty(String id, IModel itemModel,
protected Component getComponentForProperty(String id, IModel<DataAccessRule> itemModel,
Property<DataAccessRule> property) {
if (property == DataAccessRuleProvider.RULEKEY) {
return editRuleLink(id, itemModel, property);
Expand Down
Expand Up @@ -59,7 +59,7 @@ public GroupPanel(String id, String serviceName) {
add(groups = new GeoServerTablePanel<GeoServerUserGroup>("table", provider, true) {

@Override
protected Component getComponentForProperty(String id, IModel itemModel,
protected Component getComponentForProperty(String id, IModel<GeoServerUserGroup> itemModel,
Property<GeoServerUserGroup> property) {
if (property == GroupListProvider.GROUPNAME) {
return editGroupLink(id, itemModel, property);
Expand Down
Expand Up @@ -45,12 +45,11 @@ public void onSubmit() {
}
try {
if (dumpMasterPassword()) {
info (new StringResourceModel("dumpInfo", this,null,
new Object[] {new File(fileName).getCanonicalFile()}).getString());
info (new StringResourceModel("dumpInfo", this).setParameters(new File(fileName).getCanonicalFile()).getString());
}

else
error(new StringResourceModel("unauthorized", this,null).getString());
error(new StringResourceModel("unauthorized", this).getString());
} catch (Exception e) {
error(e);
}
Expand Down
Expand Up @@ -16,16 +16,17 @@
import org.geoserver.security.password.URLMasterPasswordProviderConfig;
import org.geoserver.web.wicket.HelpLink;

@SuppressWarnings("serial")
public class URLMasterPasswordProviderPanel
extends MasterPasswordProviderPanel<URLMasterPasswordProviderConfig> {

public URLMasterPasswordProviderPanel(String id, IModel<URLMasterPasswordProviderConfig> model) {
super(id, model);

add(new HelpLink("urlHelp", this).setDialog(dialog));
add(new TextField("uRL", URL.class) {
add(new TextField<URL>("uRL", URL.class) {
@Override
public IConverter getConverter(Class<?> type) {
public <C> IConverter<C> getConverter(Class<C> type) {
return new IConverter() {
@Override
public String convertToString(Object value, Locale locale) {
Expand Down
Expand Up @@ -51,11 +51,10 @@ protected AbstractRolePage(String roleService,GeoServerRole role) {

StringResourceModel descriptionModel;
if (role.getUserName() != null) {
descriptionModel = new StringResourceModel("personalizedRole", getPage(), null,
new Object[]{role.getUserName()});
descriptionModel = new StringResourceModel("personalizedRole", getPage()).setParameters(role.getUserName());
}
else {
descriptionModel = new StringResourceModel("anonymousRole", getPage(), null);
descriptionModel = new StringResourceModel("anonymousRole", getPage());
}
form.add(new Label("description", descriptionModel));

Expand Down
Expand Up @@ -48,7 +48,7 @@ public RolePanel(String id, String serviceName) {
add(roles = new GeoServerTablePanel<GeoServerRole>("table", provider, true) {

@Override
protected Component getComponentForProperty(String id, IModel itemModel,
protected Component getComponentForProperty(String id, IModel<GeoServerRole> itemModel,
Property<GeoServerRole> property) {
if (property == RoleListProvider.ROLENAME) {
return editRoleLink(id, itemModel, property);
Expand Down
Expand Up @@ -33,7 +33,7 @@ public ServiceAccessRulePage() {
add(rules = new GeoServerTablePanel<ServiceAccessRule>("table", provider, true) {

@Override
protected Component getComponentForProperty(String id, IModel itemModel,
protected Component getComponentForProperty(String id, IModel<ServiceAccessRule> itemModel,
Property<ServiceAccessRule> property) {
if (property == ServiceAccessRuleProvider.RULEKEY) {
return editRuleLink(id, itemModel, property);
Expand Down
Expand Up @@ -18,6 +18,7 @@
import org.geoserver.web.wicket.SimpleAjaxLink;
import org.geoserver.web.wicket.GeoServerDataProvider.Property;

@SuppressWarnings("serial")
public class UserTablePanel extends GeoServerTablePanel<GeoServerUser> {

String ugServiceName;
Expand All @@ -34,7 +35,7 @@ public UserTablePanel(String id, String ugServiceName, GeoServerDataProvider<Geo
}

@Override
protected Component getComponentForProperty(String id, IModel itemModel,
protected Component getComponentForProperty(String id, IModel<GeoServerUser> itemModel,
Property<GeoServerUser> property) {

if (property == UserListProvider.USERNAME) {
Expand Down
Expand Up @@ -76,11 +76,11 @@ protected Component getFromList(String columnPath, Object columnValue, Property<
MarkupContainer listView = (MarkupContainer) tester.getLastRenderedPage().get(ITEMS_PATH);

@SuppressWarnings("unchecked")
Iterator<MarkupContainer> it = (Iterator<MarkupContainer>) listView.iterator();
Iterator<Component> it = (Iterator<Component>) listView.iterator();

while (it.hasNext()) {
MarkupContainer m = it.next();
Component c = m.get(columnPath);
Component container = it.next();
Component c = container.get(columnPath);
@SuppressWarnings("unchecked")
T modelObject = (T) c.getDefaultModelObject();
if (columnValue.equals(property.getPropertyValue(modelObject)))
Expand Down
Expand Up @@ -12,6 +12,7 @@

import org.apache.wicket.Component;
import org.apache.wicket.MarkupContainer;
import org.apache.wicket.ajax.AjaxRequestHandler;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.AjaxLink;
import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
Expand Down Expand Up @@ -104,9 +105,9 @@ protected DataView<SecurityNamedServiceConfig> getDataView() {
basePage.get(basePanelId + ":table:listContainer:items");
}

protected int countItmes() {
protected long countItems() {
tester.debugComponentTrees();
return getDataView().getItemCount();
return getDataView().getItemCount();
}

protected SecurityNamedServiceConfig getSecurityNamedServiceConfig(String name) {
Expand Down Expand Up @@ -205,7 +206,7 @@ protected void doRemove(String pathForLink, String ... serviceNames) throws Exce
tester.clickLink(basePanelId + ":remove", true);
assertTrue(w.isShown());

((GeoServerDialog)w.getParent()).submit(new AjaxRequestTarget(tester.getLastRenderedPage()));
((GeoServerDialog)w.getParent()).submit(new AjaxRequestHandler(tester.getLastRenderedPage()));
//simulateDeleteSubmit();
//executeModalWindowCloseButtonCallback(w);
}
Expand Down
Expand Up @@ -89,10 +89,10 @@ protected Component getFromList(String columnPath, Object columnValue, Property<
MarkupContainer listView = (MarkupContainer) tester.getLastRenderedPage().get(getItemsPath());

@SuppressWarnings("unchecked")
Iterator<MarkupContainer> it = (Iterator<MarkupContainer>) listView.iterator();
Iterator<Component> it = (Iterator<Component>) listView.iterator();

while (it.hasNext()) {
MarkupContainer m = it.next();
MarkupContainer m = (MarkupContainer) it.next();
Component c = m.get(columnPath);
@SuppressWarnings("unchecked")
T modelObject = (T) c.getDefaultModelObject();
Expand Down
Expand Up @@ -71,7 +71,7 @@ public void testAddModifyRemove() throws Exception{

activatePanel();

assertEquals(1, countItmes());
assertEquals(1, countItems());
assertNotNull(getSecurityNamedServiceConfig("default"));
assertNull(getSecurityNamedServiceConfig("xxxxxxxx"));

Expand All @@ -87,7 +87,7 @@ public void testAddModifyRemove() throws Exception{
clickCancel();

tester.assertRenderedPage(basePage.getClass());
assertEquals(1, countItmes());
assertEquals(1, countItems());
assertNotNull(getSecurityNamedServiceConfig("default"));

clickAddNew();
Expand All @@ -101,7 +101,7 @@ public void testAddModifyRemove() throws Exception{


tester.assertRenderedPage(basePage.getClass());
assertEquals(2, countItmes());
assertEquals(2, countItems());
assertNotNull(getSecurityNamedServiceConfig("default"));

UsernamePasswordAuthenticationProviderConfig authConfig=
Expand Down
Expand Up @@ -67,7 +67,7 @@ public void testAddModify() throws Exception{

activatePanel();

assertEquals(1, countItmes());
assertEquals(1, countItems());
assertNotNull(getSecurityNamedServiceConfig("default"));

assertNull(getSecurityNamedServiceConfig("xxxxxxxx"));
Expand All @@ -84,7 +84,7 @@ public void testAddModify() throws Exception{
clickCancel();

tester.assertRenderedPage(basePage.getClass());
assertEquals(1, countItmes());
assertEquals(1, countItems());
assertNotNull(getSecurityNamedServiceConfig("default"));
assertNull(getSecurityNamedServiceConfig("default2"));

Expand All @@ -97,7 +97,7 @@ public void testAddModify() throws Exception{
clickSave();

tester.assertRenderedPage(basePage.getClass());
assertEquals(2, countItmes());
assertEquals(2, countItems());
assertNotNull(getSecurityNamedServiceConfig("default"));
assertNotNull(getSecurityNamedServiceConfig("default2"));

Expand Down Expand Up @@ -152,11 +152,11 @@ public void testRemove() throws Exception {
getSecurityManager().saveMasterPasswordProviderConfig(config);
activatePanel();

assertEquals(2, countItmes());
assertEquals(2, countItems());

doRemove(null, "default2");
assertNull(getSecurityManager().loadMasterPassswordProviderConfig("default2"));
assertEquals(1, countItmes());
assertEquals(1, countItems());
}

}
Expand Up @@ -104,7 +104,7 @@ public void testAddModify() throws Exception{

activatePanel();

assertEquals(2, countItmes());
assertEquals(2, countItems());
assertNotNull(getSecurityNamedServiceConfig("default"));
assertNull(getSecurityNamedServiceConfig("xxxxxxxx"));

Expand All @@ -122,7 +122,7 @@ public void testAddModify() throws Exception{
clickCancel();

tester.assertRenderedPage(basePage.getClass());
assertEquals(2, countItmes());
assertEquals(2, countItems());
assertNotNull(getSecurityNamedServiceConfig("default"));
assertNotNull(getSecurityNamedServiceConfig("master"));

Expand All @@ -144,7 +144,7 @@ public void testAddModify() throws Exception{

tester.assertRenderedPage(basePage.getClass());

assertEquals(3, countItmes());
assertEquals(3, countItems());
assertNotNull(getSecurityNamedServiceConfig("default"));
assertNotNull(getSecurityNamedServiceConfig("master"));
PasswordPolicyConfig pwConfig=
Expand Down
Expand Up @@ -101,7 +101,7 @@ public void testAddModifyRemove() throws Exception{

activatePanel();

assertEquals(2, countItmes());
assertEquals(2, countItems());
assertNotNull(getSecurityNamedServiceConfig("default"));
assertNotNull(getSecurityNamedServiceConfig("test"));
assertNull(getSecurityNamedServiceConfig("xxxxxxxx"));
Expand All @@ -121,7 +121,7 @@ public void testAddModifyRemove() throws Exception{
clickCancel();

tester.assertRenderedPage(basePage.getClass());
assertEquals(2, countItmes());
assertEquals(2, countItems());
assertNotNull(getSecurityNamedServiceConfig("default"));

clickAddNew();
Expand All @@ -136,7 +136,7 @@ public void testAddModifyRemove() throws Exception{
clickSave();

tester.assertRenderedPage(basePage.getClass());
assertEquals(3, countItmes());
assertEquals(3, countItems());
assertNotNull(getSecurityNamedServiceConfig("default"));

XMLRoleServiceConfig xmlConfig=
Expand Down
Expand Up @@ -104,7 +104,7 @@ public void testAddModify() throws Exception{

activatePanel();

assertEquals(2, countItmes());
assertEquals(2, countItems());
assertNotNull(getSecurityNamedServiceConfig("default"));
assertNotNull(getSecurityNamedServiceConfig("test"));
assertNull(getSecurityNamedServiceConfig("xxxxxxxx"));
Expand All @@ -123,7 +123,7 @@ public void testAddModify() throws Exception{
clickCancel();

tester.assertRenderedPage(basePage.getClass());
assertEquals(2, countItmes());
assertEquals(2, countItems());
assertNotNull(getSecurityNamedServiceConfig("default"));

clickAddNew();
Expand All @@ -142,7 +142,7 @@ public void testAddModify() throws Exception{

tester.assertNoErrorMessage();
tester.assertRenderedPage(basePage.getClass());
assertEquals(3, countItmes());
assertEquals(3, countItems());
assertNotNull(getSecurityNamedServiceConfig("default"));

XMLUserGroupServiceConfig xmlConfig=
Expand Down

0 comments on commit 84ac7d8

Please sign in to comment.