svn commit: r1444867 - /syncope/branches/1_0_X/core/src/main/resources/userWorkflow.bpmn20.xml

2013-02-11 Thread ilgrosso
Author: ilgrosso
Date: Mon Feb 11 17:06:06 2013
New Revision: 1444867

URL: http://svn.apache.org/r1444867
Log:
[SYNCOPE-308] Re-merging user workflow definition from trunk

Modified:
syncope/branches/1_0_X/core/src/main/resources/userWorkflow.bpmn20.xml

Modified: syncope/branches/1_0_X/core/src/main/resources/userWorkflow.bpmn20.xml
URL: 
http://svn.apache.org/viewvc/syncope/branches/1_0_X/core/src/main/resources/userWorkflow.bpmn20.xml?rev=1444867&r1=1444866&r2=1444867&view=diff
==
--- syncope/branches/1_0_X/core/src/main/resources/userWorkflow.bpmn20.xml 
(original)
+++ syncope/branches/1_0_X/core/src/main/resources/userWorkflow.bpmn20.xml Mon 
Feb 11 17:06:06 2013
@@ -23,12 +23,12 @@ under the License.
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  xmlns:activiti="http://activiti.org/bpmn";
  xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"; 
- xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC";
+ xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC"; 
  xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI"; 
  xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL 
  
http://www.omg.org/spec/BPMN/2.0/20100501/BPMN20.xsd";>
   
-  
+  
   
 
 
@@ -165,11 +165,14 @@ under the License.
 
 
 
-
+
 
 
   ${task == 
'delete'}
 
+
+  ${empty 
task}
+
 
 
 




svn commit: r1444864 - in /syncope/trunk: ./ core/src/main/java/org/apache/syncope/core/workflow/user/activiti/ core/src/main/java/org/apache/syncope/core/workflow/user/activiti/task/ core/src/main/re

2013-02-11 Thread ilgrosso
Author: ilgrosso
Date: Mon Feb 11 17:01:30 2013
New Revision: 1444864

URL: http://svn.apache.org/r1444864
Log:
[SYNCOPE-308] Merge from 1_0_X

Modified:
syncope/trunk/   (props changed)

syncope/trunk/core/src/main/java/org/apache/syncope/core/workflow/user/activiti/ActivitiUserWorkflowAdapter.java

syncope/trunk/core/src/main/java/org/apache/syncope/core/workflow/user/activiti/task/Delete.java
syncope/trunk/core/src/main/resources/userWorkflow.bpmn20.xml

Propchange: syncope/trunk/
--
  Merged /syncope/branches/1_0_X:r1444142-1444850

Modified: 
syncope/trunk/core/src/main/java/org/apache/syncope/core/workflow/user/activiti/ActivitiUserWorkflowAdapter.java
URL: 
http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/workflow/user/activiti/ActivitiUserWorkflowAdapter.java?rev=1444864&r1=1444863&r2=1444864&view=diff
==
--- 
syncope/trunk/core/src/main/java/org/apache/syncope/core/workflow/user/activiti/ActivitiUserWorkflowAdapter.java
 (original)
+++ 
syncope/trunk/core/src/main/java/org/apache/syncope/core/workflow/user/activiti/ActivitiUserWorkflowAdapter.java
 Mon Feb 11 17:01:30 2013
@@ -269,7 +269,7 @@ public class ActivitiUserWorkflowAdapter
 }
 
 if (StringUtils.isBlank(user.getWorkflowId())) {
-throw new WorkflowException(new NotFoundException("Empty workflow 
id"));
+throw new WorkflowException(new NotFoundException("Empty workflow 
id for " + user));
 }
 
 List tasks = 
taskService.createTaskQuery().processInstanceId(user.getWorkflowId()).list();

Modified: 
syncope/trunk/core/src/main/java/org/apache/syncope/core/workflow/user/activiti/task/Delete.java
URL: 
http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/workflow/user/activiti/task/Delete.java?rev=1444864&r1=1444863&r2=1444864&view=diff
==
--- 
syncope/trunk/core/src/main/java/org/apache/syncope/core/workflow/user/activiti/task/Delete.java
 (original)
+++ 
syncope/trunk/core/src/main/java/org/apache/syncope/core/workflow/user/activiti/task/Delete.java
 Mon Feb 11 17:01:30 2013
@@ -34,7 +34,6 @@ public class Delete extends AbstractActi
 user.checkToken("");
 }
 
-
 // remove SyncopeUser variable
 execution.removeVariable(ActivitiUserWorkflowAdapter.SYNCOPE_USER);
 }

Modified: syncope/trunk/core/src/main/resources/userWorkflow.bpmn20.xml
URL: 
http://svn.apache.org/viewvc/syncope/trunk/core/src/main/resources/userWorkflow.bpmn20.xml?rev=1444864&r1=1444863&r2=1444864&view=diff
==
--- syncope/trunk/core/src/main/resources/userWorkflow.bpmn20.xml (original)
+++ syncope/trunk/core/src/main/resources/userWorkflow.bpmn20.xml Mon Feb 11 
17:01:30 2013
@@ -169,8 +169,16 @@ under the License.
 
 
 
-
+
 
+
+
+  ${task == 
'delete'}
+
+
+  ${empty 
task}
+
+
 
 




svn commit: r1444850 - in /syncope/branches/1_0_X: console/src/main/resources/org/apache/syncope/console/pages/ core/src/main/java/org/apache/syncope/core/workflow/ core/src/main/java/org/apache/synco

2013-02-11 Thread ilgrosso
Author: ilgrosso
Date: Mon Feb 11 16:26:31 2013
New Revision: 1444850

URL: http://svn.apache.org/r1444850
Log:
[SYNCOPE-308] Default workflow changed to raise exception when update of 
rejected user is attempted

Modified:

syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/Users.html

syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/workflow/ActivitiUserWorkflowAdapter.java

syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/workflow/activiti/Delete.java
syncope/branches/1_0_X/core/src/main/resources/userWorkflow.bpmn20.xml

Modified: 
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/Users.html
URL: 
http://svn.apache.org/viewvc/syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/Users.html?rev=1444850&r1=1444849&r2=1444850&view=diff
==
--- 
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/Users.html
 (original)
+++ 
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/Users.html
 Mon Feb 11 16:26:31 2013
@@ -12,26 +12,6 @@
  limitations under the License.
  under the License.
 -->
-
-
-/* SET THE DEFAULT ERROR PANEL'S' STYLE, INVALIDATING THE CSS RENDERING
-FOR THE CURRENT PAGE  */
-.feedbackPanelERROR {
-background: none !important;
-font-weight: normal;
-color: red;
-border:0 none !important;
-list-style-type: disc;
-padding: 5px;
-margin: 5px;
-}
-
-.feedbackPanelERROR span {
-padding: 0px;
-margin: 0px;
-}
-
-
 
 
 

Modified: 
syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/workflow/ActivitiUserWorkflowAdapter.java
URL: 
http://svn.apache.org/viewvc/syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/workflow/ActivitiUserWorkflowAdapter.java?rev=1444850&r1=1444849&r2=1444850&view=diff
==
--- 
syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/workflow/ActivitiUserWorkflowAdapter.java
 (original)
+++ 
syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/workflow/ActivitiUserWorkflowAdapter.java
 Mon Feb 11 16:26:31 2013
@@ -269,7 +269,7 @@ public class ActivitiUserWorkflowAdapter
 }
 
 if (StringUtils.isBlank(user.getWorkflowId())) {
-throw new WorkflowException(new NotFoundException("Empty workflow 
id"));
+throw new WorkflowException(new NotFoundException("Empty workflow 
id for " + user));
 }
 
 List tasks = 
taskService.createTaskQuery().processInstanceId(user.getWorkflowId()).list();

Modified: 
syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/workflow/activiti/Delete.java
URL: 
http://svn.apache.org/viewvc/syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/workflow/activiti/Delete.java?rev=1444850&r1=1444849&r2=1444850&view=diff
==
--- 
syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/workflow/activiti/Delete.java
 (original)
+++ 
syncope/branches/1_0_X/core/src/main/java/org/apache/syncope/core/workflow/activiti/Delete.java
 Mon Feb 11 16:26:31 2013
@@ -34,7 +34,6 @@ public class Delete extends AbstractActi
 user.checkToken("");
 }
 
-
 // remove SyncopeUser variable
 execution.removeVariable(ActivitiUserWorkflowAdapter.SYNCOPE_USER);
 }

Modified: syncope/branches/1_0_X/core/src/main/resources/userWorkflow.bpmn20.xml
URL: 
http://svn.apache.org/viewvc/syncope/branches/1_0_X/core/src/main/resources/userWorkflow.bpmn20.xml?rev=1444850&r1=1444849&r2=1444850&view=diff
==
--- syncope/branches/1_0_X/core/src/main/resources/userWorkflow.bpmn20.xml 
(original)
+++ syncope/branches/1_0_X/core/src/main/resources/userWorkflow.bpmn20.xml Mon 
Feb 11 16:26:31 2013
@@ -164,8 +164,13 @@ under the License.
 
 
 
-
-
+
+
+
+
+  ${task == 
'delete'}
+
+
 
 
 




svn commit: r1444739 - in /syncope/trunk/core/src: main/java/org/apache/syncope/core/rest/data/ test/java/org/apache/syncope/core/persistence/dao/

2013-02-11 Thread ilgrosso
Author: ilgrosso
Date: Mon Feb 11 11:13:07 2013
New Revision: 1444739

URL: http://svn.apache.org/r1444739
Log:
[SYNCOPE-215] Implement usage of AbstractVirSchema#isReadonly() + basci test

Modified:

syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/AbstractAttributableDataBinder.java

syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/SchemaDataBinder.java

syncope/trunk/core/src/test/java/org/apache/syncope/core/persistence/dao/VirSchemaTest.java

Modified: 
syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/AbstractAttributableDataBinder.java
URL: 
http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/AbstractAttributableDataBinder.java?rev=1444739&r1=1444738&r2=1444739&view=diff
==
--- 
syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/AbstractAttributableDataBinder.java
 (original)
+++ 
syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/AbstractAttributableDataBinder.java
 Mon Feb 11 11:13:07 2013
@@ -131,7 +131,7 @@ public abstract class AbstractAttributab
 } else if (schema.isReadonly()) {
 schema = null;
 
-LOG.debug("Ignoring virtual or readonly schema {}", 
schemaName);
+LOG.debug("Ignoring readonly schema {}", schemaName);
 }
 }
 
@@ -157,6 +157,10 @@ public abstract class AbstractAttributab
 
 if (virtualSchema == null) {
 LOG.debug("Ignoring invalid virtual schema {}", virSchemaName);
+} else if (virtualSchema.isReadonly()) {
+virtualSchema = null;
+
+LOG.debug("Ignoring readonly virtual schema {}", 
virtualSchema);
 }
 }
 
@@ -274,6 +278,7 @@ public abstract class AbstractAttributab
 }
 for (AbstractVirSchema virSchema : 
virSchemaDAO.findAll(attrUtil.virSchemaClass())) {
 if (attributable.getVirtualAttribute(virSchema.getName()) == null
+&& !virSchema.isReadonly()
 && evaluateMandatoryCondition(attrUtil, attributable, 
virSchema.getName(),
 attrUtil.virIntMappingType())) {
 
@@ -294,11 +299,11 @@ public abstract class AbstractAttributab
 
 // 1. virtual attributes to be removed
 for (String vAttrToBeRemoved : vAttrsToBeRemoved) {
-AbstractVirSchema virtualSchema = 
getVirtualSchema(vAttrToBeRemoved, attrUtil.virSchemaClass());
-if (virtualSchema != null) {
-AbstractVirAttr virAttr = 
attributable.getVirtualAttribute(virtualSchema.getName());
+AbstractVirSchema virSchema = getVirtualSchema(vAttrToBeRemoved, 
attrUtil.virSchemaClass());
+if (virSchema != null) {
+AbstractVirAttr virAttr = 
attributable.getVirtualAttribute(virSchema.getName());
 if (virAttr == null) {
-LOG.debug("No virtual attribute found for schema {}", 
virtualSchema.getName());
+LOG.debug("No virtual attribute found for schema {}", 
virSchema.getName());
 } else {
 attributable.removeVirtualAttribute(virAttr);
 virAttrDAO.delete(virAttr);
@@ -306,7 +311,7 @@ public abstract class AbstractAttributab
 
 for (ExternalResource resource : resourceDAO.findAll()) {
 for (AbstractMappingItem mapItem : 
attrUtil.getMappingItems(resource)) {
-if 
(virtualSchema.getName().equals(mapItem.getIntAttrName())
+if 
(virSchema.getName().equals(mapItem.getIntAttrName())
 && mapItem.getIntMappingType() == 
attrUtil.virIntMappingType()
 && 
attributable.getResources().contains(resource)) {
 
@@ -731,7 +736,7 @@ public abstract class AbstractAttributab
 attributeTO = new AttributeTO();
 
attributeTO.setSchema(virtualAttribute.getVirtualSchema().getName());
 attributeTO.setValues(virtualAttribute.getValues());
-attributeTO.setReadonly(false);
+
attributeTO.setReadonly(virtualAttribute.getVirtualSchema().isReadonly());
 
 abstractAttributableTO.addVirtualAttribute(attributeTO);
 }

Modified: 
syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/SchemaDataBinder.java
URL: 
http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/SchemaDataBinder.java?rev=1444739&r1=1444738&r2=1444739&view=diff
==
--- 
syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/SchemaDataBinder.java
 (original)
+++ 
syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/SchemaDataBinder.java
 Mon Feb 11 11:13:07 2013
@@ -19,7 +19

svn commit: r1444727 - in /syncope/trunk/console/src/main: java/org/apache/syncope/console/pages/ java/org/apache/syncope/console/pages/panels/ resources/org/apache/syncope/console/pages/

2013-02-11 Thread coheigea
Author: coheigea
Date: Mon Feb 11 10:32:31 2013
New Revision: 1444727

URL: http://svn.apache.org/r1444727
Log:
[SYNCOPE-215] - Committing Fabio's modified patch

Modified:

syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/VirtualSchemaModalPage.java

syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/VirtualAttributesPanel.java

syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/VirtualSchemaModalPage.html

syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/VirtualSchemaModalPage.properties

syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/VirtualSchemaModalPage_it.properties

Modified: 
syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/VirtualSchemaModalPage.java
URL: 
http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/VirtualSchemaModalPage.java?rev=1444727&r1=1444726&r2=1444727&view=diff
==
--- 
syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/VirtualSchemaModalPage.java
 (original)
+++ 
syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/VirtualSchemaModalPage.java
 Mon Feb 11 10:32:31 2013
@@ -22,6 +22,7 @@ import org.apache.syncope.common.Abstrac
 import org.apache.syncope.common.to.VirtualSchemaTO;
 import org.apache.syncope.common.types.AttributableType;
 import 
org.apache.syncope.common.validation.SyncopeClientCompositeErrorException;
+import org.apache.syncope.console.wicket.markup.html.form.AjaxCheckBoxPanel;
 import org.apache.syncope.console.wicket.markup.html.form.AjaxTextFieldPanel;
 import org.apache.wicket.PageReference;
 import org.apache.wicket.ajax.AjaxRequestTarget;
@@ -61,6 +62,9 @@ public class VirtualSchemaModalPage exte
 name.addRequiredLabel();
 
 name.setEnabled(createFlag);
+
+final AjaxCheckBoxPanel readonly = new AjaxCheckBoxPanel("readonly", 
getString("readonly"),
+ new 
PropertyModel(schema, "readonly"));
 
 final IndicatingAjaxButton submit = new IndicatingAjaxButton("apply", 
new ResourceModel("submit")) {
 
@@ -121,6 +125,7 @@ public class VirtualSchemaModalPage exte
 MetaDataRoleAuthorizationStrategy.authorize(submit, ENABLE, 
allowedRoles);
 
 schemaForm.add(name);
+schemaForm.add(readonly);
 
 schemaForm.add(submit);
 schemaForm.add(cancel);

Modified: 
syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/VirtualAttributesPanel.java
URL: 
http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/VirtualAttributesPanel.java?rev=1444727&r1=1444726&r2=1444727&view=diff
==
--- 
syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/VirtualAttributesPanel.java
 (original)
+++ 
syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/VirtualAttributesPanel.java
 Mon Feb 11 10:32:31 2013
@@ -18,12 +18,16 @@
  */
 package org.apache.syncope.console.pages.panels;
 
+import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 import org.apache.syncope.common.to.AbstractAttributableTO;
 import org.apache.syncope.common.to.AttributeTO;
 import org.apache.syncope.common.to.RoleTO;
 import org.apache.syncope.common.to.UserTO;
+import org.apache.syncope.common.to.VirtualSchemaTO;
 import org.apache.syncope.common.types.AttributableType;
 import org.apache.syncope.console.rest.SchemaRestClient;
 import 
org.apache.syncope.console.wicket.markup.html.form.AjaxDecoratedCheckbox;
@@ -64,22 +68,33 @@ public class VirtualAttributesPanel exte
 
 setOutputMarkupId(true);
 
-final IModel> virtualSchemaNames = new 
LoadableDetachableModel>() {
+final IModel> schemas = new 
LoadableDetachableModel>() {
 
-private static final long serialVersionUID = 5275935387613157437L;
+private static final long serialVersionUID = -5489981430516587774L;
 
 @Override
-protected List load() {
+protected Map load() {
+final List schemaTOs;
 if (entityTO instanceof RoleTO) {
-return 
schemaRestClient.getVirtualSchemaNames(AttributableType.ROLE);
+schemaTOs = 
schemaRestClient.getVirtualSchemas(AttributableType.ROLE);
 } else if (entityTO instanceof UserTO) {
-return 
schemaRestClient.getVirtualSchemaNames(AttributableType.USER);
+schemaTOs = 
schemaRestClient.getVirtualSchemas(AttributableType.USER);
 } else {
-return 
schemaRestClient.getVirtualSchemaNames(AttributableType.MEMBERSHIP);
+