mirror of
				https://github.com/Alfresco/alfresco-community-repo.git
				synced 2025-10-29 15:21:53 +00:00 
			
		
		
		
	Compare commits
	
		
			4 Commits
		
	
	
		
			23.2.0.23
			...
			feature/20
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | 0a8052d0ab | ||
|  | a996fe2d2f | ||
|  | e0db9362a4 | ||
|  | 63d853750e | 
							
								
								
									
										96
									
								
								.github/dependabot.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										96
									
								
								.github/dependabot.yml
									
									
									
									
										vendored
									
									
								
							| @@ -14,6 +14,15 @@ updates: | ||||
|     timezone: Africa/Abidjan | ||||
|   open-pull-requests-limit: 99 | ||||
|   ignore: | ||||
|   - dependency-name: com.google.code.gson:gson | ||||
|     versions: | ||||
|     - "> 2.8.6" | ||||
|   - dependency-name: io.fabric8:fabric8-maven-plugin | ||||
|     versions: | ||||
|     - "> 4.4.0" | ||||
|   - dependency-name: javax.servlet:javax.servlet-api | ||||
|     versions: | ||||
|     - "> 3.0.1" | ||||
|   - dependency-name: org.acegisecurity:acegi-security | ||||
|     versions: | ||||
|     - "> 0.8.2_patched" | ||||
| @@ -43,7 +52,92 @@ updates: | ||||
|     - "> 1.0.0" | ||||
|   - dependency-name: org.freemarker:freemarker | ||||
|     versions: | ||||
|     - "> 2.3.31-alfresco-patched" | ||||
|     - "> 2.3.20-alfresco-patched-20200421" | ||||
|   - dependency-name: org.eclipse.jetty:jetty-server | ||||
|     versions: | ||||
|     - 9.4.38.v20210224 | ||||
|   - dependency-name: org.alfresco.tas:cmis | ||||
|     versions: | ||||
|     - "1.28" | ||||
|   - dependency-name: org.springframework:spring-webmvc | ||||
|     versions: | ||||
|     - 5.3.4 | ||||
|     - 5.3.5 | ||||
|   - dependency-name: org.springframework:spring-web | ||||
|     versions: | ||||
|     - 5.3.4 | ||||
|     - 5.3.5 | ||||
|   - dependency-name: org.springframework:spring-tx | ||||
|     versions: | ||||
|     - 5.3.4 | ||||
|     - 5.3.5 | ||||
|   - dependency-name: org.springframework:spring-orm | ||||
|     versions: | ||||
|     - 5.3.4 | ||||
|     - 5.3.5 | ||||
|   - dependency-name: org.springframework:spring-test | ||||
|     versions: | ||||
|     - 5.3.4 | ||||
|     - 5.3.5 | ||||
|   - dependency-name: org.springframework:spring-jms | ||||
|     versions: | ||||
|     - 5.3.4 | ||||
|     - 5.3.5 | ||||
|   - dependency-name: org.springframework:spring-jdbc | ||||
|     versions: | ||||
|     - 5.3.4 | ||||
|     - 5.3.5 | ||||
|   - dependency-name: org.springframework:spring-expression | ||||
|     versions: | ||||
|     - 5.3.4 | ||||
|     - 5.3.5 | ||||
|   - dependency-name: org.springframework:spring-core | ||||
|     versions: | ||||
|     - 5.3.4 | ||||
|     - 5.3.5 | ||||
|   - dependency-name: org.springframework:spring-context-support | ||||
|     versions: | ||||
|     - 5.3.4 | ||||
|     - 5.3.5 | ||||
|   - dependency-name: org.springframework:spring-context | ||||
|     versions: | ||||
|     - 5.3.4 | ||||
|     - 5.3.5 | ||||
|   - dependency-name: org.springframework:spring-beans | ||||
|     versions: | ||||
|     - 5.3.4 | ||||
|     - 5.3.5 | ||||
|   - dependency-name: org.springframework:spring-aop | ||||
|     versions: | ||||
|     - 5.3.4 | ||||
|     - 5.3.5 | ||||
|   - dependency-name: org.alfresco.tas:restapi | ||||
|     versions: | ||||
|     - "1.55" | ||||
|   - dependency-name: org.eclipse.jetty:jetty-security | ||||
|     versions: | ||||
|     - 11.0.1 | ||||
|   - dependency-name: org.alfresco.aos-module:alfresco-vti-bin | ||||
|     versions: | ||||
|     - 1.4.0-M1 | ||||
|   - dependency-name: org.alfresco.aos-module:alfresco-aos-module-distributionzip | ||||
|     versions: | ||||
|     - 1.4.0-M1 | ||||
|   - dependency-name: org.alfresco.aos-module:alfresco-aos-module | ||||
|     versions: | ||||
|     - 1.4.0-M1 | ||||
|   - dependency-name: org.alfresco.surf:spring-webscripts-api | ||||
|     versions: | ||||
|     - "8.16" | ||||
|   - dependency-name: org.alfresco.surf:spring-webscripts:tests | ||||
|     versions: | ||||
|     - "8.16" | ||||
|   - dependency-name: org.alfresco.surf:spring-webscripts | ||||
|     versions: | ||||
|     - "8.16" | ||||
|   - dependency-name: org.alfresco.surf:spring-surf-core-configservice | ||||
|     versions: | ||||
|     - "8.16" | ||||
|   registries: | ||||
|   - maven-repository-artifacts-alfresco-com-nexus-content-groups-int | ||||
| - package-ecosystem: "docker" | ||||
|   | ||||
							
								
								
									
										236
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										236
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							| @@ -33,12 +33,11 @@ jobs: | ||||
|     runs-on: ubuntu-latest | ||||
|     if: > | ||||
|       !contains(github.event.head_commit.message, '[skip tests]') && | ||||
|       !contains(github.event.head_commit.message, '[force') | ||||
|       !contains(github.event.head_commit.message, '[force]') | ||||
|     steps: | ||||
|       - uses: actions/checkout@v3 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v1.35.2       | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.33.0 | ||||
|       - name: "Init" | ||||
|         run: bash ./scripts/ci/init.sh | ||||
|       - name: "Prepare maven cache and check compilation" | ||||
| @@ -46,78 +45,27 @@ jobs: | ||||
|       - name: "Clean Maven cache" | ||||
|         run: bash ./scripts/ci/cleanup_cache.sh | ||||
|  | ||||
|   veracode_sca: | ||||
|   veracode: | ||||
|     name: "Source Clear Scan (SCA)" | ||||
|     runs-on: ubuntu-latest | ||||
|     needs: [prepare] | ||||
|     if: > | ||||
|       (github.ref_name == 'master' || startsWith(github.ref_name, 'release/') || github.event_name == 'pull_request') && | ||||
|       ((github.ref_name == 'master' || startsWith(github.ref_name, 'release/')) && github.event_name != 'pull_request') && | ||||
|       !contains(github.event.head_commit.message, '[skip tests]') && | ||||
|       !contains(github.event.head_commit.message, '[force') | ||||
|       !contains(github.event.head_commit.message, '[force]') | ||||
|     steps: | ||||
|       - uses: actions/checkout@v3 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v1.35.2       | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.33.0 | ||||
|       - name: "Init" | ||||
|         run: bash ./scripts/ci/init.sh | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/veracode@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/veracode@v1.33.0 | ||||
|         continue-on-error: true | ||||
|         with: | ||||
|           srcclr-api-token: ${{ secrets.SRCCLR_API_TOKEN }} | ||||
|       - name: "Clean Maven cache" | ||||
|         run: bash ./scripts/ci/cleanup_cache.sh | ||||
|  | ||||
|   veracode_sast: | ||||
|     name: "Pipeline SAST Scan" | ||||
|     runs-on: ubuntu-latest | ||||
|     needs: [prepare] | ||||
|     if: > | ||||
|       (github.ref_name == 'master' || startsWith(github.ref_name, 'release/') || github.event_name == 'pull_request') && | ||||
|       !contains(github.event.head_commit.message, '[skip tests]') && | ||||
|       !contains(github.event.head_commit.message, '[force') | ||||
|     steps: | ||||
|       - uses: actions/checkout@v3 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/github-download-file@v5.6.0 | ||||
|         with: | ||||
|           token: ${{ secrets.BOT_GITHUB_TOKEN }} | ||||
|           repository: "Alfresco/veracode-baseline-archive" | ||||
|           file-path: "alfresco-community-repo/alfresco-community-repo-baseline.json" | ||||
|           target: "baseline.json" | ||||
|       - name: "Build" | ||||
|         timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} | ||||
|         run: | | ||||
|           bash ./scripts/ci/init.sh | ||||
|           bash ./scripts/ci/build.sh | ||||
|       - name: "Run SAST Scan" | ||||
|         uses: veracode/Veracode-pipeline-scan-action@v1.0.10 | ||||
|         with: | ||||
|           vid: ${{ secrets.VERACODE_API_ID }} | ||||
|           vkey: ${{ secrets.VERACODE_API_KEY }} | ||||
|           file: "packaging/war/target/alfresco.war" | ||||
|           fail_build: true | ||||
|           project_name: alfresco-community-repo | ||||
|           issue_details: true | ||||
|           veracode_policy_name: Alfresco Default | ||||
|           summary_output: true | ||||
|           summary_output_file: results.json | ||||
|           summary_display: true | ||||
|           baseline_file: baseline.json | ||||
|       - name: Upload scan result | ||||
|         if: success() || failure() | ||||
|         run: zip readable_output.zip results.json | ||||
|       - name: Upload Artifact | ||||
|         if: success() || failure() | ||||
|         uses: actions/upload-artifact@v3 | ||||
|         with: | ||||
|           name: Veracode Pipeline-Scan Results (Human Readable) | ||||
|           path: readable_output.zip | ||||
|       - name: "Clean Maven cache" | ||||
|         run: bash ./scripts/ci/cleanup_cache.sh | ||||
|  | ||||
|   pmd_scan: | ||||
|     name: "PMD Scan" | ||||
|     runs-on: ubuntu-latest | ||||
| @@ -128,12 +76,9 @@ jobs: | ||||
|       !contains(github.event.head_commit.message, '[skip tests]') && | ||||
|       !contains(github.event.head_commit.message, '[force]') | ||||
|     steps: | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.35.2 | ||||
|       - uses: Alfresco/ya-pmd-scan@v3.0.0 | ||||
|       - uses: Alfresco/ya-pmd-scan@v1.0.0 | ||||
|         with: | ||||
|           classpath-build-command: "mvn test-compile -ntp -Pags -pl \"-:alfresco-community-repo-docker\"" | ||||
|           fail-on-new-issues: "false" | ||||
|  | ||||
|   all_unit_tests_suite: | ||||
|     name: "Core, Data-Model, Repository - AllUnitTestsSuite - Build and test" | ||||
| @@ -142,12 +87,11 @@ jobs: | ||||
|     if: > | ||||
|       !contains(github.event.head_commit.message, '[skip repo]') && | ||||
|       !contains(github.event.head_commit.message, '[skip tests]') && | ||||
|       !contains(github.event.head_commit.message, '[force') | ||||
|       !contains(github.event.head_commit.message, '[force]') | ||||
|     steps: | ||||
|       - uses: actions/checkout@v3 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v1.35.2       | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.33.0 | ||||
|       - name: "Init" | ||||
|         run: bash ./scripts/ci/init.sh | ||||
|       - name: "Run tests" | ||||
| @@ -164,7 +108,7 @@ jobs: | ||||
|     if: > | ||||
|       !contains(github.event.head_commit.message, '[skip repo]') && | ||||
|       !contains(github.event.head_commit.message, '[skip tests]') && | ||||
|       !contains(github.event.head_commit.message, '[force') | ||||
|       !contains(github.event.head_commit.message, '[force]') | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
| @@ -183,9 +127,8 @@ jobs: | ||||
|       REQUIRES_INSTALLED_ARTIFACTS: true | ||||
|     steps: | ||||
|       - uses: actions/checkout@v3 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v1.35.2       | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.33.0 | ||||
|       - name: "Build" | ||||
|         timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} | ||||
|         run: | | ||||
| @@ -210,16 +153,15 @@ jobs: | ||||
|       !contains(github.event.head_commit.message, '[skip db]')) || | ||||
|       contains(github.event.head_commit.message, '[db]')) && | ||||
|       !contains(github.event.head_commit.message, '[skip tests]') && | ||||
|       !contains(github.event.head_commit.message, '[force') | ||||
|       !contains(github.event.head_commit.message, '[force]') | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         version: ['10.2.18', '10.4', '10.5'] | ||||
|     steps: | ||||
|       - uses: actions/checkout@v3 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v1.35.2       | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.33.0 | ||||
|       - name: "Init" | ||||
|         run: bash ./scripts/ci/init.sh | ||||
|       - name: Run MariaDB ${{ matrix.version }} database | ||||
| @@ -241,12 +183,11 @@ jobs: | ||||
|       contains(github.event.head_commit.message, '[latest db]') || | ||||
|       contains(github.event.head_commit.message, '[db]')) && | ||||
|       !contains(github.event.head_commit.message, '[skip tests]') && | ||||
|       !contains(github.event.head_commit.message, '[force') | ||||
|       !contains(github.event.head_commit.message, '[force]') | ||||
|     steps: | ||||
|       - uses: actions/checkout@v3 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v1.35.2       | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.33.0 | ||||
|       - name: "Init" | ||||
|         run: bash ./scripts/ci/init.sh | ||||
|       - name: "Run MariaDB 10.6 database" | ||||
| @@ -268,12 +209,11 @@ jobs: | ||||
|       contains(github.event.head_commit.message, '[latest db]') || | ||||
|       contains(github.event.head_commit.message, '[db]')) && | ||||
|       !contains(github.event.head_commit.message, '[skip tests]') && | ||||
|       !contains(github.event.head_commit.message, '[force') | ||||
|       !contains(github.event.head_commit.message, '[force]') | ||||
|     steps: | ||||
|       - uses: actions/checkout@v3 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v1.35.2       | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.33.0 | ||||
|       - name: "Init" | ||||
|         run: bash ./scripts/ci/init.sh | ||||
|       - name: "Run MySQL 8 database" | ||||
| @@ -285,8 +225,8 @@ jobs: | ||||
|       - name: "Clean Maven cache" | ||||
|         run: bash ./scripts/ci/cleanup_cache.sh | ||||
|  | ||||
|   repository_postgresql_13_12_tests: | ||||
|     name: "Repository - PostgreSQL 13.12 tests" | ||||
|   repository_postgresql_13_7_tests: | ||||
|     name: "Repository - PostgreSQL 13.7 tests" | ||||
|     runs-on: ubuntu-latest | ||||
|     needs: [prepare] | ||||
|     if: > | ||||
| @@ -294,51 +234,24 @@ jobs: | ||||
|       !contains(github.event.head_commit.message, '[skip db]')) || | ||||
|       contains(github.event.head_commit.message, '[db]')) && | ||||
|       !contains(github.event.head_commit.message, '[skip tests]') && | ||||
|       !contains(github.event.head_commit.message, '[force') | ||||
|       !contains(github.event.head_commit.message, '[force]') | ||||
|     steps: | ||||
|       - uses: actions/checkout@v3 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v1.35.2       | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.33.0 | ||||
|       - name: "Init" | ||||
|         run: bash ./scripts/ci/init.sh | ||||
|       - name: "Run PostgreSQL 13.12 database" | ||||
|       - name: "Run PostgreSQL 13.7 database" | ||||
|         run: docker-compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile postgres up -d | ||||
|         env: | ||||
|           POSTGRES_VERSION: 13.12 | ||||
|           POSTGRES_VERSION: 13.7 | ||||
|       - name: "Run tests" | ||||
|         run: mvn -B test -pl repository -am -Dtest=AllDBTestsTestSuite -DfailIfNoTests=false -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco | ||||
|       - name: "Clean Maven cache" | ||||
|         run: bash ./scripts/ci/cleanup_cache.sh | ||||
|  | ||||
|   repository_postgresql_14_9_tests: | ||||
|     name: "Repository - PostgreSQL 14.9 tests" | ||||
|     runs-on: ubuntu-latest | ||||
|     needs: [prepare] | ||||
|     if: > | ||||
|       (((github.ref_name == 'master' || startsWith(github.ref_name, 'release/')) && github.event_name != 'pull_request' && | ||||
|       !contains(github.event.head_commit.message, '[skip db]')) || | ||||
|       contains(github.event.head_commit.message, '[db]')) && | ||||
|       !contains(github.event.head_commit.message, '[skip tests]') && | ||||
|       !contains(github.event.head_commit.message, '[force') | ||||
|     steps: | ||||
|       - uses: actions/checkout@v3 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v1.35.2       | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.35.2 | ||||
|       - name: "Init" | ||||
|         run: bash ./scripts/ci/init.sh | ||||
|       - name: "Run PostgreSQL 14.9 database" | ||||
|         run: docker-compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile postgres up -d | ||||
|         env: | ||||
|           POSTGRES_VERSION: 14.9 | ||||
|       - name: "Run tests" | ||||
|         run: mvn -B test -pl repository -am -Dtest=AllDBTestsTestSuite -DfailIfNoTests=false -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco | ||||
|       - name: "Clean Maven cache" | ||||
|         run: bash ./scripts/ci/cleanup_cache.sh | ||||
|  | ||||
|   repository_postgresql_15_4_tests: | ||||
|     name: "Repository - PostgreSQL 15.4 tests" | ||||
|   repository_postgresql_14_4_tests: | ||||
|     name: "Repository - PostgreSQL 14.4 tests" | ||||
|     runs-on: ubuntu-latest | ||||
|     needs: [prepare] | ||||
|     if: > | ||||
| @@ -346,18 +259,17 @@ jobs: | ||||
|       contains(github.event.head_commit.message, '[latest db]') || | ||||
|       contains(github.event.head_commit.message, '[db]')) && | ||||
|       !contains(github.event.head_commit.message, '[skip tests]') && | ||||
|       !contains(github.event.head_commit.message, '[force') | ||||
|       !contains(github.event.head_commit.message, '[force]') | ||||
|     steps: | ||||
|       - uses: actions/checkout@v3 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v1.35.2       | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.33.0 | ||||
|       - name: "Init" | ||||
|         run: bash ./scripts/ci/init.sh | ||||
|       - name: "Run PostgreSQL 15.4 database" | ||||
|       - name: "Run PostgreSQL 14.4 database" | ||||
|         run: docker-compose -f ./scripts/ci/docker-compose/docker-compose-db.yaml --profile postgres up -d | ||||
|         env: | ||||
|           POSTGRES_VERSION: 15.4 | ||||
|           POSTGRES_VERSION: 14.4 | ||||
|       - name: "Run tests" | ||||
|         run: mvn -B test -pl repository -am -Dtest=AllDBTestsTestSuite -DfailIfNoTests=false -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco | ||||
|       - name: "Clean Maven cache" | ||||
| @@ -370,12 +282,11 @@ jobs: | ||||
|     if: > | ||||
|       !contains(github.event.head_commit.message, '[skip repo]') && | ||||
|       !contains(github.event.head_commit.message, '[skip tests]') && | ||||
|       !contains(github.event.head_commit.message, '[force') | ||||
|       !contains(github.event.head_commit.message, '[force]') | ||||
|     steps: | ||||
|       - uses: actions/checkout@v3 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v1.35.2       | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.33.0 | ||||
|       - name: "Init" | ||||
|         run: bash ./scripts/ci/init.sh | ||||
|       - name: "Run ActiveMQ" | ||||
| @@ -392,7 +303,7 @@ jobs: | ||||
|     if: > | ||||
|       !contains(github.event.head_commit.message, '[skip repo]') && | ||||
|       !contains(github.event.head_commit.message, '[skip tests]') && | ||||
|       !contains(github.event.head_commit.message, '[force') | ||||
|       !contains(github.event.head_commit.message, '[force]') | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
| @@ -406,8 +317,8 @@ jobs: | ||||
|           - testSuite: AppContext04TestSuite | ||||
|             compose-profile: with-transform-core-aio | ||||
|           - testSuite: AppContext05TestSuite | ||||
|             compose-profile: with-sso | ||||
|             mvn-options: '-Didentity-service.auth-server-url=http://${HOST_IP}:8999/auth -Dauthentication.chain=identity-service1:identity-service,alfrescoNtlm1:alfrescoNtlm' | ||||
|             compose-profile: default | ||||
|             mvn-options: '"-Didentity-service.auth-server-url=http://${HOST_IP}:8999/auth"' | ||||
|           - testSuite: AppContext06TestSuite | ||||
|             compose-profile: with-transform-core-aio | ||||
|           - testSuite: AppContextExtraTestSuite | ||||
| @@ -424,15 +335,12 @@ jobs: | ||||
|             mvn-options: '-Dencryption.ssl.keystore.location=${CI_WORKSPACE}/keystores/alfresco/alfresco.keystore -Dencryption.ssl.truststore.location=${CI_WORKSPACE}/keystores/alfresco/alfresco.truststore' | ||||
|     steps: | ||||
|       - uses: actions/checkout@v3 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v1.35.2       | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.33.0 | ||||
|       - name: "Init" | ||||
|         run: bash ./scripts/ci/init.sh | ||||
|       - name: "Set transformers tag" | ||||
|         run: echo "TRANSFORMERS_TAG=$(mvn help:evaluate -Dexpression=dependency.alfresco-transform-core.version -q -DforceStdout)" >> $GITHUB_ENV | ||||
|       - name: "Set the host IP" | ||||
|         run: echo "HOST_IP=$(hostname  -I | cut -f1 -d' ')" >> $GITHUB_ENV | ||||
|       - name: "Generate Keystores and Truststores for Mutual TLS configuration" | ||||
|         if: ${{ matrix.mtls }} | ||||
|         run: | | ||||
| @@ -445,7 +353,11 @@ jobs: | ||||
|             echo "HOSTNAME_VERIFICATION_DISABLED=false" >> "$GITHUB_ENV" | ||||
|           fi | ||||
|       - name: "Set up the environment" | ||||
|         run: docker-compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile ${{ matrix.compose-profile }} up -d | ||||
|         run: | | ||||
|           if [ -e ./scripts/ci/tests/${{ matrix.testSuite }}-setup.sh ]; then | ||||
|             bash ./scripts/ci/tests/${{ matrix.testSuite }}-setup.sh | ||||
|           fi | ||||
|           docker-compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile ${{ matrix.compose-profile }} up -d | ||||
|       - name: "Run tests" | ||||
|         run: mvn -B test -pl repository -am -Dtest=${{ matrix.testSuite }} -DfailIfNoTests=false -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco ${{ matrix.mvn-options }} | ||||
|       - name: "Clean Maven cache" | ||||
| @@ -460,7 +372,7 @@ jobs: | ||||
|       !contains(github.event.head_commit.message, '[skip tas]')) || | ||||
|       contains(github.event.head_commit.message, '[tas]')) && | ||||
|       !contains(github.event.head_commit.message, '[skip tests]') && | ||||
|       !contains(github.event.head_commit.message, '[force') | ||||
|       !contains(github.event.head_commit.message, '[force]') | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
| @@ -493,9 +405,8 @@ jobs: | ||||
|       REQUIRES_LOCAL_IMAGES: true | ||||
|     steps: | ||||
|       - uses: actions/checkout@v3 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v1.35.2       | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.33.0 | ||||
|       - name: "Build" | ||||
|         timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} | ||||
|         run: | | ||||
| @@ -528,15 +439,14 @@ jobs: | ||||
|     if: > | ||||
|       !contains(github.event.head_commit.message, '[skip repo]') && | ||||
|       !contains(github.event.head_commit.message, '[skip tests]') && | ||||
|       !contains(github.event.head_commit.message, '[force') | ||||
|       !contains(github.event.head_commit.message, '[force]') | ||||
|     steps: | ||||
|       - uses: actions/checkout@v3 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v1.35.2       | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.33.0 | ||||
|       - name: "Init" | ||||
|         run: bash ./scripts/ci/init.sh | ||||
|       - name: "Run Postgres 15.4 database" | ||||
|       - name: "Run Postgres 14.4 database" | ||||
|         run: docker-compose -f ./scripts/ci/docker-compose/docker-compose.yaml --profile postgres up -d | ||||
|       - name: "Run tests" | ||||
|         run: mvn -B test -pl :alfresco-share-services -am -Dtest=ShareServicesTestSuite -DfailIfNoTests=false -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco | ||||
| @@ -552,7 +462,7 @@ jobs: | ||||
|       !contains(github.event.head_commit.message, '[skip ags]')) || | ||||
|       contains(github.event.head_commit.message, '[ags]')) && | ||||
|       !contains(github.event.head_commit.message, '[skip tests]') && | ||||
|       !contains(github.event.head_commit.message, '[force') | ||||
|       !contains(github.event.head_commit.message, '[force]') | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
| @@ -561,9 +471,8 @@ jobs: | ||||
|       REQUIRES_INSTALLED_ARTIFACTS: true | ||||
|     steps: | ||||
|       - uses: actions/checkout@v3 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v1.35.2       | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.33.0 | ||||
|       - name: "Build" | ||||
|         timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} | ||||
|         run: | | ||||
| @@ -584,7 +493,7 @@ jobs: | ||||
|       !contains(github.event.head_commit.message, '[skip ags]')) || | ||||
|       contains(github.event.head_commit.message, '[ags on MySQL]')) && | ||||
|       !contains(github.event.head_commit.message, '[skip tests]') && | ||||
|       !contains(github.event.head_commit.message, '[force') | ||||
|       !contains(github.event.head_commit.message, '[force]') | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
| @@ -593,9 +502,8 @@ jobs: | ||||
|       REQUIRES_INSTALLED_ARTIFACTS: true | ||||
|     steps: | ||||
|       - uses: actions/checkout@v3 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v1.35.2       | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.33.0 | ||||
|       - name: "Build" | ||||
|         timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} | ||||
|         run: | | ||||
| @@ -616,14 +524,13 @@ jobs: | ||||
|       !contains(github.event.head_commit.message, '[skip ags]') && !contains(github.event.head_commit.message, '[skip tas]')) || | ||||
|       (contains(github.event.head_commit.message, '[ags]') && contains(github.event.head_commit.message, '[tas]'))) && | ||||
|       !contains(github.event.head_commit.message, '[skip tests]') && | ||||
|       !contains(github.event.head_commit.message, '[force') | ||||
|       !contains(github.event.head_commit.message, '[force]') | ||||
|     env: | ||||
|       REQUIRES_LOCAL_IMAGES: true | ||||
|     steps: | ||||
|       - uses: actions/checkout@v3 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v1.35.2       | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.33.0 | ||||
|       - name: "Build" | ||||
|         timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} | ||||
|         run: | | ||||
| @@ -667,9 +574,8 @@ jobs: | ||||
|       !contains(github.event.head_commit.message, '[force]') | ||||
|     steps: | ||||
|       - uses: actions/checkout@v3 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v1.35.2       | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.33.0 | ||||
|       - name: "Build" | ||||
|         timeout-minutes: ${{ fromJSON(env.GITHUB_ACTIONS_DEPLOY_TIMEOUT) }} | ||||
|         run: | | ||||
|   | ||||
							
								
								
									
										14
									
								
								.github/workflows/master_release.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										14
									
								
								.github/workflows/master_release.yml
									
									
									
									
										vendored
									
									
								
							| @@ -34,12 +34,11 @@ jobs: | ||||
|       - uses: actions/checkout@v3 | ||||
|         with: | ||||
|           persist-credentials: false | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v1.35.2       | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.33.0 | ||||
|       - name: "Init" | ||||
|         run: bash ./scripts/ci/init.sh | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/configure-git-author@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/configure-git-author@v1.33.0 | ||||
|         with: | ||||
|           username: ${{ env.GIT_USERNAME }} | ||||
|           email: ${{ env.GIT_EMAIL }} | ||||
| @@ -63,12 +62,11 @@ jobs: | ||||
|       - uses: actions/checkout@v3 | ||||
|         with: | ||||
|           persist-credentials: false | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/free-hosted-runner-disk-space@v1.35.2       | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/get-build-info@v1.33.0 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v1.33.0 | ||||
|       - name: "Init" | ||||
|         run: bash ./scripts/ci/init.sh | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/configure-git-author@v1.35.2 | ||||
|       - uses: Alfresco/alfresco-build-tools/.github/actions/configure-git-author@v1.33.0 | ||||
|         with: | ||||
|           username: ${{ env.GIT_USERNAME }} | ||||
|           email: ${{ env.GIT_EMAIL }} | ||||
|   | ||||
							
								
								
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -39,9 +39,6 @@ dependency-reduced-pom.xml | ||||
|  | ||||
| hs_err_pid* | ||||
|  | ||||
| # Development | ||||
| repository/scripts/hazelcast-init/alfresco-hazelcast-config.xml | ||||
|  | ||||
| # Alfresco runtime | ||||
| alf_data | ||||
|  | ||||
|   | ||||
| @@ -7,7 +7,7 @@ | ||||
|    <parent> | ||||
|       <groupId>org.alfresco</groupId> | ||||
|       <artifactId>alfresco-community-repo-amps</artifactId> | ||||
|       <version>23.2.0.23</version> | ||||
|       <version>23.1.0.167-SNAPSHOT</version> | ||||
|    </parent> | ||||
|  | ||||
|    <modules> | ||||
|   | ||||
| @@ -7,7 +7,7 @@ | ||||
|    <parent> | ||||
|       <groupId>org.alfresco</groupId> | ||||
|       <artifactId>alfresco-governance-services-community-parent</artifactId> | ||||
|       <version>23.2.0.23</version> | ||||
|       <version>23.1.0.167-SNAPSHOT</version> | ||||
|    </parent> | ||||
|  | ||||
|    <modules> | ||||
|   | ||||
| @@ -7,7 +7,7 @@ | ||||
|    <parent> | ||||
|       <groupId>org.alfresco</groupId> | ||||
|       <artifactId>alfresco-governance-services-automation-community-repo</artifactId> | ||||
|       <version>23.2.0.23</version> | ||||
|       <version>23.1.0.167-SNAPSHOT</version> | ||||
|    </parent> | ||||
|  | ||||
|    <build> | ||||
| @@ -83,24 +83,6 @@ | ||||
|          <groupId>com.github.docker-java</groupId> | ||||
|          <artifactId>docker-java</artifactId> | ||||
|          <version>3.3.2</version> | ||||
|          <exclusions> | ||||
|             <exclusion> | ||||
|                <groupId>org.bouncycastle</groupId> | ||||
|                <artifactId>bcprov-jdk15on</artifactId> | ||||
|             </exclusion> | ||||
|             <exclusion> | ||||
|                <groupId>org.bouncycastle</groupId> | ||||
|                <artifactId>bcpkix-jdk15on</artifactId> | ||||
|             </exclusion> | ||||
|          </exclusions> | ||||
|       </dependency> | ||||
|       <dependency> | ||||
|          <groupId>org.bouncycastle</groupId> | ||||
|          <artifactId>bcprov-jdk15to18</artifactId> | ||||
|       </dependency> | ||||
|       <dependency> | ||||
|          <groupId>org.bouncycastle</groupId> | ||||
|          <artifactId>bcpkix-jdk15to18</artifactId> | ||||
|       </dependency> | ||||
|    </dependencies> | ||||
| </project> | ||||
|   | ||||
| @@ -28,7 +28,7 @@ package org.alfresco.rest.core; | ||||
|  | ||||
| import static lombok.AccessLevel.PROTECTED; | ||||
|  | ||||
| import jakarta.annotation.Resource; | ||||
| import javax.annotation.Resource; | ||||
|  | ||||
| import lombok.Getter; | ||||
| import lombok.Setter; | ||||
|   | ||||
| @@ -26,8 +26,8 @@ | ||||
|  */ | ||||
| package org.alfresco.rest.core.v0; | ||||
|  | ||||
| import jakarta.json.Json; | ||||
| import jakarta.json.JsonReader; | ||||
| import javax.json.Json; | ||||
| import javax.json.JsonReader; | ||||
| import java.io.IOException; | ||||
| import java.io.InputStream; | ||||
| import java.time.format.DateTimeFormatter; | ||||
|   | ||||
| @@ -42,8 +42,8 @@ import static org.testng.Assert.assertNotNull; | ||||
| import static org.testng.Assert.assertTrue; | ||||
| import static org.testng.AssertJUnit.assertFalse; | ||||
|  | ||||
| import jakarta.json.Json; | ||||
| import jakarta.json.JsonObject; | ||||
| import javax.json.Json; | ||||
| import javax.json.JsonObject; | ||||
| import java.io.File; | ||||
|  | ||||
| import org.alfresco.dataprep.CMISUtil; | ||||
|   | ||||
| @@ -50,6 +50,7 @@ import org.apache.http.HttpResponse; | ||||
| import org.apache.http.HttpStatus; | ||||
| import org.apache.http.util.EntityUtils; | ||||
| import org.json.JSONObject; | ||||
| import org.junit.Ignore; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.testng.AssertJUnit; | ||||
| import org.testng.annotations.BeforeClass; | ||||
| @@ -64,9 +65,7 @@ import java.util.List; | ||||
| import static org.alfresco.rest.core.v0.BaseAPI.NODE_REF_WORKSPACE_SPACES_STORE; | ||||
| import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias.FILE_PLAN_ALIAS; | ||||
| import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAspects.CUT_OFF_ASPECT; | ||||
| import static org.alfresco.rest.rm.community.model.recordcategory.RetentionPeriodProperty.CREATED_DATE; | ||||
| import static org.alfresco.rest.rm.community.model.recordcategory.RetentionPeriodProperty.DATE_FILED; | ||||
| import static org.alfresco.rest.rm.community.model.recordcategory.RetentionPeriodProperty.CUT_OFF_DATE; | ||||
| import static org.alfresco.rest.rm.community.model.recordcategory.RetentionPeriodProperty.*; | ||||
| import static org.alfresco.rest.rm.community.util.CommonTestUtils.generateTestPrefix; | ||||
| import static org.alfresco.utility.report.log.Step.STEP; | ||||
| import static org.junit.Assert.assertNull; | ||||
| @@ -85,25 +84,28 @@ public class DispositionScheduleLinkedRecordsTest extends BaseRMRestTest { | ||||
|     @Autowired | ||||
|     private RecordFoldersAPI recordFoldersAPI; | ||||
|     private final static  String TEST_PREFIX = generateTestPrefix(DispositionScheduleLinkedRecordsTest.class); | ||||
|     private static final String CATEGORY_RM_3077 = TEST_PREFIX + "RM-3077_manager_sees_me"; | ||||
|     private static final String COPY_CATEGORY_RM_3077 = "Copy_of_" + CATEGORY_RM_3077; | ||||
|     private static final String FOLDER_RM_3077 = "RM-3077_folder_"+ CATEGORY_RM_3077; | ||||
|     private static final String COPY_FOLDER_RM_3077 = "Copy_of_" + FOLDER_RM_3077; | ||||
|     private static final String FIRST_CATEGORY_RM_3060 = TEST_PREFIX + "RM-3060_category_record"; | ||||
|     private static final String SECOND_CATEGORY_RM_3060 = "Copy_of_" + FIRST_CATEGORY_RM_3060; | ||||
|     private static final String FIRST_FOLDER_RM_3060 = TEST_PREFIX + "RM-3060_folder"; | ||||
|     private static final String SECOND_FOLDER_RM_3060 = TEST_PREFIX + "RM-3060_disposition_on_Record_Level"; | ||||
|     private static final String ELECTRONIC_RECORD_RM_3060 = TEST_PREFIX + "RM-3060_electronic_1_record"; | ||||
|     private static final String NON_ELECTRONIC_RECORD_RM_3060 = TEST_PREFIX + "RM-3060_non-electronic_record"; | ||||
|     private static final String FIRST_CATEGORY_RM_1622 = TEST_PREFIX + "RM-1622_category_record"; | ||||
|     private static final String SECOND_CATEGORY_RM_1622 = "Copy_of_" + FIRST_CATEGORY_RM_1622; | ||||
|     private static final String FIRST_FOLDER_RM_1622 = TEST_PREFIX + "RM-1622_folder"; | ||||
|     private static final String ELECTRONIC_RECORD_RM_1622 = TEST_PREFIX + "RM-1622_electronic_1_record"; | ||||
|     private static final String SECOND_FOLDER_RM_1622 = TEST_PREFIX + "RM-1622_disposition_on_Record_Level"; | ||||
|     private RecordCategory Category1; | ||||
|     private RecordCategoryChild CopyCatFolder,folder1,CatFolder,folder2; | ||||
|     private static final String categoryRM3077 = TEST_PREFIX + "RM-3077_manager_sees_me"; | ||||
|     private static final String copyCategoryRM3077 = "Copy_of_" + categoryRM3077; | ||||
|     private static final String folderRM3077 = "RM-3077_folder_"+ categoryRM3077; | ||||
|     private static final String copyFolderRM3077 = "Copy_of_" + folderRM3077; | ||||
|     private final String folder = TEST_PREFIX + "RM-2937 folder ghosting"; | ||||
|     private static final String firstCategoryRM3060 = TEST_PREFIX + "RM-3060_category_record"; | ||||
|     private static final String secondCategoryRM3060 = "Copy_of_" + firstCategoryRM3060; | ||||
|     private static final String firstFolderRM3060 = TEST_PREFIX + "RM-3060_folder"; | ||||
|     private static final String secondFolderRM3060 = TEST_PREFIX + "RM-3060_disposition_on_Record_Level"; | ||||
|     private static final String electronicRecordRM3060 = TEST_PREFIX + "RM-3060_electronic_1_record"; | ||||
|     private static final String nonElectronicRecordRM3060 = TEST_PREFIX + "RM-3060_non-electronic_record"; | ||||
|     private static final String firstCategoryRM1622 = TEST_PREFIX + "RM-1622_category_record"; | ||||
|     private static final String secondCategoryRM1622 = "Copy_of_" + firstCategoryRM1622;; | ||||
|     private static final String firstFolderRM1622 = TEST_PREFIX + "RM-1622_folder"; | ||||
|     private static final String electronicRecordRM1622 = TEST_PREFIX + "RM-1622_electronic_1_record"; | ||||
|     private static final String secondFolderRM1622 = TEST_PREFIX + "RM-1622_disposition_on_Record_Level"; | ||||
|     private static final String TRANSFER_LOCATION = TEST_PREFIX + "RM-3060_transferred_records"; | ||||
|     public static final String TRANSFER_TYPE = "rma:transferred"; | ||||
|     private FilePlan filePlanModel; | ||||
|     private UserModel rmAdmin; | ||||
|     private UserModel rmAdmin, rmManager; | ||||
|  | ||||
|     @BeforeClass(alwaysRun = true) | ||||
|     public void setupDispositionScheduleLinkedRecordsTest() { | ||||
| @@ -118,12 +120,11 @@ public class DispositionScheduleLinkedRecordsTest extends BaseRMRestTest { | ||||
|             UserRoles.ROLE_RM_ADMIN.roleId); | ||||
|  | ||||
|         // create "rm Manager" user if it does not exist and assign it to RM Administrator role | ||||
|         UserModel rmManager = getDataUser().createRandomTestUser(); | ||||
|         rmManager = getDataUser().createRandomTestUser(); | ||||
|         rmRolesAndActionsAPI.assignRoleToUser(getDataUser().usingAdmin().getAdminUser().getUsername(), | ||||
|             getDataUser().usingAdmin().getAdminUser().getPassword(), rmManager.getUsername(), | ||||
|             getDataUser().usingAdmin().getAdminUser().getPassword(),rmManager.getUsername(), | ||||
|             UserRoles.ROLE_RM_MANAGER.roleId); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Disposition Schedule on Record Folder with linked records test | ||||
|      * <p> | ||||
| @@ -135,202 +136,194 @@ public class DispositionScheduleLinkedRecordsTest extends BaseRMRestTest { | ||||
|      * <p> | ||||
|      * <p/> TestRail Test C775<p/> | ||||
|      **/ | ||||
|     @Test(enabled = false) // temporary disabled, see ACS-6073 | ||||
|     @AlfrescoTest(jira = "RM-1622") | ||||
|     public void dispositionScheduleLinkedRecords() throws UnsupportedEncodingException { | ||||
|         STEP("Create record category"); | ||||
|         RecordCategory category1 = createRootCategory(CATEGORY_RM_3077); | ||||
|  | ||||
|         //create retention schedule | ||||
|         dispositionScheduleService.createCategoryRetentionSchedule(category1.getName(), false); | ||||
|  | ||||
|         // add cut off step | ||||
|         dispositionScheduleService.addCutOffAfterPeriodStep(category1.getName(), "day|2", CREATED_DATE); | ||||
|  | ||||
|         //create a copy of the category recordsCategory | ||||
|         String copyCategoryId = copyCategory(getAdminUser(), category1.getId(), COPY_CATEGORY_RM_3077); | ||||
|  | ||||
|         // create folders in both categories | ||||
|         RecordCategoryChild catFolder = createRecordFolder(category1.getId(), FOLDER_RM_3077); | ||||
|         createRecordFolder(copyCategoryId, COPY_FOLDER_RM_3077); | ||||
|  | ||||
|         // create record  files | ||||
|         String electronicRecord = "RM-2801 electronic record"; | ||||
|         Record elRecord = createElectronicRecord(catFolder.getId(), electronicRecord); | ||||
|         String elRecordFullName = recordsAPI.getRecordFullName(getDataUser().usingAdmin().getAdminUser().getUsername(), | ||||
|             getDataUser().usingAdmin().getAdminUser().getPassword(), catFolder.getName(), electronicRecord); | ||||
|  | ||||
|         String nonElectronicRecord = "RM-2801 non-electronic record"; | ||||
|         Record nonElRecord = createNonElectronicRecord(catFolder.getId(), nonElectronicRecord); | ||||
|         String nonElRecordFullName = recordsAPI.getRecordFullName(getDataUser().usingAdmin().getAdminUser().getUsername(), | ||||
|             getDataUser().usingAdmin().getAdminUser().getPassword(), catFolder.getName(), nonElectronicRecord); | ||||
|  | ||||
|         // link the records to copy folder, then complete them | ||||
|         List<String> recordLists = new ArrayList<>(); | ||||
|         recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + elRecord.getId()); | ||||
|         recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + nonElRecord.getId()); | ||||
|  | ||||
|         linksAPI.linkRecord(getDataUser().getAdminUser().getUsername(), | ||||
|             getDataUser().getAdminUser().getPassword(), HttpStatus.SC_OK, COPY_CATEGORY_RM_3077 + "/" + | ||||
|                 COPY_FOLDER_RM_3077, recordLists); | ||||
|         recordsAPI.completeRecord(rmAdmin.getUsername(), rmAdmin.getPassword(), elRecordFullName); | ||||
|         recordsAPI.completeRecord(rmAdmin.getUsername(), rmAdmin.getPassword(), nonElRecordFullName); | ||||
|  | ||||
|         // edit disposition date | ||||
|         recordFoldersAPI.postFolderAction(getAdminUser().getUsername(), | ||||
|             getAdminUser().getPassword(),editDispositionDateJson(), catFolder.getName()); | ||||
|  | ||||
|         // cut off the Folder | ||||
|         recordFoldersAPI.postFolderAction(getAdminUser().getUsername(), | ||||
|             getAdminUser().getPassword(),new JSONObject().put("name","cutoff"), catFolder.getName()); | ||||
|  | ||||
|         // Verify the Content | ||||
|         Node electronicNode = getNode(elRecord.getId()); | ||||
|         assertTrue("The content of " + electronicRecord + " is available", | ||||
|             StringUtils.isEmpty(electronicNode.getNodeContent().getResponse().getBody().asString())); | ||||
|  | ||||
|         // verify the Properties | ||||
|         AssertJUnit.assertNull("The properties are present even after cutting off the record.", elRecord.getProperties().getTitle()); | ||||
|  | ||||
|         // delete precondition | ||||
|         deleteRecordCategory(category1.getId()); | ||||
|         deleteRecordCategory(copyCategoryId); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Test covering RM-3060 | ||||
|      * Check the disposition steps for a record can be executed | ||||
|      * When the record is linked to a folder with the same disposition schedule | ||||
|      * */ | ||||
|     @Test(enabled = false) // temporary disabled, see ACS-6073 | ||||
|     @AlfrescoTest (jira = "RM-3060") | ||||
|     public void sameDispositionScheduleLinkedRecords() throws UnsupportedEncodingException { | ||||
|  | ||||
|         // create a category with retention applied on records level | ||||
|         RecordCategory recordCategory = getRestAPIFactory().getFilePlansAPI(rmAdmin) | ||||
|             .createRootRecordCategory(RecordCategory.builder().name(FIRST_CATEGORY_RM_3060).build(), | ||||
|                 RecordCategory.DEFAULT_FILE_PLAN_ALIAS); | ||||
|         dispositionScheduleService.createCategoryRetentionSchedule(FIRST_CATEGORY_RM_3060, true); | ||||
|         dispositionScheduleService.addCutOffAfterPeriodStep(FIRST_CATEGORY_RM_3060, "week|1", DATE_FILED); | ||||
|         dispositionScheduleService.addTransferAfterEventStep( | ||||
|             FIRST_CATEGORY_RM_3060, TRANSFER_LOCATION, RMEvents.CASE_CLOSED.getEventName()); | ||||
|         dispositionScheduleService.addDestroyWithoutGhostingAfterPeriodStep(FIRST_CATEGORY_RM_3060, "week|1", CUT_OFF_DATE); | ||||
|  | ||||
|         // make a copy of the category created | ||||
|         String categorySecondId = copyCategory(getAdminUser(), recordCategory.getId(), SECOND_CATEGORY_RM_3060); | ||||
|  | ||||
|         // create a folder on the category firstCategoryRM3060 with a complete electronic record | ||||
|         RecordCategoryChild firstFolderRecordCategoryChild = createRecordFolder(recordCategory.getId(), | ||||
|             FIRST_FOLDER_RM_3060); | ||||
|         Record firstElectronicRecord = createElectronicRecord(firstFolderRecordCategoryChild.getId(), | ||||
|             ELECTRONIC_RECORD_RM_3060); | ||||
|  | ||||
|         String elRecordFullName = recordsAPI.getRecordFullName(getDataUser().getAdminUser().getUsername(), | ||||
|             getDataUser().getAdminUser().getPassword(), FIRST_FOLDER_RM_3060, ELECTRONIC_RECORD_RM_3060); | ||||
|         String elRecordNameNodeRef = recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(), | ||||
|             getDataUser().usingAdmin().getAdminUser().getPassword(), elRecordFullName, "/" + FIRST_CATEGORY_RM_3060 + "/" + FIRST_FOLDER_RM_3060); | ||||
|  | ||||
|         recordsAPI.completeRecord(getDataUser().getAdminUser().getUsername(), | ||||
|             getDataUser().getAdminUser().getPassword(), elRecordFullName); | ||||
|  | ||||
|         // create a folder on the category secondCategoryRM3060 with a non electronic record | ||||
|         RecordCategoryChild secondFolderRecordCategoryChild = createRecordFolder(categorySecondId, | ||||
|             SECOND_FOLDER_RM_3060); | ||||
|         Record secondNonElectronicRecord = createNonElectronicRecord(secondFolderRecordCategoryChild.getId(), | ||||
|             NON_ELECTRONIC_RECORD_RM_3060); | ||||
|  | ||||
|         // link the nonElectronicRecordRM3060 to firstFolderRM3060 | ||||
|         List<String> recordLists = new ArrayList<>(); | ||||
|         recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + secondNonElectronicRecord.getId()); | ||||
|  | ||||
|         linksAPI.linkRecord(getDataUser().getAdminUser().getUsername(), | ||||
|             getDataUser().getAdminUser().getPassword(), HttpStatus.SC_OK, SECOND_CATEGORY_RM_3060 + "/" + | ||||
|                 SECOND_FOLDER_RM_3060, recordLists); | ||||
|         String nonElRecordFullName = recordsAPI.getRecordFullName(getDataUser().usingAdmin().getAdminUser().getUsername(), | ||||
|             getDataUser().usingAdmin().getAdminUser().getPassword(), | ||||
|             SECOND_FOLDER_RM_3060, secondNonElectronicRecord.getName()); | ||||
|         String nonElRecordNameNodeRef = recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(), | ||||
|             getDataUser().usingAdmin().getAdminUser().getPassword(), nonElRecordFullName, "/" + SECOND_CATEGORY_RM_3060 | ||||
|                 + "/" + SECOND_FOLDER_RM_3060); | ||||
|  | ||||
|         // complete records and cut them off | ||||
|         recordsAPI.completeRecord(getDataUser().getAdminUser().getUsername(), | ||||
|             getDataUser().getAdminUser().getPassword(), nonElRecordFullName); | ||||
|  | ||||
|         // edit the disposition date | ||||
|         recordFoldersAPI.postRecordAction(getAdminUser().getUsername(), | ||||
|             getAdminUser().getPassword(),editDispositionDateJson(),nonElRecordNameNodeRef); | ||||
|  | ||||
|         // cut off the record | ||||
|         recordFoldersAPI.postRecordAction(getAdminUser().getUsername(), | ||||
|             getAdminUser().getPassword(),new JSONObject().put("name","cutoff"),nonElRecordNameNodeRef); | ||||
|  | ||||
|         //check the record is cut off | ||||
|         AssertJUnit.assertTrue("The file " + NON_ELECTRONIC_RECORD_RM_3060 + " has not been successfully cut off.", getRestAPIFactory().getRecordsAPI().getRecord(secondNonElectronicRecord.getId()).getAspectNames().contains(CUT_OFF_ASPECT)); | ||||
|  | ||||
|         // link the electronic record to secondFolderRM3060 | ||||
|         recordLists.clear(); | ||||
|         recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + secondNonElectronicRecord.getId()); | ||||
|         linksAPI.linkRecord(getDataUser().getAdminUser().getUsername(), | ||||
|             getDataUser().getAdminUser().getPassword(), HttpStatus.SC_OK, SECOND_CATEGORY_RM_3060 + "/" + | ||||
|                 SECOND_FOLDER_RM_3060, recordLists); | ||||
|  | ||||
|         // edit the disposition date and cut off the record | ||||
|         recordFoldersAPI.postRecordAction(getAdminUser().getUsername(), | ||||
|             getAdminUser().getPassword(),editDispositionDateJson(),elRecordNameNodeRef); | ||||
|         recordFoldersAPI.postRecordAction(getAdminUser().getUsername(), | ||||
|             getAdminUser().getPassword(),new JSONObject().put("name","cutoff"),elRecordNameNodeRef); | ||||
|  | ||||
|         AssertJUnit.assertTrue("The file " + ELECTRONIC_RECORD_RM_3060 + " has not been successfully cut off.", getRestAPIFactory().getRecordsAPI().getRecord(firstElectronicRecord.getId()).getAspectNames().contains(CUT_OFF_ASPECT)); | ||||
|  | ||||
|         // open the record and complete the disposition schedule event | ||||
|         rmRolesAndActionsAPI.completeEvent(getAdminUser().getUsername(), | ||||
|             getAdminUser().getPassword(), elRecordFullName, RMEvents.CASE_CLOSED, Instant.now()); | ||||
|         rmRolesAndActionsAPI.completeEvent(getAdminUser().getUsername(), | ||||
|             getAdminUser().getPassword(), nonElRecordFullName, RMEvents.CASE_CLOSED, Instant.now()); | ||||
|  | ||||
|         // transfer the files & complete transfers | ||||
|         HttpResponse nonElRecordNameHttpResponse = recordFoldersAPI.postRecordAction(getAdminUser().getUsername(), | ||||
|             getAdminUser().getPassword(),new JSONObject().put("name","transfer"),recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(), | ||||
|                 getDataUser().usingAdmin().getAdminUser().getPassword(), nonElRecordFullName, "/" + SECOND_CATEGORY_RM_3060 | ||||
|                     + "/" + SECOND_FOLDER_RM_3060)); | ||||
|  | ||||
|         String nonElRecordNameTransferId = getTransferId(nonElRecordNameHttpResponse,nonElRecordNameNodeRef); | ||||
|         recordFoldersAPI.postRecordAction(getAdminUser().getUsername(), | ||||
|             getAdminUser().getPassword(),new JSONObject().put("name","transferComplete"),nonElRecordNameTransferId); | ||||
|  | ||||
|         HttpResponse elRecordNameHttpResponse = recordFoldersAPI.postRecordAction(getAdminUser().getUsername(), | ||||
|             getAdminUser().getPassword(),new JSONObject().put("name","transfer"),recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(), | ||||
|                 getDataUser().usingAdmin().getAdminUser().getPassword(), elRecordFullName, "/" + FIRST_CATEGORY_RM_3060 | ||||
|                     + "/" + FIRST_FOLDER_RM_3060)); | ||||
|  | ||||
|         String elRecordNameTransferId = getTransferId(elRecordNameHttpResponse,elRecordNameNodeRef); | ||||
|         recordFoldersAPI.postRecordAction(getAdminUser().getUsername(), | ||||
|             getAdminUser().getPassword(),new JSONObject().put("name","transferComplete"),elRecordNameTransferId); | ||||
|  | ||||
|         AssertJUnit.assertTrue("The file " + ELECTRONIC_RECORD_RM_3060 + " has not been successfully transferred", getRestAPIFactory().getRecordsAPI().getRecord(firstElectronicRecord.getId()).getAspectNames().contains(TRANSFER_TYPE)); | ||||
|         AssertJUnit.assertTrue("The file " + NON_ELECTRONIC_RECORD_RM_3060 + " has not been successfully transferred.", getRestAPIFactory().getRecordsAPI().getRecord(secondNonElectronicRecord.getId()).getAspectNames().contains(TRANSFER_TYPE)); | ||||
|  | ||||
|         // edit the disposition date for nonElectronicRecordRM3060 & electronicRecordRM3060 | ||||
|         recordFoldersAPI.postRecordAction(getAdminUser().getUsername(), | ||||
|             getAdminUser().getPassword(),editDispositionDateJson(),nonElRecordNameNodeRef); | ||||
|         recordFoldersAPI.postRecordAction(getAdminUser().getUsername(), | ||||
|             getAdminUser().getPassword(),editDispositionDateJson(),elRecordNameNodeRef); | ||||
|  | ||||
|         // destroy nonElectronicRecordRM3060 & electronicRecordRM3060 records | ||||
|         recordFoldersAPI.postRecordAction(getAdminUser().getUsername(), | ||||
|             getAdminUser().getPassword(),new JSONObject().put("name","destroy"),nonElRecordNameNodeRef); | ||||
|         recordFoldersAPI.postRecordAction(getAdminUser().getUsername(), | ||||
|             getAdminUser().getPassword(),new JSONObject().put("name","destroy"),elRecordNameNodeRef); | ||||
|  | ||||
|         // check the file is not displayed | ||||
|        assertNull("The file " + NON_ELECTRONIC_RECORD_RM_3060 + " has not been successfully destroyed.", secondNonElectronicRecord.getContent()); | ||||
|        assertNull("The file " + ELECTRONIC_RECORD_RM_3060 + " has not been successfully destroyed.", firstElectronicRecord.getContent()); | ||||
|  | ||||
|         // delete precondition | ||||
|         deleteRecordCategory(recordCategory.getId()); | ||||
|         deleteRecordCategory(categorySecondId); | ||||
|     } | ||||
| //    @Ignore("ACS-5020") | ||||
|     //    @Test | ||||
| //    @AlfrescoTest(jira = "RM-1622") | ||||
| //    public void dispositionScheduleLinkedRecords() throws UnsupportedEncodingException { | ||||
| //        STEP("Create record category"); | ||||
| //        Category1 = createRootCategory(categoryRM3077); | ||||
| // | ||||
| //        //create retention schedule | ||||
| //        dispositionScheduleService.createCategoryRetentionSchedule(Category1.getName(), false); | ||||
| // | ||||
| //        // add cut off step | ||||
| //        dispositionScheduleService.addCutOffAfterPeriodStep(Category1.getName(), "day|2", CREATED_DATE); | ||||
| // | ||||
| //        //create a copy of the category recordsCategory | ||||
| //        String CopyCategoryId = copyCategory(getAdminUser(),Category1.getId(), copyCategoryRM3077); | ||||
| // | ||||
| //        // create folders in both categories | ||||
| //        CatFolder = createRecordFolder(Category1.getId(), folderRM3077); | ||||
| //        CopyCatFolder = createRecordFolder(CopyCategoryId, copyFolderRM3077); | ||||
| // | ||||
| //        // create record  files | ||||
| //        String electronicRecord = "RM-2801 electronic record"; | ||||
| //        Record elRecord = createElectronicRecord(CatFolder.getId(), electronicRecord); | ||||
| //        String elRecordFullName = recordsAPI.getRecordFullName(getDataUser().usingAdmin().getAdminUser().getUsername(), | ||||
| //            getDataUser().usingAdmin().getAdminUser().getPassword(), CatFolder.getName(), electronicRecord); | ||||
| // | ||||
| //        String nonElectronicRecord = "RM-2801 non-electronic record"; | ||||
| //        Record nonElRecord = createNonElectronicRecord(CatFolder.getId(), nonElectronicRecord); | ||||
| //        String nonElRecordFullName = recordsAPI.getRecordFullName(getDataUser().usingAdmin().getAdminUser().getUsername(), | ||||
| //            getDataUser().usingAdmin().getAdminUser().getPassword(), CatFolder.getName(), nonElectronicRecord); | ||||
| // | ||||
| //        // link the records to copy folder, then complete them | ||||
| //        List<String> recordLists = new ArrayList<>(); | ||||
| //        recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + elRecord.getId()); | ||||
| //        recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + nonElRecord.getId()); | ||||
| // | ||||
| //        linksAPI.linkRecord(getDataUser().getAdminUser().getUsername(), | ||||
| //            getDataUser().getAdminUser().getPassword(), HttpStatus.SC_OK,copyCategoryRM3077 + "/" + | ||||
| //                copyFolderRM3077, recordLists); | ||||
| //        recordsAPI.completeRecord(rmAdmin.getUsername(), rmAdmin.getPassword(), elRecordFullName); | ||||
| //        recordsAPI.completeRecord(rmAdmin.getUsername(), rmAdmin.getPassword(), nonElRecordFullName); | ||||
| // | ||||
| //        // edit disposition date | ||||
| //        recordFoldersAPI.postFolderAction(getAdminUser().getUsername(), | ||||
| //            getAdminUser().getPassword(),editDispositionDateJson(),CatFolder.getName()); | ||||
| // | ||||
| //        // cut off the Folder | ||||
| //        recordFoldersAPI.postFolderAction(getAdminUser().getUsername(), | ||||
| //            getAdminUser().getPassword(),new JSONObject().put("name","cutoff"),CatFolder.getName()); | ||||
| // | ||||
| //        // Verify the Content | ||||
| //        Node electronicNode = getNode(elRecord.getId()); | ||||
| //        assertTrue("The content of " + electronicRecord + " is available", | ||||
| //            StringUtils.isEmpty(electronicNode.getNodeContent().getResponse().getBody().asString())); | ||||
| // | ||||
| //        // verify the Properties | ||||
| //        AssertJUnit.assertNull("The properties are present even after cutting off the record.", elRecord.getProperties().getTitle()); | ||||
| // | ||||
| //        // delete precondition | ||||
| //        deleteRecordCategory(Category1.getId()); | ||||
| //        deleteRecordCategory(CopyCategoryId); | ||||
| //    } | ||||
| //    /** | ||||
| //     * Test covering RM-3060 | ||||
| //     * Check the disposition steps for a record can be executed | ||||
| //     * When the record is linked to a folder with the same disposition schedule | ||||
| //     * */ | ||||
| //    @Ignore("ACS-5020") | ||||
| ////    @Test | ||||
| //    @AlfrescoTest (jira = "RM-3060") | ||||
| //    public void sameDispositionScheduleLinkedRecords() throws UnsupportedEncodingException { | ||||
| // | ||||
| //        // create a category with retention applied on records level | ||||
| //        RecordCategory recordCategory = getRestAPIFactory().getFilePlansAPI(rmAdmin) | ||||
| //            .createRootRecordCategory(RecordCategory.builder().name(firstCategoryRM3060).build(), | ||||
| //                RecordCategory.DEFAULT_FILE_PLAN_ALIAS); | ||||
| //        dispositionScheduleService.createCategoryRetentionSchedule(firstCategoryRM3060, true); | ||||
| //        dispositionScheduleService.addCutOffAfterPeriodStep(firstCategoryRM3060, "week|1", DATE_FILED); | ||||
| //        dispositionScheduleService.addTransferAfterEventStep(firstCategoryRM3060, TRANSFER_LOCATION, RMEvents.CASE_CLOSED.getEventName()); | ||||
| //        dispositionScheduleService.addDestroyWithoutGhostingAfterPeriodStep(firstCategoryRM3060, "week|1", CUT_OFF_DATE); | ||||
| // | ||||
| //        // make a copy of the category created | ||||
| //        String categorySecondId = copyCategory(getAdminUser(), recordCategory.getId(), secondCategoryRM3060); | ||||
| // | ||||
| //        // create a folder on the category firstCategoryRM3060 with a complete electronic record | ||||
| //        RecordCategoryChild firstFolderRecordCategoryChild = createRecordFolder(recordCategory.getId(),firstFolderRM3060); | ||||
| //        Record firstElectronicRecord = createElectronicRecord(firstFolderRecordCategoryChild.getId(),electronicRecordRM3060); | ||||
| // | ||||
| //        String elRecordFullName = recordsAPI.getRecordFullName(getDataUser().getAdminUser().getUsername(), | ||||
| //            getDataUser().getAdminUser().getPassword(),firstFolderRM3060, electronicRecordRM3060); | ||||
| //        String elRecordNameNodeRef = recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(), | ||||
| //            getDataUser().usingAdmin().getAdminUser().getPassword(), elRecordFullName, "/" + firstCategoryRM3060 + "/" + firstFolderRM3060); | ||||
| // | ||||
| //        recordsAPI.completeRecord(getDataUser().getAdminUser().getUsername(), | ||||
| //            getDataUser().getAdminUser().getPassword(), elRecordFullName); | ||||
| // | ||||
| //        // create a folder on the category secondCategoryRM3060 with a non electronic record | ||||
| //        RecordCategoryChild secondFolderRecordCategoryChild = createRecordFolder(categorySecondId,secondFolderRM3060); | ||||
| //        Record secondNonElectronicRecord = createNonElectronicRecord(secondFolderRecordCategoryChild.getId(),nonElectronicRecordRM3060); | ||||
| // | ||||
| //        // link the nonElectronicRecordRM3060 to firstFolderRM3060 | ||||
| //        List<String> recordLists = new ArrayList<>(); | ||||
| //        recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + secondNonElectronicRecord.getId()); | ||||
| // | ||||
| //        linksAPI.linkRecord(getDataUser().getAdminUser().getUsername(), | ||||
| //            getDataUser().getAdminUser().getPassword(), HttpStatus.SC_OK,secondCategoryRM3060 + "/" + | ||||
| //                secondFolderRM3060, recordLists); | ||||
| //        String nonElRecordFullName = recordsAPI.getRecordFullName(getDataUser().usingAdmin().getAdminUser().getUsername(), | ||||
| //            getDataUser().usingAdmin().getAdminUser().getPassword(), secondFolderRM3060, secondNonElectronicRecord.getName()); | ||||
| //        String nonElRecordNameNodeRef = recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(), | ||||
| //            getDataUser().usingAdmin().getAdminUser().getPassword(), nonElRecordFullName, "/" + secondCategoryRM3060 + "/" + secondFolderRM3060); | ||||
| // | ||||
| //        // complete records and cut them off | ||||
| //        recordsAPI.completeRecord(getDataUser().getAdminUser().getUsername(), | ||||
| //            getDataUser().getAdminUser().getPassword(), nonElRecordFullName); | ||||
| // | ||||
| //        // edit the disposition date | ||||
| //        recordFoldersAPI.postRecordAction(getAdminUser().getUsername(), | ||||
| //            getAdminUser().getPassword(),editDispositionDateJson(),nonElRecordNameNodeRef); | ||||
| // | ||||
| //        // cut off the record | ||||
| //        recordFoldersAPI.postRecordAction(getAdminUser().getUsername(), | ||||
| //            getAdminUser().getPassword(),new JSONObject().put("name","cutoff"),nonElRecordNameNodeRef); | ||||
| // | ||||
| //        //check the record is cut off | ||||
| //        AssertJUnit.assertTrue("The file " + nonElectronicRecordRM3060 + " has not been successfully cut off.", getRestAPIFactory().getRecordsAPI().getRecord(secondNonElectronicRecord.getId()).getAspectNames().contains(CUT_OFF_ASPECT)); | ||||
| // | ||||
| //        // link the electronic record to secondFolderRM3060 | ||||
| //        recordLists.clear(); | ||||
| //        recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + secondNonElectronicRecord.getId()); | ||||
| //        linksAPI.linkRecord(getDataUser().getAdminUser().getUsername(), | ||||
| //            getDataUser().getAdminUser().getPassword(), HttpStatus.SC_OK,secondCategoryRM3060 + "/" + | ||||
| //                secondFolderRM3060, recordLists); | ||||
| // | ||||
| //        // edit the disposition date and cut off the record | ||||
| //        recordFoldersAPI.postRecordAction(getAdminUser().getUsername(), | ||||
| //            getAdminUser().getPassword(),editDispositionDateJson(),elRecordNameNodeRef); | ||||
| //        recordFoldersAPI.postRecordAction(getAdminUser().getUsername(), | ||||
| //            getAdminUser().getPassword(),new JSONObject().put("name","cutoff"),elRecordNameNodeRef); | ||||
| // | ||||
| //        AssertJUnit.assertTrue("The file " + electronicRecordRM3060 + " has not been successfully cut off.", getRestAPIFactory().getRecordsAPI().getRecord(firstElectronicRecord.getId()).getAspectNames().contains(CUT_OFF_ASPECT)); | ||||
| // | ||||
| //        // open the record and complete the disposition schedule event | ||||
| //        rmRolesAndActionsAPI.completeEvent(getAdminUser().getUsername(), | ||||
| //            getAdminUser().getPassword(), elRecordFullName, RMEvents.CASE_CLOSED, Instant.now()); | ||||
| //        rmRolesAndActionsAPI.completeEvent(getAdminUser().getUsername(), | ||||
| //            getAdminUser().getPassword(), nonElRecordFullName, RMEvents.CASE_CLOSED, Instant.now()); | ||||
| // | ||||
| //        // transfer the files & complete transfers | ||||
| //        HttpResponse nonElRecordNameHttpResponse = recordFoldersAPI.postRecordAction(getAdminUser().getUsername(), | ||||
| //            getAdminUser().getPassword(),new JSONObject().put("name","transfer"),recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(), | ||||
| //                getDataUser().usingAdmin().getAdminUser().getPassword(), nonElRecordFullName, "/" + secondCategoryRM3060 + "/" + secondFolderRM3060)); | ||||
| // | ||||
| //        String nonElRecordNameTransferId = getTransferId(nonElRecordNameHttpResponse,nonElRecordNameNodeRef); | ||||
| //        recordFoldersAPI.postRecordAction(getAdminUser().getUsername(), | ||||
| //            getAdminUser().getPassword(),new JSONObject().put("name","transferComplete"),nonElRecordNameTransferId); | ||||
| // | ||||
| //        HttpResponse elRecordNameHttpResponse = recordFoldersAPI.postRecordAction(getAdminUser().getUsername(), | ||||
| //            getAdminUser().getPassword(),new JSONObject().put("name","transfer"),recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(), | ||||
| //                getDataUser().usingAdmin().getAdminUser().getPassword(), elRecordFullName, "/" + firstCategoryRM3060 + "/" + firstFolderRM3060)); | ||||
| // | ||||
| //        String elRecordNameTransferId = getTransferId(elRecordNameHttpResponse,elRecordNameNodeRef); | ||||
| //        recordFoldersAPI.postRecordAction(getAdminUser().getUsername(), | ||||
| //            getAdminUser().getPassword(),new JSONObject().put("name","transferComplete"),elRecordNameTransferId); | ||||
| // | ||||
| //        AssertJUnit.assertTrue("The file " + electronicRecordRM3060 + " has not been successfully transferred", getRestAPIFactory().getRecordsAPI().getRecord(firstElectronicRecord.getId()).getAspectNames().contains(TRANSFER_TYPE)); | ||||
| //        AssertJUnit.assertTrue("The file " + nonElectronicRecordRM3060 + " has not been successfully transferred.", getRestAPIFactory().getRecordsAPI().getRecord(secondNonElectronicRecord.getId()).getAspectNames().contains(TRANSFER_TYPE)); | ||||
| // | ||||
| //        // edit the disposition date for nonElectronicRecordRM3060 & electronicRecordRM3060 | ||||
| //        recordFoldersAPI.postRecordAction(getAdminUser().getUsername(), | ||||
| //            getAdminUser().getPassword(),editDispositionDateJson(),nonElRecordNameNodeRef); | ||||
| //        recordFoldersAPI.postRecordAction(getAdminUser().getUsername(), | ||||
| //            getAdminUser().getPassword(),editDispositionDateJson(),elRecordNameNodeRef); | ||||
| // | ||||
| //        // destroy nonElectronicRecordRM3060 & electronicRecordRM3060 records | ||||
| //        recordFoldersAPI.postRecordAction(getAdminUser().getUsername(), | ||||
| //            getAdminUser().getPassword(),new JSONObject().put("name","destroy"),nonElRecordNameNodeRef); | ||||
| //        recordFoldersAPI.postRecordAction(getAdminUser().getUsername(), | ||||
| //            getAdminUser().getPassword(),new JSONObject().put("name","destroy"),elRecordNameNodeRef); | ||||
| // | ||||
| //        // check the file is not displayed | ||||
| //       assertNull("The file " + nonElectronicRecordRM3060 + " has not been successfully destroyed.", secondNonElectronicRecord.getContent()); | ||||
| //       assertNull("The file " + electronicRecordRM3060 + " has not been successfully destroyed.", firstElectronicRecord.getContent()); | ||||
| // | ||||
| //        // delete precondition | ||||
| //        deleteRecordCategory(recordCategory.getId()); | ||||
| //        deleteRecordCategory(categorySecondId); | ||||
| //    } | ||||
|  | ||||
|     private String copyCategory(UserModel user, String categoryId, String copyName) { | ||||
|         RepoTestModel repoTestModel = new RepoTestModel() {}; | ||||
| @@ -361,7 +354,7 @@ public class DispositionScheduleLinkedRecordsTest extends BaseRMRestTest { | ||||
|  | ||||
|     private String getTransferId(HttpResponse httpResponse,String nodeRef) { | ||||
|         HttpEntity entity = httpResponse.getEntity(); | ||||
|         String responseString; | ||||
|         String responseString = null; | ||||
|         try { | ||||
|             responseString = EntityUtils.toString(entity, "UTF-8"); | ||||
|         } catch (IOException e) { | ||||
| @@ -372,6 +365,7 @@ public class DispositionScheduleLinkedRecordsTest extends BaseRMRestTest { | ||||
|             .getJSONObject("results") | ||||
|             .get(nodeRef) | ||||
|             .toString(); | ||||
|  | ||||
|     } | ||||
|  | ||||
|     @Test | ||||
| @@ -380,39 +374,35 @@ public class DispositionScheduleLinkedRecordsTest extends BaseRMRestTest { | ||||
|  | ||||
|         // create a category with retention applied on records level | ||||
|         RecordCategory catsameLevel1  = getRestAPIFactory().getFilePlansAPI(rmAdmin) | ||||
|                                                            .createRootRecordCategory(RecordCategory.builder().name( | ||||
|                                                                    FIRST_CATEGORY_RM_1622).build(), | ||||
|                                                            .createRootRecordCategory(RecordCategory.builder().name(firstCategoryRM1622).build(), | ||||
|                                                                RecordCategory.DEFAULT_FILE_PLAN_ALIAS); | ||||
|         RecordCategory catsameLevel2  = getRestAPIFactory().getFilePlansAPI(rmAdmin) | ||||
|                                                            .createRootRecordCategory(RecordCategory.builder().name( | ||||
|                                                                    SECOND_CATEGORY_RM_1622).build(), | ||||
|                                                            .createRootRecordCategory(RecordCategory.builder().name(secondCategoryRM1622).build(), | ||||
|                                                                RecordCategory.DEFAULT_FILE_PLAN_ALIAS); | ||||
|  | ||||
|         // create retention schedule applied on records for category 1 | ||||
|         dispositionScheduleService.createCategoryRetentionSchedule(FIRST_CATEGORY_RM_1622, true); | ||||
|         dispositionScheduleService.createCategoryRetentionSchedule(firstCategoryRM1622, true); | ||||
|  | ||||
|         // with retain immediately after record creation date and cut 1 day after record creation date | ||||
|         dispositionScheduleService.addCutOffAfterPeriodStep(FIRST_CATEGORY_RM_1622, "day|1", DATE_FILED); | ||||
|         dispositionScheduleService.addCutOffAfterPeriodStep(firstCategoryRM1622, "day|1", DATE_FILED); | ||||
|  | ||||
|  | ||||
|         // create a folder on the category firstCategoryRM1622 with a complete electronic record | ||||
|         RecordCategoryChild firstFolderRecordCategoryChild = createRecordFolder(catsameLevel1.getId(), | ||||
|             FIRST_FOLDER_RM_1622); | ||||
|         Record firstElectronicRecord = createElectronicRecord(firstFolderRecordCategoryChild.getId(), | ||||
|             ELECTRONIC_RECORD_RM_1622); | ||||
|         RecordCategoryChild firstFolderRecordCategoryChild = createRecordFolder(catsameLevel1.getId(),firstFolderRM1622); | ||||
|         Record firstElectronicRecord = createElectronicRecord(firstFolderRecordCategoryChild.getId(),electronicRecordRM1622); | ||||
|  | ||||
|         String elRecordFullName = recordsAPI.getRecordFullName(getDataUser().getAdminUser().getUsername(), | ||||
|             getDataUser().getAdminUser().getPassword(), FIRST_FOLDER_RM_1622, ELECTRONIC_RECORD_RM_1622); | ||||
|        recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(), | ||||
|             getDataUser().usingAdmin().getAdminUser().getPassword(), elRecordFullName, "/" + FIRST_CATEGORY_RM_1622 + "/" + FIRST_FOLDER_RM_1622); | ||||
|             getDataUser().getAdminUser().getPassword(),firstFolderRM1622, electronicRecordRM1622); | ||||
|         String elRecordNameNodeRef = recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(), | ||||
|             getDataUser().usingAdmin().getAdminUser().getPassword(), elRecordFullName, "/" + firstCategoryRM1622 + "/" + firstFolderRM1622); | ||||
|  | ||||
|         recordsAPI.completeRecord(getDataUser().getAdminUser().getUsername(), | ||||
|             getDataUser().getAdminUser().getPassword(), elRecordFullName); | ||||
|  | ||||
|         // create a folder on the category secondCategoryRM1622 with a non electronic record | ||||
|         createRecordFolder(catsameLevel2.getId(), SECOND_FOLDER_RM_1622); | ||||
|         RecordCategoryChild secondFolderRecordCategoryChild = createRecordFolder(catsameLevel2.getId(),secondFolderRM1622); | ||||
|         String elRecordNameNodeRefs = recordsAPI.getRecordNodeRef(getDataUser().usingAdmin().getAdminUser().getUsername(), | ||||
|             getDataUser().usingAdmin().getAdminUser().getPassword(), elRecordFullName, "/" + FIRST_CATEGORY_RM_1622 + "/" + FIRST_FOLDER_RM_1622); | ||||
|             getDataUser().usingAdmin().getAdminUser().getPassword(), elRecordFullName, "/" + firstCategoryRM1622 + "/" + firstFolderRM1622); | ||||
|  | ||||
|  | ||||
|         // link it to the folder in second category through the details page | ||||
| @@ -420,12 +410,14 @@ public class DispositionScheduleLinkedRecordsTest extends BaseRMRestTest { | ||||
|         recordLists.add(NODE_REF_WORKSPACE_SPACES_STORE + firstElectronicRecord.getId()); | ||||
|  | ||||
|         linksAPI.linkRecord(getDataUser().getAdminUser().getUsername(), | ||||
|             getDataUser().getAdminUser().getPassword(), HttpStatus.SC_OK, SECOND_CATEGORY_RM_1622 + "/" + | ||||
|                 SECOND_FOLDER_RM_1622, recordLists); | ||||
|             getDataUser().getAdminUser().getPassword(), HttpStatus.SC_OK,secondCategoryRM1622 + "/" + | ||||
|                 secondFolderRM1622, recordLists); | ||||
|  | ||||
|         // edit disposition date | ||||
|         recordFoldersAPI.postRecordAction(getAdminUser().getUsername(), | ||||
|             getAdminUser().getPassword(),editDispositionDateJson(),elRecordNameNodeRefs); | ||||
|  | ||||
|  | ||||
|     } | ||||
|  | ||||
|     @Test (dependsOnMethods = {"sameLevelDispositionScheduleStepsPeriodsCalculation" }) | ||||
| @@ -436,4 +428,4 @@ public class DispositionScheduleLinkedRecordsTest extends BaseRMRestTest { | ||||
|         // Verify the status code | ||||
|         assertStatusCode(NO_CONTENT); | ||||
|     } | ||||
| } | ||||
|     } | ||||
|   | ||||
| @@ -7,7 +7,7 @@ | ||||
|    <parent> | ||||
|       <groupId>org.alfresco</groupId> | ||||
|       <artifactId>alfresco-governance-services-community-parent</artifactId> | ||||
|       <version>23.2.0.23</version> | ||||
|       <version>23.1.0.167-SNAPSHOT</version> | ||||
|    </parent> | ||||
|  | ||||
|    <modules> | ||||
|   | ||||
| @@ -1,3 +1,3 @@ | ||||
| SOLR6_TAG=2.0.8.1 | ||||
| POSTGRES_TAG=15.4 | ||||
| ACTIVEMQ_TAG=5.18.3-jre17-rockylinux8 | ||||
| SOLR6_TAG=2.0.7-A5 | ||||
| POSTGRES_TAG=14.4 | ||||
| ACTIVEMQ_TAG=5.17.4-jre17-rockylinux8 | ||||
|   | ||||
| @@ -39,7 +39,7 @@ cache.jsonConversionComponentCache.timeToLiveSeconds=0 | ||||
| cache.jsonConversionComponentCache.maxIdleSeconds=0 | ||||
| cache.jsonConversionComponentCache.backup-count=1 | ||||
| cache.jsonConversionComponentCache.eviction-policy=NONE | ||||
| cache.jsonConversionComponentCache.merge-policy=com.hazelcast.spi.merge.PutIfAbsentMergePolicy | ||||
| cache.jsonConversionComponentCache.merge-policy=com.hazelcast.map.merge.PutIfAbsentMapMergePolicy | ||||
| cache.jsonConversionComponentCache.nearCache.maxSize=50 | ||||
| cache.jsonConversionComponentCache.nearCache.maxIdleSeconds=0 | ||||
| cache.jsonConversionComponentCache.nearCache.timeToLiveSeconds=0 | ||||
|   | ||||
| @@ -8,7 +8,7 @@ | ||||
|    <parent> | ||||
|       <groupId>org.alfresco</groupId> | ||||
|       <artifactId>alfresco-governance-services-community-repo-parent</artifactId> | ||||
|       <version>23.2.0.23</version> | ||||
|       <version>23.1.0.167-SNAPSHOT</version> | ||||
|    </parent> | ||||
|  | ||||
|    <properties> | ||||
| @@ -60,12 +60,9 @@ | ||||
|          <scope>test</scope> | ||||
|       </dependency> | ||||
|       <dependency> | ||||
|          <groupId>jakarta.servlet</groupId> | ||||
|          <artifactId>jakarta.servlet-api</artifactId> | ||||
|       </dependency> | ||||
|       <dependency> | ||||
|          <groupId>jakarta.mail</groupId> | ||||
|          <artifactId>jakarta.mail-api</artifactId> | ||||
|          <groupId>javax.servlet</groupId> | ||||
|          <artifactId>javax.servlet-api</artifactId> | ||||
|          <scope>provided</scope> | ||||
|       </dependency> | ||||
|       <dependency> | ||||
|          <groupId>org.alfresco.surf</groupId> | ||||
| @@ -105,8 +102,9 @@ | ||||
|          <artifactId>swagger-parser</artifactId> | ||||
|          <scope>test</scope> | ||||
|       </dependency> | ||||
|       <!-- https://mvnrepository.com/artifact/com.github.fge/json-schema-validator --> | ||||
|       <dependency> | ||||
|          <groupId>com.networknt</groupId> | ||||
|          <groupId>com.github.fge</groupId> | ||||
|          <artifactId>json-schema-validator</artifactId> | ||||
|          <scope>test</scope> | ||||
|       </dependency> | ||||
| @@ -416,7 +414,9 @@ | ||||
|                   <configuration> | ||||
|                      <images> | ||||
|                         <image> | ||||
|                            <name>postgres:15.4</name> | ||||
|                            <!-- TODO upgrade this old postgres version --> | ||||
|                            <name>postgres:9.4.12</name> | ||||
|                            <!--<name>postgres:13.3</name>--> | ||||
|                            <run> | ||||
|                               <ports> | ||||
|                                  <port>${postgresql.tests.port}:${postgresql.port}</port> | ||||
|   | ||||
| @@ -39,12 +39,12 @@ import java.util.List; | ||||
| import java.util.Map; | ||||
| import java.util.Set; | ||||
|  | ||||
| import jakarta.mail.MessagingException; | ||||
| import jakarta.mail.Multipart; | ||||
| import jakarta.mail.Part; | ||||
| import jakarta.mail.internet.ContentType; | ||||
| import jakarta.mail.internet.MimeMessage; | ||||
| import jakarta.mail.internet.MimeUtility; | ||||
| import javax.mail.MessagingException; | ||||
| import javax.mail.Multipart; | ||||
| import javax.mail.Part; | ||||
| import javax.mail.internet.ContentType; | ||||
| import javax.mail.internet.MimeMessage; | ||||
| import javax.mail.internet.MimeUtility; | ||||
|  | ||||
| import org.alfresco.error.AlfrescoRuntimeException; | ||||
| import org.alfresco.model.ContentModel; | ||||
|   | ||||
| @@ -52,7 +52,7 @@ import java.util.List; | ||||
| import java.util.Locale; | ||||
| import java.util.Map; | ||||
| import java.util.Set; | ||||
| import jakarta.transaction.SystemException; | ||||
| import javax.transaction.SystemException; | ||||
|  | ||||
| import org.alfresco.error.AlfrescoRuntimeException; | ||||
| import org.alfresco.model.ContentModel; | ||||
|   | ||||
| @@ -61,7 +61,6 @@ public class RFC822MetadataExtracter extends org.alfresco.repo.content.metadata. | ||||
|     public void setNodeService(NodeService nodeService) | ||||
|     { | ||||
|         this.nodeService = nodeService; | ||||
|         super.setNodeService(nodeService); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -29,7 +29,7 @@ package org.alfresco.module.org_alfresco_module_rm.script; | ||||
|  | ||||
| import static org.alfresco.util.WebScriptUtils.getTemplateVars; | ||||
|  | ||||
| import jakarta.servlet.http.HttpServletResponse; | ||||
| import javax.servlet.http.HttpServletResponse; | ||||
| import java.util.Map; | ||||
|  | ||||
| import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionService; | ||||
|   | ||||
| @@ -27,7 +27,7 @@ | ||||
|  | ||||
| package org.alfresco.module.org_alfresco_module_rm.script; | ||||
|  | ||||
| import jakarta.servlet.http.HttpServletResponse; | ||||
| import javax.servlet.http.HttpServletResponse; | ||||
| import java.io.File; | ||||
| import java.io.IOException; | ||||
| import java.util.HashMap; | ||||
|   | ||||
| @@ -30,7 +30,7 @@ package org.alfresco.module.org_alfresco_module_rm.script; | ||||
| import java.util.HashMap; | ||||
| import java.util.Map; | ||||
|  | ||||
| import jakarta.servlet.http.HttpServletResponse; | ||||
| import javax.servlet.http.HttpServletResponse; | ||||
|  | ||||
| import org.alfresco.module.org_alfresco_module_rm.admin.RecordsManagementAdminService; | ||||
| import org.alfresco.service.cmr.dictionary.PropertyDefinition; | ||||
|   | ||||
| @@ -34,7 +34,7 @@ import java.util.HashMap; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
|  | ||||
| import jakarta.servlet.http.HttpServletResponse; | ||||
| import javax.servlet.http.HttpServletResponse; | ||||
|  | ||||
| import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionActionDefinition; | ||||
| import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionSchedule; | ||||
|   | ||||
| @@ -34,7 +34,7 @@ import java.io.IOException; | ||||
| import java.util.HashMap; | ||||
| import java.util.Map; | ||||
|  | ||||
| import jakarta.servlet.http.HttpServletResponse; | ||||
| import javax.servlet.http.HttpServletResponse; | ||||
|  | ||||
| import org.alfresco.model.ContentModel; | ||||
| import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService; | ||||
|   | ||||
| @@ -33,7 +33,7 @@ import static org.alfresco.util.WebScriptUtils.getTemplateVars; | ||||
| import java.util.HashMap; | ||||
| import java.util.Map; | ||||
|  | ||||
| import jakarta.servlet.http.HttpServletResponse; | ||||
| import javax.servlet.http.HttpServletResponse; | ||||
|  | ||||
| import org.alfresco.module.org_alfresco_module_rm.relationship.RelationshipService; | ||||
| import org.alfresco.service.cmr.repository.NodeRef; | ||||
|   | ||||
| @@ -27,7 +27,7 @@ | ||||
|  | ||||
| package org.alfresco.module.org_alfresco_module_rm.script; | ||||
|  | ||||
| import jakarta.servlet.http.HttpServletResponse; | ||||
| import javax.servlet.http.HttpServletResponse; | ||||
| import java.io.File; | ||||
| import java.io.FileOutputStream; | ||||
| import java.io.IOException; | ||||
|   | ||||
| @@ -32,7 +32,7 @@ import java.util.HashSet; | ||||
| import java.util.Map; | ||||
| import java.util.Set; | ||||
|  | ||||
| import jakarta.servlet.http.HttpServletResponse; | ||||
| import javax.servlet.http.HttpServletResponse; | ||||
|  | ||||
| import org.alfresco.model.ContentModel; | ||||
| import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService; | ||||
|   | ||||
| @@ -32,7 +32,7 @@ import java.util.List; | ||||
| import java.util.Map; | ||||
| import java.util.TreeMap; | ||||
|  | ||||
| import jakarta.servlet.http.HttpServletResponse; | ||||
| import javax.servlet.http.HttpServletResponse; | ||||
|  | ||||
| import org.alfresco.module.org_alfresco_module_rm.capability.Capability; | ||||
| import org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService; | ||||
|   | ||||
| @@ -25,7 +25,7 @@ | ||||
|  * #L% | ||||
|  */ | ||||
| /* | ||||
|  * Copyright (C) 2005 - 2023 Alfresco Software Limited. | ||||
|  * Copyright (C) 2005-2014 Alfresco Software Limited. | ||||
|  * | ||||
|  * This file is part of Alfresco | ||||
|  * | ||||
| @@ -44,7 +44,7 @@ | ||||
|  */ | ||||
| package org.alfresco.repo.web.scripts.roles; | ||||
|  | ||||
| import jakarta.servlet.http.HttpServletResponse; | ||||
| import javax.servlet.http.HttpServletResponse; | ||||
| import java.io.BufferedWriter; | ||||
| import java.io.File; | ||||
| import java.io.FileWriter; | ||||
|   | ||||
| @@ -25,7 +25,7 @@ | ||||
|  * #L% | ||||
|  */ | ||||
| /* | ||||
|  * Copyright (C) 2005 - 2023 Alfresco Software Limited. | ||||
|  * Copyright (C) 2005-2014 Alfresco Software Limited. | ||||
|  * | ||||
|  * This file is part of Alfresco | ||||
|  * | ||||
| @@ -54,7 +54,7 @@ import java.util.HashMap; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
|  | ||||
| import jakarta.servlet.http.HttpServletResponse; | ||||
| import javax.servlet.http.HttpServletResponse; | ||||
|  | ||||
| import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionSchedule; | ||||
| import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionService; | ||||
|   | ||||
| @@ -139,7 +139,7 @@ public class JSONConversionComponentTest extends BaseRMTestCase | ||||
|             Serializable value = stringValue; | ||||
|             if (type.equals("boolean")) | ||||
|             { | ||||
|                 value = Boolean.valueOf(stringValue); | ||||
|                 value = new Boolean(stringValue); | ||||
|             } | ||||
|             return value; | ||||
|         } | ||||
|   | ||||
| @@ -4,7 +4,7 @@ | ||||
|  | ||||
| # Version label | ||||
| version.major=23 | ||||
| version.minor=2 | ||||
| version.minor=1 | ||||
| version.revision=0 | ||||
| version.label= | ||||
|  | ||||
|   | ||||
| @@ -45,10 +45,12 @@ import java.util.Set; | ||||
| import com.fasterxml.jackson.databind.JsonNode; | ||||
| import com.fasterxml.jackson.databind.ObjectMapper; | ||||
| import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; | ||||
| import com.networknt.schema.JsonSchema; | ||||
| import com.networknt.schema.JsonSchemaFactory; | ||||
| import com.networknt.schema.SpecVersion.VersionFlag; | ||||
| import com.networknt.schema.ValidationMessage; | ||||
| import com.github.fge.jackson.JsonLoader; | ||||
| import com.github.fge.jsonschema.core.exceptions.ProcessingException; | ||||
| import com.github.fge.jsonschema.core.report.ProcessingMessage; | ||||
| import com.github.fge.jsonschema.core.report.ProcessingReport; | ||||
| import com.github.fge.jsonschema.main.JsonSchema; | ||||
| import com.github.fge.jsonschema.main.JsonSchemaFactory; | ||||
|  | ||||
| import io.swagger.models.Swagger; | ||||
| import io.swagger.parser.SwaggerParser; | ||||
| @@ -64,8 +66,8 @@ import org.apache.commons.io.filefilter.WildcardFileFilter; | ||||
|  */ | ||||
| public class BaseYamlUnitTest | ||||
| { | ||||
|     private static final String SWAGGER_2_SCHEMA_LOCATION = "/rest/schema.json"; | ||||
|     private static final String OPEN_API_SPECIFICATION = "2.0"; | ||||
|     private static String SWAGGER_2_SCHEMA_LOCATION = "/rest/schema.json"; | ||||
|     private static String OPEN_API_SPECIFICATION = "2.0"; | ||||
|  | ||||
|     /** | ||||
|      * Helper method to obtain path names for all yaml files found on the given path | ||||
| @@ -84,11 +86,11 @@ public class BaseYamlUnitTest | ||||
|     /** | ||||
|      * Helper method to validate that all given yaml files are valid readable Swagger format | ||||
|      */ | ||||
|     protected void validateYamlFiles(final Set<String> yamlFileNames) throws ValidationException, IOException | ||||
|     protected void validateYamlFiles(final Set<String> yamlFileNames) throws ProcessingException, IOException | ||||
|     { | ||||
|         assertFalse("Expected at least 1 yaml file to validate", yamlFileNames.isEmpty()); | ||||
|  | ||||
|         final JsonSchema swaggerSchema = getSwaggerSchema(); | ||||
|         final JsonSchema swaggerSchema = getSwaggerSchema(SWAGGER_2_SCHEMA_LOCATION); | ||||
|         assertNotNull("Failed to obtain the Swagger schema", swaggerSchema); | ||||
|          | ||||
|         for (String yamlFilePath : yamlFileNames) | ||||
| @@ -104,11 +106,11 @@ public class BaseYamlUnitTest | ||||
|                 assertEquals("Failed to obtain Swagger version from yaml file " + yamlFilePath,  | ||||
|                         swagger.getSwagger(), OPEN_API_SPECIFICATION); | ||||
|             } | ||||
|             catch (ValidationException ex) | ||||
|             catch (ProcessingException ex) | ||||
|             { | ||||
|                 // ensure the yaml filename is included in the message | ||||
|                 String context = String.format(yamlFilePath + ": %n" + ex.getMessage()); | ||||
|                 throw new ValidationException(context) ; | ||||
|                 throw new ProcessingException(context) ; | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| @@ -116,15 +118,16 @@ public class BaseYamlUnitTest | ||||
|     /** | ||||
|      * Helper method to read in the Swagger JSON schema file | ||||
|      */ | ||||
|     private JsonSchema getSwaggerSchema() throws IOException | ||||
|     private JsonSchema getSwaggerSchema(final String schemaLocation) throws IOException, ProcessingException | ||||
|     { | ||||
|         JsonSchema swaggerSchema = null; | ||||
|         final InputStream in = this.getClass().getResourceAsStream(SWAGGER_2_SCHEMA_LOCATION); | ||||
|         final InputStream in = this.getClass().getResourceAsStream(schemaLocation); | ||||
|         if (in != null) | ||||
|         { | ||||
|             final String swaggerSchemaAsString = IOUtils.toString(in); | ||||
|             final JsonSchemaFactory factory = JsonSchemaFactory.getInstance(VersionFlag.V4); | ||||
|             swaggerSchema = factory.getSchema(swaggerSchemaAsString); | ||||
|             final JsonNode schemaNode = JsonLoader.fromString(swaggerSchemaAsString); | ||||
|             final JsonSchemaFactory factory = JsonSchemaFactory.byDefault(); | ||||
|             swaggerSchema = factory.getJsonSchema(schemaNode); | ||||
|         } | ||||
|         return swaggerSchema; | ||||
|     } | ||||
| @@ -132,7 +135,7 @@ public class BaseYamlUnitTest | ||||
|     /** | ||||
|      * Helper method to validate Yaml file against JSON schema | ||||
|      */ | ||||
|     private boolean validateYamlFile(final String yamlFilePath, final JsonSchema jsonSchema) throws IOException, ValidationException | ||||
|     private boolean validateYamlFile(final String yamlFilePath, final JsonSchema jsonSchema) throws IOException, ProcessingException | ||||
|     { | ||||
|         // Get yaml file as a string | ||||
|         final String yaml = new String(Files.readAllBytes(Paths.get(yamlFilePath))); | ||||
| @@ -149,22 +152,19 @@ public class BaseYamlUnitTest | ||||
|     /** | ||||
|      * Helper method to validate JSON string against JSON schema | ||||
|      */ | ||||
|     private boolean validateJSON(final String jsonData, final JsonSchema schema) throws IOException, ValidationException | ||||
|     private boolean validateJSON(final String jsonData, final JsonSchema schema) throws IOException, ProcessingException | ||||
|     { | ||||
|         final JsonNode dataNode = new ObjectMapper().readTree(jsonData); | ||||
|  | ||||
|         final Iterator<ValidationMessage> errors = schema.validate(dataNode).iterator(); | ||||
|         if (!errors.hasNext()) return true; | ||||
|  | ||||
|         final ValidationMessage errorMessage = errors.next(); | ||||
|         throw new ValidationException(errorMessage.toString()); | ||||
|     } | ||||
|  | ||||
|     private static class ValidationException extends Exception | ||||
|     { | ||||
|         public ValidationException(String message) | ||||
|         final JsonNode dataNode = JsonLoader.fromString(jsonData); | ||||
|         final ProcessingReport report = schema.validate(dataNode); | ||||
|         boolean isOk = report.isSuccess(); | ||||
|         if (!isOk) | ||||
|         { | ||||
|             super(message); | ||||
|             Iterator<ProcessingMessage> messages = report.iterator(); | ||||
|             if (messages.hasNext()) | ||||
|             { | ||||
|                 throw new ProcessingException(messages.next().toString()); | ||||
|             } | ||||
|         } | ||||
|         return isOk; | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| { | ||||
|   "title": "A JSON Schema for Swagger 2.0 API.", | ||||
|   "id": "http://swagger.io/v2/schema.json#", | ||||
|   "$schema": "http://json-schema.org/draft-04/schema#", | ||||
|   "id": "#", | ||||
|   "$schema": "#", | ||||
|   "type": "object", | ||||
|   "required": [ | ||||
|     "swagger", | ||||
| @@ -203,7 +203,7 @@ | ||||
|       "additionalProperties": { | ||||
|         "$ref": "#/definitions/response" | ||||
|       }, | ||||
|       "description": "One or more JSON representations for responses" | ||||
|       "description": "One or more JSON representations for parameters" | ||||
|     }, | ||||
|     "externalDocs": { | ||||
|       "type": "object", | ||||
|   | ||||
| @@ -7,7 +7,7 @@ | ||||
|     <parent> | ||||
|         <groupId>org.alfresco</groupId> | ||||
|         <artifactId>alfresco-governance-services-community-repo-parent</artifactId> | ||||
|         <version>23.2.0.23</version> | ||||
|         <version>23.1.0.167-SNAPSHOT</version> | ||||
|     </parent> | ||||
|  | ||||
|     <build> | ||||
|   | ||||
| @@ -7,7 +7,7 @@ | ||||
|     <parent> | ||||
|         <groupId>org.alfresco</groupId> | ||||
|         <artifactId>alfresco-community-repo</artifactId> | ||||
|         <version>23.2.0.23</version> | ||||
|         <version>23.1.0.167-SNAPSHOT</version> | ||||
|     </parent> | ||||
|  | ||||
|     <modules> | ||||
|   | ||||
| @@ -8,7 +8,7 @@ | ||||
|     <parent> | ||||
|         <groupId>org.alfresco</groupId> | ||||
|         <artifactId>alfresco-community-repo-amps</artifactId> | ||||
|         <version>23.2.0.23</version> | ||||
|         <version>23.1.0.167-SNAPSHOT</version> | ||||
|     </parent> | ||||
|  | ||||
|     <properties> | ||||
| @@ -128,8 +128,26 @@ | ||||
|             <scope>test</scope> | ||||
|         </dependency> | ||||
|         <dependency> | ||||
|             <groupId>jakarta.servlet</groupId> | ||||
|             <artifactId>jakarta.servlet-api</artifactId> | ||||
|             <groupId>javax.servlet</groupId> | ||||
|             <artifactId>javax.servlet-api</artifactId> | ||||
|             <scope>provided</scope> | ||||
|         </dependency> | ||||
|  | ||||
|         <!-- SHA-2432 --> | ||||
|         <dependency> | ||||
|             <groupId>org.apache.taglibs</groupId> | ||||
|             <artifactId>taglibs-standard-spec</artifactId> | ||||
|             <scope>provided</scope> | ||||
|         </dependency> | ||||
|         <dependency> | ||||
|             <groupId>org.apache.taglibs</groupId> | ||||
|             <artifactId>taglibs-standard-impl</artifactId> | ||||
|             <scope>provided</scope> | ||||
|         </dependency> | ||||
|         <dependency> | ||||
|             <groupId>org.apache.taglibs</groupId> | ||||
|             <artifactId>taglibs-standard-jstlel</artifactId> | ||||
|             <scope>provided</scope> | ||||
|         </dependency> | ||||
|     </dependencies> | ||||
|  | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| /* | ||||
|  * Copyright 2005 - 2023 Alfresco Software Limited. | ||||
|  * Copyright 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. | ||||
| @@ -27,7 +27,7 @@ import java.util.HashMap; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
|  | ||||
| import jakarta.servlet.http.HttpServletResponse; | ||||
| import javax.servlet.http.HttpServletResponse; | ||||
|  | ||||
| import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback; | ||||
| import org.alfresco.repo.web.scripts.admin.NodeBrowserPost; | ||||
|   | ||||
										
											Binary file not shown.
										
									
								
							| @@ -48,7 +48,7 @@ function tagQuery() | ||||
|    } | ||||
|    query += "ASPECT:\"{http://www.alfresco.org/model/content/1.0}taggable\""; | ||||
|    //MNT-2118 Share inconsistencies when displaying locked files with tags | ||||
|    query += " AND -ASPECT:\"{http://www.alfresco.org/model/content/1.0}workingcopy\""; | ||||
|    query += " -ASPECT:\"{http://www.alfresco.org/model/content/1.0}workingcopy\""; | ||||
|  | ||||
|    // MNT-20091 check to prevent cm:taggable with NULL | ||||
|    query += " AND ISNOTNULL:\"{http://www.alfresco.org/model/content/1.0}taggable\""; | ||||
| @@ -60,7 +60,7 @@ function tagQuery() | ||||
|          query: query, | ||||
|          language: "lucene", | ||||
|          page: { | ||||
|             // query minimum rows because all useful info will come with facets | ||||
|             // query minimum rows because all usefull info will come with facets  | ||||
|             maxItems: 1, | ||||
|             skipCount: 0 | ||||
|          }, | ||||
|   | ||||
| @@ -24,7 +24,7 @@ function getCategoryNode() | ||||
|       else | ||||
|       { | ||||
|          var queryPath = "/" + catAspect + "/" + encodePath(path); | ||||
|          categoryResults = search.luceneSearch("+PATH:\"" + queryPath + "/*\" AND -PATH:\"" + queryPath + "/member\""); | ||||
|          categoryResults = search.luceneSearch("+PATH:\"" + queryPath + "/*\" -PATH:\"" + queryPath + "/member\""); | ||||
|       } | ||||
|        | ||||
|       // make each result an object and indicate it is selectable in the UI | ||||
| @@ -71,4 +71,4 @@ function encodePath(path) | ||||
| function sortByName(a, b) | ||||
| { | ||||
|    return (b.node.name.toLowerCase() > a.node.name.toLowerCase() ? -1 : 1); | ||||
| } | ||||
| } | ||||
| @@ -29,7 +29,7 @@ function main() | ||||
|    { | ||||
|       query = "+PATH:\"" + parsedArgs.pathNode.qnamePath + "//*\" "; | ||||
|    } | ||||
|    query += "AND +TYPE:\"cm:content\" AND +@cm\\:content.mimetype:\"image/*\""; | ||||
|    query += "+TYPE:\"cm:content\" +@cm\\:content.mimetype:image/*"; | ||||
|     | ||||
|    // Sort the list before trimming to page chunks  | ||||
|    assets = search.query( | ||||
| @@ -52,4 +52,4 @@ function main() | ||||
| /** | ||||
|  * Images List Component: images | ||||
|  */ | ||||
| model.images = main(); | ||||
| model.images = main(); | ||||
| @@ -1,5 +1,5 @@ | ||||
| /* | ||||
|  * Copyright (C) 2005 - 2023 Alfresco Software Limited. | ||||
|  * Copyright 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. | ||||
| @@ -24,7 +24,7 @@ import java.util.Date; | ||||
| import java.util.regex.Matcher; | ||||
| import java.util.regex.Pattern; | ||||
|  | ||||
| import jakarta.transaction.UserTransaction; | ||||
| import javax.transaction.UserTransaction; | ||||
|  | ||||
| import org.alfresco.model.ContentModel; | ||||
| import org.alfresco.repo.node.archive.NodeArchiveService; | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| /* | ||||
|  * Copyright (C) 2005 - 2023 Alfresco Software Limited. | ||||
|  * Copyright 2005 - 2021 Alfresco Software Limited. | ||||
|  * | ||||
|  * This file is part of the Alfresco software. | ||||
|  * If the software was purchased under a paid Alfresco license, the terms of the paid license agreement will prevail. | ||||
| @@ -24,7 +24,7 @@ import java.io.Serializable; | ||||
| import java.util.HashMap; | ||||
| import java.util.Map; | ||||
|  | ||||
| import jakarta.transaction.UserTransaction; | ||||
| import javax.transaction.UserTransaction; | ||||
|  | ||||
| import org.alfresco.model.ContentModel; | ||||
| import org.alfresco.repo.model.Repository; | ||||
|   | ||||
| @@ -7,7 +7,7 @@ | ||||
|    <parent> | ||||
|       <groupId>org.alfresco</groupId> | ||||
|       <artifactId>alfresco-community-repo</artifactId> | ||||
|       <version>23.2.0.23</version> | ||||
|       <version>23.1.0.167-SNAPSHOT</version> | ||||
|    </parent> | ||||
|  | ||||
|    <dependencies> | ||||
| @@ -111,8 +111,9 @@ | ||||
|  | ||||
|       <!-- provided dependencies --> | ||||
|       <dependency> | ||||
|          <groupId>jakarta.servlet</groupId> | ||||
|          <artifactId>jakarta.servlet-api</artifactId> | ||||
|          <groupId>javax.servlet</groupId> | ||||
|          <artifactId>javax.servlet-api</artifactId> | ||||
|          <scope>provided</scope> | ||||
|       </dependency> | ||||
|  | ||||
|       <!-- Test only dependencies, as popped up while running mvn test --> | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| /* | ||||
|  * Copyright (C) 2005 - 2023 Alfresco Software Limited. | ||||
|  * Copyright (C) 2005-2011 Alfresco Software Limited. | ||||
|  * | ||||
|  * This file is part of Alfresco | ||||
|  * | ||||
| @@ -26,8 +26,8 @@ import java.net.UnknownHostException; | ||||
| import java.security.AlgorithmParameters; | ||||
| import java.util.Arrays; | ||||
|  | ||||
| import jakarta.servlet.http.HttpServletRequest; | ||||
| import jakarta.servlet.http.HttpServletResponse; | ||||
| import javax.servlet.http.HttpServletRequest; | ||||
| import javax.servlet.http.HttpServletResponse; | ||||
|  | ||||
| import org.alfresco.encryption.MACUtils.MACInput; | ||||
| import org.alfresco.error.AlfrescoRuntimeException; | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| /* | ||||
|  * Copyright (C) 2005 - 2023 Alfresco Software Limited. | ||||
|  * Copyright (C) 2005-2011 Alfresco Software Limited. | ||||
|  * | ||||
|  * This file is part of Alfresco | ||||
|  * | ||||
| @@ -21,8 +21,8 @@ package org.alfresco.encryption; | ||||
| import java.io.IOException; | ||||
| import java.security.AlgorithmParameters; | ||||
|  | ||||
| import jakarta.servlet.http.HttpServletRequest; | ||||
| import jakarta.servlet.http.HttpServletResponse; | ||||
| import javax.servlet.http.HttpServletRequest; | ||||
| import javax.servlet.http.HttpServletResponse; | ||||
|  | ||||
| import org.apache.commons.httpclient.HttpMethod; | ||||
|  | ||||
|   | ||||
| @@ -92,16 +92,15 @@ public class HttpClient4Factory | ||||
|         else | ||||
|         { | ||||
|             //Setting a connectionManager overrides these properties | ||||
|             config.getMaxTotalConnections().ifPresent(v -> clientBuilder.setMaxConnTotal(v)); | ||||
|             config.getMaxHostConnections().ifPresent(v -> clientBuilder.setMaxConnPerRoute(v)); | ||||
|             clientBuilder.setMaxConnTotal(config.getMaxTotalConnections()); | ||||
|             clientBuilder.setMaxConnPerRoute(config.getMaxHostConnections()); | ||||
|         } | ||||
|  | ||||
|         RequestConfig.Builder requestConfigBuilder = RequestConfig.custom(); | ||||
|         config.getConnectionTimeout().ifPresent(v -> requestConfigBuilder.setConnectTimeout(v)); | ||||
|         config.getConnectionRequestTimeout().ifPresent(v -> requestConfigBuilder.setConnectionRequestTimeout(v)); | ||||
|         config.getSocketTimeout().ifPresent(v -> requestConfigBuilder.setSocketTimeout(v)); | ||||
|  | ||||
|         RequestConfig requestConfig = requestConfigBuilder.build(); | ||||
|         RequestConfig requestConfig = RequestConfig.custom() | ||||
|                .setConnectTimeout(config.getConnectionTimeout()) | ||||
|                .setSocketTimeout(config.getSocketTimeout()) | ||||
|                .setConnectionRequestTimeout(config.getConnectionRequestTimeout()) | ||||
|                .build(); | ||||
|  | ||||
|         clientBuilder.setDefaultRequestConfig(requestConfig); | ||||
|  | ||||
| @@ -136,8 +135,8 @@ public class HttpClient4Factory | ||||
|                    .register("http", PlainConnectionSocketFactory.getSocketFactory()) | ||||
|                    .build()); | ||||
|         } | ||||
|         config.getMaxTotalConnections().ifPresent(v -> poolingHttpClientConnectionManager.setMaxTotal(v)); | ||||
|         config.getMaxHostConnections().ifPresent(v -> poolingHttpClientConnectionManager.setDefaultMaxPerRoute(v)); | ||||
|         poolingHttpClientConnectionManager.setMaxTotal(config.getMaxTotalConnections()); | ||||
|         poolingHttpClientConnectionManager.setDefaultMaxPerRoute(config.getMaxHostConnections()); | ||||
|  | ||||
|         return poolingHttpClientConnectionManager; | ||||
|     } | ||||
|   | ||||
| @@ -85,27 +85,17 @@ public class HttpClientConfig | ||||
|         this.keyStore = new AlfrescoKeyStoreImpl(sslEncryptionParameters.getKeyStoreParameters(),  keyResourceLoader); | ||||
|         this.trustStore = new AlfrescoKeyStoreImpl(sslEncryptionParameters.getTrustStoreParameters(), keyResourceLoader); | ||||
|  | ||||
|         config = retrieveConfig(); | ||||
|         config = retrieveConfig(serviceName); | ||||
|         checkUnsupportedProperties(config); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Method used for retrieving HttpClient config from Global Properties | ||||
|      * that can also have values provided/overridden through System Properties | ||||
|      * | ||||
|      * @param serviceName name of used service | ||||
|      * @return map of properties | ||||
|      */ | ||||
|     private Map<String, String> retrieveConfig() | ||||
|     private Map<String, String> retrieveConfig(String serviceName) | ||||
|     { | ||||
|         Map<String, String> resultProperties = getHttpClientPropertiesForService(properties); | ||||
|         Map<String, String> systemProperties = getHttpClientPropertiesForService(System.getProperties()); | ||||
|  | ||||
|         systemProperties.forEach((k, v) -> resultProperties.put(k, v)); //Override/Add to Global Properties results with values from System Properties | ||||
|  | ||||
|         return resultProperties; | ||||
|     } | ||||
|  | ||||
|     private Map<String, String> getHttpClientPropertiesForService(Properties properties) { | ||||
|         return properties.keySet().stream() | ||||
|                 .filter(key -> key instanceof String) | ||||
|                 .map(Object::toString) | ||||
| @@ -122,75 +112,79 @@ public class HttpClientConfig | ||||
|               .forEach(propertyName -> LOGGER.warn(String.format("For service [%s], an unsupported property [%s] is set", serviceName, propertyName))); | ||||
|     } | ||||
|  | ||||
|     private Optional<Integer> getIntegerProperty(HttpClientPropertiesEnum property) | ||||
|     private Integer getIntegerProperty(HttpClientPropertiesEnum property) | ||||
|     { | ||||
|         Optional<String> optionalProperty = extractValueFromConfig(property); | ||||
|  | ||||
|         return optionalProperty.isPresent() ? Optional.of(Integer.parseInt(optionalProperty.get())) : Optional.empty(); | ||||
|         return Integer.parseInt(extractValueFromConfig(property).orElse("0")); | ||||
|     } | ||||
|  | ||||
|     private Optional<Boolean> getBooleanProperty(HttpClientPropertiesEnum property) | ||||
|     private Boolean getBooleanProperty(HttpClientPropertiesEnum property) | ||||
|     { | ||||
|         Optional<String> optionalProperty = extractValueFromConfig(property); | ||||
|  | ||||
|         return optionalProperty.isPresent() ? Optional.of(Boolean.parseBoolean(optionalProperty.get())) : Optional.empty(); | ||||
|         return Boolean.parseBoolean(extractValueFromConfig(property).orElse("false")); | ||||
|     } | ||||
|  | ||||
|     private Optional<String> extractValueFromConfig(HttpClientPropertiesEnum property) | ||||
|     { | ||||
|         return Optional.ofNullable(config.get(property.name)); | ||||
|         Optional<String> optionalProperty = Optional.ofNullable(config.get(property.name)); | ||||
|         if(property.isRequired && optionalProperty.isEmpty()) | ||||
|         { | ||||
|             String msg = String.format("Required property: '%s' is empty.", property.name); | ||||
|             throw new HttpClientException(msg); | ||||
|         } | ||||
|         return optionalProperty; | ||||
|     } | ||||
|  | ||||
|     public Optional<Integer> getConnectionTimeout() | ||||
|     public Integer getConnectionTimeout() | ||||
|     { | ||||
|         return getIntegerProperty(HttpClientPropertiesEnum.CONNECTION_REQUEST_TIMEOUT); | ||||
|     } | ||||
|  | ||||
|     public Optional<Integer> getSocketTimeout() | ||||
|     public Integer getSocketTimeout() | ||||
|     { | ||||
|         return getIntegerProperty(HttpClientPropertiesEnum.SOCKET_TIMEOUT); | ||||
|     } | ||||
|  | ||||
|     public Optional<Integer> getConnectionRequestTimeout() | ||||
|     public Integer getConnectionRequestTimeout() | ||||
|     { | ||||
|         return getIntegerProperty(HttpClientPropertiesEnum.CONNECTION_REQUEST_TIMEOUT); | ||||
|     } | ||||
|  | ||||
|     public Optional<Integer> getMaxTotalConnections() | ||||
|     public Integer getMaxTotalConnections() | ||||
|     { | ||||
|         return getIntegerProperty(HttpClientPropertiesEnum.MAX_TOTAL_CONNECTIONS); | ||||
|     } | ||||
|  | ||||
|     public Optional<Integer> getMaxHostConnections() | ||||
|     public Integer getMaxHostConnections() | ||||
|     { | ||||
|         return getIntegerProperty(HttpClientPropertiesEnum.MAX_HOST_CONNECTIONS); | ||||
|     } | ||||
|  | ||||
|     public boolean isMTLSEnabled() | ||||
|     public Boolean isMTLSEnabled() | ||||
|     { | ||||
|         return getBooleanProperty(HttpClientPropertiesEnum.MTLS_ENABLED).orElse(Boolean.FALSE); | ||||
|         return getBooleanProperty(HttpClientPropertiesEnum.MTLS_ENABLED); | ||||
|     } | ||||
|  | ||||
|     public boolean isHostnameVerificationDisabled() | ||||
|     { | ||||
|         return getBooleanProperty(HttpClientPropertiesEnum.HOSTNAME_VERIFICATION_DISABLED).orElse(Boolean.FALSE); | ||||
|         return getBooleanProperty(HttpClientPropertiesEnum.HOSTNAME_VERIFICATION_DISABLED); | ||||
|     } | ||||
|  | ||||
|     private enum HttpClientPropertiesEnum | ||||
|     { | ||||
|         CONNECTION_TIMEOUT("connectionTimeout"), | ||||
|         SOCKET_TIMEOUT("socketTimeout"), | ||||
|         CONNECTION_REQUEST_TIMEOUT("connectionRequestTimeout"), | ||||
|         MAX_TOTAL_CONNECTIONS("maxTotalConnections"), | ||||
|         MAX_HOST_CONNECTIONS("maxHostConnections"), | ||||
|         HOSTNAME_VERIFICATION_DISABLED("hostnameVerificationDisabled"), | ||||
|         MTLS_ENABLED("mTLSEnabled"); | ||||
|         CONNECTION_TIMEOUT("connectionTimeout", true), | ||||
|         SOCKET_TIMEOUT("socketTimeout", true), | ||||
|         CONNECTION_REQUEST_TIMEOUT("connectionRequestTimeout", true), | ||||
|         MAX_TOTAL_CONNECTIONS("maxTotalConnections", true), | ||||
|         MAX_HOST_CONNECTIONS("maxHostConnections", true), | ||||
|         HOSTNAME_VERIFICATION_DISABLED("hostnameVerificationDisabled", false), | ||||
|         MTLS_ENABLED("mTLSEnabled", true); | ||||
|  | ||||
|         private final String name; | ||||
|         private final Boolean isRequired; | ||||
|  | ||||
|         HttpClientPropertiesEnum(String propertyName) | ||||
|         HttpClientPropertiesEnum(String propertyName, Boolean isRequired) | ||||
|         { | ||||
|             this.name = propertyName; | ||||
|             this.isRequired = isRequired; | ||||
|         } | ||||
|  | ||||
|         private static final List<String> supportedProperties = new ArrayList<>(); | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| /* | ||||
|  * Copyright (C) 2005-2023 Alfresco Software Limited. | ||||
|  * Copyright (C) 2005-2014 Alfresco Software Limited. | ||||
|  * | ||||
|  * This file is part of Alfresco | ||||
|  * | ||||
| @@ -23,13 +23,13 @@ import static java.util.Collections.emptyList; | ||||
| import java.lang.reflect.Method; | ||||
| import java.util.Collection; | ||||
|  | ||||
| import jakarta.transaction.HeuristicMixedException; | ||||
| import jakarta.transaction.HeuristicRollbackException; | ||||
| import jakarta.transaction.NotSupportedException; | ||||
| import jakarta.transaction.RollbackException; | ||||
| import jakarta.transaction.Status; | ||||
| import jakarta.transaction.SystemException; | ||||
| import jakarta.transaction.UserTransaction; | ||||
| import javax.transaction.HeuristicMixedException; | ||||
| import javax.transaction.HeuristicRollbackException; | ||||
| import javax.transaction.NotSupportedException; | ||||
| import javax.transaction.RollbackException; | ||||
| import javax.transaction.Status; | ||||
| import javax.transaction.SystemException; | ||||
| import javax.transaction.UserTransaction; | ||||
|  | ||||
| import org.alfresco.error.StackTraceUtil; | ||||
| import org.alfresco.util.GUID; | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| /* | ||||
|  * Copyright (C) 2005-2023 Alfresco Software Limited. | ||||
|  * Copyright (C) 2005-2010 Alfresco Software Limited. | ||||
|  * | ||||
|  * This file is part of Alfresco | ||||
|  * | ||||
| @@ -53,7 +53,7 @@ public interface TransactionListener | ||||
|      * on the state of the transaction. | ||||
|      * <p> | ||||
|      * Although all transaction resources are still available, this method should | ||||
|      * be used only for cleaning up resources after a commit has occurred. | ||||
|      * be used only for cleaning up resources after a commit has occured. | ||||
|      */ | ||||
|     void afterCommit(); | ||||
|  | ||||
| @@ -64,7 +64,7 @@ public interface TransactionListener | ||||
|      * on the state of the transaction. | ||||
|      * <p> | ||||
|      * Although all transaction resources are still available, this method should | ||||
|      * be used only for cleaning up resources after a rollback has occurred. | ||||
|      * be used only for cleaning up resources after a rollback has occured. | ||||
|      */ | ||||
|     void afterRollback(); | ||||
| } | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| /* | ||||
|  * Copyright (C) 2005 - 2023 Alfresco Software Limited. | ||||
|  * Copyright (C) 2005-2010 Alfresco Software Limited. | ||||
|  * | ||||
|  * This file is part of Alfresco | ||||
|  * | ||||
| @@ -20,13 +20,13 @@ package org.alfresco.web.scripts.servlet; | ||||
|  | ||||
| import java.io.IOException; | ||||
|  | ||||
| import jakarta.servlet.Filter; | ||||
| import jakarta.servlet.FilterChain; | ||||
| import jakarta.servlet.FilterConfig; | ||||
| import jakarta.servlet.ServletException; | ||||
| import jakarta.servlet.ServletRequest; | ||||
| import jakarta.servlet.ServletResponse; | ||||
| import jakarta.servlet.http.HttpServletResponse; | ||||
| import javax.servlet.Filter; | ||||
| import javax.servlet.FilterChain; | ||||
| import javax.servlet.FilterConfig; | ||||
| import javax.servlet.ServletException; | ||||
| import javax.servlet.ServletRequest; | ||||
| import javax.servlet.ServletResponse; | ||||
| import javax.servlet.http.HttpServletResponse; | ||||
|  | ||||
| /** | ||||
|  * Simple servlet filter to add a 'Cache-Control' HTTP header to a response. | ||||
| @@ -48,7 +48,7 @@ public class StaticAssetCacheFilter implements Filter | ||||
|      | ||||
|      | ||||
|     /* (non-Javadoc) | ||||
|      * @see jakarta.servlet.Filter#init(jakarta.servlet.FilterConfig) | ||||
|      * @see javax.servlet.Filter#init(javax.servlet.FilterConfig) | ||||
|      */ | ||||
|     public void init(FilterConfig config) throws ServletException | ||||
|     { | ||||
| @@ -60,7 +60,7 @@ public class StaticAssetCacheFilter implements Filter | ||||
|     } | ||||
|      | ||||
|     /* (non-Javadoc) | ||||
|      * @see jakarta.servlet.Filter#doFilter(jakarta.servlet.ServletRequest, jakarta.servlet.ServletResponse, jakarta.servlet.FilterChain) | ||||
|      * @see javax.servlet.Filter#doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain) | ||||
|      */ | ||||
|     public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, | ||||
|             ServletException | ||||
| @@ -70,7 +70,7 @@ public class StaticAssetCacheFilter implements Filter | ||||
|     } | ||||
|      | ||||
|     /* (non-Javadoc) | ||||
|      * @see jakarta.servlet.Filter#destroy() | ||||
|      * @see javax.servlet.Filter#destroy() | ||||
|      */ | ||||
|     public void destroy() | ||||
|     { | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| /* | ||||
| * Copyright (C) 2005 - 2023 Alfresco Software Limited. | ||||
| * Copyright (C) 2005-2013 Alfresco Software Limited. | ||||
| * | ||||
| * This file is part of Alfresco | ||||
| * | ||||
| @@ -21,9 +21,9 @@ package org.alfresco.web.scripts.servlet; | ||||
|  | ||||
| import javax.management.*; | ||||
| import javax.security.auth.x500.X500Principal; | ||||
| import jakarta.servlet.*; | ||||
| import jakarta.servlet.http.HttpServletRequest; | ||||
| import jakarta.servlet.http.HttpServletResponse; | ||||
| import javax.servlet.*; | ||||
| import javax.servlet.http.HttpServletRequest; | ||||
| import javax.servlet.http.HttpServletResponse; | ||||
| import java.io.IOException; | ||||
| import java.security.cert.X509Certificate; | ||||
| import java.util.Set; | ||||
| @@ -74,6 +74,8 @@ public abstract class X509ServletFilterBase implements Filter | ||||
|                 logger.debug("Initializing X509ServletFilter"); | ||||
|             } | ||||
|  | ||||
|             this.handleClientAuth(); | ||||
|  | ||||
|             this.enforce = checkEnforce(config.getServletContext()); | ||||
|  | ||||
|             if(logger.isDebugEnabled()) | ||||
| @@ -83,8 +85,6 @@ public abstract class X509ServletFilterBase implements Filter | ||||
|  | ||||
|             if (this.enforce) | ||||
|             { | ||||
|                 this.handleClientAuth(); | ||||
|  | ||||
|                 /* | ||||
|                 * We are enforcing so get the cert-contains string. | ||||
|                 */ | ||||
| @@ -134,7 +134,7 @@ public abstract class X509ServletFilterBase implements Filter | ||||
|                 logger.debug("Enforcing X509 request"); | ||||
|             } | ||||
|  | ||||
|             X509Certificate[] certs = (X509Certificate[])httpRequest.getAttribute("jakarta.servlet.request.X509Certificate"); | ||||
|             X509Certificate[] certs = (X509Certificate[])httpRequest.getAttribute("javax.servlet.request.X509Certificate"); | ||||
|             if(validCert(certs)) | ||||
|             { | ||||
|  | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| /* | ||||
|  * Copyright (C) 2005-2023 Alfresco Software Limited. | ||||
|  * Copyright (C) 2005-2011 Alfresco Software Limited. | ||||
|  * | ||||
|  * This file is part of Alfresco | ||||
|  * | ||||
| @@ -55,11 +55,11 @@ public class CannedQueryTest extends TestCase | ||||
|         RESULTS_TWO = new ArrayList<Long>(10); | ||||
|         for (int i = 0; i < 10; i++) | ||||
|         { | ||||
|             RESULTS_TWO.add(Long.valueOf(i)); | ||||
|             RESULTS_TWO.add(new Long(i)); | ||||
|         } | ||||
|         ANTI_RESULTS = new HashSet<Object>(); | ||||
|         ANTI_RESULTS.add("ONE_5"); | ||||
|         ANTI_RESULTS.add(Long.valueOf(5)); | ||||
|         ANTI_RESULTS.add(new Long(5)); | ||||
|     } | ||||
|      | ||||
|     @SuppressWarnings("rawtypes") | ||||
|   | ||||
| @@ -25,7 +25,6 @@ import junit.framework.TestCase; | ||||
|  *  | ||||
|  * @author Roy Wetherall | ||||
|  */ | ||||
| @SuppressWarnings({"PMD.DetachedTestCase", "PMD.JUnit4TestShouldUseTestAnnotation"}) | ||||
| public class VersionNumberTest extends TestCase | ||||
| { | ||||
|     public void testCreate() | ||||
| @@ -137,36 +136,4 @@ public class VersionNumberTest extends TestCase | ||||
|         assertEquals(-1, version8.compareTo(version9)); | ||||
|         assertEquals(-1, version9.compareTo(version10)); | ||||
|     } | ||||
|  | ||||
|     public void testCompareNewSchema() { | ||||
|         // module min/max repo version is 23, actual ACS version is 23.1.0 which is greater than module | ||||
|         VersionNumber repoVersionMin = new VersionNumber("23"); | ||||
|         VersionNumber repoVerisionActual = new VersionNumber("23.1.0"); | ||||
|         assertEquals(1, repoVerisionActual.compareTo(repoVersionMin)); | ||||
|  | ||||
|         // module min/max repo version is 23.2, actual ACS version is 23.1.1 which is lower than module | ||||
|         repoVersionMin = new VersionNumber("23.2"); | ||||
|         repoVerisionActual = new VersionNumber("23.1.1"); | ||||
|         assertEquals(-1, repoVerisionActual.compareTo(repoVersionMin)); | ||||
|  | ||||
|         // module min/max repo version is 7.4, actual ACS version is 23.1.0 which is greater than module | ||||
|         repoVersionMin = new VersionNumber("7.4"); | ||||
|         repoVerisionActual = new VersionNumber("23.1.0"); | ||||
|         assertEquals(1, repoVerisionActual.compareTo(repoVersionMin)); | ||||
|  | ||||
|         // module min/max repo version is 24, actual ACS version is 24.1.0 which is greater than module | ||||
|         repoVersionMin = new VersionNumber("24"); | ||||
|         repoVerisionActual = new VersionNumber("24.1.0"); | ||||
|         assertEquals(1, repoVerisionActual.compareTo(repoVersionMin)); | ||||
|  | ||||
|         // module min/max repo version is 24, actual ACS version is 23.2.0 which is lower than module | ||||
|         repoVersionMin = new VersionNumber("24"); | ||||
|         repoVerisionActual = new VersionNumber("23.2.0"); | ||||
|         assertEquals(-1, repoVerisionActual.compareTo(repoVersionMin)); | ||||
|  | ||||
|         // module min/max repo version is 24.2, actual ACS version is 24.2.0 which is equal to module | ||||
|         repoVersionMin = new VersionNumber("24.2"); | ||||
|         repoVerisionActual = new VersionNumber("24.2.0"); | ||||
|         assertEquals(0, repoVerisionActual.compareTo(repoVersionMin)); | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| /* | ||||
|  * Copyright (C) 2005-2023 Alfresco Software Limited. | ||||
|  * Copyright (C) 2005-2014 Alfresco Software Limited. | ||||
|  * | ||||
|  * This file is part of Alfresco | ||||
|  * | ||||
| @@ -21,9 +21,9 @@ package org.alfresco.util.transaction; | ||||
| import java.util.NoSuchElementException; | ||||
| import java.util.Objects; | ||||
|  | ||||
| import jakarta.transaction.RollbackException; | ||||
| import jakarta.transaction.Status; | ||||
| import jakarta.transaction.UserTransaction; | ||||
| import javax.transaction.RollbackException; | ||||
| import javax.transaction.Status; | ||||
| import javax.transaction.UserTransaction; | ||||
|  | ||||
| import junit.framework.TestCase; | ||||
|  | ||||
|   | ||||
| @@ -7,7 +7,7 @@ | ||||
|     <parent> | ||||
|         <groupId>org.alfresco</groupId> | ||||
|         <artifactId>alfresco-community-repo</artifactId> | ||||
|         <version>23.2.0.23</version> | ||||
|         <version>23.1.0.167-SNAPSHOT</version> | ||||
|     </parent> | ||||
|  | ||||
|     <properties> | ||||
| @@ -90,8 +90,9 @@ | ||||
|             | see http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Scope | ||||
|             --> | ||||
|         <dependency> | ||||
|             <groupId>jakarta.servlet</groupId> | ||||
|             <artifactId>jakarta.servlet-api</artifactId> | ||||
|             <groupId>javax.servlet</groupId> | ||||
|             <artifactId>javax.servlet-api</artifactId> | ||||
|             <scope>provided</scope> | ||||
|         </dependency> | ||||
|  | ||||
|         <!-- Jakarta... --> | ||||
| @@ -99,6 +100,7 @@ | ||||
|             <groupId>jakarta.activation</groupId> | ||||
|             <artifactId>jakarta.activation-api</artifactId> | ||||
|         </dependency> | ||||
|         <!-- REPO-5047 - Replaces com.sun.activation:javax.activation --> | ||||
|         <dependency> | ||||
|             <groupId>com.sun.activation</groupId> | ||||
|             <artifactId>jakarta.activation</artifactId> | ||||
| @@ -140,11 +142,53 @@ | ||||
|             <groupId>org.apache.chemistry.opencmis</groupId> | ||||
|             <artifactId>chemistry-opencmis-commons-impl</artifactId> | ||||
|             <version>${dependency.opencmis.version}</version> | ||||
|             <exclusions> | ||||
|                 <exclusion> | ||||
|                     <groupId>com.sun.xml.messaging.saaj</groupId> | ||||
|                     <artifactId>saaj-impl</artifactId> | ||||
|                 </exclusion> | ||||
|                 <!-- Duplicates classes from com.fasterxml.woodstox:woodstox-core --> | ||||
|                 <exclusion> | ||||
|                     <groupId>org.codehaus.woodstox</groupId> | ||||
|                     <artifactId>woodstox-core-asl</artifactId> | ||||
|                 </exclusion> | ||||
|                 <!-- [ACS-544] Excluded as conflicts with JDK9+ as it includes javax.transaction --> | ||||
|                 <exclusion> | ||||
|                   <groupId>org.apache.geronimo.specs</groupId> | ||||
|                   <artifactId>geronimo-jta_1.1_spec</artifactId> | ||||
|                 </exclusion> | ||||
|              </exclusions> | ||||
|         </dependency> | ||||
|         <dependency> | ||||
|             <groupId>org.apache.chemistry.opencmis</groupId> | ||||
|             <artifactId>chemistry-opencmis-server-bindings</artifactId> | ||||
|             <version>${dependency.opencmis.version}</version> | ||||
|             <exclusions> | ||||
|                 <exclusion> | ||||
|                     <groupId>commons-lang</groupId> | ||||
|                     <artifactId>commons-lang3</artifactId> | ||||
|                 </exclusion> | ||||
|                 <!-- Duplicates classes from jakarta.jws:jakarta.jws-api --> | ||||
|                 <exclusion> | ||||
|                     <groupId>org.apache.geronimo.specs</groupId> | ||||
|                     <artifactId>geronimo-ws-metadata_2.0_spec</artifactId> | ||||
|                 </exclusion> | ||||
|                 <!-- Duplicates classes from jakarta.transaction:jakarta.transaction-api --> | ||||
|                 <exclusion> | ||||
|                     <groupId>org.apache.geronimo.specs</groupId> | ||||
|                     <artifactId>geronimo-jta_1.1_spec</artifactId> | ||||
|                 </exclusion> | ||||
|                 <!-- Duplicates classes from jakarta.annotation:jakarta.annotation-api --> | ||||
|                 <exclusion> | ||||
|                     <groupId>javax.annotation</groupId> | ||||
|                     <artifactId>javax.annotation-api</artifactId> | ||||
|                 </exclusion> | ||||
|                 <!-- Duplicates classes from com.sun.activation:jakarta.activation --> | ||||
|                 <exclusion> | ||||
|                     <groupId>com.sun.activation</groupId> | ||||
|                     <artifactId>javax.activation</artifactId> | ||||
|                 </exclusion> | ||||
|             </exclusions> | ||||
|         </dependency> | ||||
|         <!-- This is now deployed at: | ||||
|             | http://artifacts.alfresco.com/nexus/content/repositories/thirdparty/org/acegisecurity/acegi-security/0.8.2_patched/ | ||||
| @@ -197,10 +241,6 @@ | ||||
|                     <groupId>org.bouncycastle</groupId> | ||||
|                     <artifactId>bcprov-jdk15on</artifactId> | ||||
|                 </exclusion> | ||||
|                 <exclusion> | ||||
|                     <groupId>org.bouncycastle</groupId> | ||||
|                     <artifactId>bcmail-jdk15on</artifactId> | ||||
|                 </exclusion> | ||||
|                 <exclusion> | ||||
|                     <groupId>asm</groupId> | ||||
|                     <artifactId>asm</artifactId> | ||||
| @@ -224,10 +264,7 @@ | ||||
|                 </exclusion> | ||||
|             </exclusions> | ||||
|         </dependency> | ||||
|         <dependency> | ||||
|             <groupId>org.bouncycastle</groupId> | ||||
|             <artifactId>bcmail-jdk15to18</artifactId> | ||||
|         </dependency> | ||||
|  | ||||
|         <dependency> | ||||
|             <groupId>com.fasterxml.jackson.core</groupId> | ||||
|             <artifactId>jackson-core</artifactId> | ||||
|   | ||||
| @@ -58,9 +58,10 @@ public class LuceneConjunction<Q, S, E extends Throwable> extends BaseConjunctio | ||||
|     public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, QueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext) | ||||
|             throws E | ||||
|     { | ||||
|         | ||||
|         QueryParserExpressionAdaptor<Q, E> expressionAdaptor = luceneContext.getLuceneQueryParserAdaptor().getExpressionAdaptor(); | ||||
|         boolean must = false; | ||||
|         boolean mustNot = false; | ||||
|         boolean must_not = false; | ||||
|         for (Constraint constraint : getConstraints()) | ||||
|         { | ||||
|             if (constraint instanceof LuceneQueryBuilderComponent) | ||||
| @@ -83,20 +84,23 @@ public class LuceneConjunction<Q, S, E extends Throwable> extends BaseConjunctio | ||||
|                         break; | ||||
|                     case EXCLUDE: | ||||
|                         expressionAdaptor.addExcluded(constraintQuery, constraint.getBoost()); | ||||
|                         mustNot = true; | ||||
|                         must_not = true; | ||||
|                         break; | ||||
|                     } | ||||
|                      | ||||
|                 } | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 throw new UnsupportedOperationException(); | ||||
|             } | ||||
|         } | ||||
|         if(!must && mustNot) | ||||
|         { | ||||
|             expressionAdaptor.addRequired(luceneContext.getLuceneQueryParserAdaptor().getMatchAllNodesQuery()); | ||||
|             if(!must &&  must_not) | ||||
|             { | ||||
|                 expressionAdaptor.addRequired(luceneContext.getLuceneQueryParserAdaptor().getMatchAllNodesQuery()); | ||||
|             } | ||||
|         } | ||||
|         return expressionAdaptor.getQuery(); | ||||
|  | ||||
|     } | ||||
|  | ||||
| } | ||||
|   | ||||
| @@ -40,10 +40,12 @@ import org.alfresco.repo.search.impl.querymodel.PropertyArgument; | ||||
| import org.alfresco.repo.search.impl.querymodel.Selector; | ||||
| import org.alfresco.repo.search.impl.querymodel.Source; | ||||
| import org.alfresco.repo.search.impl.querymodel.impl.BaseQuery; | ||||
| import org.alfresco.repo.search.impl.querymodel.impl.SimpleConstraint; | ||||
| import org.alfresco.repo.search.impl.querymodel.impl.functions.PropertyAccessor; | ||||
| import org.alfresco.repo.search.impl.querymodel.impl.functions.Score; | ||||
| import org.alfresco.service.cmr.search.SearchParameters.SortDefinition; | ||||
| import org.alfresco.service.cmr.search.SearchParameters.SortDefinition.SortType; | ||||
| import org.alfresco.util.Pair; | ||||
|  | ||||
| /** | ||||
|  * @author andyh | ||||
| @@ -70,8 +72,10 @@ public class LuceneQuery<Q, S, E extends Throwable> extends BaseQuery implements | ||||
|         QueryParserExpressionAdaptor<Q, E> expressionBuilder = luceneContext.getLuceneQueryParserAdaptor().getExpressionAdaptor(); | ||||
|  | ||||
|         boolean must = false; | ||||
|         boolean mustNot = false; | ||||
|         boolean must_not = false; | ||||
|  | ||||
|         ArrayList<Pair<Constraint, Q>> queriestoConjoin = new ArrayList<>(); | ||||
|          | ||||
|         if (selectors != null) | ||||
|         { | ||||
|             for (String selector : selectors) | ||||
| @@ -82,6 +86,7 @@ public class LuceneQuery<Q, S, E extends Throwable> extends BaseQuery implements | ||||
|                     @SuppressWarnings("unchecked") | ||||
|                     LuceneQueryBuilderComponent<Q, S, E> luceneQueryBuilderComponent = (LuceneQueryBuilderComponent<Q, S, E>) current; | ||||
|                     Q selectorQuery = luceneQueryBuilderComponent.addComponent(selectors, null, luceneContext, functionContext); | ||||
|                     queriestoConjoin.add(new Pair<Constraint, Q>(new SimpleConstraint(org.alfresco.repo.search.impl.querymodel.Constraint.Occur.MANDATORY), selectorQuery)); | ||||
|                     if (selectorQuery != null) | ||||
|                     { | ||||
|                         expressionBuilder.addRequired(selectorQuery); | ||||
| @@ -103,7 +108,8 @@ public class LuceneQuery<Q, S, E extends Throwable> extends BaseQuery implements | ||||
|                 @SuppressWarnings("unchecked") | ||||
|                 LuceneQueryBuilderComponent<Q, S, E> luceneQueryBuilderComponent = (LuceneQueryBuilderComponent<Q, S, E>) constraint; | ||||
|                 Q constraintQuery = luceneQueryBuilderComponent.addComponent(selectors, null, luceneContext, functionContext); | ||||
|  | ||||
|                 queriestoConjoin.add(new Pair<Constraint, Q>(constraint, constraintQuery)); | ||||
|                  | ||||
|                 if (constraintQuery != null) | ||||
|                 { | ||||
|                     switch (constraint.getOccur()) | ||||
| @@ -118,7 +124,7 @@ public class LuceneQuery<Q, S, E extends Throwable> extends BaseQuery implements | ||||
|                         break; | ||||
|                     case EXCLUDE: | ||||
|                         expressionBuilder.addExcluded(constraintQuery, constraint.getBoost()); | ||||
|                         mustNot = true; | ||||
|                         must_not = true; | ||||
|                         break; | ||||
|                     } | ||||
|                 } | ||||
| @@ -129,12 +135,13 @@ public class LuceneQuery<Q, S, E extends Throwable> extends BaseQuery implements | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         if (!must && mustNot) | ||||
|         if (!must && must_not) | ||||
|         { | ||||
|             expressionBuilder.addRequired(luceneContext.getLuceneQueryParserAdaptor().getMatchAllNodesQuery()); | ||||
|         } | ||||
|  | ||||
|         return expressionBuilder.getQuery(); | ||||
|  | ||||
|     } | ||||
|  | ||||
|     /* | ||||
| @@ -158,10 +165,10 @@ public class LuceneQuery<Q, S, E extends Throwable> extends BaseQuery implements | ||||
|     { | ||||
|         if ((getOrderings() == null) || (getOrderings().size() == 0)) | ||||
|         { | ||||
|             return Collections.emptyList(); | ||||
|             return Collections.<SortDefinition>emptyList(); | ||||
|         } | ||||
|  | ||||
|         List<SortDefinition> definitions = new ArrayList<>(getOrderings().size()); | ||||
|         ArrayList<SortDefinition> definitions = new ArrayList<SortDefinition>(getOrderings().size()); | ||||
|  | ||||
|         for (Ordering ordering : getOrderings()) | ||||
|         { | ||||
|   | ||||
| @@ -2,7 +2,7 @@ | ||||
|  * #%L | ||||
|  * Alfresco Data model classes | ||||
|  * %% | ||||
|  * Copyright (C) 2005 - 2023 Alfresco Software Limited | ||||
|  * 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  | ||||
| @@ -121,7 +121,7 @@ public class AssociationRef implements EntityRef, Serializable | ||||
|         String targetNodeRefStr = tokenizer.nextToken(); | ||||
|         String assocTypeQNameStr = tokenizer.nextToken(); | ||||
|          | ||||
|         this.id = Long.valueOf(idStr); | ||||
|         this.id = new Long(idStr); | ||||
|         this.sourceRef = new NodeRef(sourceNodeRefStr); | ||||
|         this.targetRef = new NodeRef(targetNodeRefStr); | ||||
|         this.assocTypeQName = QName.createQName(assocTypeQNameStr); | ||||
|   | ||||
| @@ -2,7 +2,7 @@ | ||||
|  * #%L | ||||
|  * Alfresco Data model classes | ||||
|  * %% | ||||
|  * Copyright (C) 2005 - 2023 Alfresco Software Limited | ||||
|  * 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  | ||||
| @@ -391,7 +391,7 @@ public class DefaultTypeConverter extends TypeConverter | ||||
|         { | ||||
|             public Boolean convert(Number source) | ||||
|             { | ||||
|                 return Boolean.valueOf(source.longValue() > 0); | ||||
|                 return new Boolean(source.longValue() > 0); | ||||
|             } | ||||
|         }); | ||||
|         addConverter(Number.class, Byte.class, new TypeConverter.Converter<Number, Byte>() | ||||
| @@ -549,8 +549,8 @@ public class DefaultTypeConverter extends TypeConverter | ||||
|         // | ||||
|         // Boolean -> | ||||
|         // | ||||
|         final Long LONG_FALSE = Long.valueOf(0L); | ||||
|         final Long LONG_TRUE = Long.valueOf(1L); | ||||
|         final Long LONG_FALSE = new Long(0L); | ||||
|         final Long LONG_TRUE = new Long(1L); | ||||
|         addConverter(Boolean.class, Long.class, new TypeConverter.Converter<Boolean, Long>() | ||||
|                 { | ||||
|                     public Long convert(Boolean source) | ||||
|   | ||||
| @@ -2,7 +2,7 @@ | ||||
|  * #%L | ||||
|  * Alfresco Data model classes | ||||
|  * %% | ||||
|  * Copyright (C) 2005 - 2023 Alfresco Software Limited | ||||
|  * 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  | ||||
| @@ -190,7 +190,7 @@ public class Duration implements Comparable, Serializable | ||||
|             { | ||||
|                if (token == StreamTokenizer.TT_NUMBER) | ||||
|                { | ||||
|                   nval = Double.valueOf(tok.nval); | ||||
|                   nval = new Double(tok.nval); | ||||
|                } | ||||
|                else if (token == StreamTokenizer.TT_EOF) | ||||
|                { | ||||
|   | ||||
| @@ -2,7 +2,7 @@ | ||||
|  * #%L | ||||
|  * Alfresco Data model classes | ||||
|  * %% | ||||
|  * Copyright (C) 2005 - 2023 Alfresco Software Limited | ||||
|  * 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  | ||||
| @@ -27,7 +27,7 @@ package org.alfresco.util; | ||||
|  | ||||
| import java.io.IOException; | ||||
|  | ||||
| import jakarta.servlet.ServletContext; | ||||
| import javax.servlet.ServletContext; | ||||
|  | ||||
| import org.apache.chemistry.opencmis.commons.server.CmisServiceFactory; | ||||
| import org.apache.chemistry.opencmis.server.impl.CmisRepositoryContextListener; | ||||
|   | ||||
| @@ -2,7 +2,7 @@ | ||||
|  * #%L | ||||
|  * Alfresco Data model classes | ||||
|  * %% | ||||
|  * Copyright (C) 2005 - 2023 Alfresco Software Limited | ||||
|  * 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  | ||||
| @@ -57,8 +57,8 @@ public class DefaultTypeConverterTest extends TestCase | ||||
|  | ||||
|     public void testPrimitives() | ||||
|     { | ||||
|         assertEquals(Boolean.FALSE, DefaultTypeConverter.INSTANCE.convert(Boolean.class, false)); | ||||
|         assertEquals(Boolean.TRUE, DefaultTypeConverter.INSTANCE.convert(Boolean.class, true)); | ||||
|         assertEquals(Boolean.valueOf(false), DefaultTypeConverter.INSTANCE.convert(Boolean.class, false)); | ||||
|         assertEquals(Boolean.valueOf(true), DefaultTypeConverter.INSTANCE.convert(Boolean.class, true)); | ||||
|         assertEquals(Character.valueOf('a'), DefaultTypeConverter.INSTANCE.convert(Character.class, 'a')); | ||||
|         assertEquals(Byte.valueOf("3"), DefaultTypeConverter.INSTANCE.convert(Byte.class, (byte) 3)); | ||||
|         assertEquals(Short.valueOf("4"), DefaultTypeConverter.INSTANCE.convert(Short.class, (short) 4)); | ||||
| @@ -70,8 +70,8 @@ public class DefaultTypeConverterTest extends TestCase | ||||
|  | ||||
|     public void testNoConversion() | ||||
|     { | ||||
|         assertEquals(Boolean.FALSE, DefaultTypeConverter.INSTANCE.convert(Boolean.class, Boolean.FALSE)); | ||||
|         assertEquals(Boolean.TRUE, DefaultTypeConverter.INSTANCE.convert(Boolean.class, Boolean.TRUE)); | ||||
|         assertEquals(Boolean.valueOf(false), DefaultTypeConverter.INSTANCE.convert(Boolean.class, Boolean.valueOf(false))); | ||||
|         assertEquals(Boolean.valueOf(true), DefaultTypeConverter.INSTANCE.convert(Boolean.class, Boolean.valueOf(true))); | ||||
|         assertEquals(Character.valueOf('w'), DefaultTypeConverter.INSTANCE.convert(Character.class, Character.valueOf('w'))); | ||||
|         assertEquals(Byte.valueOf("3"), DefaultTypeConverter.INSTANCE.convert(Byte.class, Byte.valueOf("3"))); | ||||
|         assertEquals(Short.valueOf("4"), DefaultTypeConverter.INSTANCE.convert(Short.class, Short.valueOf("4"))); | ||||
| @@ -90,8 +90,8 @@ public class DefaultTypeConverterTest extends TestCase | ||||
|  | ||||
|     public void testToString() | ||||
|     { | ||||
|         assertEquals("true", DefaultTypeConverter.INSTANCE.convert(String.class, Boolean.TRUE)); | ||||
|         assertEquals("false", DefaultTypeConverter.INSTANCE.convert(String.class, Boolean.FALSE)); | ||||
|         assertEquals("true", DefaultTypeConverter.INSTANCE.convert(String.class, new Boolean(true))); | ||||
|         assertEquals("false", DefaultTypeConverter.INSTANCE.convert(String.class, new Boolean(false))); | ||||
|         assertEquals("v", DefaultTypeConverter.INSTANCE.convert(String.class, Character.valueOf('v'))); | ||||
|         assertEquals("3", DefaultTypeConverter.INSTANCE.convert(String.class, Byte.valueOf("3"))); | ||||
|         assertEquals("4", DefaultTypeConverter.INSTANCE.convert(String.class, Short.valueOf("4"))); | ||||
| @@ -132,8 +132,8 @@ public class DefaultTypeConverterTest extends TestCase | ||||
|  | ||||
|     public void testFromString() | ||||
|     { | ||||
|         assertEquals(Boolean.TRUE, DefaultTypeConverter.INSTANCE.convert(Boolean.class, "True")); | ||||
|         assertEquals(Boolean.FALSE, DefaultTypeConverter.INSTANCE.convert(Boolean.class, "woof")); | ||||
|         assertEquals(Boolean.valueOf(true), DefaultTypeConverter.INSTANCE.convert(Boolean.class, "True")); | ||||
|         assertEquals(Boolean.valueOf(false), DefaultTypeConverter.INSTANCE.convert(Boolean.class, "woof")); | ||||
|         assertEquals(Character.valueOf('w'), DefaultTypeConverter.INSTANCE.convert(Character.class, "w")); | ||||
|         assertEquals(Byte.valueOf("3"), DefaultTypeConverter.INSTANCE.convert(Byte.class, "3")); | ||||
|         assertEquals(Short.valueOf("4"), DefaultTypeConverter.INSTANCE.convert(Short.class, "4")); | ||||
| @@ -316,8 +316,8 @@ public class DefaultTypeConverterTest extends TestCase | ||||
|     private ArrayList<Object> makeList() | ||||
|     { | ||||
|         ArrayList<Object> list = new ArrayList<Object>(); | ||||
|         list.add(Boolean.TRUE); | ||||
|         list.add(Boolean.FALSE); | ||||
|         list.add(Boolean.valueOf(true)); | ||||
|         list.add(Boolean.valueOf(false)); | ||||
|         list.add(Character.valueOf('q')); | ||||
|         list.add(Byte.valueOf("1")); | ||||
|         list.add(Short.valueOf("2")); | ||||
|   | ||||
							
								
								
									
										17
									
								
								mmt/pom.xml
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								mmt/pom.xml
									
									
									
									
									
								
							| @@ -7,7 +7,7 @@ | ||||
|     <parent> | ||||
|         <groupId>org.alfresco</groupId> | ||||
|         <artifactId>alfresco-community-repo</artifactId> | ||||
|         <version>23.2.0.23</version> | ||||
|         <version>23.1.0.167-SNAPSHOT</version> | ||||
|     </parent> | ||||
|  | ||||
|     <dependencies> | ||||
| @@ -20,16 +20,6 @@ | ||||
|             <groupId>de.schlichtherle.truezip</groupId> | ||||
|             <artifactId>truezip-driver-zip</artifactId> | ||||
|             <version>${dependency.truezip.version}</version> | ||||
|             <exclusions> | ||||
|                 <exclusion> | ||||
|                     <groupId>org.bouncycastle</groupId> | ||||
|                     <artifactId>bcprov-jdk15on</artifactId> | ||||
|                 </exclusion> | ||||
|             </exclusions> | ||||
|         </dependency> | ||||
|         <dependency> | ||||
|             <groupId>org.bouncycastle</groupId> | ||||
|             <artifactId>bcprov-jdk15to18</artifactId> | ||||
|         </dependency> | ||||
|         <dependency> | ||||
|             <groupId>de.schlichtherle.truezip</groupId> | ||||
| @@ -41,11 +31,6 @@ | ||||
|             <artifactId>maven-artifact</artifactId> | ||||
|             <version>${dependency.maven-artifact.version}</version> | ||||
|         </dependency> | ||||
|         <dependency> | ||||
|             <groupId>junit</groupId> | ||||
|             <artifactId>junit</artifactId> | ||||
|             <scope>test</scope> | ||||
|         </dependency> | ||||
|         <dependency> | ||||
|             <groupId>org.mockito</groupId> | ||||
|             <artifactId>mockito-core</artifactId> | ||||
|   | ||||
| @@ -9,6 +9,6 @@ | ||||
|     <parent> | ||||
|         <groupId>org.alfresco</groupId> | ||||
|         <artifactId>alfresco-community-repo-packaging</artifactId> | ||||
|         <version>23.2.0.23</version> | ||||
|         <version>23.1.0.167-SNAPSHOT</version> | ||||
|     </parent> | ||||
| </project> | ||||
|   | ||||
| @@ -208,6 +208,10 @@ Hibernate   http://www.hibernate.org/ | ||||
| jid3lib http://javamusictag.sourceforge.net/ | ||||
| TinyMCE http://www.tinymce.com/ | ||||
|  | ||||
|                  | ||||
| === LGPL 3.0 === | ||||
| Gytheio https://github.com/Alfresco/gytheio | ||||
|  | ||||
|  | ||||
| === MIT License === | ||||
| Bouncy Castle   http://www.bouncycastle.org/  | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| # Fetch image based on Tomcat 9.0, Java 17 and Rocky Linux 8 | ||||
| # More infos about this image: https://github.com/Alfresco/alfresco-docker-base-tomcat | ||||
| FROM alfresco/alfresco-base-tomcat:tomcat10-jre17-rockylinux8-202306291245 | ||||
| FROM alfresco/alfresco-base-tomcat:tomcat9-jre17-rockylinux8-202303081618 | ||||
|  | ||||
| # Set default docker_context. | ||||
| ARG resource_path=target | ||||
| @@ -98,4 +98,4 @@ EXPOSE 10001 | ||||
| # For remote debug | ||||
| EXPOSE 8000 | ||||
|  | ||||
| USER ${IMAGEUSERNAME} | ||||
| USER ${IMAGEUSERNAME} | ||||
| @@ -7,7 +7,7 @@ | ||||
|     <parent> | ||||
|         <groupId>org.alfresco</groupId> | ||||
|         <artifactId>alfresco-community-repo-packaging</artifactId> | ||||
|         <version>23.2.0.23</version> | ||||
|         <version>23.1.0.167-SNAPSHOT</version> | ||||
|     </parent> | ||||
|  | ||||
|     <properties> | ||||
|   | ||||
| @@ -7,7 +7,7 @@ | ||||
|     <parent> | ||||
|         <groupId>org.alfresco</groupId> | ||||
|         <artifactId>alfresco-community-repo</artifactId> | ||||
|         <version>23.2.0.23</version> | ||||
|         <version>23.1.0.167-SNAPSHOT</version> | ||||
|     </parent> | ||||
|  | ||||
|     <modules> | ||||
|   | ||||
| @@ -1,3 +1,3 @@ | ||||
| SOLR6_TAG=2.0.8.1 | ||||
| POSTGRES_TAG=15.4 | ||||
| ACTIVEMQ_TAG=5.18.3-jre17-rockylinux8 | ||||
| SOLR6_TAG=2.0.7-A5 | ||||
| POSTGRES_TAG=14.4 | ||||
| ACTIVEMQ_TAG=5.17.4-jre17-rockylinux8 | ||||
|   | ||||
| @@ -6,7 +6,7 @@ | ||||
|     <parent> | ||||
|         <groupId>org.alfresco</groupId> | ||||
|         <artifactId>alfresco-community-repo-packaging</artifactId> | ||||
|         <version>23.2.0.23</version> | ||||
|         <version>23.1.0.167-SNAPSHOT</version> | ||||
|     </parent> | ||||
|  | ||||
|     <modules> | ||||
|   | ||||
| @@ -9,27 +9,13 @@ then | ||||
|   exit 1 | ||||
| fi | ||||
|  | ||||
| # If MTLS enabled configure keystore/truststore for curl command | ||||
| if [[ $ALFRESCO_URL == https* ]]; then | ||||
|   KEYSTORE_TRUSTSTORE_PATH="${CI_WORKSPACE}/keystores/testClient" | ||||
|   KEYSTORE_PASSWORD="password" | ||||
|  | ||||
|   ADDITIONAL_MTLS_CONFIG="--key $KEYSTORE_TRUSTSTORE_PATH/client-key.pem --cert $KEYSTORE_TRUSTSTORE_PATH/client-cert.pem:$KEYSTORE_PASSWORD --cacert $KEYSTORE_TRUSTSTORE_PATH/testClient_truststore.pem" | ||||
|   if [[ ${HOSTNAME_VERIFICATION_DISABLED} == true ]]; then | ||||
|     ADDITIONAL_MTLS_CONFIG=$ADDITIONAL_MTLS_CONFIG" -k" | ||||
|   fi | ||||
| else | ||||
|   ADDITIONAL_MTLS_CONFIG="" | ||||
| fi | ||||
|  | ||||
| WAIT_INTERVAL=1 | ||||
| COUNTER=0 | ||||
| TIMEOUT=300 | ||||
| t0=$(date +%s) | ||||
|  | ||||
| echo "Waiting for alfresco to start" | ||||
| echo curl --output /dev/null --silent --head --fail ${ADDITIONAL_MTLS_CONFIG} ${ALFRESCO_URL} | ||||
| until $(curl --output /dev/null --silent --head --fail ${ADDITIONAL_MTLS_CONFIG} ${ALFRESCO_URL}) || [ "$COUNTER" -eq "$TIMEOUT" ]; do | ||||
| until $(curl --output /dev/null --silent --head --fail ${ALFRESCO_URL}) || [ "$COUNTER" -eq "$TIMEOUT" ]; do | ||||
|    printf '.' | ||||
|    sleep $WAIT_INTERVAL | ||||
|    COUNTER=$(($COUNTER+$WAIT_INTERVAL)) | ||||
|   | ||||
| @@ -7,7 +7,7 @@ | ||||
|     <parent> | ||||
|         <groupId>org.alfresco</groupId> | ||||
|         <artifactId>alfresco-community-repo-tests</artifactId> | ||||
|         <version>23.2.0.23</version> | ||||
|         <version>23.1.0.167-SNAPSHOT</version> | ||||
|     </parent> | ||||
|  | ||||
|     <organization> | ||||
| @@ -18,6 +18,7 @@ | ||||
|     <properties> | ||||
|         <maven.build.sourceVersion>17</maven.build.sourceVersion> | ||||
|         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||||
|         <chemistry-opencmis-commons-api>1.1.0</chemistry-opencmis-commons-api> | ||||
|         <maven-jar-plugin.version>3.1.1</maven-jar-plugin.version> | ||||
|         <maven-release.version>2.5.3</maven-release.version> | ||||
|         <java.version>17</java.version> | ||||
| @@ -68,6 +69,13 @@ | ||||
|                 </exclusion> | ||||
|             </exclusions> | ||||
|         </dependency> | ||||
|  | ||||
|         <!-- open cmis settings --> | ||||
|         <dependency> | ||||
|             <groupId>org.apache.chemistry.opencmis</groupId> | ||||
|             <artifactId>chemistry-opencmis-commons-api</artifactId> | ||||
|             <version>${chemistry-opencmis-commons-api}</version> | ||||
|         </dependency> | ||||
|     </dependencies> | ||||
|  | ||||
|     <build> | ||||
|   | ||||
| @@ -280,26 +280,16 @@ public class CmisUtil | ||||
|  | ||||
|     protected boolean isPrivateWorkingCopy() | ||||
|     { | ||||
|         final Document document; | ||||
|         boolean result; | ||||
|         try | ||||
|         { | ||||
|             document = getPWCDocument(); | ||||
|             result = getPWCDocument().isVersionSeriesPrivateWorkingCopy(); | ||||
|         } | ||||
|         catch (CmisVersioningException cmisVersioningException) | ||||
|         { | ||||
|             return false; | ||||
|             result = false; | ||||
|         } | ||||
|  | ||||
|         if (Boolean.FALSE.equals(document.isVersionable())) return false; | ||||
|         if (Boolean.FALSE.equals(document.isVersionSeriesCheckedOut())) return false; | ||||
|  | ||||
|         final Boolean isPWC = document.isPrivateWorkingCopy(); | ||||
|         if (isPWC != null) return isPWC; | ||||
|  | ||||
|         final String vsCoId = document.getVersionSeriesCheckedOutId(); | ||||
|         if (vsCoId == null) return false; | ||||
|  | ||||
|         return vsCoId.equals(document.getId()); | ||||
|         return result; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -9,7 +9,7 @@ | ||||
|     <parent> | ||||
|         <groupId>org.alfresco</groupId> | ||||
|         <artifactId>alfresco-community-repo-tests</artifactId> | ||||
|         <version>23.2.0.23</version> | ||||
|         <version>23.1.0.167-SNAPSHOT</version> | ||||
|     </parent> | ||||
|  | ||||
|     <developers> | ||||
| @@ -31,11 +31,6 @@ | ||||
|             <artifactId>email</artifactId> | ||||
|             <scope>test</scope> | ||||
|         </dependency> | ||||
|         <dependency> | ||||
|             <groupId>jakarta.mail</groupId> | ||||
|             <artifactId>jakarta.mail-api</artifactId> | ||||
|             <scope>test</scope> | ||||
|         </dependency> | ||||
|     </dependencies> | ||||
|  | ||||
|     <build> | ||||
|   | ||||
| @@ -11,8 +11,8 @@ import org.alfresco.utility.testrail.annotation.TestRail; | ||||
| import org.testng.annotations.BeforeClass; | ||||
| import org.testng.annotations.Test; | ||||
|  | ||||
| import jakarta.mail.FolderNotFoundException; | ||||
| import jakarta.mail.MessagingException; | ||||
| import javax.mail.FolderNotFoundException; | ||||
| import javax.mail.MessagingException; | ||||
|  | ||||
| public class ImapCheckFolderTests extends EmailTest | ||||
| { | ||||
|   | ||||
| @@ -10,8 +10,8 @@ import org.alfresco.utility.testrail.annotation.TestRail; | ||||
| import org.testng.annotations.BeforeClass; | ||||
| import org.testng.annotations.Test; | ||||
|  | ||||
| import jakarta.mail.FolderNotFoundException; | ||||
| import jakarta.mail.MessagingException; | ||||
| import javax.mail.FolderNotFoundException; | ||||
| import javax.mail.MessagingException; | ||||
|  | ||||
| public class ImapCopyFolderTests extends EmailTest | ||||
| { | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| package org.alfresco.email.imap; | ||||
|  | ||||
| import jakarta.mail.MessagingException; | ||||
| import javax.mail.MessagingException; | ||||
|  | ||||
| import org.alfresco.dataprep.CMISUtil; | ||||
| import org.alfresco.email.EmailTest; | ||||
|   | ||||
| @@ -12,7 +12,7 @@ import org.alfresco.utility.testrail.annotation.TestRail; | ||||
| import org.testng.annotations.BeforeClass; | ||||
| import org.testng.annotations.Test; | ||||
|  | ||||
| import jakarta.mail.FolderNotFoundException; | ||||
| import javax.mail.FolderNotFoundException; | ||||
|  | ||||
| /** | ||||
|  * Tests for Create Folder action using IMAP client | ||||
|   | ||||
| @@ -10,7 +10,7 @@ import org.alfresco.utility.testrail.annotation.TestRail; | ||||
| import org.testng.annotations.BeforeClass; | ||||
| import org.testng.annotations.Test; | ||||
|  | ||||
| import jakarta.mail.FolderNotFoundException; | ||||
| import javax.mail.FolderNotFoundException; | ||||
|  | ||||
| public class ImapDeleteFolderTests extends EmailTest | ||||
| { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import org.alfresco.utility.testrail.annotation.TestRail; | ||||
| import org.testng.annotations.BeforeClass; | ||||
| import org.testng.annotations.Test; | ||||
|  | ||||
| import jakarta.mail.MessagingException; | ||||
| import javax.mail.MessagingException; | ||||
|  | ||||
| public class ImapDeleteMessagesTests extends EmailTest | ||||
| { | ||||
|   | ||||
| @@ -8,7 +8,7 @@ import org.alfresco.utility.testrail.ExecutionType; | ||||
| import org.alfresco.utility.testrail.annotation.TestRail; | ||||
| import org.testng.annotations.Test; | ||||
|  | ||||
| import jakarta.mail.Flags; | ||||
| import javax.mail.Flags; | ||||
|  | ||||
| public class ImapMessageFlagsTests extends EmailTest | ||||
| { | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| package org.alfresco.email.imap; | ||||
|  | ||||
| import jakarta.mail.FolderNotFoundException; | ||||
| import javax.mail.FolderNotFoundException; | ||||
|  | ||||
| import org.alfresco.dataprep.CMISUtil; | ||||
| import org.alfresco.email.EmailTest; | ||||
|   | ||||
| @@ -10,8 +10,8 @@ import org.alfresco.utility.testrail.annotation.TestRail; | ||||
| import org.testng.annotations.BeforeClass; | ||||
| import org.testng.annotations.Test; | ||||
|  | ||||
| import jakarta.mail.Flags; | ||||
| import jakarta.mail.MessagingException; | ||||
| import javax.mail.Flags; | ||||
| import javax.mail.MessagingException; | ||||
| import java.io.IOException; | ||||
|  | ||||
| public class ImapReadMessagesTests extends EmailTest | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| package org.alfresco.email.imap; | ||||
|  | ||||
| import jakarta.mail.FolderNotFoundException; | ||||
| import javax.mail.FolderNotFoundException; | ||||
|  | ||||
| import org.alfresco.email.EmailTest; | ||||
| import org.alfresco.utility.constants.UserRole; | ||||
|   | ||||
| @@ -8,8 +8,8 @@ import org.alfresco.utility.testrail.annotation.TestRail; | ||||
| import org.testng.annotations.BeforeClass; | ||||
| import org.testng.annotations.Test; | ||||
|  | ||||
| import jakarta.mail.FolderNotFoundException; | ||||
| import jakarta.mail.MessagingException; | ||||
| import javax.mail.FolderNotFoundException; | ||||
| import javax.mail.MessagingException; | ||||
|  | ||||
| public class ImapSitesTests extends EmailTest | ||||
| { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ | ||||
|     <parent> | ||||
|         <groupId>org.alfresco</groupId> | ||||
|         <artifactId>alfresco-community-repo-tests</artifactId> | ||||
|         <version>23.2.0.23</version> | ||||
|         <version>23.1.0.167-SNAPSHOT</version> | ||||
|     </parent> | ||||
|  | ||||
|     <developers> | ||||
|   | ||||
| @@ -2,7 +2,7 @@ package org.alfresco.tas.integration; | ||||
|  | ||||
| import static org.alfresco.utility.report.log.Step.STEP; | ||||
|  | ||||
| import jakarta.mail.FolderNotFoundException; | ||||
| import javax.mail.FolderNotFoundException; | ||||
|  | ||||
| import org.alfresco.rest.model.RestCommentModel; | ||||
| import org.alfresco.rest.model.RestDeploymentModel; | ||||
|   | ||||
| @@ -7,9 +7,9 @@ import static org.hamcrest.Matchers.equalTo; | ||||
| import io.restassured.RestAssured; | ||||
| import java.io.File; | ||||
|  | ||||
| import jakarta.json.JsonObject; | ||||
| import jakarta.mail.Flags; | ||||
| import jakarta.mail.MessagingException; | ||||
| import javax.json.JsonObject; | ||||
| import javax.mail.Flags; | ||||
| import javax.mail.MessagingException; | ||||
|  | ||||
| import org.alfresco.dataprep.CMISUtil; | ||||
| import org.alfresco.dataprep.SiteService.Visibility; | ||||
|   | ||||
| @@ -5,7 +5,7 @@ import static org.alfresco.utility.report.log.Step.STEP; | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
|  | ||||
| import jakarta.mail.MessagingException; | ||||
| import javax.mail.MessagingException; | ||||
|  | ||||
| import org.alfresco.rest.model.RestCommentModel; | ||||
| import org.alfresco.rest.model.RestErrorModel; | ||||
|   | ||||
| @@ -7,7 +7,7 @@ import io.restassured.http.ContentType; | ||||
| import java.util.HashMap; | ||||
| import java.util.Map; | ||||
|  | ||||
| import jakarta.json.JsonObject; | ||||
| import javax.json.JsonObject; | ||||
|  | ||||
| import org.alfresco.rest.core.JsonBodyGenerator; | ||||
| import org.alfresco.rest.core.RestRequest; | ||||
|   | ||||
| @@ -8,7 +8,7 @@ | ||||
|     <parent> | ||||
|         <groupId>org.alfresco</groupId> | ||||
|         <artifactId>alfresco-community-repo-tests</artifactId> | ||||
|         <version>23.2.0.23</version> | ||||
|         <version>23.1.0.167-SNAPSHOT</version> | ||||
|     </parent> | ||||
|  | ||||
|     <properties> | ||||
| @@ -17,7 +17,8 @@ | ||||
|         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||||
|         <rest.api.explorer.branch>master</rest.api.explorer.branch> | ||||
|         <httpclient-osgi-version>4.5.6</httpclient-osgi-version> | ||||
|         <commons-lang3.version>3.13.0</commons-lang3.version> | ||||
|         <org.glassfish.version>1.1.4</org.glassfish.version> | ||||
|         <commons-lang3.version>3.12.0</commons-lang3.version> | ||||
|         <scribejava-apis.version>8.3.3</scribejava-apis.version> | ||||
|         <java.version>17</java.version> | ||||
|     </properties> | ||||
| @@ -44,9 +45,13 @@ | ||||
|     </profiles> | ||||
|  | ||||
|     <dependencies> | ||||
|         <!-- fix the info log messages related to Could not instantiate TestExecutionListener  | ||||
|             [org.springframework.test.context.web.ServletTestExecutionListener --> | ||||
|         <dependency> | ||||
|             <groupId>jakarta.servlet</groupId> | ||||
|             <artifactId>jakarta.servlet-api</artifactId> | ||||
|             <groupId>javax.servlet</groupId> | ||||
|             <artifactId>servlet-api</artifactId> | ||||
|             <version>2.5</version> | ||||
|             <scope>provided</scope> | ||||
|         </dependency> | ||||
|  | ||||
|         <!-- alfresco tester settings --> | ||||
| @@ -137,6 +142,13 @@ | ||||
|             <artifactId>jackson-databind</artifactId> | ||||
|         </dependency> | ||||
|  | ||||
|         <!-- https://mvnrepository.com/artifact/org.glassfish/javax.json --> | ||||
|         <dependency> | ||||
|             <groupId>org.glassfish</groupId> | ||||
|             <artifactId>javax.json</artifactId> | ||||
|             <version>${org.glassfish.version}</version> | ||||
|         </dependency> | ||||
|  | ||||
|         <!-- swagger parser --> | ||||
|         <dependency> | ||||
|             <groupId>io.swagger</groupId> | ||||
| @@ -159,14 +171,14 @@ | ||||
|         <dependency> | ||||
|             <groupId>org.codehaus.groovy</groupId> | ||||
|             <artifactId>groovy</artifactId> | ||||
|             <version>3.0.19</version> | ||||
|             <version>3.0.18</version> | ||||
|         </dependency> | ||||
|  | ||||
|         <!-- https://mvnrepository.com/artifact/org.codehaus.groovy/groovy-json--> | ||||
|         <dependency> | ||||
|             <groupId>org.codehaus.groovy</groupId> | ||||
|             <artifactId>groovy-json</artifactId> | ||||
|             <version>3.0.19</version> | ||||
|             <version>3.0.18</version> | ||||
|         </dependency> | ||||
|  | ||||
|        <dependency> | ||||
| @@ -176,8 +188,9 @@ | ||||
|        </dependency> | ||||
|  | ||||
|         <dependency> | ||||
|             <groupId>org.eclipse.parsson</groupId> | ||||
|             <artifactId>parsson</artifactId> | ||||
|             <groupId>org.glassfish</groupId> | ||||
|             <artifactId>jakarta.json</artifactId> | ||||
|             <scope>test</scope> | ||||
|         </dependency> | ||||
|     </dependencies> | ||||
|  | ||||
|   | ||||
| @@ -25,11 +25,11 @@ | ||||
|  */ | ||||
| package org.alfresco.rest.core; | ||||
|  | ||||
| import jakarta.json.Json; | ||||
| import jakarta.json.JsonArrayBuilder; | ||||
| import jakarta.json.JsonBuilderFactory; | ||||
| import jakarta.json.JsonObject; | ||||
| import jakarta.json.JsonObjectBuilder; | ||||
| import javax.json.Json; | ||||
| import javax.json.JsonArrayBuilder; | ||||
| import javax.json.JsonBuilderFactory; | ||||
| import javax.json.JsonObject; | ||||
| import javax.json.JsonObjectBuilder; | ||||
| import java.io.Serializable; | ||||
| import java.util.HashMap; | ||||
| import java.util.List; | ||||
|   | ||||
| @@ -2,7 +2,7 @@ | ||||
|  * #%L | ||||
|  * alfresco-tas-restapi | ||||
|  * %% | ||||
|  * Copyright (C) 2005 - 2023 Alfresco Software Limited | ||||
|  * Copyright (C) 2005 - 2022 Alfresco Software Limited | ||||
|  * %% | ||||
|  * This file is part of the Alfresco software.  | ||||
|  * If the software was purchased under a paid Alfresco license, the terms of  | ||||
| @@ -86,7 +86,6 @@ import org.json.JSONObject; | ||||
| import org.slf4j.Logger; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.context.annotation.Scope; | ||||
| import org.springframework.http.HttpMethod; | ||||
| import org.springframework.http.HttpStatus; | ||||
| import org.springframework.stereotype.Service; | ||||
| import org.testng.Assert; | ||||
| @@ -631,42 +630,36 @@ public class RestWrapper extends DSLWrapper<RestWrapper> | ||||
|  | ||||
|         STEP(restRequest.toString()); | ||||
|  | ||||
|         final Response returnedResponse; | ||||
|         HttpMethod httpMethod = restRequest.getHttpMethod(); | ||||
|         if (HttpMethod.GET.equals(httpMethod)) | ||||
|         Response returnedResponse; | ||||
|         switch (restRequest.getHttpMethod()) | ||||
|         { | ||||
|             returnedResponse = onRequest().get(restRequest.getPath(), restRequest.getPathParams()).andReturn(); | ||||
|         } | ||||
|         else if (HttpMethod.DELETE.equals(httpMethod)) | ||||
|         { | ||||
|             returnedResponse = onRequest().delete(restRequest.getPath(), restRequest.getPathParams()).andReturn(); | ||||
|         } | ||||
|         else if (HttpMethod.HEAD.equals(httpMethod)) | ||||
|         { | ||||
|             returnedResponse = onRequest().head(restRequest.getPath(), restRequest.getPathParams()).andReturn(); | ||||
|         } | ||||
|         else if (HttpMethod.OPTIONS.equals(httpMethod)) | ||||
|         { | ||||
|             returnedResponse = onRequest().options(restRequest.getPath(), restRequest.getPathParams()).andReturn(); | ||||
|         } | ||||
|         else if (HttpMethod.POST.equals(httpMethod)) | ||||
|         { | ||||
|             returnedResponse = onRequest().body(restRequest.getBody()) | ||||
|                                           .post(restRequest.getPath(), restRequest.getPathParams()).andReturn(); | ||||
|         } | ||||
|         else if (HttpMethod.PUT.equals(httpMethod)) | ||||
|         { | ||||
|             returnedResponse = onRequest().body(restRequest.getBody()) | ||||
|                                           .contentType(ContentType.JSON.withCharset(restRequest.getContentType())) | ||||
|                                           .put(restRequest.getPath(), restRequest.getPathParams()).andReturn(); | ||||
|         } | ||||
|         else if (HttpMethod.TRACE.equals(httpMethod)) | ||||
|         { | ||||
|             returnedResponse = onRequest().get(restRequest.getPath(), restRequest.getPathParams()).andReturn(); | ||||
|         } | ||||
|         else | ||||
|         { | ||||
|             returnedResponse = onRequest().get(restRequest.getPath(), restRequest.getPathParams()).andReturn(); | ||||
|             case GET: | ||||
|                 returnedResponse = onRequest().get(restRequest.getPath(), restRequest.getPathParams()).andReturn(); | ||||
|                 break; | ||||
|             case DELETE: | ||||
|                 returnedResponse = onRequest().delete(restRequest.getPath(), restRequest.getPathParams()).andReturn(); | ||||
|                 break; | ||||
|             case HEAD: | ||||
|                 returnedResponse = onRequest().head(restRequest.getPath(), restRequest.getPathParams()).andReturn(); | ||||
|                 break; | ||||
|             case OPTIONS: | ||||
|                 returnedResponse = onRequest().options(restRequest.getPath(), restRequest.getPathParams()).andReturn(); | ||||
|                 break; | ||||
|             case POST: | ||||
|                 returnedResponse = onRequest().body(restRequest.getBody()) | ||||
|                         .post(restRequest.getPath(), restRequest.getPathParams()).andReturn(); | ||||
|                 break; | ||||
|             case PUT: | ||||
|                 returnedResponse = onRequest().body(restRequest.getBody()) | ||||
|                         .contentType(ContentType.JSON.withCharset(restRequest.getContentType())) | ||||
|                         .put(restRequest.getPath(), restRequest.getPathParams()).andReturn(); | ||||
|                 break; | ||||
|             case TRACE: | ||||
|                 returnedResponse = onRequest().get(restRequest.getPath(), restRequest.getPathParams()).andReturn(); | ||||
|                 break; | ||||
|             default: | ||||
|                 returnedResponse = onRequest().get(restRequest.getPath(), restRequest.getPathParams()).andReturn(); | ||||
|                 break; | ||||
|         } | ||||
|  | ||||
|         logResponseInformation(restRequest, returnedResponse); | ||||
|   | ||||
| @@ -31,10 +31,15 @@ import org.alfresco.rest.core.RestWrapper; | ||||
| import org.alfresco.rest.model.RestCustomAspectModel; | ||||
| import org.alfresco.rest.model.RestCustomModel; | ||||
| import org.alfresco.rest.model.RestCustomTypeModel; | ||||
| import org.alfresco.rest.model.RestGroupsModelsCollection; | ||||
| import org.alfresco.utility.model.CustomAspectModel; | ||||
| import org.alfresco.utility.model.CustomAspectPropertiesModel; | ||||
| import org.alfresco.utility.model.CustomContentModel; | ||||
| import org.springframework.http.HttpMethod; | ||||
|  | ||||
| import javax.json.Json; | ||||
| import javax.json.JsonArrayBuilder; | ||||
| import javax.json.JsonObject; | ||||
|  | ||||
| /** | ||||
|  * @author Bogdan Bocancea | ||||
|   | ||||
| @@ -33,8 +33,8 @@ import org.alfresco.utility.model.CustomContentModel; | ||||
| import org.apache.commons.lang3.StringUtils; | ||||
| import org.springframework.http.HttpMethod; | ||||
|  | ||||
| import jakarta.json.JsonArrayBuilder; | ||||
| import jakarta.json.JsonObjectBuilder; | ||||
| import javax.json.JsonArrayBuilder; | ||||
| import javax.json.JsonObjectBuilder; | ||||
| import java.util.ArrayList; | ||||
| import java.util.Arrays; | ||||
| import java.util.List; | ||||
|   | ||||
| @@ -30,12 +30,11 @@ import static org.alfresco.rest.core.JsonBodyGenerator.arrayToJson; | ||||
| import static org.alfresco.rest.requests.RuleSettings.IS_INHERITANCE_ENABLED; | ||||
| import static org.springframework.http.HttpMethod.PUT; | ||||
|  | ||||
| import jakarta.json.JsonArrayBuilder; | ||||
| import javax.json.JsonArrayBuilder; | ||||
| import java.io.File; | ||||
| import java.io.FileInputStream; | ||||
| import java.io.IOException; | ||||
| import java.util.List; | ||||
| import java.util.stream.Stream; | ||||
|  | ||||
| import io.restassured.http.ContentType; | ||||
| import org.alfresco.rest.core.JsonBodyGenerator; | ||||
| @@ -52,11 +51,9 @@ import org.alfresco.rest.model.RestCommentModelsCollection; | ||||
| import org.alfresco.rest.model.RestNodeAssocTargetModel; | ||||
| import org.alfresco.rest.model.RestNodeAssociationModel; | ||||
| import org.alfresco.rest.model.RestNodeAssociationModelCollection; | ||||
| import org.alfresco.rest.model.RestNodeAssociationTypeModel; | ||||
| import org.alfresco.rest.model.RestNodeBodyModel; | ||||
| import org.alfresco.rest.model.RestNodeBodyMoveCopyModel; | ||||
| import org.alfresco.rest.model.RestNodeChildAssocModelCollection; | ||||
| import org.alfresco.rest.model.RestNodeChildAssociationModel; | ||||
| import org.alfresco.rest.model.RestNodeModel; | ||||
| import org.alfresco.rest.model.RestNodeModelsCollection; | ||||
| import org.alfresco.rest.model.RestRatingModel; | ||||
| @@ -75,7 +72,6 @@ import org.alfresco.rest.model.body.RestNodeLockBodyModel; | ||||
| import org.alfresco.rest.model.builder.NodesBuilder; | ||||
| import org.alfresco.utility.Utility; | ||||
| import org.alfresco.utility.model.RepoTestModel; | ||||
| import org.apache.commons.lang3.StringUtils; | ||||
| import org.springframework.http.HttpMethod; | ||||
| import org.springframework.http.HttpStatus; | ||||
| import org.testng.reporters.Files; | ||||
| @@ -828,118 +824,25 @@ public class Node extends ModelRequest<Node> | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Creates a secondary child association using POST call to: 'nodes/{nodeId}/secondary-children'. | ||||
|      * Create secondary children association using POST call 'nodes/{nodeId}/secondary-children | ||||
|      * Use a list of secondary children nodes | ||||
|      * | ||||
|      * @param secondaryChild - node, which should become a secondary child | ||||
|      * @return a node's parent-child association | ||||
|      * @return a collection of nodes | ||||
|      */ | ||||
|     public RestNodeChildAssociationModel addSecondaryChild(RepoTestModel secondaryChild) | ||||
|     public RestNodeChildAssocModelCollection createSecondaryChildren(String secondaryChildren) | ||||
|     { | ||||
|         return addSecondaryChild("cm:contains", secondaryChild); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Creates a secondary child association using POST call to: 'nodes/{nodeId}/secondary-children'. | ||||
|      * | ||||
|      * @param associationType - type of secondary parent-child relationship association | ||||
|      * @param secondaryChild - node, which should become a secondary child | ||||
|      * @return a node's parent-child association | ||||
|      */ | ||||
|     public RestNodeChildAssociationModel addSecondaryChild(String associationType, RepoTestModel secondaryChild) | ||||
|     { | ||||
|         return addSecondaryChild(new RestNodeChildAssociationModel(secondaryChild.getNodeRef(), associationType)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Creates a secondary child association using POST call to: 'nodes/{nodeId}/secondary-children'. | ||||
|      * | ||||
|      * @param secondaryChildAssociation - node's secondary parent-child association model | ||||
|      * @return a node's parent-child association | ||||
|      */ | ||||
|     public RestNodeChildAssociationModel addSecondaryChild(RestNodeChildAssociationModel secondaryChildAssociation) | ||||
|     { | ||||
|         RestRequest request = RestRequest.requestWithBody(HttpMethod.POST, secondaryChildAssociation.toJson(), "nodes/{nodeId}/secondary-children?{parameters}", repoModel.getNodeRef(), restWrapper.getParameters()); | ||||
|         return restWrapper.processModel(RestNodeChildAssociationModel.class, request); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Creates a secondary children association using POST call to: 'nodes/{nodeId}/secondary-children'. | ||||
|      * | ||||
|      * @param secondaryChildren - nodes, which should become secondary children | ||||
|      * @return a collection of node's parent-child associations | ||||
|      */ | ||||
|     public RestNodeChildAssocModelCollection addSecondaryChildren(RepoTestModel... secondaryChildren) | ||||
|     { | ||||
|         return addSecondaryChildren("cm:contains", secondaryChildren); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Creates a secondary children association using POST call to: 'nodes/{nodeId}/secondary-children'. | ||||
|      * | ||||
|      * @param associationType - type of secondary parent-child relationship association | ||||
|      * @param secondaryChildren - nodes, which should become secondary children | ||||
|      * @return a collection of node's parent-child associations | ||||
|      */ | ||||
|     public RestNodeChildAssocModelCollection addSecondaryChildren(String associationType, RepoTestModel... secondaryChildren) | ||||
|     { | ||||
|         return addSecondaryChildren(Stream.of(secondaryChildren) | ||||
|             .map(child -> new RestNodeChildAssociationModel(child.getNodeRef(), associationType)) | ||||
|             .toArray(RestNodeChildAssociationModel[]::new)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Creates a secondary children association using POST call to: 'nodes/{nodeId}/secondary-children'. | ||||
|      * | ||||
|      * @param secondaryChildrenAssociations - node's secondary parent-child association models | ||||
|      * @return a collection of node's parent-child associations | ||||
|      */ | ||||
|     public RestNodeChildAssocModelCollection addSecondaryChildren(RestNodeChildAssociationModel... secondaryChildrenAssociations) | ||||
|     { | ||||
|         String requestBody = arrayToJson(Stream.of(secondaryChildrenAssociations).toList()); | ||||
|         RestRequest request = RestRequest.requestWithBody(HttpMethod.POST, requestBody, "nodes/{nodeId}/secondary-children?{parameters}", repoModel.getNodeRef(), restWrapper.getParameters()); | ||||
|         RestRequest request = RestRequest.requestWithBody(HttpMethod.POST, secondaryChildren, "nodes/{nodeId}/secondary-children?{parameters}", repoModel.getNodeRef(), restWrapper.getParameters()); | ||||
|         return restWrapper.processModels(RestNodeChildAssocModelCollection.class, request); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Removes secondary child association using DELETE call 'nodes/{nodeId}/secondary-children/{childId}'. | ||||
|      * Delete secondary children using DELETE call 'nodes/{nodeId}/secondary-children/{childId} | ||||
|      * | ||||
|      * @param secondaryChild - node, which should NOT be a secondary child anymore | ||||
|      * @return a collection of nodes | ||||
|      */ | ||||
|     public void removeSecondaryChild(RepoTestModel secondaryChild) | ||||
|     public void deleteSecondaryChild(RestNodeAssociationModel child) | ||||
|     { | ||||
|         removeSecondaryChild(null, secondaryChild); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Removes secondary child association using DELETE call 'nodes/{nodeId}/secondary-children/{childId}'. | ||||
|      * | ||||
|      * @param associationType - type of secondary parent-child relationship association | ||||
|      * @param secondaryChild - node, which should NOT be a secondary child anymore | ||||
|      */ | ||||
|     public void removeSecondaryChild(String associationType, RepoTestModel secondaryChild) | ||||
|     { | ||||
|         RestNodeAssociationModel associationModel = new RestNodeAssociationModel(); | ||||
|         RestNodeAssociationTypeModel associationTypeModel = new RestNodeAssociationTypeModel(); | ||||
|         if (associationType != null) | ||||
|         { | ||||
|             associationTypeModel.setAssocType(associationType); | ||||
|         } | ||||
|         associationModel.setAssociation(associationTypeModel); | ||||
|         associationModel.setId(secondaryChild.getNodeRef()); | ||||
|         removeSecondaryChild(associationModel); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Removes secondary child association using DELETE call 'nodes/{nodeId}/secondary-children/{childId}'. | ||||
|      * | ||||
|      * @param secondaryChildAssociation - node's secondary parent-child association to remove | ||||
|      */ | ||||
|     public void removeSecondaryChild(RestNodeAssociationModel secondaryChildAssociation) | ||||
|     { | ||||
|         String parameters = StringUtils.isNotEmpty(secondaryChildAssociation.getAssociation().getAssocType()) ? | ||||
|             "assocType=" + secondaryChildAssociation.getAssociation().getAssocType() + "&" + restWrapper.getParameters() : | ||||
|             restWrapper.getParameters(); | ||||
|         RestRequest request = RestRequest.simpleRequest(HttpMethod.DELETE, "nodes/{nodeId}/secondary-children/{childId}?{parameters}", repoModel.getNodeRef(), secondaryChildAssociation.getId(), parameters); | ||||
|         RestRequest request = RestRequest.simpleRequest(HttpMethod.DELETE, "nodes/{nodeId}/secondary-children/{childId}?{parameters}", repoModel.getNodeRef(), child.getId(), restWrapper.getParameters()); | ||||
|         restWrapper.processEmptyModel(request); | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -25,7 +25,7 @@ | ||||
|  */ | ||||
| package org.alfresco.rest.requests; | ||||
|  | ||||
| import jakarta.json.JsonArrayBuilder; | ||||
| import javax.json.JsonArrayBuilder; | ||||
|  | ||||
| import org.alfresco.dataprep.CMISUtil.Priority; | ||||
| import org.alfresco.rest.core.JsonBodyGenerator; | ||||
|   | ||||
| @@ -27,7 +27,7 @@ package org.alfresco.rest.requests; | ||||
|  | ||||
| import java.util.HashMap; | ||||
|  | ||||
| import jakarta.json.JsonArrayBuilder; | ||||
| import javax.json.JsonArrayBuilder; | ||||
|  | ||||
| import org.alfresco.rest.core.JsonBodyGenerator; | ||||
| import org.alfresco.rest.core.RestRequest; | ||||
|   | ||||
| @@ -25,8 +25,8 @@ | ||||
|  */ | ||||
| package org.alfresco.rest.requests; | ||||
|  | ||||
| import jakarta.json.JsonArrayBuilder; | ||||
| import jakarta.json.JsonObject; | ||||
| import javax.json.JsonArrayBuilder; | ||||
| import javax.json.JsonObject; | ||||
|  | ||||
| import org.alfresco.rest.core.JsonBodyGenerator; | ||||
| import org.alfresco.rest.core.RestRequest; | ||||
|   | ||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user