http://git-wip-us.apache.org/repos/asf/syncope/blob/e034afcd/client/console/src/main/java/org/apache/syncope/client/console/panels/UserSearchResultPanel.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/UserSearchResultPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/UserSearchResultPanel.java index 0cbe42a..1fd3289 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/panels/UserSearchResultPanel.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/UserSearchResultPanel.java @@ -28,7 +28,7 @@ import java.util.Date; import java.util.List; import org.apache.syncope.client.console.commons.Constants; import org.apache.syncope.client.console.pages.BasePage; -import org.apache.syncope.client.console.pages.StatusModalPage; +import org.apache.syncope.client.console.pages.StatusModal; import org.apache.syncope.client.console.pages.UserDisplayAttributesModalPage; import org.apache.syncope.client.console.rest.AbstractAnyRestClient; import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.ActionColumn; @@ -130,8 +130,8 @@ public final class UserSearchResultPanel extends AnySearchResultPanel<UserTO> { final IModel<UserTO> model = new CompoundPropertyModel<>(anyTO); modal.setFormModel(model); - target.add(modal.setContent( - new StatusModalPage<>(modal, page.getPageReference(), model.getObject()))); + target.add(modal. + setContent(new StatusModal<>(modal, page.getPageReference(), model.getObject()))); modal.header(new Model<>(MessageFormat.format(getString("any.edit"), anyTO.getKey()))); modal.show(true); @@ -145,8 +145,8 @@ public final class UserSearchResultPanel extends AnySearchResultPanel<UserTO> { final IModel<UserTO> model = new CompoundPropertyModel<>(anyTO); modal.setFormModel(model); - target.add(modal.setContent( - new StatusModalPage<>(modal, page.getPageReference(), model.getObject(), true))); + target.add(modal.setContent(new StatusModal<>(modal, page.getPageReference(), model.getObject(), + true))); modal.header(new Model<>(MessageFormat.format(getString("any.edit"), anyTO.getKey()))); modal.show(true); @@ -156,9 +156,9 @@ public final class UserSearchResultPanel extends AnySearchResultPanel<UserTO> { private static final long serialVersionUID = -7978723352517770644L; @Override - public void onClick(final AjaxRequestTarget target, final UserTO anyTO) { - send(UserSearchResultPanel.this, Broadcast.BREADTH, - new AjaxWizard.NewItemActionEvent<AnyTO>(model.getObject(), target)); + public void onClick(final AjaxRequestTarget target, final UserTO modelObject) { + send(UserSearchResultPanel.this, Broadcast.EXACT, + new AjaxWizard.EditItemActionEvent<AnyTO>(model.getObject(), target)); } }, ActionLink.ActionType.EDIT, entitlement).add(new ActionLink<UserTO>() {
http://git-wip-us.apache.org/repos/asf/syncope/blob/e034afcd/client/console/src/main/java/org/apache/syncope/client/console/rest/AbstractAnyRestClient.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/rest/AbstractAnyRestClient.java b/client/console/src/main/java/org/apache/syncope/client/console/rest/AbstractAnyRestClient.java index 713418f..b477544 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/rest/AbstractAnyRestClient.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/rest/AbstractAnyRestClient.java @@ -39,7 +39,7 @@ public abstract class AbstractAnyRestClient<T extends AnyTO> extends BaseRestCli private static final long serialVersionUID = 1962529678091410544L; - public abstract int count(String realm); + public abstract int count(String realm, String type); public abstract List<T> list(String realm, int page, int size, final SortParam<String> sort, final String type); http://git-wip-us.apache.org/repos/asf/syncope/blob/e034afcd/client/console/src/main/java/org/apache/syncope/client/console/rest/AnyObjectRestClient.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/rest/AnyObjectRestClient.java b/client/console/src/main/java/org/apache/syncope/client/console/rest/AnyObjectRestClient.java index 9296195..b5d0fcc 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/rest/AnyObjectRestClient.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/rest/AnyObjectRestClient.java @@ -48,9 +48,9 @@ public class AnyObjectRestClient extends AbstractAnyRestClient<AnyObjectTO> { } @Override - public int count(final String realm) { - return getService(AnyObjectService.class).list(SyncopeClient.getAnyListQueryBuilder().realm(realm).page(1).size( - 1).build()).getTotalCount(); + public int count(final String type, final String realm) { + return getService(AnyObjectService.class).list( + type, SyncopeClient.getAnyListQueryBuilder().realm(realm).page(1).size(1).build()).getTotalCount(); } @Override http://git-wip-us.apache.org/repos/asf/syncope/blob/e034afcd/client/console/src/main/java/org/apache/syncope/client/console/rest/GroupRestClient.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/rest/GroupRestClient.java b/client/console/src/main/java/org/apache/syncope/client/console/rest/GroupRestClient.java index fe7c7e7..fc060e4 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/rest/GroupRestClient.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/rest/GroupRestClient.java @@ -50,7 +50,7 @@ public class GroupRestClient extends AbstractAnyRestClient<GroupTO> { } @Override - public int count(final String realm) { + public int count(final String realm, final String type) { return getService(GroupService.class). list(SyncopeClient.getAnyListQueryBuilder().realm(realm).page(1).size(1).build()). getTotalCount(); http://git-wip-us.apache.org/repos/asf/syncope/blob/e034afcd/client/console/src/main/java/org/apache/syncope/client/console/rest/UserRestClient.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/rest/UserRestClient.java b/client/console/src/main/java/org/apache/syncope/client/console/rest/UserRestClient.java index 4830ed0..8fb4a6e 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/rest/UserRestClient.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/rest/UserRestClient.java @@ -54,7 +54,7 @@ public class UserRestClient extends AbstractAnyRestClient<UserTO> { } @Override - public int count(final String realm) { + public int count(final String realm, final String type) { return getService(UserService.class). list(SyncopeClient.getAnyListQueryBuilder().realm(realm).page(1).size(1).build()). getTotalCount(); http://git-wip-us.apache.org/repos/asf/syncope/blob/e034afcd/client/console/src/main/java/org/apache/syncope/client/console/wicket/ajax/markup/html/ClearIndicatingAjaxLink.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wicket/ajax/markup/html/ClearIndicatingAjaxLink.java b/client/console/src/main/java/org/apache/syncope/client/console/wicket/ajax/markup/html/ClearIndicatingAjaxLink.java index 70491e2..81aafcf 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/wicket/ajax/markup/html/ClearIndicatingAjaxLink.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/wicket/ajax/markup/html/ClearIndicatingAjaxLink.java @@ -18,7 +18,7 @@ */ package org.apache.syncope.client.console.wicket.ajax.markup.html; -import org.apache.syncope.client.console.pages.BasePage; +import org.apache.syncope.client.console.commons.NotificationAwareComponent; import org.apache.wicket.Page; import org.apache.wicket.PageReference; import org.apache.wicket.ajax.AjaxRequestTarget; @@ -54,9 +54,9 @@ public abstract class ClearIndicatingAjaxLink<T> extends IndicatingAjaxLink<T> { @Override public final void onClick(final AjaxRequestTarget target) { - Page page = pageRef.getPage(); - if (reloadFeedbackPanel && page instanceof BasePage) { - target.add(((BasePage) page).getFeedbackPanel()); + final Page page = pageRef.getPage(); + if (reloadFeedbackPanel && page instanceof NotificationAwareComponent) { + ((NotificationAwareComponent) page).getFeedbackPanel().refresh(target); } onClickInternal(target); } http://git-wip-us.apache.org/repos/asf/syncope/blob/e034afcd/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/bootstrap/dialog/BaseModal.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/bootstrap/dialog/BaseModal.java b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/bootstrap/dialog/BaseModal.java index e030ef7..ff5bc7a 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/bootstrap/dialog/BaseModal.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/bootstrap/dialog/BaseModal.java @@ -26,6 +26,7 @@ import java.io.Serializable; import java.util.ArrayList; import java.util.List; import org.apache.syncope.client.console.commons.Constants; +import org.apache.syncope.client.console.commons.NotificationAwareComponent; import org.apache.syncope.client.console.panels.AbstractModalPanel; import org.apache.syncope.client.console.panels.ModalPanel; import org.apache.syncope.client.console.panels.NotificationPanel; @@ -46,7 +47,7 @@ import org.apache.wicket.model.IModel; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class BaseModal<T extends Serializable> extends Modal<T> { +public class BaseModal<T extends Serializable> extends Modal<T> implements NotificationAwareComponent { private static final long serialVersionUID = -6142277554912316095L; @@ -107,6 +108,7 @@ public class BaseModal<T extends Serializable> extends Modal<T> { } + @Override public NotificationPanel getFeedbackPanel() { return feedbackPanel; } http://git-wip-us.apache.org/repos/asf/syncope/blob/e034afcd/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLink.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLink.java b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLink.java index 1c6731f..6508ab3 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLink.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLink.java @@ -29,6 +29,8 @@ public abstract class ActionLink<T> implements Serializable { private T modelObject; + private boolean enabled = true; + public ActionLink() { } @@ -99,4 +101,17 @@ public abstract class ActionLink<T> implements Serializable { this.reloadFeedbackPanel = reloadFeedbackPanel; return this; } + + protected boolean statusCondition(final T modelObject) { + return true; + } + + public final ActionLink<T> disable() { + this.enabled = false; + return this; + } + + public final boolean isEnabled(final T modelObject) { + return this.enabled && statusCondition(modelObject); + } } http://git-wip-us.apache.org/repos/asf/syncope/blob/e034afcd/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksPanel.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksPanel.java index 3afb43b..868c986 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksPanel.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksPanel.java @@ -115,7 +115,8 @@ public final class ActionLinksPanel<T extends Serializable> extends Panel { public String getAjaxIndicatorMarkupId() { return disableIndicator ? StringUtils.EMPTY : super.getAjaxIndicatorMarkupId(); } - }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload())); + }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()). + setVisible(link.isEnabled(model.getObject()))); break; case MANAGE_RESOURCES: @@ -134,7 +135,8 @@ public final class ActionLinksPanel<T extends Serializable> extends Panel { public String getAjaxIndicatorMarkupId() { return disableIndicator ? StringUtils.EMPTY : super.getAjaxIndicatorMarkupId(); } - }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload())); + }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()). + setVisible(link.isEnabled(model.getObject()))); break; case MANAGE_USERS: @@ -153,7 +155,8 @@ public final class ActionLinksPanel<T extends Serializable> extends Panel { public String getAjaxIndicatorMarkupId() { return disableIndicator ? StringUtils.EMPTY : super.getAjaxIndicatorMarkupId(); } - }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload())); + }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()). + setVisible(link.isEnabled(model.getObject()))); break; case MANAGE_GROUPS: @@ -172,7 +175,8 @@ public final class ActionLinksPanel<T extends Serializable> extends Panel { public String getAjaxIndicatorMarkupId() { return disableIndicator ? StringUtils.EMPTY : super.getAjaxIndicatorMarkupId(); } - }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload())); + }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()). + setVisible(link.isEnabled(model.getObject()))); break; case MAPPING: @@ -191,7 +195,8 @@ public final class ActionLinksPanel<T extends Serializable> extends Panel { public String getAjaxIndicatorMarkupId() { return disableIndicator ? StringUtils.EMPTY : super.getAjaxIndicatorMarkupId(); } - }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload())); + }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()). + setVisible(link.isEnabled(model.getObject()))); break; case ACCOUNT_LINK: @@ -210,7 +215,8 @@ public final class ActionLinksPanel<T extends Serializable> extends Panel { public String getAjaxIndicatorMarkupId() { return disableIndicator ? StringUtils.EMPTY : super.getAjaxIndicatorMarkupId(); } - }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload())); + }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()). + setVisible(link.isEnabled(model.getObject()))); break; case RESET_TIME: @@ -229,7 +235,8 @@ public final class ActionLinksPanel<T extends Serializable> extends Panel { public String getAjaxIndicatorMarkupId() { return disableIndicator ? StringUtils.EMPTY : super.getAjaxIndicatorMarkupId(); } - }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload())); + }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()). + setVisible(link.isEnabled(model.getObject()))); break; case CLONE: @@ -248,7 +255,8 @@ public final class ActionLinksPanel<T extends Serializable> extends Panel { public String getAjaxIndicatorMarkupId() { return disableIndicator ? StringUtils.EMPTY : super.getAjaxIndicatorMarkupId(); } - }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload())); + }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()). + setVisible(link.isEnabled(model.getObject()))); break; case CREATE: @@ -267,7 +275,8 @@ public final class ActionLinksPanel<T extends Serializable> extends Panel { public String getAjaxIndicatorMarkupId() { return disableIndicator ? StringUtils.EMPTY : super.getAjaxIndicatorMarkupId(); } - }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload())); + }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()). + setVisible(link.isEnabled(model.getObject()))); break; case RESET: @@ -286,7 +295,7 @@ public final class ActionLinksPanel<T extends Serializable> extends Panel { public String getAjaxIndicatorMarkupId() { return disableIndicator ? StringUtils.EMPTY : super.getAjaxIndicatorMarkupId(); } - }); + }.setVisible(link.isEnabled(model.getObject()))); break; case EDIT: @@ -305,7 +314,8 @@ public final class ActionLinksPanel<T extends Serializable> extends Panel { public String getAjaxIndicatorMarkupId() { return disableIndicator ? StringUtils.EMPTY : super.getAjaxIndicatorMarkupId(); } - }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload())); + }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()). + setVisible(link.isEnabled(model.getObject()))); break; case USER_TEMPLATE: @@ -324,7 +334,8 @@ public final class ActionLinksPanel<T extends Serializable> extends Panel { public String getAjaxIndicatorMarkupId() { return disableIndicator ? StringUtils.EMPTY : super.getAjaxIndicatorMarkupId(); } - }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload())); + }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()). + setVisible(link.isEnabled(model.getObject()))); break; case GROUP_TEMPLATE: @@ -343,7 +354,8 @@ public final class ActionLinksPanel<T extends Serializable> extends Panel { public String getAjaxIndicatorMarkupId() { return disableIndicator ? StringUtils.EMPTY : super.getAjaxIndicatorMarkupId(); } - }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload())); + }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()). + setVisible(link.isEnabled(model.getObject()))); break; case ENABLE: @@ -362,7 +374,8 @@ public final class ActionLinksPanel<T extends Serializable> extends Panel { public String getAjaxIndicatorMarkupId() { return disableIndicator ? StringUtils.EMPTY : super.getAjaxIndicatorMarkupId(); } - }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload())); + }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()). + setVisible(link.isEnabled(model.getObject()))); break; case SEARCH: @@ -381,7 +394,8 @@ public final class ActionLinksPanel<T extends Serializable> extends Panel { public String getAjaxIndicatorMarkupId() { return disableIndicator ? StringUtils.EMPTY : super.getAjaxIndicatorMarkupId(); } - }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload())); + }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()). + setVisible(link.isEnabled(model.getObject()))); break; case EXECUTE: @@ -400,7 +414,8 @@ public final class ActionLinksPanel<T extends Serializable> extends Panel { public String getAjaxIndicatorMarkupId() { return disableIndicator ? StringUtils.EMPTY : super.getAjaxIndicatorMarkupId(); } - }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload())); + }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()). + setVisible(link.isEnabled(model.getObject()))); break; case DRYRUN: @@ -419,7 +434,8 @@ public final class ActionLinksPanel<T extends Serializable> extends Panel { public String getAjaxIndicatorMarkupId() { return disableIndicator ? StringUtils.EMPTY : super.getAjaxIndicatorMarkupId(); } - }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload())); + }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()). + setVisible(link.isEnabled(model.getObject()))); break; case DELETE: @@ -438,7 +454,8 @@ public final class ActionLinksPanel<T extends Serializable> extends Panel { public String getAjaxIndicatorMarkupId() { return disableIndicator ? StringUtils.EMPTY : super.getAjaxIndicatorMarkupId(); } - }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload())); + }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()). + setVisible(link.isEnabled(model.getObject()))); break; @@ -458,7 +475,8 @@ public final class ActionLinksPanel<T extends Serializable> extends Panel { public String getAjaxIndicatorMarkupId() { return disableIndicator ? StringUtils.EMPTY : super.getAjaxIndicatorMarkupId(); } - }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload())); + }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()). + setVisible(link.isEnabled(model.getObject()))); break; @@ -478,7 +496,8 @@ public final class ActionLinksPanel<T extends Serializable> extends Panel { public String getAjaxIndicatorMarkupId() { return disableIndicator ? StringUtils.EMPTY : super.getAjaxIndicatorMarkupId(); } - }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload())); + }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()). + setVisible(link.isEnabled(model.getObject()))); break; case SUSPEND: @@ -497,7 +516,8 @@ public final class ActionLinksPanel<T extends Serializable> extends Panel { public String getAjaxIndicatorMarkupId() { return disableIndicator ? StringUtils.EMPTY : super.getAjaxIndicatorMarkupId(); } - }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload())); + }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()). + setVisible(link.isEnabled(model.getObject()))); break; case REACTIVATE: @@ -516,7 +536,8 @@ public final class ActionLinksPanel<T extends Serializable> extends Panel { public String getAjaxIndicatorMarkupId() { return disableIndicator ? StringUtils.EMPTY : super.getAjaxIndicatorMarkupId(); } - }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload())); + }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()). + setVisible(link.isEnabled(model.getObject()))); break; case RELOAD: @@ -535,7 +556,8 @@ public final class ActionLinksPanel<T extends Serializable> extends Panel { public String getAjaxIndicatorMarkupId() { return disableIndicator ? StringUtils.EMPTY : super.getAjaxIndicatorMarkupId(); } - }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload())); + }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()). + setVisible(link.isEnabled(model.getObject()))); break; case CHANGE_VIEW: @@ -554,7 +576,8 @@ public final class ActionLinksPanel<T extends Serializable> extends Panel { public String getAjaxIndicatorMarkupId() { return disableIndicator ? StringUtils.EMPTY : super.getAjaxIndicatorMarkupId(); } - }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload())); + }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()). + setVisible(link.isEnabled(model.getObject()))); break; case UNLINK: @@ -573,7 +596,8 @@ public final class ActionLinksPanel<T extends Serializable> extends Panel { public String getAjaxIndicatorMarkupId() { return disableIndicator ? StringUtils.EMPTY : super.getAjaxIndicatorMarkupId(); } - }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload())); + }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()). + setVisible(link.isEnabled(model.getObject()))); break; case LINK: @@ -592,7 +616,8 @@ public final class ActionLinksPanel<T extends Serializable> extends Panel { public String getAjaxIndicatorMarkupId() { return disableIndicator ? StringUtils.EMPTY : super.getAjaxIndicatorMarkupId(); } - }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload())); + }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()). + setVisible(link.isEnabled(model.getObject()))); break; case UNASSIGN: @@ -601,18 +626,19 @@ public final class ActionLinksPanel<T extends Serializable> extends Panel { fragment.addOrReplace( new IndicatingOnConfirmAjaxLink<Void>("unassignLink", pageRef, "confirmUnassign") { - private static final long serialVersionUID = -6957616042924610294L; + private static final long serialVersionUID = -6957616042924610294L; - @Override - protected void onClickInternal(final AjaxRequestTarget target) { - link.onClick(target, model.getObject()); - } + @Override + protected void onClickInternal(final AjaxRequestTarget target) { + link.onClick(target, model.getObject()); + } - @Override - public String getAjaxIndicatorMarkupId() { - return disableIndicator ? StringUtils.EMPTY : super.getAjaxIndicatorMarkupId(); - } - }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload())); + @Override + public String getAjaxIndicatorMarkupId() { + return disableIndicator ? StringUtils.EMPTY : super.getAjaxIndicatorMarkupId(); + } + }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()). + setVisible(link.isEnabled(model.getObject()))); break; case ASSIGN: @@ -631,7 +657,8 @@ public final class ActionLinksPanel<T extends Serializable> extends Panel { public String getAjaxIndicatorMarkupId() { return disableIndicator ? StringUtils.EMPTY : super.getAjaxIndicatorMarkupId(); } - }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload())); + }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()). + setVisible(link.isEnabled(model.getObject()))); break; case DEPROVISION: @@ -640,18 +667,19 @@ public final class ActionLinksPanel<T extends Serializable> extends Panel { fragment.addOrReplace( new IndicatingOnConfirmAjaxLink<Void>("deprovisionLink", pageRef, "confirmDeprovision") { - private static final long serialVersionUID = -6957616042924610295L; + private static final long serialVersionUID = -6957616042924610295L; - @Override - protected void onClickInternal(final AjaxRequestTarget target) { - link.onClick(target, model.getObject()); - } + @Override + protected void onClickInternal(final AjaxRequestTarget target) { + link.onClick(target, model.getObject()); + } - @Override - public String getAjaxIndicatorMarkupId() { - return disableIndicator ? StringUtils.EMPTY : super.getAjaxIndicatorMarkupId(); - } - }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload())); + @Override + public String getAjaxIndicatorMarkupId() { + return disableIndicator ? StringUtils.EMPTY : super.getAjaxIndicatorMarkupId(); + } + }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()). + setVisible(link.isEnabled(model.getObject()))); break; case PROVISION: @@ -670,7 +698,8 @@ public final class ActionLinksPanel<T extends Serializable> extends Panel { public String getAjaxIndicatorMarkupId() { return disableIndicator ? StringUtils.EMPTY : super.getAjaxIndicatorMarkupId(); } - }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload())); + }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()). + setVisible(link.isEnabled(model.getObject()))); break; case ZOOM_IN: fragment = new Fragment("panelZoomIn", "fragmentZoomIn", this); @@ -688,7 +717,8 @@ public final class ActionLinksPanel<T extends Serializable> extends Panel { public String getAjaxIndicatorMarkupId() { return disableIndicator ? StringUtils.EMPTY : super.getAjaxIndicatorMarkupId(); } - }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload())); + }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()). + setVisible(link.isEnabled(model.getObject()))); break; case ZOOM_OUT: fragment = new Fragment("panelZoomOut", "fragmentZoomOut", this); @@ -706,7 +736,8 @@ public final class ActionLinksPanel<T extends Serializable> extends Panel { public String getAjaxIndicatorMarkupId() { return disableIndicator ? StringUtils.EMPTY : super.getAjaxIndicatorMarkupId(); } - }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload())); + }.feedbackPanelAutomaticReload(link.feedbackPanelAutomaticReload()). + setVisible(link.isEnabled(model.getObject()))); break; default: // do nothing http://git-wip-us.apache.org/repos/asf/syncope/blob/e034afcd/client/console/src/main/java/org/apache/syncope/client/console/wizards/AjaxWizard.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/AjaxWizard.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/AjaxWizard.java index 1a1cdc5..d9b76d6 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/AjaxWizard.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/AjaxWizard.java @@ -96,7 +96,7 @@ public abstract class AjaxWizard<T extends Serializable> extends Wizard implemen final AjaxRequestTarget target = RequestCycle.get().find(AjaxRequestTarget.class); try { onCancelInternal(); - send(pageRef.getPage(), Broadcast.DEPTH, new NewItemCancelEvent<T>(item, target)); + send(AjaxWizard.this, Broadcast.BUBBLE, new NewItemCancelEvent<T>(item, target)); } catch (Exception e) { LOG.warn("Wizard error on cancel", e); error(getString("wizard.cancel.error")); @@ -112,7 +112,7 @@ public abstract class AjaxWizard<T extends Serializable> extends Wizard implemen final AjaxRequestTarget target = RequestCycle.get().find(AjaxRequestTarget.class); try { onApplyInternal(); - send(pageRef.getPage(), Broadcast.DEPTH, new NewItemFinishEvent<T>(item, target)); + send(AjaxWizard.this, Broadcast.BUBBLE, new NewItemFinishEvent<T>(item, target)); } catch (Exception e) { LOG.warn("Wizard error on finish", e); error(getString("wizard.apply.error")); @@ -153,10 +153,14 @@ public abstract class AjaxWizard<T extends Serializable> extends Wizard implemen public AjaxRequestTarget getTarget() { return target; } + + public abstract String getEventDescription(); } public static class NewItemActionEvent<T> extends NewItemEvent<T> { + private static final String EVENT_DESCRIPTION = "new"; + private int index = 0; public NewItemActionEvent(final T item, final AjaxRequestTarget target) { @@ -172,22 +176,56 @@ public abstract class AjaxWizard<T extends Serializable> extends Wizard implemen return index; } + @Override + public String getEventDescription() { + return NewItemActionEvent.EVENT_DESCRIPTION; + } + } + + public static class EditItemActionEvent<T> extends NewItemActionEvent<T> { + + private static final String EVENT_DESCRIPTION = "edit"; + + public EditItemActionEvent(final T item, final AjaxRequestTarget target) { + super(item, target); + } + + public EditItemActionEvent(final T item, final int index, final AjaxRequestTarget target) { + super(item, index, target); + } + + @Override + public String getEventDescription() { + return EditItemActionEvent.EVENT_DESCRIPTION; + } } public static class NewItemCancelEvent<T> extends NewItemEvent<T> { + private static final String EVENT_DESCRIPTION = "cancel"; + public NewItemCancelEvent(final T item, final AjaxRequestTarget target) { super(item, target); } + @Override + public String getEventDescription() { + return NewItemCancelEvent.EVENT_DESCRIPTION; + } } public static class NewItemFinishEvent<T> extends NewItemEvent<T> { + private static final String EVENT_DESCRIPTION = "cancel"; + public NewItemFinishEvent(final T item, final AjaxRequestTarget target) { super(item, target); } + @Override + public String getEventDescription() { + return NewItemFinishEvent.EVENT_DESCRIPTION; + } } @Override http://git-wip-us.apache.org/repos/asf/syncope/blob/e034afcd/client/console/src/main/java/org/apache/syncope/client/console/wizards/AjaxWizardBuilder.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/AjaxWizardBuilder.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/AjaxWizardBuilder.java index 2dc47d8..0205e7f 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/AjaxWizardBuilder.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/AjaxWizardBuilder.java @@ -26,9 +26,9 @@ public abstract class AjaxWizardBuilder<T extends Serializable> { private final String id; - private final PageReference pageRef; + protected final PageReference pageRef; - private T defaultItem; + private final T defaultItem; private T item; @@ -103,4 +103,8 @@ public abstract class AjaxWizardBuilder<T extends Serializable> { this.item = item; return this; } + + public PageReference getPageReference() { + return pageRef; + } } http://git-wip-us.apache.org/repos/asf/syncope/blob/e034afcd/client/console/src/main/java/org/apache/syncope/client/console/wizards/WizardMgtPanel.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/WizardMgtPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/WizardMgtPanel.java index f60dbe7..78ff7a9 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/WizardMgtPanel.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/WizardMgtPanel.java @@ -34,7 +34,8 @@ import org.apache.wicket.markup.html.panel.Fragment; import org.apache.wicket.markup.html.panel.Panel; import org.apache.wicket.model.CompoundPropertyModel; import org.apache.wicket.model.IModel; -import org.apache.wicket.model.ResourceModel; +import org.apache.wicket.model.Model; +import org.apache.wicket.model.StringResourceModel; public abstract class WizardMgtPanel<T extends Serializable> extends Panel implements IEventSource { @@ -94,7 +95,7 @@ public abstract class WizardMgtPanel<T extends Serializable> extends Panel imple @Override public void onClick(final AjaxRequestTarget target) { - send(WizardMgtPanel.this, Broadcast.BREADTH, new AjaxWizard.NewItemActionEvent<T>(null, target)); + send(WizardMgtPanel.this, Broadcast.EXACT, new AjaxWizard.NewItemActionEvent<T>(null, target)); } }; @@ -107,15 +108,15 @@ public abstract class WizardMgtPanel<T extends Serializable> extends Panel imple @SuppressWarnings("unchecked") public void onEvent(final IEvent<?> event) { if (event.getPayload() instanceof AjaxWizard.NewItemEvent) { - final AjaxRequestTarget target = AjaxWizard.NewItemEvent.class.cast(event.getPayload()).getTarget(); - - final T item = ((AjaxWizard.NewItemEvent<T>) event.getPayload()).getItem(); + final AjaxWizard.NewItemEvent<T> newItemEvent = AjaxWizard.NewItemEvent.class.cast(event.getPayload()); + final AjaxRequestTarget target = newItemEvent.getTarget(); + final T item = newItemEvent.getItem(); if (event.getPayload() instanceof AjaxWizard.NewItemActionEvent) { newItemPanelBuilder.setItem(item); final AjaxWizard<T> wizard = newItemPanelBuilder.build( - ((AjaxWizard.NewItemActionEvent<T>) event.getPayload()).getIndex(), item != null); + ((AjaxWizard.NewItemActionEvent<T>) newItemEvent).getIndex(), item != null); if (wizardInModal) { final IModel<T> model = new CompoundPropertyModel<>(item); @@ -123,7 +124,11 @@ public abstract class WizardMgtPanel<T extends Serializable> extends Panel imple target.add(modal.setContent(wizard)); - modal.header(new ResourceModel("item.new", "New item")); + modal.header(new StringResourceModel( + String.format("any.%s", newItemEvent.getEventDescription()), + this, + new Model<T>(wizard.getItem()))); + modal.show(true); } else { final Fragment fragment = new Fragment("content", "wizard", WizardMgtPanel.this); http://git-wip-us.apache.org/repos/asf/syncope/blob/e034afcd/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/AnyWizardBuilder.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/AnyWizardBuilder.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/AnyWizardBuilder.java index d49bb89..a817f17 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/AnyWizardBuilder.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/AnyWizardBuilder.java @@ -16,8 +16,10 @@ package org.apache.syncope.client.console.wizards.any; import java.io.Serializable; +import java.util.Collections; import java.util.List; import org.apache.syncope.client.console.commons.Mode; +import org.apache.syncope.client.console.commons.status.StatusBean; import org.apache.syncope.client.console.rest.AnyTypeRestClient; import org.apache.syncope.client.console.wizards.AjaxWizardBuilder; import org.apache.syncope.common.lib.AnyOperations; @@ -27,6 +29,7 @@ import org.apache.syncope.common.lib.to.AnyTO; import org.apache.syncope.common.lib.to.ProvisioningResult; import org.apache.wicket.PageReference; import org.apache.wicket.extensions.wizard.WizardModel; +import org.apache.wicket.model.util.ListModel; public class AnyWizardBuilder<T extends AnyTO> extends AjaxWizardBuilder<T> implements Serializable { @@ -52,6 +55,7 @@ public class AnyWizardBuilder<T extends AnyTO> extends AjaxWizardBuilder<T> impl @Override protected WizardModel buildModelSteps(final T modelObject, final WizardModel wizardModel) { + addOptionalDetailsPanel(modelObject, wizardModel); wizardModel.add(new PlainAttrs(modelObject, null, Mode.ADMIN, anyTypeClasses.toArray(new String[] {}))); wizardModel.add(new DerAttrs(modelObject, anyTypeClasses.toArray(new String[] {}))); wizardModel.add(new VirAttrs(modelObject, anyTypeClasses.toArray(new String[] {}))); @@ -82,4 +86,12 @@ public class AnyWizardBuilder<T extends AnyTO> extends AjaxWizardBuilder<T> impl } } } + + protected AnyWizardBuilder<T> addOptionalDetailsPanel(final T modelObject, final WizardModel wizardModel) { + if (modelObject.getKey() > 0) { + wizardModel.add( + new Details(modelObject, new ListModel<>(Collections.<StatusBean>emptyList()), pageRef, true)); + } + return this; + } } http://git-wip-us.apache.org/repos/asf/syncope/blob/e034afcd/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/ConnObjectPanel.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/ConnObjectPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/ConnObjectPanel.java new file mode 100644 index 0000000..a525613 --- /dev/null +++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/ConnObjectPanel.java @@ -0,0 +1,98 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.syncope.client.console.wizards.any; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import org.apache.syncope.common.lib.to.AttrTO; +import org.apache.syncope.common.lib.to.ConnObjectTO; +import org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel; +import org.apache.syncope.client.console.wicket.markup.html.form.MultiFieldPanel; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.list.ListItem; +import org.apache.wicket.markup.html.list.ListView; +import org.apache.wicket.markup.html.panel.Panel; +import org.apache.wicket.model.IModel; +import org.apache.wicket.model.LoadableDetachableModel; +import org.apache.wicket.model.Model; +import org.apache.wicket.model.util.ListModel; + +public class ConnObjectPanel extends Panel { + + private static final long serialVersionUID = -6469290753080058487L; + + public ConnObjectPanel(final String id, final ConnObjectTO connObjectTO) { + super(id); + + IModel<List<AttrTO>> formProps = new LoadableDetachableModel<List<AttrTO>>() { + + private static final long serialVersionUID = 5275935387613157437L; + + @Override + protected List<AttrTO> load() { + List<AttrTO> attrs = new ArrayList<>(connObjectTO.getPlainAttrs()); + Collections.sort(attrs, new Comparator<AttrTO>() { + + @Override + public int compare(final AttrTO attr1, final AttrTO attr2) { + if (attr1 == null || attr1.getSchema() == null) { + return -1; + } + if (attr2 == null || attr2.getSchema() == null) { + return 1; + } + return attr1.getSchema().compareTo(attr2.getSchema()); + } + }); + + return attrs; + } + }; + + final ListView<AttrTO> propView = new ListView<AttrTO>("propView", formProps) { + + private static final long serialVersionUID = 3109256773218160485L; + + @Override + protected void populateItem(final ListItem<AttrTO> item) { + final AttrTO prop = item.getModelObject(); + + Label label = new Label("key", prop.getSchema()); + item.add(label); + + Panel field; + if (prop.getValues().isEmpty()) { + field = new AjaxTextFieldPanel("attribute", prop.getSchema(), new Model<String>()); + } else if (prop.getValues().size() == 1) { + field = new AjaxTextFieldPanel("attribute", + prop.getSchema(), new Model<String>(prop.getValues().get(0))); + } else { + field = new MultiFieldPanel.Builder<String>(new ListModel<String>(prop.getValues())).build( + "attribute", + prop.getSchema(), + new AjaxTextFieldPanel("panel", prop.getSchema(), new Model<String>())); + } + item.add(field); + } + }; + add(propView); + } +} http://git-wip-us.apache.org/repos/asf/syncope/blob/e034afcd/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Details.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Details.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Details.java new file mode 100644 index 0000000..2ea9476 --- /dev/null +++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/Details.java @@ -0,0 +1,46 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.syncope.client.console.wizards.any; + +import java.util.List; +import org.apache.syncope.client.console.commons.status.StatusBean; +import org.apache.syncope.common.lib.to.AnyTO; +import org.apache.wicket.PageReference; +import org.apache.wicket.extensions.wizard.WizardStep; +import org.apache.wicket.model.IModel; + +public class Details extends WizardStep { + + private static final long serialVersionUID = 6592027822510220463L; + + protected final PageReference pageRef; + + protected final StatusPanel statusPanel; + + public <T extends AnyTO> Details( + final T anyTO, + final IModel<List<StatusBean>> statusModel, + final PageReference pageRef, + final boolean includeStatusPanel) { + this.pageRef = pageRef; + + statusPanel = new StatusPanel("status", anyTO, statusModel, pageRef); + add(statusPanel.setEnabled(includeStatusPanel).setVisible(includeStatusPanel).setRenderBodyOnly(true)); + } +} http://git-wip-us.apache.org/repos/asf/syncope/blob/e034afcd/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/GroupDetails.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/GroupDetails.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/GroupDetails.java index 3613558..0cffa25 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/GroupDetails.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/GroupDetails.java @@ -18,7 +18,9 @@ */ package org.apache.syncope.client.console.wizards.any; +import java.util.List; import org.apache.syncope.client.console.commons.JexlHelpUtils; +import org.apache.syncope.client.console.commons.status.StatusBean; import org.apache.syncope.client.console.rest.GroupRestClient; import org.apache.syncope.client.console.rest.UserRestClient; import org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel; @@ -26,19 +28,19 @@ import org.apache.syncope.common.lib.to.GroupTO; import org.apache.syncope.common.lib.to.UserTO; import org.apache.syncope.common.lib.types.AnyTypeKind; import org.apache.wicket.Page; +import org.apache.wicket.PageReference; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.markup.html.AjaxLink; import org.apache.wicket.event.IEvent; import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxLink; import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow; -import org.apache.wicket.extensions.wizard.WizardStep; import org.apache.wicket.markup.html.WebMarkupContainer; import org.apache.wicket.model.IModel; import org.apache.wicket.model.PropertyModel; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class GroupDetails extends WizardStep { +public class GroupDetails extends Details { private static final long serialVersionUID = 855618618337931784L; @@ -57,7 +59,14 @@ public class GroupDetails extends WizardStep { private final OwnerModel groupOwnerModel; - public GroupDetails(final GroupTO groupTO, final boolean templateMode) { + public GroupDetails( + final GroupTO groupTO, + final IModel<List<StatusBean>> statusModel, + final boolean templateMode, + final PageReference pageRef, + final boolean includeStatusPanel) { + super(groupTO, statusModel, pageRef, includeStatusPanel); + ownerContainer = new WebMarkupContainer("ownerContainer"); ownerContainer.setOutputMarkupId(true); this.add(ownerContainer); http://git-wip-us.apache.org/repos/asf/syncope/blob/e034afcd/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/GroupWizardBuilder.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/GroupWizardBuilder.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/GroupWizardBuilder.java index 7a56b15..ee5e3cb 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/GroupWizardBuilder.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/GroupWizardBuilder.java @@ -15,7 +15,9 @@ */ package org.apache.syncope.client.console.wizards.any; +import java.util.Collections; import java.util.List; +import org.apache.syncope.client.console.commons.status.StatusBean; import org.apache.syncope.client.console.rest.GroupRestClient; import org.apache.syncope.common.lib.AnyOperations; import org.apache.syncope.common.lib.patch.GroupPatch; @@ -23,6 +25,7 @@ import org.apache.syncope.common.lib.to.GroupTO; import org.apache.syncope.common.lib.to.ProvisioningResult; import org.apache.wicket.PageReference; import org.apache.wicket.extensions.wizard.WizardModel; +import org.apache.wicket.model.util.ListModel; public class GroupWizardBuilder extends AnyWizardBuilder<GroupTO> { @@ -44,12 +47,6 @@ public class GroupWizardBuilder extends AnyWizardBuilder<GroupTO> { } @Override - protected WizardModel buildModelSteps(final GroupTO modelObject, final WizardModel wizardModel) { - wizardModel.add(new GroupDetails(modelObject, false)); - return super.buildModelSteps(modelObject, wizardModel); - } - - @Override protected void onApplyInternal(final GroupTO modelObject) { final ProvisioningResult<GroupTO> actual; @@ -64,4 +61,11 @@ public class GroupWizardBuilder extends AnyWizardBuilder<GroupTO> { } } } + + @Override + protected GroupWizardBuilder addOptionalDetailsPanel(final GroupTO modelObject, final WizardModel wizardModel) { + wizardModel.add(new GroupDetails(modelObject, + new ListModel<>(Collections.<StatusBean>emptyList()), false, pageRef, modelObject.getKey() > 0)); + return this; + } } http://git-wip-us.apache.org/repos/asf/syncope/blob/e034afcd/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PasswordPanel.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PasswordPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PasswordPanel.java index 147d5cb..b6a788a 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PasswordPanel.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PasswordPanel.java @@ -38,9 +38,9 @@ public class PasswordPanel extends Panel { public PasswordPanel( final String id, final UserTO userTO, final boolean resetPassword, final boolean templateMode) { super(id); - + setOutputMarkupId(true); - + final Form<?> form = new Form<>("passwordInnerForm"); add(form); http://git-wip-us.apache.org/repos/asf/syncope/blob/e034afcd/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java index 49574c8..2ab5c6f 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/PlainAttrs.java @@ -69,8 +69,8 @@ public class PlainAttrs extends WizardStep { private final String[] anyTypeClass; - public <T extends AnyTO> PlainAttrs(final T entityTO, final Form<?> form, final Mode mode, - final String... anyTypeClass) { + public <T extends AnyTO> PlainAttrs( + final T entityTO, final Form<?> form, final Mode mode, final String... anyTypeClass) { this.setOutputMarkupId(true); this.entityTO = entityTO; http://git-wip-us.apache.org/repos/asf/syncope/blob/e034afcd/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/StatusPanel.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/StatusPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/StatusPanel.java new file mode 100644 index 0000000..2b03146 --- /dev/null +++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/StatusPanel.java @@ -0,0 +1,220 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.syncope.client.console.wizards.any; + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import org.apache.commons.lang3.StringUtils; +import org.apache.syncope.client.console.commons.status.ConnObjectWrapper; +import org.apache.syncope.client.console.commons.status.Status; +import org.apache.syncope.client.console.commons.status.StatusBean; +import org.apache.syncope.client.console.commons.status.StatusUtils; +import org.apache.syncope.client.console.panels.ListViewPanel; +import org.apache.syncope.client.console.rest.GroupRestClient; +import org.apache.syncope.client.console.rest.UserRestClient; +import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink; +import org.apache.syncope.common.lib.to.AnyTO; +import org.apache.syncope.common.lib.to.GroupTO; +import org.apache.syncope.common.lib.to.UserTO; +import org.apache.syncope.common.lib.types.StandardEntitlement; +import org.apache.wicket.Component; +import org.apache.wicket.PageReference; +import org.apache.wicket.ajax.AjaxRequestTarget; +import org.apache.wicket.ajax.markup.html.AjaxLink; +import org.apache.wicket.markup.ComponentTag; +import org.apache.wicket.markup.html.IHeaderContributor; +import org.apache.wicket.markup.html.TransparentWebMarkupContainer; +import org.apache.wicket.markup.html.basic.Label; +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.ResourceModel; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class StatusPanel extends Panel implements IHeaderContributor { + + /** + * Logger. + */ + private static final Logger LOG = LoggerFactory.getLogger(StatusPanel.class); + + private static final long serialVersionUID = -4064294905566247728L; + + private UserRestClient userRestClient = new UserRestClient(); + + private GroupRestClient groupRestClient = new GroupRestClient(); + + private final List<ConnObjectWrapper> connObjects; + + private final Map<String, StatusBean> initialStatusBeanMap; + + private final StatusUtils statusUtils; + + private final ListViewPanel<?> listViewPanel; + + private final TransparentWebMarkupContainer container; + + private final Fragment resourceListFragment; + + public <T extends AnyTO> StatusPanel( + final String id, + final T any, + final IModel<List<StatusBean>> model, + final PageReference pageRef) { + + super(id); + + container = new TransparentWebMarkupContainer("container"); + container.setOutputMarkupPlaceholderTag(true).setOutputMarkupId(true); + add(container); + + resourceListFragment = new Fragment("content", "resources", this); + container.addOrReplace(resourceListFragment); + + statusUtils = new StatusUtils(any instanceof GroupTO ? groupRestClient : userRestClient); + + connObjects = statusUtils.getConnectorObjects(any); + + final List<StatusBean> statusBeans = new ArrayList<>(connObjects.size() + 1); + initialStatusBeanMap = new LinkedHashMap<>(connObjects.size() + 1); + + final StatusBean syncope = new StatusBean(any, "syncope"); + + if (any instanceof UserTO) { + syncope.setConnObjectLink(((UserTO) any).getUsername()); + + Status syncopeStatus = Status.UNDEFINED; + if (((UserTO) any).getStatus() != null) { + try { + syncopeStatus = Status.valueOf(((UserTO) any).getStatus().toUpperCase()); + } catch (IllegalArgumentException e) { + LOG.warn("Unexpected status found: {}", ((UserTO) any).getStatus(), e); + } + } + syncope.setStatus(syncopeStatus); + } else if (any instanceof GroupTO) { + syncope.setConnObjectLink(((GroupTO) any).getDisplayName()); + syncope.setStatus(Status.ACTIVE); + } + + statusBeans.add(syncope); + initialStatusBeanMap.put(syncope.getResourceName(), syncope); + + for (ConnObjectWrapper entry : connObjects) { + final StatusBean statusBean = statusUtils.getStatusBean(entry.getAny(), + entry.getResourceName(), + entry.getConnObjectTO(), + any instanceof GroupTO); + + initialStatusBeanMap.put(entry.getResourceName(), statusBean); + statusBeans.add(statusBean); + } + + ListViewPanel.Builder<StatusBean> builder = new ListViewPanel.Builder<StatusBean>(StatusBean.class, pageRef) { + + private static final long serialVersionUID = 1L; + + @Override + protected Component getValueComponent(final String key, final StatusBean bean) { + if ("status".equalsIgnoreCase(key)) { + return new Label("field", StringUtils.EMPTY) { + + private static final long serialVersionUID = 1L; + + @Override + protected void onComponentTag(final ComponentTag tag) { + super.onComponentTag(tag); + if (bean.getStatus() == Status.OBJECT_NOT_FOUND) { + tag.put("class", "glyphicon glyphicon-remove-circle"); + } else if (bean.getStatus() == Status.UNDEFINED + || bean.getStatus() == Status.CREATED + || bean.getStatus() == Status.NOT_YET_SUBMITTED) { + tag.put("class", "glyphicon glyphicon-question-sign"); + } else if (bean.getStatus() == Status.SUSPENDED) { + tag.put("class", "glyphicon glyphicon-ban-circle"); + } else if (bean.getStatus() == Status.ACTIVE) { + tag.put("class", "glyphicon glyphicon-ok-circle"); + } + + tag.put("alt", "status icon"); + tag.put("title", bean.getStatus().toString()); + } + }; + } else { + return super.getValueComponent(key, bean); + } + } + }; + + builder.setModel(model); + builder.setItems(statusBeans); + builder.includes("resourceName", "connObjectLink", "status"); + builder.withChecks(ListViewPanel.CheckAvailability.DISABLED); + builder.setReuseItem(false); + + builder.addAction(new ActionLink<StatusBean>() { + + private static final long serialVersionUID = -3722207913631435501L; + + @Override + protected boolean statusCondition(final StatusBean bean) { + return statusUtils.getConnObjectTO(bean.getAnyKey(), bean.getResourceName(), connObjects) != null; + } + + @Override + public void onClick(final AjaxRequestTarget target, final StatusBean bean) { + final Fragment remoteObjectFragment = new Fragment("content", "remoteObject", StatusPanel.this); + container.addOrReplace(remoteObjectFragment); + + remoteObjectFragment.add(new AjaxLink<StatusBean>("back") { + + private static final long serialVersionUID = 1L; + + @Override + public void onClick(final AjaxRequestTarget target) { + container.addOrReplace(resourceListFragment); + target.add(container); + } + }); + + remoteObjectFragment.add( + new Label("resource", new ResourceModel(bean.getResourceName(), bean.getResourceName()))); + + remoteObjectFragment.add(new ConnObjectPanel("remoteObject", + statusUtils.getConnObjectTO(bean.getAnyKey(), bean.getResourceName(), connObjects))); + + target.add(container); + } + }, ActionLink.ActionType.SEARCH, StandardEntitlement.RESOURCE_GET_CONNOBJECT); + + listViewPanel = ListViewPanel.class.cast(builder.build("resources")); + resourceListFragment.add(listViewPanel); + } + + public void setCheckAvailability(final ListViewPanel.CheckAvailability check) { + listViewPanel.setCheckAvailability(check); + } + + public Map<String, StatusBean> getInitialStatusBeanMap() { + return initialStatusBeanMap; + } +} http://git-wip-us.apache.org/repos/asf/syncope/blob/e034afcd/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/UserDetails.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/UserDetails.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/UserDetails.java index e669464..4e4b287 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/UserDetails.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/UserDetails.java @@ -20,31 +20,41 @@ package org.apache.syncope.client.console.wizards.any; import de.agilecoders.wicket.core.markup.html.bootstrap.tabs.Collapsible; import java.util.Collections; -import org.apache.syncope.client.console.commons.Constants; +import java.util.List; import org.apache.syncope.client.console.commons.JexlHelpUtils; +import org.apache.syncope.client.console.commons.status.StatusBean; +import org.apache.syncope.client.console.panels.ListViewPanel; import org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel; import org.apache.syncope.client.console.wicket.markup.html.form.FieldPanel; import org.apache.syncope.common.lib.to.UserTO; import org.apache.wicket.Component; -import org.apache.wicket.ajax.AjaxEventBehavior; +import org.apache.wicket.PageReference; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.markup.html.AjaxLink; import org.apache.wicket.extensions.markup.html.tabs.AbstractTab; import org.apache.wicket.extensions.markup.html.tabs.ITab; -import org.apache.wicket.extensions.wizard.WizardStep; +import org.apache.wicket.markup.ComponentTag; import org.apache.wicket.markup.html.WebMarkupContainer; import org.apache.wicket.markup.html.panel.Panel; +import org.apache.wicket.model.IModel; import org.apache.wicket.model.Model; import org.apache.wicket.model.PropertyModel; import org.apache.wicket.model.ResourceModel; -public class UserDetails extends WizardStep { +public class UserDetails extends Details { private static final long serialVersionUID = 6592027822510220463L; - private static final String PASSWORD_CONTENT_PATH = "tabs:0:body:content"; + private static final String PASSWORD_CONTENT_PATH = "body:content"; - public UserDetails(final UserTO userTO, final boolean resetPassword, final boolean templateMode) { + public UserDetails( + final UserTO userTO, + final IModel<List<StatusBean>> statusModel, + final boolean resetPassword, + final boolean templateMode, + final PageReference pageRef, + final boolean includeStatusPanel) { + super(userTO, statusModel, pageRef, includeStatusPanel); // ------------------------ // Username // ------------------------ @@ -87,24 +97,36 @@ public class UserDetails extends WizardStep { @Override protected Component newTitle(final String markupId, final ITab tab, final Collapsible.State state) { - return super.newTitle(markupId, tab, state).add(new AjaxEventBehavior(Constants.ON_CLICK) { + return new AjaxLink<Integer>(markupId) { private static final long serialVersionUID = 1L; @Override - protected void onEvent(final AjaxRequestTarget target) { + protected void onComponentTag(final ComponentTag tag) { + super.onComponentTag(tag); + tag.put("style", "color: #337ab7 !important"); + } + + @Override + public void onClick(final AjaxRequestTarget target) { model.setObject(model.getObject() == 0 ? -1 : 0); - final Component passwordPanel = get(PASSWORD_CONTENT_PATH); - passwordPanel.setEnabled(model.getObject() >= 0); + + boolean enable = model.getObject() >= 0; + + final Component passwordPanel = getParent().get(PASSWORD_CONTENT_PATH); + passwordPanel.setEnabled(enable); + statusPanel.setCheckAvailability(enable + ? ListViewPanel.CheckAvailability.AVAILABLE + : ListViewPanel.CheckAvailability.DISABLED); + target.add(passwordPanel); } - }); + }.setBody(new ResourceModel("password.change", "Change password ...")); } - }; collapsible.setOutputMarkupId(true); add(collapsible); - // ------------------------ + // ------------------------ } } http://git-wip-us.apache.org/repos/asf/syncope/blob/e034afcd/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/UserWizardBuilder.java ---------------------------------------------------------------------- diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/UserWizardBuilder.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/UserWizardBuilder.java index a8a8441..9c24dbc 100644 --- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/UserWizardBuilder.java +++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/UserWizardBuilder.java @@ -15,7 +15,10 @@ */ package org.apache.syncope.client.console.wizards.any; +import java.util.ArrayList; import java.util.List; +import org.apache.syncope.client.console.commons.status.StatusBean; +import org.apache.syncope.client.console.commons.status.StatusUtils; import org.apache.syncope.client.console.rest.UserRestClient; import org.apache.syncope.common.lib.AnyOperations; import org.apache.syncope.common.lib.patch.UserPatch; @@ -23,7 +26,9 @@ import org.apache.syncope.common.lib.to.ProvisioningResult; import org.apache.syncope.common.lib.to.UserTO; import org.apache.wicket.PageReference; import org.apache.wicket.extensions.wizard.WizardModel; +import org.apache.wicket.model.IModel; import org.apache.wicket.model.Model; +import org.apache.wicket.model.util.ListModel; public class UserWizardBuilder extends AnyWizardBuilder<UserTO> { @@ -31,6 +36,8 @@ public class UserWizardBuilder extends AnyWizardBuilder<UserTO> { private final UserRestClient userRestClient = new UserRestClient(); + private final IModel<List<StatusBean>> statusModel; + /** * Construct. * @@ -42,17 +49,12 @@ public class UserWizardBuilder extends AnyWizardBuilder<UserTO> { public UserWizardBuilder( final String id, final UserTO userTO, final List<String> anyTypeClasses, final PageReference pageRef) { super(id, userTO, anyTypeClasses, pageRef); - } - - @Override - protected WizardModel buildModelSteps(final UserTO modelObject, final WizardModel wizardModel) { - wizardModel.add(new UserDetails(modelObject, false, false)); - return super.buildModelSteps(modelObject, wizardModel); + statusModel = new ListModel<>(new ArrayList<StatusBean>()); } @Override protected void onApplyInternal(final UserTO modelObject) { - Model<Boolean> storePassword = new Model<>(true); + Model<Boolean> storePassword = Model.of(true); final ProvisioningResult<UserTO> actual; @@ -61,13 +63,33 @@ public class UserWizardBuilder extends AnyWizardBuilder<UserTO> { } else { final UserPatch patch = AnyOperations.diff(modelObject, getOriginalItem(), true); -// if (statusPanel != null) { -// patch.setPwdPropRequest(statusPanel.getStatusMod()); -// } + if (!statusModel.getObject().isEmpty()) { + patch.setPassword(StatusUtils.buildPasswordPatch(modelObject.getPassword(), statusModel.getObject())); + } + // update user just if it is changed if (!patch.isEmpty()) { actual = userRestClient.update(getOriginalItem().getETagValue(), patch); } } } + + @Override + protected UserWizardBuilder addOptionalDetailsPanel(final UserTO modelObject, final WizardModel wizardModel) { + wizardModel.add(new UserDetails(modelObject, statusModel, false, false, pageRef, modelObject.getKey() > 0)); + return this; + } + + /** + * Overrides default setItem() in order to clean statusModel as well. + * + * @param item item to be set. + * @return the current wizard. + */ + @Override + public UserWizardBuilder setItem(final UserTO item) { + super.setItem(item); + statusModel.getObject().clear(); + return this; + } } http://git-wip-us.apache.org/repos/asf/syncope/blob/e034afcd/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.properties ---------------------------------------------------------------------- diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.properties b/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.properties index 07db51e..05b5945 100644 --- a/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.properties +++ b/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.properties @@ -29,6 +29,6 @@ creationDate=Creation Date tokenValued=Valued tokenNotValued=Not valued -any.edit=Edit object {0} -any.new=New object +any.edit=Edit ${type} ${key} +any.new=New ${type} any.attr.display=Attributes to be displayed http://git-wip-us.apache.org/repos/asf/syncope/blob/e034afcd/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchResultPanel_it.properties ---------------------------------------------------------------------- diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchResultPanel_it.properties b/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchResultPanel_it.properties index 0d0d580..278ca4d 100644 --- a/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchResultPanel_it.properties +++ b/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchResultPanel_it.properties @@ -29,6 +29,6 @@ creationDate=Data Creazione tokenValued=Valued tokenNotValued=Not valued -any.edit=Edit object {0} -any.new=New object +any.edit=Modifica ${type} ${key} +any.new=Nuovo ${type} any.attr.display=Attributes to be displayed http://git-wip-us.apache.org/repos/asf/syncope/blob/e034afcd/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchResultPanel_pt_BR.properties ---------------------------------------------------------------------- diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchResultPanel_pt_BR.properties b/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchResultPanel_pt_BR.properties index e06e38e..5099690 100644 --- a/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchResultPanel_pt_BR.properties +++ b/client/console/src/main/resources/org/apache/syncope/client/console/panels/AbstractSearchResultPanel_pt_BR.properties @@ -29,6 +29,6 @@ creationDate=Data de Cria\u00e7\u00e3o tokenValued=Atribu\u00eddo tokenNotValued=N\u00e3o Atribu\u00eddo -any.edit=Edit object {0} -any.new=New object +any.edit=Alterar ${type} ${key} +any.new=Novo ${type} any.attr.display=Attributes to be displayed http://git-wip-us.apache.org/repos/asf/syncope/blob/e034afcd/client/console/src/main/resources/org/apache/syncope/client/console/panels/ListViewPanel.html ---------------------------------------------------------------------- diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/ListViewPanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/panels/ListViewPanel.html index 4f24eb4..e30cf50 100644 --- a/client/console/src/main/resources/org/apache/syncope/client/console/panels/ListViewPanel.html +++ b/client/console/src/main/resources/org/apache/syncope/client/console/panels/ListViewPanel.html @@ -33,17 +33,27 @@ under the License. <table class="table table-hover"> <tbody> <tr> + <th id="check"> + <input type="checkbox" wicket:id="groupselector" /> + </th> <th wicket:id="names"><span wicket:id="name"/></th> <th /> </tr> - <tr wicket:id="beans"> - <td wicket:id="fields"><span wicket:id="field"/></td> - <td> - <div class="listview-actions"> - <span wicket:id="actions">[actions]</span> - </div> - </td> - </tr> + + <span wicket:id="group"> + <tr wicket:id="beans"> + <td id="check"> + <input type="checkbox" wicket:id="check"/> + </td> + <td wicket:id="fields"><span wicket:id="field"/></td> + <td> + <div class="listview-actions"> + <span wicket:id="actions">[actions]</span> + </div> + </td> + </tr> + </span> + </tbody></table> </div><!-- /.box-body --> </div><!-- /.box --> http://git-wip-us.apache.org/repos/asf/syncope/blob/e034afcd/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksPanel.html ---------------------------------------------------------------------- diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksPanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksPanel.html index 67cf987..2830a79 100644 --- a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksPanel.html +++ b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksPanel.html @@ -96,7 +96,7 @@ under the License. </wicket:fragment> <wicket:fragment wicket:id="fragmentSearch"> - <a href="#" wicket:id="searchLink"><img id="actionLink" src="img/actions/search.png" alt="search icon" title="Search and modify"/></a> + <a href="#" wicket:id="searchLink"><i class="glyphicon glyphicon-search" alt="search icon" title="Search"></i></a> </wicket:fragment> <wicket:fragment wicket:id="fragmentEnable"> http://git-wip-us.apache.org/repos/asf/syncope/blob/e034afcd/client/console/src/main/resources/org/apache/syncope/client/console/wizards/WizardMgtPanel.html ---------------------------------------------------------------------- diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/WizardMgtPanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/WizardMgtPanel.html index e849f37..9bf9518 100644 --- a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/WizardMgtPanel.html +++ b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/WizardMgtPanel.html @@ -34,9 +34,11 @@ under the License. <wicket:child /> - <div class="modal-footer" style="text-align: right"> - <a haref="#" class="btn btn-primary" wicket:id="add">Add</a> - </div> + <wicket:enclosure child="add"> + <div class="modal-footer" style="text-align: right"> + <a haref="#" class="btn btn-primary" wicket:id="add">Add</a> + </div> + </wicket:enclosure> </wicket:fragment> <div wicket:id="modal" /> http://git-wip-us.apache.org/repos/asf/syncope/blob/e034afcd/client/console/src/main/resources/org/apache/syncope/client/console/wizards/any/ConnObjectPanel.html ---------------------------------------------------------------------- diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/any/ConnObjectPanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/any/ConnObjectPanel.html new file mode 100644 index 0000000..eed082f --- /dev/null +++ b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/any/ConnObjectPanel.html @@ -0,0 +1,26 @@ +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> +<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org"> + <head><title></title></head> + <wicket:panel> + <div class="form-group" wicket:id="propView"> + <span wicket:id="attribute">[ATTIRIBUTE]</span> + </div> + </wicket:panel> +</html>