Compare commits

..

395 Commits

Author SHA1 Message Date
Travis CI User
cf905313e3 [maven-release-plugin][skip ci] prepare release 9.40 2023-01-26 19:35:33 +00:00
tiagosalvado10
aa611b2885 [MNT-23414] Bulk import - convert empty values to null for certain types (#1688) (#1707)
(cherry picked from commit 781f045503)
2023-01-26 19:03:18 +00:00
Travis CI User
473237460f [maven-release-plugin][skip ci] prepare for next development iteration 2022-11-13 16:03:53 +00:00
Travis CI User
c2775e3d3d [maven-release-plugin][skip ci] prepare release 9.39 2022-11-13 16:03:50 +00:00
Vítor Moreira
9681d99bf4 MNT-22807: improve sitesTest test (#925) (#951)
(cherry picked from commit 1b42d80f94)
(cherry picked from commit 30e339db12)
2022-11-13 12:30:48 +00:00
tiagosalvado10
616604a4ef [MNT-23158] Scripts limits configuration and optimization (#1519) (#1553)
(cherry picked from commit f391cfa38c)
2022-11-11 21:52:48 +00:00
Travis CI User
e2596492d5 [maven-release-plugin][skip ci] prepare for next development iteration 2022-08-30 11:24:20 +00:00
Travis CI User
659bcf5393 [maven-release-plugin][skip ci] prepare release 9.38 2022-08-30 11:24:18 +00:00
Antonio Felix
872f7c80e9 Fix/mnt 23087 export of records failing (#1333) (#1341)
* MNT-23087 - Split the export list into several smaller list for better performance

(cherry picked from commit 9c98f7b0fb)
2022-08-30 11:40:33 +01:00
Travis CI User
b8ef25b059 [maven-release-plugin][skip ci] prepare for next development iteration 2022-07-14 23:53:56 +00:00
Travis CI User
abdeddcabf [maven-release-plugin][skip ci] prepare release 9.37 2022-07-14 23:53:54 +00:00
tiagosalvado10
4aa2f30cf6 [ACS-3271] Update MySQL 5.7.23 tests to 5.7.28 version (#1209) (#1220)
* ACS-3271 Update MySQL 5.7.23 tests to 5.7.28 version (#1209)

(cherry picked from commit 3990bc9db4)

Co-authored-by: Damian Ujma <92095156+damianujma@users.noreply.github.com>
2022-07-14 23:44:40 +01:00
Travis CI User
5984d62107 [maven-release-plugin][skip ci] prepare for next development iteration 2022-04-21 15:02:08 +00:00
Travis CI User
0035c997ca [maven-release-plugin][skip ci] prepare release 9.36 2022-04-21 15:02:06 +00:00
evasques
b9686dc9b2 MNT-22968 Bump freemarker and ACS-1970 (#1079)
* Bump freemarker
* ACS-1970 Switch to the alfresco/alfresco-base-tomcat:9.0.52-java-11-centos-7 base image (#693)
(cherry picked from commit 507c6b2ed8)

Co-authored-by: Piotr Żurek <Piotr.Zurek@hyland.com>
2022-04-21 14:17:07 +01:00
Travis CI User
3e16565272 [maven-release-plugin][skip ci] prepare for next development iteration 2022-01-17 10:44:48 +00:00
Travis CI User
154efed2eb [maven-release-plugin][skip ci] prepare release 9.35 2022-01-17 10:44:45 +00:00
evasques
956ce6c1a2 MNT-22758 - Bump surf webscripts to 8.27 (#873) 2022-01-17 08:57:23 +00:00
Travis CI User
c68be19071 [maven-release-plugin][skip ci] prepare for next development iteration 2021-12-10 10:44:29 +00:00
Travis CI User
bcda52f5e2 [maven-release-plugin][skip ci] prepare release 9.34 2021-12-10 10:44:26 +00:00
evasques
d92603ef2b MNT-22715 - Document Version Issue (#837)
* MNT-22715 - Document Version Issue (#831)

* MNT-22715 - Document Version Issue - Unexpected: current version does not appear to be 1st version in the list
* Set association index on new version creation
* Unit test to verify the child assoc index is set on versions
* Set association index on new version creation on AGS create record from version

(cherry picked from commit c9e98b4833)

* MNT-22715 - Setting Version Child Assoc Index Configurable (#836)

* Added configuration to use child association index on version creation - disabled by default
* Added unit test to verify both cenarios
* Included configuration in AGS

(cherry picked from commit d729443b71)
2021-12-10 09:33:22 +00:00
Travis CI User
9f1abd5db0 [maven-release-plugin][skip ci] prepare for next development iteration 2021-08-31 15:59:57 +00:00
Travis CI User
c4f567e7ba [maven-release-plugin][skip ci] prepare release 9.33 2021-08-31 15:59:54 +00:00
alandavis
dd03941907 "ACS-1907/MNT-22536 TMDQ against MySql throws SQLException in certain situations (#679)"
(cherry picked from commit 070f727495)

Also include travis changes to make it easier to skip repo, tas, db and also use latest db
2021-08-31 16:30:37 +01:00
Travis CI User
b5ee3c06a9 [maven-release-plugin][skip ci] prepare for next development iteration 2021-07-26 19:24:22 +00:00
Travis CI User
5b6d080e8a [maven-release-plugin][skip ci] prepare release 9.32 2021-07-26 19:24:16 +00:00
evasques
e03c8a72d1 PRODSEC-4421 - Bump surf-webscripts to 8.22 (#626) 2021-07-26 19:14:06 +01:00
Travis CI User
70e7f68a4b [maven-release-plugin][skip ci] prepare for next development iteration 2021-07-22 11:21:12 +00:00
Travis CI User
19053341b8 [maven-release-plugin][skip ci] prepare release 9.31 2021-07-22 11:21:07 +00:00
evasques
24c41b97cc PRODSEC-4422 - Scripts not in Data Dictionary can be executed by action (#596) (#617)
* Added validation to the ScriptActionExecuter class to enforce the existing constraints on parameter script-ref (Repo has the constraint to only allow scripts in Data Dictionary / Scripts and AGS has the constraint to only allow scripts in Data Dictionary / Records Management / Records Management Scripts") by validating if the given scriptRef is in the allowed valued of the constraint set on that param
* Added a new unit test for AGS to make sure that rmscript action still works as expected when the script is in the correct folder and fails when not
* Added new case in ActionServiceImpl2Test#testExecuteScript to assert that the transaction fails when we execute the action with an invalid script
* Moved test testActionResult from ActionServiceImplTest to class ActionServiceImpl2Test - Before it ran with a script not in Data Dictionary so with the added validation it started to fail. I moved the unit test do avoid duplicating the code to create the script in the correct location.

(cherry picked from commit ac4a1643e1)
2021-07-22 11:51:16 +01:00
dcerbo
97de175cde Revert "SEARCH-2878 Update the supported for SearchService (#587)" [ci skip]
This reverts commit 0077d31b
2021-07-15 15:12:33 +02:00
Travis CI User
6a719bb5f6 [maven-release-plugin][skip ci] prepare for next development iteration 2021-07-15 08:15:45 +00:00
Travis CI User
b8a3724ee7 [maven-release-plugin][skip ci] prepare release 9.30 2021-07-15 08:15:40 +00:00
Davide
0077d31bed SEARCH-2878 Update the supported for SearchService (#587) 2021-07-15 09:46:53 +02:00
Travis CI User
342bd5a103 [maven-release-plugin][skip ci] prepare for next development iteration 2021-07-14 14:45:46 +00:00
Travis CI User
d848e12981 [maven-release-plugin][skip ci] prepare release 9.29 2021-07-14 14:45:35 +00:00
Travis CI User
9cb2b23ef5 [maven-release-plugin][skip ci] prepare for next development iteration 2021-07-09 23:02:38 +00:00
Travis CI User
7db90ee90c [maven-release-plugin][skip ci] prepare release 9.28 2021-07-09 23:02:33 +00:00
Davide
9d0106e000 SEARCH-2878 Update the supported for SearchService to 2.0.2-RC2 (#588) 2021-07-09 22:13:07 +01:00
Travis CI User
26c991a563 [maven-release-plugin][skip ci] prepare for next development iteration 2021-07-09 16:48:11 +00:00
Travis CI User
ddfabba4ba [maven-release-plugin][skip ci] prepare release 9.27 2021-07-09 16:48:05 +00:00
Jamal Kaabi-Mofrad
ab7d757412 AUTH-532: Upgrade Keycloak client to match IDS-1.5.0 2021-07-09 16:50:24 +01:00
Travis CI User
fe028f5b85 [maven-release-plugin][skip ci] prepare for next development iteration 2021-07-09 11:45:43 +00:00
Travis CI User
2baf1b9c91 [maven-release-plugin][skip ci] prepare release 9.26 2021-07-09 11:45:38 +00:00
tiagosalvado10
3818f94268 ACS-1734 Remove libreofficeToPdf + libreofficeToPdfBoxViaPdf (#577)
* ACS-1734 Remove broken transformerFailover from libreofficeToPdf (#572)

(cherry picked from commit 0d09a048da)

* ACS-1734 Remove libreofficeToPdf + Update libreofficeToPdfBoxViaPdf (#573)

(cherry picked from commit 38d66b69bb)

Co-authored-by: David Edwards <david.edwards@alfresco.com>
2021-07-08 13:11:41 +01:00
Travis CI User
53b41068d4 [maven-release-plugin][skip ci] prepare for next development iteration 2021-07-06 10:30:20 +00:00
Travis CI User
c302bc31ff [maven-release-plugin][skip ci] prepare release 9.25 2021-07-06 10:30:14 +00:00
Tom Page
9a30044064 SEARCH-2909 Return Http Status Code 501 (Not Implemented) in REST API… (#519) (#561)
* SEARCH-2909 Return Http Status Code 501 (Not Implemented) in REST API for invocations to Search Services that are not supported.

* SEARCH-2909 Refactor exception mapping to simplify QueryParserException.

* SEARCH-2909 Add unit tests for postQuery.

This includes a test for the status code replacement with unsupported operations.

* SEARCH-2909 Add new unit test file to test suite.

Also add copyright header to test class.

Co-authored-by: Tom Page <thomas.page@alfresco.com>
(cherry picked from commit f1a5425f62)

Co-authored-by: Angel Borroy <48685308+aborroy@users.noreply.github.com>
2021-07-06 09:37:55 +01:00
Travis CI User
41edced9f1 [maven-release-plugin][skip ci] prepare for next development iteration 2021-06-29 11:40:14 +00:00
Travis CI User
15ca9e21be [maven-release-plugin][skip ci] prepare release 9.24 2021-06-29 11:40:09 +00:00
alandavis
36bf6d2f81 Bump camel-amqp 3.7.1 to 3.7.4 and netty 4.1.58.Final to 4.1.60.Final #567
(cherry picked from commit acb155739a)
2021-06-29 10:11:18 +01:00
Travis CI User
cf01f167ae [maven-release-plugin][skip ci] prepare for next development iteration 2021-06-26 07:30:30 +00:00
Travis CI User
4c94059bbf [maven-release-plugin][skip ci] prepare release 9.23 2021-06-26 07:30:25 +00:00
Alex Mukha
5efe11008d SEARCH-2876 Update Solr 2.0.2-RC1 (#564) 2021-06-26 01:40:06 +01:00
Travis CI User
3225eefd0b [maven-release-plugin][skip ci] prepare for next development iteration 2021-06-25 20:22:19 +00:00
Travis CI User
b6de89aa8d [maven-release-plugin][skip ci] prepare release 9.22 2021-06-25 20:22:14 +00:00
alandavis
4cc1c10ce5 MNT-21902 minor fixes to logic added in REPO-5549
(cherry picked from commit 0445ba9c93)
2021-06-25 18:38:11 +01:00
Travis CI User
7641c128c5 [maven-release-plugin][skip ci] prepare for next development iteration 2021-06-25 13:08:07 +00:00
Travis CI User
a62ad8715e [maven-release-plugin][skip ci] prepare release 9.21 2021-06-25 13:08:00 +00:00
tiagosalvado10
542f189907 [MNT-21611] Removed HTML transformation pipelines (with LibreOffice). Added new HTML pipelines via TEXT (#391) (#553)
(cherry picked from commit a8959b98c1)
2021-06-24 15:35:57 +01:00
Travis CI User
a006b5acaf [maven-release-plugin][skip ci] prepare for next development iteration 2021-06-21 19:46:34 +00:00
Travis CI User
c2e516b69a [maven-release-plugin][skip ci] prepare release 9.20 2021-06-21 19:46:28 +00:00
evasques
2c5044896b MNT-21837 - License expires 23h earlier - correction (#544) (#547)
* period.getMillis() (joda lib) returns an int instead of a long, so on larger periods (like 30days) we get an error that the value cannot fit in an int
* Changed the validation to only calculate the remaining milliseconds in the edge case of the remaining days being zero (as both 23h before and 23h after correspond to 0 remaining days)
* Added a unit test that validates the usage 60 days up from the licence expiring to validate the problem stops occurring
* Added a unit test that validates the usage 30 days after the licence expiring to cover all use cases

(cherry picked from commit 6e1d25a8f0)
2021-06-21 17:11:34 +01:00
Alan Davis
24454afe6b MNT-22388 [Security] multiple pdfbox vulnerabilities (Repo) (#539) (#548)
* Remove pdfbox jars as they should no longer be needed.
* Reintroduce tests that use Tika to 'guess' mimetypes as it was the tika parse that was pulling in the pdfbox libraries.

Classes that use Tika:
* HTMLRenderingEngine - removed as it is no longer used
* RemoteConnectorResponseImpl - called tika utility toByteArray so not using pdfbox
* TikaCharsetFinder - called to identify the charset not mimetype so not using pdfbox
* MimetypeMap - main use of Tika. Used to detect mimetypes. Might have been using pdfbox.

Cherry pick from master (7.1.0)
2021-06-21 16:42:33 +01:00
Travis CI User
aec55ed8a6 [maven-release-plugin][skip ci] prepare for next development iteration 2021-06-18 15:32:20 +00:00
Travis CI User
ddd5a4ae48 [maven-release-plugin][skip ci] prepare release 9.19 2021-06-18 15:32:15 +00:00
evasques
e523245a10 MNT-21837 License expires 23h earlier (#541) (#543)
* MNT-21837 - License expires 23h earlier
* Original problem is that the remaining time to license expires is calculated in days (long, not double) and anything less then 24h computes to 0 days. The validation for license being valid is that the remaining days is more than zero.
* Added method calculateMs in DateUtil class to return the interval in ms considering 2 given dates and respective timezones
* Changed the validation to use the remaining milliseconds value instead of remaining days
* Added unit test where license expires 6 hours from now - repo is not supposed to enter read-only mode
* Added unit test where license expired 1 minute ago - repo is supposed to enter read-only mode

* Removed unused import

(cherry picked from commit 630cd99067)
2021-06-18 15:34:35 +01:00
Travis CI User
c4217b32fb [maven-release-plugin][skip ci] prepare for next development iteration 2021-06-17 17:23:28 +00:00
Travis CI User
2fbd21076f [maven-release-plugin][skip ci] prepare release 9.18 2021-06-17 17:23:22 +00:00
alandavis
cb1419b140 Use alfresco/alfresco-base-tomcat:9.0.45-java-11-centos-8 2021-06-17 17:51:42 +01:00
Travis CI User
9a6c6f2ee9 [maven-release-plugin][skip ci] prepare for next development iteration 2021-06-17 11:30:48 +00:00
Travis CI User
eaff930456 [maven-release-plugin][skip ci] prepare release 9.17 2021-06-17 11:30:42 +00:00
evasques
4a03e8cc98 MNT-20500 - Admin console breaks with serialised objects (#538)
* MNT-20500 - Admin console breaks with serialised objects (#291)

* Added macro convertToJSON to recursively parse hashes and enumerables
* Added attempt/recover in macros to handle errors and not break the page
* Changed the output of serialized objects to JSON format

(cherry picked from commit ce62fb1da3)

* MNT-20500 - Admin console breaks with serialised objects (#536)

* In node browser:
** Added macro convertToJSON to recursively parse hashes and enumerables
** Added attempt/recover in macros to handle errors and not break the page
** Changed the output of serialized objects to JSON format
* In both admin console and node browser:
** Adjusted consistency of the ouput when an error occurs
** Validate the depth of each hash. When we find a hash with over 1000 elements, we throw an error instead of displaying the object. Used the stop tag to effectively force an abort of the template processing preventing performance or security issues regarding very large objects.

(cherry picked from commit d7ec130756)
2021-06-17 12:00:17 +01:00
Travis CI User
0eaeea35f8 [maven-release-plugin][skip ci] prepare for next development iteration 2021-06-11 16:08:16 +00:00
Travis CI User
f4c632c26b [maven-release-plugin][skip ci] prepare release 9.16 2021-06-11 16:08:11 +00:00
alandavis
3c96ed9482 Bump woodstox-core from 6.2.5 to 6.2.6 (#393)
(cherry picked from commit fdfb7d170d)
2021-06-11 16:34:19 +01:00
Travis CI User
0141284b37 [maven-release-plugin][skip ci] prepare for next development iteration 2021-06-10 19:56:14 +00:00
Travis CI User
2c8ed7f4b5 [maven-release-plugin][skip ci] prepare release 9.15 2021-06-10 19:56:09 +00:00
alandavis
decbe6b285 dependabot changes from master plus tidyup 2021-06-10 17:44:25 +01:00
alandavis
f0f538bad0 ACS-1520 : Upgrade trashcan-cleaner
(cherry picked from commit fe64c8cc60)
[skip ci]
2021-06-10 17:16:46 +01:00
alandavis
c0aaf75284 ATS-912: Bump to T-Core 2.4.0 (#441)
(cherry picked from commit 6f35fddab7)
[skip ci]
2021-06-10 17:13:33 +01:00
Travis CI User
7f5889474e [maven-release-plugin][skip ci] prepare for next development iteration 2021-06-07 14:55:20 +00:00
Travis CI User
11c6125760 [maven-release-plugin][skip ci] prepare release 9.14 2021-06-07 14:55:14 +00:00
cturlica
ba4effc6ec Merge remote-tracking branch 'origin/release/7.0.N' into release/7.0.N 2021-06-07 17:16:07 +03:00
cturlica
3f52aec2dc MNT-22186: propTablesCleanupJobDetail v2 can cause Out of Memory
Cherry-picked f201f35 b7828c0 from master to release/7.0.N
2021-06-07 17:13:13 +03:00
Travis CI User
eb3df043be [maven-release-plugin][skip ci] prepare for next development iteration 2021-06-07 11:38:58 +00:00
Travis CI User
c5aed167f4 [maven-release-plugin][skip ci] prepare release 9.13 2021-06-07 11:38:52 +00:00
cturlica
a477c19e9a ACS-1648: update dejavu-fonts version from 2.35-6.el8 to 2.35-7.el8 2021-06-07 14:10:20 +03:00
Travis CI User
1497362d3e [maven-release-plugin][skip ci] prepare for next development iteration 2021-06-02 14:38:23 +00:00
Travis CI User
27e2775e40 [maven-release-plugin][skip ci] prepare release 9.12 2021-06-02 14:38:18 +00:00
dependabot-preview[bot]
f2ecce0f46 Bump dependency.tika.version from 1.25 to 1.26 (#366) 2021-06-02 15:05:22 +01:00
Travis CI User
0ad54cbf77 [maven-release-plugin][skip ci] prepare for next development iteration 2021-05-28 11:50:12 +00:00
Travis CI User
3e3cd479c2 [maven-release-plugin][skip ci] prepare release 9.11 2021-05-28 11:50:08 +00:00
Nana Insaidoo
b9b41a10e8 MNT-22385 Cmis query GetTotalNumItems is returning wrong value (#504)
* Changes made to correct the value of totalItems when performing a TMDQ

* Fixes after review

- Slight change was made to NodePermissionAssessor to log when permission
  limits are exceeded

* Now pre-computing maxPermissionChecks value as per review suggestion

(cherry picked from commit cb636d1140)
2021-05-28 11:01:25 +01:00
Travis CI User
664d0b9704 [maven-release-plugin][skip ci] prepare for next development iteration 2021-05-25 09:32:12 +00:00
Travis CI User
1493b02d8d [maven-release-plugin][skip ci] prepare release 9.10 2021-05-25 09:32:08 +00:00
evasques
70c1a1279c MNT-22316 - Added pathInfo length validation before attempting substring (#487) (#491)
(cherry picked from commit e4cdae71e1)
2021-05-25 09:45:14 +01:00
tiagosalvado10
f0638e8d7d [MNT-20006] Obtaining the site as system in order to allow the activity record when an user is not member of a site (#459) 2021-05-24 12:47:55 +01:00
Travis CI User
983dd47c35 [maven-release-plugin][skip ci] prepare for next development iteration 2021-05-17 17:38:03 +00:00
Travis CI User
24d092cb02 [maven-release-plugin][skip ci] prepare release 9.9 2021-05-17 17:37:57 +00:00
alandavis
ddb299ab03 MNT-22409 Legacy transformer fails to generate multi-page TIFF preview
Originally fixed on 6.2.N. A couple of the Legacy classes no longer exist so changes are not on master. Changes to the renditions, default page limit and test still apply.

(cherry picked from commit 9d276aed7081e0078ed3f7f01dabdec20c599bfe)
2021-05-17 17:38:35 +01:00
Dharan
19d214fcb0 [MNT-22183] Use absolute paths for stylesheets (#383) (#458)
* [MNT-22183] Use absolut paths for stylesheets

* added slash

* added context prefix

Co-authored-by: dhrn <dharan.g@muraai.com>

Co-authored-by: davidcanonieto <david.cano.nieto@gmail.com>
2021-05-13 21:19:04 +05:30
Travis CI User
870ff8cc64 [maven-release-plugin][skip ci] prepare for next development iteration 2021-05-11 13:20:37 +00:00
Travis CI User
aed08fe5d9 [maven-release-plugin][skip ci] prepare release 9.8 2021-05-11 13:20:33 +00:00
alandavis
a3b0541560 Feature/search 2802 shared secret auth (#382)
* SEARCH-2802: Filter HTTP requests (now "none" and "secret" communication methods are available) from X509 Web Filter.

* SEARCH-2802: HttpClientFactory (for Repository and Search Services clients) support for Shared Secret communication.

* SEARCH-2802: Fix HttpClientFactory base unit tests.

(cherry picked from commit 20dd0efc6f)
2021-05-11 13:16:50 +01:00
alandavis
2f6c5614c3 MNT-22295 - FixedACLJob not processing all nodes due to unordered results (#359)
* Added method selectNodesWithAspects that accepts a boolean as param to order values
* Added param ordered to IdsEntity class
* Added optional ordered param to the query template that orderes the results by node id in asc order
* Added method getNodesWithAspects that accepts a boolean as param to order values in nodeDAO
* FixedACLUpdater Job calls the new getNodesWithAspects, with the ordered param as true

(cherry picked from commit 3a495f7b3f)
[skip ci]
2021-05-11 13:15:20 +01:00
alandavis
82d3828351 MNT-21898 Unexpected ACLs when job runs Fix (#344)
* On move node, verify if parent has pending acl aspect applied and consider the pending shared ACL to update inheritance to avoid ending up with mixed permissions as children of pending acl nodes do not have the correct acls and when moved, keep their wrong acl.
* Add public method setInheritanceForChildren that receives an additional param: forceSharedACL. If an unexpected ACL occurs in a child, it can be overridden by setting it.
* Implement method setInheritanceForChildren that receives an additional parameter: forceSharedACL
* Add method setFixedAcls that receives an additional parameter: forceSharedACL - When a child node has an unexpected ACL, setting this parameter to true will force it to assume the new shared ACL instead of throwing a concurrency exception. When the shared ACL is forces, a warning is thrown in the log informing on what node exactly are we forcing the ACL. This is only possible when the child ACL is type SHARED and when it has an unexpected ACL
* All methods that called setFixedAcls without the new parameter will continue to operate as normal, as having forceSharedACL=false
* Added property forceSharedACL to the FixedACLUpdaterJob. If set to true it will force shared ACL to propagate through children even if there is an unexpected ACL
* When there is a exception detected when doing setInheritanceForChildren on the job, catch and log the error, but do not rollback the entire batch
* On copy/move unit tests I changed the ACL of the target folders on copy and move tests so that the old shared ACL accessed was never the same for origin and target folders as happens when performing these operations between sites
* Added unit test to verify fix for MNT-21898 - testAsyncWithNodeMoveChildToChildPendingFolder
* Added unit test to verify system property for the job: forceSharedACL - testAsyncWithErrorsForceSharedACL

(cherry picked from commit ace87c9c3b)
[skip ci]
2021-05-11 13:13:43 +01:00
alandavis
c986498481 MNT-21694 fix test 2021-05-11 13:06:33 +01:00
alandavis
c93d81379e MNT-21694 500 error on new logo upload with Legacy transforms (#284)
The TransformationOptionsConverter class did not convert the newer transform option format a Map<String, String> to the legacy ImageTransformationOptions class that contains the commandOption (OPT_COMMAND_OPTIONS) property. As a result no legacy transformer is asked if it can do the transform.

There are no Legacy transformers in ACS 7, so this fix cannot be applied there as the class has been removed. Fixing on 6.2.N.

(cherry picked from commit 3a8cb74f26)
[skip ci]
2021-05-11 12:58:59 +01:00
Travis CI User
d348e0b72d [maven-release-plugin][skip ci] prepare for next development iteration 2021-05-10 17:00:36 +00:00
Travis CI User
dc5e7405cc [maven-release-plugin][skip ci] prepare release 9.7 2021-05-10 17:00:30 +00:00
alandavis
3c8bb7f154 Create release/7.0.N branch for 7.0.1
* Still need to cherry pick commits already merged to 6.2.N
2021-05-10 17:21:01 +01:00
Travis CI User
bb8d42d23c [maven-release-plugin][skip ci] prepare for next development iteration 2021-04-21 22:09:48 +00:00
Travis CI User
9c1aa53819 [maven-release-plugin][skip ci] prepare release 8.425 2021-04-21 22:09:43 +00:00
Travis CI User
885f4a49a5 [maven-release-plugin][skip ci] prepare for next development iteration 2021-04-12 10:35:00 +00:00
Travis CI User
9989ec3260 [maven-release-plugin][skip ci] prepare release 8.424 2021-04-12 10:34:55 +00:00
Alan Davis
78ad14b696 Bugfix/repo 5610 events are not actually sent to activemq (#360) (#380)
Original issue was ACS-1291, however the original commit for this on master was reverted and then later included in REPO-5610

REPO-5610 events are not actually sent to activemq (#360)
*   Add events tests
*  Polished put test: connects to JMS via TCP and validate that the event sent is also received back
*  Now the tests provides a simple main() that listens on the topic, useful for quick debug sessions
*  Now the user name is collected in the calling thread, so that the sendEvent does not silently fails
*  Apply changes following review
*  Now using queue system to guarantee events order
*  Add license
*  Updated logs and corrected comments
*  Remove empty methods
*  Now catering for spurious events at startup when database is bootstrapped
*  Now preserving the txn-id in all events
*  Moved up definitions in events2.xml after PR feedback
Co-authored-by: Bruno Bossola bruno@meterian.com
(cherry picked from commit 046116d)

Backport to alfresco-enterprise-repo will also include fixes for MNT-22301 Query Accelerator - datetime & stores
2021-04-12 10:56:08 +01:00
Travis CI User
8ae2009c13 [maven-release-plugin][skip ci] prepare for next development iteration 2021-03-09 20:11:25 +00:00
Travis CI User
df92479664 [maven-release-plugin][skip ci] prepare release 8.423 2021-03-09 20:11:20 +00:00
Gloria Camino
40133c350e Fixed typo for CPUs in SPANISH (#342) 2021-03-09 18:24:23 +00:00
Travis CI User
f0c95819ad [maven-release-plugin][skip ci] prepare for next development iteration 2021-03-09 16:14:43 +00:00
Travis CI User
1b3ae47b98 [maven-release-plugin][skip ci] prepare release 8.422 2021-03-09 16:14:38 +00:00
Alan Davis
6a017abf3e ATS-876 Update to T-Engine (#341) 2021-03-09 15:16:01 +00:00
dependabot-preview[bot]
19767d2fc7 Bump dependency.transform.model.version from 1.3.0 to 1.3.1 (#340) 2021-03-08 23:23:51 +00:00
Travis CI User
77935da9df [maven-release-plugin][skip ci] prepare for next development iteration 2021-03-08 17:41:39 +00:00
Travis CI User
80612db4e3 [maven-release-plugin][skip ci] prepare release 8.421 2021-03-08 17:41:34 +00:00
araschitor
49b652f696 feature/APPS-update-dependencies:Removed suffix google-drive and aos version from pom (#339) 2021-03-08 18:57:31 +02:00
Travis CI User
999ce58b43 [maven-release-plugin][skip ci] prepare for next development iteration 2021-03-08 08:26:37 +00:00
Travis CI User
2bf41ccfea [maven-release-plugin][skip ci] prepare release 8.420 2021-03-08 08:26:33 +00:00
Denis Ungureanu
f485581d5e ACS-855 : Long running patch in ACS 7.0.0.A2 upgrade (#338)
- revert  changes (sql and schema reference files) done in REPO-4547
2021-03-08 09:49:38 +02:00
Travis CI User
a4bf9b5e47 [maven-release-plugin][skip ci] prepare for next development iteration 2021-03-05 12:35:24 +00:00
Travis CI User
1fde058fc4 [maven-release-plugin][skip ci] prepare release 8.419 2021-03-05 12:35:20 +00:00
Alan Davis
d60cd5ed1c ACS-1180 ACS 7 Stacks: MySQL 8 (#336) 2021-03-05 11:37:47 +00:00
Travis CI User
f77ceb2072 [maven-release-plugin][skip ci] prepare for next development iteration 2021-03-05 11:09:00 +00:00
Travis CI User
b072d935aa [maven-release-plugin][skip ci] prepare release 8.418 2021-03-05 11:08:55 +00:00
Ancuta Morarasu
2b03e2bbf0 ACS-1201: Model integrity violation saving properties (#332)
- Fix the name property persistence in ContentModelFormProcessor to only save when the property value is actually changed. This prevents the FilenameFilteringInterceptor to be called when there are no changes to the file name.
2021-03-05 12:32:10 +02:00
Travis CI User
748272bcde [maven-release-plugin][skip ci] prepare for next development iteration 2021-03-05 09:20:48 +00:00
Travis CI User
3aad844812 [maven-release-plugin][skip ci] prepare release 8.417 2021-03-05 09:20:44 +00:00
Alan Davis
1e5188a4a7 ACS-1071 revision not set in version.properties (#335) 2021-03-05 08:42:28 +00:00
Andreea Nechifor
f5e5093ead Update webscript version (#333) 2021-03-05 10:05:07 +02:00
Stefan Kopf
fef8cc9256 ACS-1217 Additional option for SOLR to authenticate with a shared secret (#334)
Co-authored-by: Alex Mukha <alex.mukha@alfresco.com>
2021-03-04 18:49:49 +01:00
Travis CI User
2e6b40d8c7 [maven-release-plugin][skip ci] prepare for next development iteration 2021-03-04 15:59:43 +00:00
Travis CI User
4be06a5e20 [maven-release-plugin][skip ci] prepare release 8.416 2021-03-04 15:59:36 +00:00
Nithin Nambiar
f7ecb45991 MNT-22184 Add security header for admin console (#323) 2021-03-04 15:21:35 +00:00
Travis CI User
6349b6ff7b [maven-release-plugin][skip ci] prepare for next development iteration 2021-03-04 08:35:16 +00:00
Travis CI User
16c998ca94 [maven-release-plugin][skip ci] prepare release 8.415 2021-03-04 08:35:09 +00:00
Simona C
a37bf29faa Upgrade TAS restapi (#327) 2021-03-04 09:58:20 +02:00
dependabot-preview[bot]
42d14c2abe Bump acs-event-model from 0.0.11 to 0.0.12 (#328)
Bumps [acs-event-model](https://github.com/Alfresco/acs-event-model) from 0.0.11 to 0.0.12.
- [Release notes](https://github.com/Alfresco/acs-event-model/releases)
- [Commits](https://github.com/Alfresco/acs-event-model/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-03-04 07:58:35 +01:00
dependabot-preview[bot]
8544f6f90e Bump restapi from 1.55 to 1.56 (#330) 2021-03-03 22:56:39 +00:00
alandavis
ee7936334e Remove commented out section [skip ci] 2021-03-03 17:15:14 +00:00
Travis CI User
50a1e87962 [maven-release-plugin][skip ci] prepare for next development iteration 2021-03-03 08:40:10 +00:00
Travis CI User
0266dfec6a [maven-release-plugin][skip ci] prepare release 8.414 2021-03-03 08:40:04 +00:00
Simona C
e0ce4ddf42 Upgrade TAS restapi (#322) 2021-03-03 10:02:15 +02:00
Travis CI User
783f0fad55 [maven-release-plugin][skip ci] prepare for next development iteration 2021-03-02 14:55:32 +00:00
Travis CI User
6ea080d819 [maven-release-plugin][skip ci] prepare release 8.413 2021-03-02 14:55:26 +00:00
dhrn
1bb233405b [REPO-5552] TAS aspect/type api (#319)
* [REPO-5552] TAS initial commit

* [REPO-5552] * model added

* [REPO-5552] * revert comments

* [REPO-5552] * minor conventions fixes

* [REPO-5552] * minor update
2021-03-02 19:48:34 +05:30
Travis CI User
9af54e1dc4 [maven-release-plugin][skip ci] prepare for next development iteration 2021-03-02 00:22:34 +00:00
Travis CI User
3a2119cbd2 [maven-release-plugin][skip ci] prepare release 8.412 2021-03-02 00:22:28 +00:00
dependabot-preview[bot]
c3476a725f Bump restapi from 1.52 to 1.53 (#321) 2021-03-01 23:47:05 +00:00
Lucian Tuca
30baf81b44 REPO-5571 (#320)
- fixed minor stuff around logging
2021-03-01 16:42:35 +02:00
Travis CI User
c60268eae4 [maven-release-plugin][skip ci] prepare for next development iteration 2021-02-27 10:46:59 +00:00
Travis CI User
5911315c4d [maven-release-plugin][skip ci] prepare release 8.411 2021-02-27 10:46:53 +00:00
alandavis
2294a87908 REPO-5376 Query Accelerator add simple timings, having remove temporary timing code 2021-02-27 09:10:58 +00:00
Travis CI User
75d6722efd [maven-release-plugin][skip ci] prepare for next development iteration 2021-02-26 10:04:16 +00:00
Travis CI User
bcd72f35d0 [maven-release-plugin][skip ci] prepare release 8.410 2021-02-26 10:04:07 +00:00
CezarLeahu
3a5cedd418 Improve the ACS build scripts (#316)
- update build_functions.sh
- remove unnecessary checks during the build
- update the build.sh script in ACS packaging to match a simpler pom.xml
2021-02-26 09:10:40 +00:00
dhrn
5a4fbbe095 * fix random failing erors while calling aspect api (#313) 2021-02-26 08:18:47 +00:00
Travis CI User
fc89ed17f2 [maven-release-plugin][skip ci] prepare for next development iteration 2021-02-26 08:08:22 +00:00
Travis CI User
064e87a4aa [maven-release-plugin][skip ci] prepare release 8.409 2021-02-26 08:08:16 +00:00
CezarLeahu
4e50446c4e ACS-1253 Remove ignored JMX namespace argument on Camel context (#314) 2021-02-26 09:33:05 +02:00
Travis CI User
e5ca36936c [maven-release-plugin][skip ci] prepare for next development iteration 2021-02-25 21:21:31 +00:00
Travis CI User
6f0c21662e [maven-release-plugin][skip ci] prepare release 8.408 2021-02-25 21:21:25 +00:00
Andreea Nechifor
1a5aa34d3d APPS-692: after properties removed. (#315) 2021-02-25 20:45:46 +02:00
Travis CI User
24f2737255 [maven-release-plugin][skip ci] prepare for next development iteration 2021-02-25 14:35:15 +00:00
Travis CI User
0cbbe42369 [maven-release-plugin][skip ci] prepare release 8.407 2021-02-25 14:35:09 +00:00
Lucian Tuca
1f4666076d REPO-5571 : Add tempFileCleanerTrigger configurations to be able to limit the job duration/quantity
- fixed log order
2021-02-25 15:26:02 +02:00
Travis CI User
d2f21bcea1 [maven-release-plugin][skip ci] prepare for next development iteration 2021-02-24 22:05:27 +00:00
Travis CI User
5d3c4730ec [maven-release-plugin][skip ci] prepare release 8.406 2021-02-24 22:05:20 +00:00
Alan Davis
299003c0c7 ACS-1183 ACS 7 Stacks: PostgreSQL (#312)
Upgraded the version of PostgreSQL to the latest (13.1) in all tests that are not db specific
Switch to new Jira url for gitbugtrack
2021-02-24 21:34:29 +00:00
Travis CI User
d0c93dc170 [maven-release-plugin][skip ci] prepare for next development iteration 2021-02-24 16:20:17 +00:00
Travis CI User
c1002b8684 [maven-release-plugin][skip ci] prepare release 8.405 2021-02-24 16:20:11 +00:00
Lucian Tuca
43410785a5 REPO-5571 : Add tempFileCleanerTrigger configurations to be able to limit the job duration/quantity
- fixed log order
2021-02-24 17:30:13 +02:00
Travis CI User
2cbd2d98d4 [maven-release-plugin][skip ci] prepare for next development iteration 2021-02-24 13:09:43 +00:00
Travis CI User
1b768f7c1f [maven-release-plugin][skip ci] prepare release 8.404 2021-02-24 13:09:37 +00:00
araschitor
cdec3f2f93 fix/APPS-update-webscripts-version to 8.17 (#309) 2021-02-24 12:54:32 +02:00
Travis CI User
aaf2b32d02 [maven-release-plugin][skip ci] prepare for next development iteration 2021-02-23 17:28:05 +00:00
Travis CI User
2ce490042a [maven-release-plugin][skip ci] prepare release 8.403 2021-02-23 17:27:59 +00:00
Alan Davis
e88aab47f7 REPO-5376 Query Accelerator Remove all temporary code (#308)
* REPO-5376 Remove all temporary code

* Remove DBStats, SingleTaskRestartableWatch
* Remove propertiesCache and aspectsCache from DBQueryEngine as they were marked as temporary

* Remove further temporary code

Co-authored-by: Nana Insaidoo <insaidoo.nana@yahoo.it>
2021-02-23 16:54:58 +00:00
Travis CI User
36937eaad7 [maven-release-plugin][skip ci] prepare for next development iteration 2021-02-23 14:11:56 +00:00
Travis CI User
2f043eac24 [maven-release-plugin][skip ci] prepare release 8.402 2021-02-23 14:11:50 +00:00
Lucian Tuca
fd7adefe27 REPO-5571 : Change the tempFileCleanerTrigger to work at scale (#293)
* REPO-5571 : Change the tempFileCleanerTrigger to work at scale
    - added nr of files and time limits
2021-02-23 15:41:06 +02:00
dhrn
cf91e0afe0 [REPO-5552] more filtering capablities for aspect/type api (#301)
* * more filter implementation

* * aspect test case added

* * fixed coments and more test added

* * comments fixed

* * import and data fixed

* * removed unnecessary filter
2021-02-23 09:56:37 +00:00
Travis CI User
1394442d93 [maven-release-plugin][skip ci] prepare for next development iteration 2021-02-22 23:22:54 +00:00
Travis CI User
9f00a2b561 [maven-release-plugin][skip ci] prepare release 8.401 2021-02-22 23:22:47 +00:00
dependabot-preview[bot]
07891b2765 Bump mockito-core from 3.7.7 to 3.8.0 (#307) 2021-02-22 22:51:55 +00:00
Travis CI User
2a781e364b [maven-release-plugin][skip ci] prepare for next development iteration 2021-02-19 13:24:49 +00:00
Travis CI User
95ab60263c [maven-release-plugin][skip ci] prepare release 8.400 2021-02-19 13:24:43 +00:00
CezarLeahu
bb19c61253 ACS-1253 Enable Camel JMX management (#295)
- enable Camel JMX management
- disable JMS connection idle timeout
- update ActiveMQ broker URLs to use NIO
2021-02-19 14:52:28 +02:00
dependabot-preview[bot]
6f17779e71 Bump postgresql from 42.2.18 to 42.2.19 (#300) 2021-02-19 11:24:41 +00:00
Andrea Gazzarini
1ff90242b0 [SEARCH-2677] Extract SearchEngineResultSet and SearchEngineResultMetadata interfaces (#286)
* [SEARCH-2677] Extract SearchEngineResultSet and SearchEngineResultMetadata interfaces

* [SEARCH-2677] Scan the ResultSet decorator chain for a maximum of 3 nested levels
2021-02-19 12:09:40 +01:00
Travis CI User
de18900d90 [maven-release-plugin][skip ci] prepare for next development iteration 2021-02-19 08:18:49 +00:00
Travis CI User
6360842e06 [maven-release-plugin][skip ci] prepare release 8.399 2021-02-19 08:18:43 +00:00
Cristian Turlica
cee63b31f6 ACS-1264: Content Model changes dynamically updated to node caches across a cluster deadlock (#289)
Re enabling changes disabled in ACS-936 we can see deadlock in asynchronouslyRefreshedCacheThreadPool (AbstractAsynchronouslyRefreshedCache).

There should be no reason to be calling the dictionary destroy method before the doCall() finishes...and it is the use of the destroy method that carries the risk of deadlock.

Proposed fix: the liveLock is used for the doCall() method, this will stop deadlock from external calls to dictionary destroy() while doCall is in progress.

Removed invalidating cache fix (e.g. fix the issue where cluster nodes could have null values and other nodes had default value… so no properly invalidated on node startup). This fix was moved in ClusteringBootstrap as the initial one was causing issues.
2021-02-19 09:46:36 +02:00
Travis CI User
a74cdea223 [maven-release-plugin][skip ci] prepare for next development iteration 2021-02-19 00:12:19 +00:00
Travis CI User
e53b61d2bf [maven-release-plugin][skip ci] prepare release 8.398 2021-02-19 00:12:14 +00:00
alandavis
cad18795fd ATS-862 2.3.8 T-Engines
* T-Engines 2.3.8
2021-02-18 23:41:21 +00:00
Travis CI User
14e43ed825 [maven-release-plugin][skip ci] prepare for next development iteration 2021-02-18 20:21:58 +00:00
Travis CI User
2ee3b2085a [maven-release-plugin][skip ci] prepare release 8.397 2021-02-18 20:21:52 +00:00
Alan Davis
a7935b0d08 ATS-862 2.3.8 T-Engines (#297)
* alfresco-transform-model 1.3.0
2021-02-18 19:50:59 +00:00
Travis CI User
557a666fd3 [maven-release-plugin][skip ci] prepare for next development iteration 2021-02-18 19:50:25 +00:00
Travis CI User
87b7d524ea [maven-release-plugin][skip ci] prepare release 8.396 2021-02-18 19:50:19 +00:00
pieCit87
43daee3529 Feature/apps 703 bumps gdrive 3.2.1-A2 (#296) 2021-02-18 21:19:59 +02:00
Travis CI User
c9638187a1 [maven-release-plugin][skip ci] prepare for next development iteration 2021-02-18 09:49:44 +00:00
Travis CI User
659e2baef8 [maven-release-plugin][skip ci] prepare release 8.395 2021-02-18 09:49:38 +00:00
pieCit87
fb2035e82e bump of gdrive and aos (#294) 2021-02-18 11:16:40 +02:00
Travis CI User
366e4b23bf [maven-release-plugin][skip ci] prepare for next development iteration 2021-02-17 17:18:52 +00:00
Travis CI User
5f6734728e [maven-release-plugin][skip ci] prepare release 8.394 2021-02-17 17:18:46 +00:00
David Edwards
371791a0bb ACS-1185 Update activemq image to 5.16.1 (#292) 2021-02-17 16:49:12 +00:00
Travis CI User
b2d65d6ac1 [maven-release-plugin][skip ci] prepare for next development iteration 2021-02-15 16:57:56 +00:00
Travis CI User
69dca8f852 [maven-release-plugin][skip ci] prepare release 8.393 2021-02-15 16:57:50 +00:00
dhrn
4d73b11d12 show model in the aspect/type api (#285) 2021-02-15 11:29:23 +00:00
Travis CI User
582235dacf [maven-release-plugin][skip ci] prepare for next development iteration 2021-02-13 18:22:25 +00:00
Travis CI User
fbac196c19 [maven-release-plugin][skip ci] prepare release 8.392 2021-02-13 18:22:19 +00:00
dependabot-preview[bot]
fc2cde41ad Bump woodstox-core from 6.2.3 to 6.2.4 (#287) 2021-02-12 22:48:38 +00:00
Travis CI User
685c4b0844 [maven-release-plugin][skip ci] prepare for next development iteration 2021-02-10 23:31:57 +00:00
Travis CI User
06d00e5193 [maven-release-plugin][skip ci] prepare release 8.391 2021-02-10 23:31:51 +00:00
montgolfiere
3ad33034f1 MNT-14308: CMIS - optionally request rendition(s) when uploading docs - part 2 (#283)
* MNT-14308: CMIS - optionally request rendition(s) when uploading docs - part 2

- note: PublicApiAlfrescoCmisServiceFactory extends AlfrescoCmisServiceFactory and overrides getCmisServiceTarget
- hence, also ensure property (cmis.create.doc.request.renditions.set) is set for public rest api spring context

- note: set following log4j.properties: log4j.logger.org.alfresco.opencmis=info

* MNT-14308: CMIS - optionally request rendition(s) when uploading docs - part 2

- tweak info log to output property on init (since service currently instantiated on every call)

- note: set following log4j.properties: log4j.logger.org.alfresco.opencmis=info
2021-02-10 20:37:57 +00:00
Travis CI User
e6e710751e [maven-release-plugin][skip ci] prepare for next development iteration 2021-02-09 19:30:10 +00:00
Travis CI User
fe649b3302 [maven-release-plugin][skip ci] prepare release 8.390 2021-02-09 19:30:01 +00:00
alandavis
fb322089ab ACS-1186 ACS 7 Stacks: Application Server (Tomcat)
* Repo images now based on tomcat 9 & centos 8 rather than 8.5.51 and 7. Java 11 openjdk  remains the same.
* Needed to change versions of fonts installed to support the Activiti worflow diagram generator as the previous versions were centos-7 specific.
2021-02-09 18:59:58 +00:00
Travis CI User
d6ad134d4c [maven-release-plugin][skip ci] prepare for next development iteration 2021-02-08 15:56:13 +00:00
Travis CI User
9688dab484 [maven-release-plugin][skip ci] prepare release 8.389 2021-02-08 15:56:06 +00:00
Nana Insaidoo
e3dca6ecbd Apply changes to enable node ownership evaluation to happen on ent. as before (#279) 2021-02-08 15:21:44 +00:00
Travis CI User
8db3fc230e [maven-release-plugin][skip ci] prepare for next development iteration 2021-02-08 13:52:51 +00:00
Travis CI User
022519b5fd [maven-release-plugin][skip ci] prepare release 8.388 2021-02-08 13:52:44 +00:00
Gloria Camino
fafdfa6945 LOC-282 - FIX pending languages (Czech, Polish and Danish) plus FR amends (#278) 2021-02-08 13:18:32 +00:00
Travis CI User
d50f62906d [maven-release-plugin][skip ci] prepare for next development iteration 2021-02-08 11:24:37 +00:00
Travis CI User
ff34ca3d01 [maven-release-plugin][skip ci] prepare release 8.387 2021-02-08 11:24:30 +00:00
evasques
592dde531f MNT-22135 Filter policy to only run on admin auth - Unit test (#275)
Created unit test testIfGroupIsAdminAuthority to check if public method isAdminAuthority correctly validates groups:
* Verify it can identify GROUP_ALFRESCO_ADMINISTRATORS as an admin group
* Verify created groups (non administrators) and users are not considered administrators
* Add a subgroup to the parent group and verify if its still identified as non admin
* Add the group to the administrators group and verify if both group and subgroup are identified correctly as admins
* Add the user to the subgroup and verify if he's an admin
* Create a group with the same name as an admin user, group should not be identified as admin
2021-02-08 10:53:35 +00:00
Travis CI User
1776a43a30 [maven-release-plugin][skip ci] prepare for next development iteration 2021-02-08 10:49:25 +00:00
Travis CI User
5355592cb6 [maven-release-plugin][skip ci] prepare release 8.386 2021-02-08 10:49:18 +00:00
dhrn
08bc7d4599 [REPO-5317] integration test for REPO-5184 and REPO-5185 (#222) 2021-02-08 10:18:05 +00:00
Travis CI User
c54abf1b62 [maven-release-plugin][skip ci] prepare for next development iteration 2021-02-07 21:07:47 +00:00
Travis CI User
78aa6dc080 [maven-release-plugin][skip ci] prepare release 8.385 2021-02-07 21:07:41 +00:00
CezarLeahu
2171bcc192 ACS-1215 Update JMS/ActiveMQ configuration after the Camel 3.7 upgrade (#274)
- add an **activemq** messaging component bean (of type `org.apache.camel.component.activemq.ActiveMQComponent`)
- add a common **jmsConfig** bean to be used by all the three messaging component beans: **jms**, **activemq** and **amqp**
- exclude `activemq-broker` dependencies
- remove unnecessary messaging configuration
2021-02-07 22:35:21 +02:00
dependabot-preview[bot]
f6166297d3 Bump cmis from 1.26 to 1.27 (#276) 2021-02-05 22:41:57 +00:00
Travis CI User
b270ec1f8d [maven-release-plugin][skip ci] prepare for next development iteration 2021-02-05 10:26:07 +00:00
Travis CI User
d2b87f31c4 [maven-release-plugin][skip ci] prepare release 8.384 2021-02-05 10:26:00 +00:00
dhrn
0211392ff6 Aspect and Type api implementation (#261)
* initial commit

* * added match filters

* api completed

* * removed unwanted changes

* fixed test

* * fix consistant naming of class

* fixed comments

* * fixed comments

* * aspects fixed

* * types added

* * fixed tes and minor improvemment

* * fixed comments
2021-02-05 09:55:22 +00:00
Travis CI User
cc3c518940 [maven-release-plugin][skip ci] prepare for next development iteration 2021-02-04 23:10:36 +00:00
Travis CI User
465a1cec4d [maven-release-plugin][skip ci] prepare release 8.383 2021-02-04 23:10:30 +00:00
dependabot-preview[bot]
9858324d92 Bump utility from 3.0.41 to 3.0.42 (#273) 2021-02-04 22:40:37 +00:00
Travis CI User
727847b17e [maven-release-plugin][skip ci] prepare for next development iteration 2021-02-04 14:40:03 +00:00
Travis CI User
2979082767 [maven-release-plugin][skip ci] prepare release 8.382 2021-02-04 14:39:56 +00:00
Nana Insaidoo
a84a68cb9a Bugfix/APPS-766 classification children job not picking rm types (#272)
* Now handling System reading

* Address changes requested in PR #272
2021-02-04 13:00:18 +00:00
Nicolas Barithel
5cdade38a8 Fix MNT-21991 customizable personLookupProperties for REST API (#191)
* Fix MNT-21991 custom personLookupProperties

* Fix MNT-21991 test case for cm:owner
2021-02-02 10:36:52 -07:00
Travis CI User
072faf603e [maven-release-plugin][skip ci] prepare for next development iteration 2021-02-02 17:00:12 +00:00
Travis CI User
438dfa9d12 [maven-release-plugin][skip ci] prepare release 8.381 2021-02-02 17:00:04 +00:00
dependabot-preview[bot]
72be8daf01 Bump restapi from 1.51 to 1.52 (#267) 2021-02-02 16:24:45 +00:00
Travis CI User
ba9ae7071a [maven-release-plugin][skip ci] prepare for next development iteration 2021-02-01 15:56:01 +00:00
Travis CI User
48ec102598 [maven-release-plugin][skip ci] prepare release 8.380 2021-02-01 15:55:54 +00:00
montgolfiere
e8e2ded02a MNT-14308: CMIS - optionally request rendition(s) when uploading docs (#263)
* MNT-14308: CMIS - optionally request rendition(s) when uploading docs

- add new configurable option to request set of renditions when uploading via CMIS (none by default)
- note: in the event a client *relied* on previous behaviour (rather than dynamic requests) the property can be overridden & set to "doclib"

- add info message to show new property when initialising CMIS, ie. set of requested renditions set (empty by default)
- note: set following log4j.properties: log4j.logger.org.alfresco.opencmis=info
2021-02-01 10:43:37 +00:00
dependabot-preview[bot]
503b50738a Bump dependency.transform.model.version from 1.0.2.11 to 1.0.2.12 (#266) 2021-01-29 22:45:10 +00:00
dependabot-preview[bot]
8e90612619 Bump mariadb-java-client from 2.7.1 to 2.7.2 (#265) 2021-01-29 22:40:14 +00:00
Travis CI User
134ca108e9 [maven-release-plugin][skip ci] prepare for next development iteration 2021-01-29 21:24:36 +00:00
Travis CI User
af5c5133f6 [maven-release-plugin][skip ci] prepare release 8.379 2021-01-29 21:24:28 +00:00
Alan Davis
a903d9ec44 REPO-5549 Fix: Local transformer names must exist and be unique docli… (#264)
* REPO-5549 Fix: Local transformer names must exist and be unique doclib Read from ... when overriding a Local transform.

* Problem was that there were two conflicting pieces of code in play in the LocalTransformRegistry.register method. One that checked for duplicate T-Engine names and the other that allowed transforms to be overridden if they had the same name.
* The code checking for duplicate names needed an extra clause to only look at T-Engines (they have a T-Engine url associated with them).
* The code that overrode transforms then worked, but still had issues as the supported source to target mimetypes, priorities and max sizes were not cleared.
* It turned out to be simpler to split the original LocalTransformRegistry.register method into two. Extracting a new method into CombinedConfig.removeOverriddenOrInvalidTransformers that discarded invalid or overridden config before the list of supported source to target mimetypes was created rather than try to fix them up later. This is why there appear to be quite a few changes.
* More extensive unit tests were also added.
2021-01-29 20:04:55 +00:00
Travis CI User
2b1f63e07f [maven-release-plugin][skip ci] prepare for next development iteration 2021-01-28 08:51:32 +00:00
Travis CI User
1c1b956ad1 [maven-release-plugin][skip ci] prepare release 8.378 2021-01-28 08:51:25 +00:00
Alexandru-Eusebiu Epure
14ca5bb726 MNT-20775 : deleted-nodes with maxitems parameter take longer (#255)
* MNT-20775 : rest api /deleted-nodes with maxitems parameter take longer when there are more items in the trash can
  Based on offset and limit, returns only the required results from database
  Added count query for ArchivedNodes
2021-01-27 17:15:34 +02:00
Travis CI User
3d0099d742 [maven-release-plugin][skip ci] prepare for next development iteration 2021-01-26 13:14:54 +00:00
Travis CI User
fd491d83fe [maven-release-plugin][skip ci] prepare release 8.377 2021-01-26 13:14:47 +00:00
CezarLeahu
6ef30c46e9 ACS-1146 Replace *javax* dependencies with *jakarta* libraries (#254)
- group jakarta dependencies in the POMs
- define explicit version properties for the various jakarta APIs
- replace all *javax* libraries with their *jakarta* equivalent
- exclude all *javax* libraries brought in by our dependencies (they can't be handled through _dependencyManagement_ due to the different jar names)
- upgrade the *jakarta* libraries to the latest versions that still use the _javax_ package namespace
2021-01-26 13:33:35 +02:00
Travis CI User
2b9ecf1ece [maven-release-plugin][skip ci] prepare for next development iteration 2021-01-25 19:42:15 +00:00
Travis CI User
930b312cd1 [maven-release-plugin][skip ci] prepare release 8.376 2021-01-25 19:42:07 +00:00
alandavis
64122bf31b Add automated DB tests for ACS 7:
ACS-1180 MySQL 8 - commented out - schema ref test failure - see ACS-1180
ACS-1183 PostgreSQL 12.4, 13.1
ACS-1184 MariaDB 10.4, 10.5

Does not include Oracle or MS SQL Server which require new images.
Order of DB test changed to to be the same as alfresco-enterprise-repo.
2021-01-25 19:09:48 +00:00
alandavis
10efd50add MySql 8: One failing test to do with the schema reference files. ACS-1180 2021-01-25 19:04:32 +00:00
alandavis
3879e28590 Add automated DB tests for ACS 7:
ACS-1180 MySQL 8
ACS-1183 PostgreSQL 12.4, 13.1
ACS-1184 MariaDB 10.4, 10.5

Does not include Oracle or MS SQL Server which require new images.
Order of DB test changed to to be the same as alfresco-enterprise-repo.
2021-01-25 13:52:27 +00:00
alandavis
471492c8e0 Remove Whitesource [skip ci] 2021-01-25 07:46:22 +00:00
Travis CI User
ae26d9c1c4 [maven-release-plugin][skip ci] prepare for next development iteration 2021-01-24 09:06:56 +00:00
Travis CI User
c2733b9da7 [maven-release-plugin][skip ci] prepare release 8.375 2021-01-24 09:06:50 +00:00
alandavis
65a93c31f5 Revert "Bump dependency.camel.version from 3.7.0 to 3.7.1 (#252)"
Reverted because it causes the 3 REST API TAS test jobs to fail to compile in alfresco-enterprise-repo.

This reverts commit b1ea30fc74.
2021-01-24 08:34:46 +00:00
Travis CI User
58e7c41bbb [maven-release-plugin][skip ci] prepare for next development iteration 2021-01-22 12:03:50 +00:00
Travis CI User
8cfc05758d [maven-release-plugin][skip ci] prepare release 8.374 2021-01-22 12:03:42 +00:00
dependabot-preview[bot]
b1ea30fc74 Bump dependency.camel.version from 3.7.0 to 3.7.1 (#252) 2021-01-22 10:29:12 +00:00
Travis CI User
f6021faef8 [maven-release-plugin][skip ci] prepare for next development iteration 2021-01-20 23:16:29 +00:00
Travis CI User
da3220864e [maven-release-plugin][skip ci] prepare release 8.373 2021-01-20 23:16:22 +00:00
dependabot-preview[bot]
631e2f100a Bump dependency.activemq.version from 5.16.0 to 5.16.1 (#251) 2021-01-20 22:42:52 +00:00
Travis CI User
15a68ee177 [maven-release-plugin][skip ci] prepare for next development iteration 2021-01-20 16:06:34 +00:00
Travis CI User
f9af668d8d [maven-release-plugin][skip ci] prepare release 8.372 2021-01-20 16:06:27 +00:00
Nana Insaidoo
358bd704df [ACS-1160] Handle null Authority (#249) 2021-01-20 14:57:17 +00:00
Ancuta Morarasu
0543a800f7 Revert keycloak to 11.0.0-alfresco-001 (upgraded by dependabot by mistake) 2021-01-20 16:34:56 +02:00
Denis Ungureanu
b4b591b8af ACS-1170 : Release Gytheio 0.12 - ACS 7.0 compatible (#250)
- upgrade Gytheio
   - move jms bean to messaging-context.xml
2021-01-20 16:26:02 +02:00
Travis CI User
d3860738da [maven-release-plugin][skip ci] prepare for next development iteration 2021-01-19 23:18:34 +00:00
Travis CI User
d5bff09158 [maven-release-plugin][skip ci] prepare release 8.371 2021-01-19 23:18:24 +00:00
dependabot-preview[bot]
16eebe4681 Bump dependency.keycloak.version from 12.0.1 to 12.0.2 (#248) 2021-01-19 22:46:26 +00:00
Travis CI User
7d99fb235b [maven-release-plugin][skip ci] prepare for next development iteration 2021-01-18 23:36:14 +00:00
Travis CI User
83a1c7bd59 [maven-release-plugin][skip ci] prepare release 8.370 2021-01-18 23:36:03 +00:00
dependabot-preview[bot]
5df53eb3bf Bump mockito-core from 3.7.0 to 3.7.7 (#247) 2021-01-18 23:03:21 +00:00
dependabot-preview[bot]
bd65a45128 Bump mysql-connector-java from 8.0.22 to 8.0.23 (#246) 2021-01-18 22:56:03 +00:00
Travis CI User
ba060da9df [maven-release-plugin][skip ci] prepare for next development iteration 2021-01-18 12:02:00 +00:00
Travis CI User
44da1cb33c [maven-release-plugin][skip ci] prepare release 8.369 2021-01-18 12:01:50 +00:00
dependabot-preview[bot]
97428142b7 Bump dependency.spring.version from 5.3.2 to 5.3.3 (#238) 2021-01-18 11:19:19 +00:00
Travis CI User
7f36c47977 [maven-release-plugin][skip ci] prepare for next development iteration 2021-01-15 23:41:36 +00:00
Travis CI User
ba301ba19a [maven-release-plugin][skip ci] prepare release 8.368 2021-01-15 23:41:29 +00:00
Jamal Kaabi-Mofrad
2ffbb2ca23 ACS-1140: Added cluster-aware cache for QuerySet configs. (#243) 2021-01-15 23:09:37 +00:00
Gloria Camino
b3454b762c LOC-282 - Partial fix. 12 language bundles updated. (pending 3: DA, CZ and PL) (#241) 2021-01-14 14:34:17 +00:00
Travis CI User
1b09fea6fc [maven-release-plugin][skip ci] prepare for next development iteration 2021-01-12 21:15:09 +00:00
Travis CI User
45e31ebe82 [maven-release-plugin][skip ci] prepare release 8.367 2021-01-12 21:15:01 +00:00
dependabot-preview[bot]
401833665e ACS-1125 : Bump json from 20200518 to 20201115 (#160)
* Bump json from 20200518 to 20201115

Bumps [json](https://github.com/douglascrockford/JSON-java) from 20200518 to 20201115.
- [Release notes](https://github.com/douglascrockford/JSON-java/releases)
- [Commits](https://github.com/douglascrockford/JSON-java/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* ACS-1125 : Fix failing tests after json upgrade

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: DenisGabriela <Denis.Ungureanu1@ness.com>
2021-01-12 22:43:39 +02:00
Travis CI User
23b5dc3aef [maven-release-plugin][skip ci] prepare for next development iteration 2021-01-12 10:35:05 +00:00
Travis CI User
c4eb95471d [maven-release-plugin][skip ci] prepare release 8.366 2021-01-12 10:34:58 +00:00
Denis Ungureanu
a9e54bd08c ACS-1043 : Camel upgrade to 3.7.0 (#235)
ACS-1043: Upgrade Camel version
2021-01-12 11:41:23 +02:00
Travis CI User
f9aaddd787 [maven-release-plugin][skip ci] prepare for next development iteration 2021-01-12 08:19:15 +00:00
Travis CI User
81ab6e1583 [maven-release-plugin][skip ci] prepare release 8.365 2021-01-12 08:19:08 +00:00
alandavis
c7d219ee23 ACS-247 Query accelerator
Relax permissions (restricted in error) as they are needed in alfresco-enterprise-repo
2021-01-12 07:40:18 +00:00
Travis CI User
ad1079aaef [maven-release-plugin][skip ci] prepare for next development iteration 2021-01-11 23:24:18 +00:00
Travis CI User
5177e607ee [maven-release-plugin][skip ci] prepare release 8.364 2021-01-11 23:24:10 +00:00
dependabot-preview[bot]
10f0104d0d Bump dependency.jackson.version from 2.12.0 to 2.12.1 (#237) 2021-01-11 22:52:16 +00:00
Travis CI User
8ea6d79b5d [maven-release-plugin][skip ci] prepare for next development iteration 2021-01-11 19:02:58 +00:00
Travis CI User
24fcf258d3 [maven-release-plugin][skip ci] prepare release 8.363 2021-01-11 19:02:50 +00:00
Marcello Teodori
de6022db01 ACS-1110 replace fabric8 with docker-maven-plugin (#236) 2021-01-11 18:56:24 +01:00
Travis CI User
3195c93a9e [maven-release-plugin][skip ci] prepare for next development iteration 2021-01-11 13:57:09 +00:00
Travis CI User
8c5ec402a5 [maven-release-plugin][skip ci] prepare release 8.362 2021-01-11 13:57:02 +00:00
dependabot-preview[bot]
e772d3b898 Bump jakarta.activation from 1.2.2 to 2.0.0
Bumps [jakarta.activation](https://github.com/eclipse-ee4j/jaf) from 1.2.2 to 2.0.0.
- [Release notes](https://github.com/eclipse-ee4j/jaf/releases)
- [Commits](https://github.com/eclipse-ee4j/jaf/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-11 11:43:15 +00:00
Alan Davis
8fcaa7febb ACS-247 Query accelerator (#234)
Provides hook points for the query accelerator in alfresco-enterprise-repo.

In addition to these, it also includes temporary code to add timing headers to REST API calls. These will be removed as part of REPO-5376.

Commits mainly by Bruno and Nana. Merging from old projects and changes from master by Alan.
2021-01-11 11:31:36 +00:00
dependabot-preview[bot]
e9f1b9f21b Bump junrar from 4.0.0 to 7.4.0
Bumps [junrar](https://github.com/junrar/junrar) from 4.0.0 to 7.4.0.
- [Release notes](https://github.com/junrar/junrar/releases)
- [Changelog](https://github.com/junrar/junrar/blob/master/CHANGELOG.md)
- [Commits](https://github.com/junrar/junrar/compare/v4.0.0...v7.4.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-11 11:24:27 +00:00
dependabot-preview[bot]
67b7552686 Bump icu4j from 65.1 to 68.2
Bumps [icu4j](https://github.com/unicode-org/icu) from 65.1 to 68.2.
- [Release notes](https://github.com/unicode-org/icu/releases)
- [Commits](https://github.com/unicode-org/icu/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-11 11:20:08 +00:00
Eugenio Romano
facbef9ca9 Decrease log severity (#144) 2021-01-11 12:51:01 +02:00
Nicolas Barithel
a6fce739b6 MNT-21968 : Cannot use some document names if Smart Folders feature is enabled
MNT-21968 : Cannot use some document names if Smart Folders feature is enabled
   - catch NumberFormatException on parseInt
   - test case "v00Draft.pdf"
2021-01-11 12:23:30 +02:00
dependabot-preview[bot]
89fddfc614 Bump json-path from 2.4.0 to 2.5.0
Bumps [json-path](https://github.com/jayway/JsonPath) from 2.4.0 to 2.5.0.
- [Release notes](https://github.com/jayway/JsonPath/releases)
- [Changelog](https://github.com/json-path/JsonPath/blob/master/changelog.md)
- [Commits](https://github.com/jayway/JsonPath/compare/json-path-2.4.0...json-path-2.5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-11 10:22:39 +00:00
dependabot-preview[bot]
6a2e3b64d0 Bump dependency.jackson.version from 2.11.3 to 2.12.0
Bumps `dependency.jackson.version` from 2.11.3 to 2.12.0.

Updates `jackson-core` from 2.11.3 to 2.12.0
- [Release notes](https://github.com/FasterXML/jackson-core/releases)
- [Commits](https://github.com/FasterXML/jackson-core/compare/jackson-core-2.11.3...jackson-core-2.12.0)

Updates `jackson-annotations` from 2.11.3 to 2.12.0
- [Release notes](https://github.com/FasterXML/jackson/releases)
- [Commits](https://github.com/FasterXML/jackson/commits)

Updates `jackson-module-jaxb-annotations` from 2.11.3 to 2.12.0
- [Release notes](https://github.com/FasterXML/jackson-modules-base/releases)
- [Commits](https://github.com/FasterXML/jackson-modules-base/compare/jackson-modules-base-2.11.3...jackson-modules-base-2.12.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-11 10:20:52 +00:00
dependabot-preview[bot]
7479379af8 Bump mockito-core from 3.6.0 to 3.7.0
Bumps [mockito-core](https://github.com/mockito/mockito) from 3.6.0 to 3.7.0.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](https://github.com/mockito/mockito/compare/v3.6.0...v3.7.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-11 09:53:07 +00:00
dependabot-preview[bot]
66db333cdd Bump httpcore from 4.4.13 to 4.4.14
Bumps httpcore from 4.4.13 to 4.4.14.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-11 09:50:24 +00:00
dependabot-preview[bot]
b41ff7ae4d Bump guava from 28.2-jre to 30.0-jre (#48)
* Bump guava from 28.2-jre to 30.0-jre

Bumps [guava](https://github.com/google/guava) from 28.2-jre to 30.0-jre.
- [Release notes](https://github.com/google/guava/releases)
- [Commits](https://github.com/google/guava/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Removing guava.

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: tzclucian <tzclucian@gmail.com>
2021-01-11 11:44:30 +02:00
Travis CI User
ecba5737bc [maven-release-plugin][skip ci] prepare for next development iteration 2021-01-11 08:59:04 +00:00
Travis CI User
7a335fd0ff [maven-release-plugin][skip ci] prepare release 8.361 2021-01-11 08:58:57 +00:00
dependabot-preview[bot]
112ddd4fd7 Bump woodstox-core from 5.0.3 to 6.2.3
Bumps [woodstox-core](https://github.com/FasterXML/woodstox) from 5.0.3 to 6.2.3.
- [Release notes](https://github.com/FasterXML/woodstox/releases)
- [Commits](https://github.com/FasterXML/woodstox/compare/woodstox-core-5.0.3...woodstox-core-6.2.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-11 08:26:31 +00:00
Travis CI User
6ddc4c37bc [maven-release-plugin][skip ci] prepare for next development iteration 2021-01-09 06:48:30 +00:00
Travis CI User
bc36a2f261 [maven-release-plugin][skip ci] prepare release 8.360 2021-01-09 06:48:22 +00:00
dependabot-preview[bot]
7fae74b9ff Bump dependency.keycloak.version from 11.0.0-alfresco-001 to 12.0.1
Bumps `dependency.keycloak.version` from 11.0.0-alfresco-001 to 12.0.1.

Updates `keycloak-authz-client` from 11.0.0-alfresco-001 to 12.0.1

Updates `keycloak-core` from 11.0.0-alfresco-001 to 12.0.1
- [Release notes](https://github.com/keycloak/keycloak/releases)
- [Commits](https://github.com/keycloak/keycloak/commits/12.0.1)

Updates `keycloak-common` from 11.0.0-alfresco-001 to 12.0.1
- [Release notes](https://github.com/keycloak/keycloak/releases)
- [Commits](https://github.com/keycloak/keycloak/commits/12.0.1)

Updates `keycloak-adapter-core` from 11.0.0-alfresco-001 to 12.0.1
- [Release notes](https://github.com/keycloak/keycloak/releases)
- [Commits](https://github.com/keycloak/keycloak/commits/12.0.1)

Updates `keycloak-adapter-spi` from 11.0.0-alfresco-001 to 12.0.1

Updates `keycloak-servlet-adapter-spi` from 11.0.0-alfresco-001 to 12.0.1

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-09 06:12:36 +00:00
dependabot-preview[bot]
adf67f1939 Bump xercesImpl from 2.12.0-alfresco-patched-20191004 to 2.12.1
Bumps xercesImpl from 2.12.0-alfresco-patched-20191004 to 2.12.1.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-09 06:12:27 +00:00
dependabot-preview[bot]
310496de04 Bump FastInfoset from 1.2.18 to 2.0.0
Bumps FastInfoset from 1.2.18 to 2.0.0.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-09 06:10:47 +00:00
dependabot-preview[bot]
fad7f82a2e Bump joda-time from 2.10.8 to 2.10.9
Bumps [joda-time](https://github.com/JodaOrg/joda-time) from 2.10.8 to 2.10.9.
- [Release notes](https://github.com/JodaOrg/joda-time/releases)
- [Changelog](https://github.com/JodaOrg/joda-time/blob/master/RELEASE-NOTES.txt)
- [Commits](https://github.com/JodaOrg/joda-time/compare/v2.10.8...v2.10.9)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-08 19:24:38 +00:00
Travis CI User
54689899f9 [maven-release-plugin][skip ci] prepare for next development iteration 2021-01-08 17:53:27 +00:00
Travis CI User
4f8ca02f7f [maven-release-plugin][skip ci] prepare release 8.359 2021-01-08 17:53:19 +00:00
dependabot-preview[bot]
8af971e704 Bump cmis from 1.25 to 1.26
Bumps [cmis](https://github.com/Alfresco/alfresco-tas-cmis) from 1.25 to 1.26.
- [Release notes](https://github.com/Alfresco/alfresco-tas-cmis/releases)
- [Changelog](https://github.com/Alfresco/alfresco-tas-cmis/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/Alfresco/alfresco-tas-cmis/compare/v1.25...v1.26)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-08 14:59:11 +00:00
Travis CI User
54457a43ef [maven-release-plugin][skip ci] prepare for next development iteration 2021-01-08 14:45:40 +00:00
Travis CI User
fae8c0a3cd [maven-release-plugin][skip ci] prepare release 8.358 2021-01-08 14:45:32 +00:00
dependabot-preview[bot]
c537c4523e Bump restapi from 1.50 to 1.51
Bumps [restapi](https://github.com/Alfresco/alfresco-tas-restapi) from 1.50 to 1.51.
- [Release notes](https://github.com/Alfresco/alfresco-tas-restapi/releases)
- [Commits](https://github.com/Alfresco/alfresco-tas-restapi/compare/v1.50...v1.51)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-08 13:43:07 +00:00
Travis CI User
e1f6012dd7 [maven-release-plugin][skip ci] prepare for next development iteration 2021-01-07 13:44:21 +00:00
Travis CI User
e80256e92e [maven-release-plugin][skip ci] prepare release 8.357 2021-01-07 13:44:14 +00:00
Roxana Gherghelas
df333e32ee ACS-1043: Upgrade camel version from 2.24.2 to 2.25.3 (#219)
* ACS-1043: update to the latest version 2.25.3
2021-01-07 14:36:20 +02:00
Alan Davis
04d699cf86 REPO-5191 Bug: T-Engine should provide mapping rather than the repo. (#227)
Bug found while reviewing documents on how to create a custom metadata extractor. The original refactor had left the repo doing the mapping. It should have been passing the fully qualified repo properties to the T-Engine to do the mapping.

Linked to:
    Alfresco/acs-packaging#1826
    Alfresco/alfresco-transform-core#316
2021-01-07 11:56:42 +00:00
Travis CI User
be8e77941d [maven-release-plugin][skip ci] prepare for next development iteration 2021-01-06 12:56:08 +00:00
Travis CI User
af51b65014 [maven-release-plugin][skip ci] prepare release 8.356 2021-01-06 12:56:00 +00:00
montgolfiere
b4f9c8a672 Update README.md - fixed couple of minor typos 2021-01-06 10:36:54 +00:00
Travis CI User
cb3912ba36 [maven-release-plugin][skip ci] prepare for next development iteration 2021-01-05 21:44:39 +00:00
Travis CI User
a8f911e2a1 [maven-release-plugin][skip ci] prepare release 8.355 2021-01-05 21:44:31 +00:00
alandavis
06e877f7e5 REPO-5203 Remove legacy transformers (#181)
Revert change that removed POI as it is needed by AOS even though there are no tests.
2021-01-05 19:32:31 +00:00
Travis CI User
da66a843da [maven-release-plugin][skip ci] prepare for next development iteration 2021-01-03 13:51:28 +00:00
Travis CI User
4d838c6286 [maven-release-plugin][skip ci] prepare release 8.354 2021-01-03 13:51:22 +00:00
Alan Davis
5d2c83c14b REPO-5203 Remove legacy transformers (#181)
Now that the T-Engines provide parity with in process legacy transforms and metadata extract, the legacy transform code is now being removed. This will allow the documentation to be greatly simplified and a number of libraries to be removed.

Custom legacy transforms need to be moved to T-Engines. ACS 6 still provides a version where both may be run in parallel. New versions of the document transform engine (DTE) and media management (MM) are planned for ACS 7.
2021-01-03 13:20:22 +00:00
dependabot-preview[bot]
affccc1b4d Bump dependency.cxf.version from 3.4.1 to 3.4.2
Bumps `dependency.cxf.version` from 3.4.1 to 3.4.2.

Updates `cxf-rt-frontend-jaxws` from 3.4.1 to 3.4.2

Updates `cxf-rt-frontend-jaxrs` from 3.4.1 to 3.4.2

Updates `cxf-rt-rs-client` from 3.4.1 to 3.4.2

Updates `cxf-rt-transports-http` from 3.4.1 to 3.4.2

Updates `cxf-rt-ws-policy` from 3.4.1 to 3.4.2

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-29 22:44:41 +00:00
Travis CI User
8a13fda5d9 [maven-release-plugin][skip ci] prepare for next development iteration 2020-12-26 20:32:29 +00:00
Travis CI User
792a86f1ee [maven-release-plugin][skip ci] prepare release 8.353 2020-12-26 20:32:22 +00:00
dependabot-preview[bot]
9d52aa3c64 Bump bcprov-jdk15on from 1.67 to 1.68
Bumps [bcprov-jdk15on](https://github.com/bcgit/bc-java) from 1.67 to 1.68.
- [Release notes](https://github.com/bcgit/bc-java/releases)
- [Changelog](https://github.com/bcgit/bc-java/blob/master/docs/releasenotes.html)
- [Commits](https://github.com/bcgit/bc-java/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-23 22:52:39 +00:00
dependabot-preview[bot]
5e5082d9b3 Bump bcmail-jdk15on from 1.67 to 1.68
Bumps [bcmail-jdk15on](https://github.com/bcgit/bc-java) from 1.67 to 1.68.
- [Release notes](https://github.com/bcgit/bc-java/releases)
- [Changelog](https://github.com/bcgit/bc-java/blob/master/docs/releasenotes.html)
- [Commits](https://github.com/bcgit/bc-java/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-23 22:50:03 +00:00
Travis CI User
cb973c4d87 [maven-release-plugin][skip ci] prepare for next development iteration 2020-12-23 11:19:38 +00:00
Travis CI User
653694b030 [maven-release-plugin][skip ci] prepare release 8.352 2020-12-23 11:19:31 +00:00
Denis Ungureanu
f786f4ffaf ACS-1033 : Spring upgrade to 5.3.2 (#213)
- Update test as per 5de549d7d4
- before spring 5.3.0, AbstractFallbackSQLExceptionTranslator was translating org.postgresql.util.PSQLException as UncategorizedSQLException - now it returns null (ref. e9cded560d (diff-c6aa1c6a4b11e8a722808e945c4c5b6ef471c42871c7ce830554dde81ad7f2c2L89))

Co-authored-by: CezarLeahu <35226487+CezarLeahu@users.noreply.github.com>
2020-12-23 12:21:03 +02:00
Travis CI User
a79f782a91 [maven-release-plugin][skip ci] prepare for next development iteration 2020-12-18 09:55:38 +00:00
Travis CI User
3eab59c273 [maven-release-plugin][skip ci] prepare release 8.351 2020-12-18 09:55:31 +00:00
Denis Ungureanu
b9adb42c30 ACS-1033 : Spring upgrade on ACS 7.0 - 5.2.12.RELEASE (#212) 2020-12-18 11:09:37 +02:00
dependabot-preview[bot]
9c1bfca7ad Bump mariadb-java-client from 2.7.0 to 2.7.1
Bumps [mariadb-java-client](https://github.com/mariadb-corporation/mariadb-connector-j) from 2.7.0 to 2.7.1.
- [Release notes](https://github.com/mariadb-corporation/mariadb-connector-j/releases)
- [Changelog](https://github.com/mariadb-corporation/mariadb-connector-j/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mariadb-corporation/mariadb-connector-j/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-17 23:26:13 +00:00
dependabot-preview[bot]
a4bf93d33f Bump dataprep from 2.3 to 2.6
Bumps [dataprep](https://github.com/AlfrescoTestAutomation/dataprep) from 2.3 to 2.6.
- [Release notes](https://github.com/AlfrescoTestAutomation/dataprep/releases)
- [Commits](https://github.com/AlfrescoTestAutomation/dataprep/compare/dataprep-2.3...dataprep-2.6)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-17 23:05:10 +00:00
dependabot-preview[bot]
a74db1443e Bump utility from 3.0.40 to 3.0.41
Bumps [utility](https://github.com/Alfresco/alfresco-tas-utility) from 3.0.40 to 3.0.41.
- [Release notes](https://github.com/Alfresco/alfresco-tas-utility/releases)
- [Changelog](https://github.com/Alfresco/alfresco-tas-utility/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/Alfresco/alfresco-tas-utility/compare/utility-3.0.40...utility-3.0.41)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-17 22:53:42 +00:00
Travis CI User
1600704bee [maven-release-plugin][skip ci] prepare for next development iteration 2020-12-16 13:56:00 +00:00
Travis CI User
c7d5736f37 [maven-release-plugin][skip ci] prepare release 8.350 2020-12-16 13:55:53 +00:00
Adina Ababei
3891306459 ACS-1041 Fixed intermittent test failure - events2 (#208) 2020-12-16 15:23:55 +02:00
Travis CI User
bf73af71a3 [maven-release-plugin][skip ci] prepare for next development iteration 2020-12-15 23:29:32 +00:00
Travis CI User
57c04411ed [maven-release-plugin][skip ci] prepare release 8.349 2020-12-15 23:29:25 +00:00
dependabot-preview[bot]
7962cf0b03 Bump dependency.webscripts.version from 8.14 to 8.15
Bumps `dependency.webscripts.version` from 8.14 to 8.15.

Updates `spring-surf-core-configservice` from 8.14 to 8.15

Updates `spring-webscripts` from 8.14 to 8.15
- [Release notes](https://github.com/Alfresco/surf-webscripts/releases)
- [Commits](https://github.com/Alfresco/surf-webscripts/compare/spring-surf-webscripts-parent-8.14...spring-surf-webscripts-parent-8.15)

Updates `spring-webscripts` from 8.14 to 8.15
- [Release notes](https://github.com/Alfresco/surf-webscripts/releases)
- [Commits](https://github.com/Alfresco/surf-webscripts/compare/spring-surf-webscripts-parent-8.14...spring-surf-webscripts-parent-8.15)

Updates `spring-webscripts-api` from 8.14 to 8.15

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-15 22:56:02 +00:00
Travis CI User
eeb49f4b36 [maven-release-plugin][skip ci] prepare for next development iteration 2020-12-14 15:42:55 +00:00
Travis CI User
31d65ceb42 [maven-release-plugin][skip ci] prepare release 8.348 2020-12-14 15:42:48 +00:00
evasques
1b2c5d4c37 MNT-22040 Copying nodes that contain sys:pendingFixAcl aspect (#188)
* MNT-22040 - Copying nodes that contain sys:pendingFixAcl aspect
* Increased coverage of unit tests
* Added public method removePendingAclAspect
* Changed the job to use the removePendingAclAspect method instead of
repeating the same set of operations twice
* Changed method setFixedAcls to use sharedAclToReplace property of node
if it has the pendingFixAcl aspect applied instead of using the current
shared ACL to be replaced

* Added more tests and validations

* Fixed cuncurrency issues when updating parent and child at the same time, permissions triggered by a move on a node with a pending acl and permissions needeing to be reapplied on nodes that already have the pending acl aspect

* Increase the tree strcuture as sometimes we don't reach the timeout in tests

* code cleanup and formatting
2020-12-14 15:08:21 +00:00
Travis CI User
c0d1098db0 [maven-release-plugin][skip ci] prepare for next development iteration 2020-12-14 12:21:34 +00:00
Travis CI User
27af7d2f49 [maven-release-plugin][skip ci] prepare release 8.347 2020-12-14 12:21:27 +00:00
dependabot-preview[bot]
11cf9fa16c Bump cmis from 1.21 to 1.25
Bumps [cmis](https://github.com/Alfresco/alfresco-tas-cmis) from 1.21 to 1.25.
- [Release notes](https://github.com/Alfresco/alfresco-tas-cmis/releases)
- [Changelog](https://github.com/Alfresco/alfresco-tas-cmis/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/Alfresco/alfresco-tas-cmis/compare/v1.21...v1.25)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-14 11:02:38 +00:00
dependabot-preview[bot]
5f19aa76af Bump bcmail-jdk15on from 1.66 to 1.67
Bumps [bcmail-jdk15on](https://github.com/bcgit/bc-java) from 1.66 to 1.67.
- [Release notes](https://github.com/bcgit/bc-java/releases)
- [Changelog](https://github.com/bcgit/bc-java/blob/master/docs/releasenotes.html)
- [Commits](https://github.com/bcgit/bc-java/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-14 10:48:20 +00:00
dependabot-preview[bot]
2cffc61164 Bump restapi from 1.48 to 1.50
Bumps [restapi](https://github.com/Alfresco/alfresco-tas-restapi) from 1.48 to 1.50.
- [Release notes](https://github.com/Alfresco/alfresco-tas-restapi/releases)
- [Commits](https://github.com/Alfresco/alfresco-tas-restapi/compare/v1.48...v1.50)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-14 10:12:26 +00:00
dependabot-preview[bot]
53c58d4b46 Bump dependency.tika.version from 1.24.1 to 1.25
Bumps `dependency.tika.version` from 1.24.1 to 1.25.

Updates `tika-core` from 1.24.1 to 1.25
- [Release notes](https://github.com/apache/tika/releases)
- [Changelog](https://github.com/apache/tika/blob/main/CHANGES.txt)
- [Commits](https://github.com/apache/tika/compare/1.24.1...1.25)

Updates `tika-parsers` from 1.24.1 to 1.25
- [Release notes](https://github.com/apache/tika/releases)
- [Changelog](https://github.com/apache/tika/blob/main/CHANGES.txt)
- [Commits](https://github.com/apache/tika/compare/1.24.1...1.25)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-14 10:12:20 +00:00
dependabot-preview[bot]
96c6ca844a Bump groovy-all from 2.4.20 to 2.4.21
Bumps [groovy-all](https://github.com/apache/groovy) from 2.4.20 to 2.4.21.
- [Release notes](https://github.com/apache/groovy/releases)
- [Commits](https://github.com/apache/groovy/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-14 10:11:41 +00:00
dependabot-preview[bot]
b3e48b0072 Bump dependency.webscripts.version from 8.12 to 8.14
Bumps `dependency.webscripts.version` from 8.12 to 8.14.

Updates `spring-surf-core-configservice` from 8.12 to 8.14

Updates `spring-webscripts` from 8.12 to 8.14
- [Release notes](https://github.com/Alfresco/surf-webscripts/releases)
- [Commits](https://github.com/Alfresco/surf-webscripts/compare/spring-surf-webscripts-parent-8.12...spring-surf-webscripts-parent-8.14)

Updates `spring-webscripts` from 8.12 to 8.14
- [Release notes](https://github.com/Alfresco/surf-webscripts/releases)
- [Commits](https://github.com/Alfresco/surf-webscripts/compare/spring-surf-webscripts-parent-8.12...spring-surf-webscripts-parent-8.14)

Updates `spring-webscripts-api` from 8.12 to 8.14

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-14 10:11:28 +00:00
Travis CI User
e59c0d7186 [maven-release-plugin][skip ci] prepare for next development iteration 2020-12-10 13:31:35 +00:00
547 changed files with 19221 additions and 49586 deletions

View File

@@ -1,4 +1,4 @@
# For SmartGit
[bugtraq "jira"]
url = https://issues.alfresco.com/jira/browse/%BUGID%
url = https://alfresco.atlassian.net/browse/%BUGID%
logRegex = ([A-Z]+-\\d+)

View File

@@ -33,7 +33,7 @@ stages:
- name: test
if: commit_message !~ /\[skip tests\]/
- name: release
if: fork = false AND (branch = master OR branch =~ /release\/.*/ OR branch =~ /fix\/.*/) AND type != pull_request AND commit_message !~ /\[no release\]/
if: fork = false AND (branch = master OR branch =~ /release\/.*/) AND type != pull_request AND commit_message !~ /\[no release\]/
- name: update_downstream
if: fork = false AND (branch = master OR branch =~ /release\/.*/) AND type != pull_request AND commit_message !~ /\[no downstream\]/
- name: trigger_downstream
@@ -44,59 +44,49 @@ install: travis_retry travis_wait 40 bash scripts/travis/build.sh
jobs:
include:
- name: "WhiteSource scan"
stage: test
# only on release branches or master and if it is not a PR
if: fork = false AND (branch = master OR branch =~ /release\/.*/) AND type != pull_request
script:
# Download the latest version of WhiteSource Unified Agent
- curl -LJO https://github.com/whitesource/unified-agent-distribution/releases/latest/download/wss-unified-agent.jar
# Run WhiteSource Unified Agent
- java -jar wss-unified-agent.jar -apiKey ${WHITESOURCE_API_KEY} -c .wss-unified-agent.config -d ./packaging/war
# - name: "Source Clear Scan"
# # only on release branches or master and if it is not a PR
# if: fork = false AND (branch = master OR branch =~ /release\/.*/) AND type != pull_request
# script: skip
# addons:
# srcclr: true
- name: "Core, Data-Model, Repository - AllUnitTestsSuite - Build and test"
if: commit_message !~ /\[skip repo\]/
script:
- travis_retry mvn -B test -pl core,data-model
- travis_retry mvn -B test -pl repository -Dtest=AllUnitTestsSuite
- name: "Repository - AppContext01TestSuite"
if: commit_message !~ /\[skip repo\]/
before_script:
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:11.7 postgres -c 'max_connections=300'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.15.8
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.3.6
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.4.0
script: travis_wait 20 mvn -B test -pl repository -Dtest=AppContext01TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
- name: "Repository - AppContext02TestSuite"
if: commit_message !~ /\[skip repo\]/
before_script:
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:11.7 postgres -c 'max_connections=300'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.15.8
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
script: travis_wait 20 mvn -B test -pl repository -Dtest=AppContext02TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
- name: "Repository - AppContext03TestSuite"
if: commit_message !~ /\[skip repo\]/
before_script:
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:11.7 postgres -c 'max_connections=300'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.15.8
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.3.6
script: travis_wait 20 mvn -B test -pl repository -Dtest=AppContext03TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco -Dalfresco-pdf-renderer.url=http://localhost:8090/ -Djodconverter.url=http://localhost:8090/ -Dimg.url=http://localhost:8090/ -Dtika.url=http://localhost:8090/ -Dtransform.misc.url=http://localhost:8090/
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.4.0
script: travis_wait 20 mvn -B test -pl repository -Dtest=AppContext03TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
- name: "Repository - AppContext04TestSuite"
if: commit_message !~ /\[skip repo\]/
before_script:
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:11.7 postgres -c 'max_connections=300'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.15.8
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.3.6
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.4.0
script: travis_wait 20 mvn -B test -pl repository -Dtest=AppContext04TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
- name: "Repository - AppContext05TestSuite"
if: commit_message !~ /\[skip repo\]/
before_script:
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:11.7 postgres -c 'max_connections=300'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.15.8
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
- mkdir -p "${HOME}/tmp"
- cp repository/src/test/resources/realms/alfresco-realm.json "${HOME}/tmp"
- export HOST_IP=$(hostname -I | cut -f1 -d' ')
@@ -104,94 +94,141 @@ jobs:
script: travis_wait 20 mvn -B test -pl repository -Dtest=AppContext05TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco "-Didentity-service.auth-server-url=http://${HOST_IP}:8999/auth"
- name: "Repository - AppContext06TestSuite"
if: commit_message !~ /\[skip repo\]/
before_script:
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:11.7 postgres -c 'max_connections=300'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.15.8
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.3.6
script: travis_wait 20 mvn -B test -pl repository -Dtest=AppContext06TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco -Dalfresco-pdf-renderer.url=http://localhost:8090/ -Djodconverter.url=http://localhost:8090/ -Dimg.url=http://localhost:8090/ -Dtika.url=http://localhost:8090/ -Dtransform.misc.url=http://localhost:8090/
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.4.0
script: travis_wait 20 mvn -B test -pl repository -Dtest=AppContext06TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
- name: "Repository - AppContextExtraTestSuite"
if: commit_message !~ /\[skip repo\]/
before_script:
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:11.7 postgres -c 'max_connections=300'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.15.8
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.3.6
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.4.0
script: travis_wait 20 mvn -B test -pl repository -Dtest=AppContextExtraTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
- name: "Repository - MiscContextTestSuite"
if: commit_message !~ /\[skip repo\]/
before_script:
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:11.7 postgres -c 'max_connections=300'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.15.8
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.3.6
script: travis_wait 20 mvn -B test -pl repository -Dtest=MiscContextTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco -Dalfresco-pdf-renderer.url=http://localhost:8090/ -Djodconverter.url=http://localhost:8090/ -Dimg.url=http://localhost:8090/ -Dtika.url=http://localhost:8090/ -Dtransform.misc.url=http://localhost:8090/
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.4.0
script: travis_wait 20 mvn -B test -pl repository -Dtest=MiscContextTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
- name: "Repository - SearchTestSuite"
if: commit_message !~ /\[skip repo\]/
before_script:
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:11.7 postgres -c 'max_connections=300'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.15.8
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
script: travis_wait 20 mvn -B test -pl repository -Dtest=SearchTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco -Dindex.subsystem.name=solr6
- name: "Repository - MySQL tests"
if: commit_message !~ /\[skip db\]/
before_script:
- docker run -d -p 3307:3306 -e MYSQL_ROOT_PASSWORD=alfresco -e MYSQL_USER=alfresco -e MYSQL_DATABASE=alfresco -e MYSQL_PASSWORD=alfresco mysql:5.7.23 --transaction-isolation='READ-COMMITTED'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.15.8
script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -Ddb.driver=com.mysql.jdbc.Driver -Ddb.name=alfresco -Ddb.url=jdbc:mysql://localhost:3307/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
- name: "Repository - PostgreSQL 10 tests"
if: commit_message !~ /\[skip db\]/
before_script:
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:10.9 postgres -c 'max_connections=300'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.15.8
script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
- name: "Repository - PostgreSQL 11 tests"
if: commit_message !~ /\[skip db\]/
before_script:
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:11.7 postgres -c 'max_connections=300'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.15.8
script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
- name: "Repository - MariaDB tests"
if: commit_message !~ /\[skip db\]/
- name: "Repository - MariaDB 10.2.18 tests"
if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip db\]/ AND type != pull_request) OR commit_message =~ /\[db\]/
before_script:
- docker run -d -p 3307:3306 --name mariadb -e MYSQL_ROOT_PASSWORD=alfresco -e MYSQL_USER=alfresco -e MYSQL_DATABASE=alfresco -e MYSQL_PASSWORD=alfresco mariadb:10.2.18 --transaction-isolation=READ-COMMITTED --max-connections=300 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.15.8
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -Ddb.name=alfresco -Ddb.url=jdbc:mariadb://localhost:3307/alfresco?useUnicode=yes\&characterEncoding=UTF-8 -Ddb.username=alfresco -Ddb.password=alfresco -Ddb.driver=org.mariadb.jdbc.Driver
- name: "Remote-api - AppContext01TestSuite"
- name: "Repository - MariaDB 10.4 tests"
if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip db\]/ AND type != pull_request) OR commit_message =~ /\[db\]/
before_script:
- docker run -d -p 3307:3306 --name mariadb -e MYSQL_ROOT_PASSWORD=alfresco -e MYSQL_USER=alfresco -e MYSQL_DATABASE=alfresco -e MYSQL_PASSWORD=alfresco mariadb:10.4 --transaction-isolation=READ-COMMITTED --max-connections=300 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -Ddb.name=alfresco -Ddb.url=jdbc:mariadb://localhost:3307/alfresco?useUnicode=yes\&characterEncoding=UTF-8 -Ddb.username=alfresco -Ddb.password=alfresco -Ddb.driver=org.mariadb.jdbc.Driver
- name: "Repository - MariaDB 10.5 tests"
if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip db\]/ AND type != pull_request) OR commit_message =~ /\[db\]/ OR commit_message =~ /\[latest db\]/
before_script:
- docker run -d -p 3307:3306 --name mariadb -e MYSQL_ROOT_PASSWORD=alfresco -e MYSQL_USER=alfresco -e MYSQL_DATABASE=alfresco -e MYSQL_PASSWORD=alfresco mariadb:10.5 --transaction-isolation=READ-COMMITTED --max-connections=300 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -Ddb.name=alfresco -Ddb.url=jdbc:mariadb://localhost:3307/alfresco?useUnicode=yes\&characterEncoding=UTF-8 -Ddb.username=alfresco -Ddb.password=alfresco -Ddb.driver=org.mariadb.jdbc.Driver
- name: "Repository - MySQL 5.7.28 tests"
if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip db\]/ AND type != pull_request) OR commit_message =~ /\[db\]/
before_script:
- docker run -d -p 3307:3306 -e MYSQL_ROOT_PASSWORD=alfresco -e MYSQL_USER=alfresco -e MYSQL_DATABASE=alfresco -e MYSQL_PASSWORD=alfresco mysql:5.7.28 --transaction-isolation='READ-COMMITTED'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -Ddb.driver=com.mysql.jdbc.Driver -Ddb.name=alfresco -Ddb.url=jdbc:mysql://localhost:3307/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
- name: "Repository - MySQL 8 tests"
if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip db\]/ AND type != pull_request) OR commit_message =~ /\[db\]/ OR commit_message =~ /\[latest db\]/
before_script:
- docker run -d -p 3307:3306 -e MYSQL_ROOT_PASSWORD=alfresco -e MYSQL_USER=alfresco -e MYSQL_DATABASE=alfresco -e MYSQL_PASSWORD=alfresco mysql:8 --transaction-isolation='READ-COMMITTED'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -Ddb.driver=com.mysql.jdbc.Driver -Ddb.name=alfresco -Ddb.url=jdbc:mysql://localhost:3307/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
- name: "Repository - PostgreSQL 10.9 tests"
if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip db\]/ AND type != pull_request) OR commit_message =~ /\[db\]/
before_script:
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:10.9 postgres -c 'max_connections=300'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
- name: "Repository - PostgreSQL 11.7 tests"
if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip db\]/ AND type != pull_request) OR commit_message =~ /\[db\]/
before_script:
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:11.7 postgres -c 'max_connections=300'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.15.8
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
- name: "Repository - PostgreSQL 12.4 tests"
if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip db\]/ AND type != pull_request) OR commit_message =~ /\[db\]/
before_script:
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:12.4 postgres -c 'max_connections=300'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
- name: "Repository - PostgreSQL 13.1 tests"
# We only run DB tests on the latest version of PostgreSQL on feature branches
if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip db\]/ AND type != pull_request) OR commit_message =~ /\[db\]/
before_script:
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
- name: "Remote-api - AppContext01TestSuite"
if: commit_message !~ /\[skip repo\]/
before_script:
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
script: travis_wait 20 mvn -B test -pl remote-api -Dtest=AppContext01TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
- name: "Remote-api - AppContext02TestSuite"
if: commit_message !~ /\[skip repo\]/
before_script:
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:11.7 postgres -c 'max_connections=300'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.15.8
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.3.6
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.4.0
script: travis_wait 20 mvn -B test -pl remote-api -Dtest=AppContext02TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
- name: "Remote-api - AppContext03TestSuite"
if: commit_message !~ /\[skip repo\]/
before_script:
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:11.7 postgres -c 'max_connections=300'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.15.8
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.3.6
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.4.0
script: travis_wait 20 mvn -B test -pl remote-api -Dtest=AppContext03TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
- name: "Remote-api - AppContext04TestSuite"
if: commit_message !~ /\[skip repo\]/
before_script:
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:11.7 postgres -c 'max_connections=300'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.15.8
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.4.0
script: travis_wait 20 mvn -B test -pl remote-api -Dtest=AppContext04TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
- name: "Remote-api - AppContextExtraTestSuite"
if: commit_message !~ /\[skip repo\]/
before_script:
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:11.7 postgres -c 'max_connections=300'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.15.8
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
script: travis_wait 20 mvn -B test -pl remote-api -Dtest=AppContextExtraTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
- name: "REST API TAS tests part1"
if: branch = master OR commit_message =~ /\[tas\]/
# TAS tests are generally skipped on feature branches as they will be repeated on the enterprise repo or community packaging builds
if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip tas\]/) OR commit_message =~ /\[tas\]/
before_script:
- ${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/docker-compose-minimal+transforms.yml
- ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
@@ -199,7 +236,7 @@ jobs:
- travis_wait 60 mvn -B install -f packaging/tests/tas-restapi/pom.xml -Pall-tas-tests,run-restapi-part1 -Denvironment=default -DrunBugs=false
- name: "REST API TAS tests part2"
if: branch = master OR commit_message =~ /\[tas\]/
if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip tas\]/) OR commit_message =~ /\[tas\]/
before_script:
- ${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/docker-compose-minimal+transforms.yml
- ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
@@ -207,7 +244,7 @@ jobs:
- travis_wait 60 mvn -B install -f packaging/tests/tas-restapi/pom.xml -Pall-tas-tests,run-restapi-part2 -Denvironment=default -DrunBugs=false
- name: "REST API TAS tests part3"
if: branch = master OR commit_message =~ /\[tas\]/
if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip tas\]/) OR commit_message =~ /\[tas\]/
before_script:
- ${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/docker-compose-minimal+transforms.yml
- ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
@@ -215,7 +252,7 @@ jobs:
- travis_wait 60 mvn -B install -f packaging/tests/tas-restapi/pom.xml -Pall-tas-tests,run-restapi-part3 -Denvironment=default -DrunBugs=false
- name: "CMIS TAS tests - BROWSER binding"
if: branch = master OR commit_message =~ /\[tas\]/
if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip tas\]/) OR commit_message =~ /\[tas\]/
before_script:
- ${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/docker-compose-minimal+transforms.yml
- ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
@@ -223,7 +260,7 @@ jobs:
- travis_wait 40 mvn -B install -f packaging/tests/tas-cmis/pom.xml -Pall-tas-tests,run-cmis-browser -Denvironment=default -DrunBugs=false
- name: "CMIS TAS tests - ATOM binding"
if: branch = master OR commit_message =~ /\[tas\]/
if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip tas\]/) OR commit_message =~ /\[tas\]/
before_script:
- ${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/docker-compose-minimal+transforms.yml
- ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
@@ -231,7 +268,7 @@ jobs:
- travis_wait 40 mvn -B install -f packaging/tests/tas-cmis/pom.xml -Pall-tas-tests,run-cmis-atom -Denvironment=default -DrunBugs=false
- name: "CMIS TAS tests - WEBSERVICES binding"
if: branch = master OR commit_message =~ /\[tas\]/
if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip tas\]/) OR commit_message =~ /\[tas\]/
before_script:
- ${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/docker-compose-minimal+transforms.yml
- ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
@@ -239,7 +276,7 @@ jobs:
- travis_wait 40 mvn -B install -f packaging/tests/tas-cmis/pom.xml -Pall-tas-tests,run-cmis-webservices -Denvironment=default -DrunBugs=false
- name: "Email TAS tests"
if: branch = master OR commit_message =~ /\[tas\]/
if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip tas\]/) OR commit_message =~ /\[tas\]/
before_script:
- ${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/docker-compose-minimal.yml
- ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
@@ -247,7 +284,7 @@ jobs:
- travis_wait 30 mvn -B install -f packaging/tests/tas-email/pom.xml -Pall-tas-tests -Denvironment=default -DrunBugs=false
- name: "WebDAV TAS tests"
if: branch = master OR commit_message =~ /\[tas\]/
if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip tas\]/) OR commit_message =~ /\[tas\]/
before_script:
- ${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/docker-compose-minimal.yml
- ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
@@ -255,7 +292,7 @@ jobs:
- travis_wait 30 mvn -B install -f packaging/tests/tas-webdav/pom.xml -Pall-tas-tests -Denvironment=default -DrunBugs=false
- name: "Integration TAS tests"
if: branch = master OR commit_message =~ /\[tas\]/
if: (branch =~ /(release\/.*$|master)/ AND commit_message !~ /\[skip tas\]/) OR commit_message =~ /\[tas\]/
before_script:
- ${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/docker-compose-minimal.yml
- ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"

View File

@@ -1,8 +0,0 @@
{
"generalSettings": {
"shouldScanRepo": true
},
"checkRunSettings": {
"vulnerableCheckRunConclusionLevel": "failure"
}
}

View File

@@ -1,228 +0,0 @@
####################################################################
# WhiteSource Unified-Agent configuration file
####################################################################
##########################################
# GENERAL SCAN MODE: Files and Package Managers
##########################################
checkPolicies=true
forceCheckAllDependencies=true
forceUpdate=true
forceUpdate.failBuildOnPolicyViolation=true
offline=false
#ignoreSourceFiles=true
#scanComment=
#updateInventory=false
#resolveAllDependencies=false
#failErrorLevel=ALL
#requireKnownSha1=false
#generateScanReport=true
#scanReportTimeoutMinutes=10
#excludeDependenciesFromNodes=.*commons-io.*,.*maven-model
#projectPerFolder=true
#projectPerFolderIncludes=
#projectPerFolderExcludes=
#wss.connectionTimeoutMinutes=60
# Change the below URL to your WhiteSource server.
# Use the 'WhiteSource Server URL' which can be retrieved
# from your 'Profile' page on the 'Server URLs' panel.
# Then, add the '/agent' path to it.
wss.url=https://saas.whitesourcesoftware.com/agent
#npm.resolveDependencies=false
#npm.ignoreSourceFiles=false
#npm.includeDevDependencies=true
#npm.runPreStep=true
#npm.ignoreNpmLsErrors=true
#npm.ignoreScripts=true
#npm.yarnProject=true
#npm.accessToken=
#npm.identifyByNameAndVersion=true
#bower.resolveDependencies=false
#bower.ignoreSourceFiles=true
#bower.runPreStep=true
#nuget.resolvePackagesConfigFiles=false
#nuget.resolveCsProjFiles=false
#nuget.resolveDependencies=false
#nuget.restoreDependencies=true
#nuget.ignoreSourceFiles=true
#nuget.runPreStep=true
#nuget.resolveNuspecFiles=false
#python.resolveDependencies=false
#python.ignoreSourceFiles=false
#python.ignorePipInstallErrors=true
#python.installVirtualenv=true
#python.resolveHierarchyTree=false
#python.requirementsFileIncludes=requirements.txt
#python.resolveSetupPyFiles=true
#python.runPipenvPreStep=true
#python.pipenvDevDependencies=true
#python.IgnorePipenvInstallErrors=true
#maven.ignoredScopes=test provided
maven.resolveDependencies=true
#maven.ignoreSourceFiles=true
#maven.aggregateModules=true
maven.ignorePomModules=false
#maven.runPreStep=true
#maven.ignoreMvnTreeErrors=true
#maven.environmentPath=
#maven.m2RepositoryPath=
#gradle.ignoredScopes=
#gradle.resolveDependencies=false
#gradle.runAssembleCommand=false
#gradle.runPreStep=true
#gradle.ignoreSourceFiles=true
#gradle.aggregateModules=true
#gradle.preferredEnvironment=wrapper
#gradle.localRepositoryPath=
#paket.resolveDependencies=false
#paket.ignoredGroups=
#paket.ignoreSourceFiles=false
#paket.runPreStep=true
#paket.exePath=
#go.resolveDependencies=false
#go.collectDependenciesAtRuntime=true
#go.dependencyManager=
#go.ignoreSourceFiles=true
#go.glide.ignoreTestPackages=false
#go.gogradle.enableTaskAlias=true
#ruby.resolveDependencies = false
#ruby.ignoreSourceFiles = false
#ruby.installMissingGems = true
#ruby.runBundleInstall = true
#ruby.overwriteGemFile = true
#sbt.resolveDependencies=false
#sbt.ignoreSourceFiles=true
#sbt.aggregateModules=true
#sbt.runPreStep=true
#sbt.targetFolder=
#php.resolveDependencies=false
#php.runPreStep=true
#php.includeDevDependencies=true
#html.resolveDependencies=false
#cocoapods.resolveDependencies=false
#cocoapods.runPreStep=true
#cocoapods.ignoreSourceFiles=false
#hex.resolveDependencies=false
#hex.runPreStep=true
#hex.ignoreSourceFiles=false
#hex.aggregateModules=true
##################################
# Organization tokens:
##################################
apiKey=
#userKey is required if WhiteSource administrator has enabled "Enforce user level access" option
#userKey=
projectName=alfresco-community-repo
projectVersion=
projectToken=
productName=ACS Community
productVersion=
productToken=
#updateType=APPEND
#requesterEmail=user@provider.com
#########################################################################################
# Includes/Excludes Glob patterns - PLEASE USE ONLY ONE EXCLUDE LINE AND ONE INCLUDE LINE
#########################################################################################
#includes=**/*.c **/*.cc **/*.cp **/*.cpp **/*.cxx **/*.c++ **/*.h **/*.hpp **/*.hxx
#includes=**/*.m **/*.mm **/*.js **/*.php
includes=**/*.jar
#includes=**/*.gem **/*.rb
#includes=**/*.dll **/*.cs **/*.nupkg
#includes=**/*.tgz **/*.deb **/*.gzip **/*.rpm **/*.tar.bz2
#includes=**/*.zip **/*.tar.gz **/*.egg **/*.whl **/*.py
## Exclude file extensions or specific directories by adding **/*.<extension> or **<excluded_dir>/**
excludes=**/*sources.jar **/*javadoc.jar
case.sensitive.glob=false
followSymbolicLinks=true
##################################
# Archive properties
##################################
#archiveExtractionDepth=2
#archiveIncludes=**/*.war **/*.ear
#archiveExcludes=**/*sources.jar
##################################
# Proxy settings
##################################
#proxy.host=
#proxy.port=
#proxy.user=
#proxy.pass=
##################################
# SCM settings
##################################
#scm.type=
#scm.user=
#scm.pass=
#scm.ppk=
#scm.url=
#scm.branch=
#scm.tag=
#scm.npmInstall=
#scm.npmInstallTimeoutMinutes=
#scm.repositoriesFile=
##############################################
# SCAN MODE: Linux package manager settings
##############################################
#scanPackageManager=true
##################################
# SCAN MODE: Docker images
##################################
#docker.scanImages=true
#docker.includes=.*.*
#docker.excludes=
#docker.pull.enable=true
#docker.pull.images=.*.*
#docker.pull.maxImages=10
#docker.pull.tags=.*.*
#docker.pull.digest=
#docker.delete.force=true
#docker.login.sudo=false
#docker.aws.enable=true
#docker.aws.registryIds=
##################################
# SCAN MODE: Docker containers
##################################
#docker.scanContainers=true
#docker.containerIncludes=.*.*
#docker.containerExcludes=
################################
# Serverless settings
################################
#serverless.provider=
#serverless.scanFunctions=true
#serverless.includes=
#serverless.excludes=
#serverless.region=
#serverless.maxFunctions=10

View File

@@ -34,7 +34,7 @@ Repository is a library packaged as a jar file which contains the following:
Tests are combined into test classes split by test type or Spring application context used in the test, see classes
in _src/test/java/org/alfresco_. All of these classes as well as individual tests can be run by specifying the test
class name and a set of DB connection properties. Check the travis.yml file for docker images that should be started
to provide a sutable test environment. For example:
to provide a suitable test environment. For example:
~~~
mvn clean test -Dtest=SomeRepoTest -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql:alfresco -Ddb.username=alfresco -Ddb.password=alfresco
~~~
@@ -114,7 +114,7 @@ want to make changes to both of them if you are changing the repository code.
~~~
mkdir work
cd works
cd work
git clone git@github.com:Alfresco/alfresco-community-repo.git
git clone git@github.com:Alfresco/acs-community-packaging.git
~~~
@@ -131,16 +131,6 @@ cd ..
In Intellij IDEA, create a new project using the `work` directory as the source.
* File > New Project from Existing Sources > .../work > Maven
## Docker
We generally use Docker for testing. In order to reduce the size of images we also supply a squash option that collapses
the layers in the image. This is a long-standing experimental feature that we have fould useful. However you will need
to enable experimental features in your Docker Engine.
~~~
{
"experimental": true,
"debug": true
}
~~~
## Branches
As multiple projects have been combined, branch names use the ACS version they are targeting.
For example the code used to create the repository in ACS 6.2.1 is a branch called `releases/6.2.1`.

View File

@@ -7,10 +7,25 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>repo-5439-M3c1</version>
<version>9.40</version>
</parent>
<dependencies>
<!-- Jakarta... -->
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
</dependency>
<!-- REPO-5047 - Replaces org.apache.geronimo.specs:geronimo-jta_1.1_spec -->
<dependency>
<groupId>jakarta.transaction</groupId>
<artifactId>jakarta.transaction-api</artifactId>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
@@ -79,24 +94,11 @@
<groupId>org.alfresco.surf</groupId>
<artifactId>spring-surf-core-configservice</artifactId>
</dependency>
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>2.3.0.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.guessencoding</groupId>
<artifactId>guessencoding</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>jakarta.transaction</groupId>
<artifactId>jakarta.transaction-api</artifactId>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>

View File

@@ -21,7 +21,6 @@ package org.alfresco.httpclient;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.security.AlgorithmParameters;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
@@ -32,14 +31,11 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
import org.alfresco.encryption.AlfrescoKeyStore;
import org.alfresco.encryption.AlfrescoKeyStoreImpl;
import org.alfresco.encryption.EncryptionUtils;
import org.alfresco.encryption.Encryptor;
import org.alfresco.encryption.KeyProvider;
import org.alfresco.encryption.KeyResourceLoader;
import org.alfresco.encryption.KeyStoreParameters;
import org.alfresco.encryption.ssl.AuthSSLProtocolSocketFactory;
import org.alfresco.encryption.ssl.SSLEncryptionParameters;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.util.Pair;
import org.apache.commons.httpclient.DefaultHttpMethodRetryHandler;
import org.apache.commons.httpclient.HostConfiguration;
import org.apache.commons.httpclient.HttpClient;
@@ -53,8 +49,6 @@ import org.apache.commons.httpclient.SimpleHttpConnectionManager;
import org.apache.commons.httpclient.URI;
import org.apache.commons.httpclient.URIException;
import org.apache.commons.httpclient.cookie.CookiePolicy;
import org.apache.commons.httpclient.methods.ByteArrayRequestEntity;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.params.DefaultHttpParams;
import org.apache.commons.httpclient.params.DefaultHttpParamsFactory;
import org.apache.commons.httpclient.params.HttpClientParams;
@@ -75,23 +69,25 @@ import org.apache.commons.logging.LogFactory;
*/
public class HttpClientFactory
{
/**
* Communication type for HttpClient:
* - NONE is plain http
* - SECRET is plain http with a shared secret via request header
* - HTTPS is mTLS with client authentication (certificates are required)
*/
public static enum SecureCommsType
{
HTTPS, NONE;
HTTPS, NONE, SECRET;
public static SecureCommsType getType(String type)
{
if(type.equalsIgnoreCase("https"))
switch (type.toLowerCase())
{
return HTTPS;
}
else if(type.equalsIgnoreCase("none"))
{
return NONE;
}
else
{
throw new IllegalArgumentException("Invalid communications type");
case "https": return HTTPS;
case "none": return NONE;
case "secret": return SECRET;
default: throw new IllegalArgumentException("Invalid communications type");
}
}
};
@@ -122,14 +118,24 @@ public class HttpClientFactory
private int connectionTimeout = 0;
// Shared secret parameters
private String sharedSecret;
private String sharedSecretHeader = DEFAULT_SHAREDSECRET_HEADER;
// Default name for HTTP Request Header when using shared secret communication
public static final String DEFAULT_SHAREDSECRET_HEADER = "X-Alfresco-Search-Secret";
public HttpClientFactory()
{
}
/**
* Default constructor for legacy subsystems.
*/
public HttpClientFactory(SecureCommsType secureCommsType, SSLEncryptionParameters sslEncryptionParameters,
KeyResourceLoader keyResourceLoader, KeyStoreParameters keyStoreParameters,
MD5EncryptionParameters encryptionParameters, String host, int port, int sslPort, int maxTotalConnections,
int maxHostConnections, int socketTimeout)
KeyResourceLoader keyResourceLoader, KeyStoreParameters keyStoreParameters,
MD5EncryptionParameters encryptionParameters, String host, int port, int sslPort,
int maxTotalConnections, int maxHostConnections, int socketTimeout)
{
this.secureCommsType = secureCommsType;
this.sslEncryptionParameters = sslEncryptionParameters;
@@ -145,6 +151,21 @@ public class HttpClientFactory
init();
}
/**
* Recommended constructor for subsystems supporting Shared Secret communication.
* This constructor supports Shared Secret ("secret") communication method additionally to the legacy ones: "none" and "https".
*/
public HttpClientFactory(SecureCommsType secureCommsType, SSLEncryptionParameters sslEncryptionParameters,
KeyResourceLoader keyResourceLoader, KeyStoreParameters keyStoreParameters,
MD5EncryptionParameters encryptionParameters, String sharedSecret, String sharedSecretHeader,
String host, int port, int sslPort, int maxTotalConnections, int maxHostConnections, int socketTimeout)
{
this(secureCommsType, sslEncryptionParameters, keyResourceLoader, keyStoreParameters, encryptionParameters,
host, port, sslPort, maxTotalConnections, maxHostConnections, socketTimeout);
this.sharedSecret = sharedSecret;
this.sharedSecretHeader = sharedSecretHeader;
}
public void init()
{
this.sslKeyStore = new AlfrescoKeyStoreImpl(sslEncryptionParameters.getKeyStoreParameters(), keyResourceLoader);
@@ -272,10 +293,44 @@ public class HttpClientFactory
this.connectionTimeout = connectionTimeout;
}
protected HttpClient constructHttpClient()
/**
* Shared secret used for SECRET communication
* @param secret shared secret word
*/
public void setSharedSecret(String sharedSecret)
{
this.sharedSecret = sharedSecret;
}
/**
* @return Shared secret used for SECRET communication
*/
public String getSharedSecret()
{
return sharedSecret;
}
/**
* HTTP Request header used for SECRET communication
* @param sharedSecretHeader HTTP Request header
*/
public void setSharedSecretHeader(String sharedSecretHeader)
{
this.sharedSecretHeader = sharedSecretHeader;
}
/**
* @return HTTP Request header used for SECRET communication
*/
public String getSharedSecretHeader()
{
return sharedSecretHeader;
}
protected RequestHeadersHttpClient constructHttpClient()
{
MultiThreadedHttpConnectionManager connectionManager = new MultiThreadedHttpConnectionManager();
HttpClient httpClient = new HttpClient(connectionManager);
RequestHeadersHttpClient httpClient = new RequestHeadersHttpClient(connectionManager);
HttpClientParams params = httpClient.getParams();
params.setBooleanParameter(HttpConnectionParams.TCP_NODELAY, true);
params.setBooleanParameter(HttpConnectionParams.STALE_CONNECTION_CHECK, true);
@@ -291,15 +346,15 @@ public class HttpClientFactory
return httpClient;
}
protected HttpClient getHttpsClient()
protected RequestHeadersHttpClient getHttpsClient()
{
return getHttpsClient(host, sslPort);
}
protected HttpClient getHttpsClient(String httpsHost, int httpsPort)
protected RequestHeadersHttpClient getHttpsClient(String httpsHost, int httpsPort)
{
// Configure a custom SSL socket factory that will enforce mutual authentication
HttpClient httpClient = constructHttpClient();
RequestHeadersHttpClient httpClient = constructHttpClient();
// Default port is 443 for the HostFactory, when including customised port (like 8983) the port name is skipped from "getHostURL" string
HttpHostFactory hostFactory = new HttpHostFactory(new Protocol("https", sslSocketFactory, HttpsURL.DEFAULT_PORT));
httpClient.setHostConfiguration(new HostConfigurationWithHostFactory(hostFactory));
@@ -307,28 +362,54 @@ public class HttpClientFactory
return httpClient;
}
protected HttpClient getDefaultHttpClient()
protected RequestHeadersHttpClient getDefaultHttpClient()
{
return getDefaultHttpClient(host, port);
}
protected HttpClient getDefaultHttpClient(String httpHost, int httpPort)
protected RequestHeadersHttpClient getDefaultHttpClient(String httpHost, int httpPort)
{
HttpClient httpClient = constructHttpClient();
RequestHeadersHttpClient httpClient = constructHttpClient();
httpClient.getHostConfiguration().setHost(httpHost, httpPort);
return httpClient;
}
/**
* Build HTTP Client using default headers
* @return RequestHeadersHttpClient including default header for shared secret method
*/
protected RequestHeadersHttpClient constructSharedSecretHttpClient()
{
RequestHeadersHttpClient client = constructHttpClient();
client.setDefaultHeaders(Map.of(sharedSecretHeader, sharedSecret));
return client;
}
protected RequestHeadersHttpClient getSharedSecretHttpClient()
{
return getSharedSecretHttpClient(host, port);
}
protected RequestHeadersHttpClient getSharedSecretHttpClient(String httpHost, int httpPort)
{
RequestHeadersHttpClient httpClient = constructSharedSecretHttpClient();
httpClient.getHostConfiguration().setHost(httpHost, httpPort);
return httpClient;
}
protected AlfrescoHttpClient getAlfrescoHttpsClient()
{
AlfrescoHttpClient repoClient = new HttpsClient(getHttpsClient());
return repoClient;
return new HttpsClient(getHttpsClient());
}
protected AlfrescoHttpClient getAlfrescoHttpClient()
{
AlfrescoHttpClient repoClient = new DefaultHttpClient(getDefaultHttpClient());
return repoClient;
return new DefaultHttpClient(getDefaultHttpClient());
}
protected AlfrescoHttpClient getAlfrescoSharedSecretClient()
{
return new DefaultHttpClient(getSharedSecretHttpClient());
}
protected HttpClient getMD5HttpClient(String host, int port)
@@ -341,66 +422,37 @@ public class HttpClientFactory
public AlfrescoHttpClient getRepoClient(String host, int port)
{
AlfrescoHttpClient repoClient = null;
if(secureCommsType == SecureCommsType.HTTPS)
switch (secureCommsType)
{
repoClient = getAlfrescoHttpsClient();
case HTTPS: return getAlfrescoHttpsClient();
case NONE: return getAlfrescoHttpClient();
case SECRET: return getAlfrescoSharedSecretClient();
default: throw new AlfrescoRuntimeException("Invalid Solr secure communications type configured in [solr|alfresco].secureComms, should be 'ssl', 'none' or 'secret'");
}
else if(secureCommsType == SecureCommsType.NONE)
}
public RequestHeadersHttpClient getHttpClient()
{
switch (secureCommsType)
{
repoClient = getAlfrescoHttpClient();
case HTTPS: return getHttpsClient();
case NONE: return getDefaultHttpClient();
case SECRET: return getSharedSecretHttpClient();
default: throw new AlfrescoRuntimeException("Invalid Solr secure communications type configured in [solr|alfresco].secureComms, should be 'ssl', 'none' or 'secret'");
}
else
{
throw new AlfrescoRuntimeException("Invalid Solr secure communications type configured in alfresco.secureComms, should be 'ssl'or 'none'");
}
return repoClient;
}
public HttpClient getHttpClient()
public RequestHeadersHttpClient getHttpClient(String host, int port)
{
HttpClient httpClient = null;
if(secureCommsType == SecureCommsType.HTTPS)
switch (secureCommsType)
{
httpClient = getHttpsClient();
case HTTPS: return getHttpsClient(host, port);
case NONE: return getDefaultHttpClient(host, port);
case SECRET: return getSharedSecretHttpClient(host, port);
default: throw new AlfrescoRuntimeException("Invalid Solr secure communications type configured in [solr|alfresco].secureComms, should be 'ssl', 'none' or 'secret'");
}
else if(secureCommsType == SecureCommsType.NONE)
{
httpClient = getDefaultHttpClient();
}
else
{
throw new AlfrescoRuntimeException("Invalid Solr secure communications type configured in alfresco.secureComms, should be 'ssl'or 'none'");
}
return httpClient;
}
public HttpClient getHttpClient(String host, int port)
{
HttpClient httpClient = null;
if(secureCommsType == SecureCommsType.HTTPS)
{
httpClient = getHttpsClient(host, port);
}
else if(secureCommsType == SecureCommsType.NONE)
{
httpClient = getDefaultHttpClient(host, port);
}
else
{
throw new AlfrescoRuntimeException("Invalid Solr secure communications type configured in alfresco.secureComms, should be 'ssl'or 'none'");
}
return httpClient;
}
/**
* A secure client connection to the repository.
*

View File

@@ -0,0 +1,87 @@
/*
* Copyright (C) 2005-2021 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.httpclient;
import java.io.IOException;
import java.util.Map;
import org.apache.commons.httpclient.HostConfiguration;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.HttpMethod;
import org.apache.commons.httpclient.HttpState;
import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
/**
* Since Apache HttpClient 3.1 doesn't support including custom headers by default,
* this class is adding that custom headers every time a method is invoked.
*/
public class RequestHeadersHttpClient extends HttpClient
{
private Map<String, String> defaultHeaders;
public RequestHeadersHttpClient(MultiThreadedHttpConnectionManager connectionManager)
{
super(connectionManager);
}
public Map<String, String> getDefaultHeaders()
{
return defaultHeaders;
}
public void setDefaultHeaders(Map<String, String> defaultHeaders)
{
this.defaultHeaders = defaultHeaders;
}
private void addDefaultHeaders(HttpMethod method)
{
if (defaultHeaders != null)
{
defaultHeaders.forEach((k,v) -> {
method.addRequestHeader(k, v);
});
}
}
@Override
public int executeMethod(HttpMethod method) throws IOException, HttpException
{
addDefaultHeaders(method);
return super.executeMethod(method);
}
@Override
public int executeMethod(HostConfiguration hostConfiguration, HttpMethod method) throws IOException, HttpException
{
addDefaultHeaders(method);
return super.executeMethod(hostConfiguration, method);
}
@Override
public int executeMethod(HostConfiguration hostconfig, HttpMethod method, HttpState state)
throws IOException, HttpException
{
addDefaultHeaders(method);
return super.executeMethod(hostconfig, method, state);
}
}

View File

@@ -113,7 +113,7 @@ public abstract class AbstractCannedQuery<R> implements CannedQuery<R>
final List<List<R>> finalPages = pages;
// Has more items beyond requested pages ? ... ie. at least one more page (with at least one result)
final boolean hasMoreItems = (rawResults.size() > pagingDetails.getResultsRequiredForPaging());
final boolean hasMoreItems = (rawResults.size() > pagingDetails.getResultsRequiredForPaging()) || (totalCount.getFirst() > pagingDetails.getResultsRequiredForPaging());
results = new CannedQueryResults<R>()
{

View File

@@ -24,8 +24,10 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.time.Duration;
import java.util.concurrent.atomic.AtomicLong;
import org.alfresco.api.AlfrescoPublicApi;
import org.alfresco.api.AlfrescoPublicApi;
import org.alfresco.error.AlfrescoRuntimeException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -348,6 +350,17 @@ public class TempFileProvider
{
public static final String KEY_PROTECT_HOURS = "protectHours";
public static final String KEY_DIRECTORY_NAME = "directoryName";
public static final String KEY_MAX_FILES_TO_DELETE = "maxFilesToDelete";
public static final String KEY_MAX_TIME_TO_RUN = "maxTimeToRun";
/** The time when the job has actually started */
private static long jobStartTime;
/** The maximum number of files that can be deleted when the cleaning jobs runs */
private static AtomicLong maxFilesToDelete;
/** The maximum time allowed for the cleaning job to run */
private static Duration maxTimeToRun;
/**
* Gets a list of all files in the {@link TempFileProvider#ALFRESCO_TEMP_FILE_DIR temp directory}
@@ -376,24 +389,59 @@ public class TempFileProvider
}
String directoryName = (String) context.getJobDetail().getJobDataMap().get(KEY_DIRECTORY_NAME);
try
{
final Object oMaxFilesToDelete = context.getJobDetail().getJobDataMap().get(KEY_MAX_FILES_TO_DELETE);
if (oMaxFilesToDelete != null)
{
final String strMaxFilesToDelete = (String) oMaxFilesToDelete;
maxFilesToDelete = new AtomicLong(Long.parseLong(strMaxFilesToDelete));
logger.debug("Set the maximum number of temp files to be deleted to: " + maxFilesToDelete.get());
}
else
{
logger.debug("No maximum number of files was configured for the temp file clean job.");
}
}
catch (Exception e)
{
logger.warn(e);
throw new JobExecutionException("Invalid job data, maxFilesToDelete");
}
try
{
final Object oMaxTimeToRun = context.getJobDetail().getJobDataMap().get(KEY_MAX_TIME_TO_RUN);
if (oMaxTimeToRun != null)
{
final String strMaxTimeToRun = (String) oMaxTimeToRun;
maxTimeToRun = Duration.parse(strMaxTimeToRun);
logger.debug("Set the maximum duration time of the temp file clean job to: " + maxTimeToRun);
}
else
{
logger.debug("No maximum duration was configured for the temp file clean job.");
}
}
catch (Exception e)
{
logger.warn(e);
throw new JobExecutionException("Invalid job data, maxTimeToRun");
}
if (directoryName == null)
{
directoryName = ALFRESCO_TEMP_FILE_DIR;
}
long now = System.currentTimeMillis();
long aFewHoursBack = now - (3600L * 1000L * protectHours);
long aLongTimeBack = now - (24 * 3600L * 1000L);
jobStartTime = System.currentTimeMillis();
long aFewHoursBack = jobStartTime - (3600L * 1000L * protectHours);
long aLongTimeBack = jobStartTime - (24 * 3600L * 1000L);
File tempDir = TempFileProvider.getTempDir(directoryName);
int count = removeFiles(tempDir, aFewHoursBack, aLongTimeBack, false); // don't delete this directory
// done
if (logger.isDebugEnabled())
{
logger.debug("Removed " + count + " files from temp directory: " + tempDir);
}
logger.debug("Removed " + count + " files from temp directory: " + tempDir);
}
/**
@@ -429,29 +477,23 @@ public class TempFileProvider
}
// list all files
File[] files = directory.listFiles();
File[] filesToIterate = files != null ? files : new File[0];
int count = 0;
for (File file : files)
for (File file : filesToIterate)
{
if (shouldTheDeletionStop())
{
break;
}
if (file.isDirectory())
{
if(isLongLifeTempDir(file))
{
// long life for this folder and its children
int countRemoved = removeFiles(file, longLifeBefore, longLifeBefore, true);
if (logger.isDebugEnabled())
{
logger.debug("Removed " + countRemoved + " files from temp directory: " + file);
}
}
else
{
// enter subdirectory and clean it out and remove itsynetics
int countRemoved = removeFiles(file, removeBefore, longLifeBefore, true);
if (logger.isDebugEnabled())
{
logger.debug("Removed " + countRemoved + " files from directory: " + file);
}
}
// long life for this folder and its children
// OR
// enter subdirectory and clean it out and remove itsynetics
int countRemoved = removeFiles(file,
isLongLifeTempDir(file) ? longLifeBefore : removeBefore, longLifeBefore,
true);
logger.debug("Removed " + countRemoved + " files from " + (isLongLifeTempDir(file) ? "temp " : " ") + "directory: " + file);
}
else
{
@@ -464,11 +506,19 @@ public class TempFileProvider
// it is a file - attempt a delete
try
{
if(logger.isDebugEnabled())
{
logger.debug("Deleting temp file: " + file);
}
logger.debug("Deleting temp file: " + file);
file.delete();
if (maxFilesToDelete != null)
{
maxFilesToDelete.decrementAndGet();
logger.debug(maxFilesToDelete.get() + " files left to delete.");
}
if (maxTimeToRun != null)
{
logger.debug((jobStartTime + maxTimeToRun.toMillis() - System.currentTimeMillis()) + " millis left to delete.");
}
count++;
}
catch (Throwable e)
@@ -487,10 +537,8 @@ public class TempFileProvider
if(listing != null && listing.length == 0)
{
// directory is empty
if(logger.isDebugEnabled())
{
logger.debug("Deleting empty directory: " + directory);
}
logger.debug("Deleting empty directory: " + directory);
// ignore the limits for empty directories that just need cleanup
directory.delete();
}
}
@@ -499,8 +547,21 @@ public class TempFileProvider
logger.info("Failed to remove temp directory: " + directory, e);
}
}
// done
return count;
}
/**
* Decides whether or not the job should continue iterating through the temp files and delete.
* It achieves the result by checking the number of files deleted against the limit and whether
* or not it is within the time limit
*
* @return true or false
*/
private static boolean shouldTheDeletionStop()
{
return maxFilesToDelete != null && maxFilesToDelete.get() <= 0
|| maxTimeToRun != null && ((jobStartTime + maxTimeToRun.toMillis()) < System
.currentTimeMillis());
}
}
}

View File

@@ -424,12 +424,7 @@ public abstract class AbstractAsynchronouslyRefreshedCache<T>
@Override
public Void call()
{
long threadId = Thread.currentThread().getId();
logger.debug("Thread # " + threadId + "-> call()");
logger.debug("Thread # " + threadId + "call()->liveLock.writeLock().lock()");
liveLock.writeLock().lock();
logger.debug("Thread # " + threadId + "call()->liveLock.writeLock().locked [");
liveLock.writeLock().lock();
try
{
doCall();
@@ -452,9 +447,7 @@ public abstract class AbstractAsynchronouslyRefreshedCache<T>
}
finally
{
logger.debug("Thread # " + threadId + "call()->liveLock.writeLock().unlock()");
liveLock.writeLock().unlock();
logger.debug("Thread # " + threadId + "call()->liveLock.writeLock().unlocked]");
}
}

View File

@@ -18,7 +18,10 @@
*/
package org.alfresco.util.transaction;
import static java.util.Collections.emptyList;
import java.lang.reflect.Method;
import java.util.Collection;
import javax.transaction.HeuristicMixedException;
import javax.transaction.HeuristicRollbackException;
@@ -135,7 +138,9 @@ public class SpringAwareUserTransaction
private long threadId = Long.MIN_VALUE;
/** make sure that we clean up the thread transaction stack properly */
private boolean finalized = false;
private Collection<String> labels = emptyList();
/**
* Creates a user transaction that defaults to {@link TransactionDefinition#PROPAGATION_REQUIRED}.
*
@@ -200,6 +205,21 @@ public class SpringAwareUserTransaction
return null;
}
/**
* Associate one or more labels with this transaction attribute.
* <p>This may be used for applying specific transactional behavior
* or follow a purely descriptive nature.
*/
public void setLabels(Collection<String> labels) {
this.labels = labels;
}
@Override
public Collection<String> getLabels()
{
return this.labels;
}
/**
* The {@link UserTransaction } must rollback regardless of the error. The
* {@link #rollback() rollback} behaviour is implemented by simulating a caught

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>repo-5439-M3c1</version>
<version>9.40</version>
</parent>
<properties>
@@ -127,9 +127,28 @@
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<!--
| compile dependencies
-->
<!-- Jakarta... -->
<dependency>
<groupId>jakarta.activation</groupId>
<artifactId>jakarta.activation-api</artifactId>
</dependency>
<!-- REPO-5047 - Replaces com.sun.activation:javax.activation -->
<dependency>
<groupId>com.sun.activation</groupId>
<artifactId>jakarta.activation</artifactId>
</dependency>
<!-- REPO-5047 - Replaces javax.annotation:javax.annotation-api -->
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
</dependency>
<!-- REPO-5047 - Replaces org.apache.geronimo.specs:geronimo-ws-metadata_2.0_spec -->
<dependency>
<groupId>jakarta.jws</groupId>
<artifactId>jakarta.jws-api</artifactId>
</dependency>
<dependency>
<groupId>org.jibx</groupId>
<artifactId>jibx-run</artifactId>
@@ -148,31 +167,9 @@
<dependency>
<groupId>com.fasterxml.woodstox</groupId>
<artifactId>woodstox-core</artifactId>
<version>5.0.3</version>
</dependency>
<!-- REPO-5047 - Replaces org.apache.geronimo.specs:geronimo-ws-metadata_2.0_spec -->
<dependency>
<groupId>jakarta.jws</groupId>
<artifactId>jakarta.jws-api</artifactId>
<version>1.1.1</version>
</dependency>
<!-- REPO-5047 - Replaces org.apache.geronimo.specs:geronimo-jta_1.1_spec -->
<dependency>
<groupId>jakarta.transaction</groupId>
<artifactId>jakarta.transaction-api</artifactId>
</dependency>
<!-- REPO-5047 - Replaces javax.annotation:javax.annotation-api -->
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
<version>1.3.5</version>
</dependency>
<!-- REPO-5047 - Replaces com.sun.activation:javax.activation -->
<dependency>
<groupId>com.sun.activation</groupId>
<artifactId>jakarta.activation</artifactId>
<version>1.2.2</version>
<version>6.2.6</version>
</dependency>
<!-- the cxf libs were updated, see dependencyManagement section -->
<dependency>
<groupId>org.apache.chemistry.opencmis</groupId>
@@ -266,15 +263,6 @@
<groupId>asm</groupId>
<artifactId>asm</artifactId>
</exclusion>
<!-- Duplicate classes from com.sun.xml.bind:jaxb-core-->
<exclusion>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>txw2</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.istack</groupId>
<artifactId>istack-commons-runtime</artifactId>
</exclusion>
<!-- Duplicates classes from jakarta.jws:jakarta.jws-api -->
<exclusion>
<groupId>org.apache.geronimo.specs</groupId>
@@ -295,6 +283,31 @@
<groupId>com.sun.activation</groupId>
<artifactId>javax.activation</artifactId>
</exclusion>
<!-- No longer needed -->
<exclusion>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox-tools</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.pdfbox</groupId>
<artifactId>preflight</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.pdfbox</groupId>
<artifactId>jempbox</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.pdfbox</groupId>
<artifactId>xmpbox</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.pdfbox</groupId>
<artifactId>jbig2-imageio</artifactId>
</exclusion>
</exclusions>
</dependency>

View File

@@ -662,7 +662,6 @@ public class MimetypeMap implements MimetypeService
boolean successReadingConfig = true;
if (jsonConfigFileFinder != null)
{
// This should not be "alfresco/mimetype" which is used for the in JVM jodconverter
successReadingConfig &= jsonConfigFileFinder.readFiles("alfresco/mimetypes", logger);
if (mimetypeJsonConfigDir != null && !mimetypeJsonConfigDir.isBlank())
{
@@ -877,11 +876,6 @@ public class MimetypeMap implements MimetypeService
*/
private MediaType detectType(String filename, ContentReader reader)
{
// Metadata metadata = new Metadata();
// if (filename != null)
// {
// metadata.add(Metadata.RESOURCE_NAME_KEY, filename);
// }
TikaInputStream inp = null;
try
{

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Data model classes
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* Copyright (C) 2005 - 2021 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Data model classes
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -33,8 +33,7 @@ import org.alfresco.api.AlfrescoPublicApi;
* same action might succeed, all other things not having changed.
* <p/>
* An example of this would be the case where a request to create a thumbnail
* has failed because the necessary thumbnailing software is not available e.g. because the OpenOffice.org process
* is not currently running.
* has failed because the necessary thumbnailing software is not available.
*
* @author Neil Mc Erlean
* @since 4.0.1

View File

@@ -100,26 +100,25 @@ public abstract class BaseApplicationContextHelper
classpath[i] = resources[i].getURL();
}
// Let's give our classloader 'child-first' resource loading qualities!
ClassLoader classLoader = new URLClassLoader(classpath, Thread.currentThread().getContextClassLoader())
{
@Override
public URL getResource(String name)
{
URL ret = findResource(name);
return ret == null ? super.getResource(name) : ret;
}
return new URLClassLoader(classpath, Thread.currentThread().getContextClassLoader())
{
@Override
public URL getResource(String name)
{
URL ret = findResource(name);
return ret == null ? super.getResource(name) : ret;
}
@SuppressWarnings("rawtypes")
@Override
public Enumeration<URL> getResources(String name) throws IOException
{
Enumeration[] tmp = new Enumeration[2];
tmp[0] = findResources(name);
tmp[1] = super.getResources(name);
return new CompoundEnumeration<URL>(tmp);
}
};
return classLoader;
@SuppressWarnings("rawtypes")
@Override
public Enumeration<URL> getResources(String name) throws IOException
{
Enumeration[] tmp = new Enumeration[2];
tmp[0] = findResources(name);
tmp[1] = super.getResources(name);
return new CompoundEnumeration<URL>(tmp);
}
};
}
/**

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* Copyright (C) 2005 - 2021 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -57,12 +57,18 @@ public abstract class ConfigScheduler<Data>
public static class ConfigSchedulerJob implements Job
{
@Override
// Synchronized has little effect in normal operation, but on laptops that are suspended, there can be a number
// of Threads calling execute concurrently without it, resulting in errors in the log. Theoretically possible in
// production but not very likely.
public void execute(JobExecutionContext context) throws JobExecutionException
{
JobDataMap dataMap = context.getJobDetail().getJobDataMap();
ConfigScheduler configScheduler = (ConfigScheduler)dataMap.get(CONFIG_SCHEDULER);
boolean successReadingConfig = configScheduler.readConfigAndReplace(true);
configScheduler.changeScheduleOnStateChange(successReadingConfig);
synchronized (configScheduler)
{
boolean successReadingConfig = configScheduler.readConfigAndReplace(true);
configScheduler.changeScheduleOnStateChange(successReadingConfig);
}
}
}

File diff suppressed because one or more lines are too long

View File

@@ -9,6 +9,6 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-packaging</artifactId>
<version>repo-5439-M3c1</version>
<version>9.40</version>
</parent>
</project>

View File

@@ -1,110 +0,0 @@
The authoritative ImageMagick license can be found at
http://www.imagemagick.org/script/license.php and ImageMagick notices at
http://www.imagemagick.org/www/Notice.html.
Before we get to the text of the license, lets just review what the license says in simple terms:
It allows you to:
* freely download and use ImageMagick software, in whole or in part, for personal, company internal, or commercial purposes;
* use ImageMagick software in packages or distributions that you create;
* link against a library under a different license;
* link code under a different license against a library under this license;
* merge code into a work under a different license;
* extend patent grants to any code using code under this license;
*and extend patent protection.
It forbids you to:
* redistribute any piece of ImageMagick-originated software without proper attribution;
* use any marks owned by ImageMagick Studio LLC in any way that might state or imply that ImageMagick Studio LLC endorses your distribution;
* use any marks owned by ImageMagick Studio LLC in any way that might state or imply that you created the ImageMagick software in question.
It requires you to:
* include a copy of the license in any redistribution you may make that includes ImageMagick software;
* provide clear attribution to ImageMagick Studio LLC for any distributions that include ImageMagick software.
It does not require you to:
* include the source of the ImageMagick software itself, or of any modifications you may have made to it, in any redistribution you may assemble that includes it;
* submit changes that you make to the software back to the ImageMagick Studio LLC (though such feedback is encouraged).
A few other clarifications include:
* ImageMagick is freely available without charge;
* you may include ImageMagick on any digital media as long as you comply with the terms of the license;
* you can give modified code away for free or sell it under the terms of the ImageMagick license or distribute the result under a different license, but you need to acknowledge the use of the ImageMagick software;
* the license is compatible with the GPL V3.
* when exporting the ImageMagick software, review its export classification.
Terms and Conditions for Use, Reproduction, and Distribution
The legally binding and authoritative terms and conditions for use, reproduction, and distribution of ImageMagick follow:
Copyright © 1999-2018 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available.
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
a. You must give any other recipients of the Work or Derivative Works a copy of this License; and
b. You must cause any modified files to carry prominent notices stating that You changed the files; and
c. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
d. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
How to Apply the License to your Work
To apply the ImageMagick License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information (don't include the brackets). The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the ImageMagick License (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy
of the License at
https://www.imagemagick.org/script/license.php
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.

File diff suppressed because it is too large Load Diff

View File

@@ -45,7 +45,6 @@ commons-pool http://jakarta.apache.org/commons/
commons-validator http://jakarta.apache.org/commons/
ConcurrentLinkedHashMap http://code.google.com/p/concurrentlinkedhashmap/
Fast Infoset Project http://fi.java.net/
PDFBox http://pdfbox.apache.org/
Google Data Java Client Library http://code.google.com/p/gdata-java-client/
Geronimo Activation http://geronimo.apache.org/
Geronimo Annotation http://geronimo.apache.org/
@@ -191,10 +190,6 @@ truezip http://truezip.java.net/
icu4j http://icu-project.org/
=== Imagemagick ===
Imagemagick http://www.imagemagick.org/script/license.php
=== JSON license ===
JSon http://www.json.org/java/
@@ -211,16 +206,11 @@ libwmf http://wvware.sourceforge.net/libwmf.html
=== LGPL 2.1 ===
Hibernate http://www.hibernate.org/
jid3lib http://javamusictag.sourceforge.net/
JMagick http://sourceforge.net/projects/jmagick/
JODConverter http://jodconverter.sourceforge.net/
PDF Renderer http://java.net/projects/pdf-renderer
TinyMCE http://www.tinymce.com/
=== LGPL 3.0 ===
Gytheio https://github.com/Alfresco/gytheio
Jut.jar http://www.openoffice.org/licenses/lgpl_license.html
OpenOffice SDK http://www.openoffice.org/licenses/lgpl_license.html
=== MIT License ===
@@ -243,7 +233,6 @@ juniversalchardet http://code.google.com/p/juniversalchardet/
=== Mozilla Public License 2.0 ===
CCC2 http://www.webdetails.pt/ctools/ccc/
rhino-js http://www.mozilla.org/rhino/
LibreOffice http://www.libreoffice.org/
=== Oracle Binary Code License ===
@@ -279,7 +268,6 @@ The svn diff files with the details of the changes can be found in the following
=== Apache 2.0 License ====
acegi http://sourceforge.net/projects/acegisecurity/
commons-dbcp http://jakarta.apache.org/commons/
PDFBox http://pdfbox.apache.org/
Greenmail http://www.icegreen.com/greenmail/
POI http://poi.apache.org/
quartz http://quartz-scheduler.org/
@@ -297,12 +285,9 @@ TrueLicense http://truelicense.java.net/
=== LGPL 2.1 ===
Hibernate http://www.hibernate.org/
JODConverter http://jodconverter.sourceforge.net/
PDF Renderer http://java.net/projects/pdf-renderer
TinyMCE http://www.tinymce.com/
=== LGPL 3.0 ===
Jut.jar http://www.openoffice.org/licenses/lgpl_license.html
=== Mozilla Public License 2.0 ===
rhino-js http://www.mozilla.org/rhino/

View File

@@ -1,6 +1,6 @@
# Fetch image based on Tomcat 8.5 and Java 11
# Fetch image based on Tomcat 9.0, Java 11 and Centos 8
# More infos about this image: https://github.com/Alfresco/alfresco-docker-base-tomcat
FROM alfresco/alfresco-base-tomcat:8.5.51-java-11-openjdk-centos-7
FROM alfresco/alfresco-base-tomcat:9.0.52-java-11-centos-7
# Set default docker_context.
ARG resource_path=target
@@ -68,8 +68,8 @@ RUN sed -i -e "s_log4j.appender.File.File\=alfresco.log_log4j.appender.File.File
RUN yum install -y fontconfig-2.13.0-4.3.el7 \
dejavu-fonts-common-2.33-6.el7 \
fontpackages-filesystem-1.44-8.el7 \
freetype-2.8-12.el7 \
libpng-1.5.13-7.el7_2 \
freetype-2.8-14.el7_9.1 \
libpng-1.5.13-8.el7 \
dejavu-sans-fonts-2.33-6.el7 && \
yum clean all

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-packaging</artifactId>
<version>repo-5439-M3c1</version>
<version>9.40</version>
</parent>
<properties>
@@ -134,17 +134,11 @@
<plugins>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>fabric8-maven-plugin</artifactId>
<artifactId>docker-maven-plugin</artifactId>
<configuration>
<images>
<image>
<name>${image.name}:${image.tag}</name>
<build>
<dockerFileDir>${project.basedir}/</dockerFileDir>
<buildOptions>
<squash>true</squash>
</buildOptions>
</build>
</image>
</images>
</configuration>
@@ -169,29 +163,17 @@
<plugins>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>fabric8-maven-plugin</artifactId>
<artifactId>docker-maven-plugin</artifactId>
<configuration>
<images>
<!-- Quay image -->
<image>
<name>${image.name}:${image.tag}</name>
<registry>${image.registry}</registry>
<build>
<dockerFileDir>${project.basedir}/</dockerFileDir>
<buildOptions>
<squash>true</squash>
</buildOptions>
</build>
</image>
<!-- DockerHub image -->
<image>
<name>${image.name}:${image.tag}</name>
<build>
<dockerFileDir>${project.basedir}/</dockerFileDir>
<buildOptions>
<squash>true</squash>
</buildOptions>
</build>
</image>
</images>
</configuration>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>repo-5439-M3c1</version>
<version>9.40</version>
</parent>
<profiles>

View File

@@ -1,4 +1,4 @@
TRANSFORMERS_TAG=2.3.6
SOLR6_TAG=2.0.1
POSTGRES_TAG=11.7
ACTIVEMQ_TAG=5.15.8
TRANSFORMERS_TAG=2.4.0
SOLR6_TAG=2.0.2-RC2
POSTGRES_TAG=13.1
ACTIVEMQ_TAG=5.16.1

View File

@@ -38,13 +38,8 @@ services:
-Dftp.dataPortTo=30099
-Dshare.host=localhost
-Daos.baseUrlOverwrite=http://localhost:8082/alfresco/aos
-Dmessaging.broker.url=\"failover:(tcp://activemq:61616)?timeout=3000&jms.useCompression=true\"
-Dmessaging.broker.url=\"failover:(nio://activemq:61616)?timeout=3000&jms.useCompression=true\"
-DlocalTransform.core-aio.url=http://transform-core-aio:8090/
-Dalfresco-pdf-renderer.url=http://transform-core-aio:8090/
-Djodconverter.url=http://transform-core-aio:8090/
-Dimg.url=http://transform-core-aio:8090/
-Dtika.url=http://transform-core-aio:8090/
-Dtransform.misc.url=http://transform-core-aio:8090/
-Dimap.server.port=1143
-Dftp.port=1221
-Dcors.enabled=true

View File

@@ -38,7 +38,7 @@ services:
-Dftp.dataPortTo=30099
-Dshare.host=localhost
-Daos.baseUrlOverwrite=http://localhost:8082/alfresco/aos
-Dmessaging.broker.url=\"failover:(tcp://activemq:61616)?timeout=3000&jms.useCompression=true\"
-Dmessaging.broker.url=\"failover:(nio://activemq:61616)?timeout=3000&jms.useCompression=true\"
-Dlocal.transform.service.enabled=false
-Dlegacy.transform.service.enabled=false
-Dimap.server.port=1143

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-packaging</artifactId>
<version>repo-5439-M3c1</version>
<version>9.40</version>
</parent>
<modules>

View File

@@ -9,7 +9,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-tests</artifactId>
<version>repo-5439-M3c1</version>
<version>9.40</version>
</parent>
<developers>

View File

@@ -9,7 +9,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-tests</artifactId>
<version>repo-5439-M3c1</version>
<version>9.40</version>
</parent>
<developers>

View File

@@ -9,7 +9,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-tests</artifactId>
<version>repo-5439-M3c1</version>
<version>9.40</version>
</parent>
<developers>
@@ -39,16 +39,14 @@
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>javax.mail-api</artifactId>
<version>${dependency.javax.mail.version}</version>
<groupId>jakarta.mail</groupId>
<artifactId>jakarta.mail-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>javax.mail</artifactId>
<version>${dependency.javax.mail.version}</version>
<artifactId>jakarta.mail</artifactId>
</dependency>
<dependency>
@@ -95,7 +93,7 @@
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<version>2.4.0</version>
<version>2.5.0</version>
</dependency>
</dependencies>

View File

@@ -9,7 +9,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-tests</artifactId>
<version>repo-5439-M3c1</version>
<version>9.40</version>
</parent>
<developers>
@@ -59,7 +59,7 @@
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.json</artifactId>
<artifactId>jakarta.json</artifactId>
<scope>test</scope>
</dependency>
<dependency>

View File

@@ -0,0 +1,54 @@
package org.alfresco.rest.models.aspects;
import org.alfresco.rest.RestTest;
import org.alfresco.rest.model.RestAspectModel;
import org.alfresco.rest.model.RestErrorModel;
import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.http.HttpStatus;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
public class GetAspectTests extends RestTest
{
@BeforeClass(alwaysRun=true)
public void dataPreparation() throws Exception
{
restClient.authenticateUser(dataUser.createRandomTestUser());
}
@Test(groups = { TestGroup.REST_API, TestGroup.MODEL, TestGroup.REGRESSION })
@TestRail(section = { TestGroup.REST_API, TestGroup.MODEL }, executionType = ExecutionType.REGRESSION,
description = "Verify inexistent aspect and status code is Not Found (404)")
public void getInexistentAspect() throws Exception
{
String unknownAspect = "unknown:aspect";
restClient.withModelAPI().getAspect(unknownAspect);
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND)
.assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_WAS_NOT_FOUND, unknownAspect));
}
@Test(groups = { TestGroup.REST_API, TestGroup.MODEL, TestGroup.REGRESSION })
@TestRail(section = { TestGroup.REST_API, TestGroup.MODEL }, executionType = ExecutionType.REGRESSION,
description = "Verify Aspect Info and status code is OK (200)")
public void getAspect() throws Exception
{
RestAspectModel aspect = restClient.withModelAPI().getAspect("cm:titled");
restClient.assertStatusCodeIs(HttpStatus.OK);
aspect.assertThat().field("associations").isEmpty().and()
.field("mandatoryAspects").isEmpty().and()
.field("properties").isNotEmpty().and()
.field("includedInSupertypeQuery").is(true).and()
.field("isContainer").is(false).and()
.field("id").is("cm:titled").and()
.field("description").is("Titled").and()
.field("title").is("Titled").and()
.field("model.id").is("cm:contentmodel").and()
.field("model.author").is("Alfresco").and()
.field("model.description").is("Alfresco Content Domain Model").and()
.field("model.namespaceUri").is("http://www.alfresco.org/model/content/1.0").and()
.field("model.namespacePrefix").is("cm");
}
}

View File

@@ -0,0 +1,199 @@
package org.alfresco.rest.models.aspects;
import org.alfresco.rest.RestTest;
import org.alfresco.rest.model.RestAbstractClassModel;
import org.alfresco.rest.model.RestAspectsCollection;
import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.http.HttpStatus;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
public class GetAspectsTests extends RestTest
{
private UserModel regularUser;
@BeforeClass(alwaysRun=true)
public void dataPreparation() throws Exception
{
regularUser = dataUser.createRandomTestUser();
}
@Test(groups = { TestGroup.REST_API, TestGroup.MODEL, TestGroup.REGRESSION })
@TestRail(section = {TestGroup.REST_API, TestGroup.MODEL }, executionType = ExecutionType.REGRESSION,
description = "Verify user get aspects and gets status code OK (200)")
public void getAspects() throws Exception
{
RestAspectsCollection aspects = restClient.authenticateUser(regularUser).withModelAPI()
.getAspects();
restClient.assertStatusCodeIs(HttpStatus.OK);
aspects.assertThat()
.entriesListCountIs(100)
.and().entriesListContains("id", "cm:classifiable")
.and().entriesListContains("id", "cm:author")
.and().entriesListContains("id", "cm:checkedOut");
}
@Test(groups = { TestGroup.REST_API, TestGroup.MODEL, TestGroup.REGRESSION })
@TestRail(section = {TestGroup.REST_API, TestGroup.MODEL }, executionType = ExecutionType.REGRESSION,
description = "Should filter aspects using namespace uri and gets status code OK (200)")
public void getAspectByNamespaceUri() throws Exception
{
RestAspectsCollection aspects = restClient.authenticateUser(regularUser).withModelAPI()
.usingParams("where=(namespaceUri matches('http://www.alfresco.org/model.*'))")
.getAspects();
restClient.assertStatusCodeIs(HttpStatus.OK);
aspects.assertThat().entriesListCountIs(100);
aspects = restClient.authenticateUser(regularUser).withModelAPI()
.usingParams("where=(not namespaceUri matches('http://www.alfresco.org/model.*'))")
.getAspects();
restClient.assertStatusCodeIs(HttpStatus.OK);
aspects.assertThat().entriesListCountIs(0);
}
@Test(groups = { TestGroup.REST_API, TestGroup.MODEL, TestGroup.REGRESSION })
@TestRail(section = {TestGroup.REST_API, TestGroup.MODEL }, executionType = ExecutionType.REGRESSION,
description = "Should filter aspects using modelId and gets status code OK (200)")
public void getAspectByModelsIds() throws Exception
{
RestAspectsCollection aspects = restClient.authenticateUser(regularUser).withModelAPI()
.usingParams("where=(modelId in ('cm:contentmodel', 'smf:smartFolder'))")
.getAspects();
restClient.assertStatusCodeIs(HttpStatus.OK);
aspects.getPagination().assertThat().fieldsCount().is(5).and()
.field("totalItems").isLessThan(65).and()
.field("maxItems").is(100).and()
.field("skipCount").isGreaterThan(0).and()
.field("hasMoreItems").is(false);
}
@Test(groups = { TestGroup.REST_API, TestGroup.MODEL, TestGroup.REGRESSION })
@TestRail(section = {TestGroup.REST_API, TestGroup.MODEL }, executionType = ExecutionType.REGRESSION,
description = "Should filter aspects using modelId with subaspects and gets status code OK (200)")
public void getAspectByModelsIdsWithIncludeSubAspects() throws Exception
{
RestAspectsCollection aspects = restClient.authenticateUser(regularUser).withModelAPI()
.usingParams("where=(modelId in ('cm:contentmodel INCLUDESUBASPECTS', 'smf:smartFolder INCLUDESUBASPECTS'))")
.getAspects();
restClient.assertStatusCodeIs(HttpStatus.OK);
aspects.getPagination().assertThat().fieldsCount().is(5).and()
.field("totalItems").isGreaterThan(65).and()
.field("maxItems").is(100).and()
.field("skipCount").isGreaterThan(0).and()
.field("hasMoreItems").is(false);
}
@Test(groups = { TestGroup.REST_API, TestGroup.MODEL, TestGroup.REGRESSION })
@TestRail(section = {TestGroup.REST_API, TestGroup.MODEL }, executionType = ExecutionType.REGRESSION,
description = "Should filter aspects using parentId and gets status code OK (200)")
public void getAspectByParentId() throws Exception
{
RestAspectsCollection aspects = restClient.authenticateUser(regularUser).withModelAPI()
.usingParams("where=(parentId in ('cm:titled'))")
.getAspects();
restClient.assertStatusCodeIs(HttpStatus.OK);
aspects.getPagination().assertThat().fieldsCount().is(5).and()
.field("totalItems").is(5).and()
.field("hasMoreItems").is(false);
}
@Test(groups = { TestGroup.REST_API, TestGroup.MODEL, TestGroup.REGRESSION })
@TestRail(section = {TestGroup.REST_API, TestGroup.MODEL }, executionType = ExecutionType.REGRESSION,
description = "Should Aspects association, properties and mandatory aspects and gets status code OK (200)")
public void getAspectIncludeParams() throws Exception
{
RestAspectsCollection aspects = restClient.authenticateUser(regularUser).withModelAPI()
.usingParams("include=properties,mandatoryAspects,associations")
.getAspects();
restClient.assertStatusCodeIs(HttpStatus.OK);
for (RestAbstractClassModel aspect : aspects.getEntries())
{
aspect.onModel().assertThat()
.field("associations").isNotNull().and()
.field("properties").isNotNull().and()
.field("mandatoryAspects").isNotNull();
}
}
@Test(groups = { TestGroup.REST_API, TestGroup.MODEL, TestGroup.REGRESSION })
@TestRail(section = {TestGroup.REST_API, TestGroup.MODEL }, executionType = ExecutionType.REGRESSION,
description = "Should verify the query errors with possible options")
public void verifyAspectsQueryError()
{
restClient.authenticateUser(regularUser).withModelAPI()
.usingParams("where=(modelId in (' ')")
.getAspects();
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST);
restClient.authenticateUser(regularUser).withModelAPI()
.usingParams("where=(modelId in ('cm:contentmodel INCLUDESUBASPECTS',))")
.getAspects();
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST);
restClient.authenticateUser(regularUser).withModelAPI()
.usingParams("where=(modelId in ('cm:contentmodel INCLUDESUBTYPES'))")
.getAspects();
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST);
restClient.authenticateUser(regularUser).withModelAPI()
.usingParams("where=(parentId in (' ')")
.getAspects();
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST);
restClient.authenticateUser(regularUser).withModelAPI()
.usingParams("where=(parentId in ('cm:content',))")
.getAspects();
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST);
restClient.authenticateUser(regularUser).withModelAPI()
.usingParams("where=(parentId in ('cm:content',))&include=properties")
.getAspects();
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST);
restClient.authenticateUser(regularUser).withModelAPI()
.usingParams("where=(namespaceUri matches('*'))")
.getAspects();
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST);
restClient.authenticateUser(regularUser).withModelAPI()
.usingParams("where=(parentId in ('cm:content'))&include=properties")
.getAspects();
restClient.assertStatusCodeIs(HttpStatus.OK);
}
@Test(groups = { TestGroup.REST_API, TestGroup.MODEL, TestGroup.REGRESSION })
@TestRail(section={TestGroup.REST_API, TestGroup.MODEL}, executionType= ExecutionType.REGRESSION,
description= "Verify if any user gets aspects with high skipCount and maxItems parameter applied")
public void getPaginationParameter() throws Exception
{
RestAspectsCollection aspects = restClient.authenticateUser(regularUser)
.withModelAPI()
.usingParams("maxItems=10&skipCount=10")
.getAspects();
aspects.assertThat().entriesListCountIs(10);
aspects.assertThat().paginationField("hasMoreItems").is("true");
aspects.assertThat().paginationField("skipCount").is("10");
aspects.assertThat().paginationField("maxItems").is("10");
restClient.assertStatusCodeIs(HttpStatus.OK);
}
@Test(groups = { TestGroup.REST_API, TestGroup.MODEL, TestGroup.REGRESSION })
@TestRail(section={TestGroup.REST_API, TestGroup.MODEL}, executionType= ExecutionType.REGRESSION,
description= "Verify if any user gets aspects with hasMoreItems applied bases on skip count and maxItems")
public void getHighPaginationQuery() throws Exception
{
RestAspectsCollection aspects = restClient.authenticateUser(regularUser).withModelAPI()
.usingParams("maxItems=10&skipCount=150")
.getAspects();
aspects.assertThat().entriesListCountIs(0);
aspects.assertThat().paginationField("hasMoreItems").is("false");
aspects.assertThat().paginationField("skipCount").is("150");
aspects.assertThat().paginationField("maxItems").is("10");
restClient.assertStatusCodeIs(HttpStatus.OK);
}
}

View File

@@ -0,0 +1,55 @@
package org.alfresco.rest.models.types;
import org.alfresco.rest.RestTest;
import org.alfresco.rest.model.RestErrorModel;
import org.alfresco.rest.model.RestTypeModel;
import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.http.HttpStatus;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
public class GetTypeTests extends RestTest
{
@BeforeClass(alwaysRun=true)
public void dataPreparation() throws Exception
{
restClient.authenticateUser(dataUser.createRandomTestUser());
}
@Test(groups = { TestGroup.REST_API, TestGroup.MODEL, TestGroup.REGRESSION })
@TestRail(section = { TestGroup.REST_API, TestGroup.MODEL }, executionType = ExecutionType.REGRESSION,
description = "Verify inexistent type and status code is Not Found (404)")
public void getInexistentType() throws Exception
{
String unknownType = "unknown:type";
restClient.withModelAPI().getType(unknownType);
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND)
.assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_WAS_NOT_FOUND, unknownType));
}
@Test(groups = { TestGroup.REST_API, TestGroup.MODEL, TestGroup.REGRESSION })
@TestRail(section = { TestGroup.REST_API, TestGroup.MODEL }, executionType = ExecutionType.REGRESSION,
description = "Verify Type Info and status code is OK (200)")
public void getType() throws Exception
{
RestTypeModel type = restClient.withModelAPI().getType("cm:content");
restClient.assertStatusCodeIs(HttpStatus.OK);
type.assertThat().field("associations").isEmpty().and()
.field("mandatoryAspects").isNotEmpty().and()
.field("properties").isNotEmpty().and()
.field("includedInSupertypeQuery").is(true).and()
.field("isArchive").is(true).and()
.field("isContainer").is(false).and()
.field("id").is("cm:content").and()
.field("description").is("Base Content Object").and()
.field("title").is("Content").and()
.field("model.id").is("cm:contentmodel").and()
.field("model.author").is("Alfresco").and()
.field("model.description").is("Alfresco Content Domain Model").and()
.field("model.namespaceUri").is("http://www.alfresco.org/model/content/1.0").and()
.field("model.namespacePrefix").is("cm");
}
}

View File

@@ -0,0 +1,199 @@
package org.alfresco.rest.models.types;
import org.alfresco.rest.RestTest;
import org.alfresco.rest.model.RestAbstractClassModel;
import org.alfresco.rest.model.RestTypesCollection;
import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.http.HttpStatus;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
public class GetTypesTests extends RestTest
{
private UserModel regularUser;
@BeforeClass(alwaysRun=true)
public void dataPreparation() throws Exception
{
regularUser = dataUser.createRandomTestUser();
}
@Test(groups = { TestGroup.REST_API, TestGroup.MODEL, TestGroup.REGRESSION })
@TestRail(section = {TestGroup.REST_API, TestGroup.MODEL }, executionType = ExecutionType.REGRESSION,
description = "Verify user get types and gets status code OK (200)")
public void getTypes() throws Exception
{
RestTypesCollection types = restClient.authenticateUser(regularUser).withModelAPI()
.getTypes();
restClient.assertStatusCodeIs(HttpStatus.OK);
types.assertThat()
.entriesListCountIs(100)
.and().entriesListContains("id", "cm:content")
.and().entriesListContains("id", "cm:systemfolder")
.and().entriesListContains("id", "cm:folder");
}
@Test(groups = { TestGroup.REST_API, TestGroup.MODEL, TestGroup.REGRESSION })
@TestRail(section = {TestGroup.REST_API, TestGroup.MODEL }, executionType = ExecutionType.REGRESSION,
description = "Should filter types using namespace uri and gets status code OK (200)")
public void getTypeByNamespaceUri() throws Exception
{
RestTypesCollection types = restClient.authenticateUser(regularUser).withModelAPI()
.usingParams("where=(namespaceUri matches('http://www.alfresco.org/model.*'))")
.getTypes();
restClient.assertStatusCodeIs(HttpStatus.OK);
types.assertThat().entriesListCountIs(100);
types = restClient.authenticateUser(regularUser).withModelAPI()
.usingParams("where=(not namespaceUri matches('http://www.alfresco.org/model.*'))")
.getTypes();
restClient.assertStatusCodeIs(HttpStatus.OK);
types.assertThat().entriesListCountIs(0);
}
@Test(groups = { TestGroup.REST_API, TestGroup.MODEL, TestGroup.REGRESSION })
@TestRail(section = {TestGroup.REST_API, TestGroup.MODEL }, executionType = ExecutionType.REGRESSION,
description = "Should filter types using modelId and gets status code OK (200)")
public void getTypeByModelsIds() throws Exception
{
RestTypesCollection types = restClient.authenticateUser(regularUser).withModelAPI()
.usingParams("where=(modelId in ('cm:contentmodel', 'smf:smartFolder'))")
.getTypes();
restClient.assertStatusCodeIs(HttpStatus.OK);
types.getPagination().assertThat().fieldsCount().is(5).and()
.field("totalItems").isLessThan(65).and()
.field("maxItems").is(100).and()
.field("skipCount").isGreaterThan(0).and()
.field("hasMoreItems").is(false);
}
@Test(groups = { TestGroup.REST_API, TestGroup.MODEL, TestGroup.REGRESSION })
@TestRail(section = {TestGroup.REST_API, TestGroup.MODEL }, executionType = ExecutionType.REGRESSION,
description = "Should filter types using modelId with subtypes and gets status code OK (200)")
public void getTypeByModelsIdsWithIncludeSubTypes() throws Exception
{
RestTypesCollection types = restClient.authenticateUser(regularUser).withModelAPI()
.usingParams("where=(modelId in ('cm:contentmodel INCLUDESUBTYPES', 'smf:smartFolder INCLUDESUBTYPES'))")
.getTypes();
restClient.assertStatusCodeIs(HttpStatus.OK);
types.getPagination().assertThat().fieldsCount().is(5).and()
.field("totalItems").isGreaterThan(65).and()
.field("maxItems").is(100).and()
.field("skipCount").isGreaterThan(0).and()
.field("hasMoreItems").is(false);
}
@Test(groups = { TestGroup.REST_API, TestGroup.MODEL, TestGroup.REGRESSION })
@TestRail(section = {TestGroup.REST_API, TestGroup.MODEL }, executionType = ExecutionType.REGRESSION,
description = "Should filter types using parentId and gets status code OK (200)")
public void getTypeByParentId() throws Exception
{
RestTypesCollection types = restClient.authenticateUser(regularUser).withModelAPI()
.usingParams("where=(parentId in ('cm:content'))")
.getTypes();
restClient.assertStatusCodeIs(HttpStatus.OK);
types.getPagination().assertThat().fieldsCount().is(5).and()
.field("totalItems").isGreaterThan(40).and()
.field("hasMoreItems").is(false);
}
@Test(groups = { TestGroup.REST_API, TestGroup.MODEL, TestGroup.REGRESSION })
@TestRail(section = {TestGroup.REST_API, TestGroup.MODEL }, executionType = ExecutionType.REGRESSION,
description = "Should get Type with association, properties and mandatory types and gets status code OK (200)")
public void getTypeIncludeParams() throws Exception
{
RestTypesCollection types = restClient.authenticateUser(regularUser).withModelAPI()
.usingParams("include=properties,mandatoryAspects,associations")
.getTypes();
restClient.assertStatusCodeIs(HttpStatus.OK);
for (RestAbstractClassModel type : types.getEntries())
{
type.onModel().assertThat()
.field("associations").isNotNull().and()
.field("properties").isNotNull().and()
.field("mandatoryAspects").isNotNull();
}
}
@Test(groups = { TestGroup.REST_API, TestGroup.MODEL, TestGroup.REGRESSION })
@TestRail(section = {TestGroup.REST_API, TestGroup.MODEL }, executionType = ExecutionType.REGRESSION,
description = "Should verify the query errors with possible options")
public void verifyTypesQueryError() throws Exception
{
restClient.authenticateUser(regularUser).withModelAPI()
.usingParams("where=(modelId in (' ')")
.getTypes();
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST);
restClient.authenticateUser(regularUser).withModelAPI()
.usingParams("where=(modelId in ('cm:contentmodel INCLUDESUBTYPES',))")
.getTypes();
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST);
restClient.authenticateUser(regularUser).withModelAPI()
.usingParams("where=(modelId in ('cm:contentmodel INCLUDESUBASPECTS'))")
.getTypes();
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST);
restClient.authenticateUser(regularUser).withModelAPI()
.usingParams("where=(parentId in (' ')")
.getTypes();
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST);
restClient.authenticateUser(regularUser).withModelAPI()
.usingParams("where=(parentId in ('cm:titled',))")
.getTypes();
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST);
restClient.authenticateUser(regularUser).withModelAPI()
.usingParams("where=(parentId in ('cm:titled',))&include=properties")
.getTypes();
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST);
restClient.authenticateUser(regularUser).withModelAPI()
.usingParams("where=(namespaceUri matches('*'))")
.getTypes();
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST);
restClient.authenticateUser(regularUser).withModelAPI()
.usingParams("where=(parentId in ('cm:titled'))&include=properties")
.getTypes();
restClient.assertStatusCodeIs(HttpStatus.OK);
}
@Test(groups = { TestGroup.REST_API, TestGroup.MODEL, TestGroup.REGRESSION })
@TestRail(section={TestGroup.REST_API, TestGroup.MODEL}, executionType= ExecutionType.REGRESSION,
description= "Verify if any user gets types with high skipCount and maxItems parameter applied")
public void getPaginationParameter() throws Exception
{
RestTypesCollection types = restClient.authenticateUser(regularUser)
.withModelAPI()
.usingParams("maxItems=10&skipCount=10")
.getTypes();
types.assertThat().entriesListCountIs(10);
types.assertThat().paginationField("hasMoreItems").is("true");
types.assertThat().paginationField("skipCount").is("10");
types.assertThat().paginationField("maxItems").is("10");
restClient.assertStatusCodeIs(HttpStatus.OK);
}
@Test(groups = { TestGroup.REST_API, TestGroup.MODEL, TestGroup.REGRESSION })
@TestRail(section={TestGroup.REST_API, TestGroup.MODEL}, executionType= ExecutionType.REGRESSION,
description= "Verify if any user gets types with hasMoreItems applied bases on skip count and maxItems")
public void getHighPaginationQuery() throws Exception
{
RestTypesCollection types = restClient.authenticateUser(regularUser).withModelAPI()
.usingParams("maxItems=10&skipCount=150")
.getTypes();
types.assertThat().entriesListCountIs(0);
types.assertThat().paginationField("hasMoreItems").is("false");
types.assertThat().paginationField("skipCount").is("150");
types.assertThat().paginationField("maxItems").is("10");
restClient.assertStatusCodeIs(HttpStatus.OK);
}
}

View File

@@ -347,13 +347,30 @@ public class GetSitesTests extends RestTest
public void checkPaginationWithSkipCountAndMaxItems() throws Exception
{
sites = restClient.authenticateUser(regularUser).withParams("skipCount=10&maxItems=110").withCoreAPI().getSites();
int expectedCount;
if (sites.getPagination().isHasMoreItems())
{
expectedCount = sites.getPagination().getMaxItems();
}
else
{
if (sites.getPagination().getTotalItems() < sites.getPagination().getSkipCount())
{
expectedCount = 0;
}
else
{
expectedCount = sites.getPagination().getTotalItems() - sites.getPagination().getSkipCount();
}
}
sites.getPagination().assertThat()
.field("totalItems").isNotEmpty().and()
.field("maxItems").is("110").and()
.field("hasMoreItems").is((sites.getPagination().getTotalItems() - sites.getPagination().getSkipCount() > sites.getPagination().getMaxItems())?"true":"false").and()
.field("skipCount").is("10").and()
.field("count").is((sites.getPagination().isHasMoreItems()) ? sites.getPagination().getMaxItems()
: sites.getPagination().getTotalItems() - sites.getPagination().getSkipCount());
.field("count").is(expectedCount);
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION})

View File

@@ -0,0 +1,280 @@
package org.alfresco.rest.sites.groups;
import org.alfresco.rest.RestTest;
import org.alfresco.rest.core.RestRequest;
import org.alfresco.rest.model.RestErrorModel;
import org.alfresco.rest.model.RestSiteGroupModel;
import org.alfresco.utility.constants.UserRole;
import org.alfresco.utility.data.DataUser.ListUserWithRoles;
import org.alfresco.utility.model.GroupModel;
import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
public class AddSiteGroupTests extends RestTest
{
private UserModel adminUserModel;
private SiteModel publicSiteModel, moderatedSiteModel;
private ListUserWithRoles publicSiteUsersWithRoles;
private String addMemberJson, addMembersJson;
@BeforeClass(alwaysRun=true)
public void dataPreparation() throws Exception
{
adminUserModel = dataUser.getAdminUser();
publicSiteModel = dataSite.usingUser(adminUserModel).createPublicRandomSite();
moderatedSiteModel = dataSite.usingUser(adminUserModel).createModeratedRandomSite();
publicSiteUsersWithRoles = dataUser.addUsersWithRolesToSite(publicSiteModel,
UserRole.SiteManager,
UserRole.SiteCollaborator,
UserRole.SiteConsumer,
UserRole.SiteContributor);
addMemberJson = "{\"role\":\"%s\",\"id\":\"%s\"}";
addMembersJson = "{\"role\":\"%s\",\"id\":\"%s\"}, {\"role\":\"%s\",\"id\":\"%s\"}";
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
description = "Verify that user can not be added to an inexistent site and gets status code 404")
public void notAbleToAddGroupToAnInExistentSite() throws Exception
{
GroupModel group = dataGroup.createRandomGroup();
SiteModel inexistentSite = new SiteModel("inexistentSite");
restClient.authenticateUser(adminUserModel).withCoreAPI().usingSite(inexistentSite).addSiteGroup(getId(group), UserRole.SiteManager);
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND).assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, inexistentSite.getId()));
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
description = "Verify that inexistent group can not be added to site and gets status code 404")
public void notAbleToAddInExistentGroupToSite() throws Exception
{
GroupModel group = new GroupModel("inExistentGroup");
restClient.authenticateUser(adminUserModel).withCoreAPI().usingSite(publicSiteModel).addSiteGroup(group.getGroupIdentifier(), UserRole.SiteManager);
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND)
.assertLastError().containsErrorKey(RestErrorModel.API_DEFAULT_ERRORKEY)
.containsSummary(String.format("An authority was not found for %s", group.getGroupIdentifier()))
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
.stackTraceIs(RestErrorModel.STACKTRACE);
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
description = "Verify that user can not add group that is already present and gets status code 409")
public void notAbleToAddGroupThatIsAlreadyAPresent() throws Exception
{
GroupModel group = dataGroup.createRandomGroup();
restClient.authenticateUser(adminUserModel).withCoreAPI().usingSite(moderatedSiteModel).addSiteGroup(getId(group), UserRole.SiteManager);
restClient.authenticateUser(adminUserModel).withCoreAPI().usingSite(moderatedSiteModel).addSiteGroup(getId(group), UserRole.SiteManager);
restClient.assertStatusCodeIs(HttpStatus.CONFLICT).assertLastError().containsSummary(String.format(RestErrorModel.ALREADY_Site_MEMBER, getId(group), moderatedSiteModel.getId()));
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
description = "Verify that several groups with different roles can be added once in a row to a site and gets status code 201")
public void addSeveralGroupsWithDifferentRolesToASite() throws Exception
{
GroupModel firstGroup = dataGroup.createRandomGroup();
GroupModel secondGroup = dataGroup.createRandomGroup();
restClient.authenticateUser(adminUserModel).withCoreAPI();
String json = String.format(addMembersJson, UserRole.SiteContributor, getId(firstGroup), UserRole.SiteCollaborator, getId(secondGroup));
RestRequest request = RestRequest.requestWithBody(HttpMethod.POST, json, "sites/{siteId}/group-members?{parameters}", publicSiteModel.getId(), restClient.getParameters());
restClient.processModel(RestSiteGroupModel.class, request);
restClient.assertStatusCodeIs(HttpStatus.CREATED);
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
description = "Verify that several groups with same roles can be added once in a row to a site and gets status code 201")
public void addSeveralGroupsWithSameRolesToASite() throws Exception
{
GroupModel firstGroup = dataGroup.createRandomGroup();
GroupModel secondGroup = dataGroup.createRandomGroup();
restClient.authenticateUser(adminUserModel).withCoreAPI();
String json = String.format(addMembersJson, UserRole.SiteCollaborator, getId(firstGroup), UserRole.SiteCollaborator, getId(secondGroup));
RestRequest request = RestRequest.requestWithBody(HttpMethod.POST, json, "sites/{siteId}/group-members?{parameters}", publicSiteModel.getId(), restClient.getParameters());
restClient.processModel(RestSiteGroupModel.class, request);
restClient.assertStatusCodeIs(HttpStatus.CREATED);
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
description = "Verify that several users that are already added to the site can not be added once in a row and gets status code 400")
public void addSeveralGroupsThatAreAlreadyAddedToASite() throws Exception
{
GroupModel firstGroup = dataGroup.createRandomGroup();
GroupModel secondGroup = dataGroup.createRandomGroup();
restClient.authenticateUser(adminUserModel).withCoreAPI();
String json = String.format(addMembersJson, UserRole.SiteCollaborator, getId(firstGroup), UserRole.SiteCollaborator, getId(secondGroup));
RestRequest request = RestRequest.requestWithBody(HttpMethod.POST, json, "sites/{siteId}/group-members?{parameters}", publicSiteModel.getId(), restClient.getParameters());
restClient.processModel(RestSiteGroupModel.class, request);
restClient.processModel(RestSiteGroupModel.class, request);
restClient.assertStatusCodeIs(HttpStatus.CONFLICT).assertLastError().containsSummary(String.format(RestErrorModel.ALREADY_Site_MEMBER, getId(firstGroup), publicSiteModel.getId())) ;
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
description = "Add new site group membership request by providing an empty body")
public void addSiteGroupsUsingEmptyBody() throws Exception
{
restClient.authenticateUser(adminUserModel).withCoreAPI();
RestRequest request = RestRequest.requestWithBody(HttpMethod.POST, "", "sites/{siteId}/group-members?{parameters}", publicSiteModel.getId(), restClient.getParameters());
restClient.processModel(RestSiteGroupModel.class, request);
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST).assertLastError()
.containsSummary(String.format(RestErrorModel.NO_CONTENT, "No content to map due to end-of-input"))
.containsErrorKey(String.format(RestErrorModel.NO_CONTENT, "No content to map due to end-of-input"))
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
.stackTraceIs(RestErrorModel.STACKTRACE);
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
description = "Check lower and upper case letters for role field")
public void checkLowerUpperCaseLettersForRole() throws Exception
{
GroupModel group = dataGroup.createRandomGroup();
String json = String.format(addMemberJson, "SITEMANAGER", getId(group));
restClient.authenticateUser(adminUserModel).withCoreAPI();
RestRequest request = RestRequest.requestWithBody(HttpMethod.POST, json, "sites/{siteId}/group-members?{parameters}", publicSiteModel.getId(), restClient.getParameters());
restClient.processModel(RestSiteGroupModel.class, request);
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND).assertLastError()
.containsSummary(String.format("An authority was not found for GROUP_site_%s_%s", publicSiteModel.getId(), "SITEMANAGER"))
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
.stackTraceIs(RestErrorModel.STACKTRACE);
json = String.format(addMemberJson, "sitemanager", getId(group));
restClient.authenticateUser(adminUserModel).withCoreAPI();
request = RestRequest.requestWithBody(HttpMethod.POST, json, "sites/{siteId}/group-members?{parameters}", publicSiteModel.getId(), restClient.getParameters());
restClient.processModel(RestSiteGroupModel.class, request);
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND).assertLastError()
.containsSummary(String.format("An authority was not found for GROUP_site_%s_%s", publicSiteModel.getId(), "sitemanager"))
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
.stackTraceIs(RestErrorModel.STACKTRACE);
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
description = "Check empty value for user role")
public void checkEmptyValueForRole() throws Exception
{
GroupModel group = dataGroup.createRandomGroup();
String json = String.format(addMemberJson, "", getId(group));
restClient.authenticateUser(adminUserModel).withCoreAPI();
RestRequest request = RestRequest.requestWithBody(HttpMethod.POST, json, "sites/{siteId}/group-members?{parameters}", publicSiteModel.getId(), restClient.getParameters());
restClient.processModel(RestSiteGroupModel.class, request);
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST).assertLastError()
.containsErrorKey(String.format(RestErrorModel.NO_CONTENT, "N/A"))
.containsSummary(String.format(RestErrorModel.NO_CONTENT, "N/A"))
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
.stackTraceIs(RestErrorModel.STACKTRACE);
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY })
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY,
description = "Verify that manager is able to add site group membership and gets status code CREATED (201)")
public void managerIsAbleToAddSiteGroup() throws Exception
{
GroupModel group = dataGroup.createRandomGroup();
restClient.authenticateUser(publicSiteUsersWithRoles.getOneUserWithRole(UserRole.SiteManager));
restClient.withCoreAPI().usingSite(publicSiteModel).addSiteGroup(getId(group), UserRole.SiteCollaborator)
.assertThat()
.field("id").is(getId(group))
.and()
.field("role").is(UserRole.SiteCollaborator);
restClient.assertStatusCodeIs(HttpStatus.CREATED);
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
description = "Verify that site collaborator is not able to add site group membership and gets status code FORBIDDEN (403)")
public void collaboratorIsNotAbleToAddSiteGroup() throws Exception
{
GroupModel group = dataGroup.createRandomGroup();
restClient.authenticateUser(publicSiteUsersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator))
.withCoreAPI().usingSite(publicSiteModel).addSiteGroup(getId(group), UserRole.SiteCollaborator);
restClient.assertLastError().containsSummary("The current user does not have permissions to modify the membership details of the site");
restClient.assertStatusCodeIs(HttpStatus.UNPROCESSABLE_ENTITY);
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION})
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
description = "Verify that site contributor is not able to add site group membership and gets status code FORBIDDEN (403)")
public void contributorIsNotAbleToAddSiteGroup() throws Exception
{
GroupModel group = dataGroup.createRandomGroup();
restClient.authenticateUser(publicSiteUsersWithRoles.getOneUserWithRole(UserRole.SiteContributor))
.withCoreAPI().usingSite(publicSiteModel).addSiteGroup(getId(group), UserRole.SiteContributor);
restClient.assertLastError().containsSummary("The current user does not have permissions to modify the membership details of the site");
restClient.assertStatusCodeIs(HttpStatus.UNPROCESSABLE_ENTITY);
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
description = "Verify that site consumer is not able to add site group membership and gets status code FORBIDDEN (403)")
public void consumerIsNotAbleToAddSiteGroup() throws Exception
{
GroupModel group = dataGroup.createRandomGroup();
restClient.authenticateUser(publicSiteUsersWithRoles.getOneUserWithRole(UserRole.SiteConsumer))
.withCoreAPI().usingSite(publicSiteModel).addSiteGroup(getId(group), UserRole.SiteConsumer);;
restClient.assertLastError().containsSummary("The current user does not have permissions to modify the membership details of the site");
restClient.assertStatusCodeIs(HttpStatus.UNPROCESSABLE_ENTITY);
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY })
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY,
description = "Verify that admin user is able to add site group membership and gets status code CREATED (201)")
public void adminIsAbleToAddSiteGroup() throws Exception
{
GroupModel group = dataGroup.createRandomGroup();
restClient.authenticateUser(adminUserModel)
.withCoreAPI().usingSite(publicSiteModel).addSiteGroup(getId(group), UserRole.SiteConsumer)
.assertThat()
.field("id").is(getId(group))
.and()
.field("role").is(UserRole.SiteConsumer);
restClient.assertStatusCodeIs(HttpStatus.CREATED);
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY })
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY,
description = "Verify that unauthenticated user is not able to add site group membership")
public void unauthenticatedUserIsNotAuthorizedToAddSiteGroup() throws Exception
{
GroupModel group = dataGroup.createRandomGroup();
UserModel userModel = dataUser.createRandomTestUser();
userModel.setPassword("user wrong password");
dataUser.addUserToSite(userModel, publicSiteModel, UserRole.SiteManager);
restClient.authenticateUser(userModel)
.withCoreAPI().usingSite(publicSiteModel).addSiteGroup(getId(group), UserRole.SiteCollaborator);
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED);
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
description = "Verify that manager can add another user as manager to a public site and gets status code CREATED (201)")
public void addManagerToPublicSite() throws Exception
{
GroupModel group = dataGroup.createRandomGroup();
restClient.authenticateUser(adminUserModel).withCoreAPI().usingSite(publicSiteModel).addSiteGroup(getId(group), UserRole.SiteManager)
.assertThat()
.field("id").is(getId(group))
.and()
.field("role").is(UserRole.SiteManager);
restClient.assertStatusCodeIs(HttpStatus.CREATED);
}
String getId(GroupModel group) {
return "GROUP_" + group.getGroupIdentifier();
}
}

View File

@@ -0,0 +1,135 @@
package org.alfresco.rest.sites.groups;
import org.alfresco.rest.RestTest;
import org.alfresco.rest.exception.JsonToModelConversionException;
import org.alfresco.rest.model.RestErrorModel;
import org.alfresco.utility.constants.UserRole;
import org.alfresco.utility.data.DataUser;
import org.alfresco.utility.exception.DataPreparationException;
import org.alfresco.utility.model.GroupModel;
import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.http.HttpStatus;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
public class GetSiteGroupTests extends RestTest
{
private UserModel adminUser;
private SiteModel publicSiteModel;
private DataUser.ListUserWithRoles usersWithRoles;
private GroupModel manager, consumer;
@BeforeClass(alwaysRun = true)
public void dataPreparation() throws DataPreparationException
{
adminUser = dataUser.getAdminUser();
publicSiteModel = dataSite.usingUser(adminUser).createPublicRandomSite();
usersWithRoles = dataUser.addUsersWithRolesToSite(publicSiteModel, UserRole.SiteManager, UserRole.SiteCollaborator, UserRole.SiteConsumer,
UserRole.SiteContributor);
consumer = dataGroup.createRandomGroup();
dataGroup.addListOfUsersToGroup(consumer, dataUser.createRandomTestUser());
manager = dataGroup.createRandomGroup();
dataGroup.addListOfUsersToGroup(consumer, dataUser.createRandomTestUser());
restClient.authenticateUser(adminUser).withCoreAPI().usingSite(publicSiteModel).addSiteGroup(getId(manager), UserRole.SiteManager);
restClient.authenticateUser(adminUser).withCoreAPI().usingSite(publicSiteModel).addSiteGroup(getId(consumer), UserRole.SiteConsumer);
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
description = "Verify admin user can get site group and gets status code OK (200)")
public void getSiteGroupWithAdminUser() throws Exception
{
restClient.authenticateUser(adminUser);
restClient.withCoreAPI().usingSite(publicSiteModel).getSiteGroup(getId(manager))
.and().field("id").is(getId(manager))
.and().field("role").is(UserRole.SiteManager);
restClient.assertStatusCodeIs(HttpStatus.OK);
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY })
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY,
description = "Failed authentication get site group call returns status code 401")
public void unauthenticatedUserIsNotAuthorizedToRetrieveSiteGroup() throws JsonToModelConversionException, Exception
{
UserModel inexistentUser = new UserModel("inexistent user", "inexistent password");
restClient.authenticateUser(inexistentUser).withCoreAPI().usingSite(publicSiteModel).getSiteGroup(getId(consumer));
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED);
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
description = "Verify Manager role doesn't get a site group of inexistent site and status code is Not Found (404)")
public void getSiteGroupOfInexistentSite() throws Exception
{
SiteModel invalidSite = new SiteModel("invalidSite");
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager));
restClient.withCoreAPI().usingSite(invalidSite).getSiteGroup(getId(consumer));
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND)
.assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_WAS_NOT_FOUND, invalidSite.getId()));
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
description = "Verify Manager role doesn't get non site group of inexistent site and status code is Not Found (404)")
public void getSiteGroupForNonSiteGroup() throws Exception
{
GroupModel nonGroup = dataGroup.createRandomGroup();
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager));
restClient.withCoreAPI().usingSite(publicSiteModel).getSiteGroup(getId(nonGroup));
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST)
.assertLastError().containsSummary(String.format("Given authority is not a member of the site"));
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
description = "Verify Manager role doesn't get not existing site group and status code is Not Found (404)")
public void getSiteGroupForInexistentSiteGroup() throws Exception
{
GroupModel inexistentGroup = new GroupModel("inexistentGroup");
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager));
restClient.withCoreAPI().usingSite(publicSiteModel).getSiteGroup(getId(inexistentGroup));
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND)
.assertLastError().containsSummary(String.format("An authority was not found for %s", getId(inexistentGroup)));
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
description = "Verify Manager role can get site group for empty siteId")
public void getSiteGroupForEmptySiteId() throws Exception
{
SiteModel emptySite = new SiteModel("");
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager));
restClient.withCoreAPI().usingSite(emptySite).getSiteGroup(getId(consumer));
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND)
.assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_WAS_NOT_FOUND, ""));
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
description = "Verify Manager role gets site groups with Manager role and status code is OK (200)")
public void getSiteGroupWithManagerRole() throws Exception
{
GroupModel anotherManager = dataGroup.createRandomGroup();
restClient.withCoreAPI().usingSite(publicSiteModel).addSiteGroup(getId(anotherManager), UserRole.SiteManager);
restClient.withCoreAPI().usingSite(publicSiteModel).getSiteGroup(getId(anotherManager))
.assertThat().field("id").is(getId(anotherManager))
.and().field("role").is(UserRole.SiteManager);
restClient.assertStatusCodeIs(HttpStatus.OK);
}
String getId(GroupModel group) {
return "GROUP_" + group.getGroupIdentifier();
}
}

View File

@@ -0,0 +1,275 @@
package org.alfresco.rest.sites.groups;
import org.alfresco.rest.RestTest;
import org.alfresco.rest.model.*;
import org.alfresco.utility.constants.UserRole;
import org.alfresco.utility.data.DataUser;
import org.alfresco.utility.model.GroupModel;
import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.http.HttpStatus;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.util.ArrayList;
import java.util.List;
public class GetSiteGroupsTests extends RestTest
{
private SiteModel publicSite, moderatedSite;
private List<GroupModel> publicSiteGroups, moderatedSiteGroups;
private DataUser.ListUserWithRoles publicSiteUsers;
private UserModel siteCreator;
private UserModel regularUser;
@BeforeClass(alwaysRun=true)
public void dataPreparation() throws Exception
{
siteCreator = dataUser.createRandomTestUser();
regularUser = dataUser.createRandomTestUser();
publicSite = dataSite.usingUser(siteCreator).createPublicRandomSite();
moderatedSite = dataSite.usingUser(siteCreator).createModeratedRandomSite();
publicSiteUsers = dataUser.addUsersWithRolesToSite(publicSite,UserRole.SiteManager, UserRole.SiteCollaborator, UserRole.SiteConsumer, UserRole.SiteContributor);
publicSiteGroups = addGroupToSite(publicSite,UserRole.SiteManager, UserRole.SiteCollaborator, UserRole.SiteConsumer, UserRole.SiteContributor);
moderatedSiteGroups = addGroupToSite(moderatedSite, UserRole.SiteManager, UserRole.SiteCollaborator, UserRole.SiteConsumer, UserRole.SiteContributor);
RestSiteGroupModelsCollection siteGroups = restClient.authenticateUser(siteCreator).withCoreAPI().usingSite(moderatedSite).usingParams("properties=role,id").getSiteGroups();
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY })
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY,
description = "Verify Manager role gets site groups and gets status code OK (200)")
public void getSiteGroupsWithManagerRole() throws Exception
{
restClient.authenticateUser(publicSiteUsers.getOneUserWithRole(UserRole.SiteManager))
.withCoreAPI().usingSite(publicSite).getSiteGroups()
.assertThat()
.entriesListCountIs(4)
.and().entriesListContains("id", getId(publicSiteGroups.get(0)))
.and().entriesListContains("role", UserRole.SiteManager.name())
.and().entriesListContains("id", getId(publicSiteGroups.get(1)))
.and().entriesListContains("role", UserRole.SiteCollaborator.name())
.and().entriesListContains("id", getId(publicSiteGroups.get(2)))
.and().entriesListContains("role", UserRole.SiteConsumer.name())
.and().entriesListContains("id", getId(publicSiteGroups.get(3)))
.and().entriesListContains("role", UserRole.SiteContributor.name());
restClient.assertStatusCodeIs(HttpStatus.OK);
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
description = "Verify Collaborator role gets site groups and gets status code OK (200)")
public void getSiteGroupsWithCollaboratorRole() throws Exception
{
restClient.authenticateUser(publicSiteUsers.getOneUserWithRole(UserRole.SiteCollaborator))
.withCoreAPI().usingSite(publicSite).getSiteGroups()
.assertThat()
.entriesListCountIs(4)
.and().entriesListContains("id", getId(publicSiteGroups.get(1)))
.and().entriesListContains("role", UserRole.SiteCollaborator.name());
restClient.assertStatusCodeIs(HttpStatus.OK);
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
description = "Verify Contributor role gets site groups and gets status code OK (200)")
public void getSiteGroupsWithContributorRole() throws Exception
{
restClient.authenticateUser(publicSiteUsers.getOneUserWithRole(UserRole.SiteContributor))
.withCoreAPI().usingSite(publicSite).getSiteGroups()
.assertThat()
.entriesListCountIs(4)
.and().entriesListContains("id", getId(publicSiteGroups.get(3)))
.and().entriesListContains("role", UserRole.SiteContributor.name());
restClient.assertStatusCodeIs(HttpStatus.OK);
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
description = "Verify Consumer role gets site groups and gets status code OK (200)")
public void getSiteGroupsWithConsumerRole() throws Exception
{
restClient.authenticateUser(publicSiteUsers.getOneUserWithRole(UserRole.SiteConsumer))
.withCoreAPI().usingSite(publicSite).getSiteGroups()
.assertThat()
.entriesListCountIs(4)
.and().entriesListContains("id", getId(publicSiteGroups.get(2)))
.and().entriesListContains("role", UserRole.SiteConsumer.name());
restClient.assertStatusCodeIs(HttpStatus.OK);
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
description = "Verify admin user gets site groups and gets status code OK (200)")
public void getSiteGroupsWithAdminUser() throws Exception
{
restClient.authenticateUser(dataUser.getAdminUser())
.withCoreAPI().usingSite(publicSite).getSiteGroups()
.assertThat()
.entriesListCountIs(4)
.and().entriesListContains("id", getId(publicSiteGroups.get(0)))
.and().entriesListContains("role", UserRole.SiteManager.name());
restClient.assertStatusCodeIs(HttpStatus.OK);
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY })
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY,
description = "Failed authentication get site groups call returns status code 401")
public void unauthenticatedUserIsNotAuthorizedToRetrieveSiteGroups() throws Exception
{
UserModel userModel = dataUser.createRandomTestUser();
userModel.setPassword("user wrong password");
dataUser.addUserToSite(userModel, publicSite, UserRole.SiteManager);
restClient.authenticateUser(userModel).withCoreAPI().usingSite(publicSite).getSiteGroups();
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED);
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
description= "Verify get site members call returns status code 404 if siteId does not exist")
public void checkStatusCodeForNonExistentSiteId() throws Exception
{
restClient.authenticateUser(publicSiteUsers.getOneUserWithRole(UserRole.SiteContributor)).withCoreAPI()
.usingSite("NonExistentSiteId").getSiteGroups();
restClient.assertStatusCodeIs(HttpStatus.UNPROCESSABLE_ENTITY)
.assertLastError().containsSummary(String.format("Site %s does not exist", "NonExistentSiteId"));
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
description= "Verify get site groups call returns status code 400 for invalid maxItems")
public void checkStatusCodeForInvalidMaxItems() throws Exception
{
restClient.authenticateUser(regularUser).withParams("maxItems=0").withCoreAPI().usingSite(publicSite).getSiteGroups();
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST)
.assertLastError().containsSummary(RestErrorModel.ONLY_POSITIVE_VALUES_MAXITEMS)
.containsErrorKey(RestErrorModel.ONLY_POSITIVE_VALUES_MAXITEMS)
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
.stackTraceIs(RestErrorModel.STACKTRACE);
restClient.withParams("maxItems=A").withCoreAPI().usingSite(publicSite).getSiteGroups();
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST)
.assertLastError().containsSummary(String.format(RestErrorModel.INVALID_MAXITEMS, "A"));
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
description= "Verify get site groups call returns status code 400 for invalid skipCount ")
public void checkStatusCodeForInvalidSkipCount() throws Exception
{
restClient.authenticateUser(regularUser).withParams("skipCount=A")
.withCoreAPI().usingSite(publicSite).getSiteGroups();
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST)
.assertLastError().containsSummary(String.format(RestErrorModel.INVALID_SKIPCOUNT, "A"));
restClient.withParams("skipCount=-1")
.withCoreAPI().usingSite(publicSite).getSiteGroups();
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST)
.assertLastError().containsSummary(RestErrorModel.NEGATIVE_VALUES_SKIPCOUNT);
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
description= "Verify if any user gets public site groups and status code is 200")
public void getPublicSiteGroups() throws Exception
{
RestSiteGroupModelsCollection siteGroups = restClient.authenticateUser(regularUser).withCoreAPI().usingSite(publicSite).getSiteGroups();
restClient.assertStatusCodeIs(HttpStatus.OK);
siteGroups.assertThat().entriesListCountIs(4).assertThat()
.entriesListContains("id", getId(publicSiteGroups.get(0)))
.and().entriesListContains("id", getId(publicSiteGroups.get(1)))
.and().entriesListContains("id", getId(publicSiteGroups.get(2)))
.and().entriesListContains("id", getId(publicSiteGroups.get(3)))
.and().paginationField("count").is("4");
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
description= "Verify if any user gets moderated site groups and status code is 200")
public void getModeratedSiteGroups() throws Exception
{
RestSiteGroupModelsCollection siteGroups = restClient.authenticateUser(regularUser).withCoreAPI().usingSite(moderatedSite).getSiteGroups();
restClient.assertStatusCodeIs(HttpStatus.OK);
siteGroups.assertThat().entriesListCountIs(4).assertThat()
.entriesListContains("id", getId(moderatedSiteGroups.get(0))).and()
.entriesListContains("id", getId(moderatedSiteGroups.get(1))).and()
.entriesListContains("id", getId(moderatedSiteGroups.get(2))).and()
.entriesListContains("id", getId(moderatedSiteGroups.get(3))).and()
.paginationField("count").is("4");
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
description= "Verify if any user gets moderated site groups with properties parameter applied and status code is 200")
public void getModeratedSiteGroupsUsingPropertiesParameter() throws Exception
{
RestSiteGroupModelsCollection siteGroups = restClient.authenticateUser(siteCreator).withCoreAPI().usingSite(moderatedSite).usingParams("properties=role,id").getSiteGroups();
restClient.assertStatusCodeIs(HttpStatus.OK);
siteGroups.assertThat().entriesListCountIs(4)
.and().entriesListDoesNotContain("person")
.and().entriesListContains("role", UserRole.SiteManager.toString())
.and().entriesListContains("id", getId(moderatedSiteGroups.get(0)))
.and().entriesListContains("role", UserRole.SiteContributor.toString())
.and().entriesListContains("id", getId(moderatedSiteGroups.get(1)))
.and().entriesListContains("role", UserRole.SiteCollaborator.toString())
.and().entriesListContains("id", getId(moderatedSiteGroups.get(2)))
.and().entriesListContains("role", UserRole.SiteConsumer.toString())
.and().entriesListContains("id", getId(moderatedSiteGroups.get(3)));
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
description= "Verify if any user gets moderated site groups with skipCount parameter applied")
public void getModeratedSiteGroupsUsingSkipCountParameter() throws Exception
{
RestSiteGroupModelsCollection siteGroups = restClient.authenticateUser(siteCreator).withCoreAPI().usingSite(moderatedSite).usingParams("skipCount=2").getSiteGroups();
restClient.assertStatusCodeIs(HttpStatus.OK);
siteGroups.assertThat().paginationField("count").is("2");
siteGroups.assertThat().paginationField("skipCount").is("2");
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
description= "Verify if any user gets moderated site groups with high skipCount parameter applied")
public void getModeratedSiteGroupsUsingHighSkipCountParameter() throws Exception
{
RestSiteGroupModelsCollection siteGroups = restClient.authenticateUser(siteCreator).withCoreAPI().usingSite(moderatedSite).usingParams("skipCount=100").getSiteGroups();
restClient.assertStatusCodeIs(HttpStatus.OK);
siteGroups.assertThat().paginationField("count").is("0");
siteGroups.assertThat().paginationField("skipCount").is("100");
siteGroups.assertThat().entriesListIsEmpty();
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
description= "Verify if any user gets moderated site groups with maxItems parameter applied and check all pagination fields")
public void getModeratedSiteGroupsUsingMaxItemsParameter() throws Exception
{
RestSiteGroupModelsCollection siteGroups = restClient.authenticateUser(siteCreator).withCoreAPI().usingSite(moderatedSite).usingParams("maxItems=1").getSiteGroups();
restClient.assertStatusCodeIs(HttpStatus.OK);
siteGroups.assertThat().paginationField("count").is("1");
siteGroups.assertThat().paginationField("hasMoreItems").is("true");
siteGroups.assertThat().paginationField("maxItems").is("1");
siteGroups.assertThat().paginationField("totalItems").is("4");
siteGroups.assertThat().entriesListCountIs(1);
}
List<GroupModel> addGroupToSite(SiteModel siteModel, UserRole ...roles) {
List<GroupModel> groups = new ArrayList<GroupModel>();
for (UserRole role: roles) {
GroupModel group = dataGroup.createRandomGroup();
restClient.authenticateUser(dataUser.getAdminUser()).withCoreAPI().usingSite(siteModel).addSiteGroup(getId(group), role);
groups.add(group);
}
return groups;
}
String getId(GroupModel group) {
return "GROUP_" + group.getGroupIdentifier();
}
}

View File

@@ -0,0 +1,197 @@
package org.alfresco.rest.sites.groups;
import org.alfresco.rest.RestTest;
import org.alfresco.rest.model.RestErrorModel;
import org.alfresco.utility.Utility;
import org.alfresco.utility.constants.UserRole;
import org.alfresco.utility.data.DataUser;
import org.alfresco.utility.exception.DataPreparationException;
import org.alfresco.utility.model.GroupModel;
import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.report.Bug;
import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.http.HttpStatus;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.util.ArrayList;
import java.util.List;
public class RemoveSiteGroupTests extends RestTest
{
private SiteModel publicSiteModel, privateSiteModel;
private UserModel adminUserModel;
private DataUser.ListUserWithRoles usersWithRoles;
@BeforeClass(alwaysRun = true)
public void dataPreparation() throws DataPreparationException
{
adminUserModel = dataUser.getAdminUser();
UserModel siteCreator = dataUser.createRandomTestUser();
publicSiteModel = dataSite.usingUser(siteCreator).createPublicRandomSite();
privateSiteModel = dataSite.usingUser(siteCreator).createPrivateRandomSite();
usersWithRoles = dataUser.addUsersWithRolesToSite(publicSiteModel, UserRole.SiteManager, UserRole.SiteCollaborator, UserRole.SiteConsumer, UserRole.SiteContributor);
addGroupToSite(publicSiteModel, UserRole.SiteManager, UserRole.SiteCollaborator, UserRole.SiteConsumer, UserRole.SiteContributor);
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY })
@TestRail(section = { TestGroup.REST_API,
TestGroup.SITES }, executionType = ExecutionType.SANITY, description = "Verify manager can delete site group and gets status code 204, 'No Content'")
public void siteManagerIsAbleToDeleteSiteGroup() throws Exception
{
GroupModel group = addGroupToSite(publicSiteModel, UserRole.SiteConsumer).get(0);
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager));
restClient.withCoreAPI().usingSite(publicSiteModel).deleteSiteGroup(getId(group));
restClient.assertStatusCodeIs(HttpStatus.NO_CONTENT);
Utility.sleep(300, 30000, () -> restClient.withCoreAPI().usingSite(publicSiteModel)
.getSiteGroups().assertThat().entriesListDoesNotContain("id", getId(group)));
restClient.assertStatusCodeIs(HttpStatus.OK);
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section = { TestGroup.REST_API,
TestGroup.SITES }, executionType = ExecutionType.REGRESSION, description = "Verify collaborator cannot delete site group and gets status code 403, 'Forbidden'")
public void siteCollaboratorIsNotAbleToDeleteSiteGroup() throws Exception
{
GroupModel group = addGroupToSite(publicSiteModel, UserRole.SiteConsumer).get(0);
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator));
restClient.withCoreAPI().usingSite(publicSiteModel).deleteSiteGroup(getId(group));
restClient.assertStatusCodeIs(HttpStatus.UNPROCESSABLE_ENTITY);
Utility.sleep(300, 30000, () -> restClient.withCoreAPI()
.usingSite(publicSiteModel).getSiteGroups()
.assertThat().entriesListContains("id", getId(group)));
restClient.assertStatusCodeIs(HttpStatus.OK);
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section = { TestGroup.REST_API,
TestGroup.SITES }, executionType = ExecutionType.REGRESSION, description = "Verify contributor cannot delete site group and gets status code 403, 'Forbidden'")
public void siteContributorIsNotAbleToDeleteSiteGroup() throws Exception
{
GroupModel group = addGroupToSite(publicSiteModel, UserRole.SiteConsumer).get(0);
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteContributor));
restClient.withCoreAPI().usingSite(publicSiteModel).deleteSiteGroup(getId(group));
restClient.assertStatusCodeIs(HttpStatus.UNPROCESSABLE_ENTITY);
Utility.sleep(300, 30000, () -> restClient.withCoreAPI().usingSite(publicSiteModel)
.getSiteGroups().assertThat().entriesListContains("id", getId(group)));
restClient.assertStatusCodeIs(HttpStatus.OK);
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section = { TestGroup.REST_API,
TestGroup.SITES }, executionType = ExecutionType.REGRESSION, description = "Verify consumer cannot delete site member and gets status code 403, 'Forbidden'")
public void siteConsumerIsNotAbleToDeleteSiteGroup() throws Exception
{
GroupModel group = addGroupToSite(publicSiteModel, UserRole.SiteConsumer).get(0);
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteConsumer)).withCoreAPI().usingSite(publicSiteModel).deleteSiteGroup(getId(group));
restClient.assertStatusCodeIs(HttpStatus.UNPROCESSABLE_ENTITY);
Utility.sleep(300, 30000, () -> restClient.withCoreAPI().usingSite(publicSiteModel)
.getSiteGroups().assertThat().entriesListContains("id", getId(group)));
restClient.assertStatusCodeIs(HttpStatus.OK);
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY })
@TestRail(section = { TestGroup.REST_API,
TestGroup.SITES }, executionType = ExecutionType.SANITY, description = "Verify that unauthenticated user is not able to delete site group")
public void unauthenticatedUserIsNotAuthorizedToDeleteSiteGroup() throws Exception
{
GroupModel group = addGroupToSite(publicSiteModel, UserRole.SiteConsumer).get(0);
UserModel inexistentUser = new UserModel("inexistent user", "inexistent password");
restClient.authenticateUser(inexistentUser).withCoreAPI().usingSite(publicSiteModel).deleteSiteGroup(getId(group));
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED);
}
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
description = "Verify manager can NOT delete site group for an inexistent user and gets status code 404, 'Not Found'")
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
public void managerIsNotAbleToDeleteInexistentSiteGroup() throws Exception
{
GroupModel inexistentUser = new GroupModel("inexistentUser");
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager));
restClient.withCoreAPI().usingSite(publicSiteModel).deleteSiteGroup(getId(inexistentUser));
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND).assertLastError().containsSummary(String.format("An authority was not found for %s", getId(inexistentUser)));
}
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
description = "Verify manager can NOT delete site group for a non site group and gets status code 400, 'Bad Request'")
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
public void managerIsNotAbleToDeleteNotSiteGroup() throws Exception
{
GroupModel nonMember = dataGroup.createRandomGroup();
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager));
restClient.withCoreAPI().usingSite(publicSiteModel).deleteSiteGroup(getId(nonMember));
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST)
.assertLastError().containsSummary(String.format("Given authority is not a member of the site"));
}
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
description = "Verify that manager can NOT delete site group for an invalid site and gets status code 404, 'Not Found'")
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
public void managerIsNotAbleToDeleteSiteMemberOfInvalidSite() throws Exception
{
SiteModel invalidSite = new SiteModel("invalidSite");
GroupModel testGroupModel = dataGroup.createRandomGroup();
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager));
restClient.withCoreAPI().usingSite(invalidSite).deleteSiteGroup(getId(testGroupModel));
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND).assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_WAS_NOT_FOUND, "invalidSite"));
}
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
description = "Verify that admin can delete a site group of private site and gets status code 204")
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
public void adminIsAbleToDeletePrivateSiteGroup() throws Exception
{
GroupModel group = addGroupToSite(privateSiteModel, UserRole.SiteConsumer).get(0);
restClient.authenticateUser(adminUserModel).withCoreAPI().usingSite(privateSiteModel).deleteSiteGroup(getId(group));
restClient.assertStatusCodeIs(HttpStatus.NO_CONTENT);
}
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
description = "Verify that admin can not delete a site group twice and gets status code 404 for the second attempt")
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@Bug(id="ACE-5447")
public void adminIsNotAbleToRemoveSiteGroupTwice() throws Exception
{
GroupModel group = addGroupToSite(publicSiteModel, UserRole.SiteContributor).get(0);
restClient.authenticateUser(adminUserModel).withCoreAPI().usingSite(publicSiteModel).deleteSiteGroup(getId(group));
restClient.assertStatusCodeIs(HttpStatus.NO_CONTENT);
restClient.authenticateUser(adminUserModel).withCoreAPI().usingSite(publicSiteModel).deleteSiteGroup(getId(group));
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST).assertLastError()
.containsSummary("Given authority is not a member of the site");
}
List<GroupModel> addGroupToSite(SiteModel siteModel, UserRole ...roles) {
List<GroupModel> groups = new ArrayList<GroupModel>();
for (UserRole role: roles) {
GroupModel group = dataGroup.createRandomGroup();
restClient.authenticateUser(dataUser.getAdminUser()).withCoreAPI().usingSite(siteModel).addSiteGroup(getId(group), role);
groups.add(group);
}
return groups;
}
String getId(GroupModel group) {
return "GROUP_" + group.getGroupIdentifier();
}
}

View File

@@ -0,0 +1,187 @@
package org.alfresco.rest.sites.groups;
import org.alfresco.rest.RestTest;
import org.alfresco.rest.core.JsonBodyGenerator;
import org.alfresco.rest.core.RestRequest;
import org.alfresco.rest.model.RestErrorModel;
import org.alfresco.rest.model.RestSiteMemberModel;
import org.alfresco.utility.constants.UserRole;
import org.alfresco.utility.data.DataUser;
import org.alfresco.utility.model.GroupModel;
import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
public class UpdateSiteGroupTests extends RestTest
{
private UserModel adminUser, siteCreator;
private GroupModel regularGroup;
private SiteModel publicSite;
private DataUser.ListUserWithRoles publicSiteUsers;
private GroupModel groupToBeUpdated;
@BeforeClass(alwaysRun=true)
public void dataPreparation() throws Exception
{
adminUser = dataUser.getAdminUser();
siteCreator = dataUser.createRandomTestUser();
publicSite = dataSite.usingUser(siteCreator).createPublicRandomSite();
publicSiteUsers = dataUser.addUsersWithRolesToSite(publicSite, UserRole.SiteManager, UserRole.SiteCollaborator, UserRole.SiteConsumer,
UserRole.SiteContributor);
regularGroup = dataGroup.createRandomGroup();
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
description = "Verify that collaborator is not able to update site group membership and gets status code FORBIDDEN (403)")
public void collaboratorIsNotAbleToUpdateSiteGroup() throws Exception
{
groupToBeUpdated = dataGroup.createRandomGroup();
restClient.authenticateUser(publicSiteUsers.getOneUserWithRole(UserRole.SiteManager));
restClient.withCoreAPI().usingSite(publicSite).addSiteGroup(getId(groupToBeUpdated), UserRole.SiteConsumer);
restClient.authenticateUser(publicSiteUsers.getOneUserWithRole(UserRole.SiteCollaborator));
restClient.withCoreAPI().usingSite(publicSite).updateSiteGroup(getId(groupToBeUpdated), UserRole.SiteCollaborator);
restClient.assertStatusCodeIs(HttpStatus.UNPROCESSABLE_ENTITY);
restClient.assertLastError()
.containsSummary(String.format("The current user does not have permissions to modify the membership details of the site %s.", publicSite.getTitle()));
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
description = "Verify that contributor is not able to update site membership and gets status code FORBIDDEN (403)")
public void contributorIsNotAbleToUpdateSiteGroup() throws Exception
{
groupToBeUpdated = dataGroup.createRandomGroup();
restClient.authenticateUser(publicSiteUsers.getOneUserWithRole(UserRole.SiteManager));
restClient.withCoreAPI().usingSite(publicSite).addSiteGroup(getId(groupToBeUpdated), UserRole.SiteConsumer);
restClient.authenticateUser(publicSiteUsers.getOneUserWithRole(UserRole.SiteContributor));
restClient.withCoreAPI().usingSite(publicSite).updateSiteGroup(getId(groupToBeUpdated), UserRole.SiteCollaborator);
restClient.assertStatusCodeIs(HttpStatus.UNPROCESSABLE_ENTITY);
restClient.assertLastError()
.containsSummary(String.format("The current user does not have permissions to modify the membership details of the site %s.", publicSite.getTitle()));
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
description = "Verify that consumer is not able to update site group and gets status code FORBIDDEN (403)")
public void consumerIsNotAbleToUpdateSiteGroup() throws Exception
{
groupToBeUpdated = dataGroup.createRandomGroup();
restClient.authenticateUser(publicSiteUsers.getOneUserWithRole(UserRole.SiteManager));
restClient.withCoreAPI().usingSite(publicSite).addSiteGroup(getId(groupToBeUpdated), UserRole.SiteConsumer);
restClient.authenticateUser(publicSiteUsers.getOneUserWithRole(UserRole.SiteConsumer));
restClient.withCoreAPI().usingSite(publicSite).updateSiteGroup(getId(groupToBeUpdated), UserRole.SiteCollaborator);
restClient.assertStatusCodeIs(HttpStatus.UNPROCESSABLE_ENTITY);
restClient.assertLastError()
.containsSummary(String.format("The current user does not have permissions to modify the membership details of the site %s.", publicSite.getTitle()));
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
description = "Verify that admin is able to update site member and gets status code OK (200)")
public void adminIsAbleToUpdateSiteGroup() throws Exception
{
groupToBeUpdated = dataGroup.createRandomGroup();
restClient.authenticateUser(adminUser);
restClient.withCoreAPI().usingSite(publicSite).addSiteGroup(getId(groupToBeUpdated), UserRole.SiteConsumer);
restClient.withCoreAPI().usingSite(publicSite).updateSiteGroup(getId(groupToBeUpdated), UserRole.SiteCollaborator)
.assertThat().field("id").is(getId(groupToBeUpdated))
.and().field("role").is(UserRole.SiteCollaborator);
restClient.assertStatusCodeIs(HttpStatus.OK);
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY })
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY,
description = "Verify that unauthenticated user is not able to update site member")
public void unauthenticatedUserIsNotAuthorizedToUpdateSiteGroup() throws Exception
{
groupToBeUpdated = dataGroup.createRandomGroup();
restClient.authenticateUser(adminUser);
restClient.withCoreAPI().usingSite(publicSite).addSiteGroup(getId(groupToBeUpdated), UserRole.SiteConsumer);
UserModel inexistentUser = new UserModel("inexistent user", "inexistent password");
restClient.authenticateUser(inexistentUser);
restClient.withCoreAPI().usingSite(publicSite).updateSiteGroup(getId(groupToBeUpdated), UserRole.SiteCollaborator);
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED);
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
description= "Verify if update site group request returns status code 404 when nonexistent siteId is used")
public void updateSiteGroupOfNonexistentSite() throws Exception
{
groupToBeUpdated = dataGroup.createRandomGroup();
SiteModel deletedSite = dataSite.usingUser(adminUser).createPublicRandomSite();
dataSite.deleteSite(deletedSite);
restClient.authenticateUser(adminUser).withCoreAPI().usingSite(deletedSite).updateSiteGroup(getId(groupToBeUpdated), UserRole.SiteConsumer);
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND)
.assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, deletedSite.getId()));
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
description= "Verify if update site member request returns status code 400 when personId is not member of the site")
public void updateNotASiteMember() throws Exception
{
groupToBeUpdated = dataGroup.createRandomGroup();
restClient.authenticateUser(adminUser).withCoreAPI().usingSite(publicSite).updateSiteGroup(getId(groupToBeUpdated), UserRole.SiteConsumer);
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST)
.assertLastError().containsSummary("authority is not a member of the site");
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
description= "Verify if update site member request returns status code 404 when personId does not exist")
public void updateNonexistentSiteMember() throws Exception
{
GroupModel nonexistentUser = new GroupModel("nonexistentUser");
restClient.authenticateUser(adminUser).withCoreAPI().usingSite(publicSite).updateSiteGroup(getId(nonexistentUser), UserRole.SiteConsumer);
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND).assertLastError().containsSummary(String.format("An authority was not found for %s", getId(nonexistentUser)));
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
description= "Verify if update site member request returns status code 404 when empty siteId is used")
public void updateSiteMemberUsingEmptySiteId() throws Exception
{
restClient.authenticateUser(adminUser).withCoreAPI().usingSite("").updateSiteGroup(getId(regularGroup), UserRole.SiteConsumer);
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND)
.assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, ""));
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
description= "Verify if update site member request returns status code 405 when empty personId is used")
public void updateSiteMemberUsingEmptyPersonId() throws Exception
{
GroupModel emptyGroup = new GroupModel("");
restClient.authenticateUser(adminUser).withCoreAPI().usingSite(publicSite).updateSiteGroup(getId(emptyGroup), UserRole.SiteConsumer);
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND).assertLastError().containsSummary(String.format("An authority was not found for %s", getId(emptyGroup)));
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
description= "Verify if update site member request returns status code 400 when invalid role is used")
public void updateSiteMemberUsingInvalidRole() throws Exception
{
groupToBeUpdated = dataGroup.createRandomGroup();
restClient.authenticateUser(siteCreator).withCoreAPI();
restClient.authenticateUser(adminUser).withCoreAPI().usingSite(publicSite).updateSiteGroup(getId(groupToBeUpdated), UserRole.SiteConsumer);
String json = JsonBodyGenerator.keyValueJson("role","invalidRole");
RestRequest request = RestRequest.requestWithBody(HttpMethod.PUT, json, "sites/{siteId}/group-members/{groupId}", publicSite.getId(), getId(groupToBeUpdated));
restClient.processModel(RestSiteMemberModel.class, request);
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST)
.assertLastError().containsSummary("authority is not a member of the site");
}
String getId(GroupModel group) {
return "GROUP_" + group.getGroupIdentifier();
}
}

View File

@@ -6,6 +6,7 @@ import org.alfresco.rest.model.RestSiteMemberModel;
import org.alfresco.rest.model.RestSiteMemberModelsCollection;
import org.alfresco.utility.constants.UserRole;
import org.alfresco.utility.data.DataUser.ListUserWithRoles;
import org.alfresco.utility.model.GroupModel;
import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel;
@@ -20,7 +21,7 @@ import org.testng.annotations.Test;
*/
public class GetSiteMembersTests extends RestTest
{
private SiteModel publicSite, privateSite, moderatedSite, moderatedSite2, moderatedSite3;
private SiteModel publicSite, privateSite, moderatedSite, moderatedSite2, moderatedSite3, moderatedSite4;
private RestSiteMemberModelsCollection siteMembers;
private ListUserWithRoles usersWithRoles, moderatedSiteUsers;
private UserModel regularUser, privateSiteConsumer, siteCreator;
@@ -38,6 +39,7 @@ public class GetSiteMembersTests extends RestTest
moderatedSite = dataSite.usingUser(siteCreator).createModeratedRandomSite();
moderatedSite2 = dataSite.usingUser(siteCreator).createModeratedRandomSite();
moderatedSite3 = dataSite.usingUser(siteCreator).createModeratedRandomSite();
moderatedSite4 = dataSite.usingUser(siteCreator).createModeratedRandomSite();
dataUser.addUserToSite(privateSiteConsumer, privateSite, UserRole.SiteConsumer);
dataUser.addUserToSite(privateSiteConsumer, moderatedSite3, UserRole.SiteConsumer);
@@ -351,4 +353,32 @@ public class GetSiteMembersTests extends RestTest
.and().entriesListContains("role", UserRole.SiteManager.toString())
.and().entriesListContains("id", siteCreator.getUsername());
}
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION,
description= "Verify if isMemberOfGroup if user part of the group")
public void verifyIsMemberOfGroupProps() throws Exception
{
GroupModel firstGroup = dataGroup.createRandomGroup();
UserModel user = dataUser.createRandomTestUser();
dataGroup.addListOfUsersToGroup(firstGroup, user);
siteMembers = restClient.authenticateUser(siteCreator).withCoreAPI()
.usingSite(moderatedSite4).getSiteMembers();
restClient.assertStatusCodeIs(HttpStatus.OK);
siteMembers.assertThat().entriesListCountIs(1);
restClient.withCoreAPI().usingSite(moderatedSite4).addSiteGroup("GROUP_" + firstGroup.getGroupIdentifier(), UserRole.SiteCollaborator);
siteMembers = restClient.withCoreAPI().usingSite(moderatedSite4).getSiteMembers();
restClient.assertStatusCodeIs(HttpStatus.OK);
siteMembers.assertThat().entriesListCountIs(2);
siteMembers.getEntryByIndex(0).assertThat().field("isMemberOfGroup").isNotNull();
siteMembers.getEntryByIndex(1).assertThat().field("isMemberOfGroup").isNotNull();
siteMembers = restClient.withCoreAPI().usingSite(moderatedSite4).usingParams("where=(isMemberOfGroup=false)").getSiteMembers();
restClient.assertStatusCodeIs(HttpStatus.OK);
siteMembers.assertThat().entriesListCountIs(1);
siteMembers.getEntries().get(0).assertThat().field("isMemberOfGroup").is(false);
}
}

View File

@@ -15,6 +15,7 @@
<package name="org.alfresco.rest.tags.*"/>
<package name="org.alfresco.rest.trashcan.*"/>
<package name="org.alfresco.rest.workflow.*"/>
<package name="org.alfresco.rest.models.*"/>
</packages>
</test>
</suite>

View File

@@ -9,7 +9,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-tests</artifactId>
<version>repo-5439-M3c1</version>
<version>9.40</version>
</parent>
<developers>

View File

@@ -7,12 +7,12 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-packaging</artifactId>
<version>repo-5439-M3c1</version>
<version>9.40</version>
</parent>
<properties>
<scm-path>${project.parent.parent.scm.url}</scm-path>
<scm-revision>${build-number}</scm-revision>
<scm-revision>${buildNumber}</scm-revision>
</properties>
<dependencies>
@@ -60,12 +60,10 @@
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.3.3</version>
</dependency>
<dependency>
<groupId>javax.xml.soap</groupId>
<artifactId>javax.xml.soap-api</artifactId>
<version>1.4.0</version>
<groupId>jakarta.xml.soap</groupId>
<artifactId>jakarta.xml.soap-api</artifactId>
</dependency>
<!-- 'provided' dependencies, not packaged in war -->
<dependency>
@@ -95,11 +93,6 @@
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<!-- required by GDocs-->
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
@@ -147,6 +140,23 @@
</resource>
</resources>
<plugins>
<!-- Gets the scm revision and stores it in the ${buildNumber} variable -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
<configuration>
<shortRevisionLength>8</shortRevisionLength>
</configuration>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>

View File

@@ -66,6 +66,8 @@
<bean id="SOLRAuthenticationFilter" class="org.alfresco.repo.web.scripts.solr.SOLRAuthenticationFilter">
<property name="secureComms" value="${solr.secureComms}"/>
<property name="sharedSecret" value="${solr.sharedSecret}"/>
<property name="sharedSecretHeader" value="${solr.sharedSecret.header}"/>
</bean>
<bean id="WebscriptAuthenticationFilter" class="org.alfresco.repo.management.subsystems.ChainingSubsystemProxyFactory">

View File

@@ -184,5 +184,15 @@
</filter>
</config>
<!--
A set of HTTP response headers that instructs the browser to behave in certain ways to improve security
-->
<config evaluator="string-compare" condition="SecurityHeadersPolicy">
<headers>
<header>
<name>X-Frame-Options</name>
<value>SAMEORIGIN</value>
</header>
</headers>
</config>
</alfresco-config>

View File

@@ -239,11 +239,6 @@ log4j.logger.freemarker.runtime=
# Metadata extraction
log4j.logger.org.alfresco.repo.content.metadata.AbstractMappingMetadataExtracter=warn
# Reduces PDFont error level due to ALF-7105
log4j.logger.org.apache.pdfbox.pdmodel.font.PDSimpleFont=fatal
log4j.logger.org.apache.pdfbox.pdmodel.font.PDFont=fatal
log4j.logger.org.apache.pdfbox.pdmodel.font.PDCIDFont=fatal
# no index support
log4j.logger.org.alfresco.repo.search.impl.noindex.NoIndexIndexer=fatal
log4j.logger.org.alfresco.repo.search.impl.noindex.NoIndexSearchService=fatal
@@ -264,10 +259,7 @@ log4j.logger.org.alfresco.enterprise.repo.authorization.AuthorizationsConsistenc
log4j.logger.org.alfresco.heartbeat=info
# Transformations
log4j.logger.org.alfresco.repo.content.transform.JodContentTransformer=info
log4j.logger.org.alfresco.repo.content.transform.magick.ImageMagickContentTransformerWorker=info
log4j.logger.org.alfresco.repo.content.transform.pdfrenderer.AlfrescoPdfRendererContentTransformerWorker=info
log4j.logger.org.alfresco.repo.content.transform.TikaPoweredContentTransformer=info
#log4j.logger.org.alfresco.repo.content.transform.TransformerDebug=debug
log4j.logger.org.alfresco.repo.content.transform=info

View File

@@ -104,6 +104,12 @@
<filter-class>org.springframework.extensions.webscripts.servlet.CSRFFilter</filter-class>
</filter>
<filter>
<description>Security Headers filter. Adds security response headers based on config.</description>
<filter-name>Security Headers Filter</filter-name>
<filter-class>org.springframework.extensions.webscripts.servlet.SecurityHeadersFilter</filter-class>
</filter>
<!-- Enterprise filter placeholder -->
<filter-mapping>
<filter-name>Clear security context filter</filter-name>
@@ -225,6 +231,11 @@
<url-pattern>/wcs/admin/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>Security Headers Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- Enterprise filter-mapping placeholder -->
<!-- Spring Context Loader listener - can disable loading of context if runtime config changes are needed -->

View File

@@ -57,8 +57,8 @@ ModuleDetails shareServicesModule = moduleService.getModule("alfresco-share-serv
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Alfresco</title>
<link rel="stylesheet" type="text/css" href="./css/reset.css" />
<link rel="stylesheet" type="text/css" href="./css/alfresco.css" />
<link rel="stylesheet" type="text/css" href="/<%=sysAdminParams.getAlfrescoContext()%>/css/reset.css" />
<link rel="stylesheet" type="text/css" href="/<%=sysAdminParams.getAlfrescoContext()%>/css/alfresco.css" />
</head>
<body>
<div class="sticky-wrapper">

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

View File

@@ -4,21 +4,21 @@
%%
Copyright (C) 2005 - 2016 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
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%
@@ -57,19 +57,19 @@ ModuleDetails shareServicesModule = moduleService.getModule("alfresco-share-serv
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Alfresco</title>
<link rel="stylesheet" type="text/css" href="./css/reset.css" />
<link rel="stylesheet" type="text/css" href="./css/alfresco.css" />
<link rel="stylesheet" type="text/css" href="/<%=sysAdminParams.getAlfrescoContext()%>/css/reset.css" />
<link rel="stylesheet" type="text/css" href="/<%=sysAdminParams.getAlfrescoContext()%>/css/alfresco.css" />
</head>
<body>
<div class="sticky-wrapper">
<div class="index">
<div class="title">
<span class="logo"><a href="http://www.alfresco.com"><img src="./images/logo/logo.png" width="145" height="48" alt="" border="0" /></a></span>
<span class="logo-separator">&nbsp;</span>
<h1>Welcome to Alfresco</h1>
</div>
<div class="index-list">
<h4><%=descriptorService.getServerDescriptor().getEdition()%>&nbsp;-&nbsp;<%=descriptorService.getServerDescriptor().getVersion()%></h4>
<p></p>
@@ -94,7 +94,7 @@ ModuleDetails shareServicesModule = moduleService.getModule("alfresco-share-serv
{
%>
<p>WARNING: The system is in Read Only mode, the License may have failed to deploy. Please visit the <a href="./s/enterprise/admin">Alfresco Administration Console</a> (admin only)</p>
<%
<%
}
if (descriptorService.getLicenseDescriptor() != null && descriptorService.getLicenseDescriptor().getLicenseMode().toString().equals("ENTERPRISE"))
{
@@ -120,7 +120,7 @@ ModuleDetails shareServicesModule = moduleService.getModule("alfresco-share-serv
<p><a href="./api/-default-/public/cmis/versions/1.1/atom">CMIS 1.1 AtomPub Service Document</a></p>
<p><a href="./api/-default-/public/cmis/versions/1.1/browser">CMIS 1.1 Browser Binding URL</a></p>
</div>
</div>
<div class="push"></div>
</div>

330
pom.xml
View File

@@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>alfresco-community-repo</artifactId>
<version>repo-5439-M3c1</version>
<version>9.40</version>
<packaging>pom</packaging>
<name>Alfresco Community Repo Parent</name>
@@ -23,7 +23,7 @@
<properties>
<acs.version.major>7</acs.version.major>
<acs.version.minor>0</acs.version.minor>
<acs.version.revision>0</acs.version.revision>
<acs.version.revision>1</acs.version.revision>
<acs.version.label />
<version.edition>Community</version.edition>
@@ -34,85 +34,90 @@
<image.registry>quay.io</image.registry>
<java.version>11</java.version>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.build.sourceVersion>11</maven.build.sourceVersion>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<maven.build.sourceVersion>${java.version}</maven.build.sourceVersion>
<dir.root>${project.build.directory}/alf_data</dir.root>
<img.exe>convert</img.exe>
<dependency.alfresco-hb-data-sender.version>1.0.12</dependency.alfresco-hb-data-sender.version>
<dependency.alfresco-mmt.version>6.0</dependency.alfresco-mmt.version>
<dependency.alfresco-pdf-renderer.version>1.1</dependency.alfresco-pdf-renderer.version>
<dependency.alfresco-trashcan-cleaner.version>2.3</dependency.alfresco-trashcan-cleaner.version>
<dependency.alfresco-trashcan-cleaner.version>2.4.1</dependency.alfresco-trashcan-cleaner.version>
<dependency.alfresco-jlan.version>7.1</dependency.alfresco-jlan.version>
<dependency.alfresco-server-root.version>6.0.1</dependency.alfresco-server-root.version>
<dependency.alfresco-messaging-repo.version>1.2.15</dependency.alfresco-messaging-repo.version>
<dependency.alfresco-log-sanitizer.version>0.2</dependency.alfresco-log-sanitizer.version>
<dependency.activiti-engine.version>5.23.0</dependency.activiti-engine.version>
<dependency.activiti.version>5.23.0</dependency.activiti.version>
<dependency.transform.model.version>1.0.2.11</dependency.transform.model.version>
<dependency.transform.model.version>1.3.1</dependency.transform.model.version>
<dependency.alfresco-greenmail.version>6.2</dependency.alfresco-greenmail.version>
<dependency.acs-event-model.version>0.0.11</dependency.acs-event-model.version>
<dependency.acs-event-model.version>0.0.12</dependency.acs-event-model.version>
<dependency.spring.version>5.2.9.RELEASE</dependency.spring.version>
<dependency.spring.version>5.3.3</dependency.spring.version>
<dependency.antlr.version>3.5.2</dependency.antlr.version>
<dependency.jackson.version>2.11.3</dependency.jackson.version>
<dependency.jackson-databind.version>2.11.2</dependency.jackson-databind.version>
<dependency.cxf.version>3.4.1</dependency.cxf.version>
<dependency.jackson.version>2.12.3</dependency.jackson.version>
<dependency.jackson-databind.version>2.12.3</dependency.jackson-databind.version>
<dependency.cxf.version>3.4.4</dependency.cxf.version>
<dependency.opencmis.version>1.0.0</dependency.opencmis.version>
<dependency.pdfbox.version>2.0.21</dependency.pdfbox.version>
<dependency.webscripts.version>8.12</dependency.webscripts.version>
<dependency.bouncycastle.version>1.66</dependency.bouncycastle.version>
<dependency.mockito-core.version>3.6.0</dependency.mockito-core.version>
<dependency.org-json.version>20200518</dependency.org-json.version>
<dependency.webscripts.version>8.27</dependency.webscripts.version>
<dependency.bouncycastle.version>1.69</dependency.bouncycastle.version>
<dependency.mockito-core.version>3.9.0</dependency.mockito-core.version>
<dependency.org-json.version>20210307</dependency.org-json.version>
<dependency.commons-dbcp.version>1.4-DBCP330</dependency.commons-dbcp.version>
<dependency.guava.version>28.2-jre</dependency.guava.version>
<dependency.commons-io.version>2.8.0</dependency.commons-io.version>
<dependency.gson.version>2.8.5</dependency.gson.version>
<dependency.httpclient.version>4.5.13</dependency.httpclient.version>
<dependency.httpcore.version>4.4.13</dependency.httpcore.version>
<dependency.httpcore.version>4.4.14</dependency.httpcore.version>
<dependency.commons-httpclient.version>3.1-HTTPCLIENT-1265</dependency.commons-httpclient.version>
<dependency.xercesImpl.version>2.12.0-alfresco-patched-20191004</dependency.xercesImpl.version>
<dependency.xercesImpl.version>2.12.1</dependency.xercesImpl.version>
<dependency.slf4j.version>1.7.30</dependency.slf4j.version>
<dependency.gytheio.version>0.11.6</dependency.gytheio.version>
<dependency.jaxb.version>2.3.3</dependency.jaxb.version>
<dependency.gytheio.version>0.12</dependency.gytheio.version>
<dependency.groovy.version>2.5.9</dependency.groovy.version>
<dependency.javax.mail.version>1.6.2</dependency.javax.mail.version>
<dependency.tika.version>1.24.1</dependency.tika.version>
<dependency.spring-security.version>5.4.1</dependency.spring-security.version>
<dependency.tika.version>1.26</dependency.tika.version>
<dependency.spring-security.version>5.5.0</dependency.spring-security.version>
<dependency.truezip.version>7.7.10</dependency.truezip.version>
<dependency.poi.version>4.1.2</dependency.poi.version>
<dependency.ooxml-schemas.version>1.4</dependency.ooxml-schemas.version>
<dependency.keycloak.version>11.0.0-alfresco-001</dependency.keycloak.version>
<dependency.keycloak.version>13.0.1</dependency.keycloak.version>
<dependency.jboss.logging.version>3.4.1.Final</dependency.jboss.logging.version>
<dependency.camel.version>2.24.2</dependency.camel.version>
<dependency.activemq.version>5.16.0</dependency.activemq.version>
<dependency.camel.version>3.7.4</dependency.camel.version>
<dependency.activemq.version>5.16.1</dependency.activemq.version>
<dependency.apache-compress.version>1.20</dependency.apache-compress.version>
<dependency.apache.taglibs.version>1.2.5</dependency.apache.taglibs.version>
<dependency.awaitility.version>4.0.3</dependency.awaitility.version>
<dependency.awaitility.version>4.1.0</dependency.awaitility.version>
<alfresco.googledrive.version>3.2.0</alfresco.googledrive.version>
<alfresco.aos-module.version>1.4.0-M1</alfresco.aos-module.version>
<dependency.jakarta-jaxb-api.version>2.3.3</dependency.jakarta-jaxb-api.version>
<dependency.jakarta-ws-api.version>2.3.3</dependency.jakarta-ws-api.version>
<dependency.jakarta-soap-api.version>1.4.2</dependency.jakarta-soap-api.version>
<dependency.jakarta-activation-api.version>1.2.2</dependency.jakarta-activation-api.version>
<dependency.jakarta-annotation-api.version>1.3.5</dependency.jakarta-annotation-api.version>
<dependency.jakarta-transaction-api.version>1.3.3</dependency.jakarta-transaction-api.version>
<dependency.jakarta-jws-api.version>2.1.0</dependency.jakarta-jws-api.version>
<dependency.jakarta-mail-api.version>1.6.5</dependency.jakarta-mail-api.version>
<dependency.jakarta-json-api.version>1.1.6</dependency.jakarta-json-api.version>
<dependency.jakarta-rpc-api.version>1.1.4</dependency.jakarta-rpc-api.version>
<dependency.postgresql.version>42.2.18</dependency.postgresql.version>
<dependency.mysql.version>8.0.22</dependency.mysql.version>
<dependency.mariadb.version>2.7.0</dependency.mariadb.version>
<dependency.tas-utility.version>3.0.40</dependency.tas-utility.version>
<alfresco.googledrive.version>3.2.1.3</alfresco.googledrive.version>
<alfresco.aos-module.version>1.4.0.1</alfresco.aos-module.version>
<dependency.postgresql.version>42.2.20</dependency.postgresql.version>
<dependency.mysql.version>8.0.25</dependency.mysql.version>
<dependency.mariadb.version>2.7.2</dependency.mariadb.version>
<dependency.tas-utility.version>3.0.44</dependency.tas-utility.version>
<dependency.rest-assured.version>3.3.0</dependency.rest-assured.version>
<dependency.javax.json.version>1.1.4</dependency.javax.json.version>
<dependency.tas-restapi.version>1.48</dependency.tas-restapi.version>
<dependency.tas-cmis.version>1.21</dependency.tas-cmis.version>
<dependency.tas-restapi.version>1.58</dependency.tas-restapi.version>
<dependency.tas-cmis.version>1.30</dependency.tas-cmis.version>
<dependency.tas-email.version>1.8</dependency.tas-email.version>
<dependency.tas-webdav.version>1.6</dependency.tas-webdav.version>
<dependency.tas-ftp.version>1.5</dependency.tas-ftp.version>
<dependency.tas-dataprep.version>2.3</dependency.tas-dataprep.version>
<dependency.tas-dataprep.version>2.6</dependency.tas-dataprep.version>
</properties>
<scm>
<connection>scm:git:https://github.com/Alfresco/alfresco-community-repo.git</connection>
<developerConnection>scm:git:https://github.com/Alfresco/alfresco-community-repo.git</developerConnection>
<url>https://github.com/Alfresco/alfresco-community-repo</url>
<tag>repo-5439-M3c1</tag>
<tag>9.40</tag>
</scm>
<distributionManagement>
@@ -128,6 +133,92 @@
<dependencyManagement>
<dependencies>
<!-- Jakarta... -->
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>${dependency.jakarta-jaxb-api.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>${dependency.jakarta-jaxb-api.version}</version>
</dependency>
<dependency>
<groupId>jakarta.xml.ws</groupId>
<artifactId>jakarta.xml.ws-api</artifactId>
<version>${dependency.jakarta-ws-api.version}</version>
</dependency>
<dependency>
<groupId>jakarta.xml.soap</groupId>
<artifactId>jakarta.xml.soap-api</artifactId>
<version>${dependency.jakarta-soap-api.version}</version>
</dependency>
<dependency>
<groupId>jakarta.activation</groupId>
<artifactId>jakarta.activation-api</artifactId>
<version>${dependency.jakarta-activation-api.version}</version>
</dependency>
<dependency>
<groupId>com.sun.activation</groupId>
<artifactId>jakarta.activation</artifactId>
<version>${dependency.jakarta-activation-api.version}</version>
</dependency>
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
<version>${dependency.jakarta-annotation-api.version}</version>
</dependency>
<dependency>
<groupId>jakarta.transaction</groupId>
<artifactId>jakarta.transaction-api</artifactId>
<version>${dependency.jakarta-transaction-api.version}</version>
</dependency>
<dependency>
<groupId>jakarta.jws</groupId>
<artifactId>jakarta.jws-api</artifactId>
<version>${dependency.jakarta-jws-api.version}</version>
</dependency>
<dependency>
<groupId>jakarta.mail</groupId>
<artifactId>jakarta.mail-api</artifactId>
<version>${dependency.jakarta-mail-api.version}</version>
</dependency>
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>jakarta.mail</artifactId>
<version>${dependency.jakarta-mail-api.version}</version>
</dependency>
<dependency>
<groupId>jakarta.json</groupId>
<artifactId>jakarta.json-api</artifactId>
<version>${dependency.jakarta-json-api.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>jakarta.json</artifactId>
<version>${dependency.jakarta-json-api.version}</version>
</dependency>
<dependency>
<groupId>jakarta.xml.rpc</groupId>
<artifactId>jakarta.xml.rpc-api</artifactId>
<version>${dependency.jakarta-rpc-api.version}</version>
</dependency>
<dependency>
<groupId>com.sun.xml.rpc</groupId>
<artifactId>jaxrpc-impl</artifactId>
<version>${dependency.jakarta-rpc-api.version}</version>
</dependency>
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-jlan-embed</artifactId>
@@ -142,6 +233,13 @@
<groupId>org.alfresco</groupId>
<artifactId>alfresco-heartbeat-data-sender</artifactId>
<version>${dependency.alfresco-hb-data-sender.version}</version>
<exclusions>
<!-- Duplicates classes from jakarta.xml.bind:jakarta.xml.bind-api -->
<exclusion>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>xalan</groupId>
@@ -159,26 +257,18 @@
<groupId>org.alfresco.services</groupId>
<artifactId>alfresco-messaging-repo</artifactId>
<version>${dependency.alfresco-messaging-repo.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-broker</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-mmt</artifactId>
<version>${dependency.alfresco-mmt.version}</version>
</dependency>
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-pdf-renderer</artifactId>
<version>${dependency.alfresco-pdf-renderer.version}</version>
<classifier>linux</classifier>
<type>tgz</type>
</dependency>
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-pdf-renderer</artifactId>
<version>${dependency.alfresco-pdf-renderer.version}</version>
<classifier>win64</classifier>
<type>tgz</type>
</dependency>
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-server-root</artifactId>
@@ -261,21 +351,12 @@
<artifactId>commons-digester</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>${dependency.jaxb.version}</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
@@ -399,11 +480,6 @@
<artifactId>jackson-module-jaxb-annotations</artifactId>
<version>${dependency.jackson.version}</version>
</dependency>
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>2.3.3</version>
</dependency>
<dependency>
<groupId>org.codehaus.woodstox</groupId>
<artifactId>woodstox-core-asl</artifactId>
@@ -474,8 +550,7 @@
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.67</version>
<!-- <version>${dependency.bouncycastle.version}</version>-->
<version>${dependency.bouncycastle.version}</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
@@ -508,13 +583,13 @@
<dependency>
<groupId>com.drewnoakes</groupId>
<artifactId>metadata-extractor</artifactId>
<version>2.15.0</version>
<version>2.16.0</version>
</dependency>
<!-- upgrade dependency from TIKA -->
<dependency>
<groupId>com.github.junrar</groupId>
<artifactId>junrar</artifactId>
<version>4.0.0</version>
<version>7.4.0</version>
</dependency>
<!-- upgrade dependency from TIKA -->
<dependency>
@@ -523,22 +598,10 @@
<version>1.13.1</version>
</dependency>
<!-- upgrade dependency from TIKA -->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${dependency.guava.version}</version>
</dependency>
<!-- upgrade dependency from TIKA -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.20</version>
</dependency>
<!-- upgrade dependency from TIKA -->
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>${dependency.pdfbox.version}</version>
<version>${dependency.apache-compress.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
@@ -577,12 +640,6 @@
<version>${dependency.rest-assured.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.json</artifactId>
<version>${dependency.javax.json.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.alfresco.tas</groupId>
<artifactId>restapi</artifactId>
@@ -619,15 +676,10 @@
<version>${dependency.tas-dataprep.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>jakarta.transaction</groupId>
<artifactId>jakarta.transaction-api</artifactId>
<version>1.3.3</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.10.8</version>
<version>2.10.10</version>
</dependency>
<!-- provided dependencies -->
@@ -642,7 +694,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13</version>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -667,6 +719,75 @@
<artifactId>gson</artifactId>
<version>${dependency.gson.version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring</artifactId>
<version>${dependency.camel.version}</version>
<exclusions>
<exclusion>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-activemq</artifactId>
<version>${dependency.camel.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-broker</artifactId>
</exclusion>
<!-- Duplicates classes from jakarta.transaction:jakarta.transaction-api -->
<exclusion>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jta_1.1_spec</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-amqp</artifactId>
<version>${dependency.camel.version}</version>
<exclusions>
<!-- conflicts with activemq geronimo-jms_1.1_spec -->
<exclusion>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jms_2.0_spec</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jackson</artifactId>
<version>${dependency.camel.version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-directvm</artifactId>
<version>${dependency.camel.version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-direct</artifactId>
<version>${dependency.camel.version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-management</artifactId>
<version>${dependency.camel.version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-mock</artifactId>
<version>${dependency.camel.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>
@@ -683,8 +804,8 @@
</plugin>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>fabric8-maven-plugin</artifactId>
<version>4.4.0</version>
<artifactId>docker-maven-plugin</artifactId>
<version>0.34.1</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
@@ -693,7 +814,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -708,5 +829,4 @@
</plugins>
</pluginManagement>
</build>
</project>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>repo-5439-M3c1</version>
<version>9.40</version>
</parent>
<dependencies>
@@ -16,38 +16,13 @@
<artifactId>alfresco-repository</artifactId>
<version>${project.version}</version>
</dependency>
<!-- Jakarta... -->
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-data-model</artifactId>
<version>${project.version}</version>
<exclusions>
<!-- Duplicate classes from com.sun.activation:jakarta.activation-->
<exclusion>
<groupId>com.sun.activation</groupId>
<artifactId>javax.activation</artifactId>
</exclusion>
<!-- REPO-4998 - Exclusion due to classpath conflicts between org.codehaus.woodstox:woodstox-core-asl and com.fasterxml.woodstox:woodstox-core -->
<exclusion>
<groupId>org.codehaus.woodstox</groupId>
<artifactId>woodstox-core-asl</artifactId>
</exclusion>
<!-- Duplicate classes from jakarta.annotation:jakarta.annotation-api-->
<exclusion>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
</exclusion>
<!-- REPO-5009 Excluded to avoid duplicated classes with javax.jws:javax.jws-api -->
<exclusion>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-ws-metadata_2.0_spec</artifactId>
</exclusion>
<!-- Duplicates classes from jakarta.transaction:jakarta.transaction-api -->
<exclusion>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jta_1.1_spec</artifactId>
</exclusion>
</exclusions>
<groupId>jakarta.xml.rpc</groupId>
<artifactId>jakarta.xml.rpc-api</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
@@ -79,23 +54,12 @@
<groupId>org.alfresco.surf</groupId>
<artifactId>spring-webscripts</artifactId>
</dependency>
<dependency>
<groupId>javax.xml</groupId>
<artifactId>jaxrpc-api</artifactId>
<version>1.1</version>
</dependency>
<!-- This is needed at runtime by Web Client, so not really a test dependency -->
<dependency>
<groupId>org.apache.chemistry.opencmis</groupId>
<artifactId>chemistry-opencmis-test-tck</artifactId>
<version>${dependency.opencmis.version}</version>
<exclusions>
<!-- Duplicate classes from com.sun.activation:jakarta.activation-->
<exclusion>
<groupId>com.sun.activation</groupId>
<artifactId>javax.activation</artifactId>
</exclusion>
<!-- REPO-5009 Excluded to avoid duplicated classes with javax.jws:javax.jws-api -->
<exclusion>
<groupId>org.apache.geronimo.specs</groupId>
@@ -141,18 +105,6 @@
<version>${project.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
<exclusions>
<!-- Duplicates classes from jakarta.transaction:jakarta.transaction-api -->
<exclusion>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
</exclusion>
<!-- Duplicates classes from jakarta.xml.bind:jakarta.xml.bind-api -->
<exclusion>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.alfresco.surf</groupId>
@@ -195,6 +147,11 @@
<version>2.0</version>
<scope>test</scope>
<exclusions>
<!-- Duplicates classes from jakarta.transaction:jakarta.transaction-api -->
<exclusion>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jta_1.1_spec</artifactId>
</exclusion>
<!-- REPO-5009 Excluded to avoid duplicated classes with javax.jws:javax.jws-api -->
<exclusion>
<groupId>org.apache.geronimo.specs</groupId>
@@ -207,101 +164,12 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-mock</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<profiles>
<!-- Profiles to extract the alfresco-pdf-renderer -->
<profile>
<id>win-alfresco-pdf-renderer-test</id>
<activation>
<os>
<family>windows</family>
</os>
</activation>
<dependencies>
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-pdf-renderer</artifactId>
<classifier>win64</classifier>
<type>tgz</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<inherited>false</inherited>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>extract-alfresco-pdf-renderer-test</id>
<phase>generate-test-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<skip>${skipTests}</skip>
<target>
<echo message="Extracting alfresco-pdf-renderer (windows) for testing..." />
<mkdir dir="${project.build.directory}/test-binaries/alfresco-pdf-renderer" />
<untar compression="gzip" src="${settings.localRepository}/org/alfresco/alfresco-pdf-renderer/${dependency.alfresco-pdf-renderer.version}/alfresco-pdf-renderer-${dependency.alfresco-pdf-renderer.version}-win64.tgz" dest="${project.build.directory}/test-binaries/alfresco-pdf-renderer" />
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<properties>
<alfresco-pdf-renderer.exe>${project.build.directory}/test-binaries/alfresco-pdf-renderer/alfresco-pdf-renderer</alfresco-pdf-renderer.exe>
</properties>
</profile>
<profile>
<id>linux-alfresco-pdf-renderer-test</id>
<activation>
<os>
<family>linux</family>
</os>
</activation>
<dependencies>
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-pdf-renderer</artifactId>
<classifier>linux</classifier>
<type>tgz</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<inherited>false</inherited>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>extract-alfresco-pdf-renderer-test</id>
<phase>generate-test-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<skip>${skipTests}</skip>
<target>
<echo message="Extracting alfresco-pdf-renderer (linux) for testing..." />
<mkdir dir="${project.build.directory}/test-binaries/alfresco-pdf-renderer" />
<exec failonerror="true" executable="tar" dir="${project.build.directory}/test-binaries/alfresco-pdf-renderer">
<arg value="xf" />
<arg value="${settings.localRepository}/org/alfresco/alfresco-pdf-renderer/${dependency.alfresco-pdf-renderer.version}/alfresco-pdf-renderer-${dependency.alfresco-pdf-renderer.version}-linux.tgz" />
</exec>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<properties>
<alfresco-pdf-renderer.exe>${project.build.directory}/test-binaries/alfresco-pdf-renderer/alfresco-pdf-renderer</alfresco-pdf-renderer.exe>
</properties>
</profile>
</profiles>
<build>
<pluginManagement>
<plugins>
@@ -335,8 +203,6 @@
<!-- To prevent tests alfresco.log to be created in project roots and bother while synchronizing with SCM -->
<workingDirectory>${project.build.directory}</workingDirectory>
<systemPropertyVariables>
<alfresco-pdf-renderer.exe>${alfresco-pdf-renderer.exe}</alfresco-pdf-renderer.exe>
<!-- Database related properties -->
<db.url>${db.url}</db.url>
<db.driver>${db.driver}</db.driver>
@@ -344,7 +210,6 @@
<db.username>${db.username}</db.username>
<db.password>${db.password}</db.password>
<dir.root>${dir.root}</dir.root>
<img.exe>${img.exe}</img.exe>
<!-- BDE-91 -->
<alfresco.rmi.services.retries>30</alfresco.rmi.services.retries>
<alfresco.rmi.services.retryInterval>2000</alfresco.rmi.services.retryInterval>

View File

@@ -1,62 +1,61 @@
/*
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2016 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%
*/
/*
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2016 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.repo.web.scripts.solr;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.FilterChain;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponseWrapper;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.httpclient.HttpClientFactory;
import org.alfresco.repo.web.filter.beans.DependencyInjectedFilter;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.InitializingBean;
/**
* This filter protects the solr callback urls by verifying MACs on requests and encrypting responses
* and generating MACs on responses, if the secureComms property is set to "md5". If it is set to "https"
* or "none", the filter does nothing to the request and response.
*
* This filter protects the solr callback urls by verifying a shared secret on the request header if
* the secureComms property is set to "secret". If it is set to "https", this will will just verify
* that the request came in through a "secure" tomcat connector. (but it will not validate the certificate
* on the request; this done in a different filter).
*
* @since 4.0
*
*/
public class SOLRAuthenticationFilter implements DependencyInjectedFilter
public class SOLRAuthenticationFilter implements DependencyInjectedFilter, InitializingBean
{
public static enum SecureCommsType
{
HTTPS, NONE;
HTTPS, SECRET, NONE;
public static SecureCommsType getType(String type)
{
@@ -64,6 +63,10 @@ public class SOLRAuthenticationFilter implements DependencyInjectedFilter
{
return HTTPS;
}
else if(type.equalsIgnoreCase("secret"))
{
return SECRET;
}
else if(type.equalsIgnoreCase("none"))
{
return NONE;
@@ -79,7 +82,11 @@ public class SOLRAuthenticationFilter implements DependencyInjectedFilter
private static Log logger = LogFactory.getLog(SOLRAuthenticationFilter.class);
private SecureCommsType secureComms = SecureCommsType.HTTPS;
private String sharedSecret;
private String sharedSecretHeader = HttpClientFactory.DEFAULT_SHAREDSECRET_HEADER;
public void setSecureComms(String type)
{
try
@@ -92,6 +99,33 @@ public class SOLRAuthenticationFilter implements DependencyInjectedFilter
}
}
public void setSharedSecret(String sharedSecret)
{
this.sharedSecret = sharedSecret;
}
public void setSharedSecretHeader(String sharedSecretHeader)
{
this.sharedSecretHeader = sharedSecretHeader;
}
@Override
public void afterPropertiesSet() throws Exception
{
if(secureComms == SecureCommsType.SECRET)
{
if(sharedSecret == null || sharedSecret.length()==0)
{
logger.fatal("Missing value for solr.sharedSecret configuration property. If solr.secureComms is set to \"secret\", a value for solr.sharedSecret is required. See https://docs.alfresco.com/search-services/latest/install/options/");
throw new AlfrescoRuntimeException("Missing value for solr.sharedSecret configuration property");
}
if(sharedSecretHeader == null || sharedSecretHeader.length()==0)
{
throw new AlfrescoRuntimeException("Missing value for sharedSecretHeader");
}
}
}
public void doFilter(ServletContext context, ServletRequest request,
ServletResponse response, FilterChain chain) throws IOException,
ServletException
@@ -99,52 +133,22 @@ public class SOLRAuthenticationFilter implements DependencyInjectedFilter
HttpServletRequest httpRequest = (HttpServletRequest)request;
HttpServletResponse httpResponse = (HttpServletResponse)response;
/* if(secureComms == SecureCommsType.ALFRESCO)
if(secureComms == SecureCommsType.SECRET)
{
// Need to get as a byte array because we need to read the request twice, once for authentication
// and again by the web service.
SOLRHttpServletRequestWrapper requestWrapper = new SOLRHttpServletRequestWrapper(httpRequest, encryptionUtils);
if(logger.isDebugEnabled())
if(sharedSecret.equals(httpRequest.getHeader(sharedSecretHeader)))
{
logger.debug("Authenticating " + httpRequest.getRequestURI());
}
if(encryptionUtils.authenticate(httpRequest, requestWrapper.getDecryptedBody()))
{
try
{
OutputStream out = response.getOutputStream();
GenericResponseWrapper responseWrapper = new GenericResponseWrapper(httpResponse);
// TODO - do I need to chain to other authenticating filters - probably not?
// Could also remove sending of credentials with http request
chain.doFilter(requestWrapper, responseWrapper);
Pair<byte[], AlgorithmParameters> pair = encryptor.encrypt(KeyProvider.ALIAS_SOLR, null, responseWrapper.getData());
encryptionUtils.setResponseAuthentication(httpRequest, httpResponse, responseWrapper.getData(), pair.getSecond());
httpResponse.setHeader("Content-Length", Long.toString(pair.getFirst().length));
out.write(pair.getFirst());
out.close();
}
catch(Exception e)
{
throw new AlfrescoRuntimeException("", e);
}
chain.doFilter(request, response);
}
else
{
httpResponse.setStatus(401);
httpResponse.sendError(HttpServletResponse.SC_FORBIDDEN, "Authentication failure");
}
}
else */if(secureComms == SecureCommsType.HTTPS)
else if(secureComms == SecureCommsType.HTTPS)
{
if(httpRequest.isSecure())
{
// https authentication
// https authentication; cert got verified in X509 filter
chain.doFilter(request, response);
}
else
@@ -158,128 +162,4 @@ public class SOLRAuthenticationFilter implements DependencyInjectedFilter
}
}
protected boolean validateTimestamp(String timestampStr)
{
if(timestampStr == null || timestampStr.equals(""))
{
throw new AlfrescoRuntimeException("Missing timestamp on request");
}
long timestamp = -1;
try
{
timestamp = Long.valueOf(timestampStr);
}
catch(NumberFormatException e)
{
throw new AlfrescoRuntimeException("Invalid timestamp on request");
}
if(timestamp == -1)
{
throw new AlfrescoRuntimeException("Invalid timestamp on request");
}
long currentTime = System.currentTimeMillis();
return((currentTime - timestamp) < 30 * 1000); // 5s
}
/* private static class SOLRHttpServletRequestWrapper extends HttpServletRequestWrapper
{
private byte[] body;
SOLRHttpServletRequestWrapper(HttpServletRequest req, EncryptionUtils encryptionUtils) throws IOException
{
super(req);
this.body = encryptionUtils.decryptBody(req);
}
byte[] getDecryptedBody()
{
return body;
}
public ServletInputStream getInputStream()
{
final InputStream in = (body != null ? new ByteArrayInputStream(body) : null);
return new ServletInputStream()
{
public int read() throws IOException
{
if(in == null)
{
return -1;
}
else
{
int i = in.read();
if(i == -1)
{
in.close();
}
return i;
}
}
};
}
}*/
private static class ByteArrayServletOutputStream extends ServletOutputStream
{
private ByteArrayOutputStream out = new ByteArrayOutputStream();
ByteArrayServletOutputStream()
{
}
public byte[] getData()
{
return out.toByteArray();
}
@Override
public void write(int b) throws IOException
{
out.write(b);
}
}
public static class GenericResponseWrapper extends HttpServletResponseWrapper {
private ByteArrayServletOutputStream output;
private int contentLength;
private String contentType;
public GenericResponseWrapper(HttpServletResponse response) {
super(response);
output = new ByteArrayServletOutputStream();
}
public byte[] getData() {
return output.getData();
}
public ServletOutputStream getOutputStream() {
return output;
}
public PrintWriter getWriter() {
return new PrintWriter(getOutputStream(),true);
}
public void setContentLength(int length) {
this.contentLength = length;
super.setContentLength(length);
}
public int getContentLength() {
return contentLength;
}
public void setContentType(String type) {
this.contentType = type;
super.setContentType(type);
}
public String getContentType() {
return contentType;
}
}
}

View File

@@ -1,28 +1,28 @@
/*
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2016 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%
*/
/*
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2016 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.repo.webdav;
import java.util.Set;
@@ -82,8 +82,6 @@ public class UnlockMethod extends WebDAVMethod
{
if (!(strLockTokenHeader.startsWith("<") && strLockTokenHeader.endsWith(">")))
{
// ALF-13904: Header isn't correctly enclosed in < and > characters. Try correcting this
// to allow for Windows 7 + OpenOffice.org bug.
strLockTokenHeader = "<" + strLockTokenHeader + ">";
}
if (strLockTokenHeader.startsWith("<" + WebDAV.OPAQUE_LOCK_TOKEN) && strLockTokenHeader.endsWith(">"))

View File

@@ -1,28 +1,28 @@
/*
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2016 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%
*/
/*
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2016 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.repo.webdav;
import java.io.IOException;
@@ -31,7 +31,6 @@ import java.util.List;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.UnavailableException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

View File

@@ -716,7 +716,7 @@ public abstract class BaseSSOAuthenticationFilter extends BaseAuthenticationFilt
}
else
{
if(!pathInfo.substring(0, 6).toLowerCase().equals("/cmis/") && !pathInfo.equals("/discovery"))
if((pathInfo.length() > 5 && !pathInfo.substring(0, 6).toLowerCase().equals("/cmis/")) && !pathInfo.equals("/discovery"))
{
// remove tenant
int idx = pathInfo.indexOf('/', 1);

View File

@@ -0,0 +1,51 @@
/*
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2021 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.rest.api;
import org.alfresco.rest.api.model.Aspect;
import org.alfresco.rest.framework.resource.parameters.CollectionWithPagingInfo;
import org.alfresco.rest.framework.resource.parameters.Parameters;
/**
* Aspect API
*/
public interface Aspects
{
/**
* Lists aspects
* @param params
* @return Collection of aspects
*/
CollectionWithPagingInfo<Aspect> listAspects(Parameters params);
/**
* Gets an aspect by id
* @param aspectId
* @return an aspect
*/
Aspect getAspect(String aspectId);
}

View File

@@ -25,15 +25,14 @@
*/
package org.alfresco.rest.api;
import org.alfresco.rest.api.model.NodeDefinition;
import org.alfresco.service.cmr.dictionary.TypeDefinition;
import org.alfresco.service.cmr.i18n.MessageLookup;
/**
* Maps representations from TypeDefinition to NodeDefinition
*
* @author gfertuso
*/
public interface NodeDefinitionMapper
public interface ClassDefinitionMapper
{
NodeDefinition fromTypeDefinition(TypeDefinition typeDefinition, MessageLookup messageLookup);
org.alfresco.rest.api.model.ClassDefinition fromDictionaryClassDefinition(org.alfresco.service.cmr.dictionary.ClassDefinition classDefinition, MessageLookup messageLookup);
}

View File

@@ -0,0 +1,53 @@
/*
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2021 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.rest.api;
import org.alfresco.rest.api.model.Type;
import org.alfresco.rest.framework.resource.parameters.CollectionWithPagingInfo;
import org.alfresco.rest.framework.resource.parameters.Parameters;
/**
* Types API
*/
public interface Types
{
/**
* Lists types
*
* @param params
* @return Collection of types
*/
CollectionWithPagingInfo<Type> listTypes(Parameters params);
/**
* Gets a type by id
*
* @param typeId
* @return type
*/
Type getType(String typeId);
}

View File

@@ -0,0 +1,66 @@
/*
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2021 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.rest.api.aspects;
import org.alfresco.rest.api.Aspects;
import org.alfresco.rest.api.model.Aspect;
import org.alfresco.rest.framework.resource.EntityResource;
import org.alfresco.rest.framework.resource.actions.interfaces.EntityResourceAction;
import org.alfresco.rest.framework.resource.parameters.CollectionWithPagingInfo;
import org.alfresco.rest.framework.resource.parameters.Parameters;
import org.alfresco.util.ParameterCheck;
import org.springframework.beans.factory.InitializingBean;
@EntityResource(name = "aspects", title = "Aspects")
public class AspectEntityResource implements EntityResourceAction.ReadById<Aspect>, EntityResourceAction.Read<Aspect>, InitializingBean
{
private Aspects aspects;
public void setAspects(Aspects aspects)
{
this.aspects = aspects;
}
@Override
public void afterPropertiesSet()
{
ParameterCheck.mandatory("aspects", this.aspects);
}
@Override
public CollectionWithPagingInfo<Aspect> readAll(Parameters params)
{
return aspects.listAspects(params);
}
@Override
public Aspect readById(String id, Parameters parameters)
{
return aspects.getAspect(id);
}
}

View File

@@ -1,38 +1,30 @@
/*
* #%L
* Alfresco Repository
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* Copyright (C) 2005 - 2021 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
* 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.repo.search.impl;
/**
* Json returned from Solr
*
* @author Gethin James
* @since 5.0
*/
public interface JSONResult
{
public Long getQueryTime();
public long getNumberFound();
}
@WebApi(name="alfresco", scope= Api.SCOPE.PUBLIC, version=1)
package org.alfresco.rest.api.aspects;
import org.alfresco.rest.framework.Api;
import org.alfresco.rest.framework.WebApi;

View File

@@ -0,0 +1,425 @@
/*
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2021 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.rest.api.impl;
import com.google.common.collect.ImmutableList;
import org.alfresco.rest.api.ClassDefinitionMapper;
import org.alfresco.rest.api.model.AssociationSource;
import org.alfresco.rest.api.model.Association;
import org.alfresco.rest.api.model.AbstractClass;
import org.alfresco.rest.api.model.PropertyDefinition;
import org.alfresco.rest.api.model.ClassDefinition;
import org.alfresco.rest.framework.core.exceptions.InvalidArgumentException;
import org.alfresco.rest.framework.resource.parameters.CollectionWithPagingInfo;
import org.alfresco.rest.framework.resource.parameters.Paging;
import org.alfresco.rest.framework.resource.parameters.where.Query;
import org.alfresco.rest.framework.resource.parameters.where.QueryHelper;
import org.alfresco.rest.workflow.api.impl.MapBasedQueryWalker;
import org.alfresco.service.cmr.dictionary.AssociationDefinition;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.namespace.NamespacePrefixResolver;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
import org.alfresco.util.Pair;
import org.apache.commons.lang3.StringUtils;
import java.util.Arrays;
import java.util.List;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import java.util.Map;
import java.util.Collection;
import java.util.ArrayList;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function;
import java.util.function.Predicate;
public class AbstractClassImpl<T extends AbstractClass> {
static String PARAM_MODEL_IDS = "modelId";
static String PARAM_PARENT_IDS = "parentId";
static String PARAM_NAMESPACE_URI = "namespaceUri";
static String PARAM_INCLUDE_SUBASPECTS = "INCLUDESUBASPECTS";
static String PARAM_INCLUDE_SUBTYPES = "INCLUDESUBTYPES";
static String PARAM_INCLUDE_PROPERTIES = "properties";
static String PARAM_INCLUDE_MANDATORY_ASPECTS = "mandatoryAspects";
static String PARAM_INCLUDE_ASSOCIATIONS = "associations";
static List<String> ALL_PROPERTIES = ImmutableList.of(PARAM_INCLUDE_PROPERTIES, PARAM_INCLUDE_MANDATORY_ASPECTS, PARAM_INCLUDE_ASSOCIATIONS);
private DictionaryService dictionaryService;
private NamespacePrefixResolver namespaceService;
private ClassDefinitionMapper classDefinitionMapper;
AbstractClassImpl(DictionaryService dictionaryService, NamespacePrefixResolver namespaceService, ClassDefinitionMapper classDefinitionMapper)
{
this.dictionaryService = dictionaryService;
this.namespaceService = namespaceService;
this.classDefinitionMapper = classDefinitionMapper;
}
public CollectionWithPagingInfo<T> createPagedResult(List<T> list, Paging paging)
{
int skipCount = paging.getSkipCount();
int maxItems = paging.getMaxItems();
int totalItems = list.size();
Collections.sort(list);
if (skipCount >= totalItems)
{
List<T> empty = Collections.emptyList();
return CollectionWithPagingInfo.asPaged(paging, empty, false, totalItems);
}
else
{
int end = Math.min(skipCount + maxItems, totalItems);
boolean hasMoreItems = totalItems > end;
list = list.subList(skipCount, end);
return CollectionWithPagingInfo.asPaged(paging, list, hasMoreItems, totalItems);
}
}
public boolean filterByNamespace(ModelApiFilter query, QName qName)
{
//System aspect/type is not allowed
if (qName.getNamespaceURI().equals(NamespaceService.SYSTEM_MODEL_1_0_URI))
{
return false;
}
if (query != null && query.getMatchedPrefix() != null)
{
return Pattern.matches(query.getMatchedPrefix(), qName.getNamespaceURI());
}
if (query != null && query.getNotMatchedPrefix() != null)
{
return !Pattern.matches(query.getNotMatchedPrefix(), qName.getNamespaceURI());
}
return true;
}
public ModelApiFilter getQuery(Query queryParameters)
{
if (queryParameters != null)
{
ClassQueryWalker propertyWalker = new ClassQueryWalker();
QueryHelper.walk(queryParameters, propertyWalker);
return ModelApiFilter.builder()
.withModelId(propertyWalker.getModelIds())
.withParentIds(propertyWalker.getParentIds())
.withMatchPrefix(propertyWalker.getMatchedPrefix())
.withNotMatchPrefix(propertyWalker.getNotMatchedPrefix())
.build();
}
return null;
}
void validateListParam(Set<String> listParam, String paramName)
{
if (listParam.isEmpty())
{
throw new IllegalArgumentException(StringUtils.capitalize(paramName) + "s filter list cannot be empty.");
}
listParam.stream()
.filter(StringUtils::isBlank)
.findAny()
.ifPresent(qName -> {
throw new IllegalArgumentException(StringUtils.capitalize(paramName) + " cannot be empty (i.e. '')");
});
}
protected Set<Pair<QName,Boolean>> parseModelIds(Set<String> modelIds, String apiSuffix)
{
return modelIds.stream().map(modelId ->
{
QName qName = null;
boolean filterIncludeSubClass = false;
int idx = modelId.lastIndexOf(' ');
if (idx > 0)
{
String suffix = modelId.substring(idx);
if (suffix.equalsIgnoreCase(" " + apiSuffix))
{
filterIncludeSubClass = true;
modelId = modelId.substring(0, idx);
}
}
try
{
qName = QName.createQName(modelId, this.namespaceService);
}
catch (Exception ex)
{
throw new InvalidArgumentException(modelId + " isn't a valid QName. " + ex.getMessage());
}
if (qName == null)
throw new InvalidArgumentException(modelId + " isn't a valid QName. ");
return new Pair<>(qName, filterIncludeSubClass);
}).collect(Collectors.toSet());
}
public T constructFromFilters(T abstractClass, org.alfresco.service.cmr.dictionary.ClassDefinition classDefinition, List<String> includes) {
if (includes != null && includes.contains(PARAM_INCLUDE_PROPERTIES))
{
List<PropertyDefinition> properties = Collections.emptyList();
ClassDefinition _classDefinition = this.classDefinitionMapper.fromDictionaryClassDefinition(classDefinition, dictionaryService);
if (_classDefinition.getProperties() != null)
{
properties = _classDefinition.getProperties();
}
abstractClass.setProperties(properties);
}
if (includes != null && includes.contains(PARAM_INCLUDE_ASSOCIATIONS))
{
List<Association> associations = getAssociations(classDefinition.getAssociations());
abstractClass.setAssociations(associations);
}
if (includes != null && includes.contains(PARAM_INCLUDE_MANDATORY_ASPECTS))
{
if (classDefinition.getDefaultAspectNames() != null)
{
List<String> aspects = classDefinition.getDefaultAspectNames().stream().map(QName::toPrefixString).collect(Collectors.toList());
abstractClass.setMandatoryAspects(aspects);
}
}
abstractClass.setIsContainer(classDefinition.isContainer());
abstractClass.setIsArchive(classDefinition.getArchive());
abstractClass.setIncludedInSupertypeQuery(classDefinition.getIncludedInSuperTypeQuery());
return abstractClass;
}
List<Association> getAssociations(Map<QName, AssociationDefinition> associationDefinitionMap)
{
Collection<AssociationDefinition> associationDefinitions = associationDefinitionMap.values();
if (associationDefinitions.size() == 0)
return Collections.emptyList();
List<Association> associations = new ArrayList<Association>();
for (AssociationDefinition definition : associationDefinitions)
{
Association association = new Association();
association.setId(definition.getName().toPrefixString());
association.setTitle(definition.getTitle());
association.setDescription(definition.getDescription());
association.setIsChild(definition.isChild());
association.setIsProtected(definition.isProtected());
AssociationSource source = new AssociationSource();
String sourceRole = definition.getSourceRoleName() != null ? definition.getSourceRoleName().toPrefixString() : null;
source.setRole(sourceRole);
String sourceClass = definition.getSourceClass() != null ? definition.getSourceClass().getName().toPrefixString() : null;
source.setCls(sourceClass);
source.setIsMany(definition.isSourceMany());
source.setIsMandatory(definition.isSourceMandatory());
AssociationSource target = new AssociationSource();
String targetRole = definition.getTargetRoleName() != null ? definition.getTargetRoleName().toPrefixString() : null;
target.setRole(targetRole);
String targetClass = definition.getTargetClass() != null ? definition.getTargetClass().getName().toPrefixString() : null;
target.setCls(targetClass);
target.setIsMany(definition.isTargetMany());
target.setIsMandatory(definition.isTargetMandatory());
target.setIsMandatoryEnforced(definition.isTargetMandatoryEnforced());
association.setSource(source);
association.setTarget(target);
associations.add(association);
}
return associations;
}
public static <T> Predicate<T> distinctByKey(Function<? super T, ?> keyExtractor) {
Map<Object, Boolean> seen = new ConcurrentHashMap<>();
return t -> seen.putIfAbsent(keyExtractor.apply(t), Boolean.TRUE) == null;
}
public static class ClassQueryWalker extends MapBasedQueryWalker
{
private Set<String> modelIds = null;
private Set<String> parentIds = null;
private String notMatchedPrefix = null;
private String matchedPrefix = null;
public ClassQueryWalker()
{
super(new HashSet<>(Arrays.asList(PARAM_MODEL_IDS, PARAM_PARENT_IDS)), new HashSet<>(Collections.singleton(PARAM_NAMESPACE_URI)));
}
@Override
public void in(String propertyName, boolean negated, String... propertyValues)
{
if (negated)
{
throw new InvalidArgumentException("Cannot use NOT for " + propertyName);
}
if (propertyName.equalsIgnoreCase(PARAM_MODEL_IDS))
{
modelIds = new HashSet<>(Arrays.asList(propertyValues));
}
if (propertyName.equalsIgnoreCase(PARAM_PARENT_IDS))
{
parentIds = new HashSet<>(Arrays.asList(propertyValues));
}
}
@Override
public void matches(String property, String value, boolean negated)
{
if (negated && property.equals(PARAM_NAMESPACE_URI))
{
notMatchedPrefix = value;
}
else if (property.equals(PARAM_NAMESPACE_URI))
{
matchedPrefix = value;
}
}
public Set<String> getModelIds()
{
return this.modelIds;
}
public Set<String> getParentIds()
{
return this.parentIds;
}
public String getNotMatchedPrefix()
{
return this.notMatchedPrefix;
}
public String getMatchedPrefix()
{
return this.matchedPrefix;
}
}
public static class ModelApiFilter
{
private Set<String> modelIds;
private Set<String> parentIds;
private String matchedPrefix;
private String notMatchedPrefix;
public ModelApiFilter()
{
}
public Set<String> getModelIds()
{
return modelIds;
}
public String getMatchedPrefix()
{
return matchedPrefix;
}
public String getNotMatchedPrefix()
{
return notMatchedPrefix;
}
public Set<String> getParentIds()
{
return parentIds;
}
public static ModelApiFilterBuilder builder()
{
return new ModelApiFilterBuilder();
}
public static class ModelApiFilterBuilder
{
private Set<String> modelIds;
private Set<String> parentIds;
private String matchedPrefix;
private String notMatchedPrefix;
public ModelApiFilterBuilder withModelId(Set<String> modelIds)
{
this.modelIds = modelIds;
return this;
}
public ModelApiFilterBuilder withParentIds(Set<String> parentIds)
{
this.parentIds = parentIds;
return this;
}
public ModelApiFilterBuilder withMatchPrefix(String matchedPrefix)
{
this.matchedPrefix = matchedPrefix;
return this;
}
public ModelApiFilterBuilder withNotMatchPrefix(String notMatchedPrefix)
{
this.notMatchedPrefix = notMatchedPrefix;
return this;
}
public ModelApiFilter build()
{
ModelApiFilter modelApiFilter = new ModelApiFilter();
modelApiFilter.modelIds = modelIds;
modelApiFilter.parentIds = parentIds;
modelApiFilter.matchedPrefix = matchedPrefix;
modelApiFilter.notMatchedPrefix = notMatchedPrefix;
return modelApiFilter;
}
}
}
}

View File

@@ -0,0 +1,198 @@
/*
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2021 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.rest.api.impl;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.rest.api.Aspects;
import org.alfresco.rest.api.ClassDefinitionMapper;
import org.alfresco.rest.api.model.Aspect;
import org.alfresco.rest.framework.core.exceptions.EntityNotFoundException;
import org.alfresco.rest.framework.core.exceptions.InvalidArgumentException;
import org.alfresco.rest.framework.resource.parameters.CollectionWithPagingInfo;
import org.alfresco.rest.framework.resource.parameters.Paging;
import org.alfresco.rest.framework.resource.parameters.Parameters;
import org.alfresco.service.cmr.dictionary.AspectDefinition;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.dictionary.ModelDefinition;
import org.alfresco.service.namespace.NamespaceException;
import org.alfresco.service.namespace.NamespacePrefixResolver;
import org.alfresco.service.namespace.QName;
import org.alfresco.util.Pair;
import org.alfresco.util.PropertyCheck;
import java.util.Collection;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public class AspectsImpl extends AbstractClassImpl<Aspect> implements Aspects
{
private DictionaryService dictionaryService;
private NamespacePrefixResolver namespaceService;
private ClassDefinitionMapper classDefinitionMapper;
public void setDictionaryService(DictionaryService dictionaryService)
{
this.dictionaryService = dictionaryService;
}
public void setNamespaceService(NamespacePrefixResolver namespaceService)
{
this.namespaceService = namespaceService;
}
public void setClassDefinitionMapper(ClassDefinitionMapper classDefinitionMapper)
{
this.classDefinitionMapper = classDefinitionMapper;
}
public void init()
{
PropertyCheck.mandatory(this, "dictionaryService", dictionaryService);
PropertyCheck.mandatory(this, "namespaceService", namespaceService);
PropertyCheck.mandatory(this, "classDefinitionMapper", classDefinitionMapper);
}
AspectsImpl(DictionaryService dictionaryService, NamespacePrefixResolver namespaceService, ClassDefinitionMapper classDefinitionMapper)
{
super(dictionaryService, namespaceService, classDefinitionMapper);
}
@Override
public CollectionWithPagingInfo<Aspect> listAspects(Parameters params)
{
Paging paging = params.getPaging();
ModelApiFilter query = getQuery(params.getQuery());
Stream<QName> aspectStream = null;
if (query != null && query.getModelIds() != null)
{
validateListParam(query.getModelIds(), PARAM_MODEL_IDS);
Set<Pair<QName, Boolean>> modelsFilter = parseModelIds(query.getModelIds(), PARAM_INCLUDE_SUBASPECTS);
aspectStream = modelsFilter.stream().map(this::getModelAspects).flatMap(Collection::stream);
}
else if (query != null && query.getParentIds() != null)
{
validateListParam(query.getParentIds(), PARAM_PARENT_IDS);
aspectStream = query.getParentIds().stream().map(this::getChildAspects).flatMap(Collection::stream);
}
else
{
aspectStream = this.dictionaryService.getAllAspects().stream();
}
List<Aspect> allAspects = aspectStream.filter((qName) -> filterByNamespace(query, qName))
.filter(distinctByKey(QName::getPrefixString))
.map((qName) -> this.convertToAspect(dictionaryService.getAspect(qName), params.getInclude()))
.collect(Collectors.toList());
return createPagedResult(allAspects, paging);
}
@Override
public Aspect getAspect(String aspectId)
{
if (aspectId == null)
throw new InvalidArgumentException("Invalid parameter: unknown scheme specified");
AspectDefinition aspectDefinition = null;
try
{
aspectDefinition = dictionaryService.getAspect(QName.createQName(aspectId, this.namespaceService));
}
catch (NamespaceException exception)
{
throw new EntityNotFoundException(aspectId);
}
if (aspectDefinition == null)
throw new EntityNotFoundException(aspectId);
return this.convertToAspect(aspectDefinition, ALL_PROPERTIES);
}
public Aspect convertToAspect(AspectDefinition aspectDefinition, List<String> includes)
{
try
{
Aspect aspect = new Aspect(aspectDefinition, dictionaryService);
constructFromFilters(aspect, aspectDefinition, includes);
return aspect;
}
catch (Exception ex)
{
throw new AlfrescoRuntimeException("Failed to parse Aspect: " + aspectDefinition.getName() + " . " + ex.getMessage());
}
}
private Collection<QName> getModelAspects(Pair<QName,Boolean> model)
{
ModelDefinition modelDefinition = null;
try
{
modelDefinition = this.dictionaryService.getModel(model.getFirst());
}
catch (Exception exception)
{
throw new InvalidArgumentException(exception.getMessage());
}
if (modelDefinition == null)
throw new EntityNotFoundException("model");
Collection<QName> aspects = this.dictionaryService.getAspects(modelDefinition.getName());
if (!model.getSecond()) // look for model aspects alone
return aspects;
Stream<QName> aspectStream = aspects.stream();
Stream<QName> childrenStream = aspects.stream()
.map(aspect -> this.dictionaryService.getSubAspects(aspect, false))
.flatMap(Collection::stream);
return Stream.concat(aspectStream, childrenStream).collect(Collectors.toList());
}
private Collection<QName> getChildAspects(String aspectId)
{
Collection<QName> subAspects = null;
try
{
QName parentAspect = QName.createQName(aspectId, this.namespaceService);
subAspects = this.dictionaryService.getSubAspects(parentAspect, true);
}
catch (NamespaceException exception)
{
throw new InvalidArgumentException(exception.getMessage());
}
return subAspects;
}
}

View File

@@ -32,13 +32,8 @@ import java.util.Map;
import java.util.stream.Collectors;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.model.ContentModel;
import org.alfresco.rest.api.NodeDefinitionMapper;
import org.alfresco.rest.api.model.NodeDefinitionConstraint;
import org.alfresco.rest.api.model.NodeDefinition;
import org.alfresco.rest.api.model.NodeDefinitionProperty;
import org.alfresco.service.cmr.dictionary.ConstraintDefinition;
import org.alfresco.service.cmr.dictionary.PropertyDefinition;
import org.alfresco.service.cmr.dictionary.TypeDefinition;
import org.alfresco.rest.api.ClassDefinitionMapper;
import org.alfresco.rest.api.model.ClassDefinition;
import org.alfresco.service.cmr.i18n.MessageLookup;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
@@ -47,33 +42,33 @@ import org.alfresco.service.namespace.QName;
*
* @author gfertuso
*/
public class NodeDefinitionMapperImpl implements NodeDefinitionMapper
public class ClassDefinitionMapperImpl implements ClassDefinitionMapper
{
private final List<String> EXCLUDED_NS = Arrays.asList(NamespaceService.SYSTEM_MODEL_1_0_URI);
private static final List<QName> EXCLUDED_PROPS = Arrays.asList(ContentModel.PROP_CONTENT);
@Override
public NodeDefinition fromTypeDefinition(TypeDefinition typeDefinition,
MessageLookup messageLookup)
public ClassDefinition fromDictionaryClassDefinition(org.alfresco.service.cmr.dictionary.ClassDefinition classDefinition, MessageLookup messageLookup)
{
if (typeDefinition == null)
if (classDefinition == null)
{
throw new AlfrescoRuntimeException("Undefined definition for the node");
throw new AlfrescoRuntimeException("Undefined ClassDefinition for the node");
}
NodeDefinition nodeDefinition = new NodeDefinition();
nodeDefinition.setProperties(getProperties(typeDefinition.getProperties(), messageLookup));
return nodeDefinition;
ClassDefinition _classDefinition = new ClassDefinition();
_classDefinition.setProperties(getProperties(classDefinition.getProperties(), messageLookup));
return _classDefinition;
}
private boolean isPropertyExcluded(QName propertyName)
private boolean isPropertyExcluded(QName propertyName)
{
return EXCLUDED_NS.contains(propertyName.getNamespaceURI()) || EXCLUDED_PROPS.contains(propertyName);
}
private List <NodeDefinitionProperty> getProperties(Map<QName, PropertyDefinition> propertiesMap, MessageLookup messageLookup)
private List <org.alfresco.rest.api.model.PropertyDefinition> getProperties(Map<QName, org.alfresco.service.cmr.dictionary.PropertyDefinition> propertiesMap, MessageLookup messageLookup)
{
return propertiesMap.values().stream()
.filter(p -> !isPropertyExcluded(p.getName()))
@@ -81,10 +76,10 @@ public class NodeDefinitionMapperImpl implements NodeDefinitionMapper
.collect(Collectors.toList());
}
private NodeDefinitionProperty fromPropertyDefinitionToProperty(PropertyDefinition propertyDefinition,
MessageLookup messageLookup)
private org.alfresco.rest.api.model.PropertyDefinition fromPropertyDefinitionToProperty(org.alfresco.service.cmr.dictionary.PropertyDefinition propertyDefinition,
MessageLookup messageLookup)
{
NodeDefinitionProperty property = new NodeDefinitionProperty();
org.alfresco.rest.api.model.PropertyDefinition property = new org.alfresco.rest.api.model.PropertyDefinition();
property.setId(propertyDefinition.getName().toPrefixString());
property.setTitle(propertyDefinition.getTitle(messageLookup));
property.setDescription(propertyDefinition.getDescription(messageLookup));
@@ -99,8 +94,8 @@ public class NodeDefinitionMapperImpl implements NodeDefinitionMapper
return property;
}
private List<NodeDefinitionConstraint> getConstraints( Collection<ConstraintDefinition> constraintDefinitions,
MessageLookup messageLookup)
private List<org.alfresco.rest.api.model.ConstraintDefinition> getConstraints(Collection<org.alfresco.service.cmr.dictionary.ConstraintDefinition> constraintDefinitions,
MessageLookup messageLookup)
{
return constraintDefinitions.stream()
@@ -109,10 +104,10 @@ public class NodeDefinitionMapperImpl implements NodeDefinitionMapper
.collect(Collectors.toList());
}
private NodeDefinitionConstraint fromConstraintDefinitionToConstraint(ConstraintDefinition constraintDefinition,
MessageLookup messageLookup)
private org.alfresco.rest.api.model.ConstraintDefinition fromConstraintDefinitionToConstraint(org.alfresco.service.cmr.dictionary.ConstraintDefinition constraintDefinition,
MessageLookup messageLookup)
{
NodeDefinitionConstraint constraint = new NodeDefinitionConstraint();
org.alfresco.rest.api.model.ConstraintDefinition constraint = new org.alfresco.rest.api.model.ConstraintDefinition();
constraint.setId(constraintDefinition.getConstraint().getShortName());
constraint.setType(constraintDefinition.getConstraint().getType());
constraint.setTitle(constraintDefinition.getTitle(messageLookup));
@@ -120,5 +115,4 @@ public class NodeDefinitionMapperImpl implements NodeDefinitionMapper
constraint.setParameters(constraintDefinition.getConstraint().getParameters());
return constraint;
}
}

View File

@@ -1,28 +1,28 @@
/*
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2016 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%
*/
/*
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2021 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.rest.api.impl;
@@ -52,7 +52,7 @@ import org.alfresco.repo.dictionary.M2Type;
import org.alfresco.repo.dictionary.ValueDataTypeValidator;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.rest.api.CustomModels;
import org.alfresco.rest.api.model.AbstractClassModel;
import org.alfresco.rest.api.model.AbstractCustomClass;
import org.alfresco.rest.api.model.AbstractCommonDetails;
import org.alfresco.rest.api.model.CustomAspect;
import org.alfresco.rest.api.model.CustomModel;
@@ -331,9 +331,9 @@ public class CustomModelsImpl implements CustomModels
}
}
private void replacePrefix(List<? extends AbstractClassModel> existingTypesOrAspects, String modelOldNamespacePrefix, String modelNewNamespacePrefix)
private void replacePrefix(List<? extends AbstractCustomClass> existingTypesOrAspects, String modelOldNamespacePrefix, String modelNewNamespacePrefix)
{
for(AbstractClassModel classModel : existingTypesOrAspects)
for(AbstractCustomClass classModel : existingTypesOrAspects)
{
// Type/Aspect's parent name
String parentName = classModel.getParentName();
@@ -460,7 +460,7 @@ public class CustomModelsImpl implements CustomModels
return updateTypeAspect(modelName, type, parameters);
}
private <T extends AbstractClassModel> T updateTypeAspect(String modelName, T classDef, Parameters parameters)
private <T extends AbstractCustomClass> T updateTypeAspect(String modelName, T classDef, Parameters parameters)
{
// Check the current user is authorised to update the custom model
validateCurrentUser();
@@ -476,7 +476,7 @@ public class CustomModelsImpl implements CustomModels
ModelDetails existingModelDetails = new ModelDetails(getCustomModelImpl(modelName));
List<? extends AbstractClassModel> allClassDefs = isAspect ? existingModelDetails.getAspects() : existingModelDetails.getTypes();
List<? extends AbstractCustomClass> allClassDefs = isAspect ? existingModelDetails.getAspects() : existingModelDetails.getTypes();
@SuppressWarnings("unchecked")
T existingClassDef = (T) getObjectByName(allClassDefs, name);
@@ -1186,7 +1186,7 @@ public class CustomModelsImpl implements CustomModels
m2Class.setParentName(parentPrefixedName);
}
private void validateTypeAspectParent(AbstractClassModel typeAspect, CustomModel existingModel)
private void validateTypeAspectParent(AbstractCustomClass typeAspect, CustomModel existingModel)
{
String parentPrefixedName = typeAspect.getParentName();
if (StringUtils.isBlank(parentPrefixedName))
@@ -1305,7 +1305,7 @@ public class CustomModelsImpl implements CustomModels
}
}
private void mergeProperties(AbstractClassModel existingDetails, AbstractClassModel newDetails, Parameters parameters, boolean isModelActive)
private void mergeProperties(AbstractCustomClass existingDetails, AbstractCustomClass newDetails, Parameters parameters, boolean isModelActive)
{
validateList(newDetails.getProperties(), "cmm.rest_api.properties_empty_null");
@@ -1386,7 +1386,7 @@ public class CustomModelsImpl implements CustomModels
}
}
private void deleteProperty(AbstractClassModel existingClassModel, String propertyName)
private void deleteProperty(AbstractCustomClass existingClassModel, String propertyName)
{
// Transform existing properties into a map
Map<String, CustomModelProperty> existingProperties = transformToMap(existingClassModel.getProperties(), toNameFunction());
@@ -1427,9 +1427,9 @@ public class CustomModelsImpl implements CustomModels
return result;
}
private void validateTypeAspectDelete(Collection<? extends AbstractClassModel> list, String classPrefixedName)
private void validateTypeAspectDelete(Collection<? extends AbstractCustomClass> list, String classPrefixedName)
{
for(AbstractClassModel acm : list)
for(AbstractCustomClass acm : list)
{
if(classPrefixedName.equals(acm.getParentName()))
{

View File

@@ -79,12 +79,12 @@ import org.alfresco.repo.version.VersionModel;
import org.alfresco.repo.virtual.store.VirtualStore;
import org.alfresco.rest.antlr.WhereClauseParser;
import org.alfresco.rest.api.Activities;
import org.alfresco.rest.api.NodeDefinitionMapper;
import org.alfresco.rest.api.ClassDefinitionMapper;
import org.alfresco.rest.api.Nodes;
import org.alfresco.rest.api.QuickShareLinks;
import org.alfresco.rest.api.model.AssocChild;
import org.alfresco.rest.api.model.AssocTarget;
import org.alfresco.rest.api.model.NodeDefinition;
import org.alfresco.rest.api.model.ClassDefinition;
import org.alfresco.rest.api.model.Document;
import org.alfresco.rest.api.model.Folder;
import org.alfresco.rest.api.model.LockInfo;
@@ -214,7 +214,7 @@ public class NodesImpl implements Nodes
private RetryingTransactionHelper retryingTransactionHelper;
private LockService lockService;
private VirtualStore smartStore; // note: remove as part of REPO-1173
private NodeDefinitionMapper nodeDefinitionMapper;
private ClassDefinitionMapper classDefinitionMapper;
private enum Activity_Type
{
@@ -229,10 +229,13 @@ public class NodesImpl implements Nodes
private Repository repositoryHelper;
private ServiceRegistry sr;
private Set<String> defaultIgnoreTypesAndAspects;
private Set<String> defaultPersonLookupProperties;
// ignore types/aspects
private Set<QName> ignoreQNames;
private Set<QName> personLookupProperties = new HashSet<>();
private ConcurrentHashMap<String,NodeRef> ddCache = new ConcurrentHashMap<>();
private Set<String> nonAttachContentTypes = Collections.emptySet(); // pre-configured whitelist, eg. images & pdf
@@ -276,6 +279,14 @@ public class NodesImpl implements Nodes
ignoreQNames.add(createQName(type));
}
}
if (defaultPersonLookupProperties != null)
{
for (String property : defaultPersonLookupProperties)
{
personLookupProperties.add(createQName(property));
}
}
}
public void setServiceRegistry(ServiceRegistry sr)
@@ -303,6 +314,10 @@ public class NodesImpl implements Nodes
this.defaultIgnoreTypesAndAspects = ignoreTypesAndAspects;
}
public void setPersonLookupProperties(Set<String> personLookupProperties) {
this.defaultPersonLookupProperties = personLookupProperties;
}
public void setPoster(ActivityPoster poster)
{
this.poster = poster;
@@ -313,9 +328,9 @@ public class NodesImpl implements Nodes
this.smartStore = smartStore;
}
public void setNodeDefinitionMapper(NodeDefinitionMapper nodeDefinitionMapper)
public void setClassDefinitionMapper(ClassDefinitionMapper classDefinitionMapper)
{
this.nodeDefinitionMapper = nodeDefinitionMapper;
this.classDefinitionMapper = classDefinitionMapper;
}
// excluded namespaces (aspects, properties, assoc types)
@@ -338,13 +353,6 @@ public class NodesImpl implements Nodes
ContentModel.PROP_AUTO_VERSION_PROPS,
ContentModel.PROP_AUTO_VERSION);
public static final List<QName> PROPS_USERLOOKUP = Arrays.asList(
ContentModel.PROP_CREATOR,
ContentModel.PROP_MODIFIER,
ContentModel.PROP_OWNER,
ContentModel.PROP_LOCK_OWNER,
ContentModel.PROP_WORKING_COPY_OWNER);
public final static Map<String,QName> PARAM_SYNONYMS_QNAME;
static
{
@@ -1033,8 +1041,8 @@ public class NodesImpl implements Nodes
if (includeParam.contains(PARAM_INCLUDE_DEFINITION))
{
NodeDefinition nodeDefinition = nodeDefinitionMapper.fromTypeDefinition(getTypeDefinition(nodeRef), dictionaryService);
node.setDefinition(nodeDefinition);
ClassDefinition classDefinition = classDefinitionMapper.fromDictionaryClassDefinition(getTypeDefinition(nodeRef), dictionaryService);
node.setDefinition(classDefinition);
}
node.setNodeType(nodeTypeQName.toPrefixString(namespaceService));
@@ -1222,9 +1230,9 @@ public class NodesImpl implements Nodes
Serializable value = nodeProps.get(qName);
if (value != null)
{
if (PROPS_USERLOOKUP.contains(qName))
if (personLookupProperties.contains(qName))
{
value = Node.lookupUserInfo((String)value, mapUserInfo, sr.getPersonService());
value = Node.lookupUserInfo((String) value, mapUserInfo, personService);
}
// Empty (zero length) string values are considered to be

View File

@@ -0,0 +1,199 @@
/*
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2021 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.rest.api.impl;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.rest.api.ClassDefinitionMapper;
import org.alfresco.rest.api.Types;
import org.alfresco.rest.api.model.Type;
import org.alfresco.rest.framework.core.exceptions.EntityNotFoundException;
import org.alfresco.rest.framework.core.exceptions.InvalidArgumentException;
import org.alfresco.rest.framework.resource.parameters.CollectionWithPagingInfo;
import org.alfresco.rest.framework.resource.parameters.Paging;
import org.alfresco.rest.framework.resource.parameters.Parameters;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.dictionary.ModelDefinition;
import org.alfresco.service.cmr.dictionary.TypeDefinition;
import org.alfresco.service.namespace.NamespaceException;
import org.alfresco.service.namespace.NamespacePrefixResolver;
import org.alfresco.service.namespace.QName;
import org.alfresco.util.Pair;
import org.alfresco.util.PropertyCheck;
import java.util.Collection;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public class TypesImpl extends AbstractClassImpl<Type> implements Types
{
private DictionaryService dictionaryService;
private NamespacePrefixResolver namespaceService;
private ClassDefinitionMapper classDefinitionMapper;
public void setDictionaryService(DictionaryService dictionaryService)
{
this.dictionaryService = dictionaryService;
}
public void setNamespaceService(NamespacePrefixResolver namespaceService)
{
this.namespaceService = namespaceService;
}
public void setClassDefinitionMapper(ClassDefinitionMapper classDefinitionMapper)
{
this.classDefinitionMapper = classDefinitionMapper;
}
public void init()
{
PropertyCheck.mandatory(this, "dictionaryService", dictionaryService);
PropertyCheck.mandatory(this, "namespaceService", namespaceService);
PropertyCheck.mandatory(this, "classDefinitionMapper", classDefinitionMapper);
}
TypesImpl(DictionaryService dictionaryService, NamespacePrefixResolver namespaceService, ClassDefinitionMapper classDefinitionMapper)
{
super(dictionaryService, namespaceService, classDefinitionMapper);
}
@Override
public CollectionWithPagingInfo<Type> listTypes(Parameters params)
{
Paging paging = params.getPaging();
ModelApiFilter query = getQuery(params.getQuery());
Stream<QName> typeStream = null;
if (query != null && query.getModelIds() != null)
{
validateListParam(query.getModelIds(), PARAM_MODEL_IDS);
Set<Pair<QName, Boolean>> modelsFilter = parseModelIds(query.getModelIds(), PARAM_INCLUDE_SUBTYPES);
typeStream = modelsFilter.stream().map(this::getModelTypes).flatMap(Collection::stream);
}
else if (query != null && query.getParentIds() != null)
{
validateListParam(query.getParentIds(), PARAM_PARENT_IDS);
typeStream = query.getParentIds().stream().map(this::getChildTypes).flatMap(Collection::stream);
}
else
{
typeStream = this.dictionaryService.getAllTypes().stream();
}
List<Type> allTypes = typeStream
.filter((qName) -> filterByNamespace(query, qName))
.filter(distinctByKey(QName::getPrefixString))
.map((qName) -> this.convertToType(dictionaryService.getType(qName), params.getInclude()))
.collect(Collectors.toList());
return createPagedResult(allTypes, paging);
}
@Override
public Type getType(String typeId)
{
if (typeId == null)
throw new InvalidArgumentException("Invalid parameter: unknown scheme specified");
TypeDefinition typeDefinition = null;
try
{
typeDefinition = dictionaryService.getType(QName.createQName(typeId, this.namespaceService));
}
catch (NamespaceException exception)
{
throw new EntityNotFoundException(typeId);
}
if (typeDefinition == null)
throw new EntityNotFoundException(typeId);
return this.convertToType(typeDefinition, ALL_PROPERTIES);
}
public Type convertToType(TypeDefinition typeDefinition, List<String> includes)
{
try
{
Type type = new Type(typeDefinition, dictionaryService);
constructFromFilters(type, typeDefinition, includes);
return type;
}
catch (Exception ex)
{
throw new AlfrescoRuntimeException("Failed to parse Type: " + typeDefinition.getName() + " . " + ex.getMessage());
}
}
private Collection<QName> getModelTypes(Pair<QName,Boolean> model)
{
ModelDefinition modelDefinition = null;
try
{
modelDefinition = this.dictionaryService.getModel(model.getFirst());
}
catch (Exception exception)
{
throw new InvalidArgumentException(exception.getMessage());
}
if (modelDefinition == null)
throw new EntityNotFoundException("model");
Collection<QName> aspects = this.dictionaryService.getTypes(modelDefinition.getName());
if (!model.getSecond()) //look for model types alone
return aspects;
Stream<QName> aspectStream = aspects.stream();
Stream<QName> childrenStream = aspects.stream()
.map(aspect -> this.dictionaryService.getSubTypes(aspect, false))
.flatMap(Collection::stream);
return Stream.concat(aspectStream, childrenStream).collect(Collectors.toList());
}
private Collection<QName> getChildTypes(String typeId)
{
Collection<QName> subTypes = null;
try
{
QName parentType = QName.createQName(typeId, this.namespaceService);
subTypes = this.dictionaryService.getSubTypes(parentType, true);
}
catch (NamespaceException exception)
{
throw new InvalidArgumentException(exception.getMessage());
}
return subTypes;
}
}

View File

@@ -25,15 +25,12 @@
*/
package org.alfresco.rest.api.lookups;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.transaction.TransactionalResourceHelper;
import org.alfresco.rest.api.impl.NodesImpl;
import org.alfresco.rest.api.model.Node;
import org.alfresco.rest.api.model.UserInfo;
import org.alfresco.service.ServiceRegistry;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -63,10 +60,9 @@ public class PersonPropertyLookup implements PropertyLookup<String>
return supported;
}
public void setSupported(List<String> supported)
public void setSupported(Set<String> supported)
{
NodesImpl.PROPS_USERLOOKUP.forEach(entry -> this.supported.add(entry.toString()));
this.supported.addAll(supported);
this.supported = supported;
}
public void setServiceRegistry(ServiceRegistry serviceRegistry)

View File

@@ -0,0 +1,197 @@
/*
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2021 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.rest.api.model;
import org.alfresco.service.cmr.dictionary.ModelDefinition;
import org.alfresco.service.cmr.dictionary.NamespaceDefinition;
import org.alfresco.service.cmr.i18n.MessageLookup;
import org.alfresco.service.namespace.QName;
import java.util.List;
import java.util.Objects;
public abstract class AbstractClass extends ClassDefinition implements Comparable<AbstractClass>
{
protected String id;
protected String title;
protected String description;
protected String parentId;
protected Boolean isContainer = null;
protected Boolean isArchive = null;
protected Boolean includedInSupertypeQuery = null;
protected List<String> mandatoryAspects = null;
protected List<Association> associations = null;
protected Model model;
public String getId()
{
return id;
}
public void setId(String id)
{
this.id = id;
}
public String getTitle()
{
return this.title;
}
public void setTitle(String title)
{
this.title = title;
}
public String getDescription()
{
return this.description;
}
public void setDescription(String description)
{
this.description = description;
}
public String getParentId()
{
return parentId;
}
public void setParentId(String parentId)
{
this.parentId = parentId;
}
public Model getModel()
{
return model;
}
public void setModel(Model model)
{
this.model = model;
}
public Boolean getIsContainer()
{
return isContainer;
}
public void setIsContainer(Boolean isContainer)
{
this.isContainer = isContainer;
}
public Boolean getIsArchive()
{
return isArchive;
}
public void setIsArchive(Boolean isArchive)
{
this.isArchive = isArchive;
}
public Boolean getIncludedInSupertypeQuery()
{
return includedInSupertypeQuery;
}
public void setIncludedInSupertypeQuery(Boolean includedInSupertypeQuery)
{
this.includedInSupertypeQuery = includedInSupertypeQuery;
}
public List<String> getMandatoryAspects()
{
return mandatoryAspects;
}
public void setMandatoryAspects(List<String> mandatoryAspects)
{
this.mandatoryAspects = mandatoryAspects;
}
public List<Association> getAssociations()
{
return associations;
}
public void setAssociations(List<Association> associations)
{
this.associations = associations;
}
String getParentNameAsString(QName parentQName)
{
if (parentQName != null)
{
return parentQName.toPrefixString();
}
return null;
}
Model getModelInfo(org.alfresco.service.cmr.dictionary.ClassDefinition classDefinition, MessageLookup messageLookup)
{
final ModelDefinition modelDefinition = classDefinition.getModel();
final String prefix = classDefinition.getName().toPrefixString().split(":")[0];
final NamespaceDefinition namespaceDefinition = modelDefinition.getNamespaces().stream()
.filter(definition -> definition.getPrefix().equals(prefix))
.findFirst()
.get();
final String modelId = modelDefinition.getName().toPrefixString();
final String author = modelDefinition.getAuthor();
final String description = modelDefinition.getDescription(messageLookup);
return new Model(modelId, author, description, namespaceDefinition.getUri(), namespaceDefinition.getPrefix());
}
@Override
public int hashCode()
{
return Objects.hash(id, title, description, parentId, properties, isContainer, isArchive, includedInSupertypeQuery, mandatoryAspects, associations, model);
}
@Override
public boolean equals(Object obj)
{
if (this == obj)
{
return true;
}
return super.equals(obj);
}
@Override
public int compareTo(AbstractClass other)
{
return this.id.compareTo(other.getId());
}
}

View File

@@ -1,28 +1,28 @@
/*
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2016 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%
*/
/*
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2021 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.rest.api.model;
@@ -35,7 +35,7 @@ import org.alfresco.service.namespace.QName;
/**
* @author Jamal Kaabi-Mofrad
*/
public abstract class AbstractClassModel extends AbstractCommonDetails
public abstract class AbstractCustomClass extends AbstractCommonDetails
{
/* package */String parentName;
/* package */List<CustomModelProperty> properties = Collections.emptyList();

View File

@@ -0,0 +1,66 @@
/*
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2021 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.rest.api.model;
import org.alfresco.service.cmr.dictionary.AspectDefinition;
import org.alfresco.service.cmr.i18n.MessageLookup;
public class Aspect extends AbstractClass
{
public Aspect()
{
}
public Aspect(AspectDefinition aspectDefinition, MessageLookup messageLookup)
{
this.id = aspectDefinition.getName().toPrefixString();
this.title = aspectDefinition.getTitle(messageLookup);
this.description = aspectDefinition.getDescription(messageLookup);
this.parentId = getParentNameAsString(aspectDefinition.getParentName());
this.model = getModelInfo(aspectDefinition, messageLookup);
}
@Override
public String toString()
{
StringBuilder builder = new StringBuilder(512);
builder.append("Aspect [id=").append(this.id)
.append(", title=").append(this.title)
.append(", description=").append(this.description)
.append(", parentId=").append(parentId)
.append(", properties=").append(properties)
.append(", mandatoryAspects=").append(mandatoryAspects)
.append(", isContainer=").append(isContainer)
.append(", isArchive=").append(isArchive)
.append(", associations=").append(associations)
.append(", model=").append(model)
.append(", includedInSupertypeQuery=").append(includedInSupertypeQuery)
.append(']');
return builder.toString();
}
}

View File

@@ -0,0 +1,158 @@
/*
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2021 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.rest.api.model;
import java.util.Objects;
public class Association
{
private String id;
private String title;
private String description;
private Boolean isChild;
private Boolean isProtected;
private AssociationSource source = null;
private AssociationSource target = null;
public Association()
{
}
public Association(String id, String title, String description, Boolean isChild, Boolean isProtected, AssociationSource source, AssociationSource target)
{
this.id = id;
this.title = title;
this.description = description;
this.isChild = isChild;
this.isProtected = isProtected;
this.source = source;
this.target = target;
}
public String getId()
{
return id;
}
public void setId(String id)
{
this.id = id;
}
public String getTitle()
{
return title;
}
public void setTitle(String title)
{
this.title = title;
}
public String getDescription()
{
return description;
}
public void setDescription(String description)
{
this.description = description;
}
public Boolean getIsChild()
{
return isChild;
}
public void setIsChild(Boolean isChild)
{
this.isChild = isChild;
}
public Boolean getIsProtected()
{
return isProtected;
}
public void setIsProtected(Boolean isProtected)
{
this.isProtected = isProtected;
}
public AssociationSource getSource()
{
return source;
}
public void setSource(AssociationSource source)
{
this.source = source;
}
public AssociationSource getTarget()
{
return target;
}
public void setTarget(AssociationSource target)
{
this.target = target;
}
@Override
public boolean equals(Object obj)
{
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Association other = (Association) obj;
return Objects.equals(id, other.getId()) &&
Objects.equals(title, other.getTitle()) &&
Objects.equals(description, other.getDescription()) &&
Objects.equals(isChild, other.getIsChild()) &&
Objects.equals(isProtected, other.getIsProtected()) &&
Objects.equals(source, other.getSource()) &&
Objects.equals(target, other.getTarget());
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder(512);
builder.append("Association [id=").append(this.id)
.append(", title=").append(this.title)
.append(", description=").append(this.description)
.append(", isChild=").append(isChild)
.append(", isProtected=").append(isProtected)
.append(", source=").append(source)
.append(", target=").append(target)
.append(']');
return builder.toString();
}
}

View File

@@ -0,0 +1,129 @@
/*
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2021 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.rest.api.model;
import java.util.Objects;
public class AssociationSource {
private String role = null;
private String cls = null;
private Boolean isMany = null;
private Boolean isMandatory = null;
private Boolean isMandatoryEnforced = null;
public AssociationSource()
{
}
public AssociationSource(String role, String cls, Boolean isMany, Boolean isMandatory, Boolean isMandatoryEnforced)
{
this.role = role;
this.cls = cls;
this.isMany = isMany;
this.isMandatory = isMandatory;
this.isMandatoryEnforced = isMandatoryEnforced;
}
public String getRole()
{
return role;
}
public void setRole(String role)
{
this.role = role;
}
public String getCls()
{
return cls;
}
public void setCls(String cls)
{
this.cls = cls;
}
public Boolean getIsMany()
{
return isMany;
}
public void setIsMany(Boolean isMany)
{
this.isMany = isMany;
}
public Boolean getIsMandatory()
{
return isMandatory;
}
public void setIsMandatory(Boolean isMandatory)
{
this.isMandatory = isMandatory;
}
public Boolean getIsMandatoryEnforced()
{
return isMandatoryEnforced;
}
public void setIsMandatoryEnforced(Boolean isMandatoryEnforced)
{
this.isMandatoryEnforced = isMandatoryEnforced;
}
@Override
public boolean equals(Object obj)
{
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
AssociationSource other = (AssociationSource) obj;
return Objects.equals(role, other.getRole()) &&
Objects.equals(cls, other.getCls()) &&
Objects.equals(isMany, other.getIsMany()) &&
Objects.equals(isMandatory, other.getIsMandatory()) &&
Objects.equals(isMandatoryEnforced, other.getIsMandatoryEnforced());
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder(512);
builder.append("AssociationSource [role=").append(this.role)
.append(", cls=").append(this.cls)
.append(", isMany=").append(this.isMany)
.append(", isMandatory=").append(isMandatory)
.append(", isMandatoryEnforced=").append(isMandatoryEnforced)
.append(']');
return builder.toString();
}
}

View File

@@ -31,17 +31,17 @@ import java.util.List;
*
* @author gfertuso
*/
public class NodeDefinition
public class ClassDefinition
{
List <NodeDefinitionProperty> properties;
List <PropertyDefinition> properties;
public List<NodeDefinitionProperty> getProperties()
public List<PropertyDefinition> getProperties()
{
return properties;
}
public void setProperties(List<NodeDefinitionProperty> properties)
public void setProperties(List<PropertyDefinition> properties)
{
this.properties = properties;
}

View File

@@ -31,7 +31,7 @@ import java.util.Map;
*
* @author gfertuso
*/
public class NodeDefinitionConstraint
public class ConstraintDefinition
{
private String id;
private String type;

View File

@@ -1,28 +1,28 @@
/*
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2016 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%
*/
/*
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2021 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.rest.api.model;
@@ -34,7 +34,7 @@ import org.alfresco.service.cmr.i18n.MessageLookup;
/**
* @author Jamal Kaabi-Mofrad
*/
public class CustomAspect extends AbstractClassModel
public class CustomAspect extends AbstractCustomClass
{
public CustomAspect()

View File

@@ -1,28 +1,28 @@
/*
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2016 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%
*/
/*
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2021 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.rest.api.model;
@@ -34,7 +34,7 @@ import org.alfresco.service.cmr.i18n.MessageLookup;
/**
* @author Jamal Kaabi-Mofrad
*/
public class CustomType extends AbstractClassModel
public class CustomType extends AbstractCustomClass
{
public CustomType()

View File

@@ -0,0 +1,105 @@
/*
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2021 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.rest.api.model;
public class Model implements Comparable<Model>
{
private String id;
private String author;
private String description;
private String namespaceUri;
private String namespacePrefix;
public Model()
{
}
public Model(String name, String author, String description, String namespaceUri, String namespacePrefix)
{
this.id = name;
this.author = author;
this.description = description;
this.namespaceUri = namespaceUri;
this.namespacePrefix = namespacePrefix;
}
public String getId()
{
return id;
}
public void setId(String id)
{
this.id = id;
}
public String getAuthor()
{
return author;
}
public void setAuthor(String author)
{
this.author = author;
}
public String getDescription()
{
return description;
}
public void setDescription(String description)
{
this.description = description;
}
public String getNamespaceUri()
{
return namespaceUri;
}
public void setNamespaceUri(String namespaceUri)
{
this.namespaceUri = namespaceUri;
}
public String getNamespacePrefix()
{
return namespacePrefix;
}
public void setNamespacePrefix(String namespacePrefix)
{
this.namespacePrefix = namespacePrefix;
}
@Override
public int compareTo(Model model)
{
return this.id.compareTo(model.getId());
}
}

View File

@@ -95,7 +95,7 @@ public class Node implements Comparable<Node>
protected List<String> allowableOperations;
protected NodePermissions nodePermissions;
protected NodeDefinition definition;
protected ClassDefinition definition;
//optional SearchEntry (only ever returned from a search)
protected SearchEntry search = null;
@@ -470,12 +470,12 @@ public class Node implements Comparable<Node>
this.secondaryChildren = secondaryChildren;
}
public NodeDefinition getDefinition()
public ClassDefinition getDefinition()
{
return definition;
}
public void setDefinition(NodeDefinition definition)
public void setDefinition(ClassDefinition definition)
{
this.definition = definition;
}

View File

@@ -31,7 +31,7 @@ import java.util.List;
*
* @author gfertuso
*/
public class NodeDefinitionProperty
public class PropertyDefinition
{
private String id;
private String title;
@@ -42,7 +42,7 @@ public class NodeDefinitionProperty
private Boolean isMandatory;
private Boolean isMandatoryEnforced;
private Boolean isProtected;
private List<NodeDefinitionConstraint> constraints;
private List<ConstraintDefinition> constraints;
public String getId()
{
@@ -104,12 +104,12 @@ public class NodeDefinitionProperty
this.isProtected = isProtected;
}
public List<NodeDefinitionConstraint> getConstraints()
public List<ConstraintDefinition> getConstraints()
{
return constraints;
}
public void setConstraints(List<NodeDefinitionConstraint> constraints)
public void setConstraints(List<ConstraintDefinition> constraints)
{
this.constraints = constraints;
}

View File

@@ -0,0 +1,66 @@
/*
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2021 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.rest.api.model;
import org.alfresco.service.cmr.dictionary.TypeDefinition;
import org.alfresco.service.cmr.i18n.MessageLookup;
public class Type extends AbstractClass
{
public Type()
{
}
public Type(TypeDefinition typeDefinition, MessageLookup messageLookup)
{
this.id = typeDefinition.getName().toPrefixString();
this.title = typeDefinition.getTitle(messageLookup);
this.description = typeDefinition.getDescription(messageLookup);
this.parentId = getParentNameAsString(typeDefinition.getParentName());
this.model = getModelInfo(typeDefinition, messageLookup);
}
@Override
public String toString()
{
StringBuilder builder = new StringBuilder(512);
builder.append("Type [id=").append(this.id)
.append(", title=").append(this.title)
.append(", description=").append(this.description)
.append(", parentId=").append(parentId)
.append(", properties=").append(properties)
.append(", mandatoryAspects=").append(mandatoryAspects)
.append(", isContainer=").append(isContainer)
.append(", isArchive=").append(isArchive)
.append(", associations=").append(associations)
.append(", model=").append(model)
.append(", includedInSupertypeQuery=").append(includedInSupertypeQuery)
.append(']');
return builder.toString();
}
}

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* Copyright (C) 2005 - 2021 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -82,7 +82,6 @@ public class SearchApiWebscript extends AbstractWebScript implements RecognizedP
@Override
public void execute(WebScriptRequest webScriptRequest, WebScriptResponse webScriptResponse) throws IOException
{
try {
//Turn JSON into a Java object respresentation
SearchQuery searchQuery = extractJsonContent(webScriptRequest, assistant.getJsonHelper(), SearchQuery.class);

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* Copyright (C) 2005 - 2021 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -26,6 +26,8 @@
package org.alfresco.rest.api.search.impl;
import static java.util.Optional.empty;
import static java.util.Optional.of;
import static org.alfresco.rest.api.search.impl.StoreMapper.DELETED;
import static org.alfresco.rest.api.search.impl.StoreMapper.HISTORY;
import static org.alfresco.rest.api.search.impl.StoreMapper.LIVE_NODES;
@@ -42,9 +44,10 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
import org.alfresco.repo.search.impl.solr.SolrJSONResultSet;
import org.alfresco.repo.search.SearchEngineResultSet;
import org.alfresco.repo.search.impl.solr.facet.facetsresponse.GenericBucket;
import org.alfresco.repo.search.impl.solr.facet.facetsresponse.GenericFacetResponse;
import org.alfresco.repo.search.impl.solr.facet.facetsresponse.GenericFacetResponse.FACET_TYPE;
@@ -153,12 +156,10 @@ public class ResultMapper
*/
public CollectionWithPagingInfo<Node> toCollectionWithPagingInfo(Params params, SearchRequestContext searchRequestContext, SearchQuery searchQuery, ResultSet results)
{
SearchContext context = null;
Integer total = null;
List<Node> noderesults = new ArrayList<Node>();
List<Node> noderesults = new ArrayList<>();
Map<String, UserInfo> mapUserInfo = new HashMap<>(10);
Map<NodeRef, List<Pair<String, List<String>>>> hightLighting = results.getHighlighting();
int notFound = 0;
Map<NodeRef, List<Pair<String, List<String>>>> highLighting = results.getHighlighting();
final AtomicInteger unknownNodeRefsCount = new AtomicInteger();
boolean isHistory = searchRequestContext.getStores().contains(StoreMapper.HISTORY);
for (ResultSetRow row:results)
@@ -169,7 +170,7 @@ public class ResultMapper
{
float f = row.getScore();
List<HighlightEntry> highlightEntries = null;
List<Pair<String, List<String>>> high = hightLighting.get(row.getNodeRef());
List<Pair<String, List<String>>> high = highLighting.get(row.getNodeRef());
if (high != null && !high.isEmpty())
{
@@ -185,26 +186,21 @@ public class ResultMapper
else
{
logger.debug("Unknown noderef returned from search results "+row.getNodeRef());
notFound++;
unknownNodeRefsCount.incrementAndGet();
}
}
SolrJSONResultSet solrResultSet = findSolrResultSet(results);
SearchContext context =
toSearchEngineResultSet(results)
.map(resultSet -> toSearchContext(resultSet, searchRequestContext, searchQuery))
.orElse(null);
if (solrResultSet != null)
{
//We used Solr for this query
context = toSearchContext(solrResultSet, searchRequestContext, searchQuery, notFound);
}
total = setTotal(results);
return CollectionWithPagingInfo.asPaged(params.getPaging(), noderesults, results.hasMore(), total, null, context);
return CollectionWithPagingInfo.asPaged(params.getPaging(), noderesults, results.hasMore(), setTotal(results), null, context);
}
/**
* Builds a node representation based on a ResultSetRow;
* @param searchRequestContext
*
* @param aRow
* @param params
* @param mapUserInfo
@@ -285,14 +281,14 @@ public class ResultMapper
/**
* Uses the results from Solr to set the Search Context
* @param SolrJSONResultSet
*
* @param searchQuery
* @return SearchContext
*/
public SearchContext toSearchContext(SolrJSONResultSet solrResultSet, SearchRequestContext searchRequestContext, SearchQuery searchQuery, int notFound)
public SearchContext toSearchContext(SearchEngineResultSet resultSet, SearchRequestContext searchRequestContext, SearchQuery searchQuery)
{
SearchContext context = null;
Map<String, Integer> facetQueries = solrResultSet.getFacetQueries();
Map<String, Integer> facetQueries = resultSet.getFacetQueries();
List<GenericFacetResponse> facets = new ArrayList<>();
List<FacetQueryContext> facetResults = null;
SpellCheckContext spellCheckContext = null;
@@ -330,7 +326,7 @@ public class ResultMapper
}
//Field Facets
Map<String, List<Pair<String, Integer>>> facetFields = solrResultSet.getFieldFacets();
Map<String, List<Pair<String, Integer>>> facetFields = resultSet.getFieldFacets();
if(FacetFormat.V2 == searchQuery.getFacetFormat())
{
facets.addAll(getFacetBucketsForFacetFieldsAsFacets(facetFields, searchQuery));
@@ -340,28 +336,29 @@ public class ResultMapper
ffcs.addAll(getFacetBucketsForFacetFields(facetFields, searchQuery));
}
Map<String, List<Pair<String, Integer>>> facetInterval = solrResultSet.getFacetIntervals();
Map<String, List<Pair<String, Integer>>> facetInterval = resultSet.getFacetIntervals();
facets.addAll(getGenericFacetsForIntervals(facetInterval, searchQuery));
Map<String,List<Map<String,String>>> facetRanges = solrResultSet.getFacetRanges();
Map<String,List<Map<String,String>>> facetRanges = resultSet.getFacetRanges();
facets.addAll(RangeResultMapper.getGenericFacetsForRanges(facetRanges, searchQuery.getFacetRanges()));
List<GenericFacetResponse> stats = getFieldStats(searchRequestContext, solrResultSet.getStats());
List<GenericFacetResponse> pimped = getPivots(searchRequestContext, solrResultSet.getPivotFacets(), stats);
List<GenericFacetResponse> stats = getFieldStats(searchRequestContext, resultSet.getStats());
List<GenericFacetResponse> pimped = getPivots(searchRequestContext, resultSet.getPivotFacets(), stats);
facets.addAll(pimped);
facets.addAll(stats);
//Spelling
SpellCheckResult spell = solrResultSet.getSpellCheckResult();
SpellCheckResult spell = resultSet.getSpellCheckResult();
if (spell != null && spell.getResultName() != null && !spell.getResults().isEmpty())
{
spellCheckContext = new SpellCheckContext(spell.getResultName(),spell.getResults());
}
//Put it all together
context = new SearchContext(solrResultSet.getLastIndexedTxId(), facets, facetResults, ffcs, spellCheckContext, searchRequestContext.includeRequest()?searchQuery:null);
context = new SearchContext(resultSet.getLastIndexedTxId(), facets, facetResults, ffcs, spellCheckContext, searchRequestContext.includeRequest()?searchQuery:null);
return isNullContext(context)?null:context;
}
public static boolean hasGroup(SearchQuery searchQuery)
{
if(searchQuery != null && searchQuery.getFacetQueries() != null)
@@ -618,26 +615,32 @@ public class ResultMapper
}
/**
* Gets SolrJSONResultSet class if there is one.
* @param results
* @return
* Tries to see if the input {@link ResultSet} or one of the wrapped {@link ResultSet}
* is an instance of {@link SearchEngineResultSet}.
* Since some concrete ResultSet implements the decorator patterns, the code
* assumes (in those cases) a nested structure with a maximum of 3 levels.
* Probably the code could be generalised better in order to scan a decorator
* chain with an unlimited depth, but that would require a change in the ResultSet interface.
*/
protected SolrJSONResultSet findSolrResultSet(ResultSet results)
protected Optional<SearchEngineResultSet> toSearchEngineResultSet(ResultSet results)
{
ResultSet theResultSet = results;
if (results instanceof FilteringResultSet)
{
theResultSet = ((FilteringResultSet) results).getUnFilteredResultSet();
// 1st level
results = ((FilteringResultSet) results).getUnFilteredResultSet();
// 2nd level
if (results instanceof FilteringResultSet)
{
results = ((FilteringResultSet) results).getUnFilteredResultSet();
}
}
if (theResultSet instanceof SolrJSONResultSet)
{
return (SolrJSONResultSet) theResultSet;
}
return null;
return results instanceof SearchEngineResultSet
? of(results).map(SearchEngineResultSet.class::cast)
: empty();
}
public CollectionWithPagingInfo<TupleList> toCollectionWithPagingInfo(JSONArray docs, SearchSQLQuery searchQuery) throws JSONException
{
if(docs == null )

View File

@@ -0,0 +1,66 @@
/*
* #%L
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2021 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.rest.api.types;
import org.alfresco.rest.api.Types;
import org.alfresco.rest.api.model.Type;
import org.alfresco.rest.framework.resource.EntityResource;
import org.alfresco.rest.framework.resource.actions.interfaces.EntityResourceAction;
import org.alfresco.rest.framework.resource.parameters.CollectionWithPagingInfo;
import org.alfresco.rest.framework.resource.parameters.Parameters;
import org.alfresco.util.ParameterCheck;
import org.springframework.beans.factory.InitializingBean;
@EntityResource(name = "types", title = "types")
public class TypeEntityResource implements EntityResourceAction.ReadById<Type>, EntityResourceAction.Read<Type>, InitializingBean
{
private Types types;
public void setTypes(Types types)
{
this.types = types;
}
@Override
public void afterPropertiesSet()
{
ParameterCheck.mandatory("types", this.types);
}
@Override
public CollectionWithPagingInfo<Type> readAll(Parameters params)
{
return types.listTypes(params);
}
@Override
public Type readById(String id, Parameters parameters)
{
return types.getType(id);
}
}

View File

@@ -1,40 +1,30 @@
/*
* #%L
* Alfresco Repository
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* Copyright (C) 2005 - 2021 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
* 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.repo.content.transform.magick;
import org.alfresco.service.cmr.repository.CropSourceOptions;
/**
* Deprecated crop options.
*
* @deprecated replaced by {@link CropSourceOptions}
* @see CropSourceOptions
*/
public class ImageCropOptions extends CropSourceOptions
{
}
@WebApi(name="alfresco", scope= Api.SCOPE.PUBLIC, version=1)
package org.alfresco.rest.api.types;
import org.alfresco.rest.framework.Api;
import org.alfresco.rest.framework.WebApi;

View File

@@ -41,7 +41,11 @@ public class DefaultExceptionResolver implements ExceptionResolver<Exception>
@Override
public ErrorResponse resolveException(Exception ex)
{
return new ErrorResponse(DEFAULT_MESSAGE_ID, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, ex.getLocalizedMessage(), ex.getStackTrace(), null);
return new ErrorResponse(DEFAULT_MESSAGE_ID,
HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
ex.getLocalizedMessage(),
ex.getStackTrace(),
null);
}
}

View File

@@ -1,8 +1,8 @@
/*
* #%L
* Alfresco Repository
* Alfresco Remote API
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* Copyright (C) 2005 - 2021 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -23,25 +23,26 @@
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.repo.content.transform;
package org.alfresco.rest.framework.core.exceptions;
import org.alfresco.repo.search.QueryParserException;
/**
* Specifies transformations that are considered to be 'exceptional' so
* should be used in preference to other transformers that can perform
* the same transformation.
*
* @deprecated The transformations code is being moved out of the codebase and replaced by the new async RenditionService2 or other external libraries.
* QueryParserException is related with search requests to Search Services.
*/
@Deprecated
public class ExplictTransformationDetails extends SupportedTransformation
public class QueryParserExceptionResolver implements ExceptionResolver<QueryParserException>
{
public ExplictTransformationDetails()
@Override
public ErrorResponse resolveException(QueryParserException ex)
{
super();
return new ErrorResponse(
DefaultExceptionResolver.DEFAULT_MESSAGE_ID,
// Mapping the original HTTP Status code returned by Search Services
ex.getHttpStatusCode(),
ex.getLocalizedMessage(),
ex.getStackTrace(),
null);
}
public ExplictTransformationDetails(String sourceMimetype, String targetMimetype)
{
super(sourceMimetype, targetMimetype);
}
}
}

View File

@@ -26,10 +26,12 @@
package org.alfresco.rest.framework.tools;
import org.alfresco.metrics.rest.RestMetricsReporter;
import org.alfresco.repo.search.QueryParserException;
import org.alfresco.rest.framework.Api;
import org.alfresco.rest.framework.core.exceptions.DefaultExceptionResolver;
import org.alfresco.rest.framework.core.exceptions.ErrorResponse;
import org.alfresco.rest.framework.core.exceptions.ExceptionResolver;
import org.alfresco.rest.framework.core.exceptions.QueryParserExceptionResolver;
import org.alfresco.rest.framework.jacksonextensions.JacksonHelper;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -48,6 +50,7 @@ public class ApiAssistant {
private ExceptionResolver<Exception> defaultResolver = new DefaultExceptionResolver();
private ExceptionResolver<WebScriptException> webScriptExceptionResolver;
private ExceptionResolver<QueryParserException> queryParserExceptionResolver;
private ExceptionResolver<Exception> resolver;
private JacksonHelper jsonHelper;
private RestMetricsReporter restMetricsReporter;
@@ -77,6 +80,10 @@ public class ApiAssistant {
{
error = webScriptExceptionResolver.resolveException((WebScriptException) ex);
}
else if (ex instanceof QueryParserException)
{
error = queryParserExceptionResolver.resolveException((QueryParserException) ex);
}
else
{
error = resolver.resolveException(ex);
@@ -100,6 +107,11 @@ public class ApiAssistant {
this.webScriptExceptionResolver = webScriptExceptionResolver;
}
public void setQueryParserExceptionResolver(ExceptionResolver<QueryParserException> queryParserExceptionResolver)
{
this.queryParserExceptionResolver = queryParserExceptionResolver;
}
public void setResolver(ExceptionResolver<Exception> resolver) {
this.resolver = resolver;
}

View File

@@ -31,6 +31,7 @@ import java.util.Properties;
import javax.servlet.ServletContext;
import org.alfresco.httpclient.HttpClientFactory.SecureCommsType;
import org.alfresco.web.scripts.servlet.X509ServletFilterBase;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -70,7 +71,9 @@ public class AlfrescoX509ServletFilter extends X509ServletFilterBase
* Return true or false based on the property. This will switch on/off X509 enforcement in the X509ServletFilterBase.
*/
if (prop == null || "none".equals(prop))
if (prop == null ||
SecureCommsType.getType(prop) == SecureCommsType.NONE ||
SecureCommsType.getType(prop) == SecureCommsType.SECRET)
{
return false;
}

View File

@@ -20,7 +20,6 @@ admin-console.close=Close
admin-console.password.show=Show Password
admin-console.password.hide=Hide Password
admin-console.unavailable=Information is currently unavailable
admin-console.not.installed=Not Installed
admin-console.requesterror=We couldn't complete your request. Try again.

View File

@@ -20,7 +20,6 @@ admin-console.close=Zav\u0159\u00edt
admin-console.password.show=Zobrazit heslo
admin-console.password.hide=Skr\u00fdt heslo
admin-console.unavailable=Informace nejsou moment\u00e1ln\u011b k\u00a0dispozici
admin-console.not.installed=Nen\u00ed nainstalov\u00e1no
admin-console.requesterror=V\u00e1\u0161 po\u017eadavek nebylo mo\u017en\u00e9 dokon\u010dit. Zkuste to znovu.

View File

@@ -20,7 +20,6 @@ admin-console.close=Luk
admin-console.password.show=Vis adgangskode
admin-console.password.hide=Skjul adgangskode
admin-console.unavailable=Oplysningerne er i \u00f8jeblikket ikke tilg\u00e6ngelige
admin-console.not.installed=Ikke installeret
admin-console.requesterror=Vi kunne ikke fuldf\u00f8re anmodningen. Pr\u00f8v igen.

View File

@@ -20,7 +20,6 @@ admin-console.close=Schlie\u00dfen
admin-console.password.show=Passwort anzeigen
admin-console.password.hide=Passwort ausblenden
admin-console.unavailable=Information ist derzeit nicht verf\u00fcgbar
admin-console.not.installed=Nicht installiert
admin-console.requesterror=Die Anfrage konnte nicht durchgef\u00fchrt werden.

Some files were not shown because too many files have changed in this diff Show More