You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2013/12/16 12:04:57 UTC
svn commit: r1551172 [4/7] - in /syncope/trunk: ./ client/
client/src/main/java/org/apache/syncope/client/
client/src/main/java/org/apache/syncope/client/rest/ common/
common/src/main/java/org/apache/syncope/common/
common/src/main/java/org/apache/sync...
Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/ReportRestClient.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/ReportRestClient.java?rev=1551172&r1=1551171&r2=1551172&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/ReportRestClient.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/ReportRestClient.java Mon Dec 16 11:04:52 2013
@@ -22,10 +22,10 @@ import java.util.ArrayList;
import java.util.List;
import javax.ws.rs.core.Response;
import org.apache.syncope.common.services.ReportService;
-import org.apache.syncope.common.types.ReportletConfClasses;
import org.apache.syncope.common.to.ReportTO;
import org.apache.syncope.common.types.ReportExecExportFormat;
-import org.apache.syncope.common.validation.SyncopeClientException;
+import org.apache.syncope.common.SyncopeClientException;
+import org.apache.syncope.common.wrap.ReportletConfClass;
import org.springframework.stereotype.Component;
@Component
@@ -34,13 +34,18 @@ public class ReportRestClient extends Ba
private static final long serialVersionUID = 1644689667998953604L;
public List<String> getReportletConfClasses() {
+ List<String> result = new ArrayList<String>();
+
try {
- ReportletConfClasses reportletConfClasses = getService(ReportService.class).getReportletConfClasses();
- return reportletConfClasses.getConfClasses();
+ List<ReportletConfClass> reportletConfClasses = getService(ReportService.class).getReportletConfClasses();
+ for (ReportletConfClass clazz : reportletConfClasses) {
+ result.add(clazz.getName());
+ }
} catch (SyncopeClientException e) {
LOG.error("While getting available reportlet classes", e);
- return new ArrayList<String>();
}
+
+ return result;
}
public ReportTO read(final Long reportId) {
@@ -48,15 +53,15 @@ public class ReportRestClient extends Ba
}
public List<ReportTO> list() {
- return getService(ReportService.class).list();
+ return getService(ReportService.class).list().getResult();
}
public List<ReportTO> list(final int page, final int size) {
- return getService(ReportService.class).list(page, size);
+ return getService(ReportService.class).list(page, size).getResult();
}
public int count() {
- return getService(ReportService.class).count();
+ return getService(ReportService.class).list(1, 1).getTotalCount();
}
public void create(final ReportTO reportTO) {
Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/ResourceRestClient.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/ResourceRestClient.java?rev=1551172&r1=1551171&r2=1551172&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/ResourceRestClient.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/ResourceRestClient.java Mon Dec 16 11:04:52 2013
@@ -21,14 +21,14 @@ package org.apache.syncope.console.rest;
import java.util.List;
import org.apache.syncope.common.services.ResourceService;
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.BulkAssociationAction;
+import org.apache.syncope.common.reqres.BulkAction;
+import org.apache.syncope.common.reqres.BulkActionResult;
+import org.apache.syncope.common.reqres.BulkAssociationAction;
import org.apache.syncope.common.to.ResourceTO;
import org.apache.syncope.common.to.UserTO;
import org.apache.syncope.common.types.AttributableType;
import org.apache.syncope.common.util.CollectionWrapper;
-import org.apache.syncope.common.validation.SyncopeClientException;
+import org.apache.syncope.common.SyncopeClientException;
import org.springframework.stereotype.Component;
/**
@@ -85,11 +85,11 @@ public class ResourceRestClient extends
getService(ResourceService.class).delete(name);
}
- public BulkActionRes bulkAction(final BulkAction action) {
+ public BulkActionResult bulkAction(final BulkAction action) {
return getService(ResourceService.class).bulk(action);
}
- public BulkActionRes bulkAssociationAction(
+ public BulkActionResult bulkAssociationAction(
final String resourceName, final BulkAssociationAction bulkAssociationAction,
final Class<? extends AbstractAttributableTO> typeRef) {
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=1551172&r1=1551171&r2=1551172&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 Mon Dec 16 11:04:52 2013
@@ -23,14 +23,12 @@ import java.util.List;
import javax.ws.rs.core.Response;
import org.apache.syncope.common.mod.RoleMod;
-import org.apache.syncope.common.search.NodeCond;
-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.reqres.BulkAction;
+import org.apache.syncope.common.reqres.BulkActionResult;
import org.apache.syncope.common.to.ConnObjectTO;
-import org.apache.syncope.common.to.ResourceNameTO;
+import org.apache.syncope.common.wrap.ResourceName;
import org.apache.syncope.common.to.RoleTO;
import org.apache.syncope.common.types.AttributableType;
import org.apache.syncope.common.types.ResourceAssociationActionType;
@@ -48,29 +46,27 @@ public class RoleRestClient extends Abst
private static final long serialVersionUID = -8549081557283519638L;
@Override
- public Integer count() {
- return getService(RoleService.class).count();
+ public int count() {
+ return getService(RoleService.class).list(1, 1).getTotalCount();
}
public List<RoleTO> list() {
- return getService(RoleService.class).list();
+ return getService(RoleService.class).list().getResult();
}
@Override
public List<RoleTO> list(final int page, final int size) {
- return getService(RoleService.class).list(page, size);
+ return getService(RoleService.class).list(page, size).getResult();
}
@Override
- public Integer searchCount(final NodeCond searchCond) throws InvalidSearchConditionException {
- return getService(RoleService.class).searchCount(searchCond);
+ public int searchCount(final String fiql) {
+ return getService(RoleService.class).search(fiql, 1, 1).getTotalCount();
}
@Override
- public List<RoleTO> search(final NodeCond searchCond, final int page, final int size)
- throws InvalidSearchConditionException {
-
- return getService(RoleService.class).search(searchCond, page, size);
+ public List<RoleTO> search(final String fiql, final int page, final int size) {
+ return getService(RoleService.class).search(fiql, page, size).getResult();
}
@Override
@@ -97,25 +93,25 @@ public class RoleRestClient extends Abst
}
@Override
- public BulkActionRes bulkAction(final BulkAction action) {
+ public BulkActionResult bulkAction(final BulkAction action) {
return getService(RoleRestClient.class).bulkAction(action);
}
public RoleTO unlink(final long roleId, final List<StatusBean> statuses) {
return getService(RoleService.class).associate(roleId, ResourceAssociationActionType.UNLINK,
- CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(), ResourceNameTO.class)).
+ CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(), ResourceName.class)).
readEntity(RoleTO.class);
}
public RoleTO deprovision(final long roleId, final List<StatusBean> statuses) {
return getService(RoleService.class).associate(roleId, ResourceAssociationActionType.DEPROVISION,
- CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(), ResourceNameTO.class)).
+ CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(), ResourceName.class)).
readEntity(RoleTO.class);
}
public RoleTO unassign(final long roleId, final List<StatusBean> statuses) {
return getService(RoleService.class).associate(roleId, ResourceAssociationActionType.UNASSIGN,
- CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(), ResourceNameTO.class)).
+ CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(), ResourceName.class)).
readEntity(RoleTO.class);
}
Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/SchemaRestClient.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/SchemaRestClient.java?rev=1551172&r1=1551171&r2=1551172&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/SchemaRestClient.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/SchemaRestClient.java Mon Dec 16 11:04:52 2013
@@ -27,12 +27,12 @@ import org.apache.syncope.common.service
import org.apache.syncope.common.to.AbstractSchemaTO;
import org.apache.syncope.common.to.DerSchemaTO;
import org.apache.syncope.common.to.SchemaTO;
-import org.apache.syncope.common.to.ValidatorTO;
+import org.apache.syncope.common.wrap.Validator;
import org.apache.syncope.common.to.VirSchemaTO;
import org.apache.syncope.common.types.AttributableType;
import org.apache.syncope.common.types.SchemaType;
import org.apache.syncope.common.util.CollectionWrapper;
-import org.apache.syncope.common.validation.SyncopeClientException;
+import org.apache.syncope.common.SyncopeClientException;
import org.springframework.stereotype.Component;
/**
@@ -314,7 +314,7 @@ public class SchemaRestClient extends Ba
try {
response = CollectionWrapper.unwrap(
- new ArrayList<ValidatorTO>(getService(ConfigurationService.class).getValidators()));
+ new ArrayList<Validator>(getService(ConfigurationService.class).getValidators()));
} catch (SyncopeClientException e) {
LOG.error("While getting all validators", e);
}
Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/TaskRestClient.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/TaskRestClient.java?rev=1551172&r1=1551171&r2=1551172&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/TaskRestClient.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/TaskRestClient.java Mon Dec 16 11:04:52 2013
@@ -21,18 +21,18 @@ package org.apache.syncope.console.rest;
import java.util.ArrayList;
import java.util.List;
import org.apache.syncope.common.services.TaskService;
-import org.apache.syncope.common.to.BulkAction;
-import org.apache.syncope.common.to.BulkActionRes;
-import org.apache.syncope.common.to.JobClassTO;
+import org.apache.syncope.common.reqres.BulkAction;
+import org.apache.syncope.common.reqres.BulkActionResult;
+import org.apache.syncope.common.wrap.JobClass;
import org.apache.syncope.common.to.NotificationTaskTO;
import org.apache.syncope.common.to.PropagationTaskTO;
import org.apache.syncope.common.to.SchedTaskTO;
-import org.apache.syncope.common.to.SyncActionClassTO;
+import org.apache.syncope.common.wrap.SyncActionClass;
import org.apache.syncope.common.to.SyncTaskTO;
import org.apache.syncope.common.to.AbstractTaskTO;
import org.apache.syncope.common.types.TaskType;
import org.apache.syncope.common.util.CollectionWrapper;
-import org.apache.syncope.common.validation.SyncopeClientException;
+import org.apache.syncope.common.SyncopeClientException;
import org.springframework.stereotype.Component;
/**
@@ -49,10 +49,10 @@ public class TaskRestClient extends Base
* @return list of classes.
*/
public List<String> getJobClasses() {
- List<JobClassTO> jobClasses = null;
+ List<JobClass> jobClasses = null;
try {
- jobClasses = new ArrayList<JobClassTO>(getService(TaskService.class).getJobClasses());
+ jobClasses = new ArrayList<JobClass>(getService(TaskService.class).getJobClasses());
} catch (SyncopeClientException e) {
LOG.error("While getting all job classes", e);
}
@@ -60,10 +60,10 @@ public class TaskRestClient extends Base
}
public List<String> getSyncActionsClasses() {
- List<SyncActionClassTO> actions = null;
+ List<SyncActionClass> actions = null;
try {
- actions = new ArrayList<SyncActionClassTO>(getService(TaskService.class).getSyncActionsClasses());
+ actions = new ArrayList<SyncActionClass>(getService(TaskService.class).getSyncActionsClasses());
} catch (SyncopeClientException e) {
LOG.error("While getting all sync actions classes", e);
}
@@ -76,19 +76,15 @@ public class TaskRestClient extends Base
* @param kind of task (propagation, sched, sync).
* @return number of stored tasks.
*/
- public Integer count(final String kind) {
- return getService(TaskService.class).count(TaskType.fromString(kind));
+ public int count(final String kind) {
+ return getService(TaskService.class).list(TaskType.fromString(kind), 1, 1).getTotalCount();
}
- /**
- * Return a paginated list of tasks.
- *
- * @param page number.
- * @param size per page.
- * @return paginated list.
- */
- public <T extends AbstractTaskTO> List<T> listTasks(final Class<T> reference, final int page, final int size) {
- return getService(TaskService.class).list(getTaskType(reference), page, size);
+ @SuppressWarnings("unchecked")
+ public <T extends AbstractTaskTO> List<T> listTasks(
+ final Class<T> reference, final int page, final int size) {
+
+ return (List<T>) getService(TaskService.class).list(getTaskType(reference), page, size).getResult();
}
private TaskType getTaskType(final Class<?> reference) {
@@ -117,11 +113,6 @@ public class TaskRestClient extends Base
return getService(TaskService.class).read(taskId);
}
- /**
- * Delete specified task.
- *
- * @param taskId task to delete
- */
public void delete(final Long taskId, final Class<? extends AbstractTaskTO> taskToClass) {
getService(TaskService.class).delete(taskId);
}
@@ -131,20 +122,10 @@ public class TaskRestClient extends Base
startExecution(taskId, false);
}
- /**
- * Start execution for the specified TaskTO.
- *
- * @param taskId task id
- */
public void startExecution(final long taskId, final boolean dryRun) {
getService(TaskService.class).execute(taskId, dryRun);
}
- /**
- * Delete specified task's execution.
- *
- * @param taskExecId task execution id
- */
@Override
public void deleteExecution(final long taskExecId) {
getService(TaskService.class).deleteExecution(taskExecId);
@@ -166,7 +147,7 @@ public class TaskRestClient extends Base
getService(TaskService.class).update(taskTO.getId(), taskTO);
}
- public BulkActionRes bulkAction(final BulkAction action) {
+ public BulkActionResult bulkAction(final BulkAction action) {
return getService(TaskService.class).bulk(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=1551172&r1=1551171&r2=1551172&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 Mon Dec 16 11:04:52 2013
@@ -22,19 +22,17 @@ import java.util.List;
import javax.ws.rs.core.Response;
import org.apache.syncope.common.mod.StatusMod;
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.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.reqres.BulkAction;
+import org.apache.syncope.common.reqres.BulkActionResult;
import org.apache.syncope.common.to.ConnObjectTO;
-import org.apache.syncope.common.to.ResourceNameTO;
+import org.apache.syncope.common.wrap.ResourceName;
import org.apache.syncope.common.to.UserTO;
import org.apache.syncope.common.types.AttributableType;
import org.apache.syncope.common.types.ResourceAssociationActionType;
import org.apache.syncope.common.util.CollectionWrapper;
-import org.apache.syncope.common.validation.SyncopeClientException;
+import org.apache.syncope.common.SyncopeClientException;
import org.apache.syncope.console.commons.status.StatusBean;
import org.apache.syncope.console.commons.status.StatusUtils;
import org.springframework.stereotype.Component;
@@ -48,8 +46,8 @@ public class UserRestClient extends Abst
private static final long serialVersionUID = -1575748964398293968L;
@Override
- public Integer count() {
- return getService(UserService.class).count();
+ public int count() {
+ return getService(UserService.class).list(1, 1).getTotalCount();
}
/**
@@ -61,7 +59,7 @@ public class UserRestClient extends Abst
*/
@Override
public List<UserTO> list(final int page, final int size) {
- return getService(UserService.class).list(page, size);
+ return getService(UserService.class).list(page, size).getResult();
}
public UserTO create(final UserTO userTO) {
@@ -89,15 +87,13 @@ public class UserRestClient extends Abst
}
@Override
- public Integer searchCount(final NodeCond searchCond) throws InvalidSearchConditionException {
- return getService(UserService.class).searchCount(searchCond);
+ public int searchCount(final String fiql) {
+ return getService(UserService.class).search(fiql, 1, 1).getTotalCount();
}
@Override
- public List<UserTO> search(final NodeCond searchCond, final int page, final int size)
- throws InvalidSearchConditionException {
-
- return getService(UserService.class).search(searchCond, page, size);
+ public List<UserTO> search(final String fiql, final int page, final int size) {
+ return getService(UserService.class).search(fiql, page, size).getResult();
}
@Override
@@ -118,23 +114,23 @@ public class UserRestClient extends Abst
}
@Override
- public BulkActionRes bulkAction(final BulkAction action) {
+ public BulkActionResult bulkAction(final BulkAction action) {
return getService(UserService.class).bulk(action);
}
public void unlink(final long userId, final List<StatusBean> statuses) {
getService(UserService.class).associate(userId, ResourceAssociationActionType.UNLINK,
- CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(), ResourceNameTO.class));
+ CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(), ResourceName.class));
}
public void deprovision(final long userId, final List<StatusBean> statuses) {
getService(UserService.class).associate(userId, ResourceAssociationActionType.DEPROVISION,
- CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(), ResourceNameTO.class));
+ CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(), ResourceName.class));
}
public void unassign(final long userId, final List<StatusBean> statuses) {
getService(UserService.class).associate(userId, ResourceAssociationActionType.UNASSIGN,
- CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(), ResourceNameTO.class));
+ CollectionWrapper.wrap(StatusUtils.buildStatusMod(statuses).getResourceNames(), ResourceName.class));
}
}
Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/UserSelfRestClient.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/UserSelfRestClient.java?rev=1551172&r1=1551171&r2=1551172&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/UserSelfRestClient.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/UserSelfRestClient.java Mon Dec 16 11:04:52 2013
@@ -21,7 +21,7 @@ package org.apache.syncope.console.rest;
import org.apache.syncope.common.mod.UserMod;
import org.apache.syncope.common.services.UserSelfService;
import org.apache.syncope.common.to.UserTO;
-import org.apache.syncope.common.validation.SyncopeClientException;
+import org.apache.syncope.common.SyncopeClientException;
import org.apache.syncope.console.SyncopeSession;
import org.springframework.stereotype.Component;
Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/WorkflowRestClient.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/WorkflowRestClient.java?rev=1551172&r1=1551171&r2=1551172&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/WorkflowRestClient.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/WorkflowRestClient.java Mon Dec 16 11:04:52 2013
@@ -26,7 +26,7 @@ import org.apache.cxf.jaxrs.client.WebCl
import org.apache.syncope.common.services.WorkflowService;
import org.apache.syncope.common.types.AttributableType;
import org.apache.syncope.common.types.RESTHeaders;
-import org.apache.syncope.common.validation.SyncopeClientException;
+import org.apache.syncope.common.SyncopeClientException;
import org.apache.syncope.console.SyncopeSession;
import org.springframework.stereotype.Component;
Modified: 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=1551172&r1=1551171&r2=1551172&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/ActionResultColumn.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/extensions/markup/html/repeater/data/table/ActionResultColumn.java Mon Dec 16 11:04:52 2013
@@ -19,7 +19,7 @@
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.syncope.common.reqres.BulkActionResult;
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;
@@ -41,11 +41,11 @@ public class ActionResultColumn<T, S> ex
*/
protected static final Logger LOG = LoggerFactory.getLogger(ActionResultColumn.class);
- private final BulkActionRes results;
+ private final BulkActionResult results;
private final String idFieldName;
- public ActionResultColumn(final BulkActionRes results, final String idFieldName) {
+ public ActionResultColumn(final BulkActionResult results, final String idFieldName) {
super(new Model());
this.results = results;
this.idFieldName = idFieldName;
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=1551172&r1=1551171&r2=1551172&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 Mon Dec 16 11:04:52 2013
@@ -92,6 +92,7 @@ public class ActionLinksPanel extends Pa
public void addWithRoles(
final ActionLink link, final ActionLink.ActionType type, final String roles) {
+
addWithRoles(link, type, roles, true);
}
@@ -105,7 +106,7 @@ public class ActionLinksPanel extends Pa
case CLAIM:
fragment = new Fragment("panelClaim", "fragmentClaim", this);
- fragment.addOrReplace(new ClearIndicatingAjaxLink("claimLink", pageRef) {
+ fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("claimLink", pageRef) {
private static final long serialVersionUID = -7978723352517770644L;
@@ -119,7 +120,7 @@ public class ActionLinksPanel extends Pa
case MANAGE_RESOURCES:
fragment = new Fragment("panelManageResources", "fragmentManageResources", this);
- fragment.addOrReplace(new ClearIndicatingAjaxLink("manageResourcesLink", pageRef) {
+ fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("manageResourcesLink", pageRef) {
private static final long serialVersionUID = -6957616042924610291L;
@@ -133,7 +134,7 @@ public class ActionLinksPanel extends Pa
case MANAGE_USERS:
fragment = new Fragment("panelManageUsers", "fragmentManageUsers", this);
- fragment.addOrReplace(new ClearIndicatingAjaxLink("manageUsersLink", pageRef) {
+ fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("manageUsersLink", pageRef) {
private static final long serialVersionUID = -6957616042924610292L;
@@ -147,7 +148,7 @@ public class ActionLinksPanel extends Pa
case MANAGE_ROLES:
fragment = new Fragment("panelManageRoles", "fragmentManageRoles", this);
- fragment.addOrReplace(new ClearIndicatingAjaxLink("manageRolesLink", pageRef) {
+ fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("manageRolesLink", pageRef) {
private static final long serialVersionUID = -6957616042924610293L;
@@ -161,7 +162,7 @@ public class ActionLinksPanel extends Pa
case CREATE:
fragment = new Fragment("panelCreate", "fragmentCreate", this);
- fragment.addOrReplace(new ClearIndicatingAjaxLink("createLink", pageRef) {
+ fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("createLink", pageRef) {
private static final long serialVersionUID = -7978723352517770644L;
@@ -175,7 +176,7 @@ public class ActionLinksPanel extends Pa
case EDIT:
fragment = new Fragment("panelEdit", "fragmentEdit", this);
- fragment.addOrReplace(new ClearIndicatingAjaxLink("editLink", pageRef) {
+ fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("editLink", pageRef) {
private static final long serialVersionUID = -7978723352517770644L;
@@ -189,7 +190,7 @@ public class ActionLinksPanel extends Pa
case USER_TEMPLATE:
fragment = new Fragment("panelUserTemplate", "fragmentUserTemplate", this);
- fragment.addOrReplace(new ClearIndicatingAjaxLink("userTemplateLink", pageRef) {
+ fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("userTemplateLink", pageRef) {
private static final long serialVersionUID = -7978723352517770644L;
@@ -203,7 +204,7 @@ public class ActionLinksPanel extends Pa
case ROLE_TEMPLATE:
fragment = new Fragment("panelRoleTemplate", "fragmentRoleTemplate", this);
- fragment.addOrReplace(new ClearIndicatingAjaxLink("roleTemplateLink", pageRef) {
+ fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("roleTemplateLink", pageRef) {
private static final long serialVersionUID = -7978723352517770644L;
@@ -217,7 +218,7 @@ public class ActionLinksPanel extends Pa
case ENABLE:
fragment = new Fragment("panelEnable", "fragmentEnable", this);
- fragment.addOrReplace(new ClearIndicatingAjaxLink("enableLink", pageRef) {
+ fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("enableLink", pageRef) {
private static final long serialVersionUID = -7978723352517770644L;
@@ -231,7 +232,7 @@ public class ActionLinksPanel extends Pa
case SEARCH:
fragment = new Fragment("panelSearch", "fragmentSearch", this);
- fragment.addOrReplace(new ClearIndicatingAjaxLink("searchLink", pageRef) {
+ fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("searchLink", pageRef) {
private static final long serialVersionUID = -7978723352517770644L;
@@ -245,7 +246,7 @@ public class ActionLinksPanel extends Pa
case EXECUTE:
fragment = new Fragment("panelExecute", "fragmentExecute", this);
- fragment.addOrReplace(new ClearIndicatingAjaxLink("executeLink", pageRef) {
+ fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("executeLink", pageRef) {
private static final long serialVersionUID = -7978723352517770644L;
@@ -259,7 +260,7 @@ public class ActionLinksPanel extends Pa
case DRYRUN:
fragment = new Fragment("panelDryRun", "fragmentDryRun", this);
- fragment.addOrReplace(new ClearIndicatingAjaxLink("dryRunLink", pageRef) {
+ fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("dryRunLink", pageRef) {
private static final long serialVersionUID = -7978723352517770644L;
@@ -273,7 +274,7 @@ public class ActionLinksPanel extends Pa
case DELETE:
fragment = new Fragment("panelDelete", "fragmentDelete", this);
- fragment.addOrReplace(new IndicatingOnConfirmAjaxLink("deleteLink", pageRef) {
+ fragment.addOrReplace(new IndicatingOnConfirmAjaxLink<Void>("deleteLink", pageRef) {
private static final long serialVersionUID = -7978723352517770644L;
@@ -288,7 +289,7 @@ public class ActionLinksPanel extends Pa
case SELECT:
fragment = new Fragment("panelSelect", "fragmentSelect", this);
- fragment.addOrReplace(new ClearIndicatingAjaxLink("selectLink", pageRef) {
+ fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("selectLink", pageRef) {
private static final long serialVersionUID = -7978723352517770644L;
@@ -303,7 +304,7 @@ public class ActionLinksPanel extends Pa
case EXPORT:
fragment = new Fragment("panelExport", "fragmentExport", this);
- fragment.addOrReplace(new ClearIndicatingAjaxLink("exportLink", pageRef) {
+ fragment.addOrReplace(new ClearIndicatingAjaxLink<Void>("exportLink", pageRef) {
private static final long serialVersionUID = -7978723352517770644L;
@@ -376,13 +377,13 @@ public class ActionLinksPanel extends Pa
fragment.addOrReplace(
new IndicatingOnConfirmAjaxLink<Void>("unlinkLink", pageRef, "confirmUnlink") {
- private static final long serialVersionUID = -6957616042924610293L;
+ private static final long serialVersionUID = -6957616042924610293L;
- @Override
- protected void onClickInternal(final AjaxRequestTarget target) {
- link.onClick(target);
- }
- });
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+ link.onClick(target);
+ }
+ });
break;
case UNASSIGN:
@@ -391,13 +392,13 @@ public class ActionLinksPanel extends Pa
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);
- }
- });
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+ link.onClick(target);
+ }
+ });
break;
case DEPROVISION:
@@ -406,13 +407,13 @@ public class ActionLinksPanel extends Pa
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);
- }
- });
+ @Override
+ protected void onClickInternal(final AjaxRequestTarget target) {
+ link.onClick(target);
+ }
+ });
break;
default:
// do nothink
Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/MultiValueSelectorPanel.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/MultiValueSelectorPanel.java?rev=1551172&r1=1551171&r2=1551172&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/MultiValueSelectorPanel.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/MultiValueSelectorPanel.java Mon Dec 16 11:04:52 2013
@@ -42,7 +42,6 @@ public class MultiValueSelectorPanel<E>
private WebMarkupContainer container;
public MultiValueSelectorPanel(final String id, final IModel<List<E>> model, final FieldPanel panelTemplate) {
-
this(id, model, panelTemplate, false);
}
@@ -74,7 +73,6 @@ public class MultiValueSelectorPanel<E>
@Override
protected void onUpdate(final AjaxRequestTarget target) {
-
send(getPage(), Broadcast.BREADTH, new MultiValueSelectorEvent(target));
}
});
@@ -83,7 +81,7 @@ public class MultiValueSelectorPanel<E>
fieldPanel.setNewModel(item);
item.add(fieldPanel);
- AjaxLink minus = new IndicatingAjaxLink("drop") {
+ AjaxLink<Void> minus = new IndicatingAjaxLink<Void>("drop") {
private static final long serialVersionUID = -7978723352517770644L;
@@ -112,7 +110,7 @@ public class MultiValueSelectorPanel<E>
final Fragment fragment;
if (item.getIndex() == model.getObject().size() - 1) {
- final AjaxLink plus = new IndicatingAjaxLink("add") {
+ final AjaxLink<Void> plus = new IndicatingAjaxLink<Void>("add") {
private static final long serialVersionUID = -7978723352517770644L;
Modified: syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/panels/AbstractSearchPanel.html
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/panels/AbstractSearchPanel.html?rev=1551172&r1=1551171&r2=1551172&view=diff
==============================================================================
--- syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/panels/AbstractSearchPanel.html (original)
+++ syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/panels/AbstractSearchPanel.html Mon Dec 16 11:04:52 2013
@@ -21,54 +21,26 @@ under the License.
<div id="searchBox">
<div wicket:id="searchFeedback"></div>
<table border="0">
- <thead>
- <tr>
- <th></th>
- <th><wicket:message key="search_not_value"/></th>
- <th><wicket:message key="search_filter_type"/></th>
- <th><wicket:message key="search_filter_name"/></th>
- <th><wicket:message key="search_type_cond"/></th>
- <th><wicket:message key="search_filter_value"/></th>
- <th></th>
- <th></th>
- <th></th>
- </tr>
- </thead>
<tbody wicket:id="searchFormContainer">
<tr wicket:id="searchView">
- <td>
- <b><span wicket:id="operationType"/></b>
- </td>
- <td>
- <input type="checkbox" wicket:id="notOperator"/>
+ <td width="60">
+ <select class="text ui-widget-content ui-corner-all" wicket:id="operator"/>
</td>
<td>
- <select class="text ui-widget-content ui-corner-all"
- wicket:id="filterType"/>
+ <select class="text ui-widget-content ui-corner-all" wicket:id="type"/>
</td>
<td>
- <select class="text ui-widget-content ui-corner-all"
- wicket:id="filterName"/>
+ <select class="text ui-widget-content ui-corner-all" wicket:id="property"/>
</td>
<td>
- <select class="text ui-widget-content ui-corner-all"
- wicket:id="type"/>
+ <select class="text ui-widget-content ui-corner-all" wicket:id="comparator"/>
</td>
<td>
- <input type="text" class="text ui-widget-content ui-corner-all"
- wicket:id="filterValue"/>
+ <input type="text" class="text ui-widget-content ui-corner-all" wicket:id="value"/>
</td>
<td>
- <input type="button" class="text ui-widget-content ui-corner-all"
- wicket:id="addAndButton"/>
- </td>
- <td>
- <input type="submit" class="text ui-widget-content ui-corner-all"
- wicket:id="addOrButton"/>
- </td>
- <td>
- <input type="button" class="text ui-widget-content ui-corner-all"
- wicket:id="dropButton"/>
+ <a wicket:id="add"><img src="img/plus-icon.png" alt="add icon" class="add_button"/></a>
+ <a wicket:id="drop"><img src="img/minus-icon.png" alt="remove icon" class="drop_button"/></a>
</td>
</tr>
</tbody>
Modified: syncope/trunk/console/src/main/resources/org/apache/syncope/console/wicket/markup/html/form/MultiValueSelectorPanel.html
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/resources/org/apache/syncope/console/wicket/markup/html/form/MultiValueSelectorPanel.html?rev=1551172&r1=1551171&r2=1551172&view=diff
==============================================================================
--- syncope/trunk/console/src/main/resources/org/apache/syncope/console/wicket/markup/html/form/MultiValueSelectorPanel.html (original)
+++ syncope/trunk/console/src/main/resources/org/apache/syncope/console/wicket/markup/html/form/MultiValueSelectorPanel.html Mon Dec 16 11:04:52 2013
@@ -16,20 +16,20 @@ KIND, either express or implied. See th
specific language governing permissions and limitations
under the License.
-->
-<html>
- <wicket:panel>
- <span wicket:id="multiValueContainer">
- <span wicket:id="view">
- <span wicket:id="panel">[form field]</span>
- <a wicket:id="drop"><img src="img/minus-icon.png" alt="remove icon" class="drop_button" /></a>
- <span wicket:id="panelPlus">[plus]</span>
- <br />
- </span>
- <wicket:fragment wicket:id="fragmentPlus">
- <a wicket:id="add"><img src="img/plus-icon.png" alt="add icon" class="add_button" /></a>
- </wicket:fragment>
- <wicket:fragment wicket:id="emptyFragment">
- </wicket:fragment>
- </span>
- </wicket:panel>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:panel>
+ <span wicket:id="multiValueContainer">
+ <span wicket:id="view">
+ <span wicket:id="panel">[form field]</span>
+ <a wicket:id="drop"><img src="img/minus-icon.png" alt="remove icon" class="drop_button" /></a>
+ <span wicket:id="panelPlus">[plus]</span>
+ <br />
+ </span>
+ <wicket:fragment wicket:id="fragmentPlus">
+ <a wicket:id="add"><img src="img/plus-icon.png" alt="add icon" class="add_button" /></a>
+ </wicket:fragment>
+ <wicket:fragment wicket:id="emptyFragment">
+ </wicket:fragment>
+ </span>
+ </wicket:panel>
</html>
Modified: syncope/trunk/console/src/main/webapp/css/style.css
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/webapp/css/style.css?rev=1551172&r1=1551171&r2=1551172&view=diff
==============================================================================
--- syncope/trunk/console/src/main/webapp/css/style.css (original)
+++ syncope/trunk/console/src/main/webapp/css/style.css Mon Dec 16 11:04:52 2013
@@ -30,9 +30,8 @@ body {
margin-top: 5px;
}
#roletabs {
- background-color: #B9CFB3;
- margin: 0px 10px;
- margin-top: 10px;
+ margin: 0px 5px;
+ margin-top: 5px;
}
#tabs div {
@@ -115,10 +114,12 @@ a img {
input[disabled] {
background-color: #ddd;
+ background-image: none;
}
select[disabled] {
background-color: #ddd;
+ background-image: none;
}
#loginFeedbackDiv {
Modified: syncope/trunk/console/src/test/java/org/apache/syncope/console/ConfigurationTestITCase.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/test/java/org/apache/syncope/console/ConfigurationTestITCase.java?rev=1551172&r1=1551171&r2=1551172&view=diff
==============================================================================
--- syncope/trunk/console/src/test/java/org/apache/syncope/console/ConfigurationTestITCase.java (original)
+++ syncope/trunk/console/src/test/java/org/apache/syncope/console/ConfigurationTestITCase.java Mon Dec 16 11:04:52 2013
@@ -105,9 +105,9 @@ public class ConfigurationTestITCase ext
selenium.waitForCondition("selenium.isElementPresent(\"//div[@id='tabs']\");", "30000");
- selenium.click("//tr[7]/td[3]/div/span[14]/a");
+ selenium.click("//tr[6]/td[3]/div/span[14]/a");
- assertTrue(selenium.getConfirmation().matches("^Do you really want to delete the selected item[\\s\\S]$"));
+ assertTrue(selenium.getConfirmation().equals("Do you really want to delete the selected item(s)?"));
selenium.waitForCondition("selenium.isTextPresent(" + "\"Operation executed successfully\");", "30000");
}
@@ -159,7 +159,7 @@ public class ConfigurationTestITCase ext
+ "//select[@name='eventSelection:categoryContainer:type:dropDownChoiceField']"
+ "/option[text()='PROPAGATION']\");",
"30000");
-
+
selenium.select(
"//select[@name='eventSelection:categoryContainer:type:dropDownChoiceField']",
"label=PROPAGATION");
@@ -182,12 +182,12 @@ public class ConfigurationTestITCase ext
"//select[@name='eventSelection:categoryContainer:subcategory:dropDownChoiceField']",
"label=resource-db-sync");
- selenium.waitForCondition(
- "selenium.isElementPresent(\"//input[@name='eventSelection:eventsContainer:eventsPanel:failureGroup']\");",
+ selenium.waitForCondition("selenium.isElementPresent("
+ + "\"//input[@name='eventSelection:eventsContainer:eventsPanel:failureGroup']\");",
"30000");
-
+
selenium.click("//div[@class='eventSelectionWidzard']/div[2]/div[3]/span/div/input");
-
+
selenium.click("//div[2]/form/div[3]/ul/li[4]/a/span");
selenium.waitForCondition("selenium.isElementPresent("
Modified: syncope/trunk/console/src/test/java/org/apache/syncope/console/ConnInstanceTestITCase.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/test/java/org/apache/syncope/console/ConnInstanceTestITCase.java?rev=1551172&r1=1551171&r2=1551172&view=diff
==============================================================================
--- syncope/trunk/console/src/test/java/org/apache/syncope/console/ConnInstanceTestITCase.java (original)
+++ syncope/trunk/console/src/test/java/org/apache/syncope/console/ConnInstanceTestITCase.java Mon Dec 16 11:04:52 2013
@@ -78,7 +78,7 @@ public class ConnInstanceTestITCase exte
selenium.click("//div[3]/ul/li[2]/a");
selenium.click("//tr[4]/td[7]/div/span[14]/a");
- assertTrue(selenium.getConfirmation().matches("^Do you really want to delete the selected item[\\s\\S]$"));
+ assertTrue(selenium.getConfirmation().equals("Do you really want to delete the selected item(s)?"));
selenium.waitForCondition("selenium.isTextPresent(\"Error:\");", "10000");
}
Modified: syncope/trunk/console/src/test/java/org/apache/syncope/console/ResourceTestITCase.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/test/java/org/apache/syncope/console/ResourceTestITCase.java?rev=1551172&r1=1551171&r2=1551172&view=diff
==============================================================================
--- syncope/trunk/console/src/test/java/org/apache/syncope/console/ResourceTestITCase.java (original)
+++ syncope/trunk/console/src/test/java/org/apache/syncope/console/ResourceTestITCase.java Mon Dec 16 11:04:52 2013
@@ -53,7 +53,7 @@ public class ResourceTestITCase extends
selenium.click("//tbody/tr[2]/td/input");
- assertTrue(selenium.getConfirmation().matches("^Do you really want to delete the selected item[\\s\\S]$"));
+ assertTrue(selenium.getConfirmation().equals("Do you really want to delete the selected item(s)?"));
selenium.click("name=apply");
}
@@ -66,7 +66,7 @@ public class ResourceTestITCase extends
selenium.click("//tr[3]/td[6]/div/span[14]/a");
- assertTrue(selenium.getConfirmation().matches("^Do you really want to delete the selected item[\\s\\S]$"));
+ assertTrue(selenium.getConfirmation().equals("Do you really want to delete the selected item(s)?"));
}
@Test
@@ -111,4 +111,4 @@ public class ResourceTestITCase extends
selenium.waitForCondition(
"selenium.isElementPresent(\"//div/ul/li/span[contains(text(), 'Successful connection')]\");", "30000");
}
-}
\ No newline at end of file
+}
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=1551172&r1=1551171&r2=1551172&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 Mon Dec 16 11:04:52 2013
@@ -170,6 +170,6 @@ public class RoleTestITCase extends Abst
selenium.click("css=img[title='Delete']");
- assertTrue(selenium.getConfirmation().matches("^Do you really want to delete the selected item[\\s\\S]$"));
+ assertTrue(selenium.getConfirmation().equals("Do you really want to delete the selected item(s)?"));
}
}
Modified: syncope/trunk/console/src/test/java/org/apache/syncope/console/SchemaTestITCase.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/test/java/org/apache/syncope/console/SchemaTestITCase.java?rev=1551172&r1=1551171&r2=1551172&view=diff
==============================================================================
--- syncope/trunk/console/src/test/java/org/apache/syncope/console/SchemaTestITCase.java (original)
+++ syncope/trunk/console/src/test/java/org/apache/syncope/console/SchemaTestITCase.java Mon Dec 16 11:04:52 2013
@@ -50,6 +50,6 @@ public class SchemaTestITCase extends Ab
selenium.click("//div[3]/div/div/div/div/div/span/table/tbody/tr/td[7]/div/span[14]/a");
- assertTrue(selenium.getConfirmation().matches("^Do you really want to delete the selected item[\\s\\S]$"));
+ assertTrue(selenium.getConfirmation().equals("Do you really want to delete the selected item(s)?"));
}
}
Modified: syncope/trunk/console/src/test/java/org/apache/syncope/console/TaskTestITCase.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/test/java/org/apache/syncope/console/TaskTestITCase.java?rev=1551172&r1=1551171&r2=1551172&view=diff
==============================================================================
--- syncope/trunk/console/src/test/java/org/apache/syncope/console/TaskTestITCase.java (original)
+++ syncope/trunk/console/src/test/java/org/apache/syncope/console/TaskTestITCase.java Mon Dec 16 11:04:52 2013
@@ -52,7 +52,7 @@ public class TaskTestITCase extends Abst
selenium.click("//div[@id='tabs']/ul/li[3]/a/span");
selenium.click("//table/tbody/tr/td[8]/div/span[14]/a");
- assertTrue(selenium.getConfirmation().matches("^Do you really want to delete the selected item[\\s\\S]$"));
+ assertTrue(selenium.getConfirmation().equals("Do you really want to delete the selected item(s)?"));
selenium.waitForCondition("selenium.isTextPresent(\"Operation executed successfully\");", "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=1551172&r1=1551171&r2=1551172&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 Mon Dec 16 11:04:52 2013
@@ -71,16 +71,14 @@ public class UserTestITCase extends Abst
selenium.waitForCondition("selenium.isElementPresent(\"//div[@id='tabs']\");", "30000");
selenium.click("link=Search");
- selenium.select("//td[3]/select", "label=MEMBERSHIP");
+ selenium.select("//td[2]/select", "label=MEMBERSHIP");
- selenium.waitForCondition("selenium.isElementPresent("
- + "\"//td[4]/select[option='3 citizen']\");", "30000");
+ selenium.waitForCondition("selenium.isElementPresent(\"//td[3]/select[option='3 citizen']\");", "30000");
- selenium.select("//td[4]/select", "label=3 citizen");
+ selenium.select("//td[3]/select", "label=3 citizen");
selenium.click("name=search");
- selenium.waitForCondition(
- "selenium.isElementPresent(\"//*[@id='users-contain']//*[div=2]\");", "30000");
+ selenium.waitForCondition("selenium.isElementPresent(\"//*[@id='users-contain']//*[div=2]\");", "30000");
}
@Test
@@ -91,7 +89,7 @@ public class UserTestITCase extends Abst
selenium.click("//*[@id=\"users-contain\"]//*[div=4]/../td[5]/div/span[14]/a");
- assertTrue(selenium.getConfirmation().matches("^Do you really want to delete the selected item[\\s\\S]$"));
+ assertTrue(selenium.getConfirmation().equals("Do you really want to delete the selected item(s)?"));
selenium.waitForCondition("selenium.isElementPresent(" + "\"//div[@id='propagation']/span\");", "30000");
Modified: syncope/trunk/console/src/test/resources/web.xml
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/test/resources/web.xml?rev=1551172&r1=1551171&r2=1551172&view=diff
==============================================================================
--- syncope/trunk/console/src/test/resources/web.xml (original)
+++ syncope/trunk/console/src/test/resources/web.xml Mon Dec 16 11:04:52 2013
@@ -20,8 +20,8 @@ under the License.
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
- http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
- version="2.5">
+ http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
+ version="3.0">
<display-name>Apache Syncope console</display-name>
Modified: syncope/trunk/core/pom.xml
URL: http://svn.apache.org/viewvc/syncope/trunk/core/pom.xml?rev=1551172&r1=1551171&r2=1551172&view=diff
==============================================================================
--- syncope/trunk/core/pom.xml (original)
+++ syncope/trunk/core/pom.xml Mon Dec 16 11:04:52 2013
@@ -238,8 +238,8 @@ under the License.
</dependency>
<dependency>
- <groupId>javax.validation</groupId>
- <artifactId>validation-api</artifactId>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-validation_1.0_spec</artifactId>
</dependency>
<dependency>
<groupId>org.apache.bval</groupId>
Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/init/ContentUpgrader.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/init/ContentUpgrader.java?rev=1551172&r1=1551171&r2=1551172&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/init/ContentUpgrader.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/init/ContentUpgrader.java Mon Dec 16 11:04:52 2013
@@ -26,14 +26,12 @@ import java.util.HashSet;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
-import org.apache.syncope.common.search.NodeCond;
import org.apache.syncope.common.to.UserTO;
import org.apache.syncope.common.types.AbstractPolicySpec;
import org.apache.syncope.common.types.CipherAlgorithm;
import org.apache.syncope.common.types.ConnConfProperty;
import org.apache.syncope.core.persistence.beans.ConnInstance;
import org.apache.syncope.core.persistence.beans.ExternalResource;
-import org.apache.syncope.core.persistence.beans.Notification;
import org.apache.syncope.core.persistence.beans.Policy;
import org.apache.syncope.core.persistence.beans.SyncTask;
import org.apache.syncope.core.persistence.beans.SyncopeConf;
@@ -173,33 +171,6 @@ public class ContentUpgrader extends Abs
}
}
- private void upgradeNotification() {
- Field xmlAbout = ReflectionUtils.findField(Notification.class, "xmlAbout");
- xmlAbout.setAccessible(true);
- Field xmlRecipients = ReflectionUtils.findField(Notification.class, "xmlRecipients");
- xmlRecipients.setAccessible(true);
- for (Notification notification : notificationDAO.findAll()) {
- try {
- String oldAbout = (String) xmlAbout.get(notification);
- if (oldAbout != null) {
- notification.setAbout(
- XMLSerializer.<NodeCond>deserialize(
- oldAbout.replaceAll("org\\.apache\\.syncope\\.client\\.search\\.",
- "org.apache.syncope.common.search.")));
- }
- String oldRecipients = (String) xmlRecipients.get(notification);
- if (oldRecipients != null) {
- notification.setRecipients(
- XMLSerializer.<NodeCond>deserialize(
- oldRecipients.replaceAll("org\\.apache\\.syncope\\.client\\.search\\.",
- "org.apache.syncope.common.search.")));
- }
- } catch (Exception e) {
- LOG.error("While upgrading {}", notification, e);
- }
- }
- }
-
private void upgradeSyncTask() {
Field userTemplate = ReflectionUtils.findField(SyncTask.class, "userTemplate");
userTemplate.setAccessible(true);
@@ -253,8 +224,6 @@ public class ContentUpgrader extends Abs
upgradePolicy();
- upgradeNotification();
-
upgradeSyncTask();
upgradeReportletConf();
Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/notification/NotificationManager.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/notification/NotificationManager.java?rev=1551172&r1=1551171&r2=1551172&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/notification/NotificationManager.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/notification/NotificationManager.java Mon Dec 16 11:04:52 2013
@@ -50,6 +50,7 @@ import org.apache.syncope.core.persisten
import org.apache.syncope.core.persistence.dao.RoleDAO;
import org.apache.syncope.core.persistence.dao.TaskDAO;
import org.apache.syncope.core.persistence.dao.UserDAO;
+import org.apache.syncope.core.rest.data.SearchCondConverter;
import org.apache.syncope.core.rest.data.UserDataBinder;
import org.apache.syncope.core.util.AttributableUtil;
import org.apache.syncope.core.util.EntitlementUtil;
@@ -66,7 +67,7 @@ import org.springframework.ui.velocity.V
*
* @see NotificationTask
*/
-@Transactional(rollbackFor = {Throwable.class})
+@Transactional(rollbackFor = { Throwable.class })
public class NotificationManager {
/**
@@ -149,7 +150,8 @@ public class NotificationManager {
if (notification.getRecipients() != null) {
recipients.addAll(searchDAO.<SyncopeUser>search(EntitlementUtil.getRoleIds(entitlementDAO.findAll()),
- notification.getRecipients(), AttributableUtil.getInstance(AttributableType.USER)));
+ SearchCondConverter.convert(notification.getRecipients()),
+ AttributableUtil.getInstance(AttributableType.USER)));
}
if (notification.isSelfAsRecipient() && attributable instanceof SyncopeUser) {
@@ -242,8 +244,9 @@ public class NotificationManager {
if (events.isEmpty()) {
LOG.debug("No events found about {}", attributable);
} else if (attributableType == null || attributable == null || notification.getAbout() == null
- || searchDAO.matches(attributable, notification.getAbout(),
- AttributableUtil.getInstance(attributableType))) {
+ || searchDAO.matches(attributable,
+ SearchCondConverter.convert(notification.getAbout()),
+ AttributableUtil.getInstance(attributableType))) {
LOG.debug("Creating notification task for events {} about {}", events, attributable);
Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/beans/Notification.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/beans/Notification.java?rev=1551172&r1=1551171&r2=1551172&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/beans/Notification.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/beans/Notification.java Mon Dec 16 11:04:52 2013
@@ -29,16 +29,13 @@ import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.Id;
-import javax.persistence.Lob;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
-import org.apache.syncope.common.search.NodeCond;
import org.apache.syncope.common.types.IntMappingType;
import org.apache.syncope.common.types.TraceLevel;
import org.apache.syncope.core.persistence.validation.entity.NotificationCheck;
-import org.apache.syncope.core.util.XMLSerializer;
@NotificationCheck
@Entity
@@ -53,11 +50,9 @@ public class Notification extends Abstra
@Column(name = "events")
private List<String> events;
- @Lob
- private String xmlAbout;
+ private String about;
- @Lob
- private String xmlRecipients;
+ private String recipients;
@NotNull
@Enumerated(EnumType.STRING)
@@ -95,20 +90,20 @@ public class Notification extends Abstra
return id;
}
- public NodeCond getAbout() {
- return xmlAbout == null ? null : XMLSerializer.<NodeCond>deserialize(xmlAbout);
+ public String getAbout() {
+ return about;
}
- public void setAbout(NodeCond about) {
- xmlAbout = about == null ? null : XMLSerializer.serialize(about);
+ public void setAbout(final String about) {
+ this.about = about;
}
- public NodeCond getRecipients() {
- return xmlRecipients == null ? null : XMLSerializer.<NodeCond>deserialize(xmlRecipients);
+ public String getRecipients() {
+ return recipients;
}
- public void setRecipients(NodeCond recipients) {
- xmlRecipients = recipients == null ? null : XMLSerializer.serialize(recipients);
+ public void setRecipients(String recipients) {
+ this.recipients = recipients;
}
public String getRecipientAttrName() {
Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/dao/AttributableDAO.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/dao/AttributableDAO.java?rev=1551172&r1=1551171&r2=1551172&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/dao/AttributableDAO.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/dao/AttributableDAO.java Mon Dec 16 11:04:52 2013
@@ -20,7 +20,6 @@ package org.apache.syncope.core.persiste
import java.util.List;
-import org.apache.syncope.common.services.InvalidSearchConditionException;
import org.apache.syncope.core.persistence.beans.AbstractAttrValue;
import org.apache.syncope.core.persistence.beans.AbstractAttributable;
import org.apache.syncope.core.persistence.beans.ExternalResource;
@@ -35,7 +34,7 @@ public interface AttributableDAO extends
AbstractAttrValue attrUniqueValue, AttributableUtil attrUtil);
<T extends AbstractAttributable> List<T> findByDerAttrValue(String schemaName, String value,
- AttributableUtil attrUtil) throws InvalidSearchConditionException;
+ AttributableUtil attrUtil);
<T extends AbstractAttributable> List<T> findByResource(ExternalResource resource, Class<T> reference);
}
Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/dao/AttributableSearchDAO.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/dao/AttributableSearchDAO.java?rev=1551172&r1=1551171&r2=1551172&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/dao/AttributableSearchDAO.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/dao/AttributableSearchDAO.java Mon Dec 16 11:04:52 2013
@@ -21,7 +21,7 @@ package org.apache.syncope.core.persiste
import java.util.List;
import java.util.Set;
-import org.apache.syncope.common.search.NodeCond;
+import org.apache.syncope.core.persistence.dao.search.SearchCond;
import org.apache.syncope.core.persistence.beans.AbstractAttributable;
import org.apache.syncope.core.util.AttributableUtil;
@@ -33,7 +33,7 @@ public interface AttributableSearchDAO e
* @param attrUtil AttributeUtil
* @return size of search result
*/
- int count(Set<Long> adminRoles, NodeCond searchCondition, AttributableUtil attrUtil);
+ int count(Set<Long> adminRoles, SearchCond searchCondition, AttributableUtil attrUtil);
/**
* @param adminRoles the set of admin roles owned by the caller
@@ -42,7 +42,7 @@ public interface AttributableSearchDAO e
* @param <T> user/role
* @return the list of users/roles matching the given search condition
*/
- <T extends AbstractAttributable> List<T> search(Set<Long> adminRoles, NodeCond searchCondition,
+ <T extends AbstractAttributable> List<T> search(Set<Long> adminRoles, SearchCond searchCondition,
AttributableUtil attrUtil);
/**
@@ -54,7 +54,7 @@ public interface AttributableSearchDAO e
* @param <T> user/role
* @return the list of users/roles matching the given search condition (in the given page)
*/
- <T extends AbstractAttributable> List<T> search(Set<Long> adminRoles, NodeCond searchCondition,
+ <T extends AbstractAttributable> List<T> search(Set<Long> adminRoles, SearchCond searchCondition,
int page, int itemsPerPage, AttributableUtil attrUtil);
/**
@@ -66,5 +66,5 @@ public interface AttributableSearchDAO e
* @param <T> user/role
* @return true if user/role matches searchCondition
*/
- <T extends AbstractAttributable> boolean matches(T subject, NodeCond searchCondition, AttributableUtil attrUtil);
+ <T extends AbstractAttributable> boolean matches(T subject, SearchCond searchCondition, AttributableUtil attrUtil);
}
Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/dao/RoleDAO.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/dao/RoleDAO.java?rev=1551172&r1=1551171&r2=1551172&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/dao/RoleDAO.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/dao/RoleDAO.java Mon Dec 16 11:04:52 2013
@@ -20,7 +20,6 @@ package org.apache.syncope.core.persiste
import java.util.List;
-import org.apache.syncope.common.services.InvalidSearchConditionException;
import org.apache.syncope.core.persistence.beans.Entitlement;
import org.apache.syncope.core.persistence.beans.ExternalResource;
import org.apache.syncope.core.persistence.beans.membership.Membership;
@@ -48,7 +47,7 @@ public interface RoleDAO extends Attribu
List<SyncopeRole> findDescendants(SyncopeRole role);
- List<SyncopeRole> findByDerAttrValue(String schemaName, String value) throws InvalidSearchConditionException;
+ List<SyncopeRole> findByDerAttrValue(String schemaName, String value);
List<SyncopeRole> findByAttrValue(String schemaName, RAttrValue attrValue);
Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/dao/UserDAO.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/dao/UserDAO.java?rev=1551172&r1=1551171&r2=1551172&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/dao/UserDAO.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/dao/UserDAO.java Mon Dec 16 11:04:52 2013
@@ -21,7 +21,6 @@ package org.apache.syncope.core.persiste
import java.util.List;
import java.util.Set;
-import org.apache.syncope.common.services.InvalidSearchConditionException;
import org.apache.syncope.core.persistence.beans.ExternalResource;
import org.apache.syncope.core.persistence.beans.user.SyncopeUser;
import org.apache.syncope.core.persistence.beans.user.UAttrValue;
@@ -35,7 +34,7 @@ public interface UserDAO extends Attribu
SyncopeUser findByWorkflowId(String workflowId);
- List<SyncopeUser> findByDerAttrValue(String schemaName, String value) throws InvalidSearchConditionException;
+ List<SyncopeUser> findByDerAttrValue(String schemaName, String value);
List<SyncopeUser> findByAttrValue(String schemaName, UAttrValue attrValue);
Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/dao/impl/AbstractAttributableDAOImpl.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/dao/impl/AbstractAttributableDAOImpl.java?rev=1551172&r1=1551171&r2=1551172&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/dao/impl/AbstractAttributableDAOImpl.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/dao/impl/AbstractAttributableDAOImpl.java Mon Dec 16 11:04:52 2013
@@ -32,7 +32,6 @@ import javax.persistence.TypedQuery;
import org.apache.commons.jexl2.parser.Parser;
import org.apache.commons.jexl2.parser.ParserConstants;
import org.apache.commons.jexl2.parser.Token;
-import org.apache.syncope.common.services.InvalidSearchConditionException;
import org.apache.syncope.core.persistence.beans.AbstractAttrValue;
import org.apache.syncope.core.persistence.beans.AbstractAttributable;
import org.apache.syncope.core.persistence.beans.AbstractDerSchema;
@@ -81,11 +80,9 @@ public abstract class AbstractAttributab
* @param value derived attribute value
* @param attrUtil USER / ROLE
* @return where clauses to use to build the query
- * @throws InvalidSearchConditionException in case of errors retrieving identifiers
+ * @throws IllegalArgumentException in case of errors retrieving identifiers
*/
- private Set<String> getWhereClause(final String expression, final String value, final AttributableUtil attrUtil)
- throws InvalidSearchConditionException {
-
+ private Set<String> getWhereClause(final String expression, final String value, final AttributableUtil attrUtil) {
final Parser parser = new Parser(new StringReader(expression));
// Schema names
@@ -132,7 +129,7 @@ public abstract class AbstractAttributab
if (attrValues.size() != identifiers.size()) {
LOG.error("Ambiguous jexl expression resolution.");
- throw new InvalidSearchConditionException("literals and values have different size");
+ throw new IllegalArgumentException("literals and values have different size");
}
// clauses to be used with INTERSECTed queries
@@ -152,7 +149,7 @@ public abstract class AbstractAttributab
AbstractNormalSchema schema = schemaDAO.find(identifiers.get(i), attrUtil.schemaClass());
if (schema == null) {
LOG.error("Invalid schema name '{}'", identifiers.get(i));
- throw new InvalidSearchConditionException("Invalid schema name " + identifiers.get(i));
+ throw new IllegalArgumentException("Invalid schema name " + identifiers.get(i));
}
// clear builder
@@ -277,13 +274,10 @@ public abstract class AbstractAttributab
* @param value derived attribute value
* @param attrUtil AttributableUtil
* @return list of users / roles
- * @throws InvalidSearchConditionException in case of errors retrieving schema names used to buid the derived schema
- * expression.
*/
@Override
public <T extends AbstractAttributable> List<T> findByDerAttrValue(final String schemaName, final String value,
- final AttributableUtil attrUtil)
- throws InvalidSearchConditionException {
+ final AttributableUtil attrUtil) {
AbstractDerSchema schema = derSchemaDAO.find(schemaName, attrUtil.derSchemaClass());
if (schema == null) {
Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/dao/impl/AttributableSearchDAOImpl.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/dao/impl/AttributableSearchDAOImpl.java?rev=1551172&r1=1551171&r2=1551172&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/dao/impl/AttributableSearchDAOImpl.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/dao/impl/AttributableSearchDAOImpl.java Mon Dec 16 11:04:52 2013
@@ -31,12 +31,12 @@ import javax.persistence.TemporalType;
import javax.validation.ValidationException;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
-import org.apache.syncope.common.search.AttributableCond;
-import org.apache.syncope.common.search.AttributeCond;
-import org.apache.syncope.common.search.EntitlementCond;
-import org.apache.syncope.common.search.MembershipCond;
-import org.apache.syncope.common.search.NodeCond;
-import org.apache.syncope.common.search.ResourceCond;
+import org.apache.syncope.core.persistence.dao.search.AttributableCond;
+import org.apache.syncope.core.persistence.dao.search.AttributeCond;
+import org.apache.syncope.core.persistence.dao.search.EntitlementCond;
+import org.apache.syncope.core.persistence.dao.search.MembershipCond;
+import org.apache.syncope.core.persistence.dao.search.SearchCond;
+import org.apache.syncope.core.persistence.dao.search.ResourceCond;
import org.apache.syncope.common.types.AttributableType;
import org.apache.syncope.common.types.AttributeSchemaType;
import org.apache.syncope.core.persistence.beans.AbstractAttrValue;
@@ -55,7 +55,7 @@ import org.springframework.util.Reflecti
@Repository
public class AttributableSearchDAOImpl extends AbstractDAOImpl implements AttributableSearchDAO {
- static final private String EMPTY_ATTR_QUERY = "SELECT subject_id FROM user_search_attr WHERE 1=2";
+ private static final String EMPTY_ATTR_QUERY = "SELECT subject_id FROM user_search_attr WHERE 1=2";
@Autowired
private UserDAO userDAO;
@@ -100,7 +100,7 @@ public class AttributableSearchDAOImpl e
}
@Override
- public int count(final Set<Long> adminRoles, final NodeCond searchCondition, final AttributableUtil attrUtil) {
+ public int count(final Set<Long> adminRoles, final SearchCond searchCondition, final AttributableUtil attrUtil) {
List<Object> parameters = Collections.synchronizedList(new ArrayList<Object>());
// 1. get the query string from the search condition
@@ -127,14 +127,14 @@ public class AttributableSearchDAOImpl e
}
@Override
- public <T extends AbstractAttributable> List<T> search(final Set<Long> adminRoles, final NodeCond searchCondition,
+ public <T extends AbstractAttributable> List<T> search(final Set<Long> adminRoles, final SearchCond searchCondition,
final AttributableUtil attrUtil) {
return search(adminRoles, searchCondition, -1, -1, attrUtil);
}
@Override
- public <T extends AbstractAttributable> List<T> search(final Set<Long> adminRoles, final NodeCond searchCondition,
+ public <T extends AbstractAttributable> List<T> search(final Set<Long> adminRoles, final SearchCond searchCondition,
final int page, final int itemsPerPage, final AttributableUtil attrUtil) {
List<T> result = Collections.<T>emptyList();
@@ -157,7 +157,7 @@ public class AttributableSearchDAOImpl e
}
@Override
- public <T extends AbstractAttributable> boolean matches(final T user, final NodeCond searchCondition,
+ public <T extends AbstractAttributable> boolean matches(final T user, final SearchCond searchCondition,
final AttributableUtil attrUtil) {
List<Object> parameters = Collections.synchronizedList(new ArrayList<Object>());
@@ -212,7 +212,7 @@ public class AttributableSearchDAOImpl e
}
@SuppressWarnings("unchecked")
- private <T extends AbstractAttributable> List<T> doSearch(final Set<Long> adminRoles, final NodeCond nodeCond,
+ private <T extends AbstractAttributable> List<T> doSearch(final Set<Long> adminRoles, final SearchCond nodeCond,
final int page, final int itemsPerPage, final AttributableUtil attrUtil) {
List<Object> parameters = Collections.synchronizedList(new ArrayList<Object>());
@@ -281,7 +281,7 @@ public class AttributableSearchDAOImpl e
return result;
}
- private StringBuilder getQuery(final NodeCond nodeCond, final List<Object> parameters,
+ private StringBuilder getQuery(final SearchCond nodeCond, final List<Object> parameters,
final AttributableUtil attrUtil) {
StringBuilder query = new StringBuilder();
@@ -291,32 +291,32 @@ public class AttributableSearchDAOImpl e
case LEAF:
case NOT_LEAF:
if (nodeCond.getMembershipCond() != null && AttributableType.USER == attrUtil.getType()) {
- query.append(getQuery(nodeCond.getMembershipCond(), nodeCond.getType() == NodeCond.Type.NOT_LEAF,
+ query.append(getQuery(nodeCond.getMembershipCond(), nodeCond.getType() == SearchCond.Type.NOT_LEAF,
parameters, attrUtil));
}
if (nodeCond.getResourceCond() != null) {
- query.append(getQuery(nodeCond.getResourceCond(), nodeCond.getType() == NodeCond.Type.NOT_LEAF,
- parameters, attrUtil));
+ query.append(getQuery(nodeCond.getResourceCond(),
+ nodeCond.getType() == SearchCond.Type.NOT_LEAF, parameters, attrUtil));
}
if (nodeCond.getEntitlementCond() != null) {
- query.append(getQuery(nodeCond.getEntitlementCond(), nodeCond.getType() == NodeCond.Type.NOT_LEAF,
- parameters));
+ query.append(getQuery(nodeCond.getEntitlementCond(),
+ nodeCond.getType() == SearchCond.Type.NOT_LEAF, parameters));
}
if (nodeCond.getAttributeCond() != null) {
- query.append(getQuery(nodeCond.getAttributeCond(), nodeCond.getType() == NodeCond.Type.NOT_LEAF,
- parameters, attrUtil));
+ query.append(getQuery(nodeCond.getAttributeCond(),
+ nodeCond.getType() == SearchCond.Type.NOT_LEAF, parameters, attrUtil));
}
if (nodeCond.getAttributableCond() != null) {
- query.append(getQuery(nodeCond.getAttributableCond(), nodeCond.getType() == NodeCond.Type.NOT_LEAF,
- parameters, attrUtil));
+ query.append(getQuery(nodeCond.getAttributableCond(),
+ nodeCond.getType() == SearchCond.Type.NOT_LEAF, parameters, attrUtil));
}
break;
case AND:
query.append(getQuery(nodeCond.getLeftNodeCond(), parameters, attrUtil)).
append(" AND subject_id IN ( ").
- append(getQuery(nodeCond.getRightNodeCond(), parameters, attrUtil).
- append(")"));
+ append(getQuery(nodeCond.getRightNodeCond(), parameters, attrUtil)).
+ append(")");
break;
case OR:
@@ -344,15 +344,9 @@ public class AttributableSearchDAOImpl e
}
query.append("SELECT DISTINCT subject_id ").append("FROM ").
- append(attrUtil.searchView()).append("_membership WHERE ");
-
- if (cond.getRoleId() != null) {
- query.append("role_id=?").append(setParameter(parameters, cond.getRoleId()));
- } else if (cond.getRoleName() != null) {
- query.append("role_name=?").append(setParameter(parameters, cond.getRoleName()));
- }
-
- query.append(')');
+ append(attrUtil.searchView()).append("_membership WHERE ").
+ append("role_id=?").append(setParameter(parameters, cond.getRoleId())).
+ append(')');
return query.toString();
}
Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/dao/impl/RoleDAOImpl.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/dao/impl/RoleDAOImpl.java?rev=1551172&r1=1551171&r2=1551172&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/dao/impl/RoleDAOImpl.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/dao/impl/RoleDAOImpl.java Mon Dec 16 11:04:52 2013
@@ -25,7 +25,6 @@ import javax.persistence.NoResultExcepti
import javax.persistence.Query;
import javax.persistence.TypedQuery;
-import org.apache.syncope.common.services.InvalidSearchConditionException;
import org.apache.syncope.common.types.AttributableType;
import org.apache.syncope.core.persistence.beans.AbstractAttr;
import org.apache.syncope.core.persistence.beans.AbstractAttrTemplate;
@@ -267,9 +266,7 @@ public class RoleDAOImpl extends Abstrac
}
@Override
- public List<SyncopeRole> findByDerAttrValue(final String schemaName, final String value)
- throws InvalidSearchConditionException {
-
+ public List<SyncopeRole> findByDerAttrValue(final String schemaName, final String value) {
return findByDerAttrValue(schemaName, value, AttributableUtil.getInstance(AttributableType.ROLE));
}
@@ -331,7 +328,7 @@ public class RoleDAOImpl extends Abstrac
@Override
public final int count() {
Query countQuery = entityManager.createNativeQuery(
- "SELECT COUNT(e) FROM " + SyncopeRole.class.getSimpleName() + " e");
+ "SELECT COUNT(e.id) FROM " + SyncopeRole.class.getSimpleName() + " e");
return ((Number) countQuery.getSingleResult()).intValue();
}
Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/dao/impl/UserDAOImpl.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/dao/impl/UserDAOImpl.java?rev=1551172&r1=1551171&r2=1551172&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/dao/impl/UserDAOImpl.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/dao/impl/UserDAOImpl.java Mon Dec 16 11:04:52 2013
@@ -25,7 +25,6 @@ import javax.persistence.NoResultExcepti
import javax.persistence.Query;
import javax.persistence.TypedQuery;
-import org.apache.syncope.common.services.InvalidSearchConditionException;
import org.apache.syncope.common.types.AttributableType;
import org.apache.syncope.core.persistence.beans.AbstractAttrValue;
import org.apache.syncope.core.persistence.beans.AbstractAttributable;
@@ -124,9 +123,7 @@ public class UserDAOImpl extends Abstrac
}
@Override
- public List<SyncopeUser> findByDerAttrValue(final String schemaName, final String value)
- throws InvalidSearchConditionException {
-
+ public List<SyncopeUser> findByDerAttrValue(final String schemaName, final String value) {
return findByDerAttrValue(schemaName, value, AttributableUtil.getInstance(AttributableType.USER));
}
Copied: syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/dao/search/AbstractSearchCond.java (from r1548091, syncope/trunk/common/src/main/java/org/apache/syncope/common/search/SearchCond.java)
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/dao/search/AbstractSearchCond.java?p2=syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/dao/search/AbstractSearchCond.java&p1=syncope/trunk/common/src/main/java/org/apache/syncope/common/search/SearchCond.java&r1=1548091&r2=1551172&rev=1551172&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/search/SearchCond.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/dao/search/AbstractSearchCond.java Mon Dec 16 11:04:52 2013
@@ -16,12 +16,33 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.syncope.common.search;
+package org.apache.syncope.core.persistence.dao.search;
-import com.fasterxml.jackson.annotation.JsonIgnore;
+import java.io.Serializable;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
-public interface SearchCond {
+public abstract class AbstractSearchCond implements Serializable {
+
+ private static final long serialVersionUID = 5376869884544910804L;
+
+ @Override
+ public boolean equals(final Object obj) {
+ return EqualsBuilder.reflectionEquals(this, obj);
+ }
+
+ @Override
+ public int hashCode() {
+ return HashCodeBuilder.reflectionHashCode(this);
+ }
+
+ @Override
+ public String toString() {
+ return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE);
+ }
+
+ public abstract boolean isValid();
- @JsonIgnore
- boolean isValid();
}