mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged BRANCHES/V2.3 to HEAD:
95095: RM-1851 (Audit: the "Role" for "Declare as version record" is not displayed) 95096: RM-1877 (Audit: Timestamp in audit details not in ISO format) 95684: RM-1878 (Audit: Create person event displays a wrong text and link) 95688: RM-1879 (Audit: Delete object event displays wrong path for different browser languages other than English) 95689: RM-1879 (Audit: Delete object event displays wrong path for different browser languages other than English) 95690: RM-1881 (Audit: Location information in event details is not consistent) 95691: RM-1882 (Audit: Audit view event should not show any location information) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@95692 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -13,4 +13,5 @@ rm.audit.audit-stop=Audit Stop
|
|||||||
rm.audit.audit-clear=Audit Clear
|
rm.audit.audit-clear=Audit Clear
|
||||||
rm.audit.audit-view=Audit View
|
rm.audit.audit-view=Audit View
|
||||||
rm.audit.trail-file-fail=Can't generate audit report.
|
rm.audit.trail-file-fail=Can't generate audit report.
|
||||||
rm.audit.audit-report=Audit Report
|
rm.audit.audit-report=Audit Report
|
||||||
|
recordable-version-config=Auto-Declare Options
|
@@ -85,4 +85,9 @@
|
|||||||
<property name="label" value="rm.audit.fileTo"/>
|
<property name="label" value="rm.audit.fileTo"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
|
<bean id="audit-event.recordableVersionConfig" parent="audit-event" class="org.alfresco.module.org_alfresco_module_rm.audit.event.RecordableVersionPolicyAuditEvent">
|
||||||
|
<property name="name" value="recordableVersionConfig"/>
|
||||||
|
<property name="label" value="recordable-version-config"/>
|
||||||
|
</bean>
|
||||||
|
|
||||||
</beans>
|
</beans>
|
||||||
|
@@ -27,9 +27,9 @@ import static org.apache.commons.logging.LogFactory.getLog;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.alfresco.module.org_alfresco_module_rm.action.AuditableActionExecuterAbstractBase;
|
|
||||||
import org.alfresco.module.org_alfresco_module_rm.version.RecordableVersionPolicy;
|
import org.alfresco.module.org_alfresco_module_rm.version.RecordableVersionPolicy;
|
||||||
import org.alfresco.repo.action.ParameterDefinitionImpl;
|
import org.alfresco.repo.action.ParameterDefinitionImpl;
|
||||||
|
import org.alfresco.repo.action.executer.ActionExecuterAbstractBase;
|
||||||
import org.alfresco.service.cmr.action.Action;
|
import org.alfresco.service.cmr.action.Action;
|
||||||
import org.alfresco.service.cmr.action.ParameterDefinition;
|
import org.alfresco.service.cmr.action.ParameterDefinition;
|
||||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||||
@@ -46,7 +46,7 @@ import org.apache.commons.logging.Log;
|
|||||||
* @author Tuna Aksoy
|
* @author Tuna Aksoy
|
||||||
* @since 2.3
|
* @since 2.3
|
||||||
*/
|
*/
|
||||||
public class RecordableVersionConfigAction extends AuditableActionExecuterAbstractBase
|
public class RecordableVersionConfigAction extends ActionExecuterAbstractBase
|
||||||
{
|
{
|
||||||
/** Logger */
|
/** Logger */
|
||||||
private static Log LOGGER = getLog(RecordableVersionConfigAction.class);
|
private static Log LOGGER = getLog(RecordableVersionConfigAction.class);
|
||||||
|
@@ -1410,17 +1410,25 @@ public class RecordsManagementAuditServiceImpl extends AbstractLifecycleBean
|
|||||||
json.put("fullName", entry.getFullName() == null ? "": entry.getFullName());
|
json.put("fullName", entry.getFullName() == null ? "": entry.getFullName());
|
||||||
json.put("nodeRef", entry.getNodeRef() == null ? "": entry.getNodeRef());
|
json.put("nodeRef", entry.getNodeRef() == null ? "": entry.getNodeRef());
|
||||||
|
|
||||||
if (entry.getEvent().equals("createPerson") && entry.getNodeRef() != null)
|
// TODO: Find another way for checking the event
|
||||||
|
if (entry.getEvent().equals("Create Person") && entry.getNodeRef() != null)
|
||||||
{
|
{
|
||||||
NodeRef nodeRef = entry.getNodeRef();
|
NodeRef nodeRef = entry.getNodeRef();
|
||||||
String userName = (String)nodeService.getProperty(nodeRef, ContentModel.PROP_USERNAME);
|
String userName = (String)nodeService.getProperty(nodeRef, ContentModel.PROP_USERNAME);
|
||||||
json.put("nodeName", userName == null ? "": userName);
|
json.put("nodeName", userName == null ? "": userName);
|
||||||
|
json.put("createPerson", true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
json.put("nodeName", entry.getNodeName() == null ? "": entry.getNodeName());
|
json.put("nodeName", entry.getNodeName() == null ? "": entry.getNodeName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Find another way for checking the event
|
||||||
|
if (entry.getEvent().equals("Delete RM Object"))
|
||||||
|
{
|
||||||
|
json.put("deleteObject", true);
|
||||||
|
}
|
||||||
|
|
||||||
json.put("nodeType", entry.getNodeType() == null ? "": entry.getNodeType());
|
json.put("nodeType", entry.getNodeType() == null ? "": entry.getNodeType());
|
||||||
json.put("event", entry.getEvent() == null ? "": getAuditEventLabel(entry.getEvent()));
|
json.put("event", entry.getEvent() == null ? "": getAuditEventLabel(entry.getEvent()));
|
||||||
json.put("identifier", entry.getIdentifier() == null ? "": entry.getIdentifier());
|
json.put("identifier", entry.getIdentifier() == null ? "": entry.getIdentifier());
|
||||||
|
@@ -0,0 +1,58 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2005-2014 Alfresco Software Limited.
|
||||||
|
*
|
||||||
|
* This file is part of Alfresco
|
||||||
|
*
|
||||||
|
* Alfresco is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* Alfresco is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
|
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package org.alfresco.module.org_alfresco_module_rm.audit.event;
|
||||||
|
|
||||||
|
import static org.alfresco.module.org_alfresco_module_rm.version.RecordableVersionModel.PROP_RECORDABLE_VERSION_POLICY;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.alfresco.repo.node.NodeServicePolicies.OnUpdatePropertiesPolicy;
|
||||||
|
import org.alfresco.repo.policy.annotation.Behaviour;
|
||||||
|
import org.alfresco.repo.policy.annotation.BehaviourBean;
|
||||||
|
import org.alfresco.repo.policy.annotation.BehaviourKind;
|
||||||
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
|
import org.alfresco.service.namespace.QName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Audits recordable version policy property updates
|
||||||
|
*
|
||||||
|
* @author Tuna Aksoy
|
||||||
|
* @since 2.3
|
||||||
|
*/
|
||||||
|
@BehaviourBean
|
||||||
|
public class RecordableVersionPolicyAuditEvent extends AuditEvent implements OnUpdatePropertiesPolicy
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @see org.alfresco.repo.node.NodeServicePolicies.OnUpdatePropertiesPolicy#onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef, java.util.Map, java.util.Map)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Behaviour
|
||||||
|
(
|
||||||
|
kind = BehaviourKind.CLASS,
|
||||||
|
type = "cm:cmobject"
|
||||||
|
)
|
||||||
|
public void onUpdateProperties(NodeRef nodeRef, Map<QName, Serializable> before, Map<QName, Serializable> after)
|
||||||
|
{
|
||||||
|
if (before.get(PROP_RECORDABLE_VERSION_POLICY) != after.get(PROP_RECORDABLE_VERSION_POLICY))
|
||||||
|
{
|
||||||
|
recordsManagementAuditService.auditEvent(nodeRef, getName(), before, after, true, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user