You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by jb...@apache.org on 2013/01/21 10:09:04 UTC
svn commit: r1436230 [6/14] - in /syncope/trunk: ./ client/
client/src/main/java/org/apache/syncope/annotation/
client/src/main/java/org/apache/syncope/client/
client/src/main/java/org/apache/syncope/client/mod/
client/src/main/java/org/apache/syncope/...
Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/types/ResourceOperation.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/types/ResourceOperation.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/types/ResourceOperation.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/types/ResourceOperation.java Mon Jan 21 09:08:54 2013
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.common.types;
+
+public enum ResourceOperation {
+
+ CREATE,
+ UPDATE,
+ DELETE
+}
Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/types/SchemaType.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/types/SchemaType.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/types/SchemaType.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/types/SchemaType.java Mon Jan 21 09:08:54 2013
@@ -0,0 +1,43 @@
+/*
+ * 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.common.types;
+
+public enum SchemaType {
+
+ String("java.lang.String"),
+ Long("java.lang.Long"),
+ Double("java.lang.Double"),
+ Boolean("java.lang.Boolean"),
+ Date("java.util.Date"),
+ Enum("java.lang.Enum");
+
+ final private String className;
+
+ SchemaType(String className) {
+ this.className = className;
+ }
+
+ public String getClassName() {
+ return className;
+ }
+
+ public boolean isConversionPatternNeeded() {
+ return this == SchemaType.Date || this == SchemaType.Double || this == SchemaType.Long;
+ }
+}
Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/types/SyncPolicySpec.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/types/SyncPolicySpec.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/types/SyncPolicySpec.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/types/SyncPolicySpec.java Mon Jan 21 09:08:54 2013
@@ -0,0 +1,79 @@
+/*
+ * 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.common.types;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.syncope.common.annotation.SchemaList;
+
+public class SyncPolicySpec extends AbstractPolicySpec {
+
+ private static final long serialVersionUID = -3144027171719498127L;
+
+ /**
+ * SyncopeUser attributes and fields for matching during synchronization.
+ */
+ @SchemaList(extended = true)
+ private List<String> uAltSearchSchemas;
+
+ /**
+ * SyncopeRole attributes and fields for matching during synchronization.
+ */
+ @SchemaList(extended = true)
+ private List<String> rAltSearchSchemas;
+
+ /**
+ * Conflict resolution action.
+ */
+ private ConflictResolutionAction conflictResolutionAction;
+
+ public SyncPolicySpec() {
+ super();
+
+ uAltSearchSchemas = new ArrayList<String>();
+ rAltSearchSchemas = new ArrayList<String>();
+ }
+
+ public ConflictResolutionAction getConflictResolutionAction() {
+ return conflictResolutionAction == null
+ ? ConflictResolutionAction.IGNORE
+ : conflictResolutionAction;
+ }
+
+ public void setConflictResolutionAction(final ConflictResolutionAction conflictResolutionAction) {
+ this.conflictResolutionAction = conflictResolutionAction;
+ }
+
+ public List<String> getuAltSearchSchemas() {
+ return uAltSearchSchemas;
+ }
+
+ public void setuAltSearchSchemas(List<String> uAltSearchSchemas) {
+ this.uAltSearchSchemas = uAltSearchSchemas;
+ }
+
+ public List<String> getrAltSearchSchemas() {
+ return rAltSearchSchemas;
+ }
+
+ public void setrAltSearchSchemas(List<String> rAltSearchSchemas) {
+ this.rAltSearchSchemas = rAltSearchSchemas;
+ }
+}
Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/types/SyncopeClientExceptionType.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/types/SyncopeClientExceptionType.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/types/SyncopeClientExceptionType.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/types/SyncopeClientExceptionType.java Mon Jan 21 09:08:54 2013
@@ -0,0 +1,99 @@
+/*
+ * 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.common.types;
+
+public enum SyncopeClientExceptionType {
+
+ Deadlock("Syncope.Deadlock", ""),
+ DataIntegrityViolation("Syncope.DataIntegrityViolation", "Syncope.DataIntegrityViolation.name"),
+ ExistingResource("Syncope.ExistingResource", "Syncope.ExistingResource.name"),
+ GenericPersistence("Syncope.GenericPersistence", "Syncope.GenericPersistence.cause"),
+ InvalidLogger("Syncope.InvalidLogger", "Syncope.InvalidLogger.message"),
+ InvalidConnInstance("Syncope.InvalidConnInstance", "Syncope.InvalidConnInstance.message"),
+ InvalidPasswordPolicy("Syncope.InvalidPasswordPolicy", "Syncope.InvalidPasswordPolicy.reason"),
+ InvalidAccountPolicy("Syncope.InvalidAccountPolicy", "Syncope.InvalidAccountPolicy.reason"),
+ InvalidSyncPolicy("Syncope.InvalidSyncPolicy", "Syncope.InvalidSyncPolicy.reason"),
+ InvalidSyncopeRole("Syncope.InvalidSyncopeRole", "Syncope.InvalidSyncopeRole.reason"),
+ InvalidReportExec("Syncope.InvalidReportExec", "Syncope.InvalidReportExec.reason"),
+ InvalidRoles("Syncope.InvalidRoles", "Syncope.InvalidRoles.name"),
+ InvalidSchemaDefinition("Syncope.InvalidSchemaDefinition", ""),
+ InvalidSearchCondition("Syncope.InvalidSearchCondition", ""),
+ InvalidPropagationTaskExecReport(
+ "Syncope.InvalidPropagationTaskExecReport",
+ "Syncope.InvalidPropagationTaskExecReport.element"),
+ InvalidUSchema("Syncope.InvalidUSchemaUpdate", "Syncope.InvalidUSchemaUpdate.name"),
+ InvalidUDerSchema("Syncope.InvalidUDerSchemaUpdate", "Syncope.InvalidUDerSchemaUpdate.name"),
+ InvalidUVirSchema("Syncope.InvalidUVirSchemaUpdate", "Syncope.InvalidUVirSchemaUpdate.name"),
+ InvalidRSchema("Syncope.InvalidRSchemaUpdate", "Syncope.InvalidRSchemaUpdate.name"),
+ InvalidRDerSchema("Syncope.InvalidRDerSchemaUpdate", "Syncope.InvalidRDerSchemaUpdate.name"),
+ InvalidRVirSchema("Syncope.InvalidRVirSchemaUpdate", "Syncope.InvalidRVirSchemaUpdate.name"),
+ InvalidMSchema("Syncope.InvalidMSchemaUpdate", "Syncope.InvalidMSchemaUpdate.name"),
+ InvalidMDerSchema("Syncope.InvalidMDerSchemaUpdate", "Syncope.InvalidMDerSchemaUpdate.name"),
+ InvalidMVirSchema("Syncope.InvalidMVirSchemaUpdate", "Syncope.InvalidMVirSchemaUpdate.name"),
+ InvalidSchemaMapping("Syncope.InvalidSchemaMapping", ""),
+ InvalidSyncopeUser("Syncope.InvalidSyncopeUser", "Syncope.InvalidSyncopeUser.element"),
+ InvalidExternalResource("Syncope.InvalidExternalResource", "Syncope.InvalidExternalResource.element"),
+ InvalidNotification("Syncope.InvalidNotification", "Syncope.InvalidNotification.element"),
+ InvalidPropagationTask("Syncope.InvalidPropagationTask", "Syncope.InvalidPropagationTask.element"),
+ InvalidSchedTask("Syncope.InvalidSchedTask", "Syncope.InvalidSchedTask.element"),
+ InvalidSyncTask("Syncope.InvalidSyncTask", "Syncope.InvalidSyncTask.element"),
+ InvalidValues("Syncope.InvalidValues", "Syncope.InvalidValues.attributeName"),
+ NotFound("Syncope.NotFound", "Syncope.NotFound.entity"),
+ Propagation("Syncope.Propagation", "Syncope.Propagation.resourceName"),
+ RejectedUserCreate("Syncope.RejectUserCreate", "Syncope.RejectUserCreate.userId"),
+ RequiredValuesMissing("Syncope.RequiredValuesMissing", "Syncope.RequiredValuesMissing.attributeName"),
+ Scheduling("Syncope.Scheduling", "Syncope.Scheduling.message"),
+ UnauthorizedRole("Syncope.UnauthorizedRole", "Syncope.UnauthorizedRole.id"),
+ Unknown("Syncope.Unknown", ""),
+ Workflow("Syncope.Workflow", "Syncope.Workflow.message");
+
+ private String headerValue;
+
+ private String elementHeaderName;
+
+ private SyncopeClientExceptionType(String headerValue, String elementHeaderName) {
+
+ this.headerValue = headerValue;
+ this.elementHeaderName = elementHeaderName;
+ }
+
+ public static SyncopeClientExceptionType getFromHeaderValue(String exceptionTypeHeaderValue) {
+
+ SyncopeClientExceptionType result = null;
+ for (SyncopeClientExceptionType syncopeClientExceptionType : values()) {
+ if (exceptionTypeHeaderValue.equals(syncopeClientExceptionType.getHeaderValue())) {
+ result = syncopeClientExceptionType;
+ }
+ }
+
+ if (result == null) {
+ throw new IllegalArgumentException("Unexpected header value: " + exceptionTypeHeaderValue);
+ }
+
+ return result;
+ }
+
+ public String getElementHeaderName() {
+ return elementHeaderName;
+ }
+
+ public String getHeaderValue() {
+ return headerValue;
+ }
+}
Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/types/SyncopeLoggerLevel.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/types/SyncopeLoggerLevel.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/types/SyncopeLoggerLevel.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/types/SyncopeLoggerLevel.java Mon Jan 21 09:08:54 2013
@@ -0,0 +1,65 @@
+/*
+ * 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.common.types;
+
+import ch.qos.logback.classic.Level;
+
+public enum SyncopeLoggerLevel {
+
+ OFF(Level.OFF),
+ ERROR(Level.ERROR),
+ WARN(Level.WARN),
+ INFO(Level.INFO),
+ DEBUG(Level.DEBUG),
+ TRACE(Level.TRACE),
+ ALL(Level.ALL);
+
+ private Level level;
+
+ SyncopeLoggerLevel(final Level level) {
+ this.level = level;
+ }
+
+ public Level getLevel() {
+ return level;
+ }
+
+ public static SyncopeLoggerLevel fromLevel(final Level level) {
+ SyncopeLoggerLevel result;
+ if (level.equals(Level.OFF)) {
+ result = OFF;
+ } else if (level.equals(Level.ERROR)) {
+ result = ERROR;
+ } else if (level.equals(Level.WARN)) {
+ result = WARN;
+ } else if (level.equals(Level.INFO)) {
+ result = INFO;
+ } else if (level.equals(Level.DEBUG)) {
+ result = DEBUG;
+ } else if (level.equals(Level.TRACE)) {
+ result = TRACE;
+ } else if (level.equals(Level.ALL)) {
+ result = ALL;
+ } else {
+ throw new IllegalArgumentException("Undefined Level " + level);
+ }
+
+ return result;
+ }
+}
Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/types/SyncopeLoggerType.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/types/SyncopeLoggerType.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/types/SyncopeLoggerType.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/types/SyncopeLoggerType.java Mon Jan 21 09:08:54 2013
@@ -0,0 +1,35 @@
+/*
+ * 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.common.types;
+
+public enum SyncopeLoggerType {
+
+ LOG(""),
+ AUDIT("syncope.audit");
+
+ private String prefix;
+
+ SyncopeLoggerType(final String prefix) {
+ this.prefix = prefix;
+ }
+
+ public String getPrefix() {
+ return prefix;
+ }
+}
Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/types/TaskType.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/types/TaskType.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/types/TaskType.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/types/TaskType.java Mon Jan 21 09:08:54 2013
@@ -0,0 +1,49 @@
+/*
+ * 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.common.types;
+
+public enum TaskType {
+
+ PROPAGATION("propagation"),
+ NOTIFICATION("notification"),
+ SCHEDULED("sched"),
+ SYNCHRONIZATION("sync");
+
+ private String name;
+
+ private TaskType(String name) {
+ this.name = name;
+ }
+
+ @Override
+ public String toString() {
+ return name;
+ }
+
+ public static TaskType fromString(String name) {
+ if (name != null) {
+ for (TaskType t : TaskType.values()) {
+ if (t.name.equalsIgnoreCase(name)) {
+ return t;
+ }
+ }
+ }
+ return null;
+ }
+}
Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/types/TraceLevel.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/types/TraceLevel.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/types/TraceLevel.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/types/TraceLevel.java Mon Jan 21 09:08:54 2013
@@ -0,0 +1,40 @@
+/*
+ * 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.common.types;
+
+public enum TraceLevel {
+
+ /**
+ * No details at all.
+ */
+ NONE,
+ /**
+ * Only failed entries.
+ */
+ FAILURES,
+ /**
+ * Only an overall summary.
+ */
+ SUMMARY,
+ /**
+ * All available information, including per-entry information.
+ */
+ ALL
+
+}
Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/types/UserRequestType.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/types/UserRequestType.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/types/UserRequestType.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/types/UserRequestType.java Mon Jan 21 09:08:54 2013
@@ -0,0 +1,27 @@
+/*
+ * 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.common.types;
+
+public enum UserRequestType {
+
+ CREATE,
+ UPDATE,
+ DELETE
+
+}
Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/types/WorkflowFormPropertyType.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/types/WorkflowFormPropertyType.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/types/WorkflowFormPropertyType.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/types/WorkflowFormPropertyType.java Mon Jan 21 09:08:54 2013
@@ -0,0 +1,29 @@
+/*
+ * 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.common.types;
+
+public enum WorkflowFormPropertyType {
+
+ String,
+ Long,
+ Enum,
+ Date,
+ Boolean
+
+}
Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/types/package-info.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/types/package-info.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/types/package-info.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/types/package-info.java Mon Jan 21 09:08:54 2013
@@ -0,0 +1,19 @@
+/*
+ * 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.common.types;
Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/util/AttributableOperations.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/util/AttributableOperations.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/util/AttributableOperations.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/util/AttributableOperations.java Mon Jan 21 09:08:54 2013
@@ -0,0 +1,411 @@
+/*
+ * 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.common.util;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import org.apache.commons.lang.SerializationUtils;
+import org.apache.syncope.common.mod.AbstractAttributableMod;
+import org.apache.syncope.common.mod.AttributeMod;
+import org.apache.syncope.common.mod.MembershipMod;
+import org.apache.syncope.common.mod.ReferenceMod;
+import org.apache.syncope.common.mod.RoleMod;
+import org.apache.syncope.common.mod.UserMod;
+import org.apache.syncope.common.to.AbstractAttributableTO;
+import org.apache.syncope.common.to.AttributeTO;
+import org.apache.syncope.common.to.MembershipTO;
+import org.apache.syncope.common.to.RoleTO;
+import org.apache.syncope.common.to.UserTO;
+
+/**
+ * Utility class for manipulating classes extending AbstractAttributableTO and AbstractAttributableMod.
+ *
+ * @see AbstractAttributableTO
+ * @see AbstractAttributableMod
+ */
+public final class AttributableOperations {
+
+ private AttributableOperations() {
+ }
+
+ public static <T extends AbstractAttributableTO> T clone(final T original) {
+ return (T) SerializationUtils.clone(original);
+ }
+
+ private static void populate(final Map<String, AttributeTO> updatedAttrs,
+ final Map<String, AttributeTO> originalAttrs, final AbstractAttributableMod result) {
+ populate(updatedAttrs, originalAttrs, result, false);
+ }
+
+ private static void populate(final Map<String, AttributeTO> updatedAttrs,
+ final Map<String, AttributeTO> originalAttrs, final AbstractAttributableMod result, final boolean virtuals) {
+
+ for (Map.Entry<String, AttributeTO> entry : updatedAttrs.entrySet()) {
+ AttributeMod mod = new AttributeMod();
+ mod.setSchema(entry.getKey());
+
+ Set<String> updatedValues = new HashSet<String>(entry.getValue().getValues());
+
+ Set<String> originalValues = originalAttrs.containsKey(entry.getKey())
+ ? new HashSet<String>(originalAttrs.get(entry.getKey()).getValues())
+ : Collections.EMPTY_SET;
+
+ if (!updatedValues.equals(originalValues)) {
+ // avoid unwanted inputs
+ updatedValues.remove("");
+ if (!entry.getValue().isReadonly()) {
+ mod.setValuesToBeAdded(new ArrayList<String>(updatedValues));
+
+ if (!mod.isEmpty()) {
+ if (virtuals) {
+ result.addVirtualAttributeToBeRemoved(mod.getSchema());
+ } else {
+ result.addAttributeToBeRemoved(mod.getSchema());
+ }
+ }
+ }
+
+ mod.setValuesToBeRemoved(new ArrayList<String>(originalValues));
+
+ if (!mod.isEmpty()) {
+ if (virtuals) {
+ result.addVirtualAttributeToBeUpdated(mod);
+ } else {
+ result.addAttributeToBeUpdated(mod);
+ }
+ }
+ }
+ }
+ }
+
+ private static void diff(
+ final AbstractAttributableTO updated,
+ final AbstractAttributableTO original,
+ final AbstractAttributableMod result,
+ final boolean incremental) {
+
+ // 1. check same id
+ if (updated.getId() != original.getId()) {
+ throw new IllegalArgumentException("AttributableTO's id must be the same");
+ }
+ result.setId(updated.getId());
+
+ // 2. attributes
+ Map<String, AttributeTO> updatedAttrs = new HashMap<String, AttributeTO>(updated.getAttributeMap());
+ Map<String, AttributeTO> originalAttrs = new HashMap<String, AttributeTO>(original.getAttributeMap());
+
+ Set<String> originalAttrNames = new HashSet<String>(originalAttrs.keySet());
+ originalAttrNames.removeAll(updatedAttrs.keySet());
+
+ if (!incremental) {
+ result.setAttributesToBeRemoved(originalAttrNames);
+ }
+
+ Set<String> emptyUpdatedAttrs = new HashSet<String>();
+ for (Map.Entry<String, AttributeTO> entry : updatedAttrs.entrySet()) {
+ if (entry.getValue().getValues() == null || entry.getValue().getValues().isEmpty()) {
+
+ emptyUpdatedAttrs.add(entry.getKey());
+ }
+ }
+ for (String emptyUpdatedAttr : emptyUpdatedAttrs) {
+ updatedAttrs.remove(emptyUpdatedAttr);
+ result.addAttributeToBeRemoved(emptyUpdatedAttr);
+ }
+
+ populate(updatedAttrs, originalAttrs, result);
+
+ // 3. derived attributes
+ updatedAttrs = updated.getDerivedAttributeMap();
+ originalAttrs = original.getDerivedAttributeMap();
+
+ originalAttrNames = new HashSet<String>(originalAttrs.keySet());
+ originalAttrNames.removeAll(updatedAttrs.keySet());
+
+ if (!incremental) {
+ result.setDerivedAttributesToBeRemoved(originalAttrNames);
+ }
+
+ Set<String> updatedAttrNames = new HashSet<String>(updatedAttrs.keySet());
+ updatedAttrNames.removeAll(originalAttrs.keySet());
+ result.setDerivedAttributesToBeAdded(updatedAttrNames);
+
+ // 4. virtual attributes
+ updatedAttrs = updated.getVirtualAttributeMap();
+ originalAttrs = original.getVirtualAttributeMap();
+
+ originalAttrNames = new HashSet<String>(originalAttrs.keySet());
+ originalAttrNames.removeAll(updatedAttrs.keySet());
+
+ if (!incremental) {
+ result.setVirtualAttributesToBeRemoved(originalAttrNames);
+ }
+
+ populate(updatedAttrs, originalAttrs, result, true);
+
+ // 5. resources
+ Set<String> updatedRes = new HashSet<String>(updated.getResources());
+ Set<String> originalRes = new HashSet<String>(original.getResources());
+
+ updatedRes.removeAll(originalRes);
+ result.setResourcesToBeAdded(updatedRes);
+
+ originalRes.removeAll(updated.getResources());
+
+ if (!incremental) {
+ result.setResourcesToBeRemoved(originalRes);
+ }
+ }
+
+ /**
+ * Calculate modifications needed by first in order to be equal to second.
+ *
+ * @param updated updated UserTO
+ * @param original original UserTO
+ * @return UserMod containing differences
+ */
+ public static UserMod diff(final UserTO updated, final UserTO original) {
+ return diff(updated, original, false);
+ }
+
+ /**
+ * Calculate modifications needed by first in order to be equal to second.
+ *
+ * @param updated updated UserTO
+ * @param original original UserTO
+ * @param incremental perform incremental diff (without removing existing info)
+ * @return UserMod containing differences
+ */
+ public static UserMod diff(final UserTO updated, final UserTO original, final boolean incremental) {
+ UserMod result = new UserMod();
+
+ diff(updated, original, result, incremental);
+
+ // 1. password
+ if (original.getPassword() != null && !original.getPassword().equals(updated.getPassword())) {
+ result.setPassword(updated.getPassword());
+ }
+
+ // 2. username
+ if (original.getUsername() != null && !original.getUsername().equals(updated.getUsername())) {
+ result.setUsername(updated.getUsername());
+ }
+
+ // 3. memberships
+ Map<Long, MembershipTO> updatedMembs = updated.getMembershipMap();
+ Map<Long, MembershipTO> originalMembs = original.getMembershipMap();
+
+ for (Map.Entry<Long, MembershipTO> entry : updatedMembs.entrySet()) {
+ MembershipMod membMod = new MembershipMod();
+ membMod.setRole(entry.getValue().getRoleId());
+
+ if (originalMembs.containsKey(entry.getKey())) {
+ diff(entry.getValue(), originalMembs.get(entry.getKey()), membMod, false);
+ } else {
+ for (AttributeTO attr : entry.getValue().getAttributes()) {
+
+ AttributeMod attrMod = new AttributeMod();
+ attrMod.setSchema(attr.getSchema());
+ attrMod.setValuesToBeAdded(attr.getValues());
+
+ if (!attrMod.isEmpty()) {
+ membMod.addAttributeToBeUpdated(attrMod);
+ membMod.addAttributeToBeRemoved(attrMod.getSchema());
+ }
+ }
+ for (AttributeTO attr : entry.getValue().getDerivedAttributes()) {
+
+ membMod.addDerivedAttributeToBeAdded(attr.getSchema());
+ }
+ for (AttributeTO attr : entry.getValue().getVirtualAttributes()) {
+
+ AttributeMod attrMod = new AttributeMod();
+ attrMod.setSchema(attr.getSchema());
+ attrMod.setValuesToBeAdded(attr.getValues());
+
+ if (!attrMod.isEmpty()) {
+ membMod.addVirtualAttributeToBeUpdated(attrMod);
+ membMod.addAttributeToBeRemoved(attrMod.getSchema());
+ }
+ }
+ membMod.setResourcesToBeAdded(entry.getValue().getResources());
+ }
+
+ if (!membMod.isEmpty()) {
+ result.addMembershipToBeAdded(membMod);
+ }
+ }
+
+ if (!incremental) {
+ Set<Long> originalRoles = new HashSet<Long>(originalMembs.keySet());
+ originalRoles.removeAll(updatedMembs.keySet());
+ for (Long roleId : originalRoles) {
+ result.addMembershipToBeRemoved(originalMembs.get(roleId).getId());
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * Calculate modifications needed by first in order to be equal to second.
+ *
+ * @param updated updated RoleTO
+ * @param original original RoleTO
+ * @return RoleMod containing differences
+ */
+ public static RoleMod diff(final RoleTO updated, final RoleTO original) {
+ return diff(updated, original, false);
+ }
+
+ /**
+ * Calculate modifications needed by first in order to be equal to second.
+ *
+ * @param updated updated RoleTO
+ * @param original original RoleTO
+ * @param incremental perform incremental diff (without removing existing info)
+ * @return RoleMod containing differences
+ */
+ public static RoleMod diff(final RoleTO updated, final RoleTO original, final boolean incremental) {
+ RoleMod result = new RoleMod();
+
+ diff(updated, original, result, incremental);
+
+ // 1. inheritance
+ result.setInheritOwner(updated.isInheritOwner());
+ result.setInheritAccountPolicy(updated.isInheritAccountPolicy());
+ result.setInheritPasswordPolicy(updated.isInheritPasswordPolicy());
+ result.setInheritAttributes(updated.isInheritAttributes());
+ result.setInheritDerivedAttributes(updated.isInheritDerivedAttributes());
+ result.setInheritVirtualAttributes(updated.isInheritVirtualAttributes());
+
+ // 2. policies
+ result.setAccountPolicy(new ReferenceMod(updated.getAccountPolicy()));
+ result.setPasswordPolicy(new ReferenceMod(updated.getPasswordPolicy()));
+
+ // 3. name
+ if (!original.getName().equals(updated.getName())) {
+ result.setName(updated.getName());
+ }
+
+ // 4. entitlements
+ Set<String> updatedEnts = new HashSet<String>(updated.getEntitlements());
+ Set<String> originalEnts = new HashSet<String>(original.getEntitlements());
+ if (updatedEnts.equals(originalEnts)) {
+ result.setEntitlements(null);
+ } else {
+ result.setEntitlements(updated.getEntitlements());
+ }
+
+ // 5. owner
+ result.setUserOwner(new ReferenceMod(updated.getUserOwner()));
+ result.setRoleOwner(new ReferenceMod(updated.getRoleOwner()));
+
+ return result;
+ }
+
+ private static List<AttributeTO> getUpdateValues(final Map<String, AttributeTO> attrs,
+ final Set<String> attrsToBeRemoved, final Set<AttributeMod> attrsToBeUpdated) {
+
+ Map<String, AttributeTO> rwattrs = new HashMap<String, AttributeTO>(attrs);
+ for (String attrName : attrsToBeRemoved) {
+ rwattrs.remove(attrName);
+ }
+ for (AttributeMod attrMod : attrsToBeUpdated) {
+ if (rwattrs.containsKey(attrMod.getSchema())) {
+ AttributeTO attrTO = rwattrs.get(attrMod.getSchema());
+ attrTO.getValues().removeAll(attrMod.getValuesToBeRemoved());
+ attrTO.getValues().addAll(attrMod.getValuesToBeAdded());
+ } else {
+ AttributeTO attrTO = new AttributeTO();
+ attrTO.setSchema(attrMod.getSchema());
+ attrTO.setValues(attrMod.getValuesToBeAdded());
+
+ rwattrs.put(attrMod.getSchema(), attrTO);
+ }
+ }
+
+ return new ArrayList<AttributeTO>(rwattrs.values());
+ }
+
+ private static <T extends AbstractAttributableTO, K extends AbstractAttributableMod> void apply(final T to,
+ final K mod, final T result) {
+
+ // 1. attributes
+ result.setAttributes(getUpdateValues(to.getAttributeMap(), mod.getAttributesToBeRemoved(), mod.
+ getAttributesToBeUpdated()));
+
+ // 2. derived attributes
+ Map<String, AttributeTO> attrs = to.getDerivedAttributeMap();
+ for (String attrName : mod.getDerivedAttributesToBeRemoved()) {
+ attrs.remove(attrName);
+ }
+ for (String attrName : mod.getDerivedAttributesToBeAdded()) {
+ AttributeTO attrTO = new AttributeTO();
+ attrTO.setSchema(attrName);
+
+ attrs.put(attrName, attrTO);
+ }
+ result.setDerivedAttributes(new ArrayList<AttributeTO>(attrs.values()));
+
+ // 3. virtual attributes
+ result.setVirtualAttributes(getUpdateValues(to.getVirtualAttributeMap(), mod.getVirtualAttributesToBeRemoved(),
+ mod.getVirtualAttributesToBeUpdated()));
+
+ // 4. resources
+ result.getResources().removeAll(mod.getResourcesToBeRemoved());
+ result.getResources().addAll(mod.getResourcesToBeAdded());
+ }
+
+ public static UserTO apply(final UserTO userTO, final UserMod userMod) {
+ // 1. check same id
+ if (userTO.getId() != userMod.getId()) {
+ throw new IllegalArgumentException("UserTO and UserMod ids must be the same");
+ }
+
+ UserTO result = clone(userTO);
+ apply(userTO, userMod, result);
+
+ // 1. password
+ result.setPassword(userMod.getPassword());
+
+ // 2. username
+ if (userMod.getUsername() != null) {
+ result.setUsername(userMod.getUsername());
+ }
+ // 3. memberships
+ Map<Long, MembershipTO> membs = result.getMembershipMap();
+ for (Long membId : userMod.getMembershipsToBeRemoved()) {
+ result.removeMembership(membs.get(membId));
+ }
+ for (MembershipMod membMod : userMod.getMembershipsToBeAdded()) {
+ MembershipTO membTO = new MembershipTO();
+ membTO.setRoleId(membMod.getRole());
+
+ apply(membTO, membMod, membTO);
+ }
+
+ return result;
+ }
+}
Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/util/CollectionWrapper.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/util/CollectionWrapper.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/util/CollectionWrapper.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/util/CollectionWrapper.java Mon Jan 21 09:08:54 2013
@@ -0,0 +1,111 @@
+/*
+ * 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.common.util;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.syncope.common.to.EntitlementTO;
+import org.apache.syncope.common.to.MailTemplateTO;
+import org.apache.syncope.common.to.ValidatorTO;
+import org.springframework.web.servlet.ModelAndView;
+
+public final class CollectionWrapper {
+
+ private CollectionWrapper() {
+ }
+
+ public static Set<EntitlementTO> wrap(final Set<String> collection) {
+ Set<EntitlementTO> respons = new HashSet<EntitlementTO>();
+ for (String e : collection) {
+ respons.add(EntitlementTO.instance(e));
+ }
+ return respons;
+ }
+
+ public static List<EntitlementTO> wrap(final List<String> collection) {
+ List<EntitlementTO> respons = new ArrayList<EntitlementTO>();
+ for (String e : collection) {
+ respons.add(EntitlementTO.instance(e));
+ }
+ return respons;
+ }
+
+ public static Set<String> unwrap(final Set<EntitlementTO> collection) {
+ Set<String> respons = new HashSet<String>();
+ for (EntitlementTO e : collection) {
+ respons.add(e.getName());
+ }
+ return respons;
+ }
+
+ public static List<String> unwrap(final List<EntitlementTO> collection) {
+ List<String> respons = new ArrayList<String>();
+ for (EntitlementTO e : collection) {
+ respons.add(e.getName());
+ }
+ return respons;
+ }
+
+ public static Set<MailTemplateTO> wrapMailTemplates(final ModelAndView mailTemplates) {
+ @SuppressWarnings("unchecked")
+ Set<String> collection = (Set<String>) mailTemplates.getModel().values().iterator().next();
+ return wrapMailTemplates(collection);
+ }
+
+ public static Set<MailTemplateTO> wrapMailTemplates(final Set<String> collection) {
+ Set<MailTemplateTO> respons = new HashSet<MailTemplateTO>();
+ for (String e : collection) {
+ respons.add(MailTemplateTO.instance(e));
+ }
+ return respons;
+ }
+
+ public static Set<ValidatorTO> wrapValidator(final ModelAndView validators) {
+ @SuppressWarnings("unchecked")
+ Set<String> collection = (Set<String>) validators.getModel().values().iterator().next();
+ return wrapValidator(collection);
+ }
+
+ public static List<String> unwrapValidator(final List<ValidatorTO> collection) {
+ List<String> respons = new ArrayList<String>();
+ for (ValidatorTO e : collection) {
+ respons.add(e.getName());
+ }
+ return respons;
+ }
+
+ public static List<String> unwrapMailTemplates(final List<MailTemplateTO> collection) {
+ List<String> respons = new ArrayList<String>();
+ for (MailTemplateTO e : collection) {
+ respons.add(e.getName());
+ }
+ return respons;
+ }
+
+ public static Set<ValidatorTO> wrapValidator(final Set<String> collection) {
+ Set<ValidatorTO> respons = new HashSet<ValidatorTO>();
+ for (String e : collection) {
+ respons.add(ValidatorTO.instance(e));
+ }
+ return respons;
+ }
+}
Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/validation/SyncopeClientCompositeErrorException.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/validation/SyncopeClientCompositeErrorException.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/validation/SyncopeClientCompositeErrorException.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/validation/SyncopeClientCompositeErrorException.java Mon Jan 21 09:08:54 2013
@@ -0,0 +1,101 @@
+/*
+ * 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.common.validation;
+
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.client.HttpClientErrorException;
+import org.apache.syncope.common.types.SyncopeClientExceptionType;
+
+public class SyncopeClientCompositeErrorException extends HttpClientErrorException {
+
+ private Set<SyncopeClientException> exceptions;
+
+ public SyncopeClientCompositeErrorException(HttpStatus statusCode) {
+ super(statusCode);
+ exceptions = new HashSet<SyncopeClientException>();
+ }
+
+ public boolean hasExceptions() {
+ return !exceptions.isEmpty();
+ }
+
+ public boolean hasException(SyncopeClientExceptionType exceptionType) {
+ return getException(exceptionType) != null;
+ }
+
+ public SyncopeClientException getException(SyncopeClientExceptionType exceptionType) {
+
+ boolean found = false;
+ SyncopeClientException syncopeClientException = null;
+ for (Iterator<SyncopeClientException> itor = exceptions.iterator(); itor.hasNext() && !found;) {
+
+ syncopeClientException = itor.next();
+ if (syncopeClientException.getType().equals(exceptionType)) {
+ found = true;
+ }
+ }
+
+ return found
+ ? syncopeClientException
+ : null;
+ }
+
+ public Set<SyncopeClientException> getExceptions() {
+ return exceptions;
+ }
+
+ public boolean addException(SyncopeClientException exception) {
+ if (exception.getType() == null) {
+ throw new IllegalArgumentException(exception + " does not have the right "
+ + SyncopeClientExceptionType.class.getName() + " set");
+ }
+
+ return exceptions.add(exception);
+ }
+
+ @Override
+ public String getMessage() {
+ StringBuilder message = new StringBuilder();
+
+ message.append("{");
+ Iterator<SyncopeClientException> iter = getExceptions().iterator();
+ while (iter.hasNext()) {
+ SyncopeClientException e = iter.next();
+ message.append("[");
+ message.append(e.getType());
+ message.append(" ");
+ message.append(e.getElements());
+ message.append("]");
+ if (iter.hasNext()) {
+ message.append(", ");
+ }
+ }
+ message.append("}");
+
+ return message.toString();
+ }
+
+ @Override
+ public String getLocalizedMessage() {
+ return getMessage();
+ }
+}
Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/validation/SyncopeClientErrorHandler.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/validation/SyncopeClientErrorHandler.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/validation/SyncopeClientErrorHandler.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/validation/SyncopeClientErrorHandler.java Mon Jan 21 09:08:54 2013
@@ -0,0 +1,93 @@
+/*
+ * 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.common.validation;
+
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import org.apache.commons.lang.ArrayUtils;
+import org.apache.syncope.common.types.SyncopeClientExceptionType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.client.ClientHttpResponse;
+import org.springframework.web.client.DefaultResponseErrorHandler;
+
+public class SyncopeClientErrorHandler extends DefaultResponseErrorHandler {
+
+ public static final String EXCEPTION_TYPE_HEADER = "ExceptionType";
+
+ /**
+ * Logger.
+ */
+ private static final Logger LOG = LoggerFactory.getLogger(SyncopeClientErrorHandler.class);
+
+ public static final HttpStatus[] MANAGED_STATUSES = new HttpStatus[] { HttpStatus.BAD_REQUEST, HttpStatus.NOT_FOUND };
+
+ @Override
+ public void handleError(final ClientHttpResponse response) throws IOException {
+
+ if (!ArrayUtils.contains(MANAGED_STATUSES, response.getStatusCode())) {
+ super.handleError(response);
+ }
+
+ List<String> exceptionTypesInHeaders = response.getHeaders().get(EXCEPTION_TYPE_HEADER);
+ if (exceptionTypesInHeaders == null) {
+ LOG.debug("No " + EXCEPTION_TYPE_HEADER + " provided");
+
+ return;
+ }
+
+ SyncopeClientCompositeErrorException compositeException = new SyncopeClientCompositeErrorException(response
+ .getStatusCode());
+
+ Set<String> handledExceptions = new HashSet<String>();
+ for (String exceptionTypeAsString : exceptionTypesInHeaders) {
+ SyncopeClientExceptionType exceptionType = null;
+ try {
+ exceptionType = SyncopeClientExceptionType.getFromHeaderValue(exceptionTypeAsString);
+ } catch (IllegalArgumentException e) {
+ LOG.error("Unexpected value of " + EXCEPTION_TYPE_HEADER + ": " + exceptionTypeAsString, e);
+ }
+ if (exceptionType != null) {
+ handledExceptions.add(exceptionTypeAsString);
+
+ SyncopeClientException clientException = new SyncopeClientException();
+ clientException.setType(exceptionType);
+ if (response.getHeaders().get(exceptionType.getElementHeaderName()) != null
+ && !response.getHeaders().get(exceptionType.getElementHeaderName()).isEmpty()) {
+
+ clientException.setElements(response.getHeaders().get(exceptionType.getElementHeaderName()));
+ }
+
+ compositeException.addException(clientException);
+ }
+ }
+
+ exceptionTypesInHeaders.removeAll(handledExceptions);
+ if (!exceptionTypesInHeaders.isEmpty()) {
+ LOG.error("Unmanaged exceptions: " + exceptionTypesInHeaders);
+ }
+
+ if (compositeException.hasExceptions()) {
+ throw compositeException;
+ }
+ }
+}
Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/validation/SyncopeClientException.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/validation/SyncopeClientException.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/validation/SyncopeClientException.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/validation/SyncopeClientException.java Mon Jan 21 09:08:54 2013
@@ -0,0 +1,76 @@
+/*
+ * 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.common.validation;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.syncope.common.types.SyncopeClientExceptionType;
+
+public class SyncopeClientException extends Exception {
+
+ private static final long serialVersionUID = 3380920886511913475L;
+
+ private SyncopeClientExceptionType type;
+
+ private Set<String> elements;
+
+ public SyncopeClientException() {
+ super();
+ elements = new HashSet<String>();
+ }
+
+ public SyncopeClientException(SyncopeClientExceptionType type) {
+ this();
+ setType(type);
+ }
+
+ public SyncopeClientExceptionType getType() {
+ return type;
+ }
+
+ public final void setType(SyncopeClientExceptionType type) {
+ this.type = type;
+ }
+
+ public boolean addElement(String element) {
+ return elements.add(element);
+ }
+
+ public boolean removeElement(String element) {
+ return elements.remove(element);
+ }
+
+ public Set<String> getElements() {
+ return elements;
+ }
+
+ public void setElements(Set<String> elements) {
+ this.elements = elements;
+ }
+
+ public void setElements(List<String> elements) {
+ this.elements.addAll(elements);
+ }
+
+ public boolean isEmpty() {
+ return elements.isEmpty();
+ }
+}
Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/SyncopeSession.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/SyncopeSession.java?rev=1436230&r1=1436229&r2=1436230&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/SyncopeSession.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/SyncopeSession.java Mon Jan 21 09:08:54 2013
@@ -21,36 +21,36 @@ package org.apache.syncope.console;
import java.text.SimpleDateFormat;
import java.util.HashMap;
+import org.apache.syncope.client.services.proxy.ConfigurationServiceProxy;
+import org.apache.syncope.client.services.proxy.ConnectorServiceProxy;
+import org.apache.syncope.client.services.proxy.EntitlementServiceProxy;
+import org.apache.syncope.client.services.proxy.LoggerServiceProxy;
+import org.apache.syncope.client.services.proxy.NotificationServiceProxy;
+import org.apache.syncope.client.services.proxy.PolicyServiceProxy;
+import org.apache.syncope.client.services.proxy.ReportServiceProxy;
+import org.apache.syncope.client.services.proxy.ResourceServiceProxy;
+import org.apache.syncope.client.services.proxy.RoleServiceProxy;
+import org.apache.syncope.client.services.proxy.SchemaServiceProxy;
+import org.apache.syncope.client.services.proxy.SpringServiceProxy;
+import org.apache.syncope.client.services.proxy.TaskServiceProxy;
+import org.apache.syncope.client.services.proxy.UserRequestServiceProxy;
+import org.apache.syncope.client.services.proxy.UserServiceProxy;
+import org.apache.syncope.client.services.proxy.WorkflowServiceProxy;
+import org.apache.syncope.common.services.ConfigurationService;
+import org.apache.syncope.common.services.ConnectorService;
+import org.apache.syncope.common.services.EntitlementService;
+import org.apache.syncope.common.services.LoggerService;
+import org.apache.syncope.common.services.NotificationService;
+import org.apache.syncope.common.services.PolicyService;
+import org.apache.syncope.common.services.ReportService;
+import org.apache.syncope.common.services.ResourceService;
+import org.apache.syncope.common.services.RoleService;
+import org.apache.syncope.common.services.SchemaService;
+import org.apache.syncope.common.services.TaskService;
+import org.apache.syncope.common.services.UserRequestService;
+import org.apache.syncope.common.services.UserService;
+import org.apache.syncope.common.services.WorkflowService;
import org.apache.syncope.console.commons.Constants;
-import org.apache.syncope.services.ConfigurationService;
-import org.apache.syncope.services.ConnectorService;
-import org.apache.syncope.services.EntitlementService;
-import org.apache.syncope.services.LoggerService;
-import org.apache.syncope.services.NotificationService;
-import org.apache.syncope.services.PolicyService;
-import org.apache.syncope.services.ReportService;
-import org.apache.syncope.services.ResourceService;
-import org.apache.syncope.services.RoleService;
-import org.apache.syncope.services.SchemaService;
-import org.apache.syncope.services.TaskService;
-import org.apache.syncope.services.UserRequestService;
-import org.apache.syncope.services.UserService;
-import org.apache.syncope.services.WorkflowService;
-import org.apache.syncope.services.proxy.ConfigurationServiceProxy;
-import org.apache.syncope.services.proxy.ConnectorServiceProxy;
-import org.apache.syncope.services.proxy.EntitlementServiceProxy;
-import org.apache.syncope.services.proxy.LoggerServiceProxy;
-import org.apache.syncope.services.proxy.NotificationServiceProxy;
-import org.apache.syncope.services.proxy.PolicyServiceProxy;
-import org.apache.syncope.services.proxy.ReportServiceProxy;
-import org.apache.syncope.services.proxy.ResourceServiceProxy;
-import org.apache.syncope.services.proxy.RoleServiceProxy;
-import org.apache.syncope.services.proxy.SchemaServiceProxy;
-import org.apache.syncope.services.proxy.SpringServiceProxy;
-import org.apache.syncope.services.proxy.TaskServiceProxy;
-import org.apache.syncope.services.proxy.UserRequestServiceProxy;
-import org.apache.syncope.services.proxy.UserServiceProxy;
-import org.apache.syncope.services.proxy.WorkflowServiceProxy;
import org.apache.wicket.Session;
import org.apache.wicket.authroles.authorization.strategies.role.Roles;
import org.apache.wicket.protocol.http.WebApplication;
Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/AttributableDataProvider.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/AttributableDataProvider.java?rev=1436230&r1=1436229&r2=1436230&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/AttributableDataProvider.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/AttributableDataProvider.java Mon Jan 21 09:08:54 2013
@@ -21,8 +21,9 @@ package org.apache.syncope.console.commo
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
-import org.apache.syncope.client.search.NodeCond;
-import org.apache.syncope.client.to.AbstractAttributableTO;
+
+import org.apache.syncope.common.search.NodeCond;
+import org.apache.syncope.common.to.AbstractAttributableTO;
import org.apache.syncope.console.rest.AbstractAttributableRestClient;
import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder;
import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/DateFormatROModel.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/DateFormatROModel.java?rev=1436230&r1=1436229&r2=1436230&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/DateFormatROModel.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/DateFormatROModel.java Mon Jan 21 09:08:54 2013
@@ -19,9 +19,10 @@
package org.apache.syncope.console.commons;
import java.util.Date;
+
+import org.apache.syncope.console.SyncopeSession;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.PropertyModel;
-import org.apache.syncope.console.SyncopeSession;
public class DateFormatROModel implements IModel<String> {
Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/HttpResourceStream.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/HttpResourceStream.java?rev=1436230&r1=1436229&r2=1436230&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/HttpResourceStream.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/HttpResourceStream.java Mon Jan 21 09:08:54 2013
@@ -23,6 +23,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.net.URISyntaxException;
+
import org.apache.http.Header;
import org.apache.http.HttpEntity;
import org.apache.http.HttpHost;
Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/MapChoiceRenderer.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/MapChoiceRenderer.java?rev=1436230&r1=1436229&r2=1436230&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/MapChoiceRenderer.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/MapChoiceRenderer.java Mon Jan 21 09:08:54 2013
@@ -19,6 +19,7 @@
package org.apache.syncope.console.commons;
import java.util.Map;
+
import org.apache.wicket.markup.html.form.IChoiceRenderer;
public class MapChoiceRenderer<T, K> implements IChoiceRenderer<T> {
Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/PreferenceManager.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/PreferenceManager.java?rev=1436230&r1=1436229&r2=1436230&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/PreferenceManager.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/PreferenceManager.java Mon Jan 21 09:08:54 2013
@@ -26,6 +26,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
+
import org.apache.wicket.request.Request;
import org.apache.wicket.request.Response;
import org.apache.wicket.util.cookies.CookieDefaults;
Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/RoleTreeBuilder.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/RoleTreeBuilder.java?rev=1436230&r1=1436229&r2=1436230&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/RoleTreeBuilder.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/RoleTreeBuilder.java Mon Jan 21 09:08:54 2013
@@ -23,10 +23,12 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
+
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreeModel;
-import org.apache.syncope.client.to.RoleTO;
+
+import org.apache.syncope.common.to.RoleTO;
import org.apache.syncope.console.rest.RoleRestClient;
import org.springframework.beans.factory.annotation.Autowired;
Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/SchemaModalPageFactory.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/SchemaModalPageFactory.java?rev=1436230&r1=1436229&r2=1436230&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/SchemaModalPageFactory.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/SchemaModalPageFactory.java Mon Jan 21 09:08:54 2013
@@ -18,14 +18,14 @@
*/
package org.apache.syncope.console.commons;
-import org.apache.wicket.spring.injection.annot.SpringBean;
+import org.apache.syncope.common.types.AttributableType;
import org.apache.syncope.console.pages.AbstractSchemaModalPage;
import org.apache.syncope.console.pages.BaseModalPage;
import org.apache.syncope.console.pages.DerivedSchemaModalPage;
import org.apache.syncope.console.pages.SchemaModalPage;
import org.apache.syncope.console.pages.VirtualSchemaModalPage;
import org.apache.syncope.console.rest.SchemaRestClient;
-import org.apache.syncope.types.AttributableType;
+import org.apache.wicket.spring.injection.annot.SpringBean;
/**
* Modal window with Schema form.
Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/SearchCondWrapper.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/SearchCondWrapper.java?rev=1436230&r1=1436229&r2=1436230&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/SearchCondWrapper.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/SearchCondWrapper.java Mon Jan 21 09:08:54 2013
@@ -19,10 +19,11 @@
package org.apache.syncope.console.commons;
import java.io.Serializable;
+
import org.apache.commons.lang.builder.ReflectionToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
-import org.apache.syncope.client.search.AttributeCond;
-import org.apache.syncope.client.search.AttributeCond.Type;
+import org.apache.syncope.common.search.AttributeCond;
+import org.apache.syncope.common.search.AttributeCond.Type;
/**
* Generic search condition wrapper class.
Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/SelectOption.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/SelectOption.java?rev=1436230&r1=1436229&r2=1436230&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/SelectOption.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/SelectOption.java Mon Jan 21 09:08:54 2013
@@ -19,6 +19,7 @@
package org.apache.syncope.console.commons;
import java.io.Serializable;
+
import org.apache.commons.lang.builder.HashCodeBuilder;
public class SelectOption implements Serializable {
Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/SortableAttributableProviderComparator.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/SortableAttributableProviderComparator.java?rev=1436230&r1=1436229&r2=1436230&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/SortableAttributableProviderComparator.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/SortableAttributableProviderComparator.java Mon Jan 21 09:08:54 2013
@@ -22,8 +22,9 @@ import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
-import org.apache.syncope.client.to.AbstractAttributableTO;
-import org.apache.syncope.client.to.AttributeTO;
+
+import org.apache.syncope.common.to.AbstractAttributableTO;
+import org.apache.syncope.common.to.AttributeTO;
import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
import org.apache.wicket.model.AbstractReadOnlyModel;
Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/SortableDataProviderComparator.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/SortableDataProviderComparator.java?rev=1436230&r1=1436229&r2=1436230&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/SortableDataProviderComparator.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/SortableDataProviderComparator.java Mon Jan 21 09:08:54 2013
@@ -20,6 +20,7 @@ package org.apache.syncope.console.commo
import java.io.Serializable;
import java.util.Comparator;
+
import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.PropertyModel;
Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/StatusUtils.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/StatusUtils.java?rev=1436230&r1=1436229&r2=1436230&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/StatusUtils.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/StatusUtils.java Mon Jan 21 09:08:54 2013
@@ -24,17 +24,18 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
-import org.apache.syncope.client.to.AbstractAttributableTO;
-import org.apache.syncope.client.to.AttributeTO;
-import org.apache.syncope.client.to.ConnObjectTO;
-import org.apache.syncope.client.to.MappingItemTO;
-import org.apache.syncope.client.to.MappingTO;
-import org.apache.syncope.client.to.ResourceTO;
-import org.apache.syncope.client.to.RoleTO;
-import org.apache.syncope.client.to.UserTO;
+
+import org.apache.syncope.common.to.AbstractAttributableTO;
+import org.apache.syncope.common.to.AttributeTO;
+import org.apache.syncope.common.to.ConnObjectTO;
+import org.apache.syncope.common.to.MappingItemTO;
+import org.apache.syncope.common.to.MappingTO;
+import org.apache.syncope.common.to.ResourceTO;
+import org.apache.syncope.common.to.RoleTO;
+import org.apache.syncope.common.to.UserTO;
+import org.apache.syncope.common.types.IntMappingType;
import org.apache.syncope.console.rest.AbstractAttributableRestClient;
import org.apache.syncope.console.rest.ResourceRestClient;
-import org.apache.syncope.types.IntMappingType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/XMLRolesReader.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/XMLRolesReader.java?rev=1436230&r1=1436229&r2=1436230&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/XMLRolesReader.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/XMLRolesReader.java Mon Jan 21 09:08:54 2013
@@ -25,6 +25,7 @@ import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpression;
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;
+
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/markup/html/CrontabContainer.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/markup/html/CrontabContainer.java?rev=1436230&r1=1436229&r2=1436230&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/markup/html/CrontabContainer.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/markup/html/CrontabContainer.java Mon Jan 21 09:08:54 2013
@@ -19,6 +19,9 @@
package org.apache.syncope.console.markup.html;
import java.util.Arrays;
+
+import org.apache.syncope.console.commons.SelectChoiceRenderer;
+import org.apache.syncope.console.commons.SelectOption;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
import org.apache.wicket.markup.html.WebMarkupContainer;
@@ -30,8 +33,6 @@ import org.apache.wicket.model.Model;
import org.apache.wicket.model.PropertyModel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.apache.syncope.console.commons.SelectChoiceRenderer;
-import org.apache.syncope.console.commons.SelectOption;
public class CrontabContainer extends WebMarkupContainer {
Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/AbstractSchedTaskModalPage.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/AbstractSchedTaskModalPage.java?rev=1436230&r1=1436229&r2=1436230&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/AbstractSchedTaskModalPage.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/AbstractSchedTaskModalPage.java Mon Jan 21 09:08:54 2013
@@ -18,9 +18,9 @@
*/
package org.apache.syncope.console.pages;
-import org.apache.syncope.client.to.SchedTaskTO;
-import org.apache.syncope.client.to.SyncTaskTO;
-import org.apache.syncope.client.validation.SyncopeClientCompositeErrorException;
+import org.apache.syncope.common.to.SchedTaskTO;
+import org.apache.syncope.common.to.SyncTaskTO;
+import org.apache.syncope.common.validation.SyncopeClientCompositeErrorException;
import org.apache.syncope.console.commons.DateFormatROModel;
import org.apache.syncope.console.markup.html.CrontabContainer;
import org.apache.syncope.console.wicket.markup.html.form.AjaxTextFieldPanel;
Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/AbstractSchemaModalPage.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/AbstractSchemaModalPage.java?rev=1436230&r1=1436229&r2=1436230&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/AbstractSchemaModalPage.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/AbstractSchemaModalPage.java Mon Jan 21 09:08:54 2013
@@ -18,12 +18,12 @@
*/
package org.apache.syncope.console.pages;
-import org.apache.syncope.client.AbstractBaseBean;
+import org.apache.syncope.common.AbstractBaseBean;
+import org.apache.syncope.common.types.AttributableType;
+import org.apache.syncope.console.rest.SchemaRestClient;
import org.apache.wicket.PageReference;
import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
import org.apache.wicket.spring.injection.annot.SpringBean;
-import org.apache.syncope.console.rest.SchemaRestClient;
-import org.apache.syncope.types.AttributableType;
/**
* Modal window with Schema form.
Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ApprovalModalPage.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ApprovalModalPage.java?rev=1436230&r1=1436229&r2=1436230&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ApprovalModalPage.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ApprovalModalPage.java Mon Jan 21 09:08:54 2013
@@ -26,10 +26,11 @@ import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
+
import org.apache.commons.lang.StringUtils;
-import org.apache.syncope.client.to.WorkflowFormPropertyTO;
-import org.apache.syncope.client.to.WorkflowFormTO;
-import org.apache.syncope.client.validation.SyncopeClientCompositeErrorException;
+import org.apache.syncope.common.to.WorkflowFormPropertyTO;
+import org.apache.syncope.common.to.WorkflowFormTO;
+import org.apache.syncope.common.validation.SyncopeClientCompositeErrorException;
import org.apache.syncope.console.commons.MapChoiceRenderer;
import org.apache.syncope.console.rest.ApprovalRestClient;
import org.apache.syncope.console.wicket.markup.html.form.AjaxDropDownChoicePanel;
Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/BasePage.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/BasePage.java?rev=1436230&r1=1436229&r2=1436230&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/BasePage.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/BasePage.java Mon Jan 21 09:08:54 2013
@@ -18,7 +18,7 @@
*/
package org.apache.syncope.console.pages;
-import org.apache.syncope.client.to.UserTO;
+import org.apache.syncope.common.to.UserTO;
import org.apache.syncope.console.SyncopeApplication;
import org.apache.syncope.console.SyncopeSession;
import org.apache.syncope.console.rest.UserRestClient;
Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/Configuration.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/Configuration.java?rev=1436230&r1=1436229&r2=1436230&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/Configuration.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/Configuration.java Mon Jan 21 09:08:54 2013
@@ -18,19 +18,20 @@
*/
package org.apache.syncope.console.pages;
-import ch.qos.logback.classic.Logger;
-import ch.qos.logback.classic.LoggerContext;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
-import org.apache.syncope.client.to.ConfigurationTO;
-import org.apache.syncope.client.to.LoggerTO;
-import org.apache.syncope.client.to.NotificationTO;
-import org.apache.syncope.client.to.WorkflowDefinitionTO;
-import org.apache.syncope.client.validation.SyncopeClientCompositeErrorException;
+
+import org.apache.syncope.common.to.ConfigurationTO;
+import org.apache.syncope.common.to.LoggerTO;
+import org.apache.syncope.common.to.NotificationTO;
+import org.apache.syncope.common.to.WorkflowDefinitionTO;
+import org.apache.syncope.common.types.PolicyType;
+import org.apache.syncope.common.types.SyncopeLoggerLevel;
+import org.apache.syncope.common.validation.SyncopeClientCompositeErrorException;
import org.apache.syncope.console.commons.Constants;
import org.apache.syncope.console.commons.HttpResourceStream;
import org.apache.syncope.console.commons.PreferenceManager;
@@ -42,8 +43,6 @@ import org.apache.syncope.console.rest.N
import org.apache.syncope.console.rest.WorkflowRestClient;
import org.apache.syncope.console.wicket.markup.html.form.ActionLink;
import org.apache.syncope.console.wicket.markup.html.form.ActionLinksPanel;
-import org.apache.syncope.types.PolicyType;
-import org.apache.syncope.types.SyncopeLoggerLevel;
import org.apache.wicket.Page;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
@@ -79,6 +78,9 @@ import org.apache.wicket.request.resourc
import org.apache.wicket.spring.injection.annot.SpringBean;
import org.slf4j.LoggerFactory;
+import ch.qos.logback.classic.Logger;
+import ch.qos.logback.classic.LoggerContext;
+
/**
* Configurations WebPage.
*/
Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ConfigurationModalPage.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ConfigurationModalPage.java?rev=1436230&r1=1436229&r2=1436230&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ConfigurationModalPage.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ConfigurationModalPage.java Mon Jan 21 09:08:54 2013
@@ -18,8 +18,8 @@
*/
package org.apache.syncope.console.pages;
-import org.apache.syncope.client.to.ConfigurationTO;
-import org.apache.syncope.client.validation.SyncopeClientCompositeErrorException;
+import org.apache.syncope.common.to.ConfigurationTO;
+import org.apache.syncope.common.validation.SyncopeClientCompositeErrorException;
import org.apache.syncope.console.rest.ConfigurationRestClient;
import org.apache.syncope.console.wicket.markup.html.form.AjaxTextFieldPanel;
import org.apache.wicket.PageReference;