You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2016/02/04 14:06:47 UTC

syncope git commit: [SYNCOPE-766] Reportlet provided

Repository: syncope
Updated Branches:
  refs/heads/master 73526331b -> 948464813


[SYNCOPE-766] Reportlet provided


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/94846481
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/94846481
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/94846481

Branch: refs/heads/master
Commit: 9484648133a35b95a10c95fbac926ec2d33c3bfb
Parents: 7352633
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Thu Feb 4 14:06:37 2016 +0100
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Thu Feb 4 14:06:37 2016 +0100

----------------------------------------------------------------------
 .../lib/report/ReconciliationReportletConf.java | 100 ++++
 .../logic/report/ReconciliationReportlet.java   | 486 +++++++++++++++++++
 .../core/logic/report/UserReportlet.java        |   1 -
 .../main/resources/domains/MasterContent.xml    |   6 +
 .../core/persistence/jpa/inner/ReportTest.java  |   2 +-
 .../test/resources/domains/MasterContent.xml    |   7 +-
 .../org/apache/syncope/fit/cli/CLIITCase.java   |   4 +-
 7 files changed, 601 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/94846481/common/lib/src/main/java/org/apache/syncope/common/lib/report/ReconciliationReportletConf.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/report/ReconciliationReportletConf.java b/common/lib/src/main/java/org/apache/syncope/common/lib/report/ReconciliationReportletConf.java
new file mode 100644
index 0000000..b6a682d
--- /dev/null
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/report/ReconciliationReportletConf.java
@@ -0,0 +1,100 @@
+/*
+ * 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.lib.report;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlEnum;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+@XmlRootElement(name = "reconciliationReportletConf")
+@XmlType
+public class ReconciliationReportletConf extends AbstractReportletConf {
+
+    private static final long serialVersionUID = 6602717600064602764L;
+
+    @XmlEnum
+    @XmlType(name = "reconciliationReportletConfFeature")
+    public enum Feature {
+
+        key,
+        username,
+        groupName,
+        workflowId,
+        status,
+        creationDate,
+        lastLoginDate,
+        changePwdDate,
+        passwordHistorySize,
+        failedLoginCount;
+
+    }
+
+    private String userMatchingCond;
+
+    private String groupMatchingCond;
+
+    private String anyObjectMatchingCond;
+
+    private final List<Feature> features = new ArrayList<>();
+
+    public ReconciliationReportletConf() {
+        super();
+    }
+
+    public ReconciliationReportletConf(final String name) {
+        super(name);
+    }
+
+    public String getUserMatchingCond() {
+        return userMatchingCond;
+    }
+
+    public void setUserMatchingCond(final String userMatchingCond) {
+        this.userMatchingCond = userMatchingCond;
+    }
+
+    public String getGroupMatchingCond() {
+        return groupMatchingCond;
+    }
+
+    public void setGroupMatchingCond(final String groupMatchingCond) {
+        this.groupMatchingCond = groupMatchingCond;
+    }
+
+    public String getAnyObjectMatchingCond() {
+        return anyObjectMatchingCond;
+    }
+
+    public void setAnyObjectMatchingCond(final String anyObjectMatchingCond) {
+        this.anyObjectMatchingCond = anyObjectMatchingCond;
+    }
+
+    @XmlElementWrapper(name = "features")
+    @XmlElement(name = "feature")
+    @JsonProperty("features")
+    public List<Feature> getFeatures() {
+        return features;
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/94846481/core/logic/src/main/java/org/apache/syncope/core/logic/report/ReconciliationReportlet.java
----------------------------------------------------------------------
diff --git a/core/logic/src/main/java/org/apache/syncope/core/logic/report/ReconciliationReportlet.java b/core/logic/src/main/java/org/apache/syncope/core/logic/report/ReconciliationReportlet.java
new file mode 100644
index 0000000..42f6e2f
--- /dev/null
+++ b/core/logic/src/main/java/org/apache/syncope/core/logic/report/ReconciliationReportlet.java
@@ -0,0 +1,486 @@
+/*
+ * 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.core.logic.report;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import org.apache.commons.collections4.Closure;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.IterableUtils;
+import org.apache.commons.collections4.IteratorUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.common.lib.SyncopeConstants;
+import org.apache.syncope.common.lib.report.ReconciliationReportletConf;
+import org.apache.syncope.common.lib.report.ReconciliationReportletConf.Feature;
+import org.apache.syncope.common.lib.report.ReportletConf;
+import org.apache.syncope.common.lib.types.AnyTypeKind;
+import org.apache.syncope.core.misc.search.SearchCondConverter;
+import org.apache.syncope.core.misc.utils.FormatUtils;
+import org.apache.syncope.core.misc.utils.MappingUtils;
+import org.apache.syncope.core.persistence.api.dao.AnySearchDAO;
+import org.apache.syncope.core.persistence.api.dao.AnyTypeDAO;
+import org.apache.syncope.core.persistence.api.dao.GroupDAO;
+import org.apache.syncope.core.persistence.api.dao.ReportletConfClass;
+import org.apache.syncope.core.persistence.api.dao.UserDAO;
+import org.apache.syncope.core.persistence.api.dao.VirSchemaDAO;
+import org.apache.syncope.core.persistence.api.dao.search.AnyTypeCond;
+import org.apache.syncope.core.persistence.api.dao.search.OrderByClause;
+import org.apache.syncope.core.persistence.api.dao.search.SearchCond;
+import org.apache.syncope.core.persistence.api.entity.Any;
+import org.apache.syncope.core.persistence.api.entity.AnyType;
+import org.apache.syncope.core.persistence.api.entity.AnyUtils;
+import org.apache.syncope.core.persistence.api.entity.AnyUtilsFactory;
+import org.apache.syncope.core.persistence.api.entity.VirSchema;
+import org.apache.syncope.core.persistence.api.entity.anyobject.AnyObject;
+import org.apache.syncope.core.persistence.api.entity.group.Group;
+import org.apache.syncope.core.persistence.api.entity.resource.ExternalResource;
+import org.apache.syncope.core.persistence.api.entity.resource.MappingItem;
+import org.apache.syncope.core.persistence.api.entity.resource.Provision;
+import org.apache.syncope.core.persistence.api.entity.user.User;
+import org.apache.syncope.core.provisioning.api.Connector;
+import org.apache.syncope.core.provisioning.api.ConnectorFactory;
+import org.identityconnectors.framework.common.objects.Attribute;
+import org.identityconnectors.framework.common.objects.ConnectorObject;
+import org.identityconnectors.framework.common.objects.OperationalAttributes;
+import org.identityconnectors.framework.common.objects.Uid;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.AttributesImpl;
+
+/**
+ * Reportlet for extracting information for the current reconciliation status, e.g. the coherence between Syncope
+ * information and mapped entities on external resources.
+ */
+@ReportletConfClass(ReconciliationReportletConf.class)
+public class ReconciliationReportlet extends AbstractReportlet {
+
+    private static final int PAGE_SIZE = 10;
+
+    @Autowired
+    private UserDAO userDAO;
+
+    @Autowired
+    private GroupDAO groupDAO;
+
+    @Autowired
+    private AnyTypeDAO anyTypeDAO;
+
+    @Autowired
+    private AnySearchDAO searchDAO;
+
+    @Autowired
+    private VirSchemaDAO virSchemaDAO;
+
+    @Autowired
+    private MappingUtils mappingUtils;
+
+    @Autowired
+    private ConnectorFactory connFactory;
+
+    @Autowired
+    private AnyUtilsFactory anyUtilsFactory;
+
+    private ReconciliationReportletConf conf;
+
+    private String getAnyElementName(final AnyTypeKind anyTypeKind) {
+        String elementName;
+
+        switch (anyTypeKind) {
+            case USER:
+                elementName = "user";
+                break;
+
+            case GROUP:
+                elementName = "group";
+                break;
+
+            case ANY_OBJECT:
+            default:
+                elementName = "anyObject";
+        }
+
+        return elementName;
+    }
+
+    private void doExtract(
+            final ContentHandler handler,
+            final Any<?> any,
+            final Set<Missing> missing,
+            final Set<Misaligned> misaligned)
+            throws SAXException {
+
+        AttributesImpl atts = new AttributesImpl();
+
+        for (Feature feature : conf.getFeatures()) {
+            String type = null;
+            String value = null;
+            switch (feature) {
+                case key:
+                    type = ReportXMLConst.XSD_LONG;
+                    value = String.valueOf(any.getKey());
+                    break;
+
+                case username:
+                    if (any instanceof User) {
+                        type = ReportXMLConst.XSD_STRING;
+                        value = User.class.cast(any).getUsername();
+                    }
+                    break;
+
+                case groupName:
+                    if (any instanceof Group) {
+                        type = ReportXMLConst.XSD_STRING;
+                        value = Group.class.cast(any).getName();
+                    }
+                    break;
+
+                case workflowId:
+                    type = ReportXMLConst.XSD_LONG;
+                    value = String.valueOf(any.getWorkflowId());
+                    break;
+
+                case status:
+                    type = ReportXMLConst.XSD_STRING;
+                    value = any.getStatus();
+                    break;
+
+                case creationDate:
+                    type = ReportXMLConst.XSD_DATETIME;
+                    value = any.getCreationDate() == null
+                            ? StringUtils.EMPTY
+                            : FormatUtils.format(any.getCreationDate());
+                    break;
+
+                case lastLoginDate:
+                    if (any instanceof User) {
+                        type = ReportXMLConst.XSD_DATETIME;
+                        value = User.class.cast(any).getLastLoginDate() == null
+                                ? StringUtils.EMPTY
+                                : FormatUtils.format(User.class.cast(any).getLastLoginDate());
+                    }
+                    break;
+
+                case changePwdDate:
+                    if (any instanceof User) {
+                        type = ReportXMLConst.XSD_DATETIME;
+                        value = User.class.cast(any).getChangePwdDate() == null
+                                ? StringUtils.EMPTY
+                                : FormatUtils.format(User.class.cast(any).getChangePwdDate());
+                    }
+                    break;
+
+                case passwordHistorySize:
+                    if (any instanceof User) {
+                        type = ReportXMLConst.XSD_INT;
+                        value = String.valueOf(User.class.cast(any).getPasswordHistory().size());
+                    }
+                    break;
+
+                case failedLoginCount:
+                    if (any instanceof User) {
+                        type = ReportXMLConst.XSD_INT;
+                        value = String.valueOf(User.class.cast(any).getFailedLogins());
+                    }
+                    break;
+
+                default:
+            }
+
+            if (type != null && value != null) {
+                atts.addAttribute("", "", feature.name(), type, value);
+            }
+        }
+
+        handler.startElement("", "", getAnyElementName(any.getType().getKind()), atts);
+
+        for (Missing item : missing) {
+            atts.clear();
+            atts.addAttribute("", "", "resource", ReportXMLConst.XSD_STRING, item.getResource());
+            atts.addAttribute("", "", "connObjectKeyValue", ReportXMLConst.XSD_STRING, item.getConnObjectKeyValue());
+
+            handler.startElement("", "", "missing", atts);
+            handler.endElement("", "", "missing");
+        }
+        for (Misaligned item : misaligned) {
+            atts.clear();
+            atts.addAttribute("", "", "resource", ReportXMLConst.XSD_STRING, item.getResource());
+            atts.addAttribute("", "", "connObjectKeyValue", ReportXMLConst.XSD_STRING, item.getConnObjectKeyValue());
+            atts.addAttribute("", "", ReportXMLConst.ATTR_NAME, ReportXMLConst.XSD_STRING, item.getName());
+
+            handler.startElement("", "", "misaligned", atts);
+
+            handler.startElement("", "", "onSyncope", null);
+            for (Object value : item.getOnSyncope()) {
+                char[] asChars = value.toString().toCharArray();
+
+                handler.startElement("", "", "value", null);
+                handler.characters(asChars, 0, asChars.length);
+                handler.endElement("", "", "value");
+            }
+            handler.endElement("", "", "onSyncope");
+
+            handler.startElement("", "", "onResource", null);
+            for (Object value : item.getOnResource()) {
+                char[] asChars = value.toString().toCharArray();
+
+                handler.startElement("", "", "value", null);
+                handler.characters(asChars, 0, asChars.length);
+                handler.endElement("", "", "value");
+            }
+            handler.endElement("", "", "onResource");
+
+            handler.endElement("", "", "misaligned");
+        }
+
+        handler.endElement("", "", getAnyElementName(any.getType().getKind()));
+    }
+
+    private void doExtract(final ContentHandler handler, final List<? extends Any<?>> anys)
+            throws SAXException, ReportException {
+
+        final Set<Missing> missing = new HashSet<>();
+        final Set<Misaligned> misaligned = new HashSet<>();
+
+        for (Any<?> any : anys) {
+            missing.clear();
+            misaligned.clear();
+
+            AnyUtils anyUtils = anyUtilsFactory.getInstance(any);
+            for (final ExternalResource resource : anyUtils.getAllResources(any)) {
+                Provision provision = resource.getProvision(any.getType());
+                MappingItem connObjectKeyItem = MappingUtils.getConnObjectKeyItem(provision);
+                if (provision != null && connObjectKeyItem != null) {
+                    // 1. build connObjectKeyValue
+                    final String connObjectKeyValue = mappingUtils.getConnObjectKeyValue(any, provision);
+
+                    // 2. determine attributes to query
+                    Set<MappingItem> linkinMappingItems = new HashSet<>();
+                    for (VirSchema virSchema : virSchemaDAO.findByProvision(provision)) {
+                        linkinMappingItems.add(virSchema.asLinkingMappingItem());
+                    }
+                    Iterator<MappingItem> mapItems = IteratorUtils.chainedIterator(
+                            provision.getMapping().getItems().iterator(),
+                            linkinMappingItems.iterator());
+
+                    // 3. read from the underlying connector
+                    Connector connector = connFactory.getConnector(resource);
+                    ConnectorObject connectorObject = connector.getObject(
+                            provision.getObjectClass(),
+                            new Uid(connObjectKeyValue),
+                            MappingUtils.buildOperationOptions(mapItems));
+
+                    if (connectorObject == null) {
+                        // 4. not found on resource?
+                        LOG.error("Object {} with class {} not found on resource {}",
+                                connObjectKeyValue, provision.getObjectClass(), resource);
+
+                        missing.add(new Missing(resource.getKey(), connObjectKeyValue));
+                    } else {
+                        // 5. found but misaligned?
+
+                        final Map<String, Set<Object>> syncopeAttrs = new HashMap<>();
+                        for (Attribute attr : mappingUtils.prepareAttrs(any, null, false, null, provision).getRight()) {
+                            syncopeAttrs.put(attr.getName(), new HashSet<>(attr.getValue()));
+                        }
+
+                        final Map<String, Set<Object>> resourceAttrs = new HashMap<>();
+                        for (Attribute attr : connectorObject.getAttributes()) {
+                            if (!OperationalAttributes.PASSWORD_NAME.equals(attr.getName())
+                                    && !OperationalAttributes.ENABLE_NAME.equals(attr.getName())) {
+
+                                resourceAttrs.put(attr.getName(), new HashSet<>(attr.getValue()));
+                            }
+                        }
+
+                        IterableUtils.forEach(CollectionUtils.subtract(syncopeAttrs.keySet(), resourceAttrs.keySet()),
+                                new Closure<String>() {
+
+                            @Override
+                            public void execute(final String name) {
+                                misaligned.add(new Misaligned(
+                                        resource.getKey(),
+                                        connObjectKeyValue,
+                                        name,
+                                        syncopeAttrs.get(name),
+                                        Collections.emptySet()));
+                            }
+                        });
+
+                        for (Map.Entry<String, Set<Object>> entry : resourceAttrs.entrySet()) {
+                            if (syncopeAttrs.containsKey(entry.getKey())) {
+                                if (!syncopeAttrs.get(entry.getKey()).equals(entry.getValue())) {
+                                    misaligned.add(new Misaligned(
+                                            resource.getKey(),
+                                            connObjectKeyValue,
+                                            entry.getKey(),
+                                            syncopeAttrs.get(entry.getKey()),
+                                            entry.getValue()));
+                                }
+                            } else {
+                                misaligned.add(new Misaligned(
+                                        resource.getKey(),
+                                        connObjectKeyValue,
+                                        entry.getKey(),
+                                        Collections.emptySet(),
+                                        entry.getValue()));
+                            }
+                        }
+                    }
+                }
+            }
+
+            if (!missing.isEmpty() || !misaligned.isEmpty()) {
+                doExtract(handler, any, missing, misaligned);
+            }
+        }
+    }
+
+    private void doExtract(final ContentHandler handler, final SearchCond cond, final AnyTypeKind anyTypeKind)
+            throws SAXException {
+
+        int count = searchDAO.count(
+                SyncopeConstants.FULL_ADMIN_REALMS,
+                cond,
+                anyTypeKind);
+
+        for (int page = 1; page <= (count / PAGE_SIZE) + 1; page++) {
+            List<AnyObject> anys = searchDAO.search(
+                    SyncopeConstants.FULL_ADMIN_REALMS,
+                    cond,
+                    page,
+                    PAGE_SIZE,
+                    Collections.<OrderByClause>emptyList(),
+                    anyTypeKind);
+
+            doExtract(handler, anys);
+        }
+    }
+
+    @Override
+    protected void doExtract(final ReportletConf conf, final ContentHandler handler) throws SAXException {
+        if (conf instanceof ReconciliationReportletConf) {
+            this.conf = ReconciliationReportletConf.class.cast(conf);
+        } else {
+            throw new ReportException(new IllegalArgumentException("Invalid configuration provided"));
+        }
+
+        handler.startElement("", "", getAnyElementName(AnyTypeKind.USER) + "s", null);
+        if (StringUtils.isBlank(this.conf.getUserMatchingCond())) {
+            doExtract(handler, userDAO.findAll());
+        } else {
+            SearchCond cond = SearchCondConverter.convert(this.conf.getUserMatchingCond());
+            doExtract(handler, cond, AnyTypeKind.USER);
+        }
+        handler.endElement("", "", getAnyElementName(AnyTypeKind.USER) + "s");
+
+        handler.startElement("", "", getAnyElementName(AnyTypeKind.GROUP) + "s", null);
+        if (StringUtils.isBlank(this.conf.getGroupMatchingCond())) {
+            doExtract(handler, groupDAO.findAll());
+        } else {
+            SearchCond cond = SearchCondConverter.convert(this.conf.getUserMatchingCond());
+            doExtract(handler, cond, AnyTypeKind.GROUP);
+        }
+        handler.endElement("", "", getAnyElementName(AnyTypeKind.GROUP) + "s");
+
+        AttributesImpl atts = new AttributesImpl();
+
+        for (AnyType anyType : anyTypeDAO.findAll()) {
+            if (!anyType.equals(anyTypeDAO.findUser()) && !anyType.equals(anyTypeDAO.findGroup())) {
+                atts.clear();
+                atts.addAttribute("", "", "type", ReportXMLConst.XSD_STRING, anyType.getKey());
+                handler.startElement("", "", getAnyElementName(AnyTypeKind.ANY_OBJECT) + "s", atts);
+
+                AnyTypeCond anyTypeCond = new AnyTypeCond();
+                anyTypeCond.setAnyTypeName(anyType.getKey());
+                SearchCond cond = StringUtils.isBlank(this.conf.getAnyObjectMatchingCond())
+                        ? SearchCond.getLeafCond(anyTypeCond)
+                        : SearchCond.getAndCond(
+                                SearchCond.getLeafCond(anyTypeCond),
+                                SearchCondConverter.convert(this.conf.getAnyObjectMatchingCond()));
+
+                doExtract(handler, cond, AnyTypeKind.ANY_OBJECT);
+
+                handler.endElement("", "", getAnyElementName(AnyTypeKind.ANY_OBJECT) + "s");
+            }
+        }
+    }
+
+    private static class Missing {
+
+        private final String resource;
+
+        private final String connObjectKeyValue;
+
+        Missing(final String resource, final String connObjectKeyValue) {
+            this.resource = resource;
+            this.connObjectKeyValue = connObjectKeyValue;
+        }
+
+        public String getResource() {
+            return resource;
+        }
+
+        public String getConnObjectKeyValue() {
+            return connObjectKeyValue;
+        }
+
+    }
+
+    private static class Misaligned extends Missing {
+
+        private final String name;
+
+        private final Set<Object> onSyncope;
+
+        private final Set<Object> onResource;
+
+        Misaligned(
+                final String resource,
+                final String connObjectKeyValue,
+                final String name,
+                final Set<Object> onSyncope,
+                final Set<Object> onResource) {
+
+            super(resource, connObjectKeyValue);
+
+            this.name = name;
+            this.onSyncope = onSyncope;
+            this.onResource = onResource;
+        }
+
+        public String getName() {
+            return name;
+        }
+
+        public Set<Object> getOnSyncope() {
+            return onSyncope;
+        }
+
+        public Set<Object> getOnResource() {
+            return onResource;
+        }
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/94846481/core/logic/src/main/java/org/apache/syncope/core/logic/report/UserReportlet.java
----------------------------------------------------------------------
diff --git a/core/logic/src/main/java/org/apache/syncope/core/logic/report/UserReportlet.java b/core/logic/src/main/java/org/apache/syncope/core/logic/report/UserReportlet.java
index 863754d..71cc9b3 100644
--- a/core/logic/src/main/java/org/apache/syncope/core/logic/report/UserReportlet.java
+++ b/core/logic/src/main/java/org/apache/syncope/core/logic/report/UserReportlet.java
@@ -373,7 +373,6 @@ public class UserReportlet extends AbstractReportlet {
                         page, PAGE_SIZE, Collections.<OrderByClause>emptyList(), AnyTypeKind.USER);
                 doExtract(handler, users);
             }
-
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/94846481/core/persistence-jpa/src/main/resources/domains/MasterContent.xml
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/resources/domains/MasterContent.xml b/core/persistence-jpa/src/main/resources/domains/MasterContent.xml
index 361e7c9..c5a6677 100644
--- a/core/persistence-jpa/src/main/resources/domains/MasterContent.xml
+++ b/core/persistence-jpa/src/main/resources/domains/MasterContent.xml
@@ -165,4 +165,10 @@ we are happy to inform you that the password request was execute successfully fo
                 traceLevel="FAILURES"/> 
   <Notification_events Notification_id="2" event="[CUSTOM]:[]:[]:[confirmPasswordReset]:[SUCCESS]"/>
 
+  <ReportTemplate name="empty"/>  
+
+  <Report id="1" name="reconciliation" active="1" template_name="empty"/>
+  <ReportletConfInstance id="1" Report_id="1" 
+                         serializedInstance='{"@class":"org.apache.syncope.common.lib.report.ReconciliationReportletConf","name":"dashboardReconciliationReportlet","userMatchingCond":null,"groupMatchingCond":null,"anyObjectMatchingCond":null,"features":["key","username","groupName"]}'/>
+
 </dataset>

http://git-wip-us.apache.org/repos/asf/syncope/blob/94846481/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/ReportTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/ReportTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/ReportTest.java
index 813d14b..a009f42 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/ReportTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/ReportTest.java
@@ -54,7 +54,7 @@ public class ReportTest extends AbstractTest {
     public void findAll() {
         List<Report> reports = reportDAO.findAll();
         assertNotNull(reports);
-        assertEquals(1, reports.size());
+        assertEquals(2, reports.size());
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/syncope/blob/94846481/core/persistence-jpa/src/test/resources/domains/MasterContent.xml
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/resources/domains/MasterContent.xml b/core/persistence-jpa/src/test/resources/domains/MasterContent.xml
index 91d7c86..da1bfef 100644
--- a/core/persistence-jpa/src/test/resources/domains/MasterContent.xml
+++ b/core/persistence-jpa/src/test/resources/domains/MasterContent.xml
@@ -1212,7 +1212,8 @@ $$ }&#10;
   <Notification_events Notification_id="10" event="[CUSTOM]:[]:[]:[unexisting2]:[SUCCESS]"/>
     
   <NotificationTask_recipients notificationtask_id="8" address="recipient@prova.org"/>  
-  
+
+  <ReportTemplate name="empty"/>  
   <ReportTemplate name="sample"
                   htmlTemplate="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;
 &lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;&#10;
@@ -2312,6 +2313,10 @@ $$ }&#10;
   <ReportletConfInstance id="1" Report_id="1" 
                          serializedInstance='{"@class":"org.apache.syncope.common.lib.report.UserReportletConf","name":"testUserReportlet","matchingCond":null,"plainAttrs":["fullname","gender"],"derAttrs":["cn"],"virAttrs":["virtualdata"],"features":["key","username","workflowId","status","creationDate","lastLoginDate","changePwdDate","passwordHistorySize","failedLoginCount","memberships","resources"]}'/>
   <ReportExec Report_id="1" id="1" status="SUCCESS" start="2012-02-26 15:40:04" end="2012-02-26 15:41:04"/>
+
+  <Report id="2" name="reconciliation" active="1" template_name="empty"/>
+  <ReportletConfInstance id="2" Report_id="2" 
+                         serializedInstance='{"@class":"org.apache.syncope.common.lib.report.ReconciliationReportletConf","name":"dashboardReconciliationReportlet","userMatchingCond":null,"groupMatchingCond":null,"anyObjectMatchingCond":null,"features":["key","username","groupName"]}'/>
   
   <SyncopeLogger logName="syncope.audit.[REST]:[EntitlementLogic]:[]:[getOwn]:[SUCCESS]" logLevel="DEBUG" logType="AUDIT"/>
   

http://git-wip-us.apache.org/repos/asf/syncope/blob/94846481/fit/core-reference/src/test/java/org/apache/syncope/fit/cli/CLIITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/cli/CLIITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/cli/CLIITCase.java
index 33e3ad3..07b9747 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/cli/CLIITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/cli/CLIITCase.java
@@ -247,10 +247,10 @@ public class CLIITCase extends AbstractITCase {
             PROCESS_BUILDER.command(getCommand(
                     new ReportCommand().getClass().getAnnotation(Command.class).name(),
                     ReportCommand.ReportOptions.READ.getOptionName(),
-                    "2"));
+                    "72"));
             final Process process = PROCESS_BUILDER.start();
             final String result = IOUtils.toString(process.getInputStream());
-            assertTrue(result.contains("- Report 2 doesn't exist"));
+            assertTrue(result.contains("- Report 72 doesn't exist"));
 
             process.destroy();
         } catch (IOException e) {