Commit 12f5bc84 authored by Gianluca Filippone's avatar Gianluca Filippone
Browse files

Fixed Enactment Engine update from EE extension

parent 57217115
...@@ -22,6 +22,7 @@ import org.apache.syncope.client.console.SyncopeConsoleSession; ...@@ -22,6 +22,7 @@ import org.apache.syncope.client.console.SyncopeConsoleSession;
import org.apache.syncope.client.console.commons.Constants; import org.apache.syncope.client.console.commons.Constants;
import org.apache.syncope.client.console.pages.BasePage; import org.apache.syncope.client.console.pages.BasePage;
import static org.apache.syncope.client.console.panels.AbstractModalPanel.LOG; import static org.apache.syncope.client.console.panels.AbstractModalPanel.LOG;
import org.apache.syncope.client.console.rest.EnactmentEngineRestClient;
import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal; import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
import org.apache.syncope.common.lib.SyncopeClientException; import org.apache.syncope.common.lib.SyncopeClientException;
import org.apache.syncope.common.lib.to.AnyObjectTO; import org.apache.syncope.common.lib.to.AnyObjectTO;
...@@ -33,12 +34,15 @@ public class EditEnactmentEngineModalPanel extends AbstractEnactmentEngineModalP ...@@ -33,12 +34,15 @@ public class EditEnactmentEngineModalPanel extends AbstractEnactmentEngineModalP
private final AnyObjectTO enactmentEngine; private final AnyObjectTO enactmentEngine;
private final EnactmentEngineRestClient restClient;
public EditEnactmentEngineModalPanel( public EditEnactmentEngineModalPanel(
final BaseModal<Serializable> modal, final BaseModal<Serializable> modal,
final PageReference pageRef, final PageReference pageRef,
final AnyObjectTO enactmentEngine) { final AnyObjectTO enactmentEngine) {
super(modal, pageRef); super(modal, pageRef);
this.enactmentEngine = enactmentEngine; this.enactmentEngine = enactmentEngine;
this.restClient = new EnactmentEngineRestClient();
nameInput.setModelObject(enactmentEngine.getName()); nameInput.setModelObject(enactmentEngine.getName());
urlInput.setModelObject(enactmentEngine.getPlainAttrMap().get("enactmentEngineBaseURL").getValues().get(0)); urlInput.setModelObject(enactmentEngine.getPlainAttrMap().get("enactmentEngineBaseURL").getValues().get(0));
...@@ -59,6 +63,7 @@ public class EditEnactmentEngineModalPanel extends AbstractEnactmentEngineModalP ...@@ -59,6 +63,7 @@ public class EditEnactmentEngineModalPanel extends AbstractEnactmentEngineModalP
enactmentEngineTO.setBaseUrl(urlInput.getModelObject()); enactmentEngineTO.setBaseUrl(urlInput.getModelObject());
enactmentEngineTO.setUsername(usernameInput.getModelObject()); enactmentEngineTO.setUsername(usernameInput.getModelObject());
enactmentEngineTO.setPassword(passwordInput.getModelObject()); enactmentEngineTO.setPassword(passwordInput.getModelObject());
restClient.update(enactmentEngineTO);
modal.close(target); modal.close(target);
SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED)); SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
} catch (SyncopeClientException e) { } catch (SyncopeClientException e) {
......
...@@ -30,6 +30,7 @@ import org.apache.syncope.common.lib.types.AnyTypeKind; ...@@ -30,6 +30,7 @@ import org.apache.syncope.common.lib.types.AnyTypeKind;
import org.apache.wicket.PageReference; import org.apache.wicket.PageReference;
import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxLink; import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxLink;
import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator; import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn; import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn; import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
...@@ -53,6 +54,14 @@ public class EnactmentEngineDirectoryPanel extends AnyObjectDirectoryPanel { ...@@ -53,6 +54,14 @@ public class EnactmentEngineDirectoryPanel extends AnyObjectDirectoryPanel {
utilityModal.addSubmitButton(); utilityModal.addSubmitButton();
utilityModal.size(Modal.Size.Medium); utilityModal.size(Modal.Size.Medium);
addOuterObject(utilityModal); addOuterObject(utilityModal);
utilityModal.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
@Override
public void onClose(final AjaxRequestTarget target) {
target.add(container);
utilityModal.show(false);
}
});
} }
@Override @Override
......
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