Commit Graph

143 Commits

Author SHA1 Message Date
Tuna Aksoy
b786accb40 RM-2061 (Add classification properties to document details view)
RM-2062 (Add classification properties to record details view)

+review RM-29

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@102759 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-04-27 13:45:05 +00:00
Tuna Aksoy
718b2eec44 RM-2193 (Cannot classify non electronic document)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@102702 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-04-26 20:02:30 +00:00
Tom Page
0d01f1c83f RM-2045 Check that content is not re-classified.
Currently this is not supported, although it will be needed in the future.

Also take the opportunity to change the unit tests to use:
    when(x.y()).thenReturn(z));
rather than:
    doReturn(z).when(x).y();
This is because I noticed the javadoc for "doReturn" gives a good
explanation of when to use each (use the former whenever possible for
readability; use the latter if there's no choice).

+review RM-25

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@102231 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-04-21 08:06:31 +00:00
Tom Page
bf04115229 RM-2045 Fix references to "document" to refer to "content".
We can use the same API to classify documents and records.

+review RM-25

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@102160 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-04-20 09:04:01 +00:00
Tom Page
17ca9d431f RM-2045 Update unit test to use level ids, rather than levels.
+review RM-25

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@102158 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-04-20 08:39:08 +00:00
Tom Page
a572fe0916 RM-2045 Add validation that the node is a content node.
This is needed as the API method is specifically for content nodes. We
will deal with record nodes later, and possible folder nodes much later.

+review RM-25

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@102157 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-04-20 08:39:06 +00:00
Tuna Aksoy
f78917ea24 RM-2047 (Set classification repository action)
* Unit test added

+review RM-28

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@102153 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-04-19 19:49:22 +00:00
Tuna Aksoy
f1cefc629c RM-2045 (Java API to add a classification to a document)
* Changed the code to save the id's of classification reasons and levels
 
+ review RM-25

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@102118 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-04-17 13:18:11 +00:00
Tom Page
5542fc7c81 RM-2045 Create Java API to classify a document.
Create dedicated objects to handle queries against the list of configured
classification levels and reasons.

+review RM-25

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@101986 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-04-16 10:07:07 +00:00
Tuna Aksoy
e533c53f3d Fixed failing unit test
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@101803 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-04-14 12:51:47 +00:00
Tom Page
7d52c49b2b RM-1947 New constraint to avoid invalid classification levels.
Create a service locator class to allow the non-Spring constraint to access
the Spring service.

+review RM-21

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@101788 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-04-14 09:33:51 +00:00
Tuna Aksoy
2cfcc0ac05 RM-1842 (View users security clearance)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@101590 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-04-09 18:14:48 +00:00
Roy Wetherall
bf91f5e1a1 Reduce number of compilation warnings and re-format where nessesary.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@101538 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-04-09 01:58:11 +00:00
Tom Page
e6121166fc RM-1947 Restrict the classification levels shown to a user.
Currently we don't check what classification level the user has, and
instead assume that they have the highest security clearance. The work
to assign a security clearance to a user will be in RM-2112.

+review RM

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@101413 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-04-08 14:55:58 +00:00
Tom Page
27a0affb19 Rename ExceptionUtils.intercept to expectedException.
+review RM-10

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@101338 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-04-08 10:32:40 +00:00
Tom Page
c18089a3f0 RM-2028 Create util method to validate classification fields.
Also change the freemarker script to use the built-in JSON escaping.

+review RM-14

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@101242 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-04-07 13:55:42 +00:00
Tom Page
0f7bac797a RM-2028 Add new test file to test suite.
+review RM-14

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@101116 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-04-02 11:08:24 +00:00
Tom Page
1449f2163b RM-2028 Test for get classification reasons API.
+review RM-14

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@101108 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-04-02 10:02:58 +00:00
Tom Page
d0ca266dd8 RM-2027 Admin user is always "admin", system user is always "system".
+review RM-9

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@101018 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-04-01 07:35:11 +00:00
Tom Page
1ff6385d64 RM-2027 Use annotations to create mocks in unit tests.
+review RM-9

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@100783 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-03-31 10:09:31 +00:00
Tom Page
aa6c4aff42 RM-2027 Add option to specify user names in MockAuthenticationUtilHelper.
+review RM-9

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@100775 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-03-31 08:15:35 +00:00
Tom Page
9d6960cccd Wire the ClassificationServiceDAO using Spring injection.
Also small change to lower visibility of ClassificationServiceDAO member
variables from public to private.

+review RM @nmcerlean @rwetherall

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@100721 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-03-30 14:49:10 +00:00
Tom Page
aaf87ad0bf RM-2027 Make class logger static final.
Previously the logger wasn't final to allow it to be set for unit testing.
We're only testing it in the one test, so instead use a mock log4j appender
to check that the message is received.

+review RM-11

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@100717 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-03-30 14:15:24 +00:00
Tom Page
614eb89e52 Rename Configuration to ClassificationServiceDAO.
Also formatting changes as per code review comments.

+review RM-5

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@100687 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-03-30 09:13:32 +00:00
Tom Page
53fc89c3ae RM-2027 Unit testing for classification reason loading.
+review RM @nmcerlean

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@100355 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-03-27 16:43:59 +00:00
Neil McErlean
bfed925fa1 Forgot to add previous new tests to the suite. Doing that now.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@100312 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-03-27 12:16:59 +00:00
Neil McErlean
bd54d94886 Helper class for dealing with exceptions in test code and some test code to test it. All based on Java 8.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@100311 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-03-27 12:14:56 +00:00
Tom Page
a0635a4344 RM-2027 Refactor mock authentication code.
Create a new class to handle creation of the mock authentication util.
It would be nice to always use it as a factory to create a mock util, but
unfortunately this causes many of the existing unit tests to fail. Something
clever is happening in org.mockito.MockitoAnnotations.initMocks(Object) that
I currently don't understand.

+review RM

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@100292 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-03-27 11:30:20 +00:00
Neil McErlean
8ba7667e65 Work on RM-2027. Addition of the Java API code to retrieve classification reasons and some of the test code associated with that. WIP. Test code not complete. +review RM
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@100255 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-03-27 09:27:20 +00:00
Neil McErlean
de4cf99217 Refactoring test code to separate it from BaseUnitTest. RM-2027. +review RM
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@100172 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-03-26 15:07:28 +00:00
Tom Page
f4997f59f7 RM-2074 Bootstrap initial classification reasons.
+review RM

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@100134 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-03-26 10:43:48 +00:00
Neil McErlean
523f5dca4f Second and final tranche of post-code-review changes for RM-1945 & RM-1946.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@100094 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-03-25 19:39:09 +00:00
Tom Page
073b02c89b Add explicit mention that the mocked methods are generics using Objects.
These five lines were causing errors for me using Eclipse configured to
the Sun jdk1.8. Apparently there was no issue in IntelliJ and everything
worked fine from the command line before and after.

+review RM

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@100076 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-03-25 15:31:08 +00:00
Neil McErlean
3eea37206e First updates following code review on RM-1945 & RM-1946. Thanks Roy & Tom!
Renamed a public service method to getClassificationLevels.
Removed a redundant test method.
Code tidying.
Various internal renames to help readability.
Slight javadoc improvements.
Also some trivial changes like fixing typos and copyright years etc.
Removing warnings from within AuthenticationUtil blocks allows IntelliJ to fold them to Java 8 closure format. (fistpump).  


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@100020 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-03-24 21:15:22 +00:00
Neil McErlean
540ef1f1e0 More tidyup following RM-1945 & RM-1946. The maven-based build did not define a test-resources directory for unit-test code. Now it does.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@100018 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-03-24 20:19:33 +00:00
Neil McErlean
52c9c95980 Added unit tests to test suite for RM-1945 and RM-1946.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@99995 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-03-24 17:06:34 +00:00
Neil McErlean
2de84b9b21 Initial creation of ClassificationService, as part of RM-1945 and RM-1946.
This check-in adds the basic ClassificationService API, its initial implementation, ClassificationServiceImpl, along with some basic support types such as ClassificationServiceException (for service-specific exceptions) and Configuration.
It also adds unit tests ClassificationServiceImplUnitTest and ConfigurationUnitTest.

The ClassificationService begins our support for ‘Classified Records’, whereby Alfresco content can be given a ClassificationLevel and thereafter will only be accessible to users with the appropriate security clearance.

The vanilla service includes a default set, rm-classification-levels.json (Top Secret etc) which links through to the i18n’d display data via rm-classification.properties in the usual way.

The service is defined in its own spring context file, rm-classified-records-context.xml, as it is distinct from the file plan and should be applicable to content outside that file plan.



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@99932 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-03-23 18:22:26 +00:00
Roy Wetherall
4fc222e655 Merged V2.2 to V2.3:
99471: RM-2058: RM Manager can't access Users and Groups (after upgarde)



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.3@99472 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-03-16 00:17:26 +00:00
Roy Wetherall
e1015363a7 Prevent incompatiable disposition schedules from being linked together
* the unpredicatable behaviour was caused by this incompatibility and the resulting uncertaintity over which level of dispostion would 'win'
  * RM-1963: It is not possible to cut off record scheduled for cut off if it's linked to a folder with disposition schedule with cut off step set on folder.
  * RM-1962: The disposition schedule steps are not working as expected on a record linked to a folder with disposition schedule on it's own.



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.3@97948 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-02-25 00:25:33 +00:00
Roy Wetherall
82e316d5aa RM-1956: Create record capability allows user to edit metadata and copy category/folder /record
* fixes issue relating to filing records with only CreateRecord capability



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.3@97945 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-02-24 21:38:10 +00:00
Roy Wetherall
df742d4fb0 Attempt to fix failing Unit Tests that are passing locally.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.3@97788 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-02-24 00:07:08 +00:00
Roy Wetherall
bc2c837ba2 RM-1972: Methods with invalid policy are granted access
* invalid policy defintions now throw exception .. previously they just granted!
  * invalid capability definitions now throw exception .. previously they abstained with no message
  * reference to RM.Write removed and replaced with RM.Create or more appropriate permission check
  * adjustments to hold capabilities since they wheren't being exercised as we thought
  * ManageAccessRights no longer checks for frozen .. you should be able to manage the permissions of an object if it's frozen and you have the capability
  * Unit tests for new code and adjustments
  * Tweaks to existing integration tests where required



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.3@97786 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-02-23 23:02:09 +00:00
Roy Wetherall
3149f07011 RM-1864: New version is created when "Declare as version record"
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.3@97108 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-02-16 02:08:54 +00:00
Tuna Aksoy
c6e7607a15 RM-978 (Unable to navigate to copied folder from a collaboration site to RM site)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.3@94453 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2015-01-30 13:17:30 +00:00
Tuna Aksoy
28bb4d318c RM-1771 (SOLR dependent integration tests failing)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@91835 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2014-12-04 22:22:04 +00:00
Roy Wetherall
de993aea84 RM-1541: Unlink Record
* unlink added to Record Service
 * unit test for Record Service extended to include link and unlink methods
 * Unlink action added
 * unit test for Unlink action added



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@91551 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2014-12-02 07:30:21 +00:00
Roy Wetherall
9f2b174a23 RM-1763: Record Contributors Group
* if configured, RECORD_CONTRIBUTOR group controls who can declare records within collaboration sites



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@91414 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2014-12-01 00:48:51 +00:00
Tuna Aksoy
40c7736a1d Updated RM dependency to 5.0.0-SNAPSHOT
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@90990 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2014-11-24 18:02:11 +00:00
Roy Wetherall
b13f5073df Add missing mocked service
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@90355 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2014-11-13 05:34:56 +00:00
Roy Wetherall
636f45ec5c RM-1757: Record is not renamed when filed by rule
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@90353 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2014-11-13 03:45:55 +00:00