You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by fm...@apache.org on 2013/03/12 12:50:50 UTC
svn commit: r1455500 [2/2] - in /syncope/trunk:
client/src/main/java/org/apache/syncope/client/services/proxy/
common/src/main/java/org/apache/syncope/common/services/
common/src/main/java/org/apache/syncope/common/to/
console/src/main/java/org/apache/...
Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/UserSearchResultPanel.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/UserSearchResultPanel.java?rev=1455500&r1=1455499&r2=1455500&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/UserSearchResultPanel.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/UserSearchResultPanel.java Tue Mar 12 11:50:48 2013
@@ -21,6 +21,7 @@ package org.apache.syncope.console.pages
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collection;
import java.util.Date;
import java.util.List;
import org.apache.syncope.common.search.NodeCond;
@@ -39,6 +40,7 @@ import org.apache.syncope.console.wicket
import org.apache.syncope.console.wicket.extensions.markup.html.repeater.data.table.DatePropertyColumn;
import org.apache.syncope.console.wicket.extensions.markup.html.repeater.data.table.TokenColumn;
import org.apache.syncope.console.wicket.markup.html.form.ActionLink;
+import org.apache.syncope.console.wicket.markup.html.form.ActionLink.ActionType;
import org.apache.syncope.console.wicket.markup.html.form.ActionLinksPanel;
import org.apache.wicket.Page;
import org.apache.wicket.PageReference;
@@ -57,6 +59,8 @@ public class UserSearchResultPanel exten
private static final long serialVersionUID = -905187144506842332L;
+ private final static String PAGEID = "Users";
+
public <T extends AbstractAttributableTO> UserSearchResultPanel(final String id, final boolean filtered,
final NodeCond searchCond, final PageReference callerRef, final AbstractAttributableRestClient restClient) {
@@ -137,7 +141,7 @@ public class UserSearchResultPanel exten
statusmodal.show(target);
}
- }, ActionLink.ActionType.ENABLE, "Users", "update");
+ }, ActionLink.ActionType.ENABLE, PAGEID);
panel.add(new ActionLink() {
@@ -159,7 +163,7 @@ public class UserSearchResultPanel exten
editmodal.show(target);
}
- }, ActionLink.ActionType.EDIT, "Users", "read");
+ }, ActionLink.ActionType.EDIT, PAGEID);
panel.add(new ActionLink() {
@@ -188,7 +192,7 @@ public class UserSearchResultPanel exten
target.add(feedbackPanel);
}
}
- }, ActionLink.ActionType.DELETE, "Users", "delete");
+ }, ActionLink.ActionType.DELETE, PAGEID);
cellItem.add(panel);
}
@@ -196,4 +200,20 @@ public class UserSearchResultPanel exten
return columns;
}
+
+ @Override
+ protected <T extends AbstractAttributableTO> Collection<ActionType> getBulkActions() {
+ final List<ActionType> bulkActions = new ArrayList<ActionType>();
+
+ bulkActions.add(ActionType.DELETE);
+ bulkActions.add(ActionType.SUSPEND);
+ bulkActions.add(ActionType.REACTIVATE);
+
+ return bulkActions;
+ }
+
+ @Override
+ protected String getPageId() {
+ return PAGEID;
+ }
}
Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/AbstractAttributableRestClient.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/AbstractAttributableRestClient.java?rev=1455500&r1=1455499&r2=1455500&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/AbstractAttributableRestClient.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/AbstractAttributableRestClient.java Tue Mar 12 11:50:48 2013
@@ -22,6 +22,8 @@ import java.util.List;
import org.apache.syncope.common.search.NodeCond;
import org.apache.syncope.common.services.InvalidSearchConditionException;
import org.apache.syncope.common.to.AbstractAttributableTO;
+import org.apache.syncope.common.to.BulkAction;
+import org.apache.syncope.common.to.BulkActionRes;
import org.apache.syncope.common.to.ConnObjectTO;
public abstract class AbstractAttributableRestClient extends BaseRestClient {
@@ -40,4 +42,6 @@ public abstract class AbstractAttributab
public abstract ConnObjectTO getConnectorObject(String resourceName, Long id);
public abstract AbstractAttributableTO delete(Long id);
+
+ public abstract BulkActionRes bulkAction(BulkAction action);
}
Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/RoleRestClient.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/RoleRestClient.java?rev=1455500&r1=1455499&r2=1455500&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/RoleRestClient.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/RoleRestClient.java Tue Mar 12 11:50:48 2013
@@ -27,6 +27,8 @@ import org.apache.syncope.common.search.
import org.apache.syncope.common.services.InvalidSearchConditionException;
import org.apache.syncope.common.services.ResourceService;
import org.apache.syncope.common.services.RoleService;
+import org.apache.syncope.common.to.BulkAction;
+import org.apache.syncope.common.to.BulkActionRes;
import org.apache.syncope.common.to.ConnObjectTO;
import org.apache.syncope.common.to.RoleTO;
import org.apache.syncope.common.types.AttributableType;
@@ -88,4 +90,9 @@ public class RoleRestClient extends Abst
public RoleTO delete(final Long id) {
return getService(RoleService.class).delete(id);
}
+
+ @Override
+ public BulkActionRes bulkAction(final BulkAction action) {
+ return getService(RoleRestClient.class).bulkAction(action);
+ }
}
Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/UserRestClient.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/UserRestClient.java?rev=1455500&r1=1455499&r2=1455500&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/UserRestClient.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/UserRestClient.java Tue Mar 12 11:50:48 2013
@@ -25,6 +25,8 @@ import org.apache.syncope.common.search.
import org.apache.syncope.common.services.InvalidSearchConditionException;
import org.apache.syncope.common.services.ResourceService;
import org.apache.syncope.common.services.UserService;
+import org.apache.syncope.common.to.BulkAction;
+import org.apache.syncope.common.to.BulkActionRes;
import org.apache.syncope.common.to.ConnObjectTO;
import org.apache.syncope.common.to.UserTO;
import org.apache.syncope.common.types.AttributableType;
@@ -120,4 +122,9 @@ public class UserRestClient extends Abst
public UserTO reactivate(final long userId, final List<StatusBean> statuses) {
return getService(UserService.class).reactivate(userId, StatusUtils.buildPropagationRequestTO(statuses, true));
}
+
+ @Override
+ public BulkActionRes bulkAction(final BulkAction action) {
+ return getService(UserService.class).bulkAction(action);
+ }
}
Added: syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/ActionResultColumn.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/ActionResultColumn.java?rev=1455500&view=auto
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/ActionResultColumn.java (added)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/ActionResultColumn.java Tue Mar 12 11:50:48 2013
@@ -0,0 +1,75 @@
+/*
+ * 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.console.wicket.extensions.markup.html.repeater.data.table;
+
+import java.beans.PropertyDescriptor;
+import org.apache.syncope.common.to.BulkActionRes;
+import org.apache.wicket.Component;
+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.markup.html.basic.Label;
+import org.apache.wicket.markup.repeater.Item;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.ResourceModel;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.BeanUtils;
+
+public class ActionResultColumn<T, S> extends AbstractColumn<T, S> {
+
+ private static final long serialVersionUID = 7955560320949560716L;
+
+ /**
+ * Logger.
+ */
+ protected static final Logger LOG = LoggerFactory.getLogger(ActionResultColumn.class);
+
+ private final BulkActionRes results;
+
+ private final String idFieldName;
+
+ public ActionResultColumn(final BulkActionRes results, final String idFieldName) {
+ super(new Model());
+ this.results = results;
+ this.idFieldName = idFieldName;
+ }
+
+ @Override
+ public String getCssClass() {
+ return "bulkResultColumn";
+ }
+
+ @Override
+ public Component getHeader(final String componentId) {
+ return new Label(componentId, new ResourceModel("bulkActionResultLabel", "Result"));
+ }
+
+ @Override
+ public void populateItem(Item<ICellPopulator<T>> item, String componentId, IModel<T> rowModel) {
+ try {
+ final PropertyDescriptor propDesc =
+ BeanUtils.getPropertyDescriptor(rowModel.getObject().getClass(), idFieldName);
+ final Object id = propDesc.getReadMethod().invoke(rowModel.getObject(), new Object[0]);
+ item.add(new Label(componentId, results.getResultMap().get(id.toString()).toString()));
+ } catch (Exception e) {
+ LOG.error("Errore retrieving target id value", e);
+ }
+ }
+}
Propchange: syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/ActionResultColumn.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/ActionResultColumn.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/ActionResultColumn.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/CheckBoxGroupSelectorPanel.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/CheckBoxGroupSelectorPanel.java?rev=1455500&view=auto
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/CheckBoxGroupSelectorPanel.java (added)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/CheckBoxGroupSelectorPanel.java Tue Mar 12 11:50:48 2013
@@ -0,0 +1,34 @@
+/*
+ * 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.console.wicket.extensions.markup.html.repeater.data.table;
+
+import org.apache.wicket.markup.html.form.CheckGroup;
+import org.apache.wicket.markup.html.form.CheckGroupSelector;
+import org.apache.wicket.markup.html.panel.Panel;
+
+public class CheckBoxGroupSelectorPanel<T> extends Panel {
+
+ private static final long serialVersionUID = 4062106303929176865L;
+
+ public CheckBoxGroupSelectorPanel(final String componentId, final CheckGroup<T> group) {
+
+ super(componentId);
+ add(new CheckGroupSelector("groupselector", group));
+ }
+}
Propchange: syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/CheckBoxGroupSelectorPanel.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/CheckBoxGroupSelectorPanel.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/CheckBoxGroupSelectorPanel.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/CheckBoxPanel.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/CheckBoxPanel.java?rev=1455500&view=auto
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/CheckBoxPanel.java (added)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/CheckBoxPanel.java Tue Mar 12 11:50:48 2013
@@ -0,0 +1,34 @@
+/*
+ * 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.console.wicket.extensions.markup.html.repeater.data.table;
+
+import org.apache.wicket.markup.html.form.Check;
+import org.apache.wicket.markup.html.form.CheckGroup;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.model.IModel;
+
+public class CheckBoxPanel<T> extends Panel {
+
+ private static final long serialVersionUID = 4062106303929176865L;
+
+ public CheckBoxPanel(String componentId, IModel<T> model, CheckGroup<T> checkGroup) {
+ super(componentId, model);
+ add(new Check<T>("check", model, checkGroup));
+ }
+}
Propchange: syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/CheckBoxPanel.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/CheckBoxPanel.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/CheckBoxPanel.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/CheckGroupColumn.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/CheckGroupColumn.java?rev=1455500&view=auto
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/CheckGroupColumn.java (added)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/CheckGroupColumn.java Tue Mar 12 11:50:48 2013
@@ -0,0 +1,62 @@
+/*
+ * 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.console.wicket.extensions.markup.html.repeater.data.table;
+
+import org.apache.wicket.Component;
+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.markup.html.form.CheckGroup;
+import org.apache.wicket.markup.repeater.Item;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class CheckGroupColumn<T, S> extends AbstractColumn<T, S> {
+
+ private static final long serialVersionUID = 7955560320949560715L;
+
+ /**
+ * Logger.
+ */
+ protected static final Logger LOG = LoggerFactory.getLogger(CheckGroupColumn.class);
+
+ private CheckGroup<T> group;
+
+ public CheckGroupColumn(CheckGroup<T> checkGroup) {
+ super(new Model());
+ this.group = checkGroup;
+ }
+
+ @Override
+ public String getCssClass() {
+ return "checkGroupColumn";
+ }
+
+ @Override
+ public Component getHeader(String componentId) {
+ return new CheckBoxGroupSelectorPanel(componentId, group);
+ }
+
+ @Override
+ public void populateItem(Item<ICellPopulator<T>> item, String componentId, IModel<T> rowModel) {
+ item.add(new CheckBoxPanel<T>(componentId, rowModel, group));
+ }
+
+}
Propchange: syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/CheckGroupColumn.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/CheckGroupColumn.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/CheckGroupColumn.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/ActionLink.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/ActionLink.java?rev=1455500&r1=1455499&r2=1455500&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/ActionLink.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/ActionLink.java Tue Mar 12 11:50:48 2013
@@ -27,20 +27,34 @@ public abstract class ActionLink impleme
public enum ActionType {
- CREATE,
- EDIT,
- USER_TEMPLATE,
- ROLE_TEMPLATE,
- ENABLE,
- SEARCH,
- DELETE,
- EXECUTE,
- DRYRUN,
- CLAIM,
- SELECT,
- EXPORT
+ CREATE("create"),
+ EDIT("read"),
+ USER_TEMPLATE("read"),
+ ROLE_TEMPLATE("read"),
+ ENABLE("update"),
+ SEARCH("read"),
+ DELETE("delete"),
+ EXECUTE("execute"),
+ DRYRUN("execute"),
+ CLAIM("claim"),
+ SELECT("read"),
+ EXPORT("read"),
+ SUSPEND("update"),
+ REACTIVATE("update");
+ private final String actionId;
+
+ private ActionType(final String actionId) {
+ this.actionId = actionId;
+ }
+
+ public String getActionId() {
+ return actionId;
+ }
}
public abstract void onClick(final AjaxRequestTarget target);
+
+ public void postClick() {
+ }
}
Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/ActionLinksPanel.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/ActionLinksPanel.java?rev=1455500&r1=1455499&r2=1455500&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/ActionLinksPanel.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/ActionLinksPanel.java Tue Mar 12 11:50:48 2013
@@ -60,26 +60,35 @@ public class ActionLinksPanel extends Pa
super.add(new Fragment("panelDryRun", "emptyFragment", this));
super.add(new Fragment("panelSelect", "emptyFragment", this));
super.add(new Fragment("panelExport", "emptyFragment", this));
+ super.add(new Fragment("panelSuspend", "emptyFragment", this));
+ super.add(new Fragment("panelReactivate", "emptyFragment", this));
}
- public void add(final ActionLink link, final ActionLink.ActionType type, final String pageId,
- final String actionId) {
+ public void add(
+ final ActionLink link, final ActionLink.ActionType type, final String pageId, final String actionId) {
- add(link, type, xmlRolesReader.getAllAllowedRoles(pageId, actionId), true);
+ addWithRoles(link, type, xmlRolesReader.getAllAllowedRoles(pageId, actionId), true);
}
- public void add(final ActionLink link, final ActionLink.ActionType type, final String pageId,
- final String actionId, final boolean enabled) {
+ public void add(
+ final ActionLink link, final ActionLink.ActionType type, final String pageId) {
- add(link, type, xmlRolesReader.getAllAllowedRoles(pageId, actionId), enabled);
+ add(link, type, pageId, true);
}
- public void add(final ActionLink link, final ActionLink.ActionType type, final String roles) {
- add(link, type, roles, true);
+ public void add(
+ final ActionLink link, final ActionLink.ActionType type, final String pageId, final boolean enabled) {
+
+ addWithRoles(link, type, xmlRolesReader.getAllAllowedRoles(pageId, type.getActionId()), enabled);
+ }
+
+ public void addWithRoles(
+ final ActionLink link, final ActionLink.ActionType type, final String roles) {
+ addWithRoles(link, type, roles, true);
}
- public void add(final ActionLink link, final ActionLink.ActionType type, final String roles,
- final boolean enabled) {
+ public void addWithRoles(
+ final ActionLink link, final ActionLink.ActionType type, final String roles, final boolean enabled) {
Fragment fragment = null;
@@ -88,9 +97,9 @@ public class ActionLinksPanel extends Pa
case CLAIM:
fragment = new Fragment("panelClaim", "fragmentClaim", this);
- fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("claimLink", pageRef) {
+ fragment.addOrReplace(new ClearIndicatingAjaxLink("claimLink", pageRef) {
- private static final long serialVersionUID = -6957616042924610290L;
+ private static final long serialVersionUID = -7978723352517770644L;
@Override
protected void onClickInternal(final AjaxRequestTarget target) {
@@ -102,9 +111,9 @@ public class ActionLinksPanel extends Pa
case CREATE:
fragment = new Fragment("panelCreate", "fragmentCreate", this);
- fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("createLink", pageRef) {
+ fragment.addOrReplace(new ClearIndicatingAjaxLink("createLink", pageRef) {
- private static final long serialVersionUID = -6957616042924610290L;
+ private static final long serialVersionUID = -7978723352517770644L;
@Override
protected void onClickInternal(final AjaxRequestTarget target) {
@@ -116,9 +125,9 @@ public class ActionLinksPanel extends Pa
case EDIT:
fragment = new Fragment("panelEdit", "fragmentEdit", this);
- fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("editLink", pageRef) {
+ fragment.addOrReplace(new ClearIndicatingAjaxLink("editLink", pageRef) {
- private static final long serialVersionUID = -6957616042924610290L;
+ private static final long serialVersionUID = -7978723352517770644L;
@Override
protected void onClickInternal(final AjaxRequestTarget target) {
@@ -130,9 +139,9 @@ public class ActionLinksPanel extends Pa
case USER_TEMPLATE:
fragment = new Fragment("panelUserTemplate", "fragmentUserTemplate", this);
- fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("userTemplateLink", pageRef) {
+ fragment.addOrReplace(new ClearIndicatingAjaxLink("userTemplateLink", pageRef) {
- private static final long serialVersionUID = -6957616042924610290L;
+ private static final long serialVersionUID = -7978723352517770644L;
@Override
protected void onClickInternal(final AjaxRequestTarget target) {
@@ -144,9 +153,9 @@ public class ActionLinksPanel extends Pa
case ROLE_TEMPLATE:
fragment = new Fragment("panelRoleTemplate", "fragmentRoleTemplate", this);
- fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("roleTemplateLink", pageRef) {
+ fragment.addOrReplace(new ClearIndicatingAjaxLink("roleTemplateLink", pageRef) {
- private static final long serialVersionUID = -6957616042924610290L;
+ private static final long serialVersionUID = -7978723352517770644L;
@Override
protected void onClickInternal(final AjaxRequestTarget target) {
@@ -158,9 +167,9 @@ public class ActionLinksPanel extends Pa
case ENABLE:
fragment = new Fragment("panelEnable", "fragmentEnable", this);
- fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("enableLink", pageRef) {
+ fragment.addOrReplace(new ClearIndicatingAjaxLink("enableLink", pageRef) {
- private static final long serialVersionUID = -6957616042924610290L;
+ private static final long serialVersionUID = -7978723352517770644L;
@Override
protected void onClickInternal(final AjaxRequestTarget target) {
@@ -172,9 +181,9 @@ public class ActionLinksPanel extends Pa
case SEARCH:
fragment = new Fragment("panelSearch", "fragmentSearch", this);
- fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("searchLink", pageRef) {
+ fragment.addOrReplace(new ClearIndicatingAjaxLink("searchLink", pageRef) {
- private static final long serialVersionUID = -6957616042924610290L;
+ private static final long serialVersionUID = -7978723352517770644L;
@Override
protected void onClickInternal(final AjaxRequestTarget target) {
@@ -186,9 +195,9 @@ public class ActionLinksPanel extends Pa
case EXECUTE:
fragment = new Fragment("panelExecute", "fragmentExecute", this);
- fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("executeLink", pageRef) {
+ fragment.addOrReplace(new ClearIndicatingAjaxLink("executeLink", pageRef) {
- private static final long serialVersionUID = -6957616042924610290L;
+ private static final long serialVersionUID = -7978723352517770644L;
@Override
protected void onClickInternal(final AjaxRequestTarget target) {
@@ -200,9 +209,9 @@ public class ActionLinksPanel extends Pa
case DRYRUN:
fragment = new Fragment("panelDryRun", "fragmentDryRun", this);
- fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("dryRunLink", pageRef) {
+ fragment.addOrReplace(new ClearIndicatingAjaxLink("dryRunLink", pageRef) {
- private static final long serialVersionUID = -6957616042924610290L;
+ private static final long serialVersionUID = -7978723352517770644L;
@Override
protected void onClickInternal(final AjaxRequestTarget target) {
@@ -214,9 +223,9 @@ public class ActionLinksPanel extends Pa
case DELETE:
fragment = new Fragment("panelDelete", "fragmentDelete", this);
- fragment.addOrReplace(new IndicatingDeleteOnConfirmAjaxLink<Void>("deleteLink", pageRef) {
+ fragment.addOrReplace(new IndicatingDeleteOnConfirmAjaxLink("deleteLink", pageRef) {
- private static final long serialVersionUID = -6957616042924610290L;
+ private static final long serialVersionUID = -7978723352517770644L;
@Override
protected void onClickInternal(final AjaxRequestTarget target) {
@@ -229,9 +238,9 @@ public class ActionLinksPanel extends Pa
case SELECT:
fragment = new Fragment("panelSelect", "fragmentSelect", this);
- fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("selectLink", pageRef) {
+ fragment.addOrReplace(new ClearIndicatingAjaxLink("selectLink", pageRef) {
- private static final long serialVersionUID = -6957616042924610290L;
+ private static final long serialVersionUID = -7978723352517770644L;
@Override
protected void onClickInternal(final AjaxRequestTarget target) {
@@ -244,9 +253,37 @@ public class ActionLinksPanel extends Pa
case EXPORT:
fragment = new Fragment("panelExport", "fragmentExport", this);
- fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("exportLink", pageRef) {
+ fragment.addOrReplace(new ClearIndicatingAjaxLink("exportLink", pageRef) {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+ link.onClick(target);
+ }
+ });
+ break;
+
+ case SUSPEND:
+ fragment = new Fragment("panelSuspend", "fragmentSuspend", this);
+
+ fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("suspendLink", pageRef) {
- private static final long serialVersionUID = -6957616042924610290L;
+ private static final long serialVersionUID = -6957616042924610291L;
+
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+ link.onClick(target);
+ }
+ });
+ break;
+
+ case REACTIVATE:
+ fragment = new Fragment("panelReactivate", "fragmentReactivate", this);
+
+ fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("reactivateLink", pageRef) {
+
+ private static final long serialVersionUID = -6957616042924610292L;
@Override
protected void onClickInternal(final AjaxRequestTarget target) {
@@ -308,6 +345,13 @@ public class ActionLinksPanel extends Pa
super.addOrReplace(new Fragment("panelExport", "emptyFragment", this));
break;
+ case SUSPEND:
+ super.addOrReplace(new Fragment("panelSuspend", "emptyFragment", this));
+ break;
+
+ case REACTIVATE:
+ super.addOrReplace(new Fragment("panelReactivate", "emptyFragment", this));
+ break;
default:
// do nothing
}
Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/AjaxDropDownChoicePanel.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/AjaxDropDownChoicePanel.java?rev=1455500&r1=1455499&r2=1455500&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/AjaxDropDownChoicePanel.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/AjaxDropDownChoicePanel.java Tue Mar 12 11:50:48 2013
@@ -40,8 +40,9 @@ public class AjaxDropDownChoicePanel<T e
public AjaxDropDownChoicePanel(final String id, final String name, final IModel<T> model, boolean enableOnBlur) {
super(id, name, model);
- field = new DropDownChoice<T>("dropDownChoiceField", model, Collections.<T>emptyList(),
- new ChoiceRenderer<T>());
+ field = new DropDownChoice<T>(
+ "dropDownChoiceField", model, Collections.<T>emptyList(), new ChoiceRenderer<T>());
+
add(field.setLabel(new Model(name)).setOutputMarkupId(true));
if (enableOnBlur) {
Copied: syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BulkActionModalPage.html (from r1450790, syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/StatusModalPage.html)
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BulkActionModalPage.html?p2=syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BulkActionModalPage.html&p1=syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/StatusModalPage.html&r1=1450790&r2=1455500&rev=1455500&view=diff
==============================================================================
--- syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/StatusModalPage.html (original)
+++ syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BulkActionModalPage.html Tue Mar 12 11:50:48 2013
@@ -17,30 +17,27 @@ specific language governing permissions
under the License.
-->
<wicket:head>
- <style>
- .submit{
- display: block;
- clear: both;
- float: none;
- margin-left: 10px;
- padding-top: 10px;
- }
- </style>
+ <link rel="stylesheet" type="text/css" href="css/bulk.css" media="all"/>
</wicket:head>
<wicket:extend>
- <form wicket:id="form">
- <p class="ui-widget ui-corner-all ui-widget-header">
- <wicket:message key="title"/>
- </p>
+ <p class="ui-widget ui-corner-all ui-widget-header"><wicket:message key="title"/></p>
- <div style="display: block; margin: 10px">
- <span wicket:id="statuspanel">[Status Panel]</span>
- </div>
+<div id="selectedObjects">
+ <table class="ui-widget ui-widget-content table-hover pageRowElement" wicket:id="selectedObjects">[DataTable]</table>
- <div class="submit">
- <input type="submit" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" wicket:id="enable"/>
- <input type="submit" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" wicket:id="disable"/>
- <input type="button" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" wicket:id="cancel"/>
- </div>
- </form>
+ <div id="actionRow" class="pageRowElement">
+ <div id="actions">
+ <div id="actionPanel" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only">
+ <span wicket:id="actions">[Actions]</span>
+ </div>
+
+ <div id="cancelBtmForm">
+ <form wicket:id="form">
+ <input type="button" wicket:id="cancel" id="cancel"
+ class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"/>
+ </form>
+ </div>
+ </div>
+ </div>
+</div>
</wicket:extend>
Copied: syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BulkActionModalPage.properties (from r1450790, syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BasePage.properties)
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BulkActionModalPage.properties?p2=syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BulkActionModalPage.properties&p1=syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BasePage.properties&r1=1450790&r2=1455500&rev=1455500&view=diff
==============================================================================
--- syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BasePage.properties (original)
+++ syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BulkActionModalPage.properties Tue Mar 12 11:50:48 2013
@@ -14,6 +14,4 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-displayRows=Rows to display:
-home=Home
-version=VERSION
+title=Bulk action
Copied: syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BulkActionModalPage_it.properties (from r1450790, syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BasePage_it.properties)
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BulkActionModalPage_it.properties?p2=syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BulkActionModalPage_it.properties&p1=syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BasePage_it.properties&r1=1450790&r2=1455500&rev=1455500&view=diff
==============================================================================
--- syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BasePage_it.properties (original)
+++ syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BulkActionModalPage_it.properties Tue Mar 12 11:50:48 2013
@@ -14,6 +14,4 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-displayRows=Righe per pagina:
-home=Home
-version=VERSIONE
+title=Operazioni di gruppo
Copied: syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BulkActionResultModalPage.html (from r1450790, syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/StatusModalPage.html)
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BulkActionResultModalPage.html?p2=syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BulkActionResultModalPage.html&p1=syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/StatusModalPage.html&r1=1450790&r2=1455500&rev=1455500&view=diff
==============================================================================
--- syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/StatusModalPage.html (original)
+++ syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BulkActionResultModalPage.html Tue Mar 12 11:50:48 2013
@@ -16,31 +16,42 @@ KIND, either express or implied. See th
specific language governing permissions and limitations
under the License.
-->
+
+<!--
+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.
+-->
<wicket:head>
- <style>
- .submit{
- display: block;
- clear: both;
- float: none;
- margin-left: 10px;
- padding-top: 10px;
- }
- </style>
+ <link rel="stylesheet" type="text/css" href="css/bulk.css" media="all"/>
</wicket:head>
<wicket:extend>
- <form wicket:id="form">
- <p class="ui-widget ui-corner-all ui-widget-header">
- <wicket:message key="title"/>
- </p>
+ <p class="ui-widget ui-corner-all ui-widget-header"><wicket:message key="title"/></p>
- <div style="display: block; margin: 10px">
- <span wicket:id="statuspanel">[Status Panel]</span>
- </div>
+<div id="selectedObjects">
+ <table class="ui-widget ui-widget-content table-hover pageRowElement" wicket:id="selectedObjects">[DataTable]</table>
- <div class="submit">
- <input type="submit" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" wicket:id="enable"/>
- <input type="submit" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" wicket:id="disable"/>
- <input type="button" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" wicket:id="cancel"/>
- </div>
- </form>
-</wicket:extend>
+ <div id="actionRow" class="pageRowElement">
+ <div id="actions">
+ <div id="cancelBtmForm" style="padding: 0px">
+ <a class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" wicket:id="close">
+ <wicket:message key="close"/>
+ </a>
+ </div>
+ </div>
+ </div>
+</div>
+</wicket:extend>
\ No newline at end of file
Copied: syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BulkActionResultModalPage.properties (from r1450790, syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BasePage.properties)
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BulkActionResultModalPage.properties?p2=syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BulkActionResultModalPage.properties&p1=syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BasePage.properties&r1=1450790&r2=1455500&rev=1455500&view=diff
==============================================================================
--- syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BasePage.properties (original)
+++ syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BulkActionResultModalPage.properties Tue Mar 12 11:50:48 2013
@@ -14,6 +14,6 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-displayRows=Rows to display:
-home=Home
-version=VERSION
+title=Bulk Action Result
+close=Close
+bulkActionResultLabel=Result
Copied: syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BulkActionResultModalPage_it.properties (from r1450790, syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BasePage_it.properties)
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BulkActionResultModalPage_it.properties?p2=syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BulkActionResultModalPage_it.properties&p1=syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BasePage_it.properties&r1=1450790&r2=1455500&rev=1455500&view=diff
==============================================================================
--- syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BasePage_it.properties (original)
+++ syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BulkActionResultModalPage_it.properties Tue Mar 12 11:50:48 2013
@@ -14,6 +14,6 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-displayRows=Righe per pagina:
-home=Home
-version=VERSIONE
+title=Risultato esecuzion Bulk Action
+close=Chiudi
+bulkActionResultLabel=Esito
Modified: syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/Users_it.properties
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/Users_it.properties?rev=1455500&r1=1455499&r2=1455500&view=diff
==============================================================================
--- syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/Users_it.properties (original)
+++ syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/Users_it.properties Tue Mar 12 11:50:48 2013
@@ -18,7 +18,6 @@ tab1=Elenco
tab2=Ricerca
search=Cerca
create_user=Crea nuovo utente
-
search_results_title=Risultati ricerca:
search_noResults=Nessuna corrispondenza trovata.
reset=Reset
Modified: syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/panels/AbstractSearchResultPanel.html
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/panels/AbstractSearchResultPanel.html?rev=1455500&r1=1455499&r2=1455500&view=diff
==============================================================================
--- syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/panels/AbstractSearchResultPanel.html (original)
+++ syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/panels/AbstractSearchResultPanel.html Tue Mar 12 11:50:48 2013
@@ -17,53 +17,53 @@ specific language governing permissions
under the License.
-->
<wicket:head>
- <style>
- .settingsPos{
- position:relative;
- top:34px;
- left:93.2%;
- width:10px;
- text-decoration: none;
- }
-
- .settingsPosMultiPage{
- position:relative;
- top:64px;
- left:93.2%;
- width:10px;
- text-decoration: none;
- }
- </style>
+ <style>
+ .settingsPos{
+ position:relative;
+ top:34px;
+ left:93.2%;
+ width:10px;
+ text-decoration: none;
+ }
+
+ .settingsPosMultiPage{
+ position:relative;
+ top:64px;
+ left:93.2%;
+ width:10px;
+ text-decoration: none;
+ }
+ </style>
</wicket:head>
<html>
- <wicket:panel>
+ <wicket:panel>
- <div wicket:id="container">
- <a wicket:id="reload">
- <img src="img/reload.png" alt="reload" class="drop_button" />
- </a>
- <a wicket:id="displayAttrsLink">
- <img src="img/settings-icon.png" alt="settings icon" class="drop_button" />
- </a>
-
- <table class="ui-widget ui-widget-content table-hover" wicket:id="resultTable"/>
-
- <span style="float:right">
- <form wicket:id="paginator" style="display:inline">
- <label><wicket:message key="displayRows"/></label>
- <select class="text ui-widget-content ui-corner-all" wicket:id="rowsChooser"/>
- </form>
- </span>
- </div>
-
- <div wicket:id="editModal">
- </div>
+ <div wicket:id="container">
+ <a wicket:id="reload">
+ <img src="img/reload.png" alt="reload" class="drop_button" />
+ </a>
+ <a wicket:id="displayAttrsLink">
+ <img src="img/settings-icon.png" alt="settings icon" class="drop_button" />
+ </a>
+
+ <span wicket:id="resultTable">[Table]</span>
+
+ <span style="float:right">
+ <form wicket:id="paginator" style="display:inline">
+ <label><wicket:message key="displayRows"/></label>
+ <select class="text ui-widget-content ui-corner-all" wicket:id="rowsChooser"/>
+ </form>
+ </span>
+ </div>
+
+ <div wicket:id="editModal">
+ </div>
- <div wicket:id="displayModal">
- </div>
+ <div wicket:id="displayModal">
+ </div>
- <div wicket:id="statusModal">
- </div>
+ <div wicket:id="statusModal">
+ </div>
- </wicket:panel>
+ </wicket:panel>
</html>
Added: syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/panels/AjaxDataTablePanel.html
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/panels/AjaxDataTablePanel.html?rev=1455500&view=auto
==============================================================================
--- syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/panels/AjaxDataTablePanel.html (added)
+++ syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/panels/AjaxDataTablePanel.html Tue Mar 12 11:50:48 2013
@@ -0,0 +1,45 @@
+<!--
+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.
+-->
+<wicket:head>
+ <link rel="stylesheet" type="text/css" href="css/bulk.css" media="all"/>
+</wicket:head>
+<wicket:panel>
+ <span wicket:id="tablePanel">[Table panel]</span>
+ <div wicket:id="bulkModal" />
+
+ <wicket:fragment wicket:id="bulkAvailable">
+ <form wicket:id="groupForm">
+ <span wicket:id="checkgroup">
+ <table class="ui-widget ui-widget-content table-hover" wicket:id="dataTable">[DataTable]</table>
+ </span>
+ </form>
+ <div class="bulkAction">
+ <div class="bulkActionCell" style="width: 40px">
+ <a href="#" wicket:id="bulkActionLink">
+ <img src="img/actions/bulk.png" alt="bulk action icon" title="Bulk action"/>
+ </a>
+ </div>
+ </div>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="bulkNotAvailable">
+ <table class="ui-widget ui-widget-content table-hover" wicket:id="dataTable">[DataTable]</table>
+ </wicket:fragment>
+
+</wicket:panel>
Propchange: syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/panels/AjaxDataTablePanel.html
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/panels/AjaxDataTablePanel.html
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/panels/AjaxDataTablePanel.html
------------------------------------------------------------------------------
svn:mime-type = text/html
Added: syncope/trunk/console/src/main/resources/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/CheckBoxGroupSelectorPanel.html
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/resources/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/CheckBoxGroupSelectorPanel.html?rev=1455500&view=auto
==============================================================================
--- syncope/trunk/console/src/main/resources/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/CheckBoxGroupSelectorPanel.html (added)
+++ syncope/trunk/console/src/main/resources/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/CheckBoxGroupSelectorPanel.html Tue Mar 12 11:50:48 2013
@@ -0,0 +1,21 @@
+<!--
+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.
+-->
+<wicket:panel>
+ <input wicket:id="groupselector" type="checkbox"/>
+</wicket:panel>
Propchange: syncope/trunk/console/src/main/resources/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/CheckBoxGroupSelectorPanel.html
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: syncope/trunk/console/src/main/resources/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/CheckBoxGroupSelectorPanel.html
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: syncope/trunk/console/src/main/resources/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/CheckBoxGroupSelectorPanel.html
------------------------------------------------------------------------------
svn:mime-type = text/html
Added: syncope/trunk/console/src/main/resources/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/CheckBoxPanel.html
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/resources/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/CheckBoxPanel.html?rev=1455500&view=auto
==============================================================================
--- syncope/trunk/console/src/main/resources/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/CheckBoxPanel.html (added)
+++ syncope/trunk/console/src/main/resources/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/CheckBoxPanel.html Tue Mar 12 11:50:48 2013
@@ -0,0 +1,21 @@
+<!--
+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.
+-->
+<wicket:panel>
+ <input wicket:id="check" type="checkbox"/>
+</wicket:panel>
Propchange: syncope/trunk/console/src/main/resources/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/CheckBoxPanel.html
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: syncope/trunk/console/src/main/resources/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/CheckBoxPanel.html
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: syncope/trunk/console/src/main/resources/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/CheckBoxPanel.html
------------------------------------------------------------------------------
svn:mime-type = text/html
Modified: syncope/trunk/console/src/main/resources/org/apache/syncope/console/wicket/markup/html/form/ActionLinksPanel.html
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/resources/org/apache/syncope/console/wicket/markup/html/form/ActionLinksPanel.html?rev=1455500&r1=1455499&r2=1455500&view=diff
==============================================================================
--- syncope/trunk/console/src/main/resources/org/apache/syncope/console/wicket/markup/html/form/ActionLinksPanel.html (original)
+++ syncope/trunk/console/src/main/resources/org/apache/syncope/console/wicket/markup/html/form/ActionLinksPanel.html Tue Mar 12 11:50:48 2013
@@ -37,6 +37,8 @@ under the License.
<span id="action" wicket:id="panelExport">[plus]</span>
<span id="action" wicket:id="panelDelete">[plus]</span>
<span id="action" wicket:id="panelSelect">[plus]</span>
+ <span id="action" wicket:id="panelSuspend">[plus]</span>
+ <span id="action" wicket:id="panelReactivate">[plus]</span>
<wicket:fragment wicket:id="fragmentClaim">
<a href="#" wicket:id="claimLink"><img src="img/actions/claim.png" alt="claim icon" title="Claim"/></a>
@@ -86,6 +88,14 @@ under the License.
<a href="#" wicket:id="exportLink"><img src="img/actions/export.png" alt="export icon" title="Export"/></a>
</wicket:fragment>
+ <wicket:fragment wicket:id="fragmentSuspend">
+ <a href="#" wicket:id="suspendLink"><img src="img/actions/suspend.png" alt="suspend icon" title="Suspend"/></a>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="fragmentReactivate">
+ <a href="#" wicket:id="reactivateLink"><img src="img/actions/reactivate.png" alt="reactivate icon" title="Reactivate"/></a>
+ </wicket:fragment>
+
<wicket:fragment wicket:id="emptyFragment">
</wicket:fragment>
</wicket:panel>
Added: syncope/trunk/console/src/main/webapp/css/bulk.css
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/webapp/css/bulk.css?rev=1455500&view=auto
==============================================================================
--- syncope/trunk/console/src/main/webapp/css/bulk.css (added)
+++ syncope/trunk/console/src/main/webapp/css/bulk.css Tue Mar 12 11:50:48 2013
@@ -0,0 +1,79 @@
+ th.checkGroupColumn{
+ width: 20px;
+ }
+
+ td.checkGroupColumn{
+ text-align: center;
+ }
+
+ div.bulkAction{
+ display:inline-table;
+ }
+
+ div.bulkActionCell{
+ display: table-cell;
+ vertical-align: middle;
+ text-align: center;
+ width: 40px;
+ padding-left: 7px;
+ }
+
+ .pageRowElement{
+ display: inline-table;
+ width: 95%;
+ }
+
+ div#selectedObjects{
+ text-align: center;
+ margin-top: 10px;
+ }
+
+ div#selectedObjects table {
+ margin: 1em 0;
+ border-collapse: collapse;
+ }
+
+ div#selectedObjects table td, div#selectedObjects table th {
+ border: 1px solid #eee;
+ padding: .6em 10px;
+ }
+
+ div#actionRow{
+ height: 30px;
+ overflow: hidden;
+ text-align: left;
+ margin-top: 10px;
+ }
+
+ div#actions{
+ display: inline-table;
+ height: 30px;
+ overflow: hidden;
+ }
+
+ div#actions div#actionPanel{
+ display: table-cell;
+ height: 30px;
+ overflow: hidden;
+ cursor: auto;
+ background: none;
+ padding: 0px 10px;
+ vertical-align: middle;
+ }
+
+ div#actions div#cancelBtmForm{
+ display: table-cell;
+ height: 30px;
+ overflow: hidden;
+ vertical-align: middle;
+ padding-left: 3px;
+ }
+
+ div#actions div#cancelBtmForm form{
+ padding: 0px;
+ margin: 0px;
+ }
+
+ div#actions div#cancelBtmForm form input#cancel{
+ padding: 0.6em 1em;
+ }
Propchange: syncope/trunk/console/src/main/webapp/css/bulk.css
------------------------------------------------------------------------------
svn:mime-type = text/css
Added: syncope/trunk/console/src/main/webapp/img/actions/bulk.png
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/webapp/img/actions/bulk.png?rev=1455500&view=auto
==============================================================================
Binary file - no diff available.
Propchange: syncope/trunk/console/src/main/webapp/img/actions/bulk.png
------------------------------------------------------------------------------
svn:mime-type = image/png
Added: syncope/trunk/console/src/main/webapp/img/actions/reactivate.png
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/webapp/img/actions/reactivate.png?rev=1455500&view=auto
==============================================================================
Binary file - no diff available.
Propchange: syncope/trunk/console/src/main/webapp/img/actions/reactivate.png
------------------------------------------------------------------------------
svn:mime-type = image/png
Added: syncope/trunk/console/src/main/webapp/img/actions/suspend.png
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/webapp/img/actions/suspend.png?rev=1455500&view=auto
==============================================================================
Binary file - no diff available.
Propchange: syncope/trunk/console/src/main/webapp/img/actions/suspend.png
------------------------------------------------------------------------------
svn:mime-type = image/png
Modified: syncope/trunk/console/src/test/java/org/apache/syncope/console/RoleTestITCase.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/test/java/org/apache/syncope/console/RoleTestITCase.java?rev=1455500&r1=1455499&r2=1455500&view=diff
==============================================================================
--- syncope/trunk/console/src/test/java/org/apache/syncope/console/RoleTestITCase.java (original)
+++ syncope/trunk/console/src/test/java/org/apache/syncope/console/RoleTestITCase.java Tue Mar 12 11:50:48 2013
@@ -130,9 +130,9 @@ public class RoleTestITCase extends Abst
selenium.click("//input[@name=\"userListContainer:search\"]");
- selenium.waitForCondition("selenium.isElementPresent(\"//table/tbody/tr/td[4]/div/span[9]/a\");", "30000");
+ selenium.waitForCondition("selenium.isElementPresent(\"//table/tbody/tr/td[5]/div/span[9]/a\");", "30000");
- selenium.click("//table/tbody/tr/td[4]/div/span[9]/a");
+ selenium.click("//table/tbody/tr/td[5]/div/span[9]/a");
selenium.waitForCondition("selenium.isElementPresent("
+ "\"//form/div[3]/div/span/div/div/div[contains(text(),'Username')]\");", "30000");
Modified: syncope/trunk/console/src/test/java/org/apache/syncope/console/UserTestITCase.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/test/java/org/apache/syncope/console/UserTestITCase.java?rev=1455500&r1=1455499&r2=1455500&view=diff
==============================================================================
--- syncope/trunk/console/src/test/java/org/apache/syncope/console/UserTestITCase.java (original)
+++ syncope/trunk/console/src/test/java/org/apache/syncope/console/UserTestITCase.java Tue Mar 12 11:50:48 2013
@@ -50,7 +50,7 @@ public class UserTestITCase extends Abst
selenium.waitForCondition("selenium.isElementPresent(\"//div[@id='tabs']\");", "30000");
//Edit vivaldi
- selenium.click("//*[@id=\"users-contain\"]//*[div=3]/../td[4]/div/span[9]/a");
+ selenium.click("//*[@id=\"users-contain\"]//*[div=3]/../td[5]/div/span[9]/a");
selenium.waitForCondition("selenium.isElementPresent(" + "\"//input[@value='Antonio Vivaldi']\");", "30000");
@@ -89,7 +89,7 @@ public class UserTestITCase extends Abst
selenium.waitForCondition("selenium.isElementPresent(\"//div[@id='tabs']\");", "30000");
- selenium.click("//*[@id=\"users-contain\"]//*[div=4]/../td[4]/div/span[11]/a");
+ selenium.click("//*[@id=\"users-contain\"]//*[div=4]/../td[5]/div/span[11]/a");
assertTrue(selenium.getConfirmation().matches("^Do you really want to delete the selected item[\\s\\S]$"));
Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/policy/AccountPolicyEnforcer.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/policy/AccountPolicyEnforcer.java?rev=1455500&r1=1455499&r2=1455500&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/policy/AccountPolicyEnforcer.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/policy/AccountPolicyEnforcer.java Tue Mar 12 11:50:48 2013
@@ -90,6 +90,15 @@ public class AccountPolicyEnforcer exten
throw new AccountPolicyException("Suffix not permitted");
}
}
+
+ LOG.error("AAAAAAAAAAAAAAAAAAAAAAAA suspender {}", userSuspender);
+ LOG.error("AAAAAAAAAAAAAAAAAAAAAAAA failed logins {}", user.getFailedLogins());
+ LOG.error("AAAAAAAAAAAAAAAAAAAAAAAA retries logins {}", policy.getPermittedLoginRetries());
+ LOG.error("AAAAAAAAAAAAAAAAAAAAAAAA user is suspended {}", user.isSuspended());
+ LOG.error("AAAAAAAAAAAAAAAAAAAAAAAA check {}", (userSuspender != null
+ && user.getFailedLogins() != null && policy.getPermittedLoginRetries() > 0
+ && user.getFailedLogins() > policy.getPermittedLoginRetries() && !user.isSuspended()));
+
// check for subsequent failed logins
if (userSuspender != null
Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/UserController.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/UserController.java?rev=1455500&r1=1455499&r2=1455500&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/UserController.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/UserController.java Tue Mar 12 11:50:48 2013
@@ -29,6 +29,9 @@ import javax.servlet.http.HttpServletRes
import org.apache.syncope.common.mod.UserMod;
import org.apache.syncope.common.search.NodeCond;
import org.apache.syncope.common.services.InvalidSearchConditionException;
+import org.apache.syncope.common.to.BulkAction;
+import org.apache.syncope.common.to.BulkActionRes;
+import org.apache.syncope.common.to.BulkActionRes.Status;
import org.apache.syncope.common.to.MembershipTO;
import org.apache.syncope.common.to.PropagationRequestTO;
import org.apache.syncope.common.to.PropagationStatusTO;
@@ -695,4 +698,51 @@ public class UserController {
return userTO;
}
+
+ @PreAuthorize("(hasRole('USER_DELETE') and #bulkAction.operation == #bulkAction.operation.DELETE) or "
+ + "(hasRole('USER_UPDATE') and "
+ + "(#bulkAction.operation == #bulkAction.operation.REACTIVATE or "
+ + "#bulkAction.operation == #bulkAction.operation.SUSPEND))")
+ @RequestMapping(method = RequestMethod.POST, value = "/bulk")
+ public BulkActionRes bulkAction(@RequestBody final BulkAction bulkAction) {
+ LOG.debug("Bulk action '{}' called on '{}'", bulkAction.getOperation(), bulkAction.getTargets());
+
+ BulkActionRes res = new BulkActionRes();
+
+ switch (bulkAction.getOperation()) {
+ case DELETE:
+ for (String userId : bulkAction.getTargets()) {
+ try {
+ res.add(doDelete(Long.valueOf(userId)).getId(), Status.SUCCESS);
+ } catch (Exception e) {
+ LOG.error("Error performing delete for user {}", userId, e);
+ res.add(userId, Status.FAILURE);
+ }
+ }
+ break;
+ case SUSPEND:
+ for (String userId : bulkAction.getTargets()) {
+ try {
+ res.add(suspend(Long.valueOf(userId)).getId(), Status.SUCCESS);
+ } catch (Exception e) {
+ LOG.error("Error performing suspend for user {}", userId, e);
+ res.add(userId, Status.FAILURE);
+ }
+ }
+ break;
+ case REACTIVATE:
+ for (String userId : bulkAction.getTargets()) {
+ try {
+ res.add(reactivate(Long.valueOf(userId)).getId(), Status.SUCCESS);
+ } catch (Exception e) {
+ LOG.error("Error performing reactivate for user {}", userId, e);
+ res.add(userId, Status.FAILURE);
+ }
+ }
+ break;
+ default:
+ }
+
+ return res;
+ }
}
Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/services/UserServiceImpl.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/services/UserServiceImpl.java?rev=1455500&r1=1455499&r2=1455500&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/services/UserServiceImpl.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/services/UserServiceImpl.java Tue Mar 12 11:50:48 2013
@@ -27,6 +27,8 @@ import org.apache.syncope.common.mod.Use
import org.apache.syncope.common.search.NodeCond;
import org.apache.syncope.common.services.InvalidSearchConditionException;
import org.apache.syncope.common.services.UserService;
+import org.apache.syncope.common.to.BulkAction;
+import org.apache.syncope.common.to.BulkActionRes;
import org.apache.syncope.common.to.PropagationRequestTO;
import org.apache.syncope.common.to.UserTO;
import org.apache.syncope.core.rest.controller.UserController;
@@ -170,4 +172,9 @@ public class UserServiceImpl implements
public void setUriInfo(final UriInfo uriInfo) {
this.uriInfo = uriInfo;
}
+
+ @Override
+ public BulkActionRes bulkAction(final BulkAction bulkAction) {
+ return userController.bulkAction(bulkAction);
+ }
}
Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/workflow/WorkflowUserSuspender.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/workflow/WorkflowUserSuspender.java?rev=1455500&r1=1455499&r2=1455500&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/workflow/WorkflowUserSuspender.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/workflow/WorkflowUserSuspender.java Tue Mar 12 11:50:48 2013
@@ -71,11 +71,6 @@ public class WorkflowUserSuspender imple
taskExecutor.execute(tasks);
}
-
- if (LOG.isDebugEnabled()) {
- final UserTO savedTO = userDataBinder.getUserTO(updated.getResult());
- LOG.debug("About to return suspended user\n{}", savedTO);
- }
} catch (Exception e) {
LOG.error("Error during user suspension", e);
}
Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/UserTestITCase.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/UserTestITCase.java?rev=1455500&r1=1455499&r2=1455500&view=diff
==============================================================================
--- syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/UserTestITCase.java (original)
+++ syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/UserTestITCase.java Tue Mar 12 11:50:48 2013
@@ -42,6 +42,9 @@ import org.apache.syncope.common.mod.Use
import org.apache.syncope.common.services.UserService;
import org.apache.syncope.common.services.UserWorkflowService;
import org.apache.syncope.common.to.AttributeTO;
+import org.apache.syncope.common.to.BulkAction;
+import org.apache.syncope.common.to.BulkActionRes;
+import org.apache.syncope.common.to.BulkActionRes.Status;
import org.apache.syncope.common.to.ConfigurationTO;
import org.apache.syncope.common.to.ConnObjectTO;
import org.apache.syncope.common.to.MembershipTO;
@@ -2052,6 +2055,7 @@ public class UserTestITCase extends Abst
assertNull(connObjectTO.getAttributeMap().get("email"));
}
+ @Test
public void issueSYNCOPE265() {
for (long i = 1; i <= 5; i++) {
UserMod userMod = new UserMod();
@@ -2069,6 +2073,40 @@ public class UserTestITCase extends Abst
}
}
+ @Test
+ public void bulkActions() {
+ final BulkAction bulkAction = new BulkAction();
+
+ for (int i = 0; i < 10; i++) {
+ UserTO userTO = getUniqueSampleTO("bulk_" + i + "@apache.org");
+ bulkAction.addTarget(String.valueOf(createUser(userTO).getId()));
+ }
+
+ // check for a fail
+ bulkAction.addTarget(String.valueOf(Long.MAX_VALUE));
+
+ assertEquals(11, bulkAction.size());
+
+ bulkAction.setOperation(BulkAction.Type.SUSPEND);
+ BulkActionRes res = userService.bulkAction(bulkAction);
+ assertEquals(10, res.getResultByStatus(Status.SUCCESS).size());
+ assertEquals(1, res.getResultByStatus(Status.FAILURE).size());
+ assertEquals("suspended", userService.read(
+ Long.parseLong(res.getResultByStatus(Status.SUCCESS).get(3).toString())).getStatus());
+
+ bulkAction.setOperation(BulkAction.Type.REACTIVATE);
+ res = userService.bulkAction(bulkAction);
+ assertEquals(10, res.getResultByStatus(Status.SUCCESS).size());
+ assertEquals(1, res.getResultByStatus(Status.FAILURE).size());
+ assertEquals("active", userService.read(
+ Long.parseLong(res.getResultByStatus(Status.SUCCESS).get(3).toString())).getStatus());
+
+ bulkAction.setOperation(BulkAction.Type.DELETE);
+ res = userService.bulkAction(bulkAction);
+ assertEquals(10, res.getResultByStatus(Status.SUCCESS).size());
+ assertEquals(1, res.getResultByStatus(Status.FAILURE).size());
+ }
+
private boolean getBooleanAttribute(ConnObjectTO connObjectTO, String attrName) {
return Boolean.parseBoolean(getStringAttribute(connObjectTO, attrName));
}