mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Merge branch 'master' into feature/RM-5723_EditClassificationPossibleForPostRequest
# Conflicts: # rm-enterprise/rm-enterprise-repo/src/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/securitymarks/UpdateSecurityMarksPolicyTest.java
This commit is contained in:
63
CONTRIBUTING.md
Normal file
63
CONTRIBUTING.md
Normal file
@@ -0,0 +1,63 @@
|
||||
# How to contribute
|
||||
For the details on the Records Management project see [here](https://community.alfresco.com/docs/DOC-6387-project-overview-records-management).
|
||||
|
||||
## Getting started
|
||||
What you need to get started:
|
||||
|
||||
* A [Jira](https://issues.alfresco.com/jira/projects/ALF/issues/?filter=allopenissues) account;
|
||||
|
||||
* A [GitHub](https://github.com/) account.
|
||||
|
||||
Useful but not necessary:
|
||||
|
||||
* An [Alfresco community](https://community.alfresco.com/) account - this is a good place to ask questions and find answers.
|
||||
|
||||
## Making changes
|
||||
|
||||
We use Jira to track issues. If you are committing a fix for a raised issue please include the ticket number in both the merge requests and the git commit messages.
|
||||
For example a fix for the ticket [ALF-21953](https://issues.alfresco.com/jira/browse/ALF-21953) might have the git commit message: "ALF-21953 Updated to use super pom v9".
|
||||
|
||||
If you are adding in a new feature or bug fix please do so [here](https://issues.alfresco.com/jira/projects/ALF/issues/?filter=allopenissues). By raising a ticket in this project you will be agreeing to the Alfresco Contribution Agreement which can be found at the bottom of the 'Create Issue' form or alternatively attached to [this](https://community.alfresco.com/docs/DOC-7070-alfresco-contribution-agreement) page.
|
||||
|
||||
When you are ready to make a change you just need to fork the [records-management](https://github.com/Alfresco/records-management) repository and then make your changes into your copy of the code.
|
||||
|
||||
We have a set of standards we follow when writing code. These can be found [here](https://community.alfresco.com/docs/DOC-4658-coding-standards).
|
||||
|
||||
When formatting your change please try not to change the format of any other code as this can make the changes difficult to spot and please make sure to use the correct line ending (we use LF).
|
||||
|
||||
We ask that when adding/changing code you also add/change the appropriate unit tests and that these tests all run before creating the pull request (these will be run as part of the request, it just saves time if you know they will pass beforehand).
|
||||
|
||||
If you are adding any user facing strings be advised these may be change after being reviewed by a member of our UA team. For UI consistency please write to these [guidelines](http://docs.alfresco.com/sites/docs.alfresco.com/files/public/docs_team/u2/Alfresco-Writing-Guide.pdf).
|
||||
|
||||
## Submitting changes
|
||||
|
||||
When you create a pull request we will run the unit tests using [Travis](https://travis-ci.org/Alfresco/records-management). If these pass a member of the team will look over the change and then assuming there are no issues will accept your change. If there are any issue we will discuss this with you using the pull request.
|
||||
|
||||
It really helps speed up the review process if you include a description of the change in the pull request.
|
||||
|
||||
After your change has been accepted you can add it to the page [here](https://community.alfresco.com/docs/DOC-5279-featured-contributions) to let other members of the community know. A community account is required to update this page.
|
||||
|
||||
Occasionally we may have to revert a change after it has been accepted. This will usually be caused by failing integration or UI tests. If this happens to you then feel free to get in touch for more information.
|
||||
|
||||
## Additional info and links
|
||||
|
||||
[Alfresco coding standards](https://community.alfresco.com/docs/DOC-4658-coding-standards)
|
||||
|
||||
[Alfresco community contributions page](https://community.alfresco.com/docs/DOC-5279-featured-contributions)
|
||||
|
||||
[Alfresco community site](https://community.alfresco.com/)
|
||||
|
||||
[Alfresco contribution agreement](https://community.alfresco.com/docs/DOC-7070-alfresco-contribution-agreement)
|
||||
|
||||
[Alfresco writing guidelines](http://docs.alfresco.com/sites/docs.alfresco.com/files/public/docs_team/u2/Alfresco-Writing-Guide.pdf)
|
||||
|
||||
[GitHub "Records Management" code repository](https://github.com/Alfresco/records-management)
|
||||
|
||||
[IDE settings for Eclipse and Intellij](https://github.com/Alfresco/records-management/tree/master/ide-config)
|
||||
|
||||
[Jira project for raising issues/features](https://issues.alfresco.com/jira/projects/ALF/issues/?filter=allopenissues)
|
||||
|
||||
[Jira project used by GS team](https://issues.alfresco.com/jira/projects/RM/issues)
|
||||
|
||||
[Records Management project details](https://community.alfresco.com/docs/DOC-6387-project-overview-records-management)
|
||||
|
@@ -155,7 +155,10 @@ public class RecordCategoryType extends BaseBehaviourBean
|
||||
public Void doWork()
|
||||
{
|
||||
// setup vital record definition
|
||||
vitalRecordService.setupVitalRecordDefinition(child);
|
||||
if(nodeService.exists(child))
|
||||
{
|
||||
vitalRecordService.setupVitalRecordDefinition(child);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -190,7 +193,10 @@ public class RecordCategoryType extends BaseBehaviourBean
|
||||
public Void doWork()
|
||||
{
|
||||
// setup record category permissions
|
||||
filePlanPermissionService.setupRecordCategoryPermissions(childAssocRef.getChildRef());
|
||||
if(nodeService.exists(childAssocRef.getChildRef()))
|
||||
{
|
||||
filePlanPermissionService.setupRecordCategoryPermissions(childAssocRef.getChildRef());
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
@@ -54,6 +54,7 @@ import org.alfresco.module.org_alfresco_module_rm.recordfolder.RecordFolderServi
|
||||
import org.alfresco.module.org_alfresco_module_rm.relationship.RelationshipService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.report.ReportService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.role.FilePlanRoleService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.role.Role;
|
||||
import org.alfresco.module.org_alfresco_module_rm.search.RecordsManagementSearchService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.ExtendedSecurityService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.security.FilePlanPermissionService;
|
||||
@@ -173,6 +174,9 @@ public abstract class BaseRMTestCase extends RetryingTransactionHelperTestCase
|
||||
protected InplaceRecordService inplaceRecordService;
|
||||
protected RelationshipService relationshipService;
|
||||
|
||||
/** test utils */
|
||||
protected UserAndGroupsUtils userAndGroupsUtils;
|
||||
|
||||
/** test data */
|
||||
protected String siteId;
|
||||
protected StoreRef storeRef;
|
||||
@@ -340,6 +344,7 @@ public abstract class BaseRMTestCase extends RetryingTransactionHelperTestCase
|
||||
// Get the application context
|
||||
applicationContext = ApplicationContextHelper.getApplicationContext(getConfigLocations());
|
||||
utils = new CommonRMTestUtils(applicationContext);
|
||||
userAndGroupsUtils = new UserAndGroupsUtils(applicationContext);
|
||||
|
||||
// Initialise the service beans
|
||||
initServices();
|
||||
|
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2017 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
* -
|
||||
* 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/>.
|
||||
* #L%
|
||||
*/
|
||||
|
||||
package org.alfresco.module.org_alfresco_module_rm.test.util;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.role.FilePlanRoleService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.role.Role;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.security.AuthorityService;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
|
||||
/**
|
||||
* Test utils class containing methods for managing user, groups and roles
|
||||
*
|
||||
* @author Ana Manolache
|
||||
* @since 2.6
|
||||
*/
|
||||
public class UserAndGroupsUtils
|
||||
{
|
||||
protected FilePlanRoleService filePlanRoleService;
|
||||
protected AuthorityService authorityService;
|
||||
|
||||
/**
|
||||
* @param applicationContext the application context
|
||||
*/
|
||||
public UserAndGroupsUtils(ApplicationContext applicationContext)
|
||||
{
|
||||
filePlanRoleService = (FilePlanRoleService) applicationContext.getBean("FilePlanRoleService");
|
||||
authorityService = (AuthorityService) applicationContext.getBean("AuthorityService");
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a user to an RM role
|
||||
*
|
||||
* @param userName the username of the user to add to the role
|
||||
* @param role the role to add the user to
|
||||
*/
|
||||
public void addUserToRole(NodeRef filePlan, String userName, RMRole role)
|
||||
{
|
||||
// Find the authority for the given role
|
||||
Role roleObj = filePlanRoleService.getRole(filePlan, role.getGroupName());
|
||||
assertNotNull("Notification role " + role.getGroupName() + " could not be retrieved", roleObj);
|
||||
String roleGroup = roleObj.getRoleGroupName();
|
||||
assertNotNull("Notification role group " + roleGroup + " can not be null.", roleGroup);
|
||||
|
||||
// Add user to notification role group
|
||||
authorityService.addAuthority(roleGroup, userName);
|
||||
}
|
||||
|
||||
/**
|
||||
* An enum of RM Roles
|
||||
*/
|
||||
public enum RMRole
|
||||
{
|
||||
RM_ADMINISTRATOR("Administrator"),
|
||||
RM_MANAGER("RecordsManager"),
|
||||
RM_POWER_USER("PowerUser"),
|
||||
RM_SECURITY_OFFICER("SecurityOfficer"),
|
||||
RM_USER("User");
|
||||
|
||||
private String groupName;
|
||||
|
||||
private RMRole(String groupName)
|
||||
{
|
||||
this.groupName = groupName;
|
||||
}
|
||||
|
||||
public String getGroupName()
|
||||
{
|
||||
return this.groupName;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user