Compare commits

..

172 Commits

Author SHA1 Message Date
Travis CI User
64483cdf29 [maven-release-plugin][skip ci] prepare release 7.302 2020-11-06 13:23:51 +00:00
evasques
6f8879686a MNT-21967 - ClassCastException when using CMIS query with SCORE() function (#134)
* MNT-21967 - ClassCastException when using CMIS query with SCORE() function (#128)

* Added missing validation before if columnName is the expected column
before normalizing value to float, in case the column is Score

(cherry picked from commit acac23f29a)
2020-11-06 12:56:07 +00:00
Travis CI User
e722ec080b [maven-release-plugin][skip ci] prepare for next development iteration 2020-10-15 12:04:47 +00:00
Travis CI User
d44dc63519 [maven-release-plugin][skip ci] prepare release 7.301 2020-10-15 12:04:40 +00:00
tzclucian
b34b58c6bc Merge remote-tracking branch 'origin/release/6.2.N' into release/6.2.N 2020-10-15 11:25:06 +03:00
tzclucian
81838290a1 MNT-21879 : [Security] Multiple json-java vulnerabilities
- added upgrade & fix
2020-10-15 11:24:54 +03:00
Travis CI User
82ae1d8a8f [maven-release-plugin][skip ci] prepare for next development iteration 2020-10-14 08:34:33 +00:00
Travis CI User
d61efd18b4 [maven-release-plugin][skip ci] prepare release 7.300 2020-10-14 08:34:26 +00:00
Alan Davis
e6b2101197 Removed -TEST[0-9]* from the pom version 2020-10-14 08:48:13 +01:00
Alan Davis
18854bb28f Should be using TRAVIS_ACCESS_TOKEN rather than TRAVIS_ACCESS_TOKEN_TEMP [skip ci] 2020-10-14 08:30:26 +01:00
Alan Davis
99d5680c69 Merge changes from support/6.2.N to release/6.2.N since 6.2.3-A1
acs-packaging 6.2.3-SNAPSHOT
   alfresco-enterprise-remote-api 7.94
   alfresco-enterprise-repository 7.120
   alfresco-remote-api 7.157
   alfresco-repository 7.220
   alfresco-data-model 8.50.21
   alfresco-core 7.35
There were no changes needing to go into acs-packaging or alfresco-enterprise-repo

MNT-21871: jackson databind vulnerabilities 6.2.N (#833)

   - upgrade to 2.10.5
   - reconfigure object mapper with different inclusion criteria for value and contents

(cherry picked from commit a570822375ab3beb8bb879af336fdf062d05f426)
MNT-21936 : Audit query Rest API does not return the correct totalItems (#838) (#847)

* MNT-21936 : Audit query Rest API does not return the correct totalItems (#838)

   MNT-21936 : Audit query Rest API does not return the correct totalItems
   Retrieve audit entries count if it has more items
   Require new release of alfresco-repository.
   MNT-21936 : introduced omitTotalItems property for AuditImpl#listAuditEntries

(cherry picked from commit 91c49be12a21b23a87cd04b7584c230b2ec4b569)

* bump alfresco-repository to 7.220

(cherry picked from commit 91957c4ccd905f677dd457c98406d6cabfa892c9)
MNT-21936 : Audit query Rest API does not return the correct totalItems (#1253) (#1262)

* MNT-21936 : Audit query Rest API does not return the correct totalItems
   Add CountAuditEntryId select, that provides the total number of items for a specific auditApp
   Add getAuditEntriesCountByApp(long appId) in AuditDAO interface and its implementation in AuditDAOImpl
   Add getAuditEntriesCountByApp(String applicationName) in AuditComponent interface and its implementation in AuditComponentImpl
   Add getAuditEntriesCountByApp(String applicationName) in AuditService interface and its implementation in AuditServiceImpl

* MNT-21936 : Added default implementation for getAuditEntriesCountByApp() in AuditComponent AuditService and AuditDAOImpl

(cherry picked from commit 706251642bb5ef6dbb0a059bf6a0cd4f7b72ab43)

(cherry picked from commit 7e8ab16fe1af7d14d1b5dacb8dbdea30ccb7f30f)

on branches merge/62N_13Oct, origin/merge/62N_13Oct
2020-10-13 17:57:37 +01:00
Alan Davis
4d5ae34b07 Should be using TRAVIS_ACCESS_TOKEN rather than TRAVIS_ACCESS_TOKEN_TEMP to trigger downstream project builds 2020-10-13 17:32:37 +01:00
Alan Davis
673e326672 Merge changes from support/6.2.N to release/6.2.N since 6.2.3-A1
acs-packaging 6.2.3-SNAPSHOT
   alfresco-enterprise-remote-api 7.94
   alfresco-enterprise-repository 7.120
   alfresco-remote-api 7.157
   alfresco-repository 7.220
   alfresco-data-model 8.50.21
   alfresco-core 7.35
There were no changes needing to go into acs-packaging or alfresco-enterprise-repo

MNT-21871: jackson databind vulnerabilities 6.2.N (#833)

   - upgrade to 2.10.5
   - reconfigure object mapper with different inclusion criteria for value and contents

(cherry picked from commit a570822375ab3beb8bb879af336fdf062d05f426)
MNT-21936 : Audit query Rest API does not return the correct totalItems (#838) (#847)

* MNT-21936 : Audit query Rest API does not return the correct totalItems (#838)

   MNT-21936 : Audit query Rest API does not return the correct totalItems
   Retrieve audit entries count if it has more items
   Require new release of alfresco-repository.
   MNT-21936 : introduced omitTotalItems property for AuditImpl#listAuditEntries

(cherry picked from commit 91c49be12a21b23a87cd04b7584c230b2ec4b569)

* bump alfresco-repository to 7.220

(cherry picked from commit 91957c4ccd905f677dd457c98406d6cabfa892c9)
MNT-21936 : Audit query Rest API does not return the correct totalItems (#1253) (#1262)

* MNT-21936 : Audit query Rest API does not return the correct totalItems
   Add CountAuditEntryId select, that provides the total number of items for a specific auditApp
   Add getAuditEntriesCountByApp(long appId) in AuditDAO interface and its implementation in AuditDAOImpl
   Add getAuditEntriesCountByApp(String applicationName) in AuditComponent interface and its implementation in AuditComponentImpl
   Add getAuditEntriesCountByApp(String applicationName) in AuditService interface and its implementation in AuditServiceImpl

* MNT-21936 : Added default implementation for getAuditEntriesCountByApp() in AuditComponent AuditService and AuditDAOImpl

(cherry picked from commit 706251642bb5ef6dbb0a059bf6a0cd4f7b72ab43)

(cherry picked from commit 7e8ab16fe1af7d14d1b5dacb8dbdea30ccb7f30f)
2020-10-13 13:35:27 +01:00
Travis CI User
76dfa8e445 [maven-release-plugin][skip ci] prepare for next development iteration 2020-10-09 13:00:17 +00:00
Travis CI User
72aa1b0a84 [maven-release-plugin][skip ci] prepare release 7.300-TEST3 2020-10-09 13:00:10 +00:00
Alan Davis
596dfe0940 Update comment in Docker file 2020-10-09 13:32:42 +01:00
Alan Davis
c1a56ee22f Merge changes on 6.2.N (6.2.3-A1) projects since 15/7/2020 16:22 to release/6.2.N (#29)
* Changes originally made to acs-packaging

* Changes originally made to acs-packaging

* MNT-21702 : Kerberos SSO fallback mechanism for WebDAV (#766)

Reinstated 'part' of the reverted code change originally made in MNT-16931 to handle fallback correctly for WebDAV in a kerberos environment.

(cherry picked from commit 91e6af0974bbc9255d5053237abdd10104420042)
[MNT-21758] Cannot map an AOS / WebDAV drive with Kerberos SSO enabled (#785)

- Add multi catch for Illegal Argument and Not Found when findWebScript is called.

(cherry picked from commit 7c135ae8c990f65cf7901d6d6f72dc6c70e44c13)
SEARCH-2363: Escape special characters when serializing ChildAssociationRefs and AssociationRefs objects
Cherry Picked from f941a6e

(cherry picked from commit 3a8ac4417370ec3dad5e9283c3d41e2fd3dd91ce)

* SEARCH-2273: Add detailed message when ignoring nodes in SOLR without type or with types not registered in Dictionary Service.
Cherry-picked from f4bdc8c

(cherry picked from commit a01c6ddf816fed57c28a5bd873da5e4835d90488)
SEARCH-800: Get values in DBResultSetRow in the same way they are recovered in SolrJSONResultSetRow.
Cherry-picked from 695113f

(cherry picked from commit 1c98d6f29c5b9fd8081af76d63add762af833dc1)
MNT-21317 Move on Update Folder Rule triggers unexpectedly for MOVED content. (#1115)

* MNT-21317_fix folder rule trigger

* MNT-21317_folder rule test case added

* Update .travis.yml

* Update OnPropertyUpdateRuleTrigger.java

* MNT-21317 updated test

cherry picked from commit 33ca87046019416875fd23b72293e84b912f4cd9 master to 6.2.N

(cherry picked from commit 1d4e7002543f6425da9e9f26047b8d42c84b2bd3)
Bump gytheio-messaging-camel from 0.11.3 to 0.11.6 (#1095)

Bumps gytheio-messaging-camel from 0.11.3 to 0.11.6.

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
(cherry picked from commit 16179db5fc4524c339097f1f3a9a6409dd895b11)

(cherry picked from commit af0080e336b7f5505f47d72b9b063c9ce5caedd0)
REPO-5235: Use unforked tika (#1081)

* REPO-5235: Use latst unforked tika version from the updated alfresco-data-model
* Recognise new Exif properties and use a previous workaround to set correct tiff:ImageLength and tiff:ImageWidth

(cherry picked from commit 7f576b1d32)

(cherry picked from commit ab91ec354a14e8c20c4a2deb0a73149362d5155b)
support/SP/7.N: Updated T-engines to 2.3.3 (Cherry-picked from master)

(cherry picked from commit ca4e978e6874869de0bb5a56843f9caf8d8874ac)
MNT-21614: LDAP sync communication error leads to group members deletion (#1149)

* Catch reported exceptions to filter ldap sync aborts

(cherry picked from commit 4d0a1966297db0cc4e219d9693236b879b5f12c7)
support/SP/7.N: Updated T-engines to 2.3.4 (Cherry-picked from master)

(cherry picked from commit 8078e1ce7e81a5bee15f15d7bfa156427ebcccbc)
SEARCH-2289: Restore the support for SOLR 4 in ACS 6.2+ deployments.
Cherry pick from e8bba3c

(cherry picked from commit f4b653ba5577629fae0ba8e193b151dd7bbdb7be)
[MNT-21847] - Aync permissions fail when new nodes are created (#1188) (#1195)

Fix:
*Changed method setFixedAcls on class ADMAccessControlListDAO to continue to propagate through children to apply the correct acl not only when the current child acl matches the shared acl to replace but also when the current child acl matches the new shared acl
Unit Test:
*Refactored the unit test FixedAclUpdaterTest to be able to add in a new test without repeating code: separating the operations that set the permissions from the one that triggers the job into separate methods
*As it was if one test failed, leaving aspects to be processed, the test would run indefinitely (it was programmed to keep running the job while there where nodes with the aspect). Added a verification to stop triggering the job if the number of nodes with the pendingFixAcl did not change between executions.
*Also, if one test failed, it would leave nodes with pendingFixAcl aspect in the database, and the other tests that ran after would also fail, not completing the goal of processing all nodes with the aspect. If a test fails, the folder structure it ran is now deleted so no nodes with the aspect from that structure are processed by the other tests.
*Added a test to find the first folder in a tree where permissions where set async that has the pendingFixAcl aspect and that creates a new node in it to verify the issue

(cherry picked from commit 443e5e226430a2760492fb82214ad520e7e1cb75)

(cherry picked from commit 65a48f3c36a6fc3567c5b0edafb949629f705d8a)
ATS-825 : Updated T-engines to 2.3.5 (#1224)

(cherry picked from commit 6dcf985acc4f238ae8c9af22e84a61ad9b476429)
SEARCH-2450 Don't expose properties from solr endpoint if the model says not to index them. (#1228) (#1229)

(cherry picked from commit 2fea6c9484def402e2bfd7c3717071ff8df69c01)

(cherry picked from commit 8db009c9505c5d01ba08d2427f549e54ea13fbc6)
Fix/MNT-21800 CMIS Web Service Check Out returns error (#1232) (#1233)

* MNT-21800 : CMIS Web Service Check Out returns error
   Integrate path into codebase.

(cherry picked from commit 51a7793668ba1c969c5de37603190244e3839cd0)

(cherry picked from commit 0cd801a6c12d7ac7e1ff7f05b8b8acfaacdb58e4)

* SOLR Test class should be under repository/src/test and not repository/src/main [skip ci]

* Test build

* Undo README dummy change. [skip ci]

* Remove READMEs that have been moved to the top level.

* Same jars as in 6.2.3-A1

- needed to correct tika and poi.

* Fix location of keystore
Only copy win64 and linux pdf-renderer to dist zip
Sort out what get included in dist jar and zip

(cherry picked from commit 779f8af717)

* aos-module had the wrong version
2020-10-09 13:25:44 +01:00
Travis CI User
106476287d [maven-release-plugin][skip ci] prepare for next development iteration 2020-10-02 14:11:08 +00:00
Travis CI User
01f7df6ff0 [maven-release-plugin][skip ci] prepare release 7.300-TEST2 2020-10-02 14:11:00 +00:00
Alan Davis
d83fb0a942 Feature/repo 5358 merge 6213 (#26)
REPO-5361/REPO-5358 Merge latest changes (6.2.1.3) / Deployment modules should extend each other

In order to support the external deployment of the default keystore (MNT-21731/SEARCH-1915),
it was removed from alfresco-repository.jar and had be placed in deployment module of acs-packaging.
To support this in the new project structure, this commit moves the keystore back to
alfresco-community-repo's deployment module and has alfresco-enterprise-repo and acs-packaging
extend it in their own deployment modules. This also avoids duplication of licenses between projects.

(cherry picked from commit bad162c91f)
2020-10-02 13:59:40 +01:00
Cezar.Leahu
903c2828d2 REPO-5111 Update build scripts [skip ci] 2020-09-30 22:33:11 +03:00
Travis CI User
c59d485eab [maven-release-plugin][skip ci] prepare for next development iteration 2020-09-27 10:24:13 +00:00
Travis CI User
b3b3c4c9f5 [maven-release-plugin][skip ci] prepare release 7.300-TEST1 2020-09-27 10:24:06 +00:00
Alan Davis
9e014128f4 REPO-5271 Backport new structure to relaese/6.2.N (#18)
- Simplify dependencies and standardise order
- README updated
- Green builds
- Changes to make Jars in enterprise war match
- Changes to make files in enterprise image match
- Added travis_wait 40 to the initial build as it can take 20 minutes to download artifacts
- Removed NodesTest.siteConsumerWillGet403OnFileWithDisabledInherittedPermissions introduced in 7.0.0 and fails in earlier versions.
2020-09-27 10:52:06 +01:00
Cezar.Leahu
36ccfe2bea ACS-550 Add .gitignore 2020-09-03 11:15:34 +03:00
Iulian Aftene
56e9417e00 Merge pull request #13 from Alfresco/feature/REPO-5318_62N
REPO-5318-Create l10n.properties release/6.2.N
2020-08-21 11:43:35 +03:00
aftene
d5317444c8 REPO-5318-Create l10n.properties
- delete l10n.properties files from data-model, remote-api and repository
 - add new global l10n.properties file
2020-08-19 19:44:01 +03:00
Chris Shields
f0d09767e7 Merge remote-tracking branch 'acs-community-packaging/develop' into release/6.2.N 2020-07-21 10:44:54 +01:00
Chris Shields
eb8f4da6c9 Merge remote-tracking branch 'alfresco-remote-api/support/SP/7.N' into release/6.2.N 2020-07-21 10:44:52 +01:00
Chris Shields
bfc6e4c490 Merge remote-tracking branch 'alfresco-repository/support/SP/7.N' into release/6.2.N 2020-07-21 10:44:49 +01:00
Chris Shields
43815223ba Merge remote-tracking branch 'alfresco-data-model/support/SP/8.50.N' into release/6.2.N 2020-07-21 10:44:49 +01:00
Chris Shields
4da02fcae2 Merge remote-tracking branch 'alfresco-core/support/SP/7.N' into release/6.2.N 2020-07-21 10:44:49 +01:00
Chris Shields
a7f4f02dcf Moved remote-api support/SP/7.N into its own directory 2020-07-21 10:44:12 +01:00
Chris Shields
048c456580 Moved repository support/SP/7.N into its own directory 2020-07-21 10:43:38 +01:00
Chris Shields
1cd59480f9 Moved data-model support/SP/8.50.N into its own directory 2020-07-21 10:43:26 +01:00
Chris Shields
c655c97421 Moved core support/SP/7.N into its own directory 2020-07-21 10:43:19 +01:00
Travis CI User
7625df9166 [maven-release-plugin][skip ci] prepare for next development iteration 2020-07-17 15:34:06 +00:00
Travis CI User
515b8d1720 [maven-release-plugin][skip ci] prepare release alfresco-repository-7.204 2020-07-17 15:33:59 +00:00
Abdul Mohammed
32e4a7bf8b Bump alfresco-greenmail version 2020-07-17 15:46:31 +01:00
Abdul Mohammed
fbb581f527 MNT-21481: IMAP UID search command errors with French Locale- Only folders showing (#1098)
* Bump alfresco-greenmail version and add Integration tests
2020-07-17 15:42:51 +01:00
Travis CI User
a6caa9953b [maven-release-plugin][skip ci] prepare for next development iteration 2020-07-14 11:43:36 +00:00
Travis CI User
69e16a3ffc [maven-release-plugin][skip ci] prepare release alfresco-repository-7.203 2020-07-14 11:43:29 +00:00
Alexandru-Eusebiu Epure
28bebe0e6d MNT-21671 : Download as zip REST api does not include custom folders (#1090) (#1092)
Add dictionaryService to CreateDwonloadArchiveAction
   ZipDownloadExporter constructor now required dictionaryService
   ZipDownloadExporter#startNode will include into archive all subclasses of node type cm:folder.
   Add a custom model and create a custom node in DownloadServiceIntegrationTest, this use case will be tested in DownloadServiceIntegrationTest#createDownload()

(cherry picked from commit 3a31ac3634)
2020-07-14 14:22:28 +03:00
Travis CI User
9b4a43896a [maven-release-plugin][skip ci] prepare for next development iteration 2020-07-09 12:57:54 +00:00
Travis CI User
58c5160aeb [maven-release-plugin][skip ci] prepare release alfresco-remote-api-7.149 2020-07-09 12:57:47 +00:00
tiagos
94b4f4eefd Bump alfresco-data-model (8.50.19), alfresco-repository (7.202) 2020-07-09 12:44:46 +01:00
Travis CI User
c75e3cd7c4 [maven-release-plugin][skip ci] prepare for next development iteration 2020-07-08 21:13:59 +00:00
Travis CI User
58764feccd [maven-release-plugin][skip ci] prepare release alfresco-repository-7.202 2020-07-08 21:13:52 +00:00
tiagos
c5bceb0427 Bump alfresco-data-model to 8.50.19 2020-07-08 21:52:06 +01:00
Travis CI User
64e225dd0e [maven-release-plugin][skip ci] prepare for next development iteration 2020-07-08 16:14:24 +00:00
Travis CI User
30be7fdb61 [maven-release-plugin][skip ci] prepare release 8.50.19 2020-07-08 16:14:17 +00:00
tiagosalvado10
8145afb29c [MNT-18448] [MNT-20953] Added Visio extensions (vss, vst, vsdm, vssx, vssm, vstx, vstm) and Project (mpt) (#279) 2020-07-08 17:09:24 +01:00
Travis CI User
5690f15967 [maven-release-plugin][skip ci] prepare for next development iteration 2020-07-07 12:54:25 +00:00
Travis CI User
2a7306cc8b [maven-release-plugin][skip ci] prepare release alfresco-remote-api-7.148 2020-07-07 12:54:18 +00:00
Kristian Dimitrov
70839f8d9a ACS-386: Update Postgres docker to 11.7 (#705) 2020-07-07 13:27:01 +01:00
Travis CI User
f895938f04 [maven-release-plugin][skip ci] prepare for next development iteration 2020-07-03 12:30:35 +00:00
Travis CI User
bcb7cc1400 [maven-release-plugin][skip ci] prepare release alfresco-repository-7.201 2020-07-03 12:30:27 +00:00
Nebil Kisa
a6511a3fd1 Update PostgreSQL 11.4 to 11.7 (#1078) (#1079)
* Update PostgreSQL 11.4 to 11.6, interim step
* Update PostgreSQL from 11.6 to 11.7. We got a green build on 11.6.
* We got green build on both 11.6 and 11.7

(cherry picked from commit 35715e40f4)
2020-07-03 13:09:59 +01:00
Travis CI User
f0cdecac08 [maven-release-plugin][skip ci] prepare for next development iteration 2020-06-26 19:07:56 +00:00
Travis CI User
d9e16374d9 [maven-release-plugin][skip ci] prepare release alfresco-repository-7.200 2020-06-26 19:07:49 +00:00
Ancuta Morarasu
7c2d66bf2c Increment version.schema to 13010 for ACS 6.2.3 (5 more than 6.2.2) 2020-06-26 21:46:47 +03:00
Travis CI User
f3f3ed7e61 [maven-release-plugin][skip ci] prepare for next development iteration 2020-06-26 16:18:34 +00:00
Travis CI User
15ca57bcd2 [maven-release-plugin][skip ci] prepare release alfresco-repository-7.199 2020-06-26 16:18:27 +00:00
Nebil Kisa
b24b144c3e ATS-791: Update to T-Engines 2.3.1 (#1072) (#1073)
(cherry picked from commit 8bf1a0752a)
2020-06-26 16:58:16 +01:00
Travis CI User
f56726a75a [maven-release-plugin][skip ci] prepare for next development iteration 2020-06-26 15:12:17 +00:00
Travis CI User
3f78c9a729 [maven-release-plugin][skip ci] prepare release alfresco-remote-api-7.147 2020-06-26 15:12:09 +00:00
Cristian Turlica
2ffcfaee4e Updated dependencies 2020-06-26 17:55:38 +03:00
Travis CI User
73784ab389 [maven-release-plugin][skip ci] prepare for next development iteration 2020-06-26 14:49:11 +00:00
Travis CI User
ff612b2233 [maven-release-plugin][skip ci] prepare release alfresco-repository-7.198 2020-06-26 14:49:04 +00:00
Cristian Turlica
60093108db Update dependencies 2020-06-26 17:21:23 +03:00
Travis CI User
3e2b0a0f22 [maven-release-plugin][skip ci] prepare for next development iteration 2020-06-26 14:15:49 +00:00
Travis CI User
fe9f6b73cd [maven-release-plugin][skip ci] prepare release 8.50.18 2020-06-26 14:15:42 +00:00
Cristian Turlica
3d1e326d38 Updated core version 2020-06-26 16:55:47 +03:00
Travis CI User
2b6185021e [maven-release-plugin][skip ci] prepare for next development iteration 2020-06-26 11:05:46 +00:00
Travis CI User
8b2b52bd47 [maven-release-plugin][skip ci] prepare release 7.34 2020-06-26 11:05:39 +00:00
Ancuta Morarasu
41eeacac47 MNT-21641: Update surf version to 7.16 (#137) 2020-06-26 14:00:23 +03:00
Travis CI User
81e9ae40ca [maven-release-plugin][skip ci] prepare for next development iteration 2020-06-25 11:38:58 +00:00
Travis CI User
d9283af46b [maven-release-plugin][skip ci] prepare release alfresco-remote-api-7.146 2020-06-25 11:38:50 +00:00
Alex Mukha
d8d00b1430 SEARCH-2321 Update dependencies
alfresco-repository 7.197
surf webscripts 7.16
2020-06-25 11:59:06 +01:00
Travis CI User
ec22b6b39a [maven-release-plugin][skip ci] prepare for next development iteration 2020-06-25 09:46:50 +00:00
Travis CI User
69fc15dd0c [maven-release-plugin][skip ci] prepare release alfresco-repository-7.197 2020-06-25 09:46:43 +00:00
Jamal Kaabi-Mofrad
19a31ec32b ACS-300: Bump keycloak version from 9.0.3 to 11.0.0-alfresco-001 (#1062)
(cherry picked from commit 9d67d29abb)

# Conflicts:
#	pom.xml
2020-06-25 10:17:37 +01:00
Travis CI User
4a83e7f83f [maven-release-plugin][skip ci] prepare for next development iteration 2020-06-25 08:56:52 +00:00
Travis CI User
023583e67a [maven-release-plugin][skip ci] prepare release alfresco-repository-7.196 2020-06-25 08:56:44 +00:00
Alex Mukha
daf7ec44e4 SEARCH-2321 Change SAX parser config in QueryRegister 2020-06-25 09:37:20 +01:00
Alex Mukha
ec131b33a5 Revert "SEARCH-2321 Change SAX parser config in QueryRegister (#1066)"
This reverts commit d1ce85398c.
2020-06-25 09:34:17 +01:00
Alex Mukha
d1ce85398c SEARCH-2321 Change SAX parser config in QueryRegister (#1066) 2020-06-25 09:27:38 +01:00
Travis CI User
c79e3f8550 [maven-release-plugin][skip ci] prepare for next development iteration 2020-06-24 17:03:38 +00:00
Travis CI User
7a8996463a [maven-release-plugin][skip ci] prepare release alfresco-remote-api-7.145 2020-06-24 17:03:30 +00:00
Ancuta Morarasu
8242b34604 ACS-370: Newer metadata-extractor - update components
- alfresco-data-model 8.50.17, alfresco-repository 7.195
2020-06-24 19:40:06 +03:00
Travis CI User
f34dd7ad16 [maven-release-plugin][skip ci] prepare for next development iteration 2020-06-24 16:28:36 +00:00
Travis CI User
4f517f9c41 [maven-release-plugin][skip ci] prepare release alfresco-repository-7.195 2020-06-24 16:28:29 +00:00
Ancuta Morarasu
187038d4ca ACS-370: Newer metadata-extractor - update components
- alfresco-data-model 8.50.17
2020-06-24 19:05:42 +03:00
Travis CI User
f189f71fb8 [maven-release-plugin][skip ci] prepare for next development iteration 2020-06-24 12:52:20 +00:00
Travis CI User
82425433c4 [maven-release-plugin][skip ci] prepare release 8.50.17 2020-06-24 12:52:13 +00:00
cturlica
0703d10899 ACS-370: Newer metadata-extractor 2020-06-24 15:46:55 +03:00
Travis CI User
5ffacd315e [maven-release-plugin][skip ci] prepare for next development iteration 2020-06-20 07:20:44 +00:00
Travis CI User
70ad374f8a [maven-release-plugin][skip ci] prepare release alfresco-remote-api-7.144 2020-06-20 07:20:37 +00:00
Travis CI User
88bec51910 [maven-release-plugin][skip ci] prepare for next development iteration 2020-06-20 07:17:51 +00:00
Travis CI User
fdce5a76ca [maven-release-plugin][skip ci] prepare release alfresco-repository-7.194 2020-06-20 07:17:44 +00:00
Cristian Turlica
93a4b9c0dd Updated alfresco-repository version to 7.193 2020-06-20 10:00:18 +03:00
Alan Davis
d123af8664 REPO-5215 Deprecated metadata extractors in 6.2.x (#1059)
These OOTB extractors / embedders are likely to be remove in a future release.
2020-06-19 16:52:37 +01:00
Travis CI User
2ef82ccc56 [maven-release-plugin][skip ci] prepare for next development iteration 2020-06-16 23:43:50 +00:00
Travis CI User
7a6beb433a [maven-release-plugin][skip ci] prepare release alfresco-repository-7.193 2020-06-16 23:43:42 +00:00
Alan Davis
257fa68432 Revert "REPO-4334 Move metadata extraction into T-Engines (#1015)"
This reverts commit 6f4ebcca3e.
2020-06-17 00:22:01 +01:00
Travis CI User
7c07b6c974 [maven-release-plugin][skip ci] prepare for next development iteration 2020-06-16 21:42:34 +00:00
Travis CI User
87ca3ac91a [maven-release-plugin][skip ci] prepare release alfresco-repository-7.192 2020-06-16 21:42:27 +00:00
Alan Davis
6f4ebcca3e REPO-4334 Move metadata extraction into T-Engines (#1015)
* ContentMetadataExtracter (the Action service Executer):
        * Code refactored so that post processing of extracted properties can be called after a
          transform has taken place in an async call. Previously done in the same Thread.
        * The source size is passed to the metadataExtracterRegistry as this is needed to select
          the transform.
        * Passes the source nodeRef to the metadataExtractor, so that it is possible to update
          the correct node after the async transform call.
    * AbstractMappingMetadataExtracter (the base class for all extractors):
        * Post extract processing extracted into separate methods.
        * NodeRef made available to sub classes.
    * AsynchronousExtractor (new metadata extractor and embedder) that will use
      a T-Engine.
    * Set targetExtension in transform for metadata extract and embed requests to T-Engines
      in both LocalTransforms (community) and RenditionEventProducer (enterprise).
    * RenditionService2Impl (used to request and respond to async transform requests).
        * Add consumeExtractedMetadata and consumeEmbeddedMetadata methods, which
          handle the response, normally be calling AsynchronousExtractor.
    * Discovered that the JodConverterMetadataExtracter was superseded by the
    * TikaPoweredMetadataExtracter for all the types that it support in 6.0.1 and could have been
      deprecated at that time as part of REPO-2910. It will now be deprecated so that it can be
      removed in 7.0.0.

Additional tests are being added to AsynchronousExtractorTest for overwritePolicy, enableStringTagging and carryAspectProperties in a separate PR, as these will cover tests at a likely to be removed when delete local extractors.

(cherry picked from commit 63ace3abd8)

Also pick up T-Engine 2.3.0
2020-06-16 22:16:56 +01:00
Travis CI User
eb1b7c320f [maven-release-plugin][skip ci] prepare for next development iteration 2020-06-12 11:05:43 +00:00
Travis CI User
cf476f4629 [maven-release-plugin][skip ci] prepare release alfresco-repository-7.191 2020-06-12 11:05:35 +00:00
Nebil Kisa
109e87f7af ACS-753: Update alfresco-transform-core from 2.2.1 to 2.2.2 (#1044)
Update of alfresco-transform-core from 2.2.1 to 2.2.2
2020-06-12 11:46:02 +01:00
Travis CI User
bc96fcb4e2 [maven-release-plugin][skip ci] prepare for next development iteration 2020-06-11 20:14:12 +00:00
Travis CI User
098ef5f8e9 [maven-release-plugin][skip ci] prepare release alfresco-remote-api-7.143 2020-06-11 20:14:05 +00:00
Jan Vonka
12d1f2f7fd Revert "ACS-254: Update internal REST fwk to support sub-relations"
This reverts commit 3e1d862c2d.
2020-06-11 20:56:01 +01:00
Jan Vonka
bc6dd55629 Revert "ACS-197 / ACS-207 : Add REST API for Version Renditions (#654)"
This reverts commit 670b4e6245.
2020-06-11 20:55:43 +01:00
Jan Vonka
d3d4f3bf35 Revert "ACS-295: Fix bug with new REST API for Version Renditions (#665)"
This reverts commit 70423195e9.
2020-06-11 20:55:34 +01:00
Travis CI User
e627010d1b [maven-release-plugin][skip ci] prepare for next development iteration 2020-06-11 09:49:53 +00:00
Travis CI User
4b82c70015 [maven-release-plugin][skip ci] prepare release alfresco-repository-7.190 2020-06-11 09:49:46 +00:00
Abdul Mohammed
5f1d7432ae Cherry-pick changes for MNT-21487 2020-06-11 10:29:23 +01:00
Travis CI User
251fb079a7 [maven-release-plugin][skip ci] prepare for next development iteration 2020-06-04 14:47:37 +00:00
Travis CI User
da57e725c0 [maven-release-plugin][skip ci] prepare release alfresco-remote-api-7.142 2020-06-04 14:47:30 +00:00
montgolfiere
70423195e9 ACS-295: Fix bug with new REST API for Version Renditions (#665)
* ACS-295: Fix bug with new REST API for Version Renditions

- also added test that fails before fix / succeeds after fix
- note: the issue existed in previous versions of Repo (but was never exposed) ...
- ...so needs to be handled for upgrades to 6.2.2 (+)

- see also ACS-197 / ACS-207

(cherry picked from commit fdfe20e442)
2020-06-04 15:29:35 +01:00
Travis CI User
90574ee73b [maven-release-plugin][skip ci] prepare for next development iteration 2020-06-03 08:04:39 +00:00
Travis CI User
2e412f2e59 [maven-release-plugin][skip ci] prepare release alfresco-remote-api-7.141 2020-06-03 08:04:32 +00:00
Cristian Turlica
5b3e93c077 ACS-284: AuthenticationUtil.runAs method should leave the security context as it found it 2020-06-03 10:48:03 +03:00
Travis CI User
2c9c91d7be [maven-release-plugin][skip ci] prepare for next development iteration 2020-06-03 07:38:30 +00:00
Travis CI User
b7479205d5 [maven-release-plugin][skip ci] prepare release alfresco-repository-7.189 2020-06-03 07:38:23 +00:00
Cristian Turlica
5238f1297c ACS-284: AuthenticationUtil.runAs method should leave the security context as it found it 2020-06-03 10:18:26 +03:00
Travis CI User
0632e1268e [maven-release-plugin][skip ci] prepare for next development iteration 2020-06-03 06:12:33 +00:00
Travis CI User
8e36d4f4c1 [maven-release-plugin][skip ci] prepare release 8.50.16 2020-06-03 06:12:26 +00:00
Cristian Turlica
99b92f67ee ACS-284: AuthenticationUtil.runAs method should leave the security context as it found it 2020-06-03 09:05:02 +03:00
Travis CI User
8f97585cb7 [maven-release-plugin][skip ci] prepare for next development iteration 2020-06-01 11:45:36 +00:00
Travis CI User
323f26850d [maven-release-plugin][skip ci] prepare release alfresco-remote-api-7.140 2020-06-01 11:45:28 +00:00
evasques
e667470f66 MNT-17907 Bump repo version (#662) 2020-06-01 12:27:45 +01:00
Travis CI User
90210bd532 [maven-release-plugin][skip ci] prepare for next development iteration 2020-06-01 09:04:20 +00:00
Travis CI User
afbc56e6e2 [maven-release-plugin][skip ci] prepare release alfresco-repository-7.188 2020-06-01 09:04:11 +00:00
evasques
0a39b667c8 MNT-17907 - cm:addressees label renamed to All Recipients (#1026)
* MNT-17907 - Change label of cm:addressee to All Recipients (#985)

* Fix for MNT-17907 in ALL 15 LANGUAGES (#1009)

Co-authored-by: Gloria Broadbent <gloria.broadbent@alfresco.com>
2020-06-01 09:41:40 +01:00
Travis CI User
2c1d7ac627 [maven-release-plugin][skip ci] prepare for next development iteration 2020-05-27 11:17:29 +00:00
Travis CI User
c081c3a420 [maven-release-plugin][skip ci] prepare release alfresco-remote-api-7.139 2020-05-27 11:17:22 +00:00
montgolfiere
670b4e6245 ACS-197 / ACS-207 : Add REST API for Version Renditions (#654)
* ACS-197 / ACS-207 : Add REST API for Version Renditions

- add four new endpoints for version-specific renditions and automated tests (+ve & -ve)

-- GET /nodes/{nodeId}/versions/{versionId}/renditions - List renditions for a version
-- POST /nodes/{nodeId}/versions/{versionId}/renditions - Create rendition for a version
-- GET /nodes/{nodeId}/versions/{versionId}/renditions/{renditionId} - Get rendition information for a version
-- GET /nodes/{nodeId}/versions/{versionId}/renditions/{renditionId}/content - Get rendition content for a version

- note: the RenditionsImpl implementation is also tested via RenditionsTest

(cherry picked from commit 5cd8899a52)
2020-05-27 11:43:27 +01:00
Travis CI User
700491d80a [maven-release-plugin][skip ci] prepare for next development iteration 2020-05-26 11:21:54 +00:00
Travis CI User
d161574edc [maven-release-plugin][skip ci] prepare release alfresco-remote-api-7.138 2020-05-26 11:21:47 +00:00
Jan Vonka
3e1d862c2d ACS-254: Update internal REST fwk to support sub-relations
- for example: /entities-a/{a-id}/relations-a-b/{b-id}/relations-b-c/...
- see also ACS-197, ACS-202, REPO-297

- cherry-pick from master
2020-05-26 12:05:39 +01:00
Travis CI User
c19f2d71f8 [maven-release-plugin][skip ci] prepare for next development iteration 2020-05-22 12:04:54 +00:00
Travis CI User
c1d2b84582 [maven-release-plugin][skip ci] prepare release alfresco-remote-api-7.137 2020-05-22 12:04:47 +00:00
evasques
c7d7bf9347 MNT-18308 - Bump repo version (#651) 2020-05-22 12:48:53 +01:00
Travis CI User
8b03573135 [maven-release-plugin][skip ci] prepare for next development iteration 2020-05-22 09:45:36 +00:00
Travis CI User
5759d76953 [maven-release-plugin][skip ci] prepare release alfresco-repository-7.187 2020-05-22 09:45:29 +00:00
evasques
70bad61905 MNT-18308 Force Async ACL Creation (#1008) 2020-05-22 10:22:25 +01:00
Travis CI User
fe4e738521 [maven-release-plugin][skip ci] prepare for next development iteration 2020-05-21 17:44:36 +00:00
Travis CI User
080787a3f2 [maven-release-plugin][skip ci] prepare release alfresco-remote-api-7.136 2020-05-21 17:44:29 +00:00
Mykhail DIachenko
2ed64c64db ACS-22: pick up upstream projects 2020-05-21 20:26:33 +03:00
Travis CI User
ff769bc6c7 [maven-release-plugin][skip ci] prepare for next development iteration 2020-05-20 23:08:55 +00:00
Travis CI User
2d6397c367 [maven-release-plugin][skip ci] prepare release alfresco-remote-api-7.135 2020-05-20 23:08:48 +00:00
Jared Ottley
d56e81154c [MNT-21363][MNT-21511] Create Site fails with Kerb SSO in 6.2 (#647)
- Add catch for exception thrown when there is no web script found in the Public API Web Script Container
2020-05-20 16:51:02 -06:00
Travis CI User
8329ef8cc8 [maven-release-plugin][skip ci] prepare for next development iteration 2020-05-15 11:42:15 +00:00
Travis CI User
1cc88ff688 [maven-release-plugin][skip ci] prepare release alfresco-repository-7.186 2020-05-15 11:42:07 +00:00
Mykhail-Diachenko
a1a00c8bb1 ACS-22: code enhance (#994)
* * ACS-22: changed naming in ticket related cache components

(cherry picked from commit cc9e78f152)
2020-05-15 14:20:29 +03:00
Travis CI User
933d0505d7 [maven-release-plugin][skip ci] prepare for next development iteration 2020-05-15 10:46:18 +00:00
Travis CI User
86d8739af2 [maven-release-plugin][skip ci] prepare release 8.50.15 2020-05-15 10:46:11 +00:00
Mykhail-Diachenko
38c07132e5 ACS-22: Enhance code of InMemoryTicketComponentImpl (#251)
* ACS-22: Enhance code of InMemoryTicketComponentImpl (#248)

(cherry picked from commit 86af3e0a1f)
2020-05-15 13:41:09 +03:00
Travis CI User
b3a3b76112 [maven-release-plugin][skip ci] prepare for next development iteration 2020-05-06 19:27:45 +00:00
Travis CI User
a90529b8fc [maven-release-plugin][skip ci] prepare release alfresco-remote-api-7.134 2020-05-06 19:27:38 +00:00
Cristian Turlica
332fed005f ACS-125: Update spring version to 5.1.15 (#637) 2020-05-06 22:11:28 +03:00
Travis CI User
e0050d99f1 [maven-release-plugin][skip ci] prepare for next development iteration 2020-05-06 18:46:23 +00:00
Travis CI User
46ac5eaaa1 [maven-release-plugin][skip ci] prepare release alfresco-repository-7.185 2020-05-06 18:46:15 +00:00
Cristian Turlica
489bf035de ACS-125: Update spring version to 5.1.15 (#981) 2020-05-06 21:24:27 +03:00
Travis CI User
574fa342f1 [maven-release-plugin][skip ci] prepare for next development iteration 2020-05-06 18:19:21 +00:00
Travis CI User
b90d617c15 [maven-release-plugin][skip ci] prepare for next development iteration 2020-05-06 17:59:42 +00:00
Travis CI User
ef5eb81c8a [maven-release-plugin][skip ci] prepare for next development iteration 2020-05-06 16:55:16 +00:00
Travis CI User
d8c415e74a [maven-release-plugin][skip ci] prepare release alfresco-repository-7.184 2020-05-06 16:55:09 +00:00
Alan Davis
fea086de8d Increment version.schema to 13005 for ACS 6.2.2 (4 more than 6.2.1) 2020-05-06 17:35:05 +01:00
161 changed files with 2781 additions and 1567 deletions

View File

@@ -80,14 +80,14 @@ jobs:
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.4
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.3.5
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/
- name: "Repository - AppContext04TestSuite"
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.4
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.3.5
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"
@@ -104,7 +104,7 @@ jobs:
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.4
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.3.5
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/
- name: "Repository - AppContextExtraTestSuite"
@@ -117,7 +117,7 @@ jobs:
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.4
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.3.5
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/
- name: "Repository - MySQL tests"

View File

@@ -1,42 +0,0 @@
### Alfresco Core
[![Build Status](https://travis-ci.com/Alfresco/alfresco-core.svg?branch=master)](https://travis-ci.com/Alfresco/alfresco-core)
Alfresco Core is a library packaged as a jar file which is part of [Alfresco Content Services Repository](https://community.alfresco.com/docs/DOC-6385-project-overview-repository).
The library contains the following:
* Various helpers and utils
* Canned queries interface and supporting classes
* Generic encryption supporting classes
Version 7 of the library uses Spring 5, Quartz 2.3 and does not have Hibernate dependency.
### Building and testing
The project can be built and tested by running Maven command:
~~~
mvn clean install
~~~
### Artifacts
The artifacts can be obtained by:
* downloading from [Alfresco repository](https://artifacts.alfresco.com/nexus/content/groups/public)
* getting as Maven dependency by adding the dependency to your pom file:
~~~
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-core</artifactId>
<version>version</version>
</dependency>
~~~
and Alfresco repository:
~~~
<repository>
<id>alfresco-maven-repo</id>
<url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
</repository>
~~~
The SNAPSHOT version of the artifact is **never** published.
### Old version history
The history for older versions can be found in [Alfresco SVN](https://svn.alfresco.com/repos/alfresco-open-mirror/services/alfresco-core/)
### Contributing guide
Please use [this guide](CONTRIBUTING.md) to make a contribution to the project.

View File

@@ -7,18 +7,13 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>7.183.300-TEST1</version>
<version>7.302</version>
</parent>
<properties>
<dependency.org-json.version>20160212</dependency.org-json.version>
</properties>
<dependencies>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.14</version>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
@@ -27,12 +22,10 @@
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
@@ -53,12 +46,10 @@
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20160212</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${dependency.spring.version}</version>
<!-- exclude spring-jcl which is brought in by spring-core -->
<!-- see https://issues.alfresco.com/jira/browse/REPO-4774 -->
<exclusions>
@@ -71,12 +62,10 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${dependency.spring.version}</version>
</dependency>
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
<version>2.3.2</version>
<!-- exclude c3p0 -->
<!-- see https://issues.alfresco.com/jira/browse/REPO-3447 -->
<exclusions>
@@ -89,7 +78,6 @@
<dependency>
<groupId>org.alfresco.surf</groupId>
<artifactId>spring-surf-core-configservice</artifactId>
<version>${dependency.webscripts.version}</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
@@ -99,7 +87,6 @@
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.3.2</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
@@ -119,14 +106,12 @@
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.10.5</version>
</dependency>
<!-- provided dependencies -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
@@ -139,19 +124,16 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.2.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4-DBCP330</version>
<scope>test</scope>
</dependency>
</dependencies>

View File

@@ -322,7 +322,7 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
try
{
keyInfoManager = getKeyInfoManager(getKeyMetaDataFileLocation());
keyInfoManager = getKeyInfoManager(getKeyStoreParameters());
KeyStore ks = loadKeyStore(keyStoreParameters, keyInfoManager);
logger.debug("Initializing key managers");
@@ -355,7 +355,7 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
try
{
keyInfoManager = getKeyInfoManager(getKeyMetaDataFileLocation());
keyInfoManager = getKeyInfoManager(getKeyStoreParameters());
KeyStore ks = loadKeyStore(getKeyStoreParameters(), keyInfoManager);
logger.debug("Initializing trust managers");
@@ -376,12 +376,7 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
}
}
}
protected String getKeyMetaDataFileLocation()
{
return keyStoreParameters.getKeyMetaDataFileLocation();
}
protected InputStream getKeyStoreStream(String location) throws FileNotFoundException
{
if(location == null)
@@ -396,9 +391,17 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
return new FileOutputStream(getKeyStoreParameters().getLocation());
}
protected KeyInfoManager getKeyInfoManager(String metadataFileLocation) throws FileNotFoundException, IOException
protected KeyInfoManager getKeyInfoManager(KeyStoreParameters keyStoreParameters) throws IOException
{
return new KeyInfoManager(metadataFileLocation, keyResourceLoader);
return new KeyInfoManager(keyStoreParameters, keyResourceLoader);
}
@Deprecated
protected KeyInfoManager getKeyInfoManager(String metadataFileLocation) throws IOException
{
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
keyStoreParameters.setKeyMetaDataFileLocation(metadataFileLocation);
return new KeyInfoManager(keyStoreParameters, keyResourceLoader);
}
protected KeyMap cacheKeys(KeyStore ks, KeyInfoManager keyInfoManager)
@@ -563,7 +566,7 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
try
{
keyInfoManager = getKeyInfoManager(keyStoreParameters.getKeyMetaDataFileLocation());
keyInfoManager = getKeyInfoManager(keyStoreParameters);
ks = loadKeyStore(keyStoreParameters, keyInfoManager);
// Loaded
}
@@ -635,7 +638,7 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
try
{
keyInfoManager = getKeyInfoManager(getKeyMetaDataFileLocation());
keyInfoManager = getKeyInfoManager(getKeyStoreParameters());
Key key = getSecretKey(keyInfoManager.getKeyInformation(keyAlias));
encryptionKeysRegistry.registerKey(keyAlias, key);
keys.setKey(keyAlias, key);
@@ -678,7 +681,7 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
{
if(!keyStoreExists(keyStoreParameters.getLocation()))
{
keyInfoManager = getKeyInfoManager(keyStoreParameters.getKeyMetaDataFileLocation());
keyInfoManager = getKeyInfoManager(keyStoreParameters);
KeyStore ks = initialiseKeyStore(keyStoreParameters.getType(), keyStoreParameters.getProvider());
String keyStorePassword = keyInfoManager.getKeyStorePassword();
@@ -686,7 +689,7 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
{
throw new AlfrescoRuntimeException("Key store password is null for keystore at location "
+ getKeyStoreParameters().getLocation()
+ ", key store meta data location" + getKeyMetaDataFileLocation());
+ ". Either specify it as a JVM property or in key store meta data location.");
}
for(String keyAlias : keys.getKeyAliases())
@@ -765,8 +768,13 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
}
}
protected Key getSecretKey(KeyInformation keyInformation) throws NoSuchAlgorithmException, InvalidKeyException, InvalidKeySpecException
protected Key getSecretKey(KeyInformation keyInformation) throws AlfrescoRuntimeException, NoSuchAlgorithmException, InvalidKeyException, InvalidKeySpecException
{
if (keyInformation == null)
{
throw new AlfrescoRuntimeException("Unable to get secret key: no key information is provided");
}
byte[] keyData = keyInformation.getKeyData();
if(keyData == null)
@@ -796,7 +804,7 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
writeLock.lock();
try
{
keyInfoManager = getKeyInfoManager(getKeyMetaDataFileLocation());
keyInfoManager = getKeyInfoManager(getKeyStoreParameters());
KeyStore ks = loadKeyStore(getKeyStoreParameters(), keyInfoManager);
// loading Key
@@ -985,7 +993,7 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
public static class KeyInfoManager
{
private KeyResourceLoader keyResourceLoader;
private String metadataFileLocation;
private KeyStoreParameters keyStoreParameters;
private Properties keyProps;
private String keyStorePassword = null;
private Map<String, KeyInformation> keyInfo;
@@ -1005,10 +1013,10 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
}
}
KeyInfoManager(String metadataFileLocation, KeyResourceLoader keyResourceLoader) throws IOException, FileNotFoundException
KeyInfoManager(KeyStoreParameters keyStoreParameters, KeyResourceLoader keyResourceLoader) throws IOException, FileNotFoundException
{
this.keyResourceLoader = keyResourceLoader;
this.metadataFileLocation = metadataFileLocation;
this.keyStoreParameters = keyStoreParameters;
keyInfo = new HashMap<String, KeyInformation>(2);
loadKeyMetaData();
}
@@ -1025,31 +1033,73 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
* Where required, <tt>null</tt> values must be inserted into the map to indicate the presence
* of a key that is not protected by a password. They entry for {@link #KEY_KEYSTORE_PASSWORD}
* is required if the keystore is password protected.
*
* WARNING. Storing passwords (keyMetaDataFileLocation) on the file system is not following best security practices.
*
* <p/>Loading of keys info from system (JVM) properties takes precedence over metadata file.
* <p/>Set the unique ID of the keystore and remove the metadata file location property to use JVM properties lookup instead. The property lookup format is the following:
* <ul>
* <li>[keystore-id].password - keystore password</li>
* <li>[keystore-id].aliases - comma separated list of aliases for the keys in the keystore</li>
* <li>[keystore-id].[alias].keyData - key data bytes in base64</li>
* <li>[keystore-id].[alias].algorithm - key algorithm</li>
* <li>[keystore-id].[alias].password - key password</li>
* </ul>
*
*/
protected void loadKeyMetaData() throws IOException, FileNotFoundException
{
keyProps = keyResourceLoader.loadKeyMetaData(metadataFileLocation);
if(keyProps != null)
if (keyStoreParameters.getId() != null &&
(keyStoreParameters.getKeyMetaDataFileLocation() == null ||
keyStoreParameters.getKeyMetaDataFileLocation().isEmpty()))
{
String aliases = keyProps.getProperty("aliases");
if(aliases == null)
Properties jvmProperties = System.getProperties();
keyStorePassword = jvmProperties.getProperty(keyStoreParameters.getId() + ".password");
String aliases = jvmProperties.getProperty(keyStoreParameters.getId() + ".aliases");
if (aliases == null || aliases.isEmpty())
{
throw new AlfrescoRuntimeException("Passwords file must contain an aliases key");
logger.warn("No aliases were specified for " + keyStoreParameters.getId()
+ " keystore");
}
this.keyStorePassword = keyProps.getProperty(KEY_KEYSTORE_PASSWORD);
StringTokenizer st = new StringTokenizer(aliases, ",");
while(st.hasMoreTokens())
else
{
String keyAlias = st.nextToken();
keyInfo.put(keyAlias, loadKeyInformation(keyAlias));
StringTokenizer st = new StringTokenizer(aliases, ",");
while(st.hasMoreTokens())
{
String keyAlias = st.nextToken();
keyInfo.put(keyAlias, loadKeyInformation(jvmProperties, keyAlias, keyStoreParameters.getId() + "."));
}
}
}
else
{
// TODO
//throw new FileNotFoundException("Cannot find key metadata file " + getKeyMetaDataFileLocation());
logger.warn("Storing passwords (" + keyStoreParameters.getKeyMetaDataFileLocation()
+ ") on the file system is not following best security practices." +
" Please refer to documentation and use JVM properties instead");
keyProps = keyResourceLoader.loadKeyMetaData(keyStoreParameters.getKeyMetaDataFileLocation());
if(keyProps != null)
{
String aliases = keyProps.getProperty("aliases");
if(aliases == null)
{
throw new AlfrescoRuntimeException("Passwords file must contain an aliases key");
}
this.keyStorePassword = keyProps.getProperty(KEY_KEYSTORE_PASSWORD);
StringTokenizer st = new StringTokenizer(aliases, ",");
while(st.hasMoreTokens())
{
String keyAlias = st.nextToken();
keyInfo.put(keyAlias, loadKeyInformation(keyProps, keyAlias, ""));
}
}
else
{
// TODO
//throw new FileNotFoundException("Cannot find key metadata file " + getKeyMetaDataFileLocation());
}
}
}
@@ -1067,11 +1117,11 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
this.keyProps.remove(keyAlias);
}
protected KeyInformation loadKeyInformation(String keyAlias)
protected KeyInformation loadKeyInformation(Properties keyProps, String keyAlias, String prefix)
{
String keyPassword = keyProps.getProperty(keyAlias + ".password");
String keyData = keyProps.getProperty(keyAlias + ".keyData");
String keyAlgorithm = keyProps.getProperty(keyAlias + ".algorithm");
String keyPassword = keyProps.getProperty(prefix + keyAlias + ".password");
String keyData = keyProps.getProperty(prefix + keyAlias + ".keyData");
String keyAlgorithm = keyProps.getProperty(prefix + keyAlias + ".algorithm");
byte[] keyDataBytes = null;
if(keyData != null && !keyData.equals(""))

View File

@@ -22,12 +22,15 @@ import org.alfresco.util.PropertyCheck;
/**
* Stores Java keystore initialisation parameters.
*
*
* WARNING. Storing passwords (keyMetaDataFileLocation) on the file system is not following best security practices.
*
* @since 4.0
*
*/
public class KeyStoreParameters
{
private String id;
private String name;
private String type;
private String provider;
@@ -38,8 +41,40 @@ public class KeyStoreParameters
{
}
public KeyStoreParameters(String name, String type, String keyStoreProvider,
/**
* WARNING. Storing passwords (keyMetaDataFileLocation) on the file system is not following best security practices.
*
* <p/>Set the unique ID of the keystore and aliases to use Java system properties lookup instead. The property lookup format is:
* <ul>
* <li>[keystore-id].password - keystore password</li>
* <li>[keystore-id].aliases - comma separated list of aliases for the keys in the keystore</li>
* <li>[keystore-id].[alias].keydata - key data bytes in base64</li>
* <li>[keystore-id].[alias].algorithm - key algorithm</li>
* <li>[keystore-id].[alias].password - key password</li>
* </ul>
*
* Loading of keys info from system (JVM) properties takes precedence over metadata file.
*
* @param id unique identifier of the keystore
* @param name human readable name of the keystore
* @param type type of the keystore
* @param keyStoreProvider keystore provider
* @param keyMetaDataFileLocation path to keystore metadata file on the file system
* @param location path to keystore on the file system
*/
public KeyStoreParameters(String id, String name, String type, String keyStoreProvider,
String keyMetaDataFileLocation, String location)
{
this(name, type, keyStoreProvider, keyMetaDataFileLocation, location);
this.id = id;
}
/**
* Use {@link #KeyStoreParameters(String, String, String, String, String, String)} instead
*/
@Deprecated()
public KeyStoreParameters(String name, String type, String keyStoreProvider,
String keyMetaDataFileLocation, String location)
{
super();
this.name = name;
@@ -49,8 +84,13 @@ public class KeyStoreParameters
this.location = location;
}
public void init()
{
if (!PropertyCheck.isValidPropertyString(getId()))
{
setId(null);
}
if (!PropertyCheck.isValidPropertyString(getLocation()))
{
setLocation(null);
@@ -69,6 +109,11 @@ public class KeyStoreParameters
}
}
public String getId()
{
return id;
}
public String getName()
{
return name;
@@ -93,7 +138,12 @@ public class KeyStoreParameters
{
return location;
}
public void setId(String id)
{
this.id = id;
}
public void setName(String name)
{
this.name = name;

View File

@@ -0,0 +1,388 @@
/*
* Copyright (C) 2005-2020 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.encryption;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import org.alfresco.error.AlfrescoRuntimeException;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestName;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
@RunWith(MockitoJUnitRunner.class)
public class AlfrescoKeyStoreTest
{
@Mock
private EncryptionKeysRegistry encryptionKeysRegistry;
@Rule
public TestName testName = new TestName();
@Test
public void testSysPropConfig()
{
String keyStoreId = testName.getMethodName() + "-keystore";
String alias1 = "mykey1";
String alias2 = "mykey2";
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
keyStoreParameters.setId(keyStoreId);
keyStoreParameters.setName(testName.getMethodName());
keyStoreParameters.setType("JCEKS");
keyStoreParameters.setProvider("SunJCE");
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-2.jks");
System.setProperty(keyStoreId + "." + "password", "ksPwd2");
System.setProperty(keyStoreId + "." + "aliases", alias1 + "," + alias2);
System.setProperty(keyStoreId + "." + alias1 + "." + "password", "aliasPwd1");
System.setProperty(keyStoreId + "." + alias2 + "." + "password", "aliasPwd2");
try
{
AlfrescoKeyStore alfrescoKeyStore = new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
Set<String> expectedAliases = new HashSet<>();
expectedAliases.add(alias1);
expectedAliases.add(alias2);
Assert.assertEquals("The aliases are not correct", expectedAliases, alfrescoKeyStore.getKeyAliases());
Assert.assertNotNull("Failed to retrieve a key from keystore.", alfrescoKeyStore.getKey(alias1));
Assert.assertNotNull("Failed to retrieve a key from keystore.", alfrescoKeyStore.getKey(alias2));
}
finally
{
System.clearProperty(keyStoreId + "." + "password");
System.clearProperty(keyStoreId + "." + "aliases");
System.clearProperty(keyStoreId + "." + alias1 + "." + "password");
System.clearProperty(keyStoreId + "." + alias2 + "." + "password");
}
}
@Test
public void testSysPropConfigWithoutAliases()
{
String keyStoreId = testName.getMethodName() + "-keystore";
String alias1 = "mykey1";
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
keyStoreParameters.setId(keyStoreId);
keyStoreParameters.setName(testName.getMethodName());
keyStoreParameters.setType("JCEKS");
keyStoreParameters.setProvider("SunJCE");
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-1.jks");
System.setProperty(keyStoreId + "." + "password", "ksPwd1");
System.setProperty(keyStoreId + "." + alias1 + "." + "password", "aliasPwd1");
try
{
AlfrescoKeyStore keyStore = new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
Assert.assertNull(keyStore.getKey(alias1));
}
finally
{
System.clearProperty(keyStoreId + "." + "password");
System.clearProperty(keyStoreId + "." + alias1 + "." + "password");
}
}
@Test
public void testMetaDataFileConfig()
{
String alias1 = "mykey1";
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
keyStoreParameters.setName(testName.getMethodName());
keyStoreParameters.setType("JCEKS");
keyStoreParameters.setProvider("SunJCE");
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-1.jks");
keyStoreParameters.setKeyMetaDataFileLocation("classpath:keystore-tests/ks1-metadata.properties");
AlfrescoKeyStore alfrescoKeyStore = new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
Set<String> expectedAliases = new HashSet<>();
expectedAliases.add(alias1);
Assert.assertEquals("The aliases are not correct", expectedAliases, alfrescoKeyStore.getKeyAliases());
Assert.assertNotNull("Failed to retrieve a key from keystore.", alfrescoKeyStore.getKey(alias1));
}
/**
* Config via System props should be default, but if the metadata file location is set, it will be used instead.
* This is done to maintain backwards compatibility and simplify testing use cases.
*/
@Test(expected = AlfrescoRuntimeException.class)
public void testConfigBothSystemAndFile()
{
String keyStoreId = testName.getMethodName() + "-keystore";
String alias1 = "mykey1";
String alias2 = "mykey2";
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
keyStoreParameters.setId(keyStoreId);
keyStoreParameters.setName(testName.getMethodName());
keyStoreParameters.setType("JCEKS");
keyStoreParameters.setProvider("SunJCE");
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-2.jks");
// use metadata file from keystore with one key
keyStoreParameters.setKeyMetaDataFileLocation("classpath:keystore-tests/ks1-metadata.properties");
System.setProperty(keyStoreId + "." + "password", "ksPwd2");
System.setProperty(keyStoreId + "." + "aliases", alias1 + "," + alias2);
System.setProperty(keyStoreId + "." + alias1 + "." + "password", "aliasPwd1");
System.setProperty(keyStoreId + "." + alias2 + "." + "password", "aliasPwd2");
try
{
new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
}
finally
{
System.clearProperty(keyStoreId + "." + "password");
System.clearProperty(keyStoreId + "." + "aliases");
System.clearProperty(keyStoreId + "." + alias1 + "." + "password");
System.clearProperty(keyStoreId + "." + alias2 + "." + "password");
}
}
@Test(expected = AlfrescoRuntimeException.class)
public void testValidateKeysWrongAliasMetadataFile() throws Exception
{
String alias1 = "mykey1";
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
keyStoreParameters.setName(testName.getMethodName());
keyStoreParameters.setType("JCEKS");
keyStoreParameters.setProvider("SunJCE");
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-1.jks");
keyStoreParameters.setKeyMetaDataFileLocation("classpath:keystore-tests/wrong-alias-metadata.properties");
AlfrescoKeyStoreImpl alfrescoKeyStore = new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
alfrescoKeyStore.setKeysToValidate(Collections.singleton(alias1));
alfrescoKeyStore.setValidateKeyChanges(true);
alfrescoKeyStore.setEncryptionKeysRegistry(encryptionKeysRegistry);
alfrescoKeyStore.validateKeys();
}
@Test
public void testEmptyKeysMetadataFile()
{
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
keyStoreParameters.setName(testName.getMethodName());
keyStoreParameters.setType("JCEKS");
keyStoreParameters.setProvider("SunJCE");
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-1.jks");
keyStoreParameters.setKeyMetaDataFileLocation("classpath:keystore-tests/empty-alias-metadata.properties");
new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
}
@Test(expected = AlfrescoRuntimeException.class)
public void testWrongKeystorePasswordMetadataFile()
{
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
keyStoreParameters.setName(testName.getMethodName());
keyStoreParameters.setType("JCEKS");
keyStoreParameters.setProvider("SunJCE");
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-1.jks");
keyStoreParameters.setKeyMetaDataFileLocation("classpath:keystore-tests/wrong-keystore-password-metadata.properties");
new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
}
@Test(expected = AlfrescoRuntimeException.class)
public void testWrongKeyPasswordMetadataFile()
{
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
keyStoreParameters.setName(testName.getMethodName());
keyStoreParameters.setType("JCEKS");
keyStoreParameters.setProvider("SunJCE");
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-1.jks");
keyStoreParameters.setKeyMetaDataFileLocation("classpath:keystore-tests/wrong-key-password-metadata.properties");
new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
}
@Test(expected = AlfrescoRuntimeException.class)
public void testValidateKeysWrongAliasSysProps() throws Exception
{
String keyStoreId = testName.getMethodName() + "-keystore";
String alias1 = "mykey1";
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
keyStoreParameters.setId(keyStoreId);
keyStoreParameters.setName(testName.getMethodName());
keyStoreParameters.setType("JCEKS");
keyStoreParameters.setProvider("SunJCE");
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-1.jks");
System.setProperty(keyStoreId + "." + "aliases", "wrong-alias,another-wrong-alias");
System.setProperty(keyStoreId + "." + "password", "ksPwd1");
System.setProperty(keyStoreId + "." + alias1 + "." + "password", "aliasPwd1");
try
{
AlfrescoKeyStoreImpl alfrescoKeyStore = new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
alfrescoKeyStore.setValidateKeyChanges(true);
alfrescoKeyStore.setKeysToValidate(Collections.singleton(alias1));
alfrescoKeyStore.setEncryptionKeysRegistry(encryptionKeysRegistry);
alfrescoKeyStore.validateKeys();
}
finally
{
System.clearProperty(keyStoreId + "." + "aliases");
System.clearProperty(keyStoreId + "." + "password");
System.clearProperty(keyStoreId + "." + alias1 + "." + "password");
}
}
@Test
public void testEmptyKeysSysProps()
{
String keyStoreId = testName.getMethodName() + "-keystore";
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
keyStoreParameters.setId(keyStoreId);
keyStoreParameters.setName(testName.getMethodName());
keyStoreParameters.setType("JCEKS");
keyStoreParameters.setProvider("SunJCE");
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-1.jks");
System.setProperty(keyStoreId + "." + "aliases", "empty-alias,another-empty-alias");
System.setProperty(keyStoreId + "." + "password", "ksPwd1");
try
{
new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
}
finally
{
System.clearProperty(keyStoreId + "." + "aliases");
System.clearProperty(keyStoreId + "." + "password");
}
}
@Test(expected = AlfrescoRuntimeException.class)
public void testWrongKeystorePasswordSysProps()
{
String keyStoreId = testName.getMethodName() + "-keystore";
String alias1 = "mykey1";
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
keyStoreParameters.setId(keyStoreId);
keyStoreParameters.setName(testName.getMethodName());
keyStoreParameters.setType("JCEKS");
keyStoreParameters.setProvider("SunJCE");
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-1.jks");
System.setProperty(keyStoreId + "." + "aliases", alias1);
System.setProperty(keyStoreId + "." + "password", "wrong-password");
System.setProperty(keyStoreId + "." + alias1 + "." + "password", "aliasPwd1");
try
{
new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
}
finally
{
System.clearProperty(keyStoreId + "." + "aliases");
System.clearProperty(keyStoreId + "." + "password");
System.clearProperty(keyStoreId + "." + alias1 + "." + "password");
}
}
@Test(expected = AlfrescoRuntimeException.class)
public void testWrongKeyPasswordSysProps()
{
String keyStoreId = testName.getMethodName() + "-keystore";
String alias1 = "mykey1";
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
keyStoreParameters.setId(keyStoreId);
keyStoreParameters.setName(testName.getMethodName());
keyStoreParameters.setType("JCEKS");
keyStoreParameters.setProvider("SunJCE");
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-1.jks");
System.setProperty(keyStoreId + "." + "aliases", alias1);
System.setProperty(keyStoreId + "." + "password", "ksPwd1");
System.setProperty(keyStoreId + "." + alias1 + "." + "password", "wrong-key-password");
try
{
new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
}
finally
{
System.clearProperty(keyStoreId + "." + "aliases");
System.clearProperty(keyStoreId + "." + "password");
System.clearProperty(keyStoreId + "." + alias1 + "." + "password");
}
}
/**
* No exception is expected. An empty keystore can be created.
*/
@Test
public void testConfigEmptyKeystore()
{
String keyStoreId = testName.getMethodName() + "-keystore";
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
keyStoreParameters.setId(keyStoreId);
keyStoreParameters.setName(testName.getMethodName());
keyStoreParameters.setType("JCEKS");
keyStoreParameters.setProvider("SunJCE");
keyStoreParameters.setLocation("classpath:non-existing-path/some-keystore.jks");
new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
}
@Test(expected = AlfrescoRuntimeException.class)
public void testValidateKeysEmptyAliasSysProps() throws Exception
{
String keyStoreId = testName.getMethodName() + "-keystore";
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
keyStoreParameters.setId(keyStoreId);
keyStoreParameters.setName(testName.getMethodName());
keyStoreParameters.setType("JCEKS");
keyStoreParameters.setProvider("SunJCE");
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-1.jks");
System.setProperty(keyStoreId + "." + "password", "ksPwd1");
try
{
AlfrescoKeyStoreImpl alfrescoKeyStore = new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
alfrescoKeyStore.setValidateKeyChanges(true);
alfrescoKeyStore.setKeysToValidate(Collections.singleton("non-existing-alias"));
alfrescoKeyStore.setEncryptionKeysRegistry(encryptionKeysRegistry);
alfrescoKeyStore.validateKeys();
}
finally
{
System.clearProperty(keyStoreId + "." + "password");
}
}
}

View File

@@ -0,0 +1,2 @@
aliases=empty-alias
keystore.password=ksPwd1

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,3 @@
aliases=mykey1
keystore.password=ksPwd1
mykey1.password=aliasPwd1

View File

@@ -0,0 +1,24 @@
The keystores contained in this folder are used by tests.
==================
== ks-test-1.ks ==
==================
Keystore password: ksPwd1
Keystore type: JCEKS
Keystore provider: SunJCE
Your keystore contains 1 entry
mykey1: aliasPwd1
==================
== ks-test-2.ks ==
==================
Keystore password: ksPwd2
Keystore type: JCEKS
Keystore provider: SunJCE
Your keystore contains 2 entries
mykey1: aliasPwd1
mykey2: aliasPwd2

View File

@@ -0,0 +1,3 @@
aliases=non-existing-alias
keystore.password=ksPwd1
mykey1.password=aliasPwd1

View File

@@ -0,0 +1,3 @@
aliases=mykey1
keystore.password=ksPwd1
mykey1.password=wrong-key-password

View File

@@ -0,0 +1,3 @@
aliases=mykey1
keystore.password=wrong-password
mykey1.password=aliasPwd1

View File

@@ -1,47 +0,0 @@
### Alfresco Data Model
[![Build Status](https://travis-ci.com/Alfresco/alfresco-data-model.svg?branch=master)](https://travis-ci.com/Alfresco/alfresco-data-model)
Data model is a library packaged as a jar file which is part of [Alfresco Content Services Repository](https://community.alfresco.com/docs/DOC-6385-project-overview-repository).
The library contains the following:
* Dictionary, Repository and Search Services interfaces
* Models for data types and Dictionary implementation
* Parsers
Please note that the data model uses version 2 of the Jackson libraries.
The upgrade from version 1 was not backward compatible, any projects
that are dependent on data model using Jackson 1.x should use the data-model 6.N branch.
Version 8.0 of data-model depends on alfresco-core 7.0 which is based on Spring 5.
### Building and testing
The project can be built and tested by running Maven command:
~~~
mvn clean install
~~~
### Artifacts
The artifacts can be obtained by:
* downloading from [Alfresco repository](https://artifacts.alfresco.com/nexus/content/groups/public)
* getting as Maven dependency by adding the dependency to your pom file:
~~~
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-data-model</artifactId>
<version>version</version>
</dependency>
~~~
and Alfresco repository:
~~~
<repository>
<id>alfresco-maven-repo</id>
<url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
</repository>
~~~
The SNAPSHOT version of the artifact is **never** published.
### Old version history
The history for older versions can be found in [Alfresco SVN](https://svn.alfresco.com/repos/alfresco-open-mirror/alfresco/HEAD/root/projects/data-model)
### Contributing guide
Please use [this guide](CONTRIBUTING.md) to make a contribution to the project.

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>7.183.300-TEST1</version>
<version>7.302</version>
</parent>
<properties>
@@ -133,7 +133,6 @@
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<!--
@@ -147,8 +146,7 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.10.2</version>
</dependency>
</dependency>
<dependency>
<groupId>org.antlr</groupId>
@@ -194,7 +192,6 @@
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.12.0-alfresco-patched-20191004</version>
</dependency>
<!-- Tika -->
<dependency>
@@ -226,19 +223,16 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>gunit</artifactId>
<version>3.5.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.2.4</version>
<scope>test</scope>
</dependency>
</dependencies>

View File

@@ -618,7 +618,13 @@ public class AuthenticationUtil implements InitializingBean
{
if (originalFullAuthentication == null)
{
AuthenticationUtil.clearCurrentSecurityContext();
if (logger.isTraceEnabled())
{
logger.trace("Removing the current security information for thread: " + Thread.currentThread().getName());
}
ContextHolder.setContext(null);
TenantContextHolder.clearTenantDomain();
logNDC(null);
}
else

View File

@@ -37,7 +37,6 @@ import org.alfresco.repo.cache.SimpleCache;
import org.alfresco.service.cmr.repository.datatype.Duration;
import org.alfresco.util.GUID;
import org.apache.commons.codec.binary.Hex;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.safehaus.uuid.UUIDGenerator;
@@ -63,7 +62,7 @@ public class InMemoryTicketComponentImpl implements TicketComponent
private boolean oneOff;
private String guid;
private SimpleCache<String, Ticket> ticketsCache; // Can't use Ticket as it's private
private SimpleCache<String, String> usernameKey;
private SimpleCache<String, String> usernameToTicketIdCache;
private ExpiryMode expiryMode = ExpiryMode.AFTER_INACTIVITY;
private boolean useSingleTicketPerUser = true;
@@ -85,10 +84,10 @@ public class InMemoryTicketComponentImpl implements TicketComponent
}
/**
* Set the usernameKey cache as secondary map for supporting cache clustering
* Set the usernameToTicketIdCache as secondary map for supporting cache clustering
*/
public void setUsernameKey (SimpleCache<String, String> usernameKey) {
this.usernameKey = usernameKey;
public void setUsernameToTicketIdCache (SimpleCache<String, String> usernameToTicketIdCache) {
this.usernameToTicketIdCache = usernameToTicketIdCache;
}
/**
@@ -146,55 +145,55 @@ public class InMemoryTicketComponentImpl implements TicketComponent
}
/**
* All put operations into ticketsCache should go through this method,
* All put operations into ticketsCache and usernameToTicketIdCache should go through this method,
* so we can debug/trace ticket problems easier from the logs
*/
private void putTicketIntoTicketsCache(Ticket ticket)
private void putIntoCache (Ticket ticket)
{
if (logger.isTraceEnabled())
{
logger.trace("Putting into ticketsCache " + ticketsCache.toString() + " ticket: " + ticket);
}
ticketsCache.put(ticket.getTicketId(), ticket);
}
/**
* All put operations into usernameKey cache should go through this method,
* so we can debug/trace problems easier from the logs
*/
private void putTicketIntoUsernameKeyCache (Ticket ticket)
{
if (logger.isTraceEnabled())
{
logger.trace("Putting into usernameKey " + usernameKey.toString() + " username and key of ticket: " + ticket);
logger.trace("Putting into usernameToTicketIdCache " + usernameToTicketIdCache.toString() + " username and ticketId of: " + ticket);
}
usernameKey.put(ticket.getUserName(), ticket.getTicketId());
usernameToTicketIdCache.put(ticket.getUserName(), ticket.getTicketId());
}
/**
* All remove operations from ticketsCache should go through this method,
* All remove operations from ticketsCache and usernameToTicketIdCache should go through this method,
* so we can debug/trace ticket problems easier from the logs
*/
private void removeTicketFromTicketsCache(String ticketId)
private void removeFromCache (String ticketId)
{
Ticket ticket = null;
if(ticketId != null)
{
ticket = ticketsCache.get(ticketId);
}
if (logger.isTraceEnabled())
{
logger.trace("Removing ticket from ticketsCache: " + ticketId);
}
ticketsCache.remove(ticketId);
}
/**
* All remove operations from usernameKey cache should go through this method,
* so we can debug/trace problems easier from the logs
*/
private void removeFromUsernameKey(String username)
{
if (logger.isTraceEnabled())
if(ticket != null)
{
logger.trace("Removing ticket key from usernameKey: " + username);
String username = ticket.getUserName();
String actualUserTicketIdFromCache = usernameToTicketIdCache.get(username);
if(ticketId.equals(actualUserTicketIdFromCache))
{
if (logger.isTraceEnabled())
{
logger.trace("Removing ticketId from usernameToTicketIdCache for: " + username);
}
usernameToTicketIdCache.remove(username);
}
}
usernameKey.remove(username);
}
@Override
@@ -214,8 +213,7 @@ public class InMemoryTicketComponentImpl implements TicketComponent
expiryDate = Duration.add(new Date(), validDuration);
}
ticket = new Ticket(ticketsExpire ? expiryMode : ExpiryMode.DO_NOT_EXPIRE, expiryDate, userName, validDuration);
putTicketIntoTicketsCache(ticket);
putTicketIntoUsernameKeyCache(ticket);
putIntoCache(ticket);
}
String ticketString = GRANTED_AUTHORITY_TICKET_PREFIX + ticket.getTicketId();
@@ -229,40 +227,20 @@ public class InMemoryTicketComponentImpl implements TicketComponent
private Ticket findNonExpiredUserTicket(String userName)
{
String keyFromCache = usernameKey.get(userName);
if(StringUtils.isNotBlank(keyFromCache)) {
Ticket ticketFromCache = ticketsCache.get(keyFromCache);
if(ticketFromCache != null) {
String userTicketIdFromCache = usernameToTicketIdCache.get(userName);
if(userTicketIdFromCache != null)
{
Ticket ticketFromCache = ticketsCache.get(userTicketIdFromCache);
if(ticketFromCache != null)
{
Ticket newTicket = ticketFromCache.getNewEntry();
if(newTicket != null)
{
if (newTicket != ticketFromCache)
{
putTicketIntoTicketsCache(newTicket);
putTicketIntoUsernameKeyCache(newTicket);
}
return ticketFromCache;
}
}
} else {
for (String key : ticketsCache.getKeys())
{
Ticket ticket = ticketsCache.get(key);
if (ticket != null)
{
if(ticket.getUserName().equals(userName))
{
Ticket newTicket = ticket.getNewEntry();
if(newTicket != null)
{
if (newTicket != ticket)
{
putTicketIntoTicketsCache(newTicket);
putTicketIntoUsernameKeyCache(newTicket);
}
return ticket;
}
putIntoCache(newTicket);
}
return newTicket;
}
}
}
@@ -301,16 +279,11 @@ public class InMemoryTicketComponentImpl implements TicketComponent
{
//this feature is deprecated
removeTicketFromTicketsCache(ticketKey);
String userName = newTicket.getUserName();
if(StringUtils.isNotBlank(userName)) {
removeFromUsernameKey(userName);
}
removeFromCache(ticketKey);
}
else if (newTicket != ticket)
{
putTicketIntoTicketsCache(newTicket);
putTicketIntoUsernameKeyCache(newTicket);
putIntoCache(newTicket);
}
currentTicket.set(ticketString);
if (logger.isTraceEnabled())
@@ -357,7 +330,7 @@ public class InMemoryTicketComponentImpl implements TicketComponent
public void invalidateTicketById(String ticketString)
{
String key = ticketString.substring(GRANTED_AUTHORITY_TICKET_PREFIX.length());
removeTicketFromTicketsCache(key);
removeFromCache(key);
}
@Override
@@ -419,10 +392,11 @@ public class InMemoryTicketComponentImpl implements TicketComponent
logger.trace("Clearing all tickets from the ticketsCache, that used to have size: " + count);
}
ticketsCache.clear();
usernameToTicketIdCache.clear();
}
else
{
Set<String> toRemove = new HashSet<String>();
Set<String> toRemove = new HashSet<>();
for (String key : ticketsCache.getKeys())
{
Ticket ticket = ticketsCache.get(key);
@@ -434,7 +408,7 @@ public class InMemoryTicketComponentImpl implements TicketComponent
}
for (String id : toRemove)
{
removeTicketFromTicketsCache(id);
removeFromCache(id);
}
}
return count;
@@ -443,35 +417,26 @@ public class InMemoryTicketComponentImpl implements TicketComponent
@Override
public void invalidateTicketByUser(String userName)
{
Set<String> toRemove = new HashSet<String>();
Set<String> toRemove = new HashSet<>();
String keyFromCache = usernameKey.get(userName);
if(StringUtils.isNotBlank(keyFromCache)) {
Ticket ticketFromCache = ticketsCache.get(keyFromCache);
if(ticketFromCache != null) {
toRemove.add(ticketFromCache.getTicketId());
}
} else {
for (String key : ticketsCache.getKeys())
for (String key : ticketsCache.getKeys())
{
Ticket ticket = ticketsCache.get(key);
// Hack: The getKeys() call might return keys for null marker objects, yielding null values
if(ticket == null)
{
Ticket ticket = ticketsCache.get(key);
// Hack: The getKeys() call might return keys for null marker objects, yielding null values
if (ticket == null)
{
continue;
}
if (ticket.getUserName().equals(userName))
{
toRemove.add(ticket.getTicketId());
}
continue;
}
if(ticket.getUserName().equals(userName))
{
toRemove.add(ticket.getTicketId());
}
}
for (String id : toRemove)
{
removeTicketFromTicketsCache(id);
removeFromCache(id);
}
removeFromUsernameKey(userName);
}
@Override

View File

@@ -22,6 +22,7 @@
<mimetype mimetype="application/vnd.ms-project" display="Microsoft Project">
<extension default="true">mpp</extension>
<extension>mpt</extension>
</mimetype>
<mimetype mimetype="image/vnd.adobe.photoshop" display="Adobe Photoshop">
@@ -108,11 +109,28 @@
<extension>acp</extension>
</mimetype>
<mimetype mimetype="application/vnd.visio" display="Microsoft Visio">
<extension>vsd</extension>
<extension default="true">vsd</extension>
<extension>vss</extension>
<extension>vst</extension>
</mimetype>
<mimetype mimetype="application/vnd.visio2013" display="Microsoft Visio 2013">
<extension>vsdx</extension>
</mimetype>
<mimetype mimetype="application/vnd.ms-visio.drawing.macroenabled.main+xml" display="Microsoft Visio macro-enabled drawing">
<extension>vsdm</extension>
</mimetype>
<mimetype mimetype="application/vnd.ms-visio.stencil.main+xml" display="Microsoft Visio stencil">
<extension>vssx</extension>
</mimetype>
<mimetype mimetype="application/vnd.ms-visio.stencil.macroenabled.main+xml" display="Microsoft Visio macro-enabled stencil">
<extension>vssm</extension>
</mimetype>
<mimetype mimetype="application/vnd.ms-visio.template.main+xml" display="Microsoft Visio template">
<extension>vstx</extension>
</mimetype>
<mimetype mimetype="application/vnd.ms-visio.template.macroenabled.main+xml" display="Microsoft Visio macro-enabled template">
<extension>vstm</extension>
</mimetype>
<mimetype mimetype="application/vnd.adobe.xdp+xml" display="Adobe Acrobat XML Data Package">
<extension>xdp</extension>
</mimetype>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-distribution</artifactId>
<name>Package Licences and Keystore for Distribution</name>
<packaging>jar</packaging>
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-packaging</artifactId>
<version>7.302</version>
</parent>
</project>

View File

@@ -0,0 +1,141 @@
Instructions for Generating Repository SSL Keystores
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<store password> is the keystore password. The file ${dir.keystore}/ssl-keystore-passwords.properties contains passwords for the SSL keystore,
${dir.keystore}/ssl-truststore-passwords.properties contains passwords for the SSL truststore.
These instructions will create an RSA public/private key pair for the repository with a certificate that has been signed by the Alfresco Certificate Authority (CA).
It will also create a truststore for the repository containing the CA certificate; this will be used to authenticate connections to specific repository
URLs from Solr. It assumes the existence of the Alfresco CA key and certificate to sign the repository certificate; for security reasons these are not generally available.
You can either generate your own CA key and certificate (see instructions below) or use a recognised Certificate Authority such as Verisign. For Alfresco employees the key
and certificate are available in svn.
(i) Generate the repository public/private key pair in a keystore:
$ keytool -genkey -alias ssl.repo -keyalg RSA -keystore ssl.keystore -storetype JCEKS -storepass <store password>
Enter keystore password:
Re-enter new password:
What is your first and last name?
[Unknown]: Alfresco Repository
What is the name of your organizational unit?
[Unknown]:
What is the name of your organization?
[Unknown]: Alfresco Software Ltd.
What is the name of your City or Locality?
[Unknown]: Maidenhead
What is the name of your State or Province?
[Unknown]: UK
What is the two-letter country code for this unit?
[Unknown]: GB
Is CN=Alfresco Repository, OU=Unknown, O=Alfresco Software Ltd., L=Maidenhead, ST=UK, C=GB correct?
[no]: yes
Enter key password for <ssl.repo>
(RETURN if same as keystore password):
(ii) Generate a certificate request for the repository key
$ keytool -keystore ssl.keystore -alias ssl.repo -certreq -file repo.csr -storetype JCEKS -storepass <store password>
(iii) Alfresco CA signs the certificate request, creating a certificate that is valid for 365 days.
$ openssl x509 -CA ca.crt -CAkey ca.key -CAcreateserial -req -in repo.csr -out repo.crt -days 365
Signature ok
subject=/C=GB/ST=UK/L=Maidenhead/O=Alfresco Software Ltd./OU=Unknown/CN=Alfresco Repository
Getting CA Private Key
Enter pass phrase for ca.key:
(iv) Import the Alfresco CA key into the repository key store
$ keytool -import -alias ssl.alfreco.ca -file ca.crt -keystore ssl.keystore -storetype JCEKS -storepass <store password>
Enter keystore password:
Owner: CN=Alfresco CA, O=Alfresco Software Ltd., L=Maidenhead, ST=UK, C=GB
Issuer: CN=Alfresco CA, O=Alfresco Software Ltd., L=Maidenhead, ST=UK, C=GB
Serial number: 805ba6dc8f62f8b8
Valid from: Fri Aug 12 13:28:58 BST 2011 until: Mon Aug 09 13:28:58 BST 2021
Certificate fingerprints:
MD5: 4B:45:94:2D:8E:98:E8:12:04:67:AD:AE:48:3C:F5:A0
SHA1: 74:42:22:D0:52:AD:82:7A:FD:37:46:37:91:91:F4:77:89:3A:C9:A3
Signature algorithm name: SHA1withRSA
Version: 3
Extensions:
#1: ObjectId: 2.5.29.14 Criticality=false
SubjectKeyIdentifier [
KeyIdentifier [
0000: 08 42 40 DC FE 4A 50 87 05 2B 38 4D 92 70 8E 51 .B@..JP..+8M.p.Q
0010: 4E 38 71 D6 N8q.
]
]
#2: ObjectId: 2.5.29.19 Criticality=false
BasicConstraints:[
CA:true
PathLen:2147483647
]
#3: ObjectId: 2.5.29.35 Criticality=false
AuthorityKeyIdentifier [
KeyIdentifier [
0000: 08 42 40 DC FE 4A 50 87 05 2B 38 4D 92 70 8E 51 .B@..JP..+8M.p.Q
0010: 4E 38 71 D6 N8q.
]
[CN=Alfresco CA, O=Alfresco Software Ltd., L=Maidenhead, ST=UK, C=GB]
SerialNumber: [ 805ba6dc 8f62f8b8]
]
Trust this certificate? [no]: yes
Certificate was added to keystore
(v) Import the CA-signed repository certificate into the repository keystore
$ keytool -import -alias ssl.repo -file repo.crt -keystore ssl.keystore -storetype JCEKS -storepass <store password>
Enter keystore password:
Certificate reply was installed in keystore
(vi) Convert the repository keystore to a pkcs12 keystore (for use in browsers such as Firefox). Give the pkcs12 key store the key store password 'alfresco'.
keytool -importkeystore -srckeystore ssl.keystore -srcstorepass <keystore password> -srcstoretype JCEKS -srcalias ssl.repo -srckeypass kT9X6oe68t -destkeystore firefox.p12 -deststoretype pkcs12 -deststorepass alfresco -destalias ssl.repo -destkeypass alfresco
(vi) Create a repository truststore containing the Alfresco CA certificate
keytool -import -alias ssl.alfreco.ca -file ca.crt -keystore ssl.keystore -storetype JCEKS -storepass <store password>
keytool -import -alias alfreco.ca -file ca.crt -keystore ssl.truststore -storetype JCEKS -storepass <store password>
(vii) Copy the keystore and truststore to the repository keystore location defined by the property 'dir.keystore'.
(viii) Update the SSL properties i.e. properties starting with the prefixes 'alfresco.encryption.ssl.keystore' and 'alfresco.encryption.ssl.truststore'.
Instructions for Generating a Certificate Authority (CA) Key and Certificate
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(i) Generate the CA private key
$ openssl genrsa -des3 -out ca.key 1024
Generating RSA private key, 1024 bit long modulus
..........++++++
..++++++
e is 65537 (0x10001)
Enter pass phrase for ca.key:
Verifying - Enter pass phrase for ca.key:
(ii) Generate the CA self-signed certificate
$ openssl req -new -x509 -days 3650 -key ca.key -out ca.crt
Enter pass phrase for ca.key:
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:GB
State or Province Name (full name) [Some-State]:UK
Locality Name (eg, city) []:Maidenhead
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Alfresco Software Ltd.
Organizational Unit Name (eg, section) []:
Common Name (eg, YOUR name) []:Alfresco CA
Email Address []:

View File

@@ -0,0 +1,58 @@
@rem Please edit the variables below to suit your installation
@rem Note: for an installation created by the Alfresco installer, you only need to edit ALFRESCO_HOME
@rem Alfresco installation directory
set ALFRESCO_HOME=C:\Alfresco-5.2
@rem The directory containing the alfresco keystores, as referenced by keystoreFile and truststoreFile attributes in tomcat\conf\server.xml
set ALFRESCO_KEYSTORE_HOME=%ALFRESCO_HOME%\alf_data\keystore
@rem Java installation directory
set JAVA_HOME=%ALFRESCO_HOME%\java
@rem Location in which new keystore files will be generated
set CERTIFICATE_HOME=%USERPROFILE%
@rem The repository server certificate subject name, as specified in tomcat\conf\tomcat-users.xml with roles="repository"
set REPO_CERT_DNAME=CN=Alfresco Repository, OU=Unknown, O=Alfresco Software Ltd., L=Maidenhead, ST=UK, C=GB
@rem The SOLR client certificate subject name, as specified in tomcat\conf\tomcat-users.xml with roles="repoclient"
set SOLR_CLIENT_CERT_DNAME=CN=Alfresco Repository Client, OU=Unknown, O=Alfresco Software Ltd., L=Maidenhead, ST=UK, C=GB
@rem The number of days before the certificate expires
set CERTIFICATE_VALIDITY=36525
@rem Ensure certificate output dir exists
@if not exist "%CERTIFICATE_HOME%" mkdir "%CERTIFICATE_HOME%"
@rem Remove old output files (note they are backed up elsewhere)
@if exist "%CERTIFICATE_HOME%\ssl.keystore" del "%CERTIFICATE_HOME%\ssl.keystore"
@if exist "%CERTIFICATE_HOME%\ssl.truststore" del "%CERTIFICATE_HOME%\ssl.truststore"
@if exist "%CERTIFICATE_HOME%\browser.p12" del "%CERTIFICATE_HOME%\browser.p12"
@if exist "%CERTIFICATE_HOME%\ssl.repo.client.keystore" del "%CERTIFICATE_HOME%\ssl.repo.client.keystore"
@if exist "%CERTIFICATE_HOME%\ssl.repo.client.truststore" del "%CERTIFICATE_HOME%\ssl.repo.client.truststore"
@rem Generate new self-signed certificates for the repository and solr
"%JAVA_HOME%\bin\keytool" -genkeypair -keyalg RSA -dname "%REPO_CERT_DNAME%" -validity %CERTIFICATE_VALIDITY% -alias ssl.repo -keypass kT9X6oe68t -keystore "%CERTIFICATE_HOME%\ssl.keystore" -storetype JCEKS -storepass kT9X6oe68t
"%JAVA_HOME%\bin\keytool" -exportcert -alias ssl.repo -file "%CERTIFICATE_HOME%\ssl.repo.crt" -keystore "%CERTIFICATE_HOME%\ssl.keystore" -storetype JCEKS -storepass kT9X6oe68t
"%JAVA_HOME%\bin\keytool" -genkeypair -keyalg RSA -dname "%SOLR_CLIENT_CERT_DNAME%" -validity %CERTIFICATE_VALIDITY% -alias ssl.repo.client -keypass kT9X6oe68t -keystore "%CERTIFICATE_HOME%\ssl.repo.client.keystore" -storetype JCEKS -storepass kT9X6oe68t
"%JAVA_HOME%\bin\keytool" -exportcert -alias ssl.repo.client -file "%CERTIFICATE_HOME%\ssl.repo.client.crt" -keystore "%CERTIFICATE_HOME%\ssl.repo.client.keystore" -storetype JCEKS -storepass kT9X6oe68t
@rem Create trust relationship between repository and solr
"%JAVA_HOME%\bin\keytool" -importcert -noprompt -alias ssl.repo.client -file "%CERTIFICATE_HOME%\ssl.repo.client.crt" -keystore "%CERTIFICATE_HOME%\ssl.truststore" -storetype JCEKS -storepass kT9X6oe68t
@rem Create trust relationship between repository and itself - used for searches
"%JAVA_HOME%\bin\keytool" -importcert -noprompt -alias ssl.repo -file "%CERTIFICATE_HOME%\ssl.repo.crt" -keystore "%CERTIFICATE_HOME%\ssl.truststore" -storetype JCEKS -storepass kT9X6oe68t
@rem Create trust relationship between solr and repository
"%JAVA_HOME%\bin\keytool" -importcert -noprompt -alias ssl.repo -file "%CERTIFICATE_HOME%\ssl.repo.crt" -keystore "%CERTIFICATE_HOME%\ssl.repo.client.truststore" -storetype JCEKS -storepass kT9X6oe68t
@rem Export repository keystore to pkcs12 format for browser compatibility
"%JAVA_HOME%\bin\keytool" -importkeystore -srckeystore "%CERTIFICATE_HOME%\ssl.keystore" -srcstorepass kT9X6oe68t -srcstoretype JCEKS -srcalias ssl.repo -srckeypass kT9X6oe68t -destkeystore "%CERTIFICATE_HOME%\browser.p12" -deststoretype pkcs12 -deststorepass alfresco -destalias ssl.repo -destkeypass alfresco
@rem Ensure keystore dir actually exists
@if not exist "%ALFRESCO_KEYSTORE_HOME%" mkdir "%ALFRESCO_KEYSTORE_HOME%"
@rem Install the new files
copy /Y "%CERTIFICATE_HOME%\ssl.keystore" "%ALFRESCO_KEYSTORE_HOME%\ssl.keystore"
copy /Y "%CERTIFICATE_HOME%\ssl.truststore" "%ALFRESCO_KEYSTORE_HOME%\ssl.truststore"
copy /Y "%CERTIFICATE_HOME%\browser.p12" "%ALFRESCO_KEYSTORE_HOME%\browser.p12"
@echo ****************************************
@echo You must copy the following files to the correct location.
@echo %CERTIFICATE_HOME%\ssl.repo.client.keystore
@echo %CERTIFICATE_HOME%\ssl.repo.client.truststore
@echo eg. for Solr 4 the location is SOLR_HOME\workspace-SpacesStore\conf and SOLR_HOME\archive-SpacesStore\conf
@echo Please ensure that you set dir.keystore=%ALFRESCO_KEYSTORE_HOME% in alfresco-global.properties
@echo ****************************************

View File

@@ -0,0 +1,82 @@
#! /bin/sh
# Please edit the variables below to suit your installation
# Note: for an installation created by the Alfresco installer, you only need to edit ALFRESCO_HOME
# Alfresco installation directory
if [ -z "$ALFRESCO_HOME" ]; then
ALFRESCO_HOME=/opt/alfresco-5.2
echo "Setting ALFRESCO_HOME to $ALFRESCO_HOME"
fi
# The directory containing the alfresco keystores, as referenced by keystoreFile and truststoreFile attributes in tomcat/conf/server.xml
ALFRESCO_KEYSTORE_HOME=$ALFRESCO_HOME/alf_data/keystore
# Location in which new keystore files will be generated
if [ -z "$CERTIFICATE_HOME" ]; then
CERTIFICATE_HOME=$HOME
echo "Certificates will be generated in $CERTIFICATE_HOME and then moved to $ALFRESCO_KEYSTORE_HOME"
fi
# Java installation directory
JAVA_HOME=$ALFRESCO_HOME/java
# The repository server certificate subject name, as specified in tomcat/conf/tomcat-users.xml with roles="repository"
REPO_CERT_DNAME="CN=Alfresco Repository, OU=Unknown, O=Alfresco Software Ltd., L=Maidenhead, ST=UK, C=GB"
# The SOLR client certificate subject name, as specified in tomcat/conf/tomcat-users.xml with roles="repoclient"
SOLR_CLIENT_CERT_DNAME="CN=Alfresco Repository Client, OU=Unknown, O=Alfresco Software Ltd., L=Maidenhead, ST=UK, C=GB"
# The number of days before the certificate expires
CERTIFICATE_VALIDITY=36525
# Stop
if [ -f "$ALFRESCO_HOME/alfresco.sh" ]; then "$ALFRESCO_HOME/alfresco.sh" stop; fi
# Ensure certificate output dir exists
mkdir -p "$CERTIFICATE_HOME"
# Remove old output files (note they are backed up elsewhere)
if [ -f "$CERTIFICATE_HOME/ssl.keystore" ]; then rm "$CERTIFICATE_HOME/ssl.keystore"; fi
if [ -f "$CERTIFICATE_HOME/ssl.truststore" ]; then rm "$CERTIFICATE_HOME/ssl.truststore"; fi
if [ -f "$CERTIFICATE_HOME/browser.p12" ]; then rm "$CERTIFICATE_HOME/browser.p12"; fi
if [ -f "$CERTIFICATE_HOME/ssl.repo.client.keystore" ]; then rm "$CERTIFICATE_HOME/ssl.repo.client.keystore"; fi
if [ -f "$CERTIFICATE_HOME/ssl.repo.client.truststore" ]; then rm "$CERTIFICATE_HOME/ssl.repo.client.truststore"; fi
# Generate new self-signed certificates for the repository and solr
"$JAVA_HOME/bin/keytool" -genkeypair -keyalg RSA -dname "$REPO_CERT_DNAME" -validity $CERTIFICATE_VALIDITY -alias ssl.repo -keypass kT9X6oe68t -keystore "$CERTIFICATE_HOME/ssl.keystore" -storetype JCEKS -storepass kT9X6oe68t
"$JAVA_HOME/bin/keytool" -exportcert -alias ssl.repo -file "$CERTIFICATE_HOME/ssl.repo.crt" -keystore "$CERTIFICATE_HOME/ssl.keystore" -storetype JCEKS -storepass kT9X6oe68t
"$JAVA_HOME/bin/keytool" -genkeypair -keyalg RSA -dname "$SOLR_CLIENT_CERT_DNAME" -validity $CERTIFICATE_VALIDITY -alias ssl.repo.client -keypass kT9X6oe68t -keystore "$CERTIFICATE_HOME/ssl.repo.client.keystore" -storetype JCEKS -storepass kT9X6oe68t
"$JAVA_HOME/bin/keytool" -exportcert -alias ssl.repo.client -file "$CERTIFICATE_HOME/ssl.repo.client.crt" -keystore "$CERTIFICATE_HOME/ssl.repo.client.keystore" -storetype JCEKS -storepass kT9X6oe68t
# Create trust relationship between repository and solr
"$JAVA_HOME/bin/keytool" -importcert -noprompt -alias ssl.repo.client -file "$CERTIFICATE_HOME/ssl.repo.client.crt" -keystore "$CERTIFICATE_HOME/ssl.truststore" -storetype JCEKS -storepass kT9X6oe68t
# Create trust relationship between repository and itself - used for searches
"$JAVA_HOME/bin/keytool" -importcert -noprompt -alias ssl.repo -file "$CERTIFICATE_HOME/ssl.repo.crt" -keystore "$CERTIFICATE_HOME/ssl.truststore" -storetype JCEKS -storepass kT9X6oe68t
# Create trust relationship between solr and repository
"$JAVA_HOME/bin/keytool" -importcert -noprompt -alias ssl.repo -file "$CERTIFICATE_HOME/ssl.repo.crt" -keystore "$CERTIFICATE_HOME/ssl.repo.client.truststore" -storetype JCEKS -storepass kT9X6oe68t
# Export repository keystore to pkcs12 format for browser compatibility
"$JAVA_HOME/bin/keytool" -importkeystore -srckeystore "$CERTIFICATE_HOME/ssl.keystore" -srcstorepass kT9X6oe68t -srcstoretype JCEKS -srcalias ssl.repo -srckeypass kT9X6oe68t -destkeystore "$CERTIFICATE_HOME/browser.p12" -deststoretype pkcs12 -deststorepass alfresco -destalias ssl.repo -destkeypass alfresco
# Ensure keystore dir actually exists
mkdir -p "$ALFRESCO_KEYSTORE_HOME"
# Back up old files
cp "$ALFRESCO_KEYSTORE_HOME/ssl.keystore" "$ALFRESCO_KEYSTORE_HOME/ssl.keystore.old"
cp "$ALFRESCO_KEYSTORE_HOME/ssl.truststore" "$ALFRESCO_KEYSTORE_HOME/ssl.truststore.old"
cp "$ALFRESCO_KEYSTORE_HOME/browser.p12" "$ALFRESCO_KEYSTORE_HOME/browser.p12.old"
# Install the new files
cp "$CERTIFICATE_HOME/ssl.keystore" "$ALFRESCO_KEYSTORE_HOME/ssl.keystore"
cp "$CERTIFICATE_HOME/ssl.truststore" "$ALFRESCO_KEYSTORE_HOME/ssl.truststore"
cp "$CERTIFICATE_HOME/browser.p12" "$ALFRESCO_KEYSTORE_HOME/browser.p12"
echo " "
echo "*******************************************"
echo "You must copy the following files to the correct location."
echo " "
echo " $CERTIFICATE_HOME/ssl.repo.client.keystore"
echo " $CERTIFICATE_HOME/ssl.repo.client.truststore"
echo " eg. for Solr 4 the location is SOLR_HOME/workspace-SpacesStore/conf/ and SOLR_HOME/archive-SpacesStore/conf/"
echo " "
echo "$ALFRESCO_KEYSTORE_HOME/browser.p12 has also been generated."
echo " "
echo "Please ensure that you set dir.keystore=$ALFRESCO_KEYSTORE_HOME in alfresco-global.properties"
echo "*******************************************"

View File

@@ -1,7 +1,10 @@
aliases=metadata
# The password protecting the keystore entries
keystore.password=mp6yc0UD9e
# The password protecting the alias: metadata
metadata.keyData=
metadata.algorithm=DESede
# This file and the keystore is deprecated
# Please generate a new keystore for new systems and use JVM properties for it's configuration
aliases=metadata
# The password protecting the keystore entries
keystore.password=mp6yc0UD9e
# The password protecting the alias: metadata
metadata.keyData=
metadata.algorithm=DESede
metadata.password=oKIWzVdEdA

View File

@@ -0,0 +1,7 @@
See https://wiki.alfresco.com/wiki/Data_Encryption and https://wiki.alfresco.com/wiki/Alfresco_And_SOLR.
keystore is the secret key keystore, containing the secret key used to encrypt and decrypt node properties.
ssl.keystore is the repository keystore, containing the repository private/public key pair and certificate.
ssl.truststore is the repository truststore, containing certificates that the repository trusts.
browser.p12 is a pkcs12 keystore generated from ssl.keystore that contains the repository private key and certificate for use in browsers such as Firefox.

View File

@@ -19,6 +19,8 @@ ARG TOMCAT_DIR=/usr/local/tomcat
RUN mkdir -p ${TOMCAT_DIR}/shared/classes/alfresco/extension/mimetypes && \
mkdir -p ${TOMCAT_DIR}/shared/classes/alfresco/extension/transform/renditions && \
mkdir -p ${TOMCAT_DIR}/shared/classes/alfresco/extension/transform/pipelines && \
mkdir /licenses && \
mkdir -p ${TOMCAT_DIR}/shared/classes/alfresco/extension/keystore && \
mkdir ${TOMCAT_DIR}/alfresco-mmt && \
touch ${TOMCAT_DIR}/shared/classes/alfresco-global.properties
@@ -26,13 +28,13 @@ RUN mkdir -p ${TOMCAT_DIR}/shared/classes/alfresco/extension/mimetypes && \
# Copy the WAR files to the appropriate location for your application server
# Copy the JDBC drivers for the database you are using to the lib/ directory.
# Copy the alfresco-mmt.jar
# Copy Licenses to the root of the Docker image
# Copy default keystore
COPY ${resource_path}/war ${TOMCAT_DIR}/webapps
COPY ${resource_path}/connector/* ${TOMCAT_DIR}/lib/
COPY ${resource_path}/alfresco-mmt/* ${TOMCAT_DIR}/alfresco-mmt/
# Copy Licenses to the root of the Docker image
RUN mkdir /licenses
COPY ${resource_path}/licenses/ /licenses/
COPY ${resource_path}/dependency/licenses/ /licenses/
COPY ${resource_path}/dependency/keystore/metadata-keystore/keystore ${TOMCAT_DIR}/shared/classes/alfresco/extension/keystore
# Change the value of the shared.loader= property to the following:
# shared.loader=${catalina.base}/shared/classes
@@ -70,15 +72,7 @@ RUN yum install -y fontconfig-2.13.0-4.3.el7 \
dejavu-sans-fonts-2.33-6.el7 && \
yum clean all
# Generate default keystore. Please generate new one for production systems
ARG CERT_DNAME="CN=Alfresco Repository, OU=Unknown, O=Alfresco Software Ltd., L=Maidenhead, ST=UK, C=GB"
ARG CERT_VALIDITY=36525
ARG KEYSTORE_PASSWORD=mp6yc0UD9e
RUN mkdir ${TOMCAT_DIR}/shared/classes/alfresco/keystore && \
keytool -genseckey -dname "$CERT_DNAME" -validity ${CERT_VALIDITY} -alias metadata -keyalg AES -keysize 256 -keystore ${TOMCAT_DIR}/shared/classes/alfresco/keystore/keystore -storetype pkcs12 -storepass ${KEYSTORE_PASSWORD}
# The standard configuration is to have all Tomcat files owned by root with group GROUPNAME and whilst owner has read/write privileges,
# The standard configuration is to have all Tomcat files owned by root with group GROUPNAME and whilst owner has read/write privileges,
# group only has restricted permissions and world has no permissions.
RUN mkdir -p ${TOMCAT_DIR}/conf/Catalina/localhost && \
mkdir -p ${TOMCAT_DIR}/alf_data && \
@@ -97,9 +91,9 @@ RUN mkdir -p ${TOMCAT_DIR}/conf/Catalina/localhost && \
chmod g+rwx ${TOMCAT_DIR}/temp && \
chmod g+rwx ${TOMCAT_DIR}/work && \
chmod o-w ${TOMCAT_DIR}/work && \
chmod 664 ${TOMCAT_DIR}/alfresco-mmt/alfresco-mmt-*.jar && \
find /licenses -type d -exec chmod 0775 {} \; && \
find /licenses -type f -exec chmod 0664 {} \;
chmod 644 ${TOMCAT_DIR}/alfresco-mmt/alfresco-mmt-*.jar && \
find /licenses -type d -exec chmod 0755 {} \; && \
find /licenses -type f -exec chmod 0644 {} \;
EXPOSE 10001

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-packaging</artifactId>
<version>7.183.300-TEST1</version>
<version>7.302</version>
</parent>
<properties>
@@ -16,29 +16,6 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-licenses</id>
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<resources>
<resource>
<!-- Extract licenses directory -->
<directory>../distribution/src/main/resources/licenses</directory>
<filtering>false</filtering>
</resource>
</resources>
<outputDirectory>${project.build.directory}/licenses</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
@@ -126,6 +103,24 @@
</artifactItems>
</configuration>
</execution>
<execution>
<id>unpack-licenses-and-keystore</id>
<phase>process-resources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-distribution</artifactId>
<type>jar</type>
<version>${project.version}</version>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>7.183.300-TEST1</version>
<version>7.302</version>
</parent>
<profiles>
@@ -18,6 +18,7 @@
</activation>
<modules>
<module>war</module>
<module>distribution</module>
<module>docker-alfresco</module>
</modules>
</profile>
@@ -25,18 +26,21 @@
<id>community</id>
<modules>
<module>war</module>
<module>distribution</module>
</modules>
</profile>
<profile>
<id>communityDocker</id>
<modules>
<module>war</module>
<module>distribution</module>
<module>docker-alfresco</module>
</modules>
</profile>
<profile>
<id>all-tas-tests</id>
<modules>
<module>distribution</module>
<module>tests</module>
</modules>
</profile>

View File

@@ -1,4 +1,4 @@
TRANSFORMERS_TAG=2.3.1
SOLR6_TAG=1.4.2
TRANSFORMERS_TAG=2.3.5
SOLR6_TAG=2.0.0
POSTGRES_TAG=11.7
ACTIVEMQ_TAG=5.15.8

View File

@@ -10,6 +10,16 @@ services:
image: alfresco/alfresco-community-repo-base:latest
environment:
CATALINA_OPTS : "-agentlib:jdwp=transport=dt_socket,address=*:8000,server=y,suspend=n"
JAVA_TOOL_OPTIONS: "
-Dencryption.keystore.type=JCEKS
-Dencryption.cipherAlgorithm=DESede/CBC/PKCS5Padding
-Dencryption.keyAlgorithm=DESede
-Dencryption.keystore.location=/usr/local/tomcat/shared/classes/alfresco/extension/keystore/keystore
-Dmetadata-keystore.password=mp6yc0UD9e
-Dmetadata-keystore.aliases=metadata
-Dmetadata-keystore.metadata.password=oKIWzVdEdA
-Dmetadata-keystore.metadata.algorithm=DESede
"
JAVA_OPTS :
"
-Ddb.driver=org.postgresql.Driver
@@ -39,10 +49,6 @@ services:
-Dftp.port=1221
-Dcors.enabled=true
-Dcors.allowed.origins=http://localhost:4200,http://localhost:8080
-Dmetadata-keystore.password=mp6yc0UD9e
-Dmetadata-keystore.aliases=metadata
-Dmetadata-keystore.metadata.password=mp6yc0UD9e
-Dmetadata-keystore.metadata.algorithm=AES
"
ports:
- 8082:8080

View File

@@ -10,6 +10,16 @@ services:
image: alfresco/alfresco-community-repo-base:latest
environment:
CATALINA_OPTS : "-agentlib:jdwp=transport=dt_socket,address=*:8000,server=y,suspend=n"
JAVA_TOOL_OPTIONS: "
-Dencryption.keystore.type=JCEKS
-Dencryption.cipherAlgorithm=DESede/CBC/PKCS5Padding
-Dencryption.keyAlgorithm=DESede
-Dencryption.keystore.location=/usr/local/tomcat/shared/classes/alfresco/extension/keystore/keystore
-Dmetadata-keystore.password=mp6yc0UD9e
-Dmetadata-keystore.aliases=metadata
-Dmetadata-keystore.metadata.password=oKIWzVdEdA
-Dmetadata-keystore.metadata.algorithm=DESede
"
JAVA_OPTS :
"
-Ddb.driver=org.postgresql.Driver
@@ -35,10 +45,6 @@ services:
-Dftp.port=1221
-Dcors.enabled=true
-Dcors.allowed.origins=http://localhost:4200,http://localhost:8080
-Dmetadata-keystore.password=mp6yc0UD9e
-Dmetadata-keystore.aliases=metadata
-Dmetadata-keystore.metadata.password=mp6yc0UD9e
-Dmetadata-keystore.metadata.algorithm=AES
"
ports:
- 8082:8080

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-packaging</artifactId>
<version>7.183.300-TEST1</version>
<version>7.302</version>
</parent>
<modules>

View File

@@ -9,7 +9,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-tests</artifactId>
<version>7.183.300-TEST1</version>
<version>7.302</version>
</parent>
<developers>

View File

@@ -9,7 +9,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-tests</artifactId>
<version>7.183.300-TEST1</version>
<version>7.302</version>
</parent>
<developers>

View File

@@ -9,7 +9,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-tests</artifactId>
<version>7.183.300-TEST1</version>
<version>7.302</version>
</parent>
<developers>

View File

@@ -9,7 +9,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-tests</artifactId>
<version>7.183.300-TEST1</version>
<version>7.302</version>
</parent>
<developers>

View File

@@ -9,7 +9,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-tests</artifactId>
<version>7.183.300-TEST1</version>
<version>7.302</version>
</parent>
<developers>

View File

@@ -7,12 +7,12 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-packaging</artifactId>
<version>7.183.300-TEST1</version>
<version>7.302</version>
</parent>
<properties>
<scm-path>local/development/workspace</scm-path>
<scm-revision>${buildNumber}</scm-revision>
<scm-path>${project.parent.parent.scm.url}</scm-path>
<scm-revision>${build-number}</scm-revision>
</properties>
<dependencies>
@@ -41,7 +41,6 @@
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>org.apache.avalon.framework</groupId>
@@ -72,7 +71,6 @@
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<!-- Test dependencies -->
@@ -101,18 +99,15 @@
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${dependency.spring.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.3.3</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -124,13 +119,11 @@
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${dependency.postgresql.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${dependency.mysql.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
@@ -271,6 +264,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<source>${maven.build.sourceVersion}</source>
</configuration>

47
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>7.183.300-TEST1</version>
<version>7.302</version>
<packaging>pom</packaging>
<name>Alfresco Community Repo Parent</name>
@@ -23,7 +23,7 @@
<properties>
<acs.version.major>6</acs.version.major>
<acs.version.minor>2</acs.version.minor>
<acs.version.revision>1</acs.version.revision>
<acs.version.revision>3</acs.version.revision>
<acs.version.label />
<version.edition>Community</version.edition>
@@ -57,15 +57,15 @@
<dependency.spring.version>5.1.15.RELEASE</dependency.spring.version>
<dependency.antlr.version>3.5.2</dependency.antlr.version>
<dependency.jackson.version>2.10.2</dependency.jackson.version>
<dependency.jackson-databind.version>2.10.1</dependency.jackson-databind.version>
<dependency.jackson.version>2.10.5</dependency.jackson.version>
<dependency.jackson-databind.version>2.10.5</dependency.jackson-databind.version>
<dependency.cxf.version>3.3.5</dependency.cxf.version>
<dependency.opencmis.version>1.0.0</dependency.opencmis.version>
<dependency.pdfbox.version>2.0.19</dependency.pdfbox.version>
<dependency.webscripts.version>7.14</dependency.webscripts.version>
<dependency.webscripts.version>7.16</dependency.webscripts.version>
<dependency.bouncycastle.version>1.64</dependency.bouncycastle.version>
<dependency.mockito-core.version>3.2.4</dependency.mockito-core.version>
<dependency.org-json.version>20090211</dependency.org-json.version>
<dependency.mockito-core.version>3.4.6</dependency.mockito-core.version>
<dependency.org-json.version>20200518</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.6</dependency.commons-io.version>
@@ -75,32 +75,32 @@
<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.slf4j.version>1.7.30</dependency.slf4j.version>
<dependency.gytheio.version>0.11.3</dependency.gytheio.version>
<dependency.gytheio.version>0.11.6</dependency.gytheio.version>
<dependency.jaxb.version>2.3.2</dependency.jaxb.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.21-20190624-alfresco-patched</dependency.tika.version>
<dependency.tika.version>1.24.1</dependency.tika.version>
<dependency.spring-security.version>5.1.9.RELEASE</dependency.spring-security.version>
<dependency.truezip.version>7.7.10</dependency.truezip.version>
<dependency.poi.version>4.1.1</dependency.poi.version>
<dependency.poi.version>4.1.2</dependency.poi.version>
<dependency.ooxml-schemas.version>1.4</dependency.ooxml-schemas.version>
<dependency.keycloak.version>9.0.3</dependency.keycloak.version>
<dependency.keycloak.version>11.0.0-alfresco-001</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.15.11</dependency.activemq.version>
<dependency.apache.taglibs.version>1.2.5</dependency.apache.taglibs.version>
<alfresco.googledrive.version>3.2.0</alfresco.googledrive.version>
<alfresco.aos-module.version>1.3.1</alfresco.aos-module.version>
<alfresco.aos-module.version>1.3.2-RC1</alfresco.aos-module.version>
<dependency.postgresql.version>42.2.12</dependency.postgresql.version>
<dependency.postgresql.version>42.2.14</dependency.postgresql.version>
<dependency.mysql.version>8.0.19</dependency.mysql.version>
<dependency.mariadb.version>2.6.0</dependency.mariadb.version>
<dependency.tas-utility.version>3.0.20</dependency.tas-utility.version>
<dependency.tas-utility.version>3.0.21</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.33</dependency.tas-restapi.version>
<dependency.tas-restapi.version>1.43</dependency.tas-restapi.version>
<dependency.tas-cmis.version>1.13</dependency.tas-cmis.version>
<dependency.tas-email.version>1.8</dependency.tas-email.version>
<dependency.tas-webdav.version>1.6</dependency.tas-webdav.version>
@@ -112,7 +112,7 @@
<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>7.183.300-TEST1</tag>
<tag>7.302</tag>
</scm>
<distributionManagement>
@@ -172,11 +172,6 @@
<classifier>win64</classifier>
<type>tgz</type>
</dependency>
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-pdf-renderer</artifactId>
<version>${dependency.alfresco-pdf-renderer.version}</version>
</dependency>
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-server-root</artifactId>
@@ -232,7 +227,7 @@
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.2</version>
</dependency>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
@@ -488,12 +483,6 @@
<artifactId>xercesImpl</artifactId>
<version>${dependency.xercesImpl.version}</version>
</dependency>
<!-- Newer metadata-extractor, used in TIKA, see ACS-370 -->
<dependency>
<groupId>com.drewnoakes</groupId>
<artifactId>metadata-extractor</artifactId>
<version>2.11.0</version>
</dependency>
<!-- upgrade dependency from TIKA -->
<dependency>
<groupId>com.github.junrar</groupId>
@@ -678,7 +667,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.1.1</version>
<version>3.2.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>

View File

@@ -1,41 +0,0 @@
### Alfresco Remote API
[![Build Status](https://travis-ci.com/Alfresco/alfresco-remote-api.svg?branch=master)](https://travis-ci.com/Alfresco/alfresco-remote-api)
Remote API is a library packaged as a jar file which is part of [Alfresco Content Services Repository](https://community.alfresco.com/docs/DOC-6385-project-overview-repository).
The library contains the following:
* REST API framework
* WebScript implementations including [V1 REST APIs](https://community.alfresco.com/community/ecm/blog/2017/05/02/v1-rest-api-10-things-you-should-know)
* [OpenCMIS](https://chemistry.apache.org/java/opencmis.html) implementations
### Building and testing
The project can be built by running Maven command:
~~~
mvn clean install
~~~
The tests are combined in 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, for example:
~~~
mvn clean test -Dtest=SomeTest -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql:alfresco -Ddb.username=alfresco -Ddb.password=alfresco
~~~
### Artifacts
The artifacts can be obtained by:
* downloading from [Alfresco repository](https://artifacts.alfresco.com/nexus/content/groups/public)
* getting as Maven dependency by adding the dependency to your pom file:
~~~
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-remote-api</artifactId>
<version>version</version>
</dependency>
~~~
and Alfresco Maven repository:
~~~
<repository>
<id>alfresco-maven-repo</id>
<url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
</repository>
~~~
The SNAPSHOT version of the artifact is **never** published.
### Contributing guide
Please use [this guide](CONTRIBUTING.md) to make a contribution to the project.

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>7.183.300-TEST1</version>
<version>7.302</version>
</parent>
<dependencies>
@@ -24,28 +24,23 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${dependency.jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${dependency.jackson-databind.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${dependency.jackson.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-csv</artifactId>
<version>1.8</version>
</dependency>
<dependency>
<groupId>org.apache.santuario</groupId>
@@ -56,7 +51,6 @@
<dependency>
<groupId>org.alfresco.surf</groupId>
<artifactId>spring-webscripts</artifactId>
<version>${dependency.webscripts.version}</version>
</dependency>
<dependency>
<groupId>javax.xml</groupId>
@@ -78,19 +72,16 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.3.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${dependency.spring.version}</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -110,14 +101,12 @@
<dependency>
<groupId>org.alfresco.surf</groupId>
<artifactId>spring-webscripts</artifactId>
<version>${dependency.webscripts.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${dependency.postgresql.version}</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -158,7 +147,6 @@
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-pdf-renderer</artifactId>
<version>${dependency.alfresco-pdf-renderer.version}</version>
<classifier>win64</classifier>
<type>tgz</type>
</dependency>
@@ -203,7 +191,6 @@
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-pdf-renderer</artifactId>
<version>${dependency.alfresco-pdf-renderer.version}</version>
<classifier>linux</classifier>
<type>tgz</type>
</dependency>
@@ -240,54 +227,6 @@
<alfresco-pdf-renderer.exe>${project.build.directory}/test-binaries/alfresco-pdf-renderer/alfresco-pdf-renderer</alfresco-pdf-renderer.exe>
</properties>
</profile>
<profile>
<id>osx-alfresco-pdf-renderer-test</id>
<activation>
<os>
<family>mac</family>
</os>
</activation>
<dependencies>
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-pdf-renderer</artifactId>
<version>${dependency.alfresco-pdf-renderer.version}</version>
<classifier>osx</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 (OS-X) 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}-osx.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>

View File

@@ -438,7 +438,7 @@ import org.springframework.extensions.webscripts.json.JSONUtils;
{
public String convert(ChildAssociationRef source)
{
return source.toString();
return org.json.simple.JSONObject.escape(source.toString());
}
});
@@ -454,7 +454,7 @@ import org.springframework.extensions.webscripts.json.JSONUtils;
{
public String convert(AssociationRef source)
{
return source.toString();
return org.json.simple.JSONObject.escape(source.toString());
}
});

View File

@@ -366,7 +366,22 @@ public abstract class BaseKerberosAuthenticationFilter extends BaseSSOAuthentica
}
// Send back a request for SPNEGO authentication
logonStartAgain(context, req, resp, true);
// MNT-21702 fixing Kerberos SSO fallback machanism for WebDAV
if (req.getRequestURL().toString().contains("webdav"))
{
if ( getLogger().isDebugEnabled()) {
getLogger().debug("WebDAV request, fallback");
}
logonStartAgain(context, req, resp, false);
}
else
{
if ( getLogger().isDebugEnabled()) {
getLogger().debug("Non-WebDAV request, don't fallback");
}
logonStartAgain(context, req, resp, true);
}
return false;
}

View File

@@ -52,6 +52,7 @@ import org.alfresco.repo.security.authentication.AuthenticationException;
import org.alfresco.repo.web.auth.WebCredentials;
import org.alfresco.repo.web.filter.beans.DependencyInjectedFilter;
import org.alfresco.rest.api.PublicApiTenantWebScriptServletRequest;
import org.alfresco.rest.framework.core.exceptions.NotFoundException;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.ApplicationContext;
import org.springframework.extensions.webscripts.RuntimeContainer;
@@ -201,7 +202,16 @@ public abstract class BaseSSOAuthenticationFilter extends BaseAuthenticationFilt
// Get the HTTP request/response
HttpServletRequest req = (HttpServletRequest) request;
Match match = container.getRegistry().findWebScript(req.getMethod(), getScriptUrl(req));
Match match = null;
try
{
match = container.getRegistry().findWebScript(req.getMethod(), getScriptUrl(req));
}
catch (NotFoundException | IllegalArgumentException Ex)
{
getLogger().debug(req.getMethod() + " " + getScriptUrl(req) + "not found in Public API Container.");
}
// If a filter up the chain has marked the request as not requiring auth then respect it
if (request.getAttribute(NO_AUTH_REQUIRED) != null)

View File

@@ -280,21 +280,28 @@ public class AuditImpl implements Audit
// clear null elements
entriesAudit.removeAll(Collections.singleton(null));
int totalItems = entriesAudit.size();
int totalRetrievedItems = entriesAudit.size();
int end = Math.min(limit - 1, totalRetrievedItems);
boolean hasMoreItems = totalRetrievedItems > end;
if (skipCount >= totalItems)
String omitTotalItemsParameter = parameters.getParameter("omitTotalItems");
boolean omitTotalItems = (null != omitTotalItemsParameter) && Boolean.parseBoolean(omitTotalItemsParameter);
Integer totalItems;
if (omitTotalItems)
{
List<AuditEntry> empty = Collections.emptyList();
return CollectionWithPagingInfo.asPaged(paging, empty, false, totalItems);
totalItems = null;
}
else
{
int end = Math.min(limit - 1, totalItems);
boolean hasMoreItems = totalItems > end;
entriesAudit = entriesAudit.subList(skipCount, end);
return CollectionWithPagingInfo.asPaged(paging, entriesAudit, hasMoreItems, totalItems);
totalItems = hasMoreItems ? getAuditEntriesCountByApp(auditApplication) : totalRetrievedItems;
}
entriesAudit = (skipCount >= totalRetrievedItems)
? Collections.emptyList()
: entriesAudit.subList(skipCount, end);
return CollectionWithPagingInfo.asPaged(paging, entriesAudit, hasMoreItems, totalItems);
}
/**
@@ -882,4 +889,10 @@ public class AuditImpl implements Audit
}
}
public int getAuditEntriesCountByApp(AuditService.AuditApplication auditApplication)
{
final String applicationName = auditApplication.getKey().substring(1);
return auditService.getAuditEntriesCountByApp(applicationName);
}
}

View File

@@ -82,9 +82,8 @@ public class JacksonHelper implements InitializingBean
//Configure the objectMapper ready for use
objectMapper = new ObjectMapper();
objectMapper.registerModule(module);
objectMapper.setDefaultPropertyInclusion(JsonInclude.Include.NON_EMPTY);
objectMapper.configOverride(java.util.Map.class)
.setInclude(JsonInclude.Value.construct(JsonInclude.Include.NON_EMPTY, null));
objectMapper.setDefaultPropertyInclusion(
JsonInclude.Value.construct(JsonInclude.Include.NON_EMPTY, JsonInclude.Include.ALWAYS));
objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
DateFormat DATE_FORMAT_ISO8601 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
DATE_FORMAT_ISO8601.setTimeZone(TimeZone.getTimeZone("UTC"));

View File

@@ -4,57 +4,121 @@
* %%
* 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
* 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 static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.util.Date;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.web.scripts.solr.SOLRSerializer.SOLRTypeConverter;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.repository.AssociationRef;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
import org.alfresco.util.ISO8601DateFormat;
import org.json.JSONException;
import org.json.JSONObject;
import org.junit.Test;
import org.mockito.Mockito;
public class SOLRSerializerTest
public class SOLRSerializerTest
{
@Test
@Test
public void testDateSerializer()
{
SOLRTypeConverter typeConverter = new SOLRTypeConverter(null);
trip(typeConverter, "1912-01-01T00:40:00-06:00", "1912-01-01T06:40:00.000Z");
trip(typeConverter, "1812-01-01T00:40:00-06:00", "1812-01-01T06:40:00.000Z");
trip(typeConverter, "1845-01-01T00:40:00-06:00", "1845-01-01T06:40:00.000Z");
trip(typeConverter, "1846-01-01T00:40:00-06:00", "1846-01-01T06:40:00.000Z");
trip(typeConverter, "1847-01-01T00:40:00-06:00", "1847-01-01T06:40:00.000Z");
trip(typeConverter, "1848-01-01T00:40:00-06:00", "1848-01-01T06:40:00.000Z");
SOLRTypeConverter typeConverter = new SOLRTypeConverter(null);
trip(typeConverter, "1912-01-01T00:40:00-06:00", "1912-01-01T06:40:00.000Z");
trip(typeConverter, "1812-01-01T00:40:00-06:00", "1812-01-01T06:40:00.000Z");
trip(typeConverter, "1845-01-01T00:40:00-06:00", "1845-01-01T06:40:00.000Z");
trip(typeConverter, "1846-01-01T00:40:00-06:00", "1846-01-01T06:40:00.000Z");
trip(typeConverter, "1847-01-01T00:40:00-06:00", "1847-01-01T06:40:00.000Z");
trip(typeConverter, "1848-01-01T00:40:00-06:00", "1848-01-01T06:40:00.000Z");
}
private void trip( SOLRTypeConverter typeConverter, String iso, String zulu)
{
Date testDate = ISO8601DateFormat.parse(iso);
String strDate = typeConverter.INSTANCE.convert(String.class, testDate);
assertEquals(zulu, strDate);
}
private void trip(SOLRTypeConverter typeConverter, String iso, String zulu)
{
Date testDate = ISO8601DateFormat.parse(iso);
String strDate = typeConverter.INSTANCE.convert(String.class, testDate);
assertEquals(zulu, strDate);
}
/**
* Test SOLR Serialization including values with special characters for ChildAssociationRef
*/
@Test
public void testChildAssociationRefToJSONString()
{
SOLRSerializer solrSerializer = new SOLRSerializer();
solrSerializer.setDictionaryService(Mockito.mock(DictionaryService.class));
solrSerializer.setNamespaceService(Mockito.mock(NamespaceService.class));
solrSerializer.init();
// Create a Child QName including special character \
QName childQName = QName.createQName("hello", "wo\rld");
ChildAssociationRef childAssociationRef = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS,
new NodeRef("workspace://SpacesStore/parent"), childQName,
new NodeRef("workspace://SpacesStore/child"));
String validJsonString = solrSerializer.serializeToJSONString(childAssociationRef);
String jsonObjectString = String.format("{ \"key\": \"%s\" }", validJsonString);
try
{
new JSONObject(jsonObjectString);
}
catch (JSONException e)
{
assertTrue("JSON String " + jsonObjectString + " is not a valid JSON", false);
}
}
/**
* Test SOLR Serialization including values with special characters for AssociationRef
*/
@Test
public void testAssociationRefToJSONString()
{
SOLRSerializer solrSerializer = new SOLRSerializer();
solrSerializer.setDictionaryService(Mockito.mock(DictionaryService.class));
solrSerializer.setNamespaceService(Mockito.mock(NamespaceService.class));
solrSerializer.init();
AssociationRef associationRef = new AssociationRef(
new NodeRef("workspace://SpacesStore/wo\rld"),
ContentModel.ASSOC_ATTACHMENTS,
new NodeRef("workspace://SpacesStore/hello"));
String validJsonString = solrSerializer.serializeToJSONString(associationRef);
String jsonObjectString = String.format("{ \"key\": \"%s\" }", validJsonString);
try
{
new JSONObject(jsonObjectString);
}
catch (JSONException e)
{
assertTrue("JSON String " + jsonObjectString + " is not a valid JSON", false);
}
}
}

View File

@@ -26,6 +26,7 @@
package org.alfresco.rest.api.tests;
import static org.alfresco.rest.api.tests.util.RestApiUtil.toJsonAsStringNonNull;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
@@ -405,6 +406,31 @@ public class AuditAppTest extends AbstractSingleNetworkSiteTest
validateAuditEntryFields(ae, auditApp);
}
// MNT-21936 Audit query Rest API does not return the correct totalItems
int auditEntriesTotalItems = auditEntries.getPaging().getTotalItems();
// set maxItems to 1
Map<String, String> params = new HashMap<>();
params.put("maxItems","1");
auditEntries = auditAppsProxy.getAuditAppEntries(auditApp.getId(), params,
HttpServletResponse.SC_OK);
int AuditEntriesTotalItemsAfterLimit = auditEntries.getPaging().getTotalItems();
int retrievedAuditEntriesCount = auditEntries.getPaging().getCount();
// When totalItems are retrieved using getAuditEntriesCountByApp() method that was introduced in MNT-21936
// 2 audit entries will be created.
assertEquals(auditEntriesTotalItems + 2, AuditEntriesTotalItemsAfterLimit);
assertEquals(1, retrievedAuditEntriesCount);
// set omitTotalItems to true.
params.put("omitTotalItems", "true");
auditEntries = auditAppsProxy.getAuditAppEntries(auditApp.getId(), params,
HttpServletResponse.SC_OK);
// verify that totalItems is null.
assertNull(auditEntries.getPaging().getTotalItems());
// Negative tests
// 401
setRequestContext(networkOne.getId(), networkAdmin, "wrongPassword");

View File

@@ -1,41 +0,0 @@
### Alfresco Repository
[![Build Status](https://travis-ci.com/Alfresco/alfresco-repository.svg?branch=master)](https://travis-ci.com/Alfresco/alfresco-repository)
Repository is a library packaged as a jar file which is part of [Alfresco Content Services Repository](https://community.alfresco.com/docs/DOC-6385-project-overview-repository).
The library contains the following:
* DAOs and SQL scripts
* Various Service implementations
* Utility classes
### Building and testing
The project can be built by running Maven command:
~~~
mvn clean install
~~~
The tests are combined in 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, 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
~~~
### Artifacts
The artifacts can be obtained by:
* downloading from [Alfresco repository](https://artifacts.alfresco.com/nexus/content/groups/public)
* getting as Maven dependency by adding the dependency to your pom file:
~~~
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-repository</artifactId>
<version>version</version>
</dependency>
~~~
and Alfresco Maven repository:
~~~
<repository>
<id>alfresco-maven-repo</id>
<url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
</repository>
~~~
The SNAPSHOT version of the artifact is **never** published.
### Contributing guide
Please use [this guide](CONTRIBUTING.md) to make a contribution to the project.

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>7.183.300-TEST1</version>
<version>7.302</version>
</parent>
<dependencies>
@@ -19,7 +19,6 @@
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-jlan-embed</artifactId>
<version>${dependency.alfresco-jlan.version}</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
@@ -40,7 +39,6 @@
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-heartbeat-data-sender</artifactId>
<version>${dependency.alfresco-hb-data-sender.version}</version>
</dependency>
<dependency>
<groupId>com.sun.mail</groupId>
@@ -55,12 +53,10 @@
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4-DBCP330</version>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
@@ -86,7 +82,6 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>commons-pool</groupId>
@@ -126,7 +121,6 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${dependency.spring.version}</version>
<!-- exclude spring-jcl which is brought in by spring-core -->
<!-- see https://issues.alfresco.com/jira/browse/REPO-4774 -->
<exclusions>
@@ -139,7 +133,6 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${dependency.spring.version}</version>
<!-- exclude spring-jcl which is brought in by spring-orm -->
<!-- see https://issues.alfresco.com/jira/browse/REPO-4774 -->
<exclusions>
@@ -152,17 +145,14 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${dependency.spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${dependency.spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${dependency.spring.version}</version>
</dependency>
<dependency>
<groupId>org.subethamail</groupId>
@@ -215,22 +205,18 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.30</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.30</version>
</dependency>
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.12.0-alfresco-patched-20191004</version>
</dependency>
<dependency>
<groupId>xalan</groupId>
<artifactId>xalan</artifactId>
<version>2.7.2-alfresco</version>
</dependency>
<dependency>
<groupId>xml-apis</groupId>
@@ -271,7 +257,6 @@
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>${dependency.pdfbox.version}</version>
</dependency>
<dependency>
<groupId>org.apache.pdfbox</groupId>
@@ -342,7 +327,6 @@
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.10.5</version>
</dependency>
<dependency>
<groupId>jaxen</groupId>
@@ -379,7 +363,6 @@
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
@@ -392,19 +375,16 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${dependency.jackson-databind.version}</version>
</dependency>
<!-- Spring Surf -->
<dependency>
<groupId>org.alfresco.surf</groupId>
<artifactId>spring-surf-core-configservice</artifactId>
<version>${dependency.webscripts.version}</version>
</dependency>
<dependency>
<groupId>org.alfresco.surf</groupId>
<artifactId>spring-webscripts</artifactId>
<version>${dependency.webscripts.version}</version>
<exclusions>
<exclusion>
<groupId>com.sun</groupId>
@@ -427,7 +407,6 @@
<dependency>
<groupId>org.alfresco.surf</groupId>
<artifactId>spring-webscripts-api</artifactId>
<version>${dependency.webscripts.version}</version>
</dependency>
<!-- Chemistry -->
@@ -451,7 +430,6 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>28.2-jre</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
@@ -467,8 +445,7 @@
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
<version>2.3.2</version>
<exclusions>
<exclusions>
<exclusion>
<groupId>com.mchange</groupId>
<artifactId>*</artifactId>
@@ -801,19 +778,16 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.3.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${dependency.spring.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -852,19 +826,16 @@
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${dependency.postgresql.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${dependency.mysql.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>${dependency.mariadb.version}</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -876,13 +847,11 @@
<dependency>
<groupId>org.antlr</groupId>
<artifactId>gunit</artifactId>
<version>${dependency.antlr.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.alfresco.surf</groupId>
<artifactId>spring-webscripts</artifactId>
<version>${dependency.webscripts.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
@@ -940,7 +909,6 @@
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-pdf-renderer</artifactId>
<version>${dependency.alfresco-pdf-renderer.version}</version>
<classifier>win64</classifier>
<type>tgz</type>
</dependency>
@@ -985,7 +953,6 @@
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-pdf-renderer</artifactId>
<version>${dependency.alfresco-pdf-renderer.version}</version>
<classifier>linux</classifier>
<type>tgz</type>
</dependency>
@@ -1022,54 +989,6 @@
<alfresco-pdf-renderer.exe>${project.build.directory}/test-binaries/alfresco-pdf-renderer/alfresco-pdf-renderer</alfresco-pdf-renderer.exe>
</properties>
</profile>
<profile>
<id>osx-alfresco-pdf-renderer-test</id>
<activation>
<os>
<family>mac</family>
</os>
</activation>
<dependencies>
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-pdf-renderer</artifactId>
<version>${dependency.alfresco-pdf-renderer.version}</version>
<classifier>osx</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 (OS-X) 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}-osx.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>

View File

@@ -81,22 +81,19 @@ public class TransactionAwareHolder<T> extends Holder<T>
{
this.internalHolder = internalHolder;
this.value = internalHolder.getValue();
txListener = new TxAwareHolderListener();
}
@Override
public T getValue()
{
if (TransactionSynchronizationManager.isSynchronizationActive())
{
AlfrescoTransactionSupport.bindListener(txListener);
}
registerTxListenerIfNeeded();
return this.value;
}
@Override
public void setValue(T value)
{
registerTxListenerIfNeeded();
this.value = value;
}
@@ -109,6 +106,17 @@ public class TransactionAwareHolder<T> extends Holder<T>
'}';
}
// MNT-21800 CMIS Web Service Check Out returns error
private void registerTxListenerIfNeeded()
{
if (this.txListener == null && TransactionSynchronizationManager.isSynchronizationActive())
{
TxAwareHolderListener listener = new TxAwareHolderListener();
AlfrescoTransactionSupport.bindListener(listener);
this.txListener = listener;
}
}
private class TxAwareHolderListener extends TransactionListenerAdapter
{
@Override

View File

@@ -177,13 +177,13 @@ public class CMISResultSetRow implements ResultSetRow
context.setScore(getScore());
for (Column column : query.getColumns())
{
// When an SCORE selector is included, score must be adapted to range 0..1 due to CMIS specification
if (column.getFunction()!= null && column.getFunction().getName().equals(Score.NAME))
{
return getNormalisedScore();
}
else if (column.getAlias().equals(columnName))
if (column.getAlias().equals(columnName))
{
//When an SCORE selector is included, score must be adapted to range 0..1 due to CMIS specification
if (column.getFunction()!= null && column.getFunction().getName().equals(Score.NAME))
{
return getNormalisedScore();
}
return column.getFunction().getValue(column.getFunctionArguments(), context);
}
// Special case for one selector - ignore any table aliases

View File

@@ -261,4 +261,15 @@ public interface AuditComponent
* @return a map containing min/max and the associated value
*/
HashMap<String, Long> getAuditMinMaxByApp(String applicationName, List<String> extremes);
/**
* Issue an audit query to retrieve count of records for a given application.
*
* @param applicationName the name of the application
* @return a map containing min/max and the associated value
*/
default int getAuditEntriesCountByApp(String applicationName)
{
return -1;
}
}

View File

@@ -941,4 +941,18 @@ public class AuditComponentImpl implements AuditComponent
return auditDAO.getAuditMinMaxByApp(applicationId, extremes);
}
@Override
public int getAuditEntriesCountByApp(String applicationName)
{
// Get the id for the application
AuditApplication app = auditModelRegistry.getAuditApplicationByName(applicationName);
Long applicationId = app.getApplicationId();
if (applicationId == null)
{
throw new AuditException("No persisted instance exists for audit application: " + app);
}
return auditDAO.getAuditEntriesCountByApp(applicationId);
}
}

View File

@@ -177,4 +177,13 @@ public class AuditServiceImpl implements AuditService
{
return auditComponent.getAuditMinMaxByApp(applicationName, extremes);
}
/**
* {@inheritDoc}
*/
@Override
public int getAuditEntriesCountByApp(String applicationName)
{
return auditComponent.getAuditEntriesCountByApp(applicationName);
}
}

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* 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
@@ -36,6 +36,8 @@ import org.apache.tika.parser.dwg.DWGParser;
/**
* @deprecated OOTB extractors are being moved to T-Engines.
*
* Metadata extractor for the
* {@link org.alfresco.repo.content.MimetypeMap#MIMETYPE_APP_DWG MIMETYPE_APP_DWG}
* and
@@ -55,6 +57,7 @@ import org.apache.tika.parser.dwg.DWGParser;
* @since 3.4
* @author Nick Burch
*/
@Deprecated
public class DWGMetadataExtracter extends TikaPoweredMetadataExtracter
{
private static final String KEY_KEYWORD = "keyword";

View File

@@ -24,7 +24,7 @@
* #L%
*/
/*
* Copyright (C) 2005 Jesper Steen Møller
* Copyright (C) 2005 - 2020 Jesper Steen Møller
*
* This file is part of Alfresco
*
@@ -61,6 +61,8 @@ import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.service.cmr.repository.ContentReader;
/**
* @deprecated OOTB extractors are being moved to T-Engines.
*
* Extracts the following values from HTML documents:
* <pre>
* <b>author:</b> -- cm:author
@@ -75,6 +77,7 @@ import org.alfresco.service.cmr.repository.ContentReader;
* @author Jesper Steen Møller
* @author Derek Hulley
*/
@Deprecated
public class HtmlMetadataExtracter extends AbstractMappingMetadataExtracter
{
private static final String KEY_AUTHOR = "author";

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2017 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
@@ -39,6 +39,8 @@ import org.alfresco.service.cmr.repository.ContentReader;
import org.alfresco.util.PropertyCheck;
/**
* @deprecated OOTB extractors are being moved to T-Engines.
*
* Extracts values from Open Office documents into the following:
* <pre>
* <b>author:</b> -- cm:author
@@ -48,6 +50,7 @@ import org.alfresco.util.PropertyCheck;
*
* @author Neil McErlean
*/
@Deprecated
public class JodConverterMetadataExtracter extends AbstractMappingMetadataExtracter implements OpenOfficeMetadataWorker
{
private OpenOfficeMetadataWorker worker;

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2017 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
@@ -59,6 +59,10 @@ import com.sun.star.util.CloseVetoException;
import com.sun.star.util.XCloseable;
import com.sun.star.util.XRefreshable;
/**
* @deprecated OOTB extractors are being moved to T-Engines.
*/
@Deprecated
public class JodConverterMetadataExtracterWorker implements
OpenOfficeMetadataWorker
{
@@ -120,6 +124,7 @@ public class JodConverterMetadataExtracterWorker implements
}
}
@Deprecated
class ExtractMetadataOfficeTask implements OfficeTask
{
/*
@@ -259,6 +264,7 @@ class ExtractMetadataOfficeTask implements OfficeTask
}
}
@Deprecated
class ResultsCallback
{
private Map<String, Serializable> results = new HashMap<String, Serializable>();

View File

@@ -1,28 +1,28 @@
/*
* #%L
* Alfresco Repository
* %%
* 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 Repository
* %%
* 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
* 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.metadata;
import java.io.Serializable;
@@ -36,6 +36,8 @@ import org.apache.tika.parser.Parser;
import org.apache.tika.parser.mp3.Mp3Parser;
/**
* @deprecated OOTB extractors are being moved to T-Engines.
*
* Extracts the following values from MP3 files:
* <pre>
* <b>songTitle:</b> -- cm:title
@@ -57,6 +59,7 @@ import org.apache.tika.parser.mp3.Mp3Parser;
*
* @author Nick Burch
*/
@Deprecated
public class MP3MetadataExtracter extends TikaAudioMetadataExtracter
{
private static final String KEY_SONG_TITLE = "songTitle";

View File

@@ -1,28 +1,28 @@
/*
* #%L
* Alfresco Repository
* %%
* 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 Repository
* %%
* 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
* 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.metadata;
import java.io.Serializable;
@@ -35,6 +35,8 @@ import org.apache.tika.parser.Parser;
import org.apache.tika.parser.microsoft.OfficeParser;
/**
* @deprecated OOTB extractors are being moved to T-Engines.
*
* Outlook MAPI format email meta-data extractor extracting the following values:
* <pre>
* <b>sentDate:</b> -- cm:sentdate
@@ -53,6 +55,7 @@ import org.apache.tika.parser.microsoft.OfficeParser;
* @since 2.1
* @author Kevin Roast
*/
@Deprecated
public class MailMetadataExtracter extends TikaPoweredMetadataExtracter
{
private static final String KEY_SENT_DATE = "sentDate";

View File

@@ -1,28 +1,28 @@
/*
* #%L
* Alfresco Repository
* %%
* 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 Repository
* %%
* 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
* 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.metadata;
import java.util.List;
@@ -31,11 +31,14 @@ import org.apache.tika.extractor.DocumentSelector;
import org.apache.tika.metadata.Metadata;
/**
* @deprecated OOTB extractors are being moved to T-Engines.
*
* Tika 1.6 has the ability to parse embedded artifacts, such as images in a PDF,
* but this can be very resource intensive so adding this selector
* to parsers and transformers that handle formats with embedded artifacts
* will disable parsing of the specified content types.
*/
@Deprecated
public class MediaTypeDisablingDocumentSelector implements DocumentSelector
{
private List<String> disabledMediaTypes;

View File

@@ -1,30 +1,30 @@
/*
* #%L
* Alfresco Repository
* %%
* 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%
*/
/*
* Copyright (C) 2005 Jesper Steen Møller
* #%L
* Alfresco Repository
* %%
* 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
* 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%
*/
/*
* Copyright (C) 2005 - 2020 Jesper Steen Møller
*
* This file is part of Alfresco
*
@@ -53,6 +53,8 @@ import org.apache.tika.parser.Parser;
import org.apache.tika.parser.microsoft.OfficeParser;
/**
* @deprecated OOTB extractors are being moved to T-Engines.
*
* Office file format Metadata Extracter. This extracter uses the POI library to extract
* the following:
* <pre>
@@ -78,6 +80,7 @@ import org.apache.tika.parser.microsoft.OfficeParser;
* @author Derek Hulley
* @author Nick Burch
*/
@Deprecated
public class OfficeMetadataExtracter extends TikaPoweredMetadataExtracter
{
public static final String KEY_CREATE_DATETIME = "createDateTime";

View File

@@ -1,30 +1,30 @@
/*
* #%L
* Alfresco Repository
* %%
* 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%
*/
/*
* Copyright (C) 2005 Antti Jokipii
* #%L
* Alfresco Repository
* %%
* 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%
*/
/*
* Copyright (C) 2005 - 2020 Antti Jokipii
*
* This file is part of Alfresco
*
@@ -59,6 +59,8 @@ import org.joda.time.format.DateTimeFormatter;
/**
* @deprecated OOTB extractors are being moved to T-Engines.
*
* Metadata extractor for the
* {@link org.alfresco.repo.content.MimetypeMap#MIMETYPE_OPENDOCUMENT_TEXT MIMETYPE_OPENDOCUMENT_XXX}
* mimetypes.
@@ -86,6 +88,7 @@ import org.joda.time.format.DateTimeFormatter;
* @author Antti Jokipii
* @author Derek Hulley
*/
@Deprecated
public class OpenDocumentMetadataExtracter extends TikaPoweredMetadataExtracter
{
private static final String KEY_CREATION_DATE = "creationDate";

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* 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
@@ -23,28 +23,31 @@
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.repo.content.metadata;
import java.io.Serializable;
import java.util.Map;
import org.alfresco.service.cmr.repository.ContentReader;
/**
* An interface that allows separation between the metadata extractor registry and the third party subsystem owning the
* open office connection.
*
* @author dward
*/
public interface OpenOfficeMetadataWorker
{
/**
* @return Returns true if a connection to the Uno server could be established
*/
public boolean isConnected();
/**
* @see AbstractMappingMetadataExtracter#extractRaw(ContentReader)
*/
public Map<String, Serializable> extractRaw(ContentReader reader) throws Throwable;
package org.alfresco.repo.content.metadata;
import java.io.Serializable;
import java.util.Map;
import org.alfresco.service.cmr.repository.ContentReader;
/**
* @deprecated OOTB extractors are being moved to T-Engines.
*
* An interface that allows separation between the metadata extractor registry and the third party subsystem owning the
* open office connection.
*
* @author dward
*/
@Deprecated
public interface OpenOfficeMetadataWorker
{
/**
* @return Returns true if a connection to the Uno server could be established
*/
public boolean isConnected();
/**
* @see AbstractMappingMetadataExtracter#extractRaw(ContentReader)
*/
public Map<String, Serializable> extractRaw(ContentReader reader) throws Throwable;
}

View File

@@ -1,30 +1,30 @@
/*
* #%L
* Alfresco Repository
* %%
* 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%
*/
/*
* Copyright (C) 2005 Jesper Steen Møller
* #%L
* Alfresco Repository
* %%
* 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%
*/
/*
* Copyright (C) 2005 - 2020 Jesper Steen Møller
*
* This file is part of Alfresco
*
@@ -52,6 +52,8 @@ import org.apache.tika.parser.Parser;
import org.apache.tika.parser.pdf.PDFParser;
/**
* @deprecated OOTB extractors are being moved to T-Engines.
*
* Metadata extractor for the PDF documents.
* <pre>
* <b>author:</b> -- cm:author
@@ -66,6 +68,7 @@ import org.apache.tika.parser.pdf.PDFParser;
* @author Jesper Steen Møller
* @author Derek Hulley
*/
@Deprecated
public class PdfBoxMetadataExtracter extends TikaPoweredMetadataExtracter
{
protected static Log pdfLogger = LogFactory.getLog(PdfBoxMetadataExtracter.class);

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* 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
@@ -36,6 +36,8 @@ import org.apache.tika.parser.microsoft.ooxml.OOXMLParser;
import org.springframework.beans.factory.InitializingBean;
/**
* @deprecated OOTB extractors are being moved to T-Engines.
*
* POI-based metadata extractor for Office 07 documents.
* See http://poi.apache.org/ for information on POI.
* <pre>
@@ -52,6 +54,7 @@ import org.springframework.beans.factory.InitializingBean;
* @author Neil McErlean
* @author Dmitry Velichkevich
*/
@Deprecated
public class PoiMetadataExtracter extends TikaPoweredMetadataExtracter
{
protected static Log logger = LogFactory.getLog(PoiMetadataExtracter.class);

View File

@@ -1,28 +1,28 @@
/*
* #%L
* Alfresco Repository
* %%
* 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 Repository
* %%
* 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
* 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.metadata;
import java.io.IOException;
@@ -47,6 +47,8 @@ import org.alfresco.service.cmr.repository.ContentReader;
import org.alfresco.service.namespace.QName;
/**
* @deprecated OOTB extractors are being moved to T-Engines.
*
* Metadata extractor for RFC822 mime emails.
*
* Default configuration: (see RFC822MetadataExtractor.properties)
@@ -66,6 +68,7 @@ import org.alfresco.service.namespace.QName;
* @author Derek Hulley
* @since 3.2
*/
@Deprecated
public class RFC822MetadataExtracter extends AbstractMappingMetadataExtracter
{

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* 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
@@ -42,6 +42,8 @@ import org.gagravarr.tika.FlacParser;
import org.gagravarr.tika.VorbisParser;
/**
* @deprecated OOTB extractors are being moved to T-Engines.
*
* A Metadata Extractor which makes use of the Apache
* Tika Audio Parsers to extract metadata from your
* media files.
@@ -64,6 +66,7 @@ import org.gagravarr.tika.VorbisParser;
* @since 4.0
* @author Nick Burch
*/
@Deprecated
public class TikaAudioMetadataExtracter extends TikaPoweredMetadataExtracter
{
protected static final String KEY_LYRICS = "lyrics";

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* 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
@@ -40,6 +40,8 @@ import org.apache.tika.parser.AutoDetectParser;
import org.apache.tika.parser.Parser;
/**
* @deprecated OOTB extractors are being moved to T-Engines.
*
* A Metadata Extractor which makes use of the Apache
* Tika auto-detection to select the best parser
* to extract the metadata from your document.
@@ -60,16 +62,16 @@ import org.apache.tika.parser.Parser;
* @since 3.4
* @author Nick Burch
*/
@Deprecated
public class TikaAutoMetadataExtracter extends TikaPoweredMetadataExtracter
{
protected static Log logger = LogFactory.getLog(TikaAutoMetadataExtracter.class);
private static AutoDetectParser parser;
private static TikaConfig config;
private static String EXIF_IMAGE_HEIGHT_TAG = "Exif Image Height";
private static String EXIF_IMAGE_WIDTH_TAG = "Exif Image Width";
private static String EXIF_IMAGE_HEIGHT_TAG = "Exif SubIFD:Exif Image Height";
private static String EXIF_IMAGE_WIDTH_TAG = "Exif SubIFD:Exif Image Width";
private static String JPEG_IMAGE_HEIGHT_TAG = "Image Height";
private static String JPEG_IMAGE_WIDTH_TAG = "Image Width";
private static String COMPRESSION_TAG = "Compression";
public static ArrayList<String> SUPPORTED_MIMETYPES;
private static ArrayList<String> buildMimeTypes(TikaConfig tikaConfig)
@@ -119,24 +121,19 @@ public class TikaAutoMetadataExtracter extends TikaPoweredMetadataExtracter
*/
@Override
protected Map<String, Serializable> extractSpecific(Metadata metadata,
Map<String, Serializable> properties, Map<String,String> headers)
Map<String, Serializable> properties, Map<String, String> headers)
{
if(MimetypeMap.MIMETYPE_IMAGE_JPEG.equals(metadata.get(Metadata.CONTENT_TYPE)))
if (MimetypeMap.MIMETYPE_IMAGE_JPEG.equals(metadata.get(Metadata.CONTENT_TYPE)))
{
//check if the image has exif information
if(metadata.get(EXIF_IMAGE_WIDTH_TAG) != null
&& metadata.get(EXIF_IMAGE_HEIGHT_TAG) != null
&& metadata.get(COMPRESSION_TAG) != null)
if (metadata.get(EXIF_IMAGE_WIDTH_TAG) != null && metadata.get(EXIF_IMAGE_HEIGHT_TAG) != null)
{
//replace the exif size properties that will be embedded in the node with
//the guessed dimensions from Tika
putRawValue(TIFF.IMAGE_LENGTH.getName(), extractSize(metadata.get(EXIF_IMAGE_HEIGHT_TAG)), properties);
putRawValue(TIFF.IMAGE_WIDTH.getName(), extractSize(metadata.get(EXIF_IMAGE_WIDTH_TAG)), properties);
putRawValue(JPEG_IMAGE_HEIGHT_TAG, metadata.get(EXIF_IMAGE_HEIGHT_TAG), properties);
putRawValue(JPEG_IMAGE_WIDTH_TAG, metadata.get(EXIF_IMAGE_WIDTH_TAG), properties);
putRawValue(TIFF.IMAGE_LENGTH.getName(), extractSize(metadata.get(JPEG_IMAGE_HEIGHT_TAG)), properties);
putRawValue(TIFF.IMAGE_WIDTH.getName(), extractSize(metadata.get(JPEG_IMAGE_WIDTH_TAG)), properties);
}
}
return properties;
}
}

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* 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
@@ -74,6 +74,8 @@ import org.xml.sax.SAXException;
/**
* @deprecated extractors have been moved to a T-Engine.
*
* The parent of all Metadata Extractors which use
* Apache Tika under the hood. This handles all the
* common parts of processing the files, and the common
@@ -92,6 +94,7 @@ import org.xml.sax.SAXException;
* @author Nick Burch
*/
@AlfrescoPublicApi
@Deprecated
public abstract class TikaPoweredMetadataExtracter
extends AbstractMappingMetadataExtracter
implements MetadataEmbedder

View File

@@ -1,28 +1,28 @@
/*
* #%L
* Alfresco Repository
* %%
* 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 Repository
* %%
* 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
* 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.metadata;
import java.util.ArrayList;
@@ -37,6 +37,8 @@ import org.apache.tika.parser.ParseContext;
import org.apache.tika.parser.Parser;
/**
* @deprecated OOTB extractors are being moved to T-Engines.
*
* A Metadata Extractor which makes use of Apache Tika,
* and allows the selection of the Tika parser to be
* sprung-in to extract the metadata from your document.
@@ -56,6 +58,7 @@ import org.apache.tika.parser.Parser;
* @author Nick Burch
*/
@AlfrescoPublicApi
@Deprecated
public class TikaSpringConfiguredMetadataExtracter extends TikaPoweredMetadataExtracter
{
protected static Log logger = LogFactory.getLog(TikaSpringConfiguredMetadataExtracter.class);

View File

@@ -233,4 +233,15 @@ public interface AuditDAO
* @return a map containing min/max and the associated value
*/
HashMap<String, Long> getAuditMinMaxByApp(long appId, List<String> extremes);
/**
* Issue an audit query to retrieve count of records for a given application.
*
* @param applicationId the database id of the application
* @return a map containing min/max and the associated value
*/
default int getAuditEntriesCountByApp(long applicationId)
{
return -1;
}
}

View File

@@ -65,6 +65,7 @@ public class AuditDAOImpl extends AbstractAuditDAOImpl
private static final String DELETE_ENTRIES_BY_ID = "alfresco.audit.delete_AuditEntriesById";
private static final String INSERT_ENTRY = "alfresco.audit.insert.insert_AuditEntry";
private static final String SELECT_MINMAX_ENTRY_FOR_APP = "alfresco.audit.select_MinMaxAuditEntryId";
private static final String SELECT_COUNT_ENTRIES_FOR_APP = "alfresco.audit.select_CountAuditEntryId";
@SuppressWarnings("unused")
private static final String SELECT_ENTRIES_SIMPLE = "alfresco.audit.select_AuditEntriesSimple";
@@ -223,6 +224,17 @@ public class AuditDAOImpl extends AbstractAuditDAOImpl
return result;
}
@Override
public int getAuditEntriesCountByApp(long applicationId)
{
Map<String, Object> params = new HashMap<>();
params.put("auditAppId", applicationId);
int result = template.selectOne(SELECT_COUNT_ENTRIES_FOR_APP, params);
return result;
}
@SuppressWarnings("unchecked")
@Override
protected void findAuditEntries(

View File

@@ -430,8 +430,8 @@ public class ADMAccessControlListDAO implements AccessControlListDAO
// {
// setFixedAcls(child.getId(), inheritFrom, mergeFrom, sharedAclToReplace, changes, false);
// }
// Already replaced
if(acl.equals(sharedAclToReplace))
// Still has old shared ACL or already replaced
if(acl.equals(sharedAclToReplace) || acl.equals(mergeFrom))
{
propagateOnChildren = setFixAclPending(child.getId(), inheritFrom, mergeFrom, sharedAclToReplace, changes, false, asyncCall, propagateOnChildren);
}
@@ -459,52 +459,62 @@ public class ADMAccessControlListDAO implements AccessControlListDAO
}
}
}
/**
* If async call required adds ASPECT_PENDING_FIX_ACL aspect to nodes when transactionTime reaches max admitted time
*/
private boolean setFixAclPending(Long nodeId, Long inheritFrom, Long mergeFrom, Long sharedAclToReplace, List<AclChange> changes,
boolean set, boolean asyncCall, boolean propagateOnChildren)
{
// check if async call is required
if (!asyncCall)
{
// make regular method call
setFixedAcls(nodeId, inheritFrom, mergeFrom, sharedAclToReplace, changes, set, asyncCall, propagateOnChildren);
return true;
}
else
{
// check transaction time
long transactionStartTime = AlfrescoTransactionSupport.getTransactionStartTime();
long transactionTime = System.currentTimeMillis() - transactionStartTime;
/**
* Adds ASPECT_PENDING_FIX_ACL aspect to nodes when transactionTime reaches max admitted time
* MNT-18308: No longer checks if call is async in order to evaluate time passed to decide if nodes should be
* processed by job. This is now the default behavior for both sync and async calls: when fixedAclMaxTransactionTime
* is exceeded, call turns async and all remaining nodes should be processed by job FixedACLUpdater
*
* @param nodeId
* the nodeId of the current node being processed
* @param inheritFrom
* the parent node's ACL
* @param mergeFrom
* the new shared ACL, if already known.
* @param sharedAclToReplace
* the old shared ACL, to be replaced
* @param changes
* the list in which to record changes
* @param set
* if to set the shared ACL on the parent
* @param asyncCall
* if the call was initially set as async
* @param propagateOnChildren
* current setting of child propagation of ACL creation
* @return new setting on child propagation of ACL creation
*
*/
private boolean setFixAclPending(Long nodeId, Long inheritFrom, Long mergeFrom, Long sharedAclToReplace,
List<AclChange> changes, boolean set, boolean asyncCall, boolean propagateOnChildren)
{
// check transaction time
long transactionStartTime = AlfrescoTransactionSupport.getTransactionStartTime();
long transactionTime = System.currentTimeMillis() - transactionStartTime;
if (transactionTime < fixedAclMaxTransactionTime)
{
// make regular method call if time is under max transaction configured time
setFixedAcls(nodeId, inheritFrom, mergeFrom, sharedAclToReplace, changes, set, asyncCall, propagateOnChildren);
return true;
}
// If flag is still unset or false, the call until now has been sync and will turn async, we should throw a
// warning
if (log.isWarnEnabled() && (AlfrescoTransactionSupport.getResource(FixedAclUpdater.FIXED_ACL_ASYNC_REQUIRED_KEY) == null
|| (Boolean) AlfrescoTransactionSupport.getResource(FixedAclUpdater.FIXED_ACL_ASYNC_REQUIRED_KEY) == false))
{
log.warn("The ACL processing time in transaction " + AlfrescoTransactionSupport.getTransactionId()
+ " exceeded the configured limit of " + fixedAclMaxTransactionTime
+ " ms. The rest of the ACL processing will be done asynchronously.");
}
// set ASPECT_PENDING_FIX_ACL aspect on node to be later on processed with FixedAclUpdater amd switch flag
// FIXED_ACL_ASYNC_REQUIRED_KEY
addFixedAclPendingAspect(nodeId, sharedAclToReplace, inheritFrom);
AlfrescoTransactionSupport.bindResource(FixedAclUpdater.FIXED_ACL_ASYNC_REQUIRED_KEY, true);
// stop propagating on children nodes
return false;
}
if (transactionTime < fixedAclMaxTransactionTime)
{
// make regular method call if time is under max transaction configured time
setFixedAcls(nodeId, inheritFrom, mergeFrom, sharedAclToReplace, changes, set, asyncCall, propagateOnChildren);
return true;
}
else
{
// time exceeded;
if (nodeDAO.getPrimaryChildrenAcls(nodeId).size() == 0)
{
// if node is leaf in tree hierarchy call setFixedAcls now as processing with FixedAclUpdater would be more time consuming
setFixedAcls(nodeId, inheritFrom, mergeFrom, sharedAclToReplace, changes, set, asyncCall, false);
}
else
{
// set ASPECT_PENDING_FIX_ACL aspect on node to be later on processed with FixedAclUpdater
addFixedAclPendingAspect(nodeId, sharedAclToReplace, inheritFrom);
AlfrescoTransactionSupport.bindResource(FixedAclUpdater.FIXED_ACL_ASYNC_REQUIRED_KEY, true);
}
// stop propagating on children nodes
return false;
}
}
}
private void addFixedAclPendingAspect(Long nodeId, Long sharedAclToReplace, Long inheritFrom)
{
Set<QName> aspect = new HashSet<>();

View File

@@ -321,7 +321,10 @@ public class FixedAclUpdater extends TransactionListenerAdapter implements Appli
if (nodes.size() < maxItemBatchSize)
{
nodes.add(nodePair.getSecond());
maxNodeId = nodePair.getFirst();
if (nodePair.getFirst() > maxNodeId)
{
maxNodeId = nodePair.getFirst();
}
return true;
}
return false;

View File

@@ -43,6 +43,7 @@ import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransacti
import org.alfresco.service.cmr.action.Action;
import org.alfresco.service.cmr.action.ParameterDefinition;
import org.alfresco.service.cmr.coci.CheckOutCheckInService;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.download.DownloadRequest;
import org.alfresco.service.cmr.download.DownloadStatus;
import org.alfresco.service.cmr.download.DownloadStatus.Status;
@@ -84,6 +85,7 @@ public class CreateDownloadArchiveAction extends ActionExecuterAbstractBase
private NodeService nodeService;
private RetryingTransactionHelper transactionHelper;
private DownloadStatusUpdateService updateService;
private DictionaryService dictionaryService;
private long maximumContentSize = -1l;
@@ -167,6 +169,11 @@ public class CreateDownloadArchiveAction extends ActionExecuterAbstractBase
this.updateService = updateService;
}
public void setDictionaryService(DictionaryService dictionaryService)
{
this.dictionaryService = dictionaryService;
}
/**
* Create an archive file containing content from the repository.
*
@@ -246,7 +253,7 @@ public class CreateDownloadArchiveAction extends ActionExecuterAbstractBase
{
// perform the actual export
final File tempFile = TempFileProvider.createTempFile(TEMP_FILE_PREFIX, TEMP_FILE_SUFFIX);
final ZipDownloadExporter handler = new ZipDownloadExporter(tempFile, checkOutCheckInService, nodeService, transactionHelper, updateService, downloadStorage, actionedUponNodeRef, estimator.getSize(), estimator.getFileCount());
final ZipDownloadExporter handler = new ZipDownloadExporter(tempFile, checkOutCheckInService, nodeService, transactionHelper, updateService, downloadStorage, dictionaryService, actionedUponNodeRef, estimator.getSize(), estimator.getFileCount());
try {
exporterService.exportView(handler, crawlerParameters, null);

View File

@@ -39,6 +39,7 @@ import org.alfresco.model.ContentModel;
import org.alfresco.repo.transaction.RetryingTransactionHelper;
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
import org.alfresco.service.cmr.coci.CheckOutCheckInService;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.download.DownloadStatus;
import org.alfresco.service.cmr.download.DownloadStatus.Status;
import org.alfresco.service.cmr.repository.ContentData;
@@ -77,6 +78,7 @@ public class ZipDownloadExporter extends BaseExporter
private RetryingTransactionHelper transactionHelper;
private DownloadStorage downloadStorage;
private DictionaryService dictionaryService;
private DownloadStatusUpdateService updateService;
private Deque<Pair<String, NodeRef>> path = new LinkedList<Pair<String, NodeRef>>();
@@ -93,11 +95,12 @@ public class ZipDownloadExporter extends BaseExporter
* @param transactionHelper RetryingTransactionHelper
* @param updateService DownloadStatusUpdateService
* @param downloadStorage DownloadStorage
* @param dictionaryService DictionaryService
* @param downloadNodeRef NodeRef
* @param total long
* @param totalFileCount long
*/
public ZipDownloadExporter(File zipFile, CheckOutCheckInService checkOutCheckInService, NodeService nodeService, RetryingTransactionHelper transactionHelper, DownloadStatusUpdateService updateService, DownloadStorage downloadStorage, NodeRef downloadNodeRef, long total, long totalFileCount)
public ZipDownloadExporter(File zipFile, CheckOutCheckInService checkOutCheckInService, NodeService nodeService, RetryingTransactionHelper transactionHelper, DownloadStatusUpdateService updateService, DownloadStorage downloadStorage, DictionaryService dictionaryService, NodeRef downloadNodeRef, long total, long totalFileCount)
{
super(checkOutCheckInService, nodeService);
try
@@ -106,6 +109,7 @@ public class ZipDownloadExporter extends BaseExporter
this.updateService = updateService;
this.transactionHelper = transactionHelper;
this.downloadStorage = downloadStorage;
this.dictionaryService = dictionaryService;
this.downloadNodeRef = downloadNodeRef;
this.total = total;
@@ -134,7 +138,7 @@ public class ZipDownloadExporter extends BaseExporter
{
this.currentName = (String)nodeService.getProperty(nodeRef, ContentModel.PROP_NAME);
path.push(new Pair<String, NodeRef>(currentName, nodeRef));
if (ContentModel.TYPE_FOLDER.equals(nodeService.getType(nodeRef)))
if (dictionaryService.isSubClass(nodeService.getType(nodeRef), ContentModel.TYPE_FOLDER))
{
String path = getPath() + PATH_SEPARATOR;
ZipArchiveEntry archiveEntry = new ZipArchiveEntry(path);

View File

@@ -196,7 +196,7 @@ public class PreferenceServiceImpl implements PreferenceService, Extensible
{
if(jsonPrefs.has(preferenceName))
{
preferenceValue = jsonPrefs.getString(preferenceName);
preferenceValue = String.valueOf(jsonPrefs.get(preferenceName));
}
}
}

View File

@@ -1,28 +1,28 @@
/*
* #%L
* Alfresco Repository
* %%
* 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 Repository
* %%
* 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.rule.ruletrigger;
import java.io.Serializable;
@@ -141,7 +141,7 @@ public class OnPropertyUpdateRuleTrigger extends RuleTriggerAbstractBase
for (QName name : keys)
{
// Skip rule firing on this content property for performance reasons
if (name.equals(ContentModel.PROP_PREFERENCE_VALUES))
if (name.equals(ContentModel.PROP_PREFERENCE_VALUES) || name.equals(ContentModel.PROP_CASCADE_CRC))
{
continue;
}

View File

@@ -1,28 +1,28 @@
/*
* #%L
* Alfresco Repository
* %%
* 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 Repository
* %%
* 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.search;
import java.io.IOException;
@@ -136,7 +136,7 @@ public class QueryRegisterComponentImpl implements QueryRegisterComponent
try
{
InputStream is = this.getClass().getClassLoader().getResourceAsStream(location);
SAXReader reader = new SAXReader();
SAXReader reader = SAXReader.createDefault();
Document document = reader.read(is);
is.close();
QueryCollection collection = QueryCollectionImpl.createQueryCollection(document.getRootElement(), dictionaryService, namespaceService);

View File

@@ -240,6 +240,11 @@ public class DBResultSet extends AbstractResultSet
nodeRefs[n+1] = nodeRef == null ? null : tenantService.getBaseName(nodeRef);
}
}
}
}
public NodeService getNodeService()
{
return nodeService;
}
}

View File

@@ -25,11 +25,13 @@
*/
package org.alfresco.repo.search.impl.querymodel.impl.db;
import java.io.Serializable;
import java.util.Map;
import org.alfresco.repo.search.AbstractResultSetRow;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.search.ResultSet;
import org.alfresco.service.cmr.search.ResultSet;
import org.alfresco.service.namespace.QName;
/**
* @author Andy
@@ -82,6 +84,13 @@ public class DBResultSetRow extends AbstractResultSetRow
public float getScore(String selectorName)
{
throw new UnsupportedOperationException();
}
@Override
protected Map<QName, Serializable> getDirectProperties()
{
DBResultSet rs = (DBResultSet) getResultSet();
return rs.getNodeService().getProperties(rs.getNodeRef(getIndex()));
}

View File

@@ -54,6 +54,7 @@ import javax.naming.InvalidNameException;
import javax.naming.Name;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import javax.naming.ServiceUnavailableException;
import javax.naming.directory.Attribute;
import javax.naming.directory.Attributes;
import javax.naming.directory.DirContext;
@@ -882,6 +883,16 @@ public class LDAPUserRegistry implements UserRegistry, LDAPNameResolver, Initial
continue;
}
}
catch (ServiceUnavailableException | CommunicationException e)
{
// MNT-21614: Check & fail if communication breaks due to ServiceUnavailableException or CommunicationException
if (e.getMessage() != null)
{
Object[] params = {e.getLocalizedMessage() };
throw new AlfrescoRuntimeException("synchronization.err.ldap.search", params, e);
}
continue;
}
catch (NamingException e)
{
// Check if it is a timeout and fail

View File

@@ -691,20 +691,18 @@ public class SOLRTrackingComponentImpl implements SOLRTrackingComponent
return new ArrayList<Long>(visited);
}
/** Get properties that we want to be indexed. */
protected Map<QName, Serializable> getProperties(Long nodeId)
{
Map<QName, Serializable> props = null;
// ALF-10641
// Residual properties are un-indexed -> break serlialisation
// Residual properties are un-indexed -> break serialisation
nodeDAO.setCheckNodeConsistency();
Map<QName, Serializable> sourceProps = nodeDAO.getNodeProperties(nodeId);
props = new HashMap<QName, Serializable>((int)(sourceProps.size() * 1.3));
Map<QName, Serializable> props = new HashMap<>(sourceProps.size());
for(QName propertyQName : sourceProps.keySet())
{
PropertyDefinition propDef = dictionaryService.getProperty(propertyQName);
if(propDef != null)
if(propDef != null && propDef.isIndexed())
{
props.put(propertyQName, sourceProps.get(propertyQName));
}
@@ -865,7 +863,22 @@ public class SOLRTrackingComponentImpl implements SOLRTrackingComponent
}
else
{
throw new AlfrescoRuntimeException("Nodes with no type are ignored by SOLR");
QName typeQName = null;
TypeDefinition typeDefinition = null;
String errorMessage = "NodeId " + nodeId + " with nodeRef " + nodeRef;
typeQName = nodeDAO.getNodeType(nodeId);
if (typeQName != null)
{
errorMessage += " has type " + typeQName + ", but this type is not registered in DictionaryService.";
}
else
{
errorMessage += " has no type.";
}
throw new AlfrescoRuntimeException(errorMessage + " It will be ignored by SOLR.");
}
}

View File

@@ -241,4 +241,15 @@ public interface AuditService
* @return a map containing min/max and the associated value
*/
HashMap<String, Long> getAuditMinMaxByApp(String applicationName, List<String> extremes);
/**
* Issue an audit query to retrieve min / max audit record id for a given application.
*
* @param applicationName the name of the application
* @return a map containing min/max and the associated value
*/
default int getAuditEntriesCountByApp(String applicationName)
{
return -1;
}
}

View File

@@ -598,8 +598,8 @@
<property name="ticketsCache">
<ref bean="ticketsCache" />
</property>
<property name="usernameKey">
<ref bean="usernameKeyCache" />
<property name="usernameToTicketIdCache">
<ref bean="usernameToTicketIdCache" />
</property>
<!-- The period for which tickets are valid in XML duration format. -->
<!-- The default is PT1H for one hour. -->

View File

@@ -281,8 +281,8 @@
<constructor-arg value="cache.ticketsCache"/>
</bean>
<bean name="usernameKeyCache" factory-bean="cacheFactory" factory-method="createCache">
<constructor-arg value="cache.usernameKeyCache"/>
<bean name="usernameToTicketIdCache" factory-bean="cacheFactory" factory-method="createCache">
<constructor-arg value="cache.usernameToTicketIdCache"/>
</bean>
<!-- ===================================== -->

View File

@@ -333,14 +333,14 @@ cache.ticketsCache.eviction-policy=LRU
cache.ticketsCache.merge-policy=com.hazelcast.map.merge.PutIfAbsentMapMergePolicy
cache.ticketsCache.readBackupData=false
cache.usernameKeyCache.maxItems=1000
cache.usernameKeyCache.timeToLiveSeconds=0
cache.usernameKeyCache.maxIdleSeconds=0
cache.usernameKeyCache.cluster.type=fully-distributed
cache.usernameKeyCache.backup-count=1
cache.usernameKeyCache.eviction-policy=LRU
cache.usernameKeyCache.merge-policy=com.hazelcast.map.merge.PutIfAbsentMapMergePolicy
cache.usernameKeyCache.readBackupData=false
cache.usernameToTicketIdCache.maxItems=1000
cache.usernameToTicketIdCache.timeToLiveSeconds=0
cache.usernameToTicketIdCache.maxIdleSeconds=0
cache.usernameToTicketIdCache.cluster.type=fully-distributed
cache.usernameToTicketIdCache.backup-count=1
cache.usernameToTicketIdCache.eviction-policy=LRU
cache.usernameToTicketIdCache.merge-policy=com.hazelcast.map.merge.PutIfAbsentMapMergePolicy
cache.usernameToTicketIdCache.readBackupData=false
cache.authorityEntitySharedCache.tx.maxItems=50000
cache.authorityEntitySharedCache.tx.statsEnabled=${caches.tx.statsEnabled}

View File

@@ -89,18 +89,19 @@
<bean id="downloadContentServiceHelper" class="org.alfresco.repo.download.LocalContentServiceHelper">
<property name="contentService" ref="contentService"/>
</bean>
<bean id="createDownloadArchiveAction" class="org.alfresco.repo.download.CreateDownloadArchiveAction" parent="action-executer">
<property name="checkOutCheckInSerivce" ref="checkOutCheckInService"/>
<property name="contentServiceHelper" ref="downloadContentServiceHelper" />
<property name="downloadStorage" ref="downloadStorage" />
<property name="exporterService" ref="downloadExporterComponent" />
<property name="maximumContentSize" value="${download.maxContentSize}" />
<property name="nodeService" ref="nodeService" />
<property name="publicAction" value="false"/>
<property name="transactionHelper" ref="retryingTransactionHelper"/>
<property name="updateService" ref="downloadStatusUpdateService"/>
</bean>
<bean id="createDownloadArchiveAction" class="org.alfresco.repo.download.CreateDownloadArchiveAction" parent="action-executer">
<property name="checkOutCheckInSerivce" ref="checkOutCheckInService"/>
<property name="contentServiceHelper" ref="downloadContentServiceHelper"/>
<property name="downloadStorage" ref="downloadStorage"/>
<property name="exporterService" ref="downloadExporterComponent"/>
<property name="maximumContentSize" value="${download.maxContentSize}"/>
<property name="nodeService" ref="nodeService"/>
<property name="publicAction" value="false"/>
<property name="transactionHelper" ref="retryingTransactionHelper"/>
<property name="updateService" ref="downloadStatusUpdateService"/>
<property name="dictionaryService" ref="dictionaryService"/>
</bean>
<bean id="downloadExporterComponent" parent="exporterComponent">
<property name="exportSecondaryNodes" value="true"/>

View File

@@ -15,10 +15,12 @@
</bean>
<bean id="keyStoreParameters" class="org.alfresco.encryption.KeyStoreParameters" init-method="init">
<property name="id" value="metadata-keystore"/>
<property name="name" value="Key Store"/>
<property name="location" value="${encryption.keystore.location}"/>
<property name="provider" value="${encryption.keystore.provider}"/>
<property name="type" value="${encryption.keystore.type}"/>
<!-- This property is left for backwards compatibility -->
<property name="keyMetaDataFileLocation" value="${encryption.keystore.keyMetaData.location}"/>
</bean>
@@ -30,18 +32,22 @@
<!-- TODO i18n for key store names -->
<bean id="sslKeyStoreParameters" class="org.alfresco.encryption.KeyStoreParameters" init-method="init">
<property name="id" value="ssl-keystore"/>
<property name="name" value="SSL Key Store"/>
<property name="location" value="${encryption.ssl.keystore.location}"/>
<property name="type" value="${encryption.ssl.keystore.type}"/>
<property name="provider" value="${encryption.ssl.keystore.provider}"/>
<!-- This property is left for backwards compatibility -->
<property name="keyMetaDataFileLocation" value="${encryption.ssl.keystore.keyMetaData.location}"/>
</bean>
<bean id="sslTrustStoreParameters" class="org.alfresco.encryption.KeyStoreParameters" init-method="init">
<property name="id" value="ssl-truststore"/>
<property name="name" value="SSL Trust Store"/>
<property name="location" value="${encryption.ssl.truststore.location}"/>
<property name="type" value="${encryption.ssl.truststore.type}"/>
<property name="provider" value="${encryption.ssl.truststore.provider}"/>
<!-- This property is left for backwards compatibility -->
<property name="keyMetaDataFileLocation" value="${encryption.ssl.truststore.keyMetaData.location}"/>
</bean>
@@ -71,10 +77,12 @@
</bean>
<bean id="backupKeyStoreParameters" class="org.alfresco.encryption.KeyStoreParameters" init-method="init">
<property name="id" value="metadata-backup-keystore"/>
<property name="name" value="Backup Key Store"/>
<property name="location" value="${encryption.keystore.backup.location}"/>
<property name="provider" value="${encryption.keystore.backup.provider}"/>
<property name="type" value="${encryption.keystore.backup.type}"/>
<!-- This property is left for backwards compatibility -->
<property name="keyMetaDataFileLocation" value="${encryption.keystore.backup.keyMetaData.location}"/>
</bean>

View File

@@ -59,6 +59,10 @@
<parameter property="min" jdbcType="VARCHAR" javaType="String"/>
<parameter property="max" jdbcType="VARCHAR" javaType="String"/>
</parameterMap>
<parameterMap id="parameter_AuditAppId" type="map">
<parameter property="auditAppId" jdbcType="BIGINT" javaType="Long"/>
</parameterMap>
<!-- -->
<!-- SQL Snippets -->
@@ -277,6 +281,16 @@
<include refid="select_AuditEntriesOrderBySnippet"/>
</sql>
<!-- Get the count of audit entries for application -->
<select id="select_CountAuditEntryId" parameterMap="parameter_AuditAppId" resultType="int">
select
COUNT(id)
from
alf_audit_entry
where
alf_audit_entry.audit_app_id = #{auditAppId}
</select>
<!-- Get the maximum/minimum audit entry id for application -->
<select id="select_MinMaxAuditEntryId" parameterMap="parameter_IdMinMaxMap" resultMap="result_minMaxMap">
select

View File

@@ -286,8 +286,8 @@ cm_contentmodel.property.cm_originator.title=From
cm_contentmodel.property.cm_originator.description=From
cm_contentmodel.property.cm_addressee.title=To
cm_contentmodel.property.cm_addressee.description=To
cm_contentmodel.property.cm_addressees.title=CC
cm_contentmodel.property.cm_addressees.description=CC
cm_contentmodel.property.cm_addressees.title=All Recipients
cm_contentmodel.property.cm_addressees.description=All Recipients
cm_contentmodel.property.cm_subjectline.title=Subject
cm_contentmodel.property.cm_subjectline.description=Subject
cm_contentmodel.property.cm_sentdate.title=Sent Date

View File

@@ -286,8 +286,8 @@ cm_contentmodel.property.cm_originator.title=Od
cm_contentmodel.property.cm_originator.description=Od
cm_contentmodel.property.cm_addressee.title=Komu
cm_contentmodel.property.cm_addressee.description=Komu
cm_contentmodel.property.cm_addressees.title=Kopie
cm_contentmodel.property.cm_addressees.description=Kopie
cm_contentmodel.property.cm_addressees.title=V\u0161ichni p\u0159\u00edjemci
cm_contentmodel.property.cm_addressees.description=V\u0161ichni p\u0159\u00edjemci
cm_contentmodel.property.cm_subjectline.title=P\u0159edm\u011bt
cm_contentmodel.property.cm_subjectline.description=P\u0159edm\u011bt
cm_contentmodel.property.cm_sentdate.title=Datum odesl\u00e1n\u00ed

View File

@@ -286,8 +286,8 @@ cm_contentmodel.property.cm_originator.title=Fra
cm_contentmodel.property.cm_originator.description=Fra
cm_contentmodel.property.cm_addressee.title=Til
cm_contentmodel.property.cm_addressee.description=Til
cm_contentmodel.property.cm_addressees.title=Cc
cm_contentmodel.property.cm_addressees.description=Cc
cm_contentmodel.property.cm_addressees.title=Alle modtagere
cm_contentmodel.property.cm_addressees.description=Alle modtagere
cm_contentmodel.property.cm_subjectline.title=Emne
cm_contentmodel.property.cm_subjectline.description=Emne
cm_contentmodel.property.cm_sentdate.title=Afsendelsesdato

View File

@@ -286,8 +286,8 @@ cm_contentmodel.property.cm_originator.title=Von
cm_contentmodel.property.cm_originator.description=Von
cm_contentmodel.property.cm_addressee.title=An
cm_contentmodel.property.cm_addressee.description=An
cm_contentmodel.property.cm_addressees.title=Cc
cm_contentmodel.property.cm_addressees.description=Cc
cm_contentmodel.property.cm_addressees.title=Alle Empf\u00e4nger
cm_contentmodel.property.cm_addressees.description=Alle Empf\u00e4nger
cm_contentmodel.property.cm_subjectline.title=Betreff
cm_contentmodel.property.cm_subjectline.description=Betreff
cm_contentmodel.property.cm_sentdate.title=Sendedatum

View File

@@ -286,8 +286,8 @@ cm_contentmodel.property.cm_originator.title=De
cm_contentmodel.property.cm_originator.description=De
cm_contentmodel.property.cm_addressee.title=Para
cm_contentmodel.property.cm_addressee.description=Para
cm_contentmodel.property.cm_addressees.title=CC
cm_contentmodel.property.cm_addressees.description=CC
cm_contentmodel.property.cm_addressees.title=Todos los destinatarios
cm_contentmodel.property.cm_addressees.description=Todos los destinatarios
cm_contentmodel.property.cm_subjectline.title=Asunto
cm_contentmodel.property.cm_subjectline.description=Asunto
cm_contentmodel.property.cm_sentdate.title=Fecha de env\u00edo

View File

@@ -286,8 +286,8 @@ cm_contentmodel.property.cm_originator.title=L\u00e4hett\u00e4j\u00e4
cm_contentmodel.property.cm_originator.description=L\u00e4hett\u00e4j\u00e4
cm_contentmodel.property.cm_addressee.title=Vastaanottaja
cm_contentmodel.property.cm_addressee.description=Vastaanottaja
cm_contentmodel.property.cm_addressees.title=Kopio
cm_contentmodel.property.cm_addressees.description=Kopio
cm_contentmodel.property.cm_addressees.title=Kaikki vastaanottajat
cm_contentmodel.property.cm_addressees.description=Kaikki vastaanottajat
cm_contentmodel.property.cm_subjectline.title=Aihe
cm_contentmodel.property.cm_subjectline.description=Aihe
cm_contentmodel.property.cm_sentdate.title=L\u00e4hetysp\u00e4iv\u00e4m\u00e4\u00e4r\u00e4

View File

@@ -286,8 +286,8 @@ cm_contentmodel.property.cm_originator.title=De
cm_contentmodel.property.cm_originator.description=De
cm_contentmodel.property.cm_addressee.title=\u00c0
cm_contentmodel.property.cm_addressee.description=\u00c0
cm_contentmodel.property.cm_addressees.title=CC
cm_contentmodel.property.cm_addressees.description=CC
cm_contentmodel.property.cm_addressees.title=Tous les destinataires
cm_contentmodel.property.cm_addressees.description=Tous les destinataires
cm_contentmodel.property.cm_subjectline.title=Sujet
cm_contentmodel.property.cm_subjectline.description=Sujet
cm_contentmodel.property.cm_sentdate.title=Date d'envoi

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