@Override public void onSubmit() { setResponsePage(new NewRolePage(roleServiceName).setReturnPage(this.getPage())); } }.setVisible(roleService.canCreateStore()));
public NewRolePage(String roleServiceName) { super(roleServiceName, null); if (hasRoleStore(roleServiceName)==false) { throw new RuntimeException("Workflow error, new role not possible for read only service"); } }
@Override protected void onFormSubmit(GeoServerRole role) throws IOException { GeoServerRoleStore store = null; try { store = new RoleStoreValidationWrapper(getRoleStore(roleServiceName)); //copy into a new one so we can set the name properly GeoServerRole newRole= store.createRoleObject(get("form:name").getDefaultModelObjectAsString()); newRole.setUserName(role.getUserName()); newRole.getProperties().putAll(role.getProperties()); role = newRole; store.addRole(role); String parentRoleName = get("form:parent").getDefaultModelObjectAsString(); if (parentRoleName != null) { GeoServerRole parentRole = store.getRoleByName(parentRoleName); store.setParentRole(role, parentRole); } store.store(); } catch (IOException ex) { try {store.load(); } catch (IOException ex2) {}; throw ex; } }
@Override protected void onFormSubmit(GeoServerRole role) throws IOException { GeoServerRoleStore store = null; try { //copy into a new one so we can set the name properly GeoServerRole newRole = new GeoServerRole(get("form:name").getDefaultModelObjectAsString()); newRole.setUserName(role.getUserName()); newRole.getProperties().putAll(role.getProperties()); role = newRole; store = new RoleStoreValidationWrapper(getRoleStore(roleServiceName)); store.addRole(role); String parentRoleName = get("form:parent").getDefaultModelObjectAsString(); if (parentRoleName != null) { GeoServerRole parentRole = store.getRoleByName(parentRoleName); store.setParentRole(role, parentRole); } store.store(); } catch (IOException ex) { try {store.load(); } catch (IOException ex2) {}; throw ex; } }
@Override public void onSubmit() { setResponsePage( new NewRolePage(roleServiceName).setReturnPage(this.getPage())); } }.setVisible(roleService.canCreateStore()));
try { store = new RoleStoreValidationWrapper(getRoleStore(roleServiceName)); store.createRoleObject(get("form:name").getDefaultModelObjectAsString()); newRole.setUserName(role.getUserName()); newRole.getProperties().putAll(role.getProperties()); store.addRole(role); String parentRoleName = get("form:parent").getDefaultModelObjectAsString(); if (parentRoleName != null) { GeoServerRole parentRole = store.getRoleByName(parentRoleName);
public NewRolePage(String roleServiceName) { super(roleServiceName, null); if (hasRoleStore(roleServiceName) == false) { throw new RuntimeException( "Workflow error, new role not possible for read only service"); } }
@Override public void onClick() { setResponsePage( new NewRolePage(roleServiceName).setReturnPage(getPage())); } });
public NewRolePage(String roleServiceName) { super(roleServiceName, new GeoServerRole(GeoServerRole.NULL_ROLE.getAuthority())); if (hasRoleStore(roleServiceName)==false) { throw new RuntimeException("Workflow error, new role not possible for read only service"); } }
@Override public void onClick() { setResponsePage(new NewRolePage(roleServiceName).setReturnPage(getPage())); } });
@Override public void onSubmit() { setResponsePage(new NewRolePage(roleServiceName).setReturnPage(this.getPage())); } }.setVisible(roleService.canCreateStore()));
@Override public void onClick() { setResponsePage(new NewRolePage(roleServiceName).setReturnPage(getPage())); } });