mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-09-10 14:11:58 +00:00
Compare commits
581 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
50d9b6b8a1 | ||
|
6027854b4d | ||
|
ebed22937d | ||
|
49a9d6c89f | ||
|
e4d2a7522f | ||
|
9e910c7427 | ||
|
87eca02048 | ||
|
09392a9837 | ||
|
074baf84ab | ||
|
7b3e3a1a97 | ||
|
ba1eb7d7fd | ||
|
ab7670b7b3 | ||
|
253929f415 | ||
|
6261c372c6 | ||
|
eba5043ffe | ||
|
0c02b7e9f2 | ||
|
85710587f6 | ||
|
e14003a436 | ||
|
23ba8f2d41 | ||
|
905e861396 | ||
|
4ec2a93535 | ||
|
9d1b966ad5 | ||
|
a9210f6086 | ||
|
fafc3e7e1d | ||
|
376f146e7c | ||
|
5559ad446e | ||
|
ac5396031d | ||
|
0ed32cf65d | ||
|
578d779183 | ||
|
a5821023e2 | ||
|
809e943d15 | ||
|
70a7334e0d | ||
|
98df0752d8 | ||
|
a076f28a4c | ||
|
a2021092df | ||
|
93260c0bc8 | ||
|
c205c94caa | ||
|
5135482fd2 | ||
|
ed9aa57849 | ||
|
7b578827d1 | ||
|
11a5731ca7 | ||
|
ce48f64a14 | ||
|
4a9a7ba4de | ||
|
0dc7d62d3f | ||
|
7f54671ca2 | ||
|
84e2ff5f1f | ||
|
75fbb557fe | ||
|
d40fb4f988 | ||
|
f50a76d20d | ||
|
c170ed725a | ||
|
62ccbe9da2 | ||
|
310689994d | ||
|
62a506da47 | ||
|
399a29eef2 | ||
|
4167f6810e | ||
|
01fe638d60 | ||
|
3ad2db96ab | ||
|
1c9366dcaf | ||
|
9c1daf0795 | ||
|
fb7a6a8a1f | ||
|
4307444e2d | ||
|
89ae5bc193 | ||
|
fe537e97d5 | ||
|
c7b29613d4 | ||
|
4d1f6ae91e | ||
|
1f2d85e252 | ||
|
efa330adf5 | ||
|
abde3fa4cb | ||
|
1d6a775f22 | ||
|
6596825462 | ||
|
30a9c0c065 | ||
|
1399b363cc | ||
|
6416432f42 | ||
|
1c7c87caee | ||
|
42de0e1607 | ||
|
9da76f53e0 | ||
|
c70fdd47a7 | ||
|
d96e726db4 | ||
|
fc66677977 | ||
|
2a9f61076c | ||
|
12c66a09d1 | ||
|
5882e3d002 | ||
|
c15bace290 | ||
|
40eb3f1649 | ||
|
edd5c3ac7b | ||
|
71eb5f3011 | ||
|
1bf2cf015c | ||
|
cd97fb3c3a | ||
|
fc729dd26f | ||
|
8c21deee57 | ||
|
0cf79474a1 | ||
|
5a840b7ecf | ||
|
f3f3ed7e61 | ||
|
15ca57bcd2 | ||
|
b24b144c3e | ||
|
f56726a75a | ||
|
3f78c9a729 | ||
|
2ffcfaee4e | ||
|
73784ab389 | ||
|
ff612b2233 | ||
|
60093108db | ||
|
3e2b0a0f22 | ||
|
fe9f6b73cd | ||
|
3d1e326d38 | ||
|
2b6185021e | ||
|
8b2b52bd47 | ||
|
41eeacac47 | ||
|
81e9ae40ca | ||
|
d9283af46b | ||
|
d8d00b1430 | ||
|
ec22b6b39a | ||
|
69fc15dd0c | ||
|
19a31ec32b | ||
|
4a83e7f83f | ||
|
023583e67a | ||
|
daf7ec44e4 | ||
|
ec131b33a5 | ||
|
d1ce85398c | ||
|
c79e3f8550 | ||
|
7a8996463a | ||
|
8242b34604 | ||
|
f34dd7ad16 | ||
|
4f517f9c41 | ||
|
187038d4ca | ||
|
f189f71fb8 | ||
|
82425433c4 | ||
|
0703d10899 | ||
|
5ffacd315e | ||
|
70ad374f8a | ||
|
88bec51910 | ||
|
fdce5a76ca | ||
|
93a4b9c0dd | ||
|
d123af8664 | ||
|
2ef82ccc56 | ||
|
7a6beb433a | ||
|
257fa68432 | ||
|
7c07b6c974 | ||
|
87ca3ac91a | ||
|
6f4ebcca3e | ||
|
eb1b7c320f | ||
|
cf476f4629 | ||
|
109e87f7af | ||
|
bc96fcb4e2 | ||
|
098ef5f8e9 | ||
|
12d1f2f7fd | ||
|
bc6dd55629 | ||
|
d3d4f3bf35 | ||
|
e627010d1b | ||
|
4b82c70015 | ||
|
5f1d7432ae | ||
|
251fb079a7 | ||
|
da57e725c0 | ||
|
70423195e9 | ||
|
90574ee73b | ||
|
2e412f2e59 | ||
|
5b3e93c077 | ||
|
2c9c91d7be | ||
|
b7479205d5 | ||
|
5238f1297c | ||
|
0632e1268e | ||
|
8e36d4f4c1 | ||
|
99b92f67ee | ||
|
8f97585cb7 | ||
|
323f26850d | ||
|
e667470f66 | ||
|
90210bd532 | ||
|
afbc56e6e2 | ||
|
0a39b667c8 | ||
|
2c1d7ac627 | ||
|
c081c3a420 | ||
|
670b4e6245 | ||
|
700491d80a | ||
|
d161574edc | ||
|
3e1d862c2d | ||
|
c19f2d71f8 | ||
|
c1d2b84582 | ||
|
c7d7bf9347 | ||
|
8b03573135 | ||
|
5759d76953 | ||
|
70bad61905 | ||
|
fe4e738521 | ||
|
080787a3f2 | ||
|
2ed64c64db | ||
|
ff769bc6c7 | ||
|
2d6397c367 | ||
|
d56e81154c | ||
|
8329ef8cc8 | ||
|
1cc88ff688 | ||
|
a1a00c8bb1 | ||
|
933d0505d7 | ||
|
86d8739af2 | ||
|
38c07132e5 | ||
|
b3a3b76112 | ||
|
a90529b8fc | ||
|
332fed005f | ||
|
e0050d99f1 | ||
|
46ac5eaaa1 | ||
|
489bf035de | ||
|
574fa342f1 | ||
|
2ab8cf8b1e | ||
|
9ea4a0a643 | ||
|
b90d617c15 | ||
|
2d5c67fa27 | ||
|
bffdcf2d99 | ||
|
ef5eb81c8a | ||
|
d8c415e74a | ||
|
fea086de8d | ||
|
e403345bea | ||
|
c60c165b7c | ||
|
5230c2ab2b | ||
|
7ae3204c2a | ||
|
4a3f1631c5 | ||
|
debd0dad26 | ||
|
501b9691a4 | ||
|
bfffa040c3 | ||
|
94aab58b77 | ||
|
b4e3bca479 | ||
|
1f8dc69ce7 | ||
|
1015001c4f | ||
|
66d7a4ff6f | ||
|
6708a538a8 | ||
|
aeb86f7c3b | ||
|
e744098ed9 | ||
|
5cf1bf8b65 | ||
|
fa8fd5b348 | ||
|
34caf837dd | ||
|
a290c20f88 | ||
|
59cb203762 | ||
|
f530f4f27a | ||
|
bc53b1c89e | ||
|
57ae90489c | ||
|
273f68ef0a | ||
|
2ff344aa6e | ||
|
88314a10fd | ||
|
08f1fee170 | ||
|
8aca8b45ca | ||
|
3608c9f2bf | ||
|
7f9c671524 | ||
|
3a5d8c96f6 | ||
|
cab66e441d | ||
|
a2ec0f7a1f | ||
|
82d99d68cd | ||
|
778e5146fb | ||
|
92bfc91852 | ||
|
d5470a3e15 | ||
|
f1f9d6d4a7 | ||
|
171f772071 | ||
|
41b3843935 | ||
|
df5dce7fdb | ||
|
2667243e27 | ||
|
0156f669ee | ||
|
7a2c97950b | ||
|
2a9682cf50 | ||
|
df1c08d230 | ||
|
f2cf9fde80 | ||
|
e158c0af23 | ||
|
e15e5f32c6 | ||
|
9ca368a1e5 | ||
|
bd5683f2e8 | ||
|
878323a92d | ||
|
39558f9030 | ||
|
cefc9b216a | ||
|
54c801efef | ||
|
26b4a41f9f | ||
|
45aa6a10b1 | ||
|
38e71f5e30 | ||
|
b482ffa8f9 | ||
|
1b15b546b1 | ||
|
2ff2cda897 | ||
|
66a4999041 | ||
|
426e4b498d | ||
|
d573a6905d | ||
|
eeac8f88b5 | ||
|
e2d10eaa50 | ||
|
979ece477e | ||
|
867eac0c54 | ||
|
a37d69f6bf | ||
|
a609b7705e | ||
|
6ce6afa1c3 | ||
|
ddaa08685b | ||
|
6db970feba | ||
|
1e538ea3f2 | ||
|
915f67750b | ||
|
39d5a07b5d | ||
|
e879e3813f | ||
|
75b87de6bc | ||
|
5cd6cbb956 | ||
|
7b57864f85 | ||
|
dd8095e948 | ||
|
ad5e2a607f | ||
|
5b84c2ad11 | ||
|
b82594ad59 | ||
|
6742812548 | ||
|
9aac7efea6 | ||
|
4c594b6246 | ||
|
15591b9952 | ||
|
50da066416 | ||
|
3f52f57632 | ||
|
6ee88d6906 | ||
|
4aa494da71 | ||
|
0fc5c6b7bc | ||
|
fcda1691d6 | ||
|
5a57770fb9 | ||
|
d73ce2628c | ||
|
5ae148ac84 | ||
|
7e4cbd7e23 | ||
|
a5f8afe6d0 | ||
|
9b05b9a5eb | ||
|
b1036202a6 | ||
|
778ff9d7b8 | ||
|
58afaefab1 | ||
|
ce31b06477 | ||
|
f85f5f9d71 | ||
|
d32faa2429 | ||
|
5bae8eb049 | ||
|
cd563798b3 | ||
|
288e5b8777 | ||
|
13b387e185 | ||
|
e9a75eb55b | ||
|
93ecefa864 | ||
|
7ee22d35c8 | ||
|
eafc654736 | ||
|
9252450e4b | ||
|
d8b12e24ec | ||
|
86ba3d5fd7 | ||
|
4b54c69195 | ||
|
66577e083f | ||
|
a058aea33a | ||
|
8e23108fbc | ||
|
665fd1e6f6 | ||
|
edeba4ae52 | ||
|
476731080e | ||
|
dcfc0129f7 | ||
|
59f07ce344 | ||
|
9dcc5e46aa | ||
|
50d382e272 | ||
|
ea5175141d | ||
|
46984a705b | ||
|
400317d08b | ||
|
f08099164d | ||
|
c14d372d21 | ||
|
8d441c9688 | ||
|
312807d92b | ||
|
557f093dd4 | ||
|
f2b4d88885 | ||
|
87aee131c6 | ||
|
26970522d4 | ||
|
361038a4d6 | ||
|
1a0ce5770b | ||
|
833909d281 | ||
|
0a395d4708 | ||
|
1779a7c030 | ||
|
ee5a1a1fa8 | ||
|
1dcbbfd512 | ||
|
8e36a0a462 | ||
|
ffcd2de1ae | ||
|
c1b14fb592 | ||
|
9f8fb4e680 | ||
|
f0023df7fb | ||
|
73b9b623b7 | ||
|
170bcf3a0f | ||
|
0c0e2652b5 | ||
|
aab1595552 | ||
|
08411e4d15 | ||
|
84e751f2e8 | ||
|
0cadd6a48a | ||
|
260bf52ad5 | ||
|
3a9308cd41 | ||
|
f709e4c273 | ||
|
85d80b7689 | ||
|
ea74f137d0 | ||
|
2b2209d13d | ||
|
80025fb56a | ||
|
3ea4922f04 | ||
|
114545ce31 | ||
|
b6435f9e20 | ||
|
0fc5f0480c | ||
|
ce075a3194 | ||
|
74d5a97be7 | ||
|
9cb05adadc | ||
|
e53530faff | ||
|
a144daa3ad | ||
|
5d6d6d42c6 | ||
|
74ddbf9e7c | ||
|
f235ae694d | ||
|
d727d30b41 | ||
|
62b7650925 | ||
|
9db78d663c | ||
|
2d2213c860 | ||
|
a370505f65 | ||
|
a110411eb1 | ||
|
9c39f1abd8 | ||
|
5fe4ebc045 | ||
|
15785a5188 | ||
|
588b62c78a | ||
|
fe740c8de6 | ||
|
d5364b3a04 | ||
|
14e353434c | ||
|
4ac5672940 | ||
|
28086c1d4f | ||
|
c1acc88b12 | ||
|
ef95672052 | ||
|
253cc19a3a | ||
|
f02cb05caa | ||
|
397933a0db | ||
|
edfe204d5a | ||
|
40f3b539c4 | ||
|
b339991d52 | ||
|
9eff1509b3 | ||
|
86980643f0 | ||
|
06adb15a4f | ||
|
adb3209192 | ||
|
eee488bcfb | ||
|
e9fc89ac19 | ||
|
d1d8e8bbcd | ||
|
6d7e95e143 | ||
|
396ddca1ae | ||
|
fbd11a20e7 | ||
|
b6a99dbba8 | ||
|
9ba912b613 | ||
|
aa8bb477bd | ||
|
e8893e7bfb | ||
|
f23aa55db9 | ||
|
e02c3bf1bc | ||
|
0209c549ed | ||
|
49c03d7476 | ||
|
807c484d87 | ||
|
651e7187c1 | ||
|
8337ddc903 | ||
|
cbc502feea | ||
|
b22453afe8 | ||
|
4839fe180e | ||
|
94bc72b46e | ||
|
d0753c9c42 | ||
|
ece88565bb | ||
|
aff271b0a8 | ||
|
a054f6440b | ||
|
6f148c056c | ||
|
8efbe18818 | ||
|
98fcba54d8 | ||
|
1c06199762 | ||
|
7e9cfc62bf | ||
|
c866593237 | ||
|
97423baa34 | ||
|
4cd0317088 | ||
|
01ee91a022 | ||
|
faa2f57a11 | ||
|
ffc5371e6e | ||
|
9eee86a112 | ||
|
9889c2467e | ||
|
1aaa81e193 | ||
|
c79549b91b | ||
|
a5ee34eeb6 | ||
|
3a87570a7b | ||
|
04f34274a0 | ||
|
8c246c0140 | ||
|
9c757c9cfd | ||
|
215227c657 | ||
|
fe0cee1030 | ||
|
ab606ba30e | ||
|
f571956de7 | ||
|
adcc4fa1ee | ||
|
3292aace29 | ||
|
c88a1c6360 | ||
|
599dd69b8a | ||
|
0055934b34 | ||
|
291a5ea1e0 | ||
|
b130e55bbd | ||
|
c7b623721e | ||
|
045fafbd14 | ||
|
ac68ff3e79 | ||
|
1cab30cfd1 | ||
|
e148321e60 | ||
|
f1a7171627 | ||
|
dfe67a0a49 | ||
|
5af08756cb | ||
|
c98612fe78 | ||
|
397b13e182 | ||
|
54ebad0fce | ||
|
98633bc15e | ||
|
2c93e0df28 | ||
|
8864c5a124 | ||
|
e6f09b17c7 | ||
|
f359af4e74 | ||
|
c6e01cb75d | ||
|
dfb668e24a | ||
|
7f03e4f12f | ||
|
cfe60fc0ca | ||
|
110040db2d | ||
|
2c461b0d40 | ||
|
b3264c594f | ||
|
8bc465a192 | ||
|
82eb5c0cd5 | ||
|
9ad349fee7 | ||
|
67ef6ecc2a | ||
|
5c47e3153a | ||
|
a55546379b | ||
|
2ab9b5086a | ||
|
0e6843d107 | ||
|
8a7891a974 | ||
|
f6382d9130 | ||
|
a610bde4e0 | ||
|
85832c81ce | ||
|
f5c9a556f2 | ||
|
6fcdedffc1 | ||
|
0f5f912a76 | ||
|
f1df0b4b55 | ||
|
eca3747650 | ||
|
6e810e93ad | ||
|
23fe161354 | ||
|
1e098e19d2 | ||
|
9f11fa6d24 | ||
|
2473e3504e | ||
|
b70aef199d | ||
|
633072b847 | ||
|
2e2a766edf | ||
|
ce2cb22342 | ||
|
cf57cd15b5 | ||
|
8bf64b502a | ||
|
aef618761e | ||
|
b245a24621 | ||
|
220d41e5e1 | ||
|
b411fe4a9b | ||
|
9ed738a8d0 | ||
|
535fd9d1d5 | ||
|
3040b76398 | ||
|
8d8e278dd7 | ||
|
0bede55ff0 | ||
|
026cdc9950 | ||
|
07e6fdc414 | ||
|
0b2488dc92 | ||
|
3502854fcc | ||
|
ddbfac8bfb | ||
|
141f53190c | ||
|
dc3a7a1f83 | ||
|
00a68eb4a1 | ||
|
f6021a2223 | ||
|
d11a55097b | ||
|
248326181b | ||
|
24c70c15b5 | ||
|
ad07052b3e | ||
|
763a047e17 | ||
|
a9eebb6eb0 | ||
|
beaf23f267 | ||
|
e7dc32fdf6 | ||
|
b3e484a4c2 | ||
|
2e0de740fd | ||
|
db74f631b3 | ||
|
331a6ccad0 | ||
|
a04b6e4143 | ||
|
202e5d6134 | ||
|
26b3274c8a | ||
|
ab26456624 | ||
|
82b0cb662f | ||
|
7eb8e7f0ae | ||
|
3043047a4e | ||
|
ceeb0cd4bd | ||
|
546733bb13 | ||
|
ce4a18a346 | ||
|
1ad0c910d6 | ||
|
c123c5c219 | ||
|
ed8c248638 | ||
|
f3c491f188 | ||
|
c67b8f4d85 | ||
|
9d516199cb | ||
|
1502520eff | ||
|
b548d8ef9b | ||
|
c96c6a5d86 | ||
|
dadc6ed188 | ||
|
dd7452d08b | ||
|
c2e750c6b8 | ||
|
ba0fa51c0b | ||
|
a7685a6f39 | ||
|
aad5452dd4 | ||
|
6a1d5c662f | ||
|
9aa65a8059 | ||
|
f69af626d5 | ||
|
891d42409e | ||
|
3b03252dea | ||
|
6f42e4f9c1 | ||
|
39bcff8631 |
@@ -1,4 +1,4 @@
|
||||
# For SmartGit
|
||||
[bugtraq "jira"]
|
||||
url = https://alfresco.atlassian.net/browse/%BUGID%
|
||||
url = https://issues.alfresco.com/jira/browse/%BUGID%
|
||||
logRegex = ([A-Z]+-\\d+)
|
||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@@ -35,6 +35,3 @@ target
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
|
||||
hs_err_pid*
|
||||
|
||||
# Alfresco runtime
|
||||
alf_data
|
||||
|
@@ -15,7 +15,7 @@
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
<name>Alfresco Internal Repository</name>
|
||||
<url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
|
||||
<url>https://artifacts.alfresco.com/nexus/content/groups/internal</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
<pluginRepositories>
|
||||
@@ -43,5 +43,15 @@
|
||||
<username>${env.MAVEN_USERNAME}</username>
|
||||
<password>${env.MAVEN_PASSWORD}</password>
|
||||
</server>
|
||||
<server>
|
||||
<id>quay.io</id>
|
||||
<username>${env.QUAY_USERNAME}</username>
|
||||
<password>${env.QUAY_PASSWORD}</password>
|
||||
</server>
|
||||
<server>
|
||||
<id>docker.io</id>
|
||||
<username>${env.DOCKERHUB_USERNAME}</username>
|
||||
<password>${env.DOCKERHUB_PASSWORD}</password>
|
||||
</server>
|
||||
</servers>
|
||||
</settings>
|
||||
|
179
.travis.yml
179
.travis.yml
@@ -1,5 +1,5 @@
|
||||
---
|
||||
dist: focal
|
||||
dist: xenial
|
||||
language: java
|
||||
jdk: openjdk11
|
||||
|
||||
@@ -21,8 +21,6 @@ branches:
|
||||
only:
|
||||
- master
|
||||
- /release\/.*/
|
||||
- /feature\/.*/
|
||||
- /fix\/.*/
|
||||
|
||||
env:
|
||||
global:
|
||||
@@ -45,6 +43,13 @@ install: travis_retry travis_wait 40 bash scripts/travis/build.sh
|
||||
jobs:
|
||||
include:
|
||||
|
||||
# - name: "Source Clear Scan"
|
||||
# # only on release branches or master and if it is not a PR
|
||||
# if: fork = false AND (branch = master OR branch =~ /release\/.*/) AND type != pull_request
|
||||
# script: skip
|
||||
# addons:
|
||||
# srcclr: true
|
||||
|
||||
- name: "Core, Data-Model, Repository - AllUnitTestsSuite - Build and test"
|
||||
script:
|
||||
- travis_retry mvn -B test -pl core,data-model
|
||||
@@ -52,166 +57,120 @@ jobs:
|
||||
|
||||
- name: "Repository - AppContext01TestSuite"
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.3.10
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:11.7 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.15.8
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=AppContext01TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
|
||||
- name: "Repository - AppContext02TestSuite"
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:11.7 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.15.8
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=AppContext02TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
|
||||
- name: "Repository - AppContext03TestSuite"
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.3.10
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=AppContext03TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:11.7 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.15.8
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.3.4
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=AppContext03TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco -Dalfresco-pdf-renderer.url=http://localhost:8090/ -Djodconverter.url=http://localhost:8090/ -Dimg.url=http://localhost:8090/ -Dtika.url=http://localhost:8090/ -Dtransform.misc.url=http://localhost:8090/
|
||||
|
||||
- name: "Repository - AppContext04TestSuite"
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.3.10
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:11.7 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.15.8
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.3.4
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=AppContext04TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
|
||||
- name: "Repository - AppContext05TestSuite"
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:11.7 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.15.8
|
||||
- mkdir -p "${HOME}/tmp"
|
||||
- cp repository/src/test/resources/realms/alfresco-realm.json "${HOME}/tmp"
|
||||
- export HOST_IP=$(hostname -I | cut -f1 -d' ')
|
||||
- docker run -d -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin -e DB_VENDOR=h2 -p 8999:8080 -e KEYCLOAK_IMPORT=/tmp/alfresco-realm.json -v $HOME/tmp/alfresco-realm.json:/tmp/alfresco-realm.json alfresco/alfresco-identity-service:1.2
|
||||
- docker run -d -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin -e DB_VENDOR=h2 -p 8999:8080 -e KEYCLOAK_IMPORT=/tmp/alfresco-realm.json -v $HOME/tmp/alfresco-realm.json:/tmp/alfresco-realm.json quay.io/alfresco/alfresco-identity-service:1.2
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=AppContext05TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco "-Didentity-service.auth-server-url=http://${HOST_IP}:8999/auth"
|
||||
|
||||
- name: "Repository - AppContext06TestSuite"
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.3.10
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=AppContext06TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:11.7 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.15.8
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.3.4
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=AppContext06TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco -Dalfresco-pdf-renderer.url=http://localhost:8090/ -Djodconverter.url=http://localhost:8090/ -Dimg.url=http://localhost:8090/ -Dtika.url=http://localhost:8090/ -Dtransform.misc.url=http://localhost:8090/
|
||||
|
||||
- name: "Repository - AppContextExtraTestSuite"
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.3.10
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:11.7 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.15.8
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=AppContextExtraTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
|
||||
- name: "Repository - MiscContextTestSuite"
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.3.10
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=MiscContextTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:11.7 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.15.8
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.3.4
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=MiscContextTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco -Dalfresco-pdf-renderer.url=http://localhost:8090/ -Djodconverter.url=http://localhost:8090/ -Dimg.url=http://localhost:8090/ -Dtika.url=http://localhost:8090/ -Dtransform.misc.url=http://localhost:8090/
|
||||
|
||||
- name: "Repository - SearchTestSuite"
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=SearchTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco -Dindex.subsystem.name=solr6
|
||||
|
||||
- name: "Repository - MariaDB 10.2.18 tests"
|
||||
if: commit_message !~ /\[skip db\]/
|
||||
before_script:
|
||||
- docker run -d -p 3307:3306 --name mariadb -e MYSQL_ROOT_PASSWORD=alfresco -e MYSQL_USER=alfresco -e MYSQL_DATABASE=alfresco -e MYSQL_PASSWORD=alfresco mariadb:10.2.18 --transaction-isolation=READ-COMMITTED --max-connections=300 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -Ddb.name=alfresco -Ddb.url=jdbc:mariadb://localhost:3307/alfresco?useUnicode=yes\&characterEncoding=UTF-8 -Ddb.username=alfresco -Ddb.password=alfresco -Ddb.driver=org.mariadb.jdbc.Driver
|
||||
|
||||
- name: "Repository - MariaDB 10.4 tests"
|
||||
if: commit_message !~ /\[skip db\]/
|
||||
before_script:
|
||||
- docker run -d -p 3307:3306 --name mariadb -e MYSQL_ROOT_PASSWORD=alfresco -e MYSQL_USER=alfresco -e MYSQL_DATABASE=alfresco -e MYSQL_PASSWORD=alfresco mariadb:10.4 --transaction-isolation=READ-COMMITTED --max-connections=300 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -Ddb.name=alfresco -Ddb.url=jdbc:mariadb://localhost:3307/alfresco?useUnicode=yes\&characterEncoding=UTF-8 -Ddb.username=alfresco -Ddb.password=alfresco -Ddb.driver=org.mariadb.jdbc.Driver
|
||||
|
||||
- name: "Repository - MariaDB 10.5 tests"
|
||||
if: commit_message !~ /\[skip db\]/
|
||||
before_script:
|
||||
- docker run -d -p 3307:3306 --name mariadb -e MYSQL_ROOT_PASSWORD=alfresco -e MYSQL_USER=alfresco -e MYSQL_DATABASE=alfresco -e MYSQL_PASSWORD=alfresco mariadb:10.5 --transaction-isolation=READ-COMMITTED --max-connections=300 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -Ddb.name=alfresco -Ddb.url=jdbc:mariadb://localhost:3307/alfresco?useUnicode=yes\&characterEncoding=UTF-8 -Ddb.username=alfresco -Ddb.password=alfresco -Ddb.driver=org.mariadb.jdbc.Driver
|
||||
|
||||
- name: "Repository - MySQL 5.7.23 tests"
|
||||
- name: "Repository - MySQL tests"
|
||||
if: commit_message !~ /\[skip db\]/
|
||||
before_script:
|
||||
- docker run -d -p 3307:3306 -e MYSQL_ROOT_PASSWORD=alfresco -e MYSQL_USER=alfresco -e MYSQL_DATABASE=alfresco -e MYSQL_PASSWORD=alfresco mysql:5.7.23 --transaction-isolation='READ-COMMITTED'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.15.8
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -Ddb.driver=com.mysql.jdbc.Driver -Ddb.name=alfresco -Ddb.url=jdbc:mysql://localhost:3307/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
|
||||
- name: "Repository - MySQL 8 tests"
|
||||
if: commit_message !~ /\[skip db\]/
|
||||
before_script:
|
||||
- docker run -d -p 3307:3306 -e MYSQL_ROOT_PASSWORD=alfresco -e MYSQL_USER=alfresco -e MYSQL_DATABASE=alfresco -e MYSQL_PASSWORD=alfresco mysql:8 --transaction-isolation='READ-COMMITTED'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -Ddb.driver=com.mysql.jdbc.Driver -Ddb.name=alfresco -Ddb.url=jdbc:mysql://localhost:3307/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
|
||||
- name: "Repository - PostgreSQL 10.9 tests"
|
||||
- name: "Repository - PostgreSQL 10 tests"
|
||||
if: commit_message !~ /\[skip db\]/
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:10.9 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.15.8
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
|
||||
- name: "Repository - PostgreSQL 11.7 tests"
|
||||
- name: "Repository - PostgreSQL 11 tests"
|
||||
if: commit_message !~ /\[skip db\]/
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:11.7 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.15.8
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
|
||||
- name: "Repository - PostgreSQL 12.4 tests"
|
||||
- name: "Repository - MariaDB tests"
|
||||
if: commit_message !~ /\[skip db\]/
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:12.4 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
|
||||
- name: "Repository - PostgreSQL 13.1 tests"
|
||||
if: commit_message !~ /\[skip db\]/
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
- docker run -d -p 3307:3306 --name mariadb -e MYSQL_ROOT_PASSWORD=alfresco -e MYSQL_USER=alfresco -e MYSQL_DATABASE=alfresco -e MYSQL_PASSWORD=alfresco mariadb:10.2.18 --transaction-isolation=READ-COMMITTED --max-connections=300 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.15.8
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=AllDBTestsTestSuite -Ddb.name=alfresco -Ddb.url=jdbc:mariadb://localhost:3307/alfresco?useUnicode=yes\&characterEncoding=UTF-8 -Ddb.username=alfresco -Ddb.password=alfresco -Ddb.driver=org.mariadb.jdbc.Driver
|
||||
|
||||
- name: "Remote-api - AppContext01TestSuite"
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:11.7 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.15.8
|
||||
script: travis_wait 20 mvn -B test -pl remote-api -Dtest=AppContext01TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
|
||||
- name: "Remote-api - AppContext02TestSuite"
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.3.10
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:11.7 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.15.8
|
||||
script: travis_wait 20 mvn -B test -pl remote-api -Dtest=AppContext02TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
|
||||
- name: "Remote-api - AppContext03TestSuite"
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.3.10
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:11.7 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.15.8
|
||||
script: travis_wait 20 mvn -B test -pl remote-api -Dtest=AppContext03TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
|
||||
- name: "Remote-api - AppContext04TestSuite"
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.3.10
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:11.7 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.15.8
|
||||
script: travis_wait 20 mvn -B test -pl remote-api -Dtest=AppContext04TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
|
||||
- name: "Remote-api - AppContextExtraTestSuite"
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:13.1 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.16.1
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:11.7 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.15.8
|
||||
script: travis_wait 20 mvn -B test -pl remote-api -Dtest=AppContextExtraTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
|
||||
- name: "REST API TAS tests part1"
|
||||
if: branch = master OR commit_message =~ /\[tas\]/
|
||||
if: commit_message =~ /\[tas\]/
|
||||
before_script:
|
||||
- ${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/docker-compose-minimal+transforms.yml
|
||||
- ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
|
||||
@@ -219,7 +178,7 @@ jobs:
|
||||
- travis_wait 60 mvn -B install -f packaging/tests/tas-restapi/pom.xml -Pall-tas-tests,run-restapi-part1 -Denvironment=default -DrunBugs=false
|
||||
|
||||
- name: "REST API TAS tests part2"
|
||||
if: branch = master OR commit_message =~ /\[tas\]/
|
||||
if: commit_message =~ /\[tas\]/
|
||||
before_script:
|
||||
- ${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/docker-compose-minimal+transforms.yml
|
||||
- ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
|
||||
@@ -227,39 +186,23 @@ jobs:
|
||||
- travis_wait 60 mvn -B install -f packaging/tests/tas-restapi/pom.xml -Pall-tas-tests,run-restapi-part2 -Denvironment=default -DrunBugs=false
|
||||
|
||||
- name: "REST API TAS tests part3"
|
||||
if: branch = master OR commit_message =~ /\[tas\]/
|
||||
if: commit_message =~ /\[tas\]/
|
||||
before_script:
|
||||
- ${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/docker-compose-minimal+transforms.yml
|
||||
- ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
|
||||
script:
|
||||
- travis_wait 60 mvn -B install -f packaging/tests/tas-restapi/pom.xml -Pall-tas-tests,run-restapi-part3 -Denvironment=default -DrunBugs=false
|
||||
|
||||
- name: "CMIS TAS tests - BROWSER binding"
|
||||
if: branch = master OR commit_message =~ /\[tas\]/
|
||||
- name: "CMIS TAS tests"
|
||||
if: commit_message =~ /\[tas\]/
|
||||
before_script:
|
||||
- ${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/docker-compose-minimal+transforms.yml
|
||||
- ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
|
||||
script:
|
||||
- travis_wait 40 mvn -B install -f packaging/tests/tas-cmis/pom.xml -Pall-tas-tests,run-cmis-browser -Denvironment=default -DrunBugs=false
|
||||
|
||||
- name: "CMIS TAS tests - ATOM binding"
|
||||
if: branch = master OR commit_message =~ /\[tas\]/
|
||||
before_script:
|
||||
- ${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/docker-compose-minimal+transforms.yml
|
||||
- ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
|
||||
script:
|
||||
- travis_wait 40 mvn -B install -f packaging/tests/tas-cmis/pom.xml -Pall-tas-tests,run-cmis-atom -Denvironment=default -DrunBugs=false
|
||||
|
||||
- name: "CMIS TAS tests - WEBSERVICES binding"
|
||||
if: branch = master OR commit_message =~ /\[tas\]/
|
||||
before_script:
|
||||
- ${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/docker-compose-minimal+transforms.yml
|
||||
- ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
|
||||
script:
|
||||
- travis_wait 40 mvn -B install -f packaging/tests/tas-cmis/pom.xml -Pall-tas-tests,run-cmis-webservices -Denvironment=default -DrunBugs=false
|
||||
- travis_wait 40 mvn -B install -f packaging/tests/tas-cmis/pom.xml -Pall-tas-tests -Denvironment=default -DrunBugs=false
|
||||
|
||||
- name: "Email TAS tests"
|
||||
if: branch = master OR commit_message =~ /\[tas\]/
|
||||
if: commit_message =~ /\[tas\]/
|
||||
before_script:
|
||||
- ${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/docker-compose-minimal.yml
|
||||
- ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
|
||||
@@ -267,7 +210,7 @@ jobs:
|
||||
- travis_wait 30 mvn -B install -f packaging/tests/tas-email/pom.xml -Pall-tas-tests -Denvironment=default -DrunBugs=false
|
||||
|
||||
- name: "WebDAV TAS tests"
|
||||
if: branch = master OR commit_message =~ /\[tas\]/
|
||||
if: commit_message =~ /\[tas\]/
|
||||
before_script:
|
||||
- ${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/docker-compose-minimal.yml
|
||||
- ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
|
||||
@@ -275,7 +218,7 @@ jobs:
|
||||
- travis_wait 30 mvn -B install -f packaging/tests/tas-webdav/pom.xml -Pall-tas-tests -Denvironment=default -DrunBugs=false
|
||||
|
||||
- name: "Integration TAS tests"
|
||||
if: branch = master OR commit_message =~ /\[tas\]/
|
||||
if: commit_message =~ /\[tas\]/
|
||||
before_script:
|
||||
- ${TAS_SCRIPTS}/start-compose.sh ${TAS_ENVIRONMENT}/docker-compose-minimal.yml
|
||||
- ${TAS_SCRIPTS}/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
|
||||
|
26
README.md
26
README.md
@@ -34,7 +34,7 @@ Repository is a library packaged as a jar file which contains the following:
|
||||
Tests are combined into test classes split by test type or Spring application context used in the test, see classes
|
||||
in _src/test/java/org/alfresco_. All of these classes as well as individual tests can be run by specifying the test
|
||||
class name and a set of DB connection properties. Check the travis.yml file for docker images that should be started
|
||||
to provide a suitable test environment. For example:
|
||||
to provide a sutable test environment. For example:
|
||||
~~~
|
||||
mvn clean test -Dtest=SomeRepoTest -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql:alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
~~~
|
||||
@@ -113,27 +113,27 @@ and `acs-community-packaging` in a single Intellij IDEA project. They depend on
|
||||
want to make changes to both of them if you are changing the repository code.
|
||||
|
||||
~~~
|
||||
mkdir work
|
||||
cd work
|
||||
git clone git@github.com:Alfresco/alfresco-community-repo.git
|
||||
git clone git@github.com:Alfresco/acs-community-packaging.git
|
||||
$ mkdir work
|
||||
$ cd work
|
||||
$ git clone git@github.com:Alfresco/alfresco-community-repo.git
|
||||
$ git clone git@github.com:Alfresco/acs-community-packaging.git
|
||||
~~~
|
||||
If you wish to build these projects from the command line, use the following commands.
|
||||
~~~
|
||||
cd alfresco-community-repo
|
||||
mvn clean install -PcommunityDocker -DskipTests=true -Dversion.edition=Community
|
||||
cd ..
|
||||
$ cd alfresco-community-repo
|
||||
$ mvn clean install -PcommunityDocker -DskipTests=true -Dversion.edition=Community
|
||||
$ cd ..
|
||||
|
||||
cd acs-community-packaging
|
||||
mvn clean install -PcommunityDocker -Dmaven.javadoc.skip=true
|
||||
cd ..
|
||||
$ cd acs-community-packaging
|
||||
$ mvn clean install -PcommunityDocker -Dmaven.javadoc.skip=true
|
||||
$ cd ..
|
||||
~~~
|
||||
In Intellij IDEA, create a new project using the `work` directory as the source.
|
||||
In Itellij IDEA, create a new project using the `work` directory as the source.
|
||||
* File > New Project from Existing Sources > .../work > Maven
|
||||
|
||||
## Branches
|
||||
As multiple projects have been combined, branch names use the ACS version they are targeting.
|
||||
For example the code used to create the repository in ACS 6.2.1 is a branch called `releases/6.2.1`.
|
||||
For example the code used to create the repository in ACS 6.2.1 in a branch called `releases/6.2.1`.
|
||||
|
||||
The actual version number of the **repository artifacts** created by `alfresco-community-repo` are however different.
|
||||
For example `release/6.2.1` artifacts are `7.183.x`. This adds some complexity, but ensures that
|
||||
|
62
core/pom.xml
62
core/pom.xml
@@ -1,5 +1,6 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>alfresco-core</artifactId>
|
||||
<name>Alfresco Core</name>
|
||||
<description>Alfresco core libraries and utils</description>
|
||||
@@ -7,28 +8,14 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>9.1</version>
|
||||
<version>7.199.314</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<!-- Jakarta... -->
|
||||
<dependency>
|
||||
<groupId>jakarta.xml.bind</groupId>
|
||||
<artifactId>jakarta.xml.bind-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.glassfish.jaxb</groupId>
|
||||
<artifactId>jaxb-runtime</artifactId>
|
||||
</dependency>
|
||||
<!-- REPO-5047 - Replaces org.apache.geronimo.specs:geronimo-jta_1.1_spec -->
|
||||
<dependency>
|
||||
<groupId>jakarta.transaction</groupId>
|
||||
<artifactId>jakarta.transaction-api</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
<version>1.14</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-httpclient</groupId>
|
||||
@@ -37,10 +24,12 @@
|
||||
<dependency>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
<version>1.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
@@ -65,6 +54,7 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-orm</artifactId>
|
||||
<version>${dependency.spring.version}</version>
|
||||
<!-- exclude spring-jcl which is brought in by spring-core -->
|
||||
<!-- see https://issues.alfresco.com/jira/browse/REPO-4774 -->
|
||||
<exclusions>
|
||||
@@ -77,10 +67,12 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context</artifactId>
|
||||
<version>${dependency.spring.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.quartz-scheduler</groupId>
|
||||
<artifactId>quartz</artifactId>
|
||||
<version>2.3.2</version>
|
||||
<!-- exclude c3p0 -->
|
||||
<!-- see https://issues.alfresco.com/jira/browse/REPO-3447 -->
|
||||
<exclusions>
|
||||
@@ -94,20 +86,42 @@
|
||||
<groupId>org.alfresco.surf</groupId>
|
||||
<artifactId>spring-surf-core-configservice</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.xml.bind</groupId>
|
||||
<artifactId>jaxb-api</artifactId>
|
||||
<version>2.3.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sun.xml.bind</groupId>
|
||||
<artifactId>jaxb-impl</artifactId>
|
||||
<version>2.3.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sun.xml.bind</groupId>
|
||||
<artifactId>jaxb-core</artifactId>
|
||||
<version>2.3.0.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.guessencoding</groupId>
|
||||
<artifactId>guessencoding</artifactId>
|
||||
<version>1.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.transaction</groupId>
|
||||
<artifactId>jta</artifactId>
|
||||
<version>1.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>joda-time</groupId>
|
||||
<artifactId>joda-time</artifactId>
|
||||
<version>2.10.5</version>
|
||||
</dependency>
|
||||
|
||||
<!-- provided dependencies -->
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>3.0.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -120,24 +134,40 @@
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.13</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<version>3.2.4</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-dbcp</groupId>
|
||||
<artifactId>commons-dbcp</artifactId>
|
||||
<version>1.4-DBCP330</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-release-plugin</artifactId>
|
||||
<configuration>
|
||||
<autoVersionSubmodules>true</autoVersionSubmodules>
|
||||
<tagNameFormat>@{project.version}</tagNameFormat>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.2.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
|
@@ -322,7 +322,7 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
|
||||
|
||||
try
|
||||
{
|
||||
keyInfoManager = getKeyInfoManager(getKeyStoreParameters());
|
||||
keyInfoManager = getKeyInfoManager(getKeyMetaDataFileLocation());
|
||||
KeyStore ks = loadKeyStore(keyStoreParameters, keyInfoManager);
|
||||
|
||||
logger.debug("Initializing key managers");
|
||||
@@ -355,7 +355,7 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
|
||||
|
||||
try
|
||||
{
|
||||
keyInfoManager = getKeyInfoManager(getKeyStoreParameters());
|
||||
keyInfoManager = getKeyInfoManager(getKeyMetaDataFileLocation());
|
||||
KeyStore ks = loadKeyStore(getKeyStoreParameters(), keyInfoManager);
|
||||
|
||||
logger.debug("Initializing trust managers");
|
||||
@@ -376,7 +376,12 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected String getKeyMetaDataFileLocation()
|
||||
{
|
||||
return keyStoreParameters.getKeyMetaDataFileLocation();
|
||||
}
|
||||
|
||||
protected InputStream getKeyStoreStream(String location) throws FileNotFoundException
|
||||
{
|
||||
if(location == null)
|
||||
@@ -391,17 +396,9 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
|
||||
return new FileOutputStream(getKeyStoreParameters().getLocation());
|
||||
}
|
||||
|
||||
protected KeyInfoManager getKeyInfoManager(KeyStoreParameters keyStoreParameters) throws IOException
|
||||
protected KeyInfoManager getKeyInfoManager(String metadataFileLocation) throws FileNotFoundException, IOException
|
||||
{
|
||||
return new KeyInfoManager(keyStoreParameters, keyResourceLoader);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
protected KeyInfoManager getKeyInfoManager(String metadataFileLocation) throws IOException
|
||||
{
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setKeyMetaDataFileLocation(metadataFileLocation);
|
||||
return new KeyInfoManager(keyStoreParameters, keyResourceLoader);
|
||||
return new KeyInfoManager(metadataFileLocation, keyResourceLoader);
|
||||
}
|
||||
|
||||
protected KeyMap cacheKeys(KeyStore ks, KeyInfoManager keyInfoManager)
|
||||
@@ -566,7 +563,7 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
|
||||
|
||||
try
|
||||
{
|
||||
keyInfoManager = getKeyInfoManager(keyStoreParameters);
|
||||
keyInfoManager = getKeyInfoManager(keyStoreParameters.getKeyMetaDataFileLocation());
|
||||
ks = loadKeyStore(keyStoreParameters, keyInfoManager);
|
||||
// Loaded
|
||||
}
|
||||
@@ -638,7 +635,7 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
|
||||
|
||||
try
|
||||
{
|
||||
keyInfoManager = getKeyInfoManager(getKeyStoreParameters());
|
||||
keyInfoManager = getKeyInfoManager(getKeyMetaDataFileLocation());
|
||||
Key key = getSecretKey(keyInfoManager.getKeyInformation(keyAlias));
|
||||
encryptionKeysRegistry.registerKey(keyAlias, key);
|
||||
keys.setKey(keyAlias, key);
|
||||
@@ -681,7 +678,7 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
|
||||
{
|
||||
if(!keyStoreExists(keyStoreParameters.getLocation()))
|
||||
{
|
||||
keyInfoManager = getKeyInfoManager(keyStoreParameters);
|
||||
keyInfoManager = getKeyInfoManager(keyStoreParameters.getKeyMetaDataFileLocation());
|
||||
KeyStore ks = initialiseKeyStore(keyStoreParameters.getType(), keyStoreParameters.getProvider());
|
||||
|
||||
String keyStorePassword = keyInfoManager.getKeyStorePassword();
|
||||
@@ -689,7 +686,7 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Key store password is null for keystore at location "
|
||||
+ getKeyStoreParameters().getLocation()
|
||||
+ ". Either specify it as a JVM property or in key store meta data location.");
|
||||
+ ", key store meta data location" + getKeyMetaDataFileLocation());
|
||||
}
|
||||
|
||||
for(String keyAlias : keys.getKeyAliases())
|
||||
@@ -768,13 +765,8 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
|
||||
}
|
||||
}
|
||||
|
||||
protected Key getSecretKey(KeyInformation keyInformation) throws AlfrescoRuntimeException, NoSuchAlgorithmException, InvalidKeyException, InvalidKeySpecException
|
||||
protected Key getSecretKey(KeyInformation keyInformation) throws NoSuchAlgorithmException, InvalidKeyException, InvalidKeySpecException
|
||||
{
|
||||
if (keyInformation == null)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Unable to get secret key: no key information is provided");
|
||||
}
|
||||
|
||||
byte[] keyData = keyInformation.getKeyData();
|
||||
|
||||
if(keyData == null)
|
||||
@@ -804,7 +796,7 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
|
||||
writeLock.lock();
|
||||
try
|
||||
{
|
||||
keyInfoManager = getKeyInfoManager(getKeyStoreParameters());
|
||||
keyInfoManager = getKeyInfoManager(getKeyMetaDataFileLocation());
|
||||
KeyStore ks = loadKeyStore(getKeyStoreParameters(), keyInfoManager);
|
||||
|
||||
// loading Key
|
||||
@@ -993,7 +985,7 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
|
||||
public static class KeyInfoManager
|
||||
{
|
||||
private KeyResourceLoader keyResourceLoader;
|
||||
private KeyStoreParameters keyStoreParameters;
|
||||
private String metadataFileLocation;
|
||||
private Properties keyProps;
|
||||
private String keyStorePassword = null;
|
||||
private Map<String, KeyInformation> keyInfo;
|
||||
@@ -1013,10 +1005,10 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
|
||||
}
|
||||
}
|
||||
|
||||
KeyInfoManager(KeyStoreParameters keyStoreParameters, KeyResourceLoader keyResourceLoader) throws IOException, FileNotFoundException
|
||||
KeyInfoManager(String metadataFileLocation, KeyResourceLoader keyResourceLoader) throws IOException, FileNotFoundException
|
||||
{
|
||||
this.keyResourceLoader = keyResourceLoader;
|
||||
this.keyStoreParameters = keyStoreParameters;
|
||||
this.metadataFileLocation = metadataFileLocation;
|
||||
keyInfo = new HashMap<String, KeyInformation>(2);
|
||||
loadKeyMetaData();
|
||||
}
|
||||
@@ -1033,73 +1025,31 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
|
||||
* Where required, <tt>null</tt> values must be inserted into the map to indicate the presence
|
||||
* of a key that is not protected by a password. They entry for {@link #KEY_KEYSTORE_PASSWORD}
|
||||
* is required if the keystore is password protected.
|
||||
*
|
||||
* WARNING. Storing passwords (keyMetaDataFileLocation) on the file system is not following best security practices.
|
||||
*
|
||||
* <p/>Loading of keys info from system (JVM) properties takes precedence over metadata file.
|
||||
* <p/>Set the unique ID of the keystore and remove the metadata file location property to use JVM properties lookup instead. The property lookup format is the following:
|
||||
* <ul>
|
||||
* <li>[keystore-id].password - keystore password</li>
|
||||
* <li>[keystore-id].aliases - comma separated list of aliases for the keys in the keystore</li>
|
||||
* <li>[keystore-id].[alias].keyData - key data bytes in base64</li>
|
||||
* <li>[keystore-id].[alias].algorithm - key algorithm</li>
|
||||
* <li>[keystore-id].[alias].password - key password</li>
|
||||
* </ul>
|
||||
*
|
||||
*/
|
||||
protected void loadKeyMetaData() throws IOException, FileNotFoundException
|
||||
{
|
||||
if (keyStoreParameters.getId() != null &&
|
||||
(keyStoreParameters.getKeyMetaDataFileLocation() == null ||
|
||||
keyStoreParameters.getKeyMetaDataFileLocation().isEmpty()))
|
||||
keyProps = keyResourceLoader.loadKeyMetaData(metadataFileLocation);
|
||||
if(keyProps != null)
|
||||
{
|
||||
Properties jvmProperties = System.getProperties();
|
||||
keyStorePassword = jvmProperties.getProperty(keyStoreParameters.getId() + ".password");
|
||||
String aliases = jvmProperties.getProperty(keyStoreParameters.getId() + ".aliases");
|
||||
if (aliases == null || aliases.isEmpty())
|
||||
String aliases = keyProps.getProperty("aliases");
|
||||
if(aliases == null)
|
||||
{
|
||||
logger.warn("No aliases were specified for " + keyStoreParameters.getId()
|
||||
+ " keystore");
|
||||
throw new AlfrescoRuntimeException("Passwords file must contain an aliases key");
|
||||
}
|
||||
else
|
||||
|
||||
this.keyStorePassword = keyProps.getProperty(KEY_KEYSTORE_PASSWORD);
|
||||
|
||||
StringTokenizer st = new StringTokenizer(aliases, ",");
|
||||
while(st.hasMoreTokens())
|
||||
{
|
||||
StringTokenizer st = new StringTokenizer(aliases, ",");
|
||||
while(st.hasMoreTokens())
|
||||
{
|
||||
String keyAlias = st.nextToken();
|
||||
keyInfo.put(keyAlias, loadKeyInformation(jvmProperties, keyAlias, keyStoreParameters.getId() + "."));
|
||||
}
|
||||
String keyAlias = st.nextToken();
|
||||
keyInfo.put(keyAlias, loadKeyInformation(keyAlias));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.warn("Storing passwords (" + keyStoreParameters.getKeyMetaDataFileLocation()
|
||||
+ ") on the file system is not following best security practices." +
|
||||
" Please refer to documentation and use JVM properties instead");
|
||||
|
||||
keyProps = keyResourceLoader.loadKeyMetaData(keyStoreParameters.getKeyMetaDataFileLocation());
|
||||
if(keyProps != null)
|
||||
{
|
||||
String aliases = keyProps.getProperty("aliases");
|
||||
if(aliases == null)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Passwords file must contain an aliases key");
|
||||
}
|
||||
|
||||
this.keyStorePassword = keyProps.getProperty(KEY_KEYSTORE_PASSWORD);
|
||||
|
||||
StringTokenizer st = new StringTokenizer(aliases, ",");
|
||||
while(st.hasMoreTokens())
|
||||
{
|
||||
String keyAlias = st.nextToken();
|
||||
keyInfo.put(keyAlias, loadKeyInformation(keyProps, keyAlias, ""));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO
|
||||
//throw new FileNotFoundException("Cannot find key metadata file " + getKeyMetaDataFileLocation());
|
||||
}
|
||||
// TODO
|
||||
//throw new FileNotFoundException("Cannot find key metadata file " + getKeyMetaDataFileLocation());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1117,11 +1067,11 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
|
||||
this.keyProps.remove(keyAlias);
|
||||
}
|
||||
|
||||
protected KeyInformation loadKeyInformation(Properties keyProps, String keyAlias, String prefix)
|
||||
protected KeyInformation loadKeyInformation(String keyAlias)
|
||||
{
|
||||
String keyPassword = keyProps.getProperty(prefix + keyAlias + ".password");
|
||||
String keyData = keyProps.getProperty(prefix + keyAlias + ".keyData");
|
||||
String keyAlgorithm = keyProps.getProperty(prefix + keyAlias + ".algorithm");
|
||||
String keyPassword = keyProps.getProperty(keyAlias + ".password");
|
||||
String keyData = keyProps.getProperty(keyAlias + ".keyData");
|
||||
String keyAlgorithm = keyProps.getProperty(keyAlias + ".algorithm");
|
||||
|
||||
byte[] keyDataBytes = null;
|
||||
if(keyData != null && !keyData.equals(""))
|
||||
|
@@ -22,15 +22,12 @@ import org.alfresco.util.PropertyCheck;
|
||||
|
||||
/**
|
||||
* Stores Java keystore initialisation parameters.
|
||||
*
|
||||
* WARNING. Storing passwords (keyMetaDataFileLocation) on the file system is not following best security practices.
|
||||
*
|
||||
*
|
||||
* @since 4.0
|
||||
*
|
||||
*/
|
||||
public class KeyStoreParameters
|
||||
{
|
||||
private String id;
|
||||
private String name;
|
||||
private String type;
|
||||
private String provider;
|
||||
@@ -41,40 +38,8 @@ public class KeyStoreParameters
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* WARNING. Storing passwords (keyMetaDataFileLocation) on the file system is not following best security practices.
|
||||
*
|
||||
* <p/>Set the unique ID of the keystore and aliases to use Java system properties lookup instead. The property lookup format is:
|
||||
* <ul>
|
||||
* <li>[keystore-id].password - keystore password</li>
|
||||
* <li>[keystore-id].aliases - comma separated list of aliases for the keys in the keystore</li>
|
||||
* <li>[keystore-id].[alias].keydata - key data bytes in base64</li>
|
||||
* <li>[keystore-id].[alias].algorithm - key algorithm</li>
|
||||
* <li>[keystore-id].[alias].password - key password</li>
|
||||
* </ul>
|
||||
*
|
||||
* Loading of keys info from system (JVM) properties takes precedence over metadata file.
|
||||
*
|
||||
* @param id unique identifier of the keystore
|
||||
* @param name human readable name of the keystore
|
||||
* @param type type of the keystore
|
||||
* @param keyStoreProvider keystore provider
|
||||
* @param keyMetaDataFileLocation path to keystore metadata file on the file system
|
||||
* @param location path to keystore on the file system
|
||||
*/
|
||||
public KeyStoreParameters(String id, String name, String type, String keyStoreProvider,
|
||||
String keyMetaDataFileLocation, String location)
|
||||
{
|
||||
this(name, type, keyStoreProvider, keyMetaDataFileLocation, location);
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use {@link #KeyStoreParameters(String, String, String, String, String, String)} instead
|
||||
*/
|
||||
@Deprecated()
|
||||
public KeyStoreParameters(String name, String type, String keyStoreProvider,
|
||||
String keyMetaDataFileLocation, String location)
|
||||
String keyMetaDataFileLocation, String location)
|
||||
{
|
||||
super();
|
||||
this.name = name;
|
||||
@@ -84,13 +49,8 @@ public class KeyStoreParameters
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
|
||||
public void init()
|
||||
{
|
||||
if (!PropertyCheck.isValidPropertyString(getId()))
|
||||
{
|
||||
setId(null);
|
||||
}
|
||||
if (!PropertyCheck.isValidPropertyString(getLocation()))
|
||||
{
|
||||
setLocation(null);
|
||||
@@ -109,11 +69,6 @@ public class KeyStoreParameters
|
||||
}
|
||||
}
|
||||
|
||||
public String getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
@@ -138,12 +93,7 @@ public class KeyStoreParameters
|
||||
{
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setId(String id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
|
@@ -113,7 +113,7 @@ public abstract class AbstractCannedQuery<R> implements CannedQuery<R>
|
||||
final List<List<R>> finalPages = pages;
|
||||
|
||||
// Has more items beyond requested pages ? ... ie. at least one more page (with at least one result)
|
||||
final boolean hasMoreItems = (rawResults.size() > pagingDetails.getResultsRequiredForPaging()) || (totalCount.getFirst() > pagingDetails.getResultsRequiredForPaging());
|
||||
final boolean hasMoreItems = (rawResults.size() > pagingDetails.getResultsRequiredForPaging());
|
||||
|
||||
results = new CannedQueryResults<R>()
|
||||
{
|
||||
|
@@ -24,10 +24,8 @@ import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.time.Duration;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
import org.alfresco.api.AlfrescoPublicApi;
|
||||
import org.alfresco.api.AlfrescoPublicApi;
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
@@ -350,17 +348,6 @@ public class TempFileProvider
|
||||
{
|
||||
public static final String KEY_PROTECT_HOURS = "protectHours";
|
||||
public static final String KEY_DIRECTORY_NAME = "directoryName";
|
||||
public static final String KEY_MAX_FILES_TO_DELETE = "maxFilesToDelete";
|
||||
public static final String KEY_MAX_TIME_TO_RUN = "maxTimeToRun";
|
||||
|
||||
/** The time when the job has actually started */
|
||||
private static long jobStartTime;
|
||||
|
||||
/** The maximum number of files that can be deleted when the cleaning jobs runs */
|
||||
private static AtomicLong maxFilesToDelete;
|
||||
|
||||
/** The maximum time allowed for the cleaning job to run */
|
||||
private static Duration maxTimeToRun;
|
||||
|
||||
/**
|
||||
* Gets a list of all files in the {@link TempFileProvider#ALFRESCO_TEMP_FILE_DIR temp directory}
|
||||
@@ -389,59 +376,24 @@ public class TempFileProvider
|
||||
}
|
||||
|
||||
String directoryName = (String) context.getJobDetail().getJobDataMap().get(KEY_DIRECTORY_NAME);
|
||||
|
||||
try
|
||||
{
|
||||
final Object oMaxFilesToDelete = context.getJobDetail().getJobDataMap().get(KEY_MAX_FILES_TO_DELETE);
|
||||
if (oMaxFilesToDelete != null)
|
||||
{
|
||||
final String strMaxFilesToDelete = (String) oMaxFilesToDelete;
|
||||
maxFilesToDelete = new AtomicLong(Long.parseLong(strMaxFilesToDelete));
|
||||
logger.debug("Set the maximum number of temp files to be deleted to: " + maxFilesToDelete.get());
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.debug("No maximum number of files was configured for the temp file clean job.");
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
logger.warn(e);
|
||||
throw new JobExecutionException("Invalid job data, maxFilesToDelete");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
final Object oMaxTimeToRun = context.getJobDetail().getJobDataMap().get(KEY_MAX_TIME_TO_RUN);
|
||||
if (oMaxTimeToRun != null)
|
||||
{
|
||||
final String strMaxTimeToRun = (String) oMaxTimeToRun;
|
||||
maxTimeToRun = Duration.parse(strMaxTimeToRun);
|
||||
logger.debug("Set the maximum duration time of the temp file clean job to: " + maxTimeToRun);
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.debug("No maximum duration was configured for the temp file clean job.");
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
logger.warn(e);
|
||||
throw new JobExecutionException("Invalid job data, maxTimeToRun");
|
||||
}
|
||||
|
||||
if (directoryName == null)
|
||||
{
|
||||
directoryName = ALFRESCO_TEMP_FILE_DIR;
|
||||
}
|
||||
|
||||
jobStartTime = System.currentTimeMillis();
|
||||
long aFewHoursBack = jobStartTime - (3600L * 1000L * protectHours);
|
||||
long aLongTimeBack = jobStartTime - (24 * 3600L * 1000L);
|
||||
long now = System.currentTimeMillis();
|
||||
long aFewHoursBack = now - (3600L * 1000L * protectHours);
|
||||
|
||||
long aLongTimeBack = now - (24 * 3600L * 1000L);
|
||||
|
||||
File tempDir = TempFileProvider.getTempDir(directoryName);
|
||||
int count = removeFiles(tempDir, aFewHoursBack, aLongTimeBack, false); // don't delete this directory
|
||||
logger.debug("Removed " + count + " files from temp directory: " + tempDir);
|
||||
// done
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Removed " + count + " files from temp directory: " + tempDir);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -477,23 +429,29 @@ public class TempFileProvider
|
||||
}
|
||||
// list all files
|
||||
File[] files = directory.listFiles();
|
||||
File[] filesToIterate = files != null ? files : new File[0];
|
||||
int count = 0;
|
||||
for (File file : filesToIterate)
|
||||
for (File file : files)
|
||||
{
|
||||
if (shouldTheDeletionStop())
|
||||
{
|
||||
break;
|
||||
}
|
||||
if (file.isDirectory())
|
||||
{
|
||||
// long life for this folder and its children
|
||||
// OR
|
||||
// enter subdirectory and clean it out and remove itsynetics
|
||||
int countRemoved = removeFiles(file,
|
||||
isLongLifeTempDir(file) ? longLifeBefore : removeBefore, longLifeBefore,
|
||||
true);
|
||||
logger.debug("Removed " + countRemoved + " files from " + (isLongLifeTempDir(file) ? "temp " : " ") + "directory: " + file);
|
||||
if(isLongLifeTempDir(file))
|
||||
{
|
||||
// long life for this folder and its children
|
||||
int countRemoved = removeFiles(file, longLifeBefore, longLifeBefore, true);
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Removed " + countRemoved + " files from temp directory: " + file);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// enter subdirectory and clean it out and remove itsynetics
|
||||
int countRemoved = removeFiles(file, removeBefore, longLifeBefore, true);
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Removed " + countRemoved + " files from directory: " + file);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -506,19 +464,11 @@ public class TempFileProvider
|
||||
// it is a file - attempt a delete
|
||||
try
|
||||
{
|
||||
logger.debug("Deleting temp file: " + file);
|
||||
if(logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Deleting temp file: " + file);
|
||||
}
|
||||
file.delete();
|
||||
|
||||
if (maxFilesToDelete != null)
|
||||
{
|
||||
maxFilesToDelete.decrementAndGet();
|
||||
logger.debug(maxFilesToDelete.get() + " files left to delete.");
|
||||
}
|
||||
if (maxTimeToRun != null)
|
||||
{
|
||||
logger.debug((jobStartTime + maxTimeToRun.toMillis() - System.currentTimeMillis()) + " millis left to delete.");
|
||||
}
|
||||
|
||||
count++;
|
||||
}
|
||||
catch (Throwable e)
|
||||
@@ -537,8 +487,10 @@ public class TempFileProvider
|
||||
if(listing != null && listing.length == 0)
|
||||
{
|
||||
// directory is empty
|
||||
logger.debug("Deleting empty directory: " + directory);
|
||||
// ignore the limits for empty directories that just need cleanup
|
||||
if(logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Deleting empty directory: " + directory);
|
||||
}
|
||||
directory.delete();
|
||||
}
|
||||
}
|
||||
@@ -547,21 +499,8 @@ public class TempFileProvider
|
||||
logger.info("Failed to remove temp directory: " + directory, e);
|
||||
}
|
||||
}
|
||||
// done
|
||||
return count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Decides whether or not the job should continue iterating through the temp files and delete.
|
||||
* It achieves the result by checking the number of files deleted against the limit and whether
|
||||
* or not it is within the time limit
|
||||
*
|
||||
* @return true or false
|
||||
*/
|
||||
private static boolean shouldTheDeletionStop()
|
||||
{
|
||||
return maxFilesToDelete != null && maxFilesToDelete.get() <= 0
|
||||
|| maxTimeToRun != null && ((jobStartTime + maxTimeToRun.toMillis()) < System
|
||||
.currentTimeMillis());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -424,7 +424,6 @@ public abstract class AbstractAsynchronouslyRefreshedCache<T>
|
||||
@Override
|
||||
public Void call()
|
||||
{
|
||||
liveLock.writeLock().lock();
|
||||
try
|
||||
{
|
||||
doCall();
|
||||
@@ -445,10 +444,6 @@ public abstract class AbstractAsynchronouslyRefreshedCache<T>
|
||||
}
|
||||
return null;
|
||||
}
|
||||
finally
|
||||
{
|
||||
liveLock.writeLock().unlock();
|
||||
}
|
||||
}
|
||||
|
||||
private void doCall() throws Exception
|
||||
|
@@ -18,10 +18,7 @@
|
||||
*/
|
||||
package org.alfresco.util.transaction;
|
||||
|
||||
import static java.util.Collections.emptyList;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Collection;
|
||||
|
||||
import javax.transaction.HeuristicMixedException;
|
||||
import javax.transaction.HeuristicRollbackException;
|
||||
@@ -39,7 +36,6 @@ import org.springframework.transaction.CannotCreateTransactionException;
|
||||
import org.springframework.transaction.NoTransactionException;
|
||||
import org.springframework.transaction.PlatformTransactionManager;
|
||||
import org.springframework.transaction.TransactionDefinition;
|
||||
import org.springframework.transaction.TransactionManager;
|
||||
import org.springframework.transaction.TransactionStatus;
|
||||
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
||||
import org.springframework.transaction.interceptor.TransactionAttribute;
|
||||
@@ -138,9 +134,7 @@ public class SpringAwareUserTransaction
|
||||
private long threadId = Long.MIN_VALUE;
|
||||
/** make sure that we clean up the thread transaction stack properly */
|
||||
private boolean finalized = false;
|
||||
|
||||
private Collection<String> labels = emptyList();
|
||||
|
||||
|
||||
/**
|
||||
* Creates a user transaction that defaults to {@link TransactionDefinition#PROPAGATION_REQUIRED}.
|
||||
*
|
||||
@@ -205,21 +199,6 @@ public class SpringAwareUserTransaction
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Associate one or more labels with this transaction attribute.
|
||||
* <p>This may be used for applying specific transactional behavior
|
||||
* or follow a purely descriptive nature.
|
||||
*/
|
||||
public void setLabels(Collection<String> labels) {
|
||||
this.labels = labels;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<String> getLabels()
|
||||
{
|
||||
return this.labels;
|
||||
}
|
||||
|
||||
/**
|
||||
* The {@link UserTransaction } must rollback regardless of the error. The
|
||||
* {@link #rollback() rollback} behaviour is implemented by simulating a caught
|
||||
@@ -431,15 +410,8 @@ public class SpringAwareUserTransaction
|
||||
// begin a transaction
|
||||
try
|
||||
{
|
||||
TransactionManager tm = getTransactionManager();
|
||||
|
||||
if (tm != null && !(tm instanceof PlatformTransactionManager))
|
||||
{
|
||||
throw new IllegalStateException("Specified transaction manager is not a PlatformTransactionManager: " + tm);
|
||||
}
|
||||
|
||||
internalTxnInfo = createTransactionIfNecessary(
|
||||
(PlatformTransactionManager) tm, getTransactionAttribute(null, null), getName());
|
||||
getTransactionManager(), getTransactionAttribute(null, null), getName());
|
||||
}
|
||||
catch (CannotCreateTransactionException e)
|
||||
{
|
||||
|
@@ -1,388 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2020 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.alfresco.encryption;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.TestName;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.junit.MockitoJUnitRunner;
|
||||
|
||||
@RunWith(MockitoJUnitRunner.class)
|
||||
public class AlfrescoKeyStoreTest
|
||||
{
|
||||
@Mock
|
||||
private EncryptionKeysRegistry encryptionKeysRegistry;
|
||||
|
||||
@Rule
|
||||
public TestName testName = new TestName();
|
||||
|
||||
@Test
|
||||
public void testSysPropConfig()
|
||||
{
|
||||
String keyStoreId = testName.getMethodName() + "-keystore";
|
||||
String alias1 = "mykey1";
|
||||
String alias2 = "mykey2";
|
||||
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setId(keyStoreId);
|
||||
keyStoreParameters.setName(testName.getMethodName());
|
||||
keyStoreParameters.setType("JCEKS");
|
||||
keyStoreParameters.setProvider("SunJCE");
|
||||
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-2.jks");
|
||||
|
||||
System.setProperty(keyStoreId + "." + "password", "ksPwd2");
|
||||
System.setProperty(keyStoreId + "." + "aliases", alias1 + "," + alias2);
|
||||
System.setProperty(keyStoreId + "." + alias1 + "." + "password", "aliasPwd1");
|
||||
System.setProperty(keyStoreId + "." + alias2 + "." + "password", "aliasPwd2");
|
||||
|
||||
try
|
||||
{
|
||||
AlfrescoKeyStore alfrescoKeyStore = new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
|
||||
Set<String> expectedAliases = new HashSet<>();
|
||||
expectedAliases.add(alias1);
|
||||
expectedAliases.add(alias2);
|
||||
Assert.assertEquals("The aliases are not correct", expectedAliases, alfrescoKeyStore.getKeyAliases());
|
||||
|
||||
Assert.assertNotNull("Failed to retrieve a key from keystore.", alfrescoKeyStore.getKey(alias1));
|
||||
Assert.assertNotNull("Failed to retrieve a key from keystore.", alfrescoKeyStore.getKey(alias2));
|
||||
}
|
||||
finally
|
||||
{
|
||||
System.clearProperty(keyStoreId + "." + "password");
|
||||
System.clearProperty(keyStoreId + "." + "aliases");
|
||||
System.clearProperty(keyStoreId + "." + alias1 + "." + "password");
|
||||
System.clearProperty(keyStoreId + "." + alias2 + "." + "password");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSysPropConfigWithoutAliases()
|
||||
{
|
||||
String keyStoreId = testName.getMethodName() + "-keystore";
|
||||
String alias1 = "mykey1";
|
||||
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setId(keyStoreId);
|
||||
keyStoreParameters.setName(testName.getMethodName());
|
||||
keyStoreParameters.setType("JCEKS");
|
||||
keyStoreParameters.setProvider("SunJCE");
|
||||
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-1.jks");
|
||||
|
||||
System.setProperty(keyStoreId + "." + "password", "ksPwd1");
|
||||
System.setProperty(keyStoreId + "." + alias1 + "." + "password", "aliasPwd1");
|
||||
try
|
||||
{
|
||||
AlfrescoKeyStore keyStore = new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
|
||||
Assert.assertNull(keyStore.getKey(alias1));
|
||||
}
|
||||
finally
|
||||
{
|
||||
System.clearProperty(keyStoreId + "." + "password");
|
||||
System.clearProperty(keyStoreId + "." + alias1 + "." + "password");
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMetaDataFileConfig()
|
||||
{
|
||||
String alias1 = "mykey1";
|
||||
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setName(testName.getMethodName());
|
||||
keyStoreParameters.setType("JCEKS");
|
||||
keyStoreParameters.setProvider("SunJCE");
|
||||
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-1.jks");
|
||||
keyStoreParameters.setKeyMetaDataFileLocation("classpath:keystore-tests/ks1-metadata.properties");
|
||||
|
||||
AlfrescoKeyStore alfrescoKeyStore = new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
|
||||
Set<String> expectedAliases = new HashSet<>();
|
||||
expectedAliases.add(alias1);
|
||||
Assert.assertEquals("The aliases are not correct", expectedAliases, alfrescoKeyStore.getKeyAliases());
|
||||
|
||||
Assert.assertNotNull("Failed to retrieve a key from keystore.", alfrescoKeyStore.getKey(alias1));
|
||||
}
|
||||
|
||||
/**
|
||||
* Config via System props should be default, but if the metadata file location is set, it will be used instead.
|
||||
* This is done to maintain backwards compatibility and simplify testing use cases.
|
||||
*/
|
||||
@Test(expected = AlfrescoRuntimeException.class)
|
||||
public void testConfigBothSystemAndFile()
|
||||
{
|
||||
String keyStoreId = testName.getMethodName() + "-keystore";
|
||||
String alias1 = "mykey1";
|
||||
String alias2 = "mykey2";
|
||||
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setId(keyStoreId);
|
||||
keyStoreParameters.setName(testName.getMethodName());
|
||||
keyStoreParameters.setType("JCEKS");
|
||||
keyStoreParameters.setProvider("SunJCE");
|
||||
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-2.jks");
|
||||
// use metadata file from keystore with one key
|
||||
keyStoreParameters.setKeyMetaDataFileLocation("classpath:keystore-tests/ks1-metadata.properties");
|
||||
|
||||
System.setProperty(keyStoreId + "." + "password", "ksPwd2");
|
||||
System.setProperty(keyStoreId + "." + "aliases", alias1 + "," + alias2);
|
||||
System.setProperty(keyStoreId + "." + alias1 + "." + "password", "aliasPwd1");
|
||||
System.setProperty(keyStoreId + "." + alias2 + "." + "password", "aliasPwd2");
|
||||
|
||||
try
|
||||
{
|
||||
new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
|
||||
}
|
||||
finally
|
||||
{
|
||||
System.clearProperty(keyStoreId + "." + "password");
|
||||
System.clearProperty(keyStoreId + "." + "aliases");
|
||||
System.clearProperty(keyStoreId + "." + alias1 + "." + "password");
|
||||
System.clearProperty(keyStoreId + "." + alias2 + "." + "password");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Test(expected = AlfrescoRuntimeException.class)
|
||||
public void testValidateKeysWrongAliasMetadataFile() throws Exception
|
||||
{
|
||||
String alias1 = "mykey1";
|
||||
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setName(testName.getMethodName());
|
||||
keyStoreParameters.setType("JCEKS");
|
||||
keyStoreParameters.setProvider("SunJCE");
|
||||
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-1.jks");
|
||||
keyStoreParameters.setKeyMetaDataFileLocation("classpath:keystore-tests/wrong-alias-metadata.properties");
|
||||
|
||||
AlfrescoKeyStoreImpl alfrescoKeyStore = new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
|
||||
alfrescoKeyStore.setKeysToValidate(Collections.singleton(alias1));
|
||||
alfrescoKeyStore.setValidateKeyChanges(true);
|
||||
alfrescoKeyStore.setEncryptionKeysRegistry(encryptionKeysRegistry);
|
||||
alfrescoKeyStore.validateKeys();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEmptyKeysMetadataFile()
|
||||
{
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setName(testName.getMethodName());
|
||||
keyStoreParameters.setType("JCEKS");
|
||||
keyStoreParameters.setProvider("SunJCE");
|
||||
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-1.jks");
|
||||
keyStoreParameters.setKeyMetaDataFileLocation("classpath:keystore-tests/empty-alias-metadata.properties");
|
||||
|
||||
new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
|
||||
}
|
||||
|
||||
@Test(expected = AlfrescoRuntimeException.class)
|
||||
public void testWrongKeystorePasswordMetadataFile()
|
||||
{
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setName(testName.getMethodName());
|
||||
keyStoreParameters.setType("JCEKS");
|
||||
keyStoreParameters.setProvider("SunJCE");
|
||||
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-1.jks");
|
||||
keyStoreParameters.setKeyMetaDataFileLocation("classpath:keystore-tests/wrong-keystore-password-metadata.properties");
|
||||
|
||||
new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
|
||||
}
|
||||
|
||||
@Test(expected = AlfrescoRuntimeException.class)
|
||||
public void testWrongKeyPasswordMetadataFile()
|
||||
{
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setName(testName.getMethodName());
|
||||
keyStoreParameters.setType("JCEKS");
|
||||
keyStoreParameters.setProvider("SunJCE");
|
||||
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-1.jks");
|
||||
keyStoreParameters.setKeyMetaDataFileLocation("classpath:keystore-tests/wrong-key-password-metadata.properties");
|
||||
|
||||
new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
|
||||
}
|
||||
|
||||
@Test(expected = AlfrescoRuntimeException.class)
|
||||
public void testValidateKeysWrongAliasSysProps() throws Exception
|
||||
{
|
||||
String keyStoreId = testName.getMethodName() + "-keystore";
|
||||
String alias1 = "mykey1";
|
||||
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setId(keyStoreId);
|
||||
keyStoreParameters.setName(testName.getMethodName());
|
||||
keyStoreParameters.setType("JCEKS");
|
||||
keyStoreParameters.setProvider("SunJCE");
|
||||
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-1.jks");
|
||||
|
||||
System.setProperty(keyStoreId + "." + "aliases", "wrong-alias,another-wrong-alias");
|
||||
System.setProperty(keyStoreId + "." + "password", "ksPwd1");
|
||||
System.setProperty(keyStoreId + "." + alias1 + "." + "password", "aliasPwd1");
|
||||
|
||||
try
|
||||
{
|
||||
AlfrescoKeyStoreImpl alfrescoKeyStore = new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
|
||||
alfrescoKeyStore.setValidateKeyChanges(true);
|
||||
alfrescoKeyStore.setKeysToValidate(Collections.singleton(alias1));
|
||||
alfrescoKeyStore.setEncryptionKeysRegistry(encryptionKeysRegistry);
|
||||
alfrescoKeyStore.validateKeys();
|
||||
}
|
||||
finally
|
||||
{
|
||||
System.clearProperty(keyStoreId + "." + "aliases");
|
||||
System.clearProperty(keyStoreId + "." + "password");
|
||||
System.clearProperty(keyStoreId + "." + alias1 + "." + "password");
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEmptyKeysSysProps()
|
||||
{
|
||||
String keyStoreId = testName.getMethodName() + "-keystore";
|
||||
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setId(keyStoreId);
|
||||
keyStoreParameters.setName(testName.getMethodName());
|
||||
keyStoreParameters.setType("JCEKS");
|
||||
keyStoreParameters.setProvider("SunJCE");
|
||||
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-1.jks");
|
||||
|
||||
System.setProperty(keyStoreId + "." + "aliases", "empty-alias,another-empty-alias");
|
||||
System.setProperty(keyStoreId + "." + "password", "ksPwd1");
|
||||
|
||||
try
|
||||
{
|
||||
new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
|
||||
}
|
||||
finally
|
||||
{
|
||||
System.clearProperty(keyStoreId + "." + "aliases");
|
||||
System.clearProperty(keyStoreId + "." + "password");
|
||||
}
|
||||
}
|
||||
|
||||
@Test(expected = AlfrescoRuntimeException.class)
|
||||
public void testWrongKeystorePasswordSysProps()
|
||||
{
|
||||
String keyStoreId = testName.getMethodName() + "-keystore";
|
||||
String alias1 = "mykey1";
|
||||
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setId(keyStoreId);
|
||||
keyStoreParameters.setName(testName.getMethodName());
|
||||
keyStoreParameters.setType("JCEKS");
|
||||
keyStoreParameters.setProvider("SunJCE");
|
||||
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-1.jks");
|
||||
|
||||
System.setProperty(keyStoreId + "." + "aliases", alias1);
|
||||
System.setProperty(keyStoreId + "." + "password", "wrong-password");
|
||||
System.setProperty(keyStoreId + "." + alias1 + "." + "password", "aliasPwd1");
|
||||
|
||||
try
|
||||
{
|
||||
new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
|
||||
}
|
||||
finally
|
||||
{
|
||||
System.clearProperty(keyStoreId + "." + "aliases");
|
||||
System.clearProperty(keyStoreId + "." + "password");
|
||||
System.clearProperty(keyStoreId + "." + alias1 + "." + "password");
|
||||
}
|
||||
}
|
||||
|
||||
@Test(expected = AlfrescoRuntimeException.class)
|
||||
public void testWrongKeyPasswordSysProps()
|
||||
{
|
||||
String keyStoreId = testName.getMethodName() + "-keystore";
|
||||
String alias1 = "mykey1";
|
||||
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setId(keyStoreId);
|
||||
keyStoreParameters.setName(testName.getMethodName());
|
||||
keyStoreParameters.setType("JCEKS");
|
||||
keyStoreParameters.setProvider("SunJCE");
|
||||
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-1.jks");
|
||||
|
||||
System.setProperty(keyStoreId + "." + "aliases", alias1);
|
||||
System.setProperty(keyStoreId + "." + "password", "ksPwd1");
|
||||
System.setProperty(keyStoreId + "." + alias1 + "." + "password", "wrong-key-password");
|
||||
|
||||
try
|
||||
{
|
||||
new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
|
||||
}
|
||||
finally
|
||||
{
|
||||
System.clearProperty(keyStoreId + "." + "aliases");
|
||||
System.clearProperty(keyStoreId + "." + "password");
|
||||
System.clearProperty(keyStoreId + "." + alias1 + "." + "password");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* No exception is expected. An empty keystore can be created.
|
||||
*/
|
||||
@Test
|
||||
public void testConfigEmptyKeystore()
|
||||
{
|
||||
String keyStoreId = testName.getMethodName() + "-keystore";
|
||||
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setId(keyStoreId);
|
||||
keyStoreParameters.setName(testName.getMethodName());
|
||||
keyStoreParameters.setType("JCEKS");
|
||||
keyStoreParameters.setProvider("SunJCE");
|
||||
keyStoreParameters.setLocation("classpath:non-existing-path/some-keystore.jks");
|
||||
|
||||
new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
|
||||
}
|
||||
|
||||
@Test(expected = AlfrescoRuntimeException.class)
|
||||
public void testValidateKeysEmptyAliasSysProps() throws Exception
|
||||
{
|
||||
String keyStoreId = testName.getMethodName() + "-keystore";
|
||||
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setId(keyStoreId);
|
||||
keyStoreParameters.setName(testName.getMethodName());
|
||||
keyStoreParameters.setType("JCEKS");
|
||||
keyStoreParameters.setProvider("SunJCE");
|
||||
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-1.jks");
|
||||
|
||||
System.setProperty(keyStoreId + "." + "password", "ksPwd1");
|
||||
|
||||
try
|
||||
{
|
||||
AlfrescoKeyStoreImpl alfrescoKeyStore = new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
|
||||
alfrescoKeyStore.setValidateKeyChanges(true);
|
||||
alfrescoKeyStore.setKeysToValidate(Collections.singleton("non-existing-alias"));
|
||||
alfrescoKeyStore.setEncryptionKeysRegistry(encryptionKeysRegistry);
|
||||
alfrescoKeyStore.validateKeys();
|
||||
}
|
||||
finally
|
||||
{
|
||||
System.clearProperty(keyStoreId + "." + "password");
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2020 Alfresco Software Limited.
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
@@ -74,22 +74,6 @@ public class VersionNumberTest extends TestCase
|
||||
{
|
||||
// OK
|
||||
}
|
||||
try
|
||||
{
|
||||
new VersionNumber("1.2.3-M4");
|
||||
fail("Should not have created an invalid version");
|
||||
} catch (Exception exception)
|
||||
{
|
||||
// OK
|
||||
}
|
||||
try
|
||||
{
|
||||
new VersionNumber("1.2.3-A4");
|
||||
fail("Should not have created an invalid version");
|
||||
} catch (Exception exception)
|
||||
{
|
||||
// OK
|
||||
}
|
||||
}
|
||||
|
||||
public void testEquals()
|
||||
|
@@ -1,28 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2020 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.alfresco.util.testing.category;
|
||||
|
||||
/**
|
||||
* Category marker for tests that fail very frequently so are excluded from the build. Only run by developers while
|
||||
* working on a specific feature/class. An issue should be raised to identify and fix the reason the test fails.
|
||||
* @see IntermittentlyFailingTests for tests that fail intermittently but not that frequently
|
||||
*/
|
||||
public interface FrequentlyFailingTests extends NonBuildTests
|
||||
{
|
||||
}
|
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2020 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.alfresco.util.testing.category;
|
||||
|
||||
/**
|
||||
* Category marker for tests that intermittently fail, but not that frequently. Still included in the build. If the
|
||||
* instability increases or we have time to investigate, an issue should be raised to investigate and possibly
|
||||
* be switch to {@link FrequentlyFailingTests}. Use by developers to aid in working out if the build job should just be
|
||||
* retried.
|
||||
*/
|
||||
public interface IntermittentlyFailingTests
|
||||
{
|
||||
}
|
@@ -1,2 +0,0 @@
|
||||
aliases=empty-alias
|
||||
keystore.password=ksPwd1
|
Binary file not shown.
Binary file not shown.
@@ -1,3 +0,0 @@
|
||||
aliases=mykey1
|
||||
keystore.password=ksPwd1
|
||||
mykey1.password=aliasPwd1
|
@@ -1,24 +0,0 @@
|
||||
The keystores contained in this folder are used by tests.
|
||||
|
||||
==================
|
||||
== ks-test-1.ks ==
|
||||
==================
|
||||
|
||||
Keystore password: ksPwd1
|
||||
Keystore type: JCEKS
|
||||
Keystore provider: SunJCE
|
||||
|
||||
Your keystore contains 1 entry
|
||||
mykey1: aliasPwd1
|
||||
|
||||
==================
|
||||
== ks-test-2.ks ==
|
||||
==================
|
||||
|
||||
Keystore password: ksPwd2
|
||||
Keystore type: JCEKS
|
||||
Keystore provider: SunJCE
|
||||
|
||||
Your keystore contains 2 entries
|
||||
mykey1: aliasPwd1
|
||||
mykey2: aliasPwd2
|
@@ -1,3 +0,0 @@
|
||||
aliases=non-existing-alias
|
||||
keystore.password=ksPwd1
|
||||
mykey1.password=aliasPwd1
|
@@ -1,3 +0,0 @@
|
||||
aliases=mykey1
|
||||
keystore.password=ksPwd1
|
||||
mykey1.password=wrong-key-password
|
@@ -1,3 +0,0 @@
|
||||
aliases=mykey1
|
||||
keystore.password=wrong-password
|
||||
mykey1.password=aliasPwd1
|
@@ -7,11 +7,11 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>9.1</version>
|
||||
<version>7.199.314</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<!-- Files to exclude from SonarQube analysis -->
|
||||
<!-- Files to exclude from SonarQube analysis -->
|
||||
<sonar.exclusions>
|
||||
source/java/org/alfresco/repo/search/impl/parsers/CMIS*er.java,
|
||||
source/java/org/alfresco/repo/search/impl/parsers/FTSParser.java,
|
||||
@@ -64,6 +64,7 @@
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.2.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
@@ -108,6 +109,13 @@
|
||||
</lifecycleMappingMetadata>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-release-plugin</artifactId>
|
||||
<configuration>
|
||||
<autoVersionSubmodules>true</autoVersionSubmodules>
|
||||
<tagNameFormat>@{project.version}</tagNameFormat>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
@@ -125,30 +133,12 @@
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>3.0.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Jakarta... -->
|
||||
<dependency>
|
||||
<groupId>jakarta.activation</groupId>
|
||||
<artifactId>jakarta.activation-api</artifactId>
|
||||
</dependency>
|
||||
<!-- REPO-5047 - Replaces com.sun.activation:javax.activation -->
|
||||
<dependency>
|
||||
<groupId>com.sun.activation</groupId>
|
||||
<artifactId>jakarta.activation</artifactId>
|
||||
</dependency>
|
||||
<!-- REPO-5047 - Replaces javax.annotation:javax.annotation-api -->
|
||||
<dependency>
|
||||
<groupId>jakarta.annotation</groupId>
|
||||
<artifactId>jakarta.annotation-api</artifactId>
|
||||
</dependency>
|
||||
<!-- REPO-5047 - Replaces org.apache.geronimo.specs:geronimo-ws-metadata_2.0_spec -->
|
||||
<dependency>
|
||||
<groupId>jakarta.jws</groupId>
|
||||
<artifactId>jakarta.jws-api</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--
|
||||
| compile dependencies
|
||||
-->
|
||||
<dependency>
|
||||
<groupId>org.jibx</groupId>
|
||||
<artifactId>jibx-run</artifactId>
|
||||
@@ -156,71 +146,36 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-annotations</artifactId>
|
||||
</dependency>
|
||||
<artifactId>jackson-annotations</artifactId>
|
||||
<version>2.10.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.antlr</groupId>
|
||||
<artifactId>antlr</artifactId>
|
||||
<version>${dependency.antlr.version}</version>
|
||||
<version>3.5.2</version>
|
||||
</dependency>
|
||||
<!-- REPO-5047 - Replaces org.codehaus.woodstox:woodstox-core-asl -->
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.woodstox</groupId>
|
||||
<artifactId>woodstox-core</artifactId>
|
||||
<version>6.2.4</version>
|
||||
</dependency>
|
||||
|
||||
<!-- the cxf libs were updated, see dependencyManagement section -->
|
||||
<dependency>
|
||||
<groupId>org.apache.chemistry.opencmis</groupId>
|
||||
<artifactId>chemistry-opencmis-commons-impl</artifactId>
|
||||
<version>${dependency.opencmis.version}</version>
|
||||
<version>1.0.0</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>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.chemistry.opencmis</groupId>
|
||||
<artifactId>chemistry-opencmis-server-bindings</artifactId>
|
||||
<version>${dependency.opencmis.version}</version>
|
||||
<version>1.0.0</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:
|
||||
@@ -239,6 +194,7 @@
|
||||
<dependency>
|
||||
<groupId>xerces</groupId>
|
||||
<artifactId>xercesImpl</artifactId>
|
||||
<version>2.12.0-alfresco-patched-20191004</version>
|
||||
</dependency>
|
||||
<!-- Tika -->
|
||||
<dependency>
|
||||
@@ -263,26 +219,6 @@
|
||||
<groupId>asm</groupId>
|
||||
<artifactId>asm</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>
|
||||
|
||||
@@ -290,16 +226,19 @@
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.13</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.antlr</groupId>
|
||||
<artifactId>gunit</artifactId>
|
||||
<scope>test</scope>
|
||||
<version>3.5.2</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<version>3.2.4</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
@@ -28,8 +28,8 @@ package org.alfresco.opencmis.dictionary;
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
|
||||
import org.alfresco.repo.search.adaptor.LuceneFunction;
|
||||
import org.alfresco.repo.search.adaptor.QueryParserAdaptor;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneFunction;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneQueryParserAdaptor;
|
||||
import org.alfresco.repo.search.impl.querymodel.PredicateMode;
|
||||
|
||||
|
||||
@@ -45,14 +45,14 @@ public interface CMISPropertyLuceneBuilder
|
||||
* @return the query - may be null if no query is required
|
||||
* @throws E
|
||||
*/
|
||||
public <Q, S, E extends Throwable> Q buildLuceneEquality(QueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E;
|
||||
public <Q, S, E extends Throwable> Q buildLuceneEquality(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E;
|
||||
|
||||
/**
|
||||
* @param not Boolean
|
||||
* @return the query - may be null if no query is required
|
||||
* @throws E
|
||||
*/
|
||||
public <Q, S, E extends Throwable> Q buildLuceneExists(QueryParserAdaptor<Q, S, E> lqpa, Boolean not) throws E;
|
||||
public <Q, S, E extends Throwable> Q buildLuceneExists(LuceneQueryParserAdaptor<Q, S, E> lqpa, Boolean not) throws E;
|
||||
|
||||
/**
|
||||
* @param value Serializable
|
||||
@@ -61,7 +61,7 @@ public interface CMISPropertyLuceneBuilder
|
||||
* @return the query - may be null if no query is required
|
||||
* @throws E
|
||||
*/
|
||||
public <Q, S, E extends Throwable> Q buildLuceneGreaterThan(QueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E;
|
||||
public <Q, S, E extends Throwable> Q buildLuceneGreaterThan(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E;
|
||||
|
||||
/**
|
||||
* @param value Serializable
|
||||
@@ -70,7 +70,7 @@ public interface CMISPropertyLuceneBuilder
|
||||
* @return the query - may be null if no query is required
|
||||
* @throws E
|
||||
*/
|
||||
public <Q, S, E extends Throwable> Q buildLuceneGreaterThanOrEquals(QueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E;
|
||||
public <Q, S, E extends Throwable> Q buildLuceneGreaterThanOrEquals(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E;
|
||||
|
||||
/**
|
||||
* @param not Boolean
|
||||
@@ -78,7 +78,7 @@ public interface CMISPropertyLuceneBuilder
|
||||
* @return the query - may be null if no query is required
|
||||
* @throws E
|
||||
*/
|
||||
public <Q, S, E extends Throwable> Q buildLuceneIn(QueryParserAdaptor<Q, S, E> lqpa, Collection<Serializable> values, Boolean not, PredicateMode mode) throws E;
|
||||
public <Q, S, E extends Throwable> Q buildLuceneIn(LuceneQueryParserAdaptor<Q, S, E> lqpa, Collection<Serializable> values, Boolean not, PredicateMode mode) throws E;
|
||||
|
||||
/**
|
||||
* @param value PredicateMode
|
||||
@@ -87,7 +87,7 @@ public interface CMISPropertyLuceneBuilder
|
||||
* @return the query - may be null if no query is required
|
||||
* @throws E
|
||||
*/
|
||||
public <Q, S, E extends Throwable> Q buildLuceneInequality(QueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E;
|
||||
public <Q, S, E extends Throwable> Q buildLuceneInequality(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E;
|
||||
|
||||
/**
|
||||
* @param value Serializable
|
||||
@@ -96,7 +96,7 @@ public interface CMISPropertyLuceneBuilder
|
||||
* @return the query - may be null if no query is required
|
||||
* @throws E
|
||||
*/
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLessThan(QueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E;
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLessThan(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E;
|
||||
|
||||
/**
|
||||
* @param value Serializable
|
||||
@@ -105,7 +105,7 @@ public interface CMISPropertyLuceneBuilder
|
||||
* @return the query - may be null if no query is required
|
||||
* @throws E
|
||||
*/
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLessThanOrEquals(QueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E;
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLessThanOrEquals(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E;
|
||||
|
||||
/**
|
||||
* @param value Serializable
|
||||
@@ -113,14 +113,14 @@ public interface CMISPropertyLuceneBuilder
|
||||
* @return the query - may be null if no query is required
|
||||
* @throws E
|
||||
*/
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLike(QueryParserAdaptor<Q, S, E> lqpa, Serializable value, Boolean not) throws E;
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLike(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value, Boolean not) throws E;
|
||||
|
||||
/**
|
||||
* @param lqpa TODO
|
||||
* @return the sort field
|
||||
* @throws E
|
||||
*/
|
||||
public <Q, S, E extends Throwable> String getLuceneSortField(QueryParserAdaptor<Q, S, E> lqpa) throws E;
|
||||
public <Q, S, E extends Throwable> String getLuceneSortField(LuceneQueryParserAdaptor<Q, S, E> lqpa) throws E;
|
||||
|
||||
/**
|
||||
* @return the field name
|
||||
|
@@ -27,9 +27,9 @@ package org.alfresco.opencmis.mapping;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.alfresco.repo.search.adaptor.AnalysisMode;
|
||||
import org.alfresco.repo.search.adaptor.LuceneFunction;
|
||||
import org.alfresco.repo.search.adaptor.QueryParserAdaptor;
|
||||
import org.alfresco.repo.search.adaptor.lucene.AnalysisMode;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneFunction;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneQueryParserAdaptor;
|
||||
import org.alfresco.repo.search.impl.querymodel.PredicateMode;
|
||||
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
@@ -66,13 +66,13 @@ public abstract class AbstractSimpleLuceneBuilder extends BaseLuceneBuilder
|
||||
protected abstract QName getQNameForExists();
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> Q buildLuceneEquality(QueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneEquality(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
{
|
||||
return lqpa.getFieldQuery(getLuceneFieldName(), getValueAsString(value), AnalysisMode.IDENTIFIER, luceneFunction);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> Q buildLuceneExists(QueryParserAdaptor<Q, S, E> lqpa, Boolean not) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneExists(LuceneQueryParserAdaptor<Q, S, E> lqpa, Boolean not) throws E
|
||||
{
|
||||
if (not)
|
||||
{
|
||||
@@ -85,7 +85,7 @@ public abstract class AbstractSimpleLuceneBuilder extends BaseLuceneBuilder
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> Q buildLuceneGreaterThan(QueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneGreaterThan(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
{
|
||||
String field = getLuceneFieldName();
|
||||
String stringValue = getValueAsString(value);
|
||||
@@ -93,7 +93,7 @@ public abstract class AbstractSimpleLuceneBuilder extends BaseLuceneBuilder
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> Q buildLuceneGreaterThanOrEquals(QueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneGreaterThanOrEquals(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
{
|
||||
String field = getLuceneFieldName();
|
||||
String stringValue = getValueAsString(value);
|
||||
@@ -101,7 +101,7 @@ public abstract class AbstractSimpleLuceneBuilder extends BaseLuceneBuilder
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLessThan(QueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLessThan(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
{
|
||||
String field = getLuceneFieldName();
|
||||
String stringValue = getValueAsString(value);
|
||||
@@ -109,7 +109,7 @@ public abstract class AbstractSimpleLuceneBuilder extends BaseLuceneBuilder
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLessThanOrEquals(QueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLessThanOrEquals(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
{
|
||||
String field = getLuceneFieldName();
|
||||
String stringValue = getValueAsString(value);
|
||||
@@ -117,7 +117,7 @@ public abstract class AbstractSimpleLuceneBuilder extends BaseLuceneBuilder
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLike(QueryParserAdaptor<Q, S, E> lqpa, Serializable value, Boolean not) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLike(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value, Boolean not) throws E
|
||||
{
|
||||
String field = getLuceneFieldName();
|
||||
String stringValue = getValueAsString(value);
|
||||
@@ -131,7 +131,7 @@ public abstract class AbstractSimpleLuceneBuilder extends BaseLuceneBuilder
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> String getLuceneSortField(QueryParserAdaptor<Q, S, E> lqpa) throws E
|
||||
public <Q, S, E extends Throwable> String getLuceneSortField(LuceneQueryParserAdaptor<Q, S, E> lqpa) throws E
|
||||
{
|
||||
return getLuceneFieldName();
|
||||
}
|
||||
|
@@ -29,9 +29,9 @@ import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
|
||||
import org.alfresco.opencmis.dictionary.CMISPropertyLuceneBuilder;
|
||||
import org.alfresco.repo.search.adaptor.LuceneFunction;
|
||||
import org.alfresco.repo.search.adaptor.QueryParserAdaptor;
|
||||
import org.alfresco.repo.search.adaptor.QueryParserExpressionAdaptor;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneFunction;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneQueryParserAdaptor;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneQueryParserExpressionAdaptor;
|
||||
import org.alfresco.repo.search.impl.querymodel.PredicateMode;
|
||||
|
||||
/**
|
||||
@@ -50,33 +50,33 @@ public class BaseLuceneBuilder implements CMISPropertyLuceneBuilder
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> Q buildLuceneEquality(QueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneEquality(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> Q buildLuceneExists(QueryParserAdaptor<Q, S, E> lqpa, Boolean not) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneExists(LuceneQueryParserAdaptor<Q, S, E> lqpa, Boolean not) throws E
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> Q buildLuceneGreaterThan(QueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneGreaterThan(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> Q buildLuceneGreaterThanOrEquals(QueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneGreaterThanOrEquals(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> Q buildLuceneIn(QueryParserAdaptor<Q, S, E> lqpa, Collection<Serializable> values, Boolean not, PredicateMode mode) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneIn(LuceneQueryParserAdaptor<Q, S, E> lqpa, Collection<Serializable> values, Boolean not, PredicateMode mode) throws E
|
||||
{
|
||||
QueryParserExpressionAdaptor<Q, E> expressionAdaptor = lqpa.getExpressionAdaptor();
|
||||
LuceneQueryParserExpressionAdaptor<Q, E> expressionAdaptor = lqpa.getExpressionAdaptor();
|
||||
for(Serializable value : values)
|
||||
{
|
||||
expressionAdaptor.addOptional(buildLuceneEquality(lqpa, value, mode, LuceneFunction.FIELD));
|
||||
@@ -92,25 +92,25 @@ public class BaseLuceneBuilder implements CMISPropertyLuceneBuilder
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> Q buildLuceneInequality(QueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneInequality(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
{
|
||||
return lqpa.getNegatedQuery(buildLuceneEquality(lqpa, value, mode, luceneFunction));
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLessThan(QueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLessThan(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLessThanOrEquals(QueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLessThanOrEquals(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLike(QueryParserAdaptor<Q, S, E> lqpa, Serializable value, Boolean not) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLike(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value, Boolean not) throws E
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
@@ -122,7 +122,7 @@ public class BaseLuceneBuilder implements CMISPropertyLuceneBuilder
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> String getLuceneSortField(QueryParserAdaptor<Q, S, E> lqpa) throws E
|
||||
public <Q, S, E extends Throwable> String getLuceneSortField(LuceneQueryParserAdaptor<Q, S, E> lqpa) throws E
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
@@ -29,9 +29,9 @@ import java.io.Serializable;
|
||||
|
||||
import org.alfresco.opencmis.dictionary.CMISDictionaryService;
|
||||
import org.alfresco.opencmis.dictionary.TypeDefinitionWrapper;
|
||||
import org.alfresco.repo.search.adaptor.AnalysisMode;
|
||||
import org.alfresco.repo.search.adaptor.LuceneFunction;
|
||||
import org.alfresco.repo.search.adaptor.QueryParserAdaptor;
|
||||
import org.alfresco.repo.search.adaptor.lucene.AnalysisMode;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneFunction;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneQueryParserAdaptor;
|
||||
import org.alfresco.repo.search.impl.querymodel.PredicateMode;
|
||||
import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter;
|
||||
import org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException;
|
||||
@@ -56,13 +56,13 @@ public class BaseTypeIdLuceneBuilder extends BaseLuceneBuilder
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> Q buildLuceneEquality(QueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneEquality(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
{
|
||||
return lqpa.getFieldQuery("TYPE", getType(getValueAsString(value)), AnalysisMode.IDENTIFIER, luceneFunction);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> Q buildLuceneExists(QueryParserAdaptor<Q, S, E> lqpa, Boolean not) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneExists(LuceneQueryParserAdaptor<Q, S, E> lqpa, Boolean not) throws E
|
||||
{
|
||||
if (not)
|
||||
{
|
||||
|
@@ -27,7 +27,7 @@ package org.alfresco.opencmis.mapping;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.alfresco.repo.search.adaptor.QueryParserAdaptor;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneQueryParserAdaptor;
|
||||
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
import org.alfresco.service.cmr.dictionary.PropertyDefinition;
|
||||
@@ -52,7 +52,7 @@ public class DirectLuceneBuilder extends AbstractSimpleLuceneBuilder
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> String getLuceneSortField(QueryParserAdaptor<Q, S, E> lqpa) throws E
|
||||
public <Q, S, E extends Throwable> String getLuceneSortField(LuceneQueryParserAdaptor<Q, S, E> lqpa) throws E
|
||||
{
|
||||
String field = getLuceneFieldName();
|
||||
// need to find the real field to use
|
||||
|
@@ -30,8 +30,8 @@ import java.util.Collection;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.alfresco.repo.search.adaptor.LuceneFunction;
|
||||
import org.alfresco.repo.search.adaptor.QueryParserAdaptor;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneFunction;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneQueryParserAdaptor;
|
||||
import org.alfresco.repo.search.impl.querymodel.PredicateMode;
|
||||
import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter;
|
||||
import org.alfresco.util.EqualsHelper;
|
||||
@@ -58,7 +58,7 @@ public class FixedValueLuceneBuilder extends BaseLuceneBuilder
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> Q buildLuceneEquality(QueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneEquality(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
{
|
||||
if (EqualsHelper.nullSafeEquals(value, value))
|
||||
{
|
||||
@@ -71,7 +71,7 @@ public class FixedValueLuceneBuilder extends BaseLuceneBuilder
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> Q buildLuceneExists(QueryParserAdaptor<Q, S, E> lqpa, Boolean not) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneExists(LuceneQueryParserAdaptor<Q, S, E> lqpa, Boolean not) throws E
|
||||
{
|
||||
if (not)
|
||||
{
|
||||
@@ -100,7 +100,7 @@ public class FixedValueLuceneBuilder extends BaseLuceneBuilder
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <Q, S, E extends Throwable> Q buildLuceneGreaterThan(QueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneGreaterThan(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
{
|
||||
if (value instanceof Comparable)
|
||||
{
|
||||
@@ -122,7 +122,7 @@ public class FixedValueLuceneBuilder extends BaseLuceneBuilder
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <Q, S, E extends Throwable> Q buildLuceneGreaterThanOrEquals(QueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneGreaterThanOrEquals(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
{
|
||||
if (value instanceof Comparable)
|
||||
{
|
||||
@@ -143,7 +143,7 @@ public class FixedValueLuceneBuilder extends BaseLuceneBuilder
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> Q buildLuceneIn(QueryParserAdaptor<Q, S, E> lqpa, Collection<Serializable> values, Boolean not, PredicateMode mode) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneIn(LuceneQueryParserAdaptor<Q, S, E> lqpa, Collection<Serializable> values, Boolean not, PredicateMode mode) throws E
|
||||
{
|
||||
boolean in = false;
|
||||
for (Serializable value : values)
|
||||
@@ -166,7 +166,7 @@ public class FixedValueLuceneBuilder extends BaseLuceneBuilder
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> Q buildLuceneInequality(QueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneInequality(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
{
|
||||
if (!EqualsHelper.nullSafeEquals(value, value))
|
||||
{
|
||||
@@ -180,7 +180,7 @@ public class FixedValueLuceneBuilder extends BaseLuceneBuilder
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLessThan(QueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLessThan(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
{
|
||||
if (value instanceof Comparable)
|
||||
{
|
||||
@@ -201,7 +201,7 @@ public class FixedValueLuceneBuilder extends BaseLuceneBuilder
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLessThanOrEquals(QueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLessThanOrEquals(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
{
|
||||
if (value instanceof Comparable)
|
||||
{
|
||||
@@ -222,7 +222,7 @@ public class FixedValueLuceneBuilder extends BaseLuceneBuilder
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLike(QueryParserAdaptor<Q, S, E> lqpa, Serializable value, Boolean not) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLike(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value, Boolean not) throws E
|
||||
{
|
||||
if (value != null)
|
||||
{
|
||||
@@ -255,7 +255,7 @@ public class FixedValueLuceneBuilder extends BaseLuceneBuilder
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> String getLuceneSortField(QueryParserAdaptor<Q, S, E> lqpa)
|
||||
public <Q, S, E extends Throwable> String getLuceneSortField(LuceneQueryParserAdaptor<Q, S, E> lqpa)
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
@@ -28,9 +28,9 @@ package org.alfresco.opencmis.mapping;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.alfresco.repo.search.adaptor.AnalysisMode;
|
||||
import org.alfresco.repo.search.adaptor.LuceneFunction;
|
||||
import org.alfresco.repo.search.adaptor.QueryParserAdaptor;
|
||||
import org.alfresco.repo.search.adaptor.lucene.AnalysisMode;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneFunction;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneQueryParserAdaptor;
|
||||
import org.alfresco.repo.search.impl.querymodel.PredicateMode;
|
||||
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
@@ -66,7 +66,7 @@ public class ObjectIdLuceneBuilder extends BaseLuceneBuilder
|
||||
return "ID";
|
||||
}
|
||||
|
||||
private <Q, S, E extends Throwable> StoreRef getStore(QueryParserAdaptor<Q, S, E> lqpa)
|
||||
private <Q, S, E extends Throwable> StoreRef getStore(LuceneQueryParserAdaptor<Q, S, E> lqpa)
|
||||
{
|
||||
ArrayList<StoreRef> stores = lqpa.getSearchParameters().getStores();
|
||||
if(stores.size() < 1)
|
||||
@@ -77,7 +77,7 @@ public class ObjectIdLuceneBuilder extends BaseLuceneBuilder
|
||||
return stores.get(0);
|
||||
}
|
||||
|
||||
private <Q, S, E extends Throwable> String getValueAsString(QueryParserAdaptor<Q, S, E> lqpa, Serializable value)
|
||||
private <Q, S, E extends Throwable> String getValueAsString(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value)
|
||||
{
|
||||
String nodeRefStr = null;
|
||||
if(!NodeRef.isNodeRef((String)value))
|
||||
@@ -97,7 +97,7 @@ public class ObjectIdLuceneBuilder extends BaseLuceneBuilder
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> Q buildLuceneEquality(QueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneEquality(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
{
|
||||
String field = getLuceneFieldName();
|
||||
String stringValue = getValueAsString(lqpa, value);
|
||||
@@ -105,7 +105,7 @@ public class ObjectIdLuceneBuilder extends BaseLuceneBuilder
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> Q buildLuceneExists(QueryParserAdaptor<Q, S, E> lqpa, Boolean not) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneExists(LuceneQueryParserAdaptor<Q, S, E> lqpa, Boolean not) throws E
|
||||
{
|
||||
if (not)
|
||||
{
|
||||
@@ -117,36 +117,36 @@ public class ObjectIdLuceneBuilder extends BaseLuceneBuilder
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> Q buildLuceneGreaterThan(QueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode,
|
||||
LuceneFunction luceneFunction) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneGreaterThan(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode,
|
||||
LuceneFunction luceneFunction) throws E
|
||||
{
|
||||
throw new CmisInvalidArgumentException("Property " + PropertyIds.OBJECT_ID + " can not be used in a 'greater than' comparison");
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> Q buildLuceneGreaterThanOrEquals(QueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode,
|
||||
LuceneFunction luceneFunction) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneGreaterThanOrEquals(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode,
|
||||
LuceneFunction luceneFunction) throws E
|
||||
{
|
||||
throw new CmisInvalidArgumentException("Property " + PropertyIds.OBJECT_ID
|
||||
+ " can not be used in a 'greater than or equals' comparison");
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLessThan(QueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode,
|
||||
LuceneFunction luceneFunction) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLessThan(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode,
|
||||
LuceneFunction luceneFunction) throws E
|
||||
{
|
||||
throw new CmisInvalidArgumentException("Property " + PropertyIds.OBJECT_ID + " can not be used in a 'less than' comparison");
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLessThanOrEquals(QueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode,
|
||||
LuceneFunction luceneFunction) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLessThanOrEquals(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode,
|
||||
LuceneFunction luceneFunction) throws E
|
||||
{
|
||||
throw new CmisInvalidArgumentException("Property " + PropertyIds.OBJECT_ID + " can not be used in a 'less than or equals' comparison");
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLike(QueryParserAdaptor<Q, S, E> lqpa, Serializable value, Boolean not) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLike(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value, Boolean not) throws E
|
||||
{
|
||||
String field = getLuceneFieldName();
|
||||
String stringValue = getValueAsString(lqpa, value);
|
||||
@@ -160,7 +160,7 @@ public class ObjectIdLuceneBuilder extends BaseLuceneBuilder
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> String getLuceneSortField(QueryParserAdaptor<Q, S, E> lqpa)
|
||||
public <Q, S, E extends Throwable> String getLuceneSortField(LuceneQueryParserAdaptor<Q, S, E> lqpa)
|
||||
{
|
||||
return getLuceneFieldName();
|
||||
}
|
||||
|
@@ -29,9 +29,9 @@ import java.io.Serializable;
|
||||
|
||||
import org.alfresco.opencmis.dictionary.CMISDictionaryService;
|
||||
import org.alfresco.opencmis.dictionary.TypeDefinitionWrapper;
|
||||
import org.alfresco.repo.search.adaptor.AnalysisMode;
|
||||
import org.alfresco.repo.search.adaptor.LuceneFunction;
|
||||
import org.alfresco.repo.search.adaptor.QueryParserAdaptor;
|
||||
import org.alfresco.repo.search.adaptor.lucene.AnalysisMode;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneFunction;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneQueryParserAdaptor;
|
||||
import org.alfresco.repo.search.impl.querymodel.PredicateMode;
|
||||
import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter;
|
||||
import org.apache.chemistry.opencmis.commons.PropertyIds;
|
||||
@@ -72,8 +72,8 @@ public class ObjectTypeIdLuceneBuilder extends BaseLuceneBuilder
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> Q buildLuceneEquality(QueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode,
|
||||
LuceneFunction luceneFunction) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneEquality(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode,
|
||||
LuceneFunction luceneFunction) throws E
|
||||
{
|
||||
String field = getLuceneFieldName();
|
||||
String stringValue = getValueAsString(value);
|
||||
@@ -83,7 +83,7 @@ public class ObjectTypeIdLuceneBuilder extends BaseLuceneBuilder
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> Q buildLuceneExists(QueryParserAdaptor<Q, S, E> lqpa, Boolean not) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneExists(LuceneQueryParserAdaptor<Q, S, E> lqpa, Boolean not) throws E
|
||||
{
|
||||
if (not)
|
||||
{
|
||||
@@ -95,43 +95,43 @@ public class ObjectTypeIdLuceneBuilder extends BaseLuceneBuilder
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> Q buildLuceneGreaterThan(QueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode,
|
||||
LuceneFunction luceneFunction) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneGreaterThan(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode,
|
||||
LuceneFunction luceneFunction) throws E
|
||||
{
|
||||
throw new CmisInvalidArgumentException("Property " + PropertyIds.OBJECT_TYPE_ID + " can not be used in a 'greater than' comparison");
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> Q buildLuceneGreaterThanOrEquals(QueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode,
|
||||
LuceneFunction luceneFunction) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneGreaterThanOrEquals(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode,
|
||||
LuceneFunction luceneFunction) throws E
|
||||
{
|
||||
throw new CmisInvalidArgumentException("Property " + PropertyIds.OBJECT_TYPE_ID
|
||||
+ " can not be used in a 'greater than or equals' comparison");
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> Q buildLuceneInequality(QueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode,
|
||||
LuceneFunction luceneFunction) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneInequality(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode,
|
||||
LuceneFunction luceneFunction) throws E
|
||||
{
|
||||
return lqpa.getNegatedQuery(buildLuceneEquality(lqpa, value, mode, luceneFunction));
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLessThan(QueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode,
|
||||
LuceneFunction luceneFunction) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLessThan(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode,
|
||||
LuceneFunction luceneFunction) throws E
|
||||
{
|
||||
throw new CmisInvalidArgumentException("Property " + PropertyIds.OBJECT_TYPE_ID + " can not be used in a 'less than' comparison");
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLessThanOrEquals(QueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode,
|
||||
LuceneFunction luceneFunction) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLessThanOrEquals(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode,
|
||||
LuceneFunction luceneFunction) throws E
|
||||
{
|
||||
throw new CmisInvalidArgumentException("Property " + PropertyIds.OBJECT_TYPE_ID + " can not be used in a 'less than or equals' comparison");
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLike(QueryParserAdaptor<Q, S, E> lqpa, Serializable value, Boolean not) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLike(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value, Boolean not) throws E
|
||||
{
|
||||
String field = getLuceneFieldName();
|
||||
String stringValue = getValueAsString(value);
|
||||
@@ -147,7 +147,7 @@ public class ObjectTypeIdLuceneBuilder extends BaseLuceneBuilder
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> String getLuceneSortField(QueryParserAdaptor<Q, S, E> lqpa)
|
||||
public <Q, S, E extends Throwable> String getLuceneSortField(LuceneQueryParserAdaptor<Q, S, E> lqpa)
|
||||
{
|
||||
return getLuceneFieldName();
|
||||
}
|
||||
|
@@ -28,9 +28,9 @@ package org.alfresco.opencmis.mapping;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.alfresco.repo.search.adaptor.AnalysisMode;
|
||||
import org.alfresco.repo.search.adaptor.LuceneFunction;
|
||||
import org.alfresco.repo.search.adaptor.QueryParserAdaptor;
|
||||
import org.alfresco.repo.search.adaptor.lucene.AnalysisMode;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneFunction;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneQueryParserAdaptor;
|
||||
import org.alfresco.repo.search.impl.querymodel.PredicateMode;
|
||||
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
@@ -60,7 +60,7 @@ public class ParentLuceneBuilder extends BaseLuceneBuilder
|
||||
this.dictionaryService = dictionaryService;
|
||||
}
|
||||
|
||||
private <Q, S, E extends Throwable> StoreRef getStore(QueryParserAdaptor<Q, S, E> lqpa)
|
||||
private <Q, S, E extends Throwable> StoreRef getStore(LuceneQueryParserAdaptor<Q, S, E> lqpa)
|
||||
{
|
||||
ArrayList<StoreRef> stores = lqpa.getSearchParameters().getStores();
|
||||
if(stores.size() < 1)
|
||||
@@ -77,7 +77,7 @@ public class ParentLuceneBuilder extends BaseLuceneBuilder
|
||||
return "PARENT";
|
||||
}
|
||||
|
||||
private <Q, S, E extends Throwable> String getValueAsString(QueryParserAdaptor<Q, S, E> lqpa, Serializable value)
|
||||
private <Q, S, E extends Throwable> String getValueAsString(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value)
|
||||
{
|
||||
String nodeRefStr = (String)value;
|
||||
if(!NodeRef.isNodeRef((String)value))
|
||||
@@ -93,8 +93,8 @@ public class ParentLuceneBuilder extends BaseLuceneBuilder
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> Q buildLuceneEquality(QueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode,
|
||||
LuceneFunction luceneFunction) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneEquality(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value, PredicateMode mode,
|
||||
LuceneFunction luceneFunction) throws E
|
||||
{
|
||||
String field = getLuceneFieldName();
|
||||
String stringValue = getValueAsString(lqpa, value);
|
||||
@@ -102,7 +102,7 @@ public class ParentLuceneBuilder extends BaseLuceneBuilder
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> Q buildLuceneExists(QueryParserAdaptor<Q, S, E> lqpa, Boolean not) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneExists(LuceneQueryParserAdaptor<Q, S, E> lqpa, Boolean not) throws E
|
||||
{
|
||||
if (not)
|
||||
{
|
||||
@@ -114,7 +114,7 @@ public class ParentLuceneBuilder extends BaseLuceneBuilder
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLike(QueryParserAdaptor<Q, S, E> lqpa, Serializable value, Boolean not) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLike(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value, Boolean not) throws E
|
||||
{
|
||||
String field = getLuceneFieldName();
|
||||
String stringValue = getValueAsString(lqpa, value);
|
||||
@@ -128,7 +128,7 @@ public class ParentLuceneBuilder extends BaseLuceneBuilder
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Q, S, E extends Throwable> String getLuceneSortField(QueryParserAdaptor<Q, S, E> lqpa)
|
||||
public <Q, S, E extends Throwable> String getLuceneSortField(LuceneQueryParserAdaptor<Q, S, E> lqpa)
|
||||
{
|
||||
return getLuceneFieldName();
|
||||
}
|
||||
|
@@ -30,7 +30,7 @@ import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.repo.search.adaptor.AnalysisMode;
|
||||
import org.alfresco.repo.search.adaptor.lucene.AnalysisMode;
|
||||
import org.alfresco.repo.search.impl.parsers.CMIS_FTSLexer;
|
||||
import org.alfresco.repo.search.impl.parsers.CMIS_FTSParser;
|
||||
import org.alfresco.repo.search.impl.parsers.FTSQueryException;
|
||||
|
@@ -34,9 +34,9 @@ import org.alfresco.opencmis.dictionary.CMISDictionaryService;
|
||||
import org.alfresco.opencmis.dictionary.CMISNodeInfo;
|
||||
import org.alfresco.opencmis.dictionary.PropertyDefinitionWrapper;
|
||||
import org.alfresco.opencmis.dictionary.TypeDefinitionWrapper;
|
||||
import org.alfresco.repo.search.adaptor.LuceneFunction;
|
||||
import org.alfresco.repo.search.adaptor.QueryParserAdaptor;
|
||||
import org.alfresco.repo.search.adaptor.QueryConstants;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneFunction;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneQueryParserAdaptor;
|
||||
import org.alfresco.repo.search.adaptor.lucene.QueryConstants;
|
||||
import org.alfresco.repo.search.impl.querymodel.FunctionArgument;
|
||||
import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.PredicateMode;
|
||||
@@ -258,8 +258,8 @@ public class CmisFunctionEvaluationContext implements FunctionEvaluationContext
|
||||
this.score = score;
|
||||
}
|
||||
|
||||
public <Q, S, E extends Throwable> Q buildLuceneEquality(QueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value,
|
||||
PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneEquality(LuceneQueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value,
|
||||
PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
{
|
||||
PropertyDefinitionWrapper propertyDef = cmisDictionaryService.findProperty(propertyName);
|
||||
return propertyDef.getPropertyLuceneBuilder().buildLuceneEquality(lqpa, value, mode, luceneFunction);
|
||||
@@ -272,7 +272,7 @@ public class CmisFunctionEvaluationContext implements FunctionEvaluationContext
|
||||
* buildLuceneExists(org.alfresco.repo.search.impl.lucene.LuceneQueryParser,
|
||||
* org.alfresco.service.namespace.QName, java.lang.Boolean)
|
||||
*/
|
||||
public <Q, S, E extends Throwable> Q buildLuceneExists(QueryParserAdaptor<Q, S, E> lqpa, String propertyName, Boolean not) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneExists(LuceneQueryParserAdaptor<Q, S, E> lqpa, String propertyName, Boolean not) throws E
|
||||
{
|
||||
PropertyDefinitionWrapper propertyDef = cmisDictionaryService.findProperty(propertyName);
|
||||
return propertyDef.getPropertyLuceneBuilder().buildLuceneExists(lqpa, not);
|
||||
@@ -287,8 +287,8 @@ public class CmisFunctionEvaluationContext implements FunctionEvaluationContext
|
||||
* org.alfresco.service.namespace.QName, java.io.Serializable,
|
||||
* org.alfresco.repo.search.impl.querymodel.PredicateMode)
|
||||
*/
|
||||
public <Q, S, E extends Throwable> Q buildLuceneGreaterThan(QueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value,
|
||||
PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneGreaterThan(LuceneQueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value,
|
||||
PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
{
|
||||
PropertyDefinitionWrapper propertyDef = cmisDictionaryService.findProperty(propertyName);
|
||||
return propertyDef.getPropertyLuceneBuilder().buildLuceneGreaterThan(lqpa, value, mode, luceneFunction);
|
||||
@@ -303,8 +303,8 @@ public class CmisFunctionEvaluationContext implements FunctionEvaluationContext
|
||||
* org.alfresco.service.namespace.QName, java.io.Serializable,
|
||||
* org.alfresco.repo.search.impl.querymodel.PredicateMode)
|
||||
*/
|
||||
public <Q, S, E extends Throwable> Q buildLuceneGreaterThanOrEquals(QueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value,
|
||||
PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneGreaterThanOrEquals(LuceneQueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value,
|
||||
PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
{
|
||||
PropertyDefinitionWrapper propertyDef = cmisDictionaryService.findProperty(propertyName);
|
||||
return propertyDef.getPropertyLuceneBuilder().buildLuceneGreaterThanOrEquals(lqpa, value, mode, luceneFunction);
|
||||
@@ -319,8 +319,8 @@ public class CmisFunctionEvaluationContext implements FunctionEvaluationContext
|
||||
* java.lang.Boolean,
|
||||
* org.alfresco.repo.search.impl.querymodel.PredicateMode)
|
||||
*/
|
||||
public <Q, S, E extends Throwable> Q buildLuceneIn(QueryParserAdaptor<Q, S, E> lqpa, String propertyName, Collection<Serializable> values,
|
||||
Boolean not, PredicateMode mode) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneIn(LuceneQueryParserAdaptor<Q, S, E> lqpa, String propertyName, Collection<Serializable> values,
|
||||
Boolean not, PredicateMode mode) throws E
|
||||
{
|
||||
PropertyDefinitionWrapper propertyDef = cmisDictionaryService.findProperty(propertyName);
|
||||
return propertyDef.getPropertyLuceneBuilder().buildLuceneIn(lqpa, values, not, mode);
|
||||
@@ -335,8 +335,8 @@ public class CmisFunctionEvaluationContext implements FunctionEvaluationContext
|
||||
* org.alfresco.service.namespace.QName, java.io.Serializable,
|
||||
* org.alfresco.repo.search.impl.querymodel.PredicateMode)
|
||||
*/
|
||||
public <Q, S, E extends Throwable> Q buildLuceneInequality(QueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value,
|
||||
PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneInequality(LuceneQueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value,
|
||||
PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
{
|
||||
PropertyDefinitionWrapper propertyDef = cmisDictionaryService.findProperty(propertyName);
|
||||
return propertyDef.getPropertyLuceneBuilder().buildLuceneInequality(lqpa, value, mode, luceneFunction);
|
||||
@@ -351,8 +351,8 @@ public class CmisFunctionEvaluationContext implements FunctionEvaluationContext
|
||||
* org.alfresco.service.namespace.QName, java.io.Serializable,
|
||||
* org.alfresco.repo.search.impl.querymodel.PredicateMode)
|
||||
*/
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLessThan(QueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value,
|
||||
PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLessThan(LuceneQueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value,
|
||||
PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
{
|
||||
PropertyDefinitionWrapper propertyDef = cmisDictionaryService.findProperty(propertyName);
|
||||
return propertyDef.getPropertyLuceneBuilder().buildLuceneLessThan(lqpa, value, mode, luceneFunction);
|
||||
@@ -367,8 +367,8 @@ public class CmisFunctionEvaluationContext implements FunctionEvaluationContext
|
||||
* org.alfresco.service.namespace.QName, java.io.Serializable,
|
||||
* org.alfresco.repo.search.impl.querymodel.PredicateMode)
|
||||
*/
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLessThanOrEquals(QueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value,
|
||||
PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLessThanOrEquals(LuceneQueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value,
|
||||
PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
{
|
||||
PropertyDefinitionWrapper propertyDef = cmisDictionaryService.findProperty(propertyName);
|
||||
return propertyDef.getPropertyLuceneBuilder().buildLuceneLessThanOrEquals(lqpa, value, mode, luceneFunction);
|
||||
@@ -382,7 +382,7 @@ public class CmisFunctionEvaluationContext implements FunctionEvaluationContext
|
||||
* org.alfresco.service.namespace.QName, java.io.Serializable,
|
||||
* java.lang.Boolean)
|
||||
*/
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLike(QueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value, Boolean not)
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLike(LuceneQueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value, Boolean not)
|
||||
throws E
|
||||
{
|
||||
PropertyDefinitionWrapper propertyDef = cmisDictionaryService.findProperty(propertyName);
|
||||
@@ -395,7 +395,7 @@ public class CmisFunctionEvaluationContext implements FunctionEvaluationContext
|
||||
* @see org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext#
|
||||
* getLuceneSortField(org.alfresco.service.namespace.QName)
|
||||
*/
|
||||
public <Q, S, E extends Throwable> String getLuceneSortField(QueryParserAdaptor<Q, S, E> lqpa, String propertyName) throws E
|
||||
public <Q, S, E extends Throwable> String getLuceneSortField(LuceneQueryParserAdaptor<Q, S, E> lqpa, String propertyName) throws E
|
||||
{
|
||||
PropertyDefinitionWrapper propertyDef = cmisDictionaryService.findProperty(propertyName);
|
||||
return propertyDef.getPropertyLuceneBuilder().getLuceneSortField(lqpa);
|
||||
|
@@ -31,9 +31,6 @@ import org.alfresco.service.cmr.repository.ContentIOException;
|
||||
import org.alfresco.service.cmr.repository.ContentReader;
|
||||
import org.alfresco.service.cmr.repository.ContentStreamListener;
|
||||
import org.alfresco.service.cmr.repository.ContentWriter;
|
||||
import org.alfresco.service.cmr.repository.DirectAccessUrl;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* Provides low-level retrieval of content
|
||||
@@ -238,29 +235,4 @@ public interface ContentStore
|
||||
* if an IO error occurs
|
||||
*/
|
||||
public boolean delete(String contentUrl);
|
||||
|
||||
/**
|
||||
* Gets a presigned URL to directly access a binary content. It is up to the actual store
|
||||
* implementation if it can fulfil this request with an expiry time or not.
|
||||
*
|
||||
* @param contentUrl A content store URL
|
||||
* @param expiresAt An optional expiry date, so the direct access url would become invalid when the expiry date is reached
|
||||
* @return A direct access URL object for a binary content
|
||||
* @throws UnsupportedOperationException if the store is unable to provide the information
|
||||
*/
|
||||
default DirectAccessUrl getDirectAccessUrl(String contentUrl, Date expiresAt)
|
||||
{
|
||||
throw new UnsupportedOperationException(
|
||||
"Retrieving direct access URLs is not supported by this content store.");
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the store supports the retrieving of direct access URLs.
|
||||
*
|
||||
* @return true if direct access URLs retrieving is supported, false otherwise
|
||||
*/
|
||||
default boolean isDirectAccessSupported()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@@ -662,6 +662,7 @@ public class MimetypeMap implements MimetypeService
|
||||
boolean successReadingConfig = true;
|
||||
if (jsonConfigFileFinder != null)
|
||||
{
|
||||
// This should not be "alfresco/mimetype" which is used for the in JVM jodconverter
|
||||
successReadingConfig &= jsonConfigFileFinder.readFiles("alfresco/mimetypes", logger);
|
||||
if (mimetypeJsonConfigDir != null && !mimetypeJsonConfigDir.isBlank())
|
||||
{
|
||||
@@ -876,6 +877,11 @@ public class MimetypeMap implements MimetypeService
|
||||
*/
|
||||
private MediaType detectType(String filename, ContentReader reader)
|
||||
{
|
||||
// Metadata metadata = new Metadata();
|
||||
// if (filename != null)
|
||||
// {
|
||||
// metadata.add(Metadata.RESOURCE_NAME_KEY, filename);
|
||||
// }
|
||||
TikaInputStream inp = null;
|
||||
try
|
||||
{
|
||||
|
@@ -117,6 +117,12 @@ public class CustomModelDefinitionImpl implements CustomModelDefinition
|
||||
return this.active;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAnalyserResourceBundleName()
|
||||
{
|
||||
return m2ModelDefinition.getAnalyserResourceBundleName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAuthor()
|
||||
{
|
||||
|
@@ -280,6 +280,11 @@ public interface DictionaryDAO extends ModelQuery
|
||||
// MT-specific
|
||||
boolean isModelInherited(QName name);
|
||||
|
||||
/**
|
||||
* @return String
|
||||
*/
|
||||
String getDefaultAnalyserResourceBundleName();
|
||||
|
||||
/**
|
||||
* @return ClassLoader
|
||||
*/
|
||||
|
@@ -101,6 +101,18 @@ public class DictionaryDAOImpl implements DictionaryDAO, NamespaceDAO,
|
||||
this.dictionaryRegistryCache = dictionaryRegistryCache;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDefaultAnalyserResourceBundleName()
|
||||
{
|
||||
return defaultAnalyserResourceBundleName;
|
||||
}
|
||||
|
||||
public void setDefaultAnalyserResourceBundleName(
|
||||
String defaultAnalyserResourceBundleName)
|
||||
{
|
||||
this.defaultAnalyserResourceBundleName = defaultAnalyserResourceBundleName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct
|
||||
*
|
||||
|
@@ -234,6 +234,15 @@ import org.alfresco.service.namespace.QName;
|
||||
return Collections.unmodifiableMap(childassociations);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.dictionary.ClassDefinition#getAnalyserResourceBundleName()
|
||||
*/
|
||||
@Override
|
||||
public String getAnalyserResourceBundleName()
|
||||
{
|
||||
return type.getAnalyserResourceBundleName();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.dictionary.ClassDefinition#getParentClassDefinition()
|
||||
*/
|
||||
|
@@ -48,7 +48,7 @@ public abstract class M2Class
|
||||
private Boolean archive = null;
|
||||
private Boolean includedInSuperTypeQuery = null;
|
||||
private String analyserResourceBundleName = null;
|
||||
|
||||
|
||||
private List<M2Property> properties = new ArrayList<M2Property>();
|
||||
private List<M2PropertyOverride> propertyOverrides = new ArrayList<M2PropertyOverride>();
|
||||
private List<M2ClassAssociation> associations = new ArrayList<M2ClassAssociation>();
|
||||
@@ -270,6 +270,19 @@ public abstract class M2Class
|
||||
{
|
||||
return Collections.unmodifiableList(mandatoryAspects);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return String
|
||||
*/
|
||||
public String getAnalyserResourceBundleName()
|
||||
{
|
||||
return analyserResourceBundleName;
|
||||
}
|
||||
|
||||
public void setAnalyserResourceBundleName(String analyserResourceBundleName)
|
||||
{
|
||||
this.analyserResourceBundleName = analyserResourceBundleName;
|
||||
}
|
||||
|
||||
public void setConfigProperties(Properties configProperties)
|
||||
{
|
||||
|
@@ -206,6 +206,8 @@ import org.alfresco.util.EqualsHelper;
|
||||
defaultAspectNames.add(name);
|
||||
}
|
||||
}
|
||||
|
||||
this.analyserResourceBundleName = m2Class.getAnalyserResourceBundleName();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -759,6 +761,15 @@ import org.alfresco.util.EqualsHelper;
|
||||
return modelDiffs;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.dictionary.ClassDefinition#getAnalyserResourceBundleName()
|
||||
*/
|
||||
@Override
|
||||
public String getAnalyserResourceBundleName()
|
||||
{
|
||||
return analyserResourceBundleName;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.dictionary.ClassDefinition#getParentClassDefinition()
|
||||
*/
|
||||
|
@@ -40,50 +40,86 @@ public class M2DataType
|
||||
private String defaultAnalyserClassName = null;
|
||||
private String javaClassName = null;
|
||||
private String analyserResourceBundleName = null;
|
||||
|
||||
|
||||
|
||||
|
||||
/*package*/ M2DataType()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
public String getTitle()
|
||||
{
|
||||
return title;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setTitle(String title)
|
||||
{
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
|
||||
public String getDescription()
|
||||
{
|
||||
return description;
|
||||
}
|
||||
|
||||
|
||||
public void setDescription(String description)
|
||||
{
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
|
||||
public String getDefaultAnalyserClassName()
|
||||
{
|
||||
return defaultAnalyserClassName;
|
||||
}
|
||||
|
||||
|
||||
public void setDefaultAnalyserClassName(String defaultAnalyserClassName)
|
||||
{
|
||||
this.defaultAnalyserClassName = defaultAnalyserClassName;;
|
||||
}
|
||||
|
||||
|
||||
public String getJavaClassName()
|
||||
{
|
||||
return javaClassName;
|
||||
}
|
||||
|
||||
|
||||
public void setJavaClassName(String javaClassName)
|
||||
{
|
||||
this.javaClassName = javaClassName;;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return String
|
||||
*/
|
||||
public String getAnalyserResourceBundleName()
|
||||
{
|
||||
return analyserResourceBundleName;
|
||||
}
|
||||
|
||||
|
||||
public void setAnalyserResourceBundleName(String analyserResourceBundleName)
|
||||
{
|
||||
this.analyserResourceBundleName = analyserResourceBundleName;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -67,6 +67,7 @@ import org.alfresco.service.namespace.QName;
|
||||
throw new DictionaryException(ERR_NOT_DEFINED_NAMESPACE, name.toPrefixString(), name.getNamespaceURI(), model.getName().toPrefixString());
|
||||
}
|
||||
this.dataType = propertyType;
|
||||
this.analyserResourceBundleName = dataType.getAnalyserResourceBundleName();
|
||||
}
|
||||
|
||||
|
||||
@@ -145,9 +146,108 @@ import org.alfresco.service.namespace.QName;
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDefaultAnalyserClassName()
|
||||
{
|
||||
return dataType.getDefaultAnalyserClassName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getJavaClassName()
|
||||
{
|
||||
return dataType.getJavaClassName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAnalyserResourceBundleName()
|
||||
{
|
||||
return analyserResourceBundleName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String resolveAnalyserClassName()
|
||||
{
|
||||
return resolveAnalyserClassName(I18NUtil.getLocale());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param locale Locale
|
||||
* @return String
|
||||
*/
|
||||
@Override
|
||||
public String resolveAnalyserClassName(Locale locale)
|
||||
{
|
||||
ClassLoader resourceBundleClassLoader = getModel().getDictionaryDAO().getResourceClassLoader();
|
||||
if(resourceBundleClassLoader == null)
|
||||
{
|
||||
resourceBundleClassLoader = this.getClass().getClassLoader();
|
||||
}
|
||||
|
||||
StringBuilder keyBuilder = new StringBuilder(64);
|
||||
keyBuilder.append(getModel().getName().toPrefixString());
|
||||
keyBuilder.append(".datatype");
|
||||
keyBuilder.append(".").append(getName().toPrefixString());
|
||||
keyBuilder.append(".analyzer");
|
||||
String key = StringUtils.replace(keyBuilder.toString(), ":", "_");
|
||||
|
||||
String analyserClassName = null;
|
||||
|
||||
String defaultAnalyserResourceBundleName = this.getModel().getDictionaryDAO().getDefaultAnalyserResourceBundleName();
|
||||
if(defaultAnalyserResourceBundleName != null)
|
||||
{
|
||||
ResourceBundle bundle = ResourceBundle.getBundle(defaultAnalyserResourceBundleName, locale, resourceBundleClassLoader);
|
||||
if(bundle.containsKey(key))
|
||||
{
|
||||
analyserClassName = bundle.getString(key);
|
||||
}
|
||||
}
|
||||
|
||||
String analyserResourceBundleName;
|
||||
if(analyserClassName == null)
|
||||
{
|
||||
analyserResourceBundleName = dataType.getAnalyserResourceBundleName();
|
||||
if(analyserResourceBundleName != null)
|
||||
{
|
||||
ResourceBundle bundle = ResourceBundle.getBundle(analyserResourceBundleName, locale, resourceBundleClassLoader);
|
||||
if(bundle.containsKey(key))
|
||||
{
|
||||
analyserClassName = bundle.getString(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(analyserClassName == null)
|
||||
{
|
||||
analyserResourceBundleName = getModel().getAnalyserResourceBundleName();
|
||||
if(analyserResourceBundleName != null)
|
||||
{
|
||||
ResourceBundle bundle = ResourceBundle.getBundle(analyserResourceBundleName, locale, resourceBundleClassLoader);
|
||||
if(bundle.containsKey(key))
|
||||
{
|
||||
analyserClassName = bundle.getString(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(analyserClassName == null)
|
||||
{
|
||||
// MLTEXT should fall back to TEXT for analysis
|
||||
if(name.equals(DataTypeDefinition.MLTEXT))
|
||||
{
|
||||
analyserClassName = model.getDictionaryDAO().getDataType(DataTypeDefinition.TEXT).resolveAnalyserClassName(locale);
|
||||
if(analyserClassName == null)
|
||||
{
|
||||
analyserClassName = dataType.getDefaultAnalyserClassName();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
analyserClassName = dataType.getDefaultAnalyserClassName();
|
||||
}
|
||||
}
|
||||
|
||||
return analyserClassName;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -469,6 +469,21 @@ public class M2Model
|
||||
return new ArrayList();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return String
|
||||
*/
|
||||
public String getAnalyserResourceBundleName()
|
||||
{
|
||||
return analyserResourceBundleName;
|
||||
}
|
||||
|
||||
|
||||
public void setAnalyserResourceBundleName(String analyserResourceBundleName)
|
||||
{
|
||||
this.analyserResourceBundleName = analyserResourceBundleName;
|
||||
}
|
||||
|
||||
public void setConfigProperties(Properties configProperties)
|
||||
{
|
||||
if (types != null)
|
||||
|
@@ -55,6 +55,7 @@ public class M2ModelDefinition implements ModelDefinition
|
||||
{
|
||||
this.name = QName.createQName(model.getName(), resolver);
|
||||
this.model = model;
|
||||
this.analyserResourceBundleName = model.getAnalyserResourceBundleName();
|
||||
this.dictionaryDAO = dictionaryDAO;
|
||||
}
|
||||
|
||||
@@ -174,6 +175,17 @@ public class M2ModelDefinition implements ModelDefinition
|
||||
return model.getChecksum(bindingType);
|
||||
}
|
||||
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.dictionary.ModelDefinition#getAnalyserResourceBundleName()
|
||||
*/
|
||||
@Override
|
||||
public String getAnalyserResourceBundleName()
|
||||
{
|
||||
return analyserResourceBundleName;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public DictionaryDAO getDictionaryDAO()
|
||||
{
|
||||
|
@@ -312,6 +312,20 @@ public class M2Property
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return String
|
||||
*/
|
||||
public String getAnalyserResourceBundleName()
|
||||
{
|
||||
return analyserResourceBundleName;
|
||||
}
|
||||
|
||||
|
||||
public void setAnalyserResourceBundleName(String analyserResourceBundleName)
|
||||
{
|
||||
this.analyserResourceBundleName = analyserResourceBundleName;
|
||||
}
|
||||
|
||||
public void setConfigProperties(Properties configProperties)
|
||||
{
|
||||
|
@@ -78,6 +78,7 @@ import org.springframework.util.StringUtils;
|
||||
// Resolve Names
|
||||
this.name = QName.createQName(m2Property.getName(), prefixResolver);
|
||||
this.propertyTypeName = QName.createQName(m2Property.getType(), prefixResolver);
|
||||
this.analyserResourceBundleName = m2Property.getAnalyserResourceBundleName();
|
||||
}
|
||||
|
||||
|
||||
@@ -551,43 +552,19 @@ import org.springframework.util.StringUtils;
|
||||
// check mandatory
|
||||
if (isMandatory() != propDef.isMandatory())
|
||||
{
|
||||
// Change from mandatory to NON mandatory is an incremental change
|
||||
if (isMandatory() && !propDef.isMandatory())
|
||||
{
|
||||
isUpdatedIncrementally = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
isUpdated = true;
|
||||
}
|
||||
isUpdated = true;
|
||||
}
|
||||
|
||||
// check mandatory enforced
|
||||
if (isMandatoryEnforced() != propDef.isMandatoryEnforced())
|
||||
{
|
||||
// Change from mandatory enforced to NON mandatory enforced is an incremental change
|
||||
if (isMandatoryEnforced() && ! propDef.isMandatoryEnforced())
|
||||
{
|
||||
isUpdatedIncrementally = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
isUpdated = true;
|
||||
}
|
||||
{
|
||||
isUpdated = true;
|
||||
}
|
||||
|
||||
// check protected
|
||||
if (isProtected() != propDef.isProtected())
|
||||
{
|
||||
// Change from protected to NON protected is an incremental change
|
||||
if (isProtected() && !propDef.isProtected())
|
||||
{
|
||||
isUpdatedIncrementally = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
isUpdated = true;
|
||||
}
|
||||
{
|
||||
isUpdated = true;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -688,4 +665,119 @@ import org.springframework.util.StringUtils;
|
||||
|
||||
return modelDiffs;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.dictionary.PropertyDefinition#getAnalyserResourceBundleName()
|
||||
*/
|
||||
@Override
|
||||
public String getAnalyserResourceBundleName()
|
||||
{
|
||||
return analyserResourceBundleName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String resolveAnalyserClassName()
|
||||
{
|
||||
return resolveAnalyserClassName(I18NUtil.getLocale());
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.dictionary.PropertyDefinition#getAnalyserClassName(java.lang.String, java.util.Locale)
|
||||
*/
|
||||
@Override
|
||||
public String resolveAnalyserClassName(Locale locale
|
||||
)
|
||||
{
|
||||
ClassLoader resourceBundleClassLoader = getModel().getDictionaryDAO().getResourceClassLoader();
|
||||
if(resourceBundleClassLoader == null)
|
||||
{
|
||||
resourceBundleClassLoader = this.getClass().getClassLoader();
|
||||
}
|
||||
|
||||
StringBuilder keyBuilder = new StringBuilder(64);
|
||||
keyBuilder.append(getDataType().getModel().getName().toPrefixString());
|
||||
keyBuilder.append(".datatype");
|
||||
keyBuilder.append(".").append(getDataType().getName().toPrefixString());
|
||||
keyBuilder.append(".analyzer");
|
||||
String key = StringUtils.replace(keyBuilder.toString(), ":", "_");
|
||||
|
||||
String analyserClassName = null;
|
||||
|
||||
String analyserResourceBundleName = getAnalyserResourceBundleName();
|
||||
if(analyserResourceBundleName != null)
|
||||
{
|
||||
ResourceBundle bundle = ResourceBundle.getBundle(analyserResourceBundleName, locale, resourceBundleClassLoader);
|
||||
if(bundle.containsKey(key))
|
||||
{
|
||||
analyserClassName = bundle.getString(key);
|
||||
}
|
||||
}
|
||||
|
||||
// walk containing class and its hierarchy
|
||||
|
||||
ClassDefinition classDefinition = null;
|
||||
ClassDefinition parentClassDefinition = null;
|
||||
while(analyserClassName == null)
|
||||
{
|
||||
if(classDefinition == null)
|
||||
{
|
||||
classDefinition = getContainerClass();
|
||||
}
|
||||
else
|
||||
{
|
||||
if(parentClassDefinition == null)
|
||||
{
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
classDefinition = parentClassDefinition;
|
||||
}
|
||||
}
|
||||
|
||||
parentClassDefinition = classDefinition.getParentClassDefinition();
|
||||
|
||||
analyserResourceBundleName = classDefinition.getAnalyserResourceBundleName();
|
||||
if(analyserResourceBundleName != null)
|
||||
{
|
||||
ResourceBundle bundle = ResourceBundle.getBundle(analyserResourceBundleName, locale, resourceBundleClassLoader);
|
||||
if(bundle.containsKey(key))
|
||||
{
|
||||
analyserClassName = bundle.getString(key);
|
||||
}
|
||||
}
|
||||
if(analyserClassName == null)
|
||||
{
|
||||
if((parentClassDefinition == null) || !classDefinition.getModel().getName().equals(parentClassDefinition.getModel().getName()))
|
||||
{
|
||||
analyserResourceBundleName = classDefinition.getModel().getAnalyserResourceBundleName();
|
||||
if(analyserResourceBundleName != null)
|
||||
{
|
||||
ResourceBundle bundle = ResourceBundle.getBundle(analyserResourceBundleName, locale, resourceBundleClassLoader);
|
||||
if(bundle.containsKey(key))
|
||||
{
|
||||
analyserClassName = bundle.getString(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
String defaultAnalyserResourceBundleName = this.getContainerClass().getModel().getDictionaryDAO().getDefaultAnalyserResourceBundleName();
|
||||
if(analyserClassName == null)
|
||||
{
|
||||
if(defaultAnalyserResourceBundleName != null)
|
||||
{
|
||||
ResourceBundle bundle = ResourceBundle.getBundle(defaultAnalyserResourceBundleName, locale, resourceBundleClassLoader);
|
||||
if(bundle.containsKey(key))
|
||||
{
|
||||
analyserClassName = bundle.getString(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(analyserClassName == null)
|
||||
{
|
||||
analyserClassName = getDataType().resolveAnalyserClassName(locale);
|
||||
}
|
||||
return analyserClassName;
|
||||
}
|
||||
}
|
||||
|
@@ -12,7 +12,7 @@
|
||||
<value name="published" field="published" usage="optional"/>
|
||||
<value name="version" field="version" usage="optional"/>
|
||||
<value name="analyserResourceBundleName" field="analyserResourceBundleName" usage="optional"/>
|
||||
|
||||
|
||||
<structure name="imports" usage="optional">
|
||||
<collection field="imports" factory="org.alfresco.repo.dictionary.M2Model.createList">
|
||||
<structure name="import" type="org.alfresco.repo.dictionary.M2Namespace" usage="optional">
|
||||
@@ -37,7 +37,7 @@
|
||||
<value style="attribute" name="name" field="name"/>
|
||||
<value name="title" field="title" usage="optional"/>
|
||||
<value name="description" field="description" usage="optional"/>
|
||||
<value name="default-analyser-class" field="defaultAnalyserClassName" usage="optional"/>
|
||||
<value name="default-analyser-class" field="defaultAnalyserClassName"/>
|
||||
<value name="analyserResourceBundleName" field="analyserResourceBundleName" usage="optional"/>
|
||||
<value name="java-class" field="javaClassName"/>
|
||||
</structure>
|
||||
@@ -179,4 +179,4 @@
|
||||
<value name="propagateTimestamps" field="propagateTimestamps" usage="optional"/>
|
||||
</mapping>
|
||||
|
||||
</binding>
|
||||
</binding>
|
@@ -23,7 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.repo.search.adaptor;
|
||||
package org.alfresco.repo.search.adaptor.lucene;
|
||||
|
||||
public enum AnalysisMode
|
||||
{
|
@@ -24,7 +24,7 @@
|
||||
* #L%
|
||||
*/
|
||||
|
||||
package org.alfresco.repo.search.adaptor;
|
||||
package org.alfresco.repo.search.adaptor.lucene;
|
||||
|
||||
/**
|
||||
* Functions that can be applied to lucene fields
|
@@ -23,7 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.repo.search.adaptor;
|
||||
package org.alfresco.repo.search.adaptor.lucene;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -33,8 +33,8 @@ import org.alfresco.service.cmr.dictionary.PropertyDefinition;
|
||||
import org.alfresco.service.cmr.search.SearchParameters;
|
||||
|
||||
/**
|
||||
* Adaptor class to wrap search parser implementations and encapsulate changes between search versions of query
|
||||
* building.
|
||||
* Adaptor class principally to wrap lucene parser implementations and encapsulate changes between lucene versions
|
||||
* of query building.
|
||||
*
|
||||
* @param <Q> the query type used by the query engine implementation
|
||||
* @param <S> the sort type used by the query engine implementation
|
||||
@@ -43,7 +43,7 @@ import org.alfresco.service.cmr.search.SearchParameters;
|
||||
* @author Andy
|
||||
*
|
||||
*/
|
||||
public interface QueryParserAdaptor<Q, S, E extends Throwable>
|
||||
public interface LuceneQueryParserAdaptor<Q, S, E extends Throwable>
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -215,9 +215,9 @@ public interface QueryParserAdaptor<Q, S, E extends Throwable>
|
||||
|
||||
/**
|
||||
* Utility to build conjunctions, disjunctions and negation
|
||||
* @return QueryParserExpressionAdaptor
|
||||
* @return LuceneQueryParserExpressionAdaptor
|
||||
*/
|
||||
QueryParserExpressionAdaptor<Q, E> getExpressionAdaptor();
|
||||
LuceneQueryParserExpressionAdaptor<Q, E> getExpressionAdaptor();
|
||||
|
||||
/**
|
||||
* A query that matches all alfresco nodes (not extra stuff that may be in the underlying index)
|
@@ -23,13 +23,13 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.repo.search.adaptor;
|
||||
package org.alfresco.repo.search.adaptor.lucene;
|
||||
|
||||
/**
|
||||
* @author Andy
|
||||
*
|
||||
*/
|
||||
public interface QueryParserExpressionAdaptor<Q, E extends Throwable>
|
||||
public interface LuceneQueryParserExpressionAdaptor<Q, E extends Throwable>
|
||||
{
|
||||
public void addRequired(Q q) throws E;
|
||||
public void addExcluded(Q q) throws E;
|
@@ -23,7 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.repo.search.adaptor;
|
||||
package org.alfresco.repo.search.adaptor.lucene;
|
||||
|
||||
/**
|
||||
* This class defines
|
||||
@@ -181,24 +181,6 @@ public interface QueryConstants
|
||||
|
||||
public static final String FIELD_SOLR_NOLOCALE_TOKENISED_SUFFIX = ".__";
|
||||
|
||||
public static final String FIELD_SOLR_UNIT_OF_TIME_SECOND_SUFFIX = "_unit_of_time_second";
|
||||
|
||||
public static final String FIELD_SOLR_UNIT_OF_TIME_MINUTE_SUFFIX = "_unit_of_time_minute";
|
||||
|
||||
public static final String FIELD_SOLR_UNIT_OF_TIME_HOUR_SUFFIX = "_unit_of_time_hour";
|
||||
|
||||
public static final String FIELD_SOLR_UNIT_OF_TIME_DAY_SUFFIX = "_unit_of_time_day_of_month";
|
||||
|
||||
public static final String FIELD_SOLR_UNIT_OF_TIME_DAY_OF_WEEK_SUFFIX = "_unit_of_time_day_of_week";
|
||||
|
||||
public static final String FIELD_SOLR_UNIT_OF_TIME_DAY_OF_YEAR_SUFFIX = "_unit_of_time_day_of_year";
|
||||
|
||||
public static final String FIELD_SOLR_UNIT_OF_TIME_MONTH_SUFFIX = "_unit_of_time_month";
|
||||
|
||||
public static final String FIELD_SOLR_UNIT_OF_TIME_QUARTER_SUFFIX = "_unit_of_time_quarter";
|
||||
|
||||
public static final String FIELD_SOLR_UNIT_OF_TIME_YEAR_SUFFIX = "_unit_of_time_year";
|
||||
|
||||
public static final String FIELD_SITE = "SITE";
|
||||
|
||||
public static final String FIELD_GEO = "GEO";
|
@@ -27,7 +27,7 @@ package org.alfresco.repo.search.impl;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
import org.alfresco.repo.search.adaptor.QueryConstants;
|
||||
import org.alfresco.repo.search.adaptor.lucene.QueryConstants;
|
||||
import org.alfresco.service.cmr.dictionary.AspectDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.ClassDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
||||
@@ -384,51 +384,6 @@ public class QueryParserUtils implements QueryConstants
|
||||
propertyFieldName = field.substring(field.startsWith("@") ? 1 : 0, field.length() - FIELD_SOLR_NOLOCALE_TOKENISED_SUFFIX.length());
|
||||
ending = FIELD_SOLR_NOLOCALE_TOKENISED_SUFFIX;
|
||||
}
|
||||
else if (field.endsWith(FIELD_SOLR_UNIT_OF_TIME_SECOND_SUFFIX))
|
||||
{
|
||||
propertyFieldName = field.substring(field.startsWith("@") ? 1 : 0, field.length() - FIELD_SOLR_UNIT_OF_TIME_SECOND_SUFFIX.length());
|
||||
ending = FIELD_SOLR_UNIT_OF_TIME_SECOND_SUFFIX;
|
||||
}
|
||||
else if (field.endsWith(FIELD_SOLR_UNIT_OF_TIME_MINUTE_SUFFIX))
|
||||
{
|
||||
propertyFieldName = field.substring(field.startsWith("@") ? 1 : 0, field.length() - FIELD_SOLR_UNIT_OF_TIME_MINUTE_SUFFIX.length());
|
||||
ending = FIELD_SOLR_UNIT_OF_TIME_MINUTE_SUFFIX;
|
||||
}
|
||||
else if (field.endsWith(FIELD_SOLR_UNIT_OF_TIME_HOUR_SUFFIX))
|
||||
{
|
||||
propertyFieldName = field.substring(field.startsWith("@") ? 1 : 0, field.length() - FIELD_SOLR_UNIT_OF_TIME_HOUR_SUFFIX.length());
|
||||
ending = FIELD_SOLR_UNIT_OF_TIME_HOUR_SUFFIX;
|
||||
}
|
||||
else if (field.endsWith(FIELD_SOLR_UNIT_OF_TIME_DAY_SUFFIX))
|
||||
{
|
||||
propertyFieldName = field.substring(field.startsWith("@") ? 1 : 0, field.length() - FIELD_SOLR_UNIT_OF_TIME_DAY_SUFFIX.length());
|
||||
ending = FIELD_SOLR_UNIT_OF_TIME_DAY_SUFFIX;
|
||||
}
|
||||
else if (field.endsWith(FIELD_SOLR_UNIT_OF_TIME_DAY_OF_WEEK_SUFFIX))
|
||||
{
|
||||
propertyFieldName = field.substring(field.startsWith("@") ? 1 : 0, field.length() - FIELD_SOLR_UNIT_OF_TIME_DAY_OF_WEEK_SUFFIX.length());
|
||||
ending = FIELD_SOLR_UNIT_OF_TIME_DAY_OF_WEEK_SUFFIX;
|
||||
}
|
||||
else if (field.endsWith(FIELD_SOLR_UNIT_OF_TIME_DAY_OF_YEAR_SUFFIX))
|
||||
{
|
||||
propertyFieldName = field.substring(field.startsWith("@") ? 1 : 0, field.length() - FIELD_SOLR_UNIT_OF_TIME_DAY_OF_YEAR_SUFFIX.length());
|
||||
ending = FIELD_SOLR_UNIT_OF_TIME_DAY_OF_YEAR_SUFFIX;
|
||||
}
|
||||
else if (field.endsWith(FIELD_SOLR_UNIT_OF_TIME_MONTH_SUFFIX))
|
||||
{
|
||||
propertyFieldName = field.substring(field.startsWith("@") ? 1 : 0, field.length() - FIELD_SOLR_UNIT_OF_TIME_MONTH_SUFFIX.length());
|
||||
ending = FIELD_SOLR_UNIT_OF_TIME_MONTH_SUFFIX;
|
||||
}
|
||||
else if (field.endsWith(FIELD_SOLR_UNIT_OF_TIME_QUARTER_SUFFIX))
|
||||
{
|
||||
propertyFieldName = field.substring(field.startsWith("@") ? 1 : 0, field.length() - FIELD_SOLR_UNIT_OF_TIME_QUARTER_SUFFIX.length());
|
||||
ending = FIELD_SOLR_UNIT_OF_TIME_QUARTER_SUFFIX;
|
||||
}
|
||||
else if (field.endsWith(FIELD_SOLR_UNIT_OF_TIME_YEAR_SUFFIX))
|
||||
{
|
||||
propertyFieldName = field.substring(field.startsWith("@") ? 1 : 0, field.length() - FIELD_SOLR_UNIT_OF_TIME_YEAR_SUFFIX.length());
|
||||
ending = FIELD_SOLR_UNIT_OF_TIME_YEAR_SUFFIX;
|
||||
}
|
||||
else
|
||||
{
|
||||
propertyFieldName = field.substring(field.startsWith("@") ? 1 : 0);
|
||||
|
@@ -31,9 +31,9 @@ import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.repo.dictionary.IndexTokenisationMode;
|
||||
import org.alfresco.repo.search.adaptor.LuceneFunction;
|
||||
import org.alfresco.repo.search.adaptor.QueryParserAdaptor;
|
||||
import org.alfresco.repo.search.adaptor.QueryConstants;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneFunction;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneQueryParserAdaptor;
|
||||
import org.alfresco.repo.search.adaptor.lucene.QueryConstants;
|
||||
import org.alfresco.repo.search.impl.querymodel.FunctionArgument;
|
||||
import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.PredicateMode;
|
||||
@@ -136,54 +136,54 @@ public class AlfrescoFunctionEvaluationContext implements FunctionEvaluationCont
|
||||
this.defaultNamespace = defaultNamespace;
|
||||
}
|
||||
|
||||
public <Q, S, E extends Throwable> Q buildLuceneEquality(QueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneEquality(LuceneQueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public <Q, S, E extends Throwable> Q buildLuceneExists(QueryParserAdaptor<Q, S, E> lqpa, String propertyName, Boolean not) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneExists(LuceneQueryParserAdaptor<Q, S, E> lqpa, String propertyName, Boolean not) throws E
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public <Q, S, E extends Throwable> Q buildLuceneGreaterThan(QueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneGreaterThan(LuceneQueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public <Q, S, E extends Throwable> Q buildLuceneGreaterThanOrEquals(QueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction)
|
||||
public <Q, S, E extends Throwable> Q buildLuceneGreaterThanOrEquals(LuceneQueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction)
|
||||
throws E
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public <Q, S, E extends Throwable> Q buildLuceneIn(QueryParserAdaptor<Q, S, E> lqpa, String propertyName, Collection<Serializable> values, Boolean not, PredicateMode mode) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneIn(LuceneQueryParserAdaptor<Q, S, E> lqpa, String propertyName, Collection<Serializable> values, Boolean not, PredicateMode mode) throws E
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public <Q, S, E extends Throwable> Q buildLuceneInequality(QueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneInequality(LuceneQueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLessThan(QueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLessThan(LuceneQueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLessThanOrEquals(QueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction)
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLessThanOrEquals(LuceneQueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction)
|
||||
throws E
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLike(QueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value, Boolean not) throws E
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLike(LuceneQueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value, Boolean not) throws E
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public <Q, S, E extends Throwable> String getLuceneSortField(QueryParserAdaptor<Q, S, E> lqpa, String propertyName) throws E
|
||||
public <Q, S, E extends Throwable> String getLuceneSortField(LuceneQueryParserAdaptor<Q, S, E> lqpa, String propertyName) throws E
|
||||
{
|
||||
// Score is special
|
||||
if (propertyName.equalsIgnoreCase("Score"))
|
||||
@@ -263,12 +263,12 @@ public class AlfrescoFunctionEvaluationContext implements FunctionEvaluationCont
|
||||
}
|
||||
|
||||
/**
|
||||
* @param lqpa QueryParserAdaptor<Q, S, E>
|
||||
* @param lqpa LuceneQueryParserAdaptor<Q, S, E>
|
||||
* @param field String
|
||||
* @return ... extends Throwable
|
||||
* @throws E
|
||||
*/
|
||||
private <Q, S, E extends Throwable> String findSortField(QueryParserAdaptor<Q, S, E> lqpa, String field) throws E
|
||||
private <Q, S, E extends Throwable> String findSortField(LuceneQueryParserAdaptor<Q, S, E> lqpa, String field) throws E
|
||||
{
|
||||
return lqpa.getSortField(field);
|
||||
}
|
||||
@@ -499,129 +499,6 @@ public class AlfrescoFunctionEvaluationContext implements FunctionEvaluationCont
|
||||
return propertyField;
|
||||
}
|
||||
}
|
||||
else if(field.endsWith(QueryConstants.FIELD_SOLR_UNIT_OF_TIME_SECOND_SUFFIX))
|
||||
{
|
||||
QName propertyField = QName.createQName(field.substring(0, field.length() - QueryConstants.FIELD_SOLR_UNIT_OF_TIME_SECOND_SUFFIX.length()));
|
||||
PropertyDefinition propertyDef = dictionaryService.getProperty(propertyField);
|
||||
if (!propertyDef.getDataType().getName().equals(DataTypeDefinition.DATETIME))
|
||||
{
|
||||
throw new FTSQueryException(QueryConstants.FIELD_SOLR_UNIT_OF_TIME_SECOND_SUFFIX+" only supported on datetime properties");
|
||||
}
|
||||
else
|
||||
{
|
||||
return propertyField;
|
||||
}
|
||||
}
|
||||
else if(field.endsWith(QueryConstants.FIELD_SOLR_UNIT_OF_TIME_MINUTE_SUFFIX))
|
||||
{
|
||||
QName propertyField = QName.createQName(field.substring(0, field.length() - QueryConstants.FIELD_SOLR_UNIT_OF_TIME_MINUTE_SUFFIX.length()));
|
||||
PropertyDefinition propertyDef = dictionaryService.getProperty(propertyField);
|
||||
if (!propertyDef.getDataType().getName().equals(DataTypeDefinition.DATETIME))
|
||||
{
|
||||
throw new FTSQueryException(QueryConstants.FIELD_SOLR_UNIT_OF_TIME_MINUTE_SUFFIX+" only supported on datetime properties");
|
||||
}
|
||||
else
|
||||
{
|
||||
return propertyField;
|
||||
}
|
||||
}
|
||||
else if(field.endsWith(QueryConstants.FIELD_SOLR_UNIT_OF_TIME_HOUR_SUFFIX))
|
||||
{
|
||||
QName propertyField = QName.createQName(field.substring(0, field.length() - QueryConstants.FIELD_SOLR_UNIT_OF_TIME_HOUR_SUFFIX.length()));
|
||||
PropertyDefinition propertyDef = dictionaryService.getProperty(propertyField);
|
||||
if (!propertyDef.getDataType().getName().equals(DataTypeDefinition.DATETIME))
|
||||
{
|
||||
throw new FTSQueryException(QueryConstants.FIELD_SOLR_UNIT_OF_TIME_HOUR_SUFFIX+" only supported on datetime properties");
|
||||
}
|
||||
else
|
||||
{
|
||||
return propertyField;
|
||||
}
|
||||
}
|
||||
else if(field.endsWith(QueryConstants.FIELD_SOLR_UNIT_OF_TIME_DAY_SUFFIX))
|
||||
{
|
||||
QName propertyField = QName.createQName(field.substring(0, field.length() - QueryConstants.FIELD_SOLR_UNIT_OF_TIME_DAY_SUFFIX.length()));
|
||||
PropertyDefinition propertyDef = dictionaryService.getProperty(propertyField);
|
||||
if (!propertyDef.getDataType().getName().equals(DataTypeDefinition.DATE) &&
|
||||
!propertyDef.getDataType().getName().equals(DataTypeDefinition.DATETIME))
|
||||
{
|
||||
throw new FTSQueryException(QueryConstants.FIELD_SOLR_UNIT_OF_TIME_DAY_SUFFIX+" only supported on date and datetime properties");
|
||||
}
|
||||
else
|
||||
{
|
||||
return propertyField;
|
||||
}
|
||||
}
|
||||
else if(field.endsWith(QueryConstants.FIELD_SOLR_UNIT_OF_TIME_DAY_OF_WEEK_SUFFIX))
|
||||
{
|
||||
QName propertyField = QName.createQName(field.substring(0, field.length() - QueryConstants.FIELD_SOLR_UNIT_OF_TIME_DAY_OF_WEEK_SUFFIX.length()));
|
||||
PropertyDefinition propertyDef = dictionaryService.getProperty(propertyField);
|
||||
if (!propertyDef.getDataType().getName().equals(DataTypeDefinition.DATE) &&
|
||||
!propertyDef.getDataType().getName().equals(DataTypeDefinition.DATETIME))
|
||||
{
|
||||
throw new FTSQueryException(QueryConstants.FIELD_SOLR_UNIT_OF_TIME_DAY_OF_WEEK_SUFFIX+" only supported on date and datetime properties");
|
||||
}
|
||||
else
|
||||
{
|
||||
return propertyField;
|
||||
}
|
||||
}
|
||||
else if(field.endsWith(QueryConstants.FIELD_SOLR_UNIT_OF_TIME_DAY_OF_YEAR_SUFFIX))
|
||||
{
|
||||
QName propertyField = QName.createQName(field.substring(0, field.length() - QueryConstants.FIELD_SOLR_UNIT_OF_TIME_DAY_OF_YEAR_SUFFIX.length()));
|
||||
PropertyDefinition propertyDef = dictionaryService.getProperty(propertyField);
|
||||
if (!propertyDef.getDataType().getName().equals(DataTypeDefinition.DATE) &&
|
||||
!propertyDef.getDataType().getName().equals(DataTypeDefinition.DATETIME))
|
||||
{
|
||||
throw new FTSQueryException(QueryConstants.FIELD_SOLR_UNIT_OF_TIME_DAY_OF_YEAR_SUFFIX+" only supported on date and datetime properties");
|
||||
}
|
||||
else
|
||||
{
|
||||
return propertyField;
|
||||
}
|
||||
}
|
||||
else if(field.endsWith(QueryConstants.FIELD_SOLR_UNIT_OF_TIME_MONTH_SUFFIX))
|
||||
{
|
||||
QName propertyField = QName.createQName(field.substring(0, field.length() - QueryConstants.FIELD_SOLR_UNIT_OF_TIME_MONTH_SUFFIX.length()));
|
||||
PropertyDefinition propertyDef = dictionaryService.getProperty(propertyField);
|
||||
if (!propertyDef.getDataType().getName().equals(DataTypeDefinition.DATE) &&
|
||||
!propertyDef.getDataType().getName().equals(DataTypeDefinition.DATETIME))
|
||||
{
|
||||
throw new FTSQueryException(QueryConstants.FIELD_SOLR_UNIT_OF_TIME_MONTH_SUFFIX+" only supported on date and datetime properties");
|
||||
}
|
||||
else
|
||||
{
|
||||
return propertyField;
|
||||
}
|
||||
}
|
||||
else if(field.endsWith(QueryConstants.FIELD_SOLR_UNIT_OF_TIME_QUARTER_SUFFIX))
|
||||
{
|
||||
QName propertyField = QName.createQName(field.substring(0, field.length() - QueryConstants.FIELD_SOLR_UNIT_OF_TIME_QUARTER_SUFFIX.length()));
|
||||
PropertyDefinition propertyDef = dictionaryService.getProperty(propertyField);
|
||||
if (!propertyDef.getDataType().getName().equals(DataTypeDefinition.DATE) &&
|
||||
!propertyDef.getDataType().getName().equals(DataTypeDefinition.DATETIME))
|
||||
{
|
||||
throw new FTSQueryException(QueryConstants.FIELD_SOLR_UNIT_OF_TIME_QUARTER_SUFFIX+" only supported on date and datetime properties");
|
||||
}
|
||||
else
|
||||
{
|
||||
return propertyField;
|
||||
}
|
||||
}
|
||||
else if(field.endsWith(QueryConstants.FIELD_SOLR_UNIT_OF_TIME_YEAR_SUFFIX))
|
||||
{
|
||||
QName propertyField = QName.createQName(field.substring(0, field.length() - QueryConstants.FIELD_SOLR_UNIT_OF_TIME_YEAR_SUFFIX.length()));
|
||||
PropertyDefinition propertyDef = dictionaryService.getProperty(propertyField);
|
||||
if (!propertyDef.getDataType().getName().equals(DataTypeDefinition.DATE) &&
|
||||
!propertyDef.getDataType().getName().equals(DataTypeDefinition.DATETIME))
|
||||
{
|
||||
throw new FTSQueryException(QueryConstants.FIELD_SOLR_UNIT_OF_TIME_YEAR_SUFFIX+" only supported on date and datetime properties");
|
||||
}
|
||||
else
|
||||
{
|
||||
return propertyField;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return qname;
|
||||
|
@@ -32,7 +32,7 @@ import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.repo.search.adaptor.AnalysisMode;
|
||||
import org.alfresco.repo.search.adaptor.lucene.AnalysisMode;
|
||||
import org.alfresco.repo.search.impl.querymodel.Argument;
|
||||
import org.alfresco.repo.search.impl.querymodel.Column;
|
||||
import org.alfresco.repo.search.impl.querymodel.Constraint;
|
||||
|
@@ -29,8 +29,8 @@ import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.repo.search.adaptor.LuceneFunction;
|
||||
import org.alfresco.repo.search.adaptor.QueryParserAdaptor;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneFunction;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneQueryParserAdaptor;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
|
||||
@@ -79,7 +79,7 @@ public interface FunctionEvaluationContext
|
||||
* @return the query
|
||||
* @throws E
|
||||
*/
|
||||
public <Q, S, E extends Throwable> Q buildLuceneEquality(QueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E;
|
||||
public <Q, S, E extends Throwable> Q buildLuceneEquality(LuceneQueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E;
|
||||
|
||||
/**
|
||||
* Note: null and not null are not required to support functions from the spec
|
||||
@@ -88,7 +88,7 @@ public interface FunctionEvaluationContext
|
||||
* @return the query
|
||||
* @throws E
|
||||
*/
|
||||
public <Q, S, E extends Throwable> Q buildLuceneExists(QueryParserAdaptor<Q, S, E> lqpa, String propertyName, Boolean not) throws E;
|
||||
public <Q, S, E extends Throwable> Q buildLuceneExists(LuceneQueryParserAdaptor<Q, S, E> lqpa, String propertyName, Boolean not) throws E;
|
||||
|
||||
/**
|
||||
* @param propertyName String
|
||||
@@ -98,7 +98,7 @@ public interface FunctionEvaluationContext
|
||||
* @return the query
|
||||
* @throws E
|
||||
*/
|
||||
public <Q, S, E extends Throwable> Q buildLuceneGreaterThan(QueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E;
|
||||
public <Q, S, E extends Throwable> Q buildLuceneGreaterThan(LuceneQueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E;
|
||||
|
||||
/**
|
||||
* @param propertyName String
|
||||
@@ -108,7 +108,7 @@ public interface FunctionEvaluationContext
|
||||
* @return the query
|
||||
* @throws E
|
||||
*/
|
||||
public <Q, S, E extends Throwable> Q buildLuceneGreaterThanOrEquals(QueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E;
|
||||
public <Q, S, E extends Throwable> Q buildLuceneGreaterThanOrEquals(LuceneQueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E;
|
||||
|
||||
/**
|
||||
* @param propertyName String
|
||||
@@ -118,7 +118,7 @@ public interface FunctionEvaluationContext
|
||||
* @return the query
|
||||
* @throws E
|
||||
*/
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLessThan(QueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E;
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLessThan(LuceneQueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E;
|
||||
|
||||
/**
|
||||
* @param propertyName String
|
||||
@@ -128,7 +128,7 @@ public interface FunctionEvaluationContext
|
||||
* @return the query
|
||||
* @throws E
|
||||
*/
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLessThanOrEquals(QueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E;
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLessThanOrEquals(LuceneQueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E;
|
||||
|
||||
/**
|
||||
* Note: Like is not required to support functions from the spec
|
||||
@@ -138,7 +138,7 @@ public interface FunctionEvaluationContext
|
||||
* @return the query
|
||||
* @throws E
|
||||
*/
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLike(QueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value, Boolean not) throws E;
|
||||
public <Q, S, E extends Throwable> Q buildLuceneLike(LuceneQueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value, Boolean not) throws E;
|
||||
|
||||
/**
|
||||
* @param propertyName String
|
||||
@@ -148,7 +148,7 @@ public interface FunctionEvaluationContext
|
||||
* @return the query
|
||||
* @throws E
|
||||
*/
|
||||
public <Q, S, E extends Throwable> Q buildLuceneInequality(QueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E;
|
||||
public <Q, S, E extends Throwable> Q buildLuceneInequality(LuceneQueryParserAdaptor<Q, S, E> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E;
|
||||
|
||||
/**
|
||||
* Note: In is not required to support functions from the spec
|
||||
@@ -158,14 +158,14 @@ public interface FunctionEvaluationContext
|
||||
* @return the query
|
||||
* @throws E
|
||||
*/
|
||||
public <Q, S, E extends Throwable> Q buildLuceneIn(QueryParserAdaptor<Q, S, E> lqpa, String propertyName, Collection<Serializable> values, Boolean not, PredicateMode mode) throws E;
|
||||
public <Q, S, E extends Throwable> Q buildLuceneIn(LuceneQueryParserAdaptor<Q, S, E> lqpa, String propertyName, Collection<Serializable> values, Boolean not, PredicateMode mode) throws E;
|
||||
|
||||
/**
|
||||
* @param propertyName String
|
||||
* @return the field used for sorting the given property
|
||||
* @throws E
|
||||
*/
|
||||
public <Q, S, E extends Throwable> String getLuceneSortField(QueryParserAdaptor<Q, S, E> lqpa, String propertyName) throws E;
|
||||
public <Q, S, E extends Throwable> String getLuceneSortField(LuceneQueryParserAdaptor<Q, S, E> lqpa, String propertyName) throws E;
|
||||
|
||||
/**
|
||||
* @param propertyName String
|
||||
|
@@ -29,7 +29,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.repo.search.adaptor.QueryParserExpressionAdaptor;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneQueryParserExpressionAdaptor;
|
||||
import org.alfresco.repo.search.impl.querymodel.Argument;
|
||||
import org.alfresco.repo.search.impl.querymodel.Constraint;
|
||||
import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext;
|
||||
@@ -52,14 +52,14 @@ public class LuceneConjunction<Q, S, E extends Throwable> extends BaseConjunctio
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderComponent#addComponent(java.lang.String,
|
||||
* java.util.Map, org.alfresco.repo.search.impl.querymodel.impl.lucene.QueryBuilderContext,
|
||||
* java.util.Map, org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderContext,
|
||||
* org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext)
|
||||
*/
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, QueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
throws E
|
||||
{
|
||||
|
||||
QueryParserExpressionAdaptor<Q, E> expressionAdaptor = luceneContext.getLuceneQueryParserAdaptor().getExpressionAdaptor();
|
||||
LuceneQueryParserExpressionAdaptor<Q, E> expressionAdaptor = luceneContext.getLuceneQueryParserAdaptor().getExpressionAdaptor();
|
||||
boolean must = false;
|
||||
boolean must_not = false;
|
||||
for (Constraint constraint : getConstraints())
|
||||
|
@@ -30,7 +30,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.repo.search.adaptor.QueryParserExpressionAdaptor;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneQueryParserExpressionAdaptor;
|
||||
import org.alfresco.repo.search.impl.querymodel.Argument;
|
||||
import org.alfresco.repo.search.impl.querymodel.Constraint;
|
||||
import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext;
|
||||
@@ -54,13 +54,13 @@ public class LuceneDisjunction<Q, S, E extends Throwable> extends BaseDisjunctio
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderComponent#addComponent(java.lang.String,
|
||||
* java.util.Map, org.alfresco.repo.search.impl.querymodel.impl.lucene.QueryBuilderContext,
|
||||
* java.util.Map, org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderContext,
|
||||
* org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext)
|
||||
*/
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, QueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
throws E
|
||||
{
|
||||
QueryParserExpressionAdaptor<Q, E> expressionBuilder = luceneContext.getLuceneQueryParserAdaptor().getExpressionAdaptor();
|
||||
LuceneQueryParserExpressionAdaptor<Q, E> expressionBuilder = luceneContext.getLuceneQueryParserAdaptor().getExpressionAdaptor();
|
||||
ArrayList<Pair<Constraint, Q>> queriestoDisjoin = new ArrayList<>();
|
||||
for (Constraint constraint : getConstraints())
|
||||
{
|
||||
@@ -80,7 +80,7 @@ public class LuceneDisjunction<Q, S, E extends Throwable> extends BaseDisjunctio
|
||||
expressionBuilder.addOptional(constraintQuery, constraint.getBoost());
|
||||
break;
|
||||
case EXCLUDE:
|
||||
QueryParserExpressionAdaptor<Q, E> subExpressionBuilder = luceneContext.getLuceneQueryParserAdaptor().getExpressionAdaptor();
|
||||
LuceneQueryParserExpressionAdaptor<Q, E> subExpressionBuilder = luceneContext.getLuceneQueryParserAdaptor().getExpressionAdaptor();
|
||||
subExpressionBuilder.addRequired(luceneContext.getLuceneQueryParserAdaptor().getMatchAllNodesQuery());
|
||||
subExpressionBuilder.addExcluded(constraintQuery);
|
||||
expressionBuilder.addOptional(subExpressionBuilder.getQuery(), constraint.getBoost());
|
||||
|
@@ -51,7 +51,7 @@ public class LuceneFunctionalConstraint<Q, S, E extends Throwable> extends BaseF
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderComponent#addComponent(org.apache.lucene.search.BooleanQuery, org.apache.lucene.search.BooleanQuery, org.alfresco.service.cmr.dictionary.DictionaryService, java.lang.String)
|
||||
*/
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, QueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext) throws E
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext) throws E
|
||||
{
|
||||
Function function = getFunction();
|
||||
if(function != null)
|
||||
|
@@ -30,7 +30,7 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.repo.search.adaptor.QueryParserExpressionAdaptor;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneQueryParserExpressionAdaptor;
|
||||
import org.alfresco.repo.search.impl.querymodel.Column;
|
||||
import org.alfresco.repo.search.impl.querymodel.Constraint;
|
||||
import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext;
|
||||
@@ -67,9 +67,9 @@ public class LuceneQuery<Q, S, E extends Throwable> extends BaseQuery implements
|
||||
*
|
||||
* @see org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilder#buildQuery()
|
||||
*/
|
||||
public Q buildQuery(Set<String> selectors, QueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext) throws E
|
||||
public Q buildQuery(Set<String> selectors, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext) throws E
|
||||
{
|
||||
QueryParserExpressionAdaptor<Q, E> expressionBuilder = luceneContext.getLuceneQueryParserAdaptor().getExpressionAdaptor();
|
||||
LuceneQueryParserExpressionAdaptor<Q, E> expressionBuilder = luceneContext.getLuceneQueryParserAdaptor().getExpressionAdaptor();
|
||||
|
||||
boolean must = false;
|
||||
boolean must_not = false;
|
||||
@@ -148,10 +148,10 @@ public class LuceneQuery<Q, S, E extends Throwable> extends BaseQuery implements
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilder#buildSort(java.lang.String,
|
||||
* org.alfresco.repo.search.impl.querymodel.impl.lucene.QueryBuilderContext,
|
||||
* org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderContext,
|
||||
* org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext)
|
||||
*/
|
||||
public S buildSort(Set<String> selectors, QueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext) throws E
|
||||
public S buildSort(Set<String> selectors, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext) throws E
|
||||
{
|
||||
if ((getOrderings() == null) || (getOrderings().size() == 0))
|
||||
{
|
||||
@@ -161,7 +161,7 @@ public class LuceneQuery<Q, S, E extends Throwable> extends BaseQuery implements
|
||||
return luceneContext.getLuceneQueryParserAdaptor().buildSort(getOrderings(), functionContext);
|
||||
}
|
||||
|
||||
public List<SortDefinition> buildSortDefinitions(Set<String> selectors, QueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
public List<SortDefinition> buildSortDefinitions(Set<String> selectors, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
{
|
||||
if ((getOrderings() == null) || (getOrderings().size() == 0))
|
||||
{
|
||||
|
@@ -47,7 +47,7 @@ public interface LuceneQueryBuilder <Q, S, E extends Throwable>
|
||||
* @return - the query
|
||||
* @throws E
|
||||
*/
|
||||
public Q buildQuery(Set<String> selectors, QueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext) throws E;
|
||||
public Q buildQuery(Set<String> selectors, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext) throws E;
|
||||
|
||||
/**
|
||||
* Build the matching lucene sort
|
||||
@@ -55,12 +55,12 @@ public interface LuceneQueryBuilder <Q, S, E extends Throwable>
|
||||
* @return - the sort spec
|
||||
* @throws E
|
||||
*/
|
||||
public S buildSort(Set<String> selectors, QueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext) throws E;
|
||||
public S buildSort(Set<String> selectors, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext) throws E;
|
||||
|
||||
/**
|
||||
* Build a sort definition for a sorted result set wrapper
|
||||
* @param functionContext FunctionEvaluationContext
|
||||
*/
|
||||
public List<SortDefinition> buildSortDefinitions(Set<String> selectors, QueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext);
|
||||
public List<SortDefinition> buildSortDefinitions(Set<String> selectors, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext);
|
||||
|
||||
}
|
||||
|
@@ -42,5 +42,5 @@ public interface LuceneQueryBuilderComponent<Q, S, E extends Throwable>
|
||||
* @return - the lucene query fragment for this component
|
||||
* @throws E
|
||||
*/
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, QueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext) throws E;
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext) throws E;
|
||||
}
|
||||
|
@@ -25,20 +25,20 @@
|
||||
*/
|
||||
package org.alfresco.repo.search.impl.querymodel.impl.lucene;
|
||||
|
||||
import org.alfresco.repo.search.adaptor.QueryParserAdaptor;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneQueryParserAdaptor;
|
||||
import org.alfresco.service.namespace.NamespacePrefixResolver;
|
||||
|
||||
/**
|
||||
* @author Andy
|
||||
*
|
||||
*/
|
||||
public interface QueryBuilderContext<Q, S, E extends Throwable>
|
||||
public interface LuceneQueryBuilderContext<Q, S, E extends Throwable>
|
||||
{
|
||||
|
||||
/**
|
||||
* @return - the parser
|
||||
*/
|
||||
public abstract QueryParserAdaptor<Q, S, E> getLuceneQueryParserAdaptor();
|
||||
public abstract LuceneQueryParserAdaptor<Q, S, E> getLuceneQueryParserAdaptor();
|
||||
|
||||
/**
|
||||
* @return - the namespace prefix resolver
|
@@ -28,9 +28,10 @@ package org.alfresco.repo.search.impl.querymodel.impl.lucene;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.repo.search.adaptor.QueryParserAdaptor;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneQueryParserAdaptor;
|
||||
import org.alfresco.repo.search.impl.querymodel.Argument;
|
||||
import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.JoinType;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.BaseSelector;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
|
||||
@@ -53,9 +54,9 @@ public class LuceneSelector<Q, S, E extends Throwable> extends BaseSelector impl
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderComponent#addComponent(org.apache.lucene.search.BooleanQuery, org.apache.lucene.search.BooleanQuery)
|
||||
*/
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, QueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext) throws E
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext) throws E
|
||||
{
|
||||
QueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
|
||||
LuceneQueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
|
||||
switch(getJoinType())
|
||||
{
|
||||
case INNER:
|
||||
|
@@ -29,14 +29,14 @@ import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.repo.search.adaptor.QueryParserAdaptor;
|
||||
import org.alfresco.repo.search.adaptor.QueryConstants;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneQueryParserAdaptor;
|
||||
import org.alfresco.repo.search.adaptor.lucene.QueryConstants;
|
||||
import org.alfresco.repo.search.impl.querymodel.Argument;
|
||||
import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.QueryModelException;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.functions.Child;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderComponent;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.QueryBuilderContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderContext;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.StoreRef;
|
||||
|
||||
@@ -55,7 +55,7 @@ public class LuceneChild<Q, S, E extends Throwable> extends Child implements Luc
|
||||
super();
|
||||
}
|
||||
|
||||
private StoreRef getStore(QueryBuilderContext<Q, S, E> luceneContext)
|
||||
private StoreRef getStore(LuceneQueryBuilderContext<Q, S, E> luceneContext)
|
||||
{
|
||||
ArrayList<StoreRef> stores = luceneContext.getLuceneQueryParserAdaptor().getSearchParameters().getStores();
|
||||
if(stores.size() < 1)
|
||||
@@ -73,10 +73,10 @@ public class LuceneChild<Q, S, E extends Throwable> extends Child implements Luc
|
||||
* org.apache.lucene.search.BooleanQuery, org.alfresco.service.cmr.dictionary.DictionaryService,
|
||||
* java.lang.String)
|
||||
*/
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, QueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
throws E
|
||||
{
|
||||
QueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
|
||||
LuceneQueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
|
||||
Argument argument = functionArgs.get(ARG_PARENT);
|
||||
String id = (String) argument.getValue(functionContext);
|
||||
argument = functionArgs.get(ARG_SELECTOR);
|
||||
|
@@ -29,14 +29,14 @@ import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.repo.search.adaptor.QueryParserAdaptor;
|
||||
import org.alfresco.repo.search.adaptor.QueryConstants;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneQueryParserAdaptor;
|
||||
import org.alfresco.repo.search.adaptor.lucene.QueryConstants;
|
||||
import org.alfresco.repo.search.impl.querymodel.Argument;
|
||||
import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.QueryModelException;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.functions.Descendant;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderComponent;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.QueryBuilderContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderContext;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.Path;
|
||||
import org.alfresco.service.cmr.repository.StoreRef;
|
||||
@@ -56,7 +56,7 @@ public class LuceneDescendant<Q, S, E extends Throwable> extends Descendant impl
|
||||
super();
|
||||
}
|
||||
|
||||
private StoreRef getStore(QueryBuilderContext<Q, S, E> luceneContext)
|
||||
private StoreRef getStore(LuceneQueryBuilderContext<Q, S, E> luceneContext)
|
||||
{
|
||||
ArrayList<StoreRef> stores = luceneContext.getLuceneQueryParserAdaptor().getSearchParameters().getStores();
|
||||
if(stores.size() < 1)
|
||||
@@ -74,10 +74,10 @@ public class LuceneDescendant<Q, S, E extends Throwable> extends Descendant impl
|
||||
* org.apache.lucene.search.BooleanQuery, org.alfresco.service.cmr.dictionary.DictionaryService,
|
||||
* java.lang.String)
|
||||
*/
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, QueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
throws E
|
||||
{
|
||||
QueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
|
||||
LuceneQueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
|
||||
Argument argument = functionArgs.get(ARG_ANCESTOR);
|
||||
String id = (String) argument.getValue(functionContext);
|
||||
argument = functionArgs.get(ARG_SELECTOR);
|
||||
|
@@ -28,14 +28,14 @@ package org.alfresco.repo.search.impl.querymodel.impl.lucene.functions;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.repo.search.adaptor.QueryParserAdaptor;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneQueryParserAdaptor;
|
||||
import org.alfresco.repo.search.impl.querymodel.Argument;
|
||||
import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.PredicateMode;
|
||||
import org.alfresco.repo.search.impl.querymodel.QueryModelException;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.functions.Equals;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderComponent;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.QueryBuilderContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderContext;
|
||||
|
||||
/**
|
||||
* @author andyh
|
||||
@@ -58,10 +58,10 @@ public class LuceneEquals<Q, S, E extends Throwable> extends Equals implements
|
||||
* org.apache.lucene.search.BooleanQuery, org.alfresco.service.cmr.dictionary.DictionaryService,
|
||||
* java.lang.String)
|
||||
*/
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, QueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
throws E
|
||||
{
|
||||
QueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
|
||||
LuceneQueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
|
||||
setPropertyAndStaticArguments(functionArgs);
|
||||
|
||||
Q query = functionContext.buildLuceneEquality(lqpa, getPropertyName(), getStaticArgument().getValue(functionContext), PredicateMode.ANY, functionContext.getLuceneFunction(getFunctionArgument()));
|
||||
|
@@ -28,14 +28,14 @@ package org.alfresco.repo.search.impl.querymodel.impl.lucene.functions;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.repo.search.adaptor.QueryParserAdaptor;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneQueryParserAdaptor;
|
||||
import org.alfresco.repo.search.impl.querymodel.Argument;
|
||||
import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.PropertyArgument;
|
||||
import org.alfresco.repo.search.impl.querymodel.QueryModelException;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.functions.Exists;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderComponent;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.QueryBuilderContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderContext;
|
||||
import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter;
|
||||
|
||||
/**
|
||||
@@ -52,10 +52,10 @@ public class LuceneExists<Q, S, E extends Throwable> extends Exists implements L
|
||||
super();
|
||||
}
|
||||
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, QueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
throws E
|
||||
{
|
||||
QueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
|
||||
LuceneQueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
|
||||
PropertyArgument propertyArgument = (PropertyArgument) functionArgs.get(ARG_PROPERTY);
|
||||
Argument inverseArgument = functionArgs.get(ARG_NOT);
|
||||
Boolean not = DefaultTypeConverter.INSTANCE.convert(Boolean.class, inverseArgument.getValue(functionContext));
|
||||
|
@@ -28,13 +28,13 @@ package org.alfresco.repo.search.impl.querymodel.impl.lucene.functions;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.repo.search.adaptor.QueryParserAdaptor;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneQueryParserAdaptor;
|
||||
import org.alfresco.repo.search.impl.querymodel.Argument;
|
||||
import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.PropertyArgument;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.functions.FTSFuzzyTerm;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderComponent;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.QueryBuilderContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderContext;
|
||||
|
||||
/**
|
||||
* Fuzzy matching
|
||||
@@ -59,10 +59,10 @@ public class LuceneFTSFuzzyTerm<Q, S, E extends Throwable> extends FTSFuzzyTerm
|
||||
* org.apache.lucene.search.BooleanQuery, org.alfresco.service.cmr.dictionary.DictionaryService,
|
||||
* java.lang.String)
|
||||
*/
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, QueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
throws E
|
||||
{
|
||||
QueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
|
||||
LuceneQueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
|
||||
Argument argument = functionArgs.get(ARG_TERM);
|
||||
String term = (String) argument.getValue(functionContext);
|
||||
argument = functionArgs.get(ARG_MIN_SIMILARITY);
|
||||
|
@@ -28,15 +28,15 @@ package org.alfresco.repo.search.impl.querymodel.impl.lucene.functions;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.repo.search.adaptor.AnalysisMode;
|
||||
import org.alfresco.repo.search.adaptor.LuceneFunction;
|
||||
import org.alfresco.repo.search.adaptor.QueryParserAdaptor;
|
||||
import org.alfresco.repo.search.adaptor.lucene.AnalysisMode;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneFunction;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneQueryParserAdaptor;
|
||||
import org.alfresco.repo.search.impl.querymodel.Argument;
|
||||
import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.PropertyArgument;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.functions.FTSPhrase;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderComponent;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.QueryBuilderContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderContext;
|
||||
|
||||
/**
|
||||
* @author andyh
|
||||
@@ -59,10 +59,10 @@ public class LuceneFTSPhrase<Q, S, E extends Throwable> extends FTSPhrase implem
|
||||
* org.apache.lucene.search.BooleanQuery, org.alfresco.service.cmr.dictionary.DictionaryService,
|
||||
* java.lang.String)
|
||||
*/
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, QueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
throws E
|
||||
{
|
||||
QueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
|
||||
LuceneQueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
|
||||
Argument argument = functionArgs.get(ARG_PHRASE);
|
||||
String term = (String) argument.getValue(functionContext);
|
||||
|
||||
|
@@ -28,14 +28,14 @@ package org.alfresco.repo.search.impl.querymodel.impl.lucene.functions;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.repo.search.adaptor.AnalysisMode;
|
||||
import org.alfresco.repo.search.adaptor.QueryParserAdaptor;
|
||||
import org.alfresco.repo.search.adaptor.lucene.AnalysisMode;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneQueryParserAdaptor;
|
||||
import org.alfresco.repo.search.impl.querymodel.Argument;
|
||||
import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.PropertyArgument;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.functions.FTSPrefixTerm;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderComponent;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.QueryBuilderContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderContext;
|
||||
|
||||
/**
|
||||
* Perfix term
|
||||
@@ -59,10 +59,10 @@ public class LuceneFTSPrefixTerm<Q, S, E extends Throwable> extends FTSPrefixTer
|
||||
* org.apache.lucene.search.BooleanQuery, org.alfresco.service.cmr.dictionary.DictionaryService,
|
||||
* java.lang.String)
|
||||
*/
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, QueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
throws E
|
||||
{
|
||||
QueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
|
||||
LuceneQueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
|
||||
Argument argument = functionArgs.get(ARG_TERM);
|
||||
String term = (String) argument.getValue(functionContext);
|
||||
// strip trailing wildcard *
|
||||
|
@@ -28,13 +28,13 @@ package org.alfresco.repo.search.impl.querymodel.impl.lucene.functions;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.repo.search.adaptor.QueryParserAdaptor;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneQueryParserAdaptor;
|
||||
import org.alfresco.repo.search.impl.querymodel.Argument;
|
||||
import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.PropertyArgument;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.functions.FTSProximity;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderComponent;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.QueryBuilderContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderContext;
|
||||
|
||||
/**
|
||||
* Proximity
|
||||
@@ -59,10 +59,10 @@ public class LuceneFTSProximity<Q, S, E extends Throwable> extends FTSProximity
|
||||
* org.apache.lucene.search.BooleanQuery, org.alfresco.service.cmr.dictionary.DictionaryService,
|
||||
* java.lang.String)
|
||||
*/
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, QueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
throws E
|
||||
{
|
||||
QueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
|
||||
LuceneQueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
|
||||
Argument argument = functionArgs.get(ARG_FIRST);
|
||||
String first = (String) argument.getValue(functionContext);
|
||||
argument = functionArgs.get(ARG_LAST);
|
||||
|
@@ -28,15 +28,15 @@ package org.alfresco.repo.search.impl.querymodel.impl.lucene.functions;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.repo.search.adaptor.AnalysisMode;
|
||||
import org.alfresco.repo.search.adaptor.LuceneFunction;
|
||||
import org.alfresco.repo.search.adaptor.QueryParserAdaptor;
|
||||
import org.alfresco.repo.search.adaptor.lucene.AnalysisMode;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneFunction;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneQueryParserAdaptor;
|
||||
import org.alfresco.repo.search.impl.querymodel.Argument;
|
||||
import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.PropertyArgument;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.functions.FTSRange;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderComponent;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.QueryBuilderContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderContext;
|
||||
|
||||
/**
|
||||
* Range
|
||||
@@ -60,10 +60,10 @@ public class LuceneFTSRange<Q, S, E extends Throwable> extends FTSRange implemen
|
||||
* org.apache.lucene.search.BooleanQuery, org.alfresco.service.cmr.dictionary.DictionaryService,
|
||||
* java.lang.String)
|
||||
*/
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, QueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
throws E
|
||||
{
|
||||
QueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
|
||||
LuceneQueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
|
||||
Argument argument = functionArgs.get(ARG_FROM_INC);
|
||||
Boolean fromInc = (Boolean) argument.getValue(functionContext);
|
||||
argument = functionArgs.get(ARG_FROM);
|
||||
|
@@ -28,15 +28,15 @@ package org.alfresco.repo.search.impl.querymodel.impl.lucene.functions;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.repo.search.adaptor.AnalysisMode;
|
||||
import org.alfresco.repo.search.adaptor.LuceneFunction;
|
||||
import org.alfresco.repo.search.adaptor.QueryParserAdaptor;
|
||||
import org.alfresco.repo.search.adaptor.lucene.AnalysisMode;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneFunction;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneQueryParserAdaptor;
|
||||
import org.alfresco.repo.search.impl.querymodel.Argument;
|
||||
import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.PropertyArgument;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.functions.FTSTerm;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderComponent;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.QueryBuilderContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderContext;
|
||||
|
||||
/**
|
||||
* @author andyh
|
||||
@@ -58,10 +58,10 @@ public class LuceneFTSTerm<Q, S, E extends Throwable> extends FTSTerm implements
|
||||
* org.apache.lucene.search.BooleanQuery, org.alfresco.service.cmr.dictionary.DictionaryService,
|
||||
* java.lang.String)
|
||||
*/
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, QueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
throws E
|
||||
{
|
||||
QueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
|
||||
LuceneQueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
|
||||
Argument argument = functionArgs.get(ARG_TERM);
|
||||
String term = (String) argument.getValue(functionContext);
|
||||
argument = functionArgs.get(ARG_TOKENISATION_MODE);
|
||||
|
@@ -28,14 +28,14 @@ package org.alfresco.repo.search.impl.querymodel.impl.lucene.functions;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.repo.search.adaptor.AnalysisMode;
|
||||
import org.alfresco.repo.search.adaptor.QueryParserAdaptor;
|
||||
import org.alfresco.repo.search.adaptor.lucene.AnalysisMode;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneQueryParserAdaptor;
|
||||
import org.alfresco.repo.search.impl.querymodel.Argument;
|
||||
import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.PropertyArgument;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.functions.FTSWildTerm;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderComponent;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.QueryBuilderContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderContext;
|
||||
|
||||
/**
|
||||
* Wild Card
|
||||
@@ -60,10 +60,10 @@ public class LuceneFTSWildTerm<Q, S, E extends Throwable> extends FTSWildTerm im
|
||||
* org.apache.lucene.search.BooleanQuery, org.alfresco.service.cmr.dictionary.DictionaryService,
|
||||
* java.lang.String)
|
||||
*/
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, QueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
throws E
|
||||
{
|
||||
QueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
|
||||
LuceneQueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
|
||||
Argument argument = functionArgs.get(ARG_TERM);
|
||||
String term = (String) argument.getValue(functionContext);
|
||||
|
||||
|
@@ -28,14 +28,14 @@ package org.alfresco.repo.search.impl.querymodel.impl.lucene.functions;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.repo.search.adaptor.QueryParserAdaptor;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneQueryParserAdaptor;
|
||||
import org.alfresco.repo.search.impl.querymodel.Argument;
|
||||
import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.PredicateMode;
|
||||
import org.alfresco.repo.search.impl.querymodel.QueryModelException;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.functions.GreaterThan;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderComponent;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.QueryBuilderContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderContext;
|
||||
|
||||
/**
|
||||
* @author andyh
|
||||
@@ -58,10 +58,10 @@ public class LuceneGreaterThan<Q, S, E extends Throwable> extends GreaterThan im
|
||||
* org.apache.lucene.search.BooleanQuery, org.alfresco.service.cmr.dictionary.DictionaryService,
|
||||
* java.lang.String)
|
||||
*/
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, QueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
throws E
|
||||
{
|
||||
QueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
|
||||
LuceneQueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
|
||||
setPropertyAndStaticArguments(functionArgs);
|
||||
|
||||
Q query = functionContext.buildLuceneGreaterThan(lqpa, getPropertyName(), getStaticArgument().getValue(functionContext), PredicateMode.ANY, functionContext.getLuceneFunction(getFunctionArgument()));
|
||||
|
@@ -28,14 +28,14 @@ package org.alfresco.repo.search.impl.querymodel.impl.lucene.functions;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.repo.search.adaptor.QueryParserAdaptor;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneQueryParserAdaptor;
|
||||
import org.alfresco.repo.search.impl.querymodel.Argument;
|
||||
import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.PredicateMode;
|
||||
import org.alfresco.repo.search.impl.querymodel.QueryModelException;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.functions.GreaterThanOrEquals;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderComponent;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.QueryBuilderContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderContext;
|
||||
|
||||
/**
|
||||
* @author andyh
|
||||
@@ -59,10 +59,10 @@ public class LuceneGreaterThanOrEquals<Q, S, E extends Throwable> extends Greate
|
||||
* org.apache.lucene.search.BooleanQuery, org.alfresco.service.cmr.dictionary.DictionaryService,
|
||||
* java.lang.String)
|
||||
*/
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, QueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
throws E
|
||||
{
|
||||
QueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
|
||||
LuceneQueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
|
||||
setPropertyAndStaticArguments(functionArgs);
|
||||
|
||||
Q query = functionContext.buildLuceneGreaterThanOrEquals(lqpa, getPropertyName(), getStaticArgument().getValue(functionContext), PredicateMode.ANY, functionContext.getLuceneFunction(getFunctionArgument()));
|
||||
|
@@ -30,7 +30,7 @@ import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.repo.search.adaptor.QueryParserAdaptor;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneQueryParserAdaptor;
|
||||
import org.alfresco.repo.search.impl.querymodel.Argument;
|
||||
import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.ListArgument;
|
||||
@@ -40,7 +40,7 @@ import org.alfresco.repo.search.impl.querymodel.PropertyArgument;
|
||||
import org.alfresco.repo.search.impl.querymodel.QueryModelException;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.functions.In;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderComponent;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.QueryBuilderContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderContext;
|
||||
import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter;
|
||||
|
||||
/**
|
||||
@@ -64,10 +64,10 @@ public class LuceneIn<Q, S, E extends Throwable> extends In implements LuceneQue
|
||||
* org.alfresco.service.cmr.dictionary.DictionaryService, java.lang.String)
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, QueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
throws E
|
||||
{
|
||||
QueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
|
||||
LuceneQueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
|
||||
PropertyArgument propertyArgument = (PropertyArgument) functionArgs.get(ARG_PROPERTY);
|
||||
Argument inverseArgument = functionArgs.get(ARG_NOT);
|
||||
Boolean not = DefaultTypeConverter.INSTANCE.convert(Boolean.class, inverseArgument.getValue(functionContext));
|
||||
|
@@ -28,14 +28,14 @@ package org.alfresco.repo.search.impl.querymodel.impl.lucene.functions;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.repo.search.adaptor.QueryParserAdaptor;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneQueryParserAdaptor;
|
||||
import org.alfresco.repo.search.impl.querymodel.Argument;
|
||||
import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.PredicateMode;
|
||||
import org.alfresco.repo.search.impl.querymodel.QueryModelException;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.functions.LessThan;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderComponent;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.QueryBuilderContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderContext;
|
||||
|
||||
/**
|
||||
* @author andyh
|
||||
@@ -59,10 +59,10 @@ public class LuceneLessThan<Q, S, E extends Throwable> extends LessThan implemen
|
||||
* org.apache.lucene.search.BooleanQuery, org.alfresco.service.cmr.dictionary.DictionaryService,
|
||||
* java.lang.String)
|
||||
*/
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, QueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
throws E
|
||||
{
|
||||
QueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
|
||||
LuceneQueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
|
||||
setPropertyAndStaticArguments(functionArgs);
|
||||
|
||||
Q query = functionContext.buildLuceneLessThan(lqpa, getPropertyName(), getStaticArgument().getValue(functionContext), PredicateMode.ANY, functionContext.getLuceneFunction(getFunctionArgument()));
|
||||
|
@@ -28,14 +28,14 @@ package org.alfresco.repo.search.impl.querymodel.impl.lucene.functions;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.repo.search.adaptor.QueryParserAdaptor;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneQueryParserAdaptor;
|
||||
import org.alfresco.repo.search.impl.querymodel.Argument;
|
||||
import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.PredicateMode;
|
||||
import org.alfresco.repo.search.impl.querymodel.QueryModelException;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.functions.LessThanOrEquals;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderComponent;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.QueryBuilderContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderContext;
|
||||
|
||||
/**
|
||||
* @author andyh
|
||||
@@ -59,10 +59,10 @@ public class LuceneLessThanOrEquals<Q, S, E extends Throwable> extends LessThanO
|
||||
* org.apache.lucene.search.BooleanQuery, org.alfresco.service.cmr.dictionary.DictionaryService,
|
||||
* java.lang.String)
|
||||
*/
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, QueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
throws E
|
||||
{
|
||||
QueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
|
||||
LuceneQueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
|
||||
|
||||
setPropertyAndStaticArguments(functionArgs);
|
||||
|
||||
|
@@ -29,14 +29,14 @@ import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.repo.search.adaptor.QueryParserAdaptor;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneQueryParserAdaptor;
|
||||
import org.alfresco.repo.search.impl.querymodel.Argument;
|
||||
import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.PropertyArgument;
|
||||
import org.alfresco.repo.search.impl.querymodel.QueryModelException;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.functions.Like;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderComponent;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.QueryBuilderContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderContext;
|
||||
import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter;
|
||||
|
||||
/**
|
||||
@@ -61,10 +61,10 @@ public class LuceneLike<Q, S, E extends Throwable> extends Like implements Lucen
|
||||
* org.apache.lucene.search.BooleanQuery, org.alfresco.service.cmr.dictionary.DictionaryService,
|
||||
* java.lang.String)
|
||||
*/
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, QueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
throws E
|
||||
{
|
||||
QueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
|
||||
LuceneQueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
|
||||
PropertyArgument propertyArgument = (PropertyArgument) functionArgs.get(ARG_PROPERTY);
|
||||
Argument inverseArgument = functionArgs.get(ARG_NOT);
|
||||
Boolean not = DefaultTypeConverter.INSTANCE.convert(Boolean.class, inverseArgument.getValue(functionContext));
|
||||
|
@@ -33,7 +33,7 @@ import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.QueryModelException;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.functions.Lower;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderComponent;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.QueryBuilderContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderContext;
|
||||
|
||||
/**
|
||||
* @author andyh
|
||||
@@ -52,10 +52,10 @@ public class LuceneLower<Q, S, E extends Throwable> extends Lower implements Luc
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderComponent#addComponent(java.util.Set,
|
||||
* java.util.Map, org.alfresco.repo.search.impl.querymodel.impl.lucene.QueryBuilderContext,
|
||||
* java.util.Map, org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderContext,
|
||||
* org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext)
|
||||
*/
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, QueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
throws E
|
||||
{
|
||||
throw new QueryModelException("Unsupported function in query " + getName());
|
||||
|
@@ -28,14 +28,14 @@ package org.alfresco.repo.search.impl.querymodel.impl.lucene.functions;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.repo.search.adaptor.QueryParserAdaptor;
|
||||
import org.alfresco.repo.search.adaptor.lucene.LuceneQueryParserAdaptor;
|
||||
import org.alfresco.repo.search.impl.querymodel.Argument;
|
||||
import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.PredicateMode;
|
||||
import org.alfresco.repo.search.impl.querymodel.QueryModelException;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.functions.NotEquals;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderComponent;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.QueryBuilderContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderContext;
|
||||
|
||||
/**
|
||||
* @author andyh
|
||||
@@ -58,10 +58,10 @@ public class LuceneNotEquals<Q, S, E extends Throwable> extends NotEquals implem
|
||||
* org.apache.lucene.search.BooleanQuery, org.alfresco.service.cmr.dictionary.DictionaryService,
|
||||
* java.lang.String)
|
||||
*/
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, QueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
throws E
|
||||
{
|
||||
QueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
|
||||
LuceneQueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
|
||||
setPropertyAndStaticArguments(functionArgs);
|
||||
|
||||
Q query = functionContext.buildLuceneInequality(lqpa, getPropertyName(), getStaticArgument().getValue(functionContext), PredicateMode.ANY, functionContext
|
||||
|
@@ -33,7 +33,7 @@ import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.QueryModelException;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.functions.PropertyAccessor;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderComponent;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.QueryBuilderContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderContext;
|
||||
|
||||
/**
|
||||
* @author andyh
|
||||
@@ -49,9 +49,9 @@ public class LucenePropertyAccessor<Q, S, E extends Throwable> extends PropertyA
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderComponent#addComponent(java.util.Set, java.util.Map, org.alfresco.repo.search.impl.querymodel.impl.lucene.QueryBuilderContext, org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext)
|
||||
* @see org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderComponent#addComponent(java.util.Set, java.util.Map, org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderContext, org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext)
|
||||
*/
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, QueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
throws E
|
||||
{
|
||||
throw new QueryModelException("Unsupported function in query "+getName());
|
||||
|
@@ -33,7 +33,7 @@ import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.QueryModelException;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.functions.Score;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderComponent;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.QueryBuilderContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderContext;
|
||||
|
||||
/**
|
||||
* @author andyh
|
||||
@@ -51,9 +51,9 @@ public class LuceneScore<Q, S, E extends Throwable> extends Score implements Luc
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderComponent#addComponent(java.util.Set, java.util.Map, org.alfresco.repo.search.impl.querymodel.impl.lucene.QueryBuilderContext, org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext)
|
||||
* @see org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderComponent#addComponent(java.util.Set, java.util.Map, org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderContext, org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext)
|
||||
*/
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, QueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
throws E
|
||||
{
|
||||
throw new QueryModelException("Unsupported function in query "+getName());
|
||||
|
@@ -33,7 +33,7 @@ import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.QueryModelException;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.functions.Upper;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderComponent;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.QueryBuilderContext;
|
||||
import org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderContext;
|
||||
|
||||
/**
|
||||
* @author andyh
|
||||
@@ -50,9 +50,9 @@ public class LuceneUpper<Q, S, E extends Throwable> extends Upper implements Luc
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderComponent#addComponent(java.util.Set, java.util.Map, org.alfresco.repo.search.impl.querymodel.impl.lucene.QueryBuilderContext, org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext)
|
||||
* @see org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderComponent#addComponent(java.util.Set, java.util.Map, org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryBuilderContext, org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext)
|
||||
*/
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, QueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
|
||||
throws E
|
||||
{
|
||||
throw new QueryModelException("Unsupported function in query "+getName());
|
||||
|
@@ -149,6 +149,12 @@ public interface ClassDefinition
|
||||
*/
|
||||
public List<AspectDefinition> getDefaultAspects(boolean inherited);
|
||||
|
||||
/**
|
||||
* Get the name of the property bundle that defines analyser mappings for this class (keyed by the type of the property)
|
||||
* @return the resource or null if not set.
|
||||
*/
|
||||
public String getAnalyserResourceBundleName();
|
||||
|
||||
/**
|
||||
* Get the parent class definition
|
||||
*
|
||||
|
@@ -33,7 +33,6 @@ import org.alfresco.repo.dictionary.CustomModelsInfo;
|
||||
import org.alfresco.repo.dictionary.M2Model;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.util.Pair;
|
||||
|
||||
/**
|
||||
* Custom model service configuration API.
|
||||
@@ -106,14 +105,6 @@ public interface CustomModelService
|
||||
*/
|
||||
public NodeRef getModelNodeRef(String modelFileName);
|
||||
|
||||
/**
|
||||
* Gets custom model
|
||||
*
|
||||
* @param modelNodeRef the {@code NodeRef} of the custom model
|
||||
* @return m2Model the {@code M2Model} object
|
||||
*/
|
||||
public M2Model getM2Model(NodeRef modelNodeRef);
|
||||
|
||||
/**
|
||||
* Creates custom model
|
||||
*
|
||||
@@ -176,8 +167,6 @@ public interface CustomModelService
|
||||
*/
|
||||
public boolean isNamespaceUriExists(String modelNamespaceUri);
|
||||
|
||||
public boolean isNamespacePrefixExists(NodeRef modelNodeRef);
|
||||
|
||||
/**
|
||||
* Whether a model with the given name exists or not
|
||||
*
|
||||
@@ -186,35 +175,10 @@ public interface CustomModelService
|
||||
*/
|
||||
public boolean isModelExists(String modelFileName);
|
||||
|
||||
/**
|
||||
* Gets custom models' namespace URI and prefix
|
||||
*
|
||||
* @param model the {@code M2Model} object
|
||||
* @return the custom model URI and prefix as a {@code Pair<String, String}
|
||||
* @throws CustomModelException if no namespace or more than one namespace exists
|
||||
*/
|
||||
public Pair<String, String> getModelNamespaceUriPrefix(M2Model model);
|
||||
|
||||
/**
|
||||
* Validates the custom models' namespace prefix
|
||||
*
|
||||
* @param prefix the namespace prefix {@code String}
|
||||
* @throws CustomModelException if the namespace prefix is already in use by another model
|
||||
*/
|
||||
public void validateModelNamespacePrefix(String prefix);
|
||||
|
||||
/**
|
||||
* Validates the custom models' namespace prefix
|
||||
*
|
||||
* @param modelNodeRef the nodeRef of the model whose namespace prefix is to be validated {@code NodeRef}
|
||||
* @throws CustomModelException if the namespace prefix is already in use by another model
|
||||
*/
|
||||
public void validateModelNamespacePrefix(NodeRef modelNodeRef);
|
||||
|
||||
/**
|
||||
* Whether the given namespace prefix has already been used or not
|
||||
*
|
||||
* @param modelNamespacePrefix the model namespace prefix
|
||||
* @param modelNamespaceUri the model namespace prefix
|
||||
* @return true if the prefix has been used, false otherwise
|
||||
*/
|
||||
public boolean isNamespacePrefixExists(String modelNamespacePrefix);
|
||||
|
@@ -98,8 +98,33 @@ public interface DataTypeDefinition
|
||||
*/
|
||||
public String getDescription(MessageLookup messageLookup);
|
||||
|
||||
/**
|
||||
* Get the name of the property bundle that defines analyser mappings for this data type (keyed by the type of the property)
|
||||
* @return the resource or null if not set.
|
||||
*/
|
||||
public String getAnalyserResourceBundleName();
|
||||
|
||||
/**
|
||||
* @return the equivalent java class name (or null, if not mapped)
|
||||
*/
|
||||
public String getJavaClassName();
|
||||
|
||||
/**
|
||||
* Get the default analyser class - used when no resource bundles can be found and no repository default is set.
|
||||
* @return String
|
||||
*/
|
||||
public String getDefaultAnalyserClassName();
|
||||
|
||||
/**
|
||||
* @param locale
|
||||
* @return String
|
||||
*/
|
||||
public String resolveAnalyserClassName(Locale locale);
|
||||
|
||||
/**
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String resolveAnalyserClassName();
|
||||
|
||||
}
|
||||
|
@@ -105,6 +105,12 @@ public interface ModelDefinition
|
||||
|
||||
public long getChecksum(XMLBindingType bindingType);
|
||||
|
||||
/**
|
||||
* Get the name of the property bundle that defines analyser mappings for this model (keyed by the type of the property)
|
||||
* @return the resource or null if not set.
|
||||
*/
|
||||
public String getAnalyserResourceBundleName();
|
||||
|
||||
/**
|
||||
* @return DictionaryDAO
|
||||
*/
|
||||
|
@@ -161,4 +161,22 @@ public interface PropertyDefinition extends ClassAttributeDefinition
|
||||
* @return Returns a list of property constraint definitions
|
||||
*/
|
||||
public List<ConstraintDefinition> getConstraints();
|
||||
|
||||
/**
|
||||
* Get the name of the property bundle that defines analyser mappings for this class.
|
||||
* @return the resource or null if not set.
|
||||
*/
|
||||
public String getAnalyserResourceBundleName();
|
||||
|
||||
/**
|
||||
* @param locale Locale
|
||||
* @return String
|
||||
*/
|
||||
public String resolveAnalyserClassName(Locale locale);
|
||||
|
||||
/**
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String resolveAnalyserClassName();
|
||||
}
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Data model classes
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2020 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
|
||||
@@ -33,7 +33,8 @@ import org.alfresco.api.AlfrescoPublicApi;
|
||||
* same action might succeed, all other things not having changed.
|
||||
* <p/>
|
||||
* An example of this would be the case where a request to create a thumbnail
|
||||
* has failed because the necessary thumbnailing software is not available.
|
||||
* has failed because the necessary thumbnailing software is not available e.g. because the OpenOffice.org process
|
||||
* is not currently running.
|
||||
*
|
||||
* @author Neil Mc Erlean
|
||||
* @since 4.0.1
|
||||
|
@@ -50,36 +50,23 @@ import org.alfresco.service.namespace.QName;
|
||||
@AlfrescoPublicApi
|
||||
public interface SearchService
|
||||
{
|
||||
String LANGUAGE_LUCENE = "lucene";
|
||||
public static final String LANGUAGE_LUCENE = "lucene";
|
||||
|
||||
String LANGUAGE_XPATH = "xpath";
|
||||
public static final String LANGUAGE_XPATH = "xpath";
|
||||
|
||||
String LANGUAGE_FTS_ALFRESCO = "fts-alfresco";
|
||||
public static final String LANGUAGE_FTS_ALFRESCO = "fts-alfresco";
|
||||
|
||||
public static final String LANGUAGE_SOLR_FTS_ALFRESCO = "solr-fts-alfresco";
|
||||
|
||||
public static final String LANGUAGE_CMIS_STRICT = "cmis-strict";
|
||||
|
||||
public static final String LANGUAGE_CMIS_ALFRESCO = "cmis-alfresco";
|
||||
|
||||
String LANGUAGE_CMIS_STRICT = "cmis-strict";
|
||||
public static final String LANGUAGE_SOLR_CMIS = "solr-cmis";
|
||||
|
||||
String LANGUAGE_CMIS_ALFRESCO = "cmis-alfresco";
|
||||
|
||||
String LANGUAGE_INDEX_CMIS = "index-cmis";
|
||||
|
||||
String LANGUAGE_INDEX_ALFRESCO = "index-alfresco";
|
||||
|
||||
String LANGUAGE_INDEX_SQL = "index-sql";
|
||||
|
||||
String LANGUAGE_INDEX_FTS_ALFRESCO = "index-fts-alfresco";
|
||||
|
||||
// Old language names for solr subsystems retro compatibility
|
||||
@Deprecated
|
||||
String LANGUAGE_SOLR_FTS_ALFRESCO = "solr-fts-alfresco";
|
||||
|
||||
@Deprecated
|
||||
String LANGUAGE_SOLR_CMIS = "solr-cmis";
|
||||
|
||||
@Deprecated
|
||||
String LANGUAGE_SOLR_ALFRESCO = "solr-alfresco";
|
||||
|
||||
@Deprecated
|
||||
String LANGUAGE_SOLR_SQL = "solr-sql";
|
||||
public static final String LANGUAGE_SOLR_ALFRESCO = "solr-alfresco";
|
||||
|
||||
public static final String LANGUAGE_SOLR_SQL = "solr-sql";
|
||||
|
||||
/**
|
||||
* Search against a store. Pulls back all attributes on each node. Does not
|
||||
@@ -94,7 +81,7 @@ public interface SearchService
|
||||
* @return Returns the query results
|
||||
*/
|
||||
@Auditable(parameters = {"store", "language", "query"})
|
||||
ResultSet query(StoreRef store, String language, String query);
|
||||
public ResultSet query(StoreRef store, String language, String query);
|
||||
|
||||
/**
|
||||
* Search against a store.
|
||||
@@ -111,8 +98,8 @@ public interface SearchService
|
||||
* @return Returns the query results
|
||||
*/
|
||||
@Auditable(parameters = {"store", "language", "query", "queryParameterDefinitions"})
|
||||
ResultSet query(StoreRef store, String language, String query,
|
||||
QueryParameterDefinition[] queryParameterDefinitions);
|
||||
public ResultSet query(StoreRef store, String language, String query,
|
||||
QueryParameterDefinition[] queryParameterDefinitions);
|
||||
|
||||
|
||||
/**
|
||||
@@ -127,14 +114,14 @@ public interface SearchService
|
||||
* @return Returns the query results
|
||||
*/
|
||||
@Auditable(parameters = {"store", "queryId", "queryParameters"})
|
||||
ResultSet query(StoreRef store, QName queryId, QueryParameter[] queryParameters);
|
||||
public ResultSet query(StoreRef store, QName queryId, QueryParameter[] queryParameters);
|
||||
|
||||
/**
|
||||
* Search using the given SearchParameters
|
||||
*/
|
||||
|
||||
@Auditable(parameters = {"searchParameters"})
|
||||
ResultSet query(SearchParameters searchParameters);
|
||||
public ResultSet query(SearchParameters searchParameters);
|
||||
|
||||
/**
|
||||
* Select nodes using an xpath expression.
|
||||
@@ -156,8 +143,8 @@ public interface SearchService
|
||||
|
||||
parameters = {"contextNodeRef", "xpath", "parameters", "namespacePrefixResolver", "followAllParentLinks"},
|
||||
recordable = {true, true, true, false, true})
|
||||
List<NodeRef> selectNodes(NodeRef contextNodeRef, String xpath, QueryParameterDefinition[] parameters,
|
||||
NamespacePrefixResolver namespacePrefixResolver, boolean followAllParentLinks)
|
||||
public List<NodeRef> selectNodes(NodeRef contextNodeRef, String xpath, QueryParameterDefinition[] parameters,
|
||||
NamespacePrefixResolver namespacePrefixResolver, boolean followAllParentLinks)
|
||||
throws InvalidNodeRefException, XPathException;
|
||||
|
||||
/**
|
||||
@@ -182,8 +169,8 @@ public interface SearchService
|
||||
|
||||
parameters = {"contextNodeRef", "xpath", "parameters", "namespacePrefixResolver", "followAllParentLinks", "language"},
|
||||
recordable = {true, true, true, false, true, true})
|
||||
List<NodeRef> selectNodes(NodeRef contextNodeRef, String xpath, QueryParameterDefinition[] parameters,
|
||||
NamespacePrefixResolver namespacePrefixResolver, boolean followAllParentLinks, String language)
|
||||
public List<NodeRef> selectNodes(NodeRef contextNodeRef, String xpath, QueryParameterDefinition[] parameters,
|
||||
NamespacePrefixResolver namespacePrefixResolver, boolean followAllParentLinks, String language)
|
||||
throws InvalidNodeRefException, XPathException;
|
||||
|
||||
/**
|
||||
@@ -206,9 +193,9 @@ public interface SearchService
|
||||
|
||||
parameters = {"contextNodeRef", "xpath", "parameters", "namespacePrefixResolver", "followAllParentLinks"},
|
||||
recordable = {true, true, true, false, true})
|
||||
List<Serializable> selectProperties(NodeRef contextNodeRef, String xpath,
|
||||
QueryParameterDefinition[] parameters, NamespacePrefixResolver namespacePrefixResolver,
|
||||
boolean followAllParentLinks) throws InvalidNodeRefException, XPathException;
|
||||
public List<Serializable> selectProperties(NodeRef contextNodeRef, String xpath,
|
||||
QueryParameterDefinition[] parameters, NamespacePrefixResolver namespacePrefixResolver,
|
||||
boolean followAllParentLinks) throws InvalidNodeRefException, XPathException;
|
||||
|
||||
/**
|
||||
* Select properties using an xpath expression
|
||||
@@ -232,9 +219,9 @@ public interface SearchService
|
||||
|
||||
parameters = {"contextNodeRef", "xpath", "parameters", "namespacePrefixResolver", "followAllParentLinks", "language"},
|
||||
recordable = {true, true, true, false, true, true})
|
||||
List<Serializable> selectProperties(NodeRef contextNodeRef, String xpath,
|
||||
QueryParameterDefinition[] parameters, NamespacePrefixResolver namespacePrefixResolver,
|
||||
boolean followAllParentLinks, String language) throws InvalidNodeRefException, XPathException;
|
||||
public List<Serializable> selectProperties(NodeRef contextNodeRef, String xpath,
|
||||
QueryParameterDefinition[] parameters, NamespacePrefixResolver namespacePrefixResolver,
|
||||
boolean followAllParentLinks, String language) throws InvalidNodeRefException, XPathException;
|
||||
|
||||
/**
|
||||
* Search for string pattern in both the node text (if present) and node
|
||||
@@ -249,7 +236,7 @@ public interface SearchService
|
||||
* @return Returns true if the pattern could be found - uses the default OR operator
|
||||
*/
|
||||
@Auditable(parameters = {"nodeRef", "propertyQName", "googleLikePattern"})
|
||||
boolean contains(NodeRef nodeRef, QName propertyQName, String googleLikePattern)
|
||||
public boolean contains(NodeRef nodeRef, QName propertyQName, String googleLikePattern)
|
||||
throws InvalidNodeRefException;
|
||||
|
||||
/**
|
||||
@@ -265,7 +252,7 @@ public interface SearchService
|
||||
* @return Returns true if the pattern could be found
|
||||
*/
|
||||
@Auditable(parameters = {"nodeRef", "propertyQName", "googleLikePattern", "defaultOperator"})
|
||||
boolean contains(NodeRef nodeRef, QName propertyQName, String googleLikePattern, SearchParameters.Operator defaultOperator)
|
||||
public boolean contains(NodeRef nodeRef, QName propertyQName, String googleLikePattern, SearchParameters.Operator defaultOperator)
|
||||
throws InvalidNodeRefException;
|
||||
|
||||
/**
|
||||
@@ -283,6 +270,6 @@ public interface SearchService
|
||||
* @return Returns true if the pattern could be found
|
||||
*/
|
||||
@Auditable(parameters = {"nodeRef", "propertyQName", "sqlLikePattern", "includeFTS"})
|
||||
boolean like(NodeRef nodeRef, QName propertyQName, String sqlLikePattern, boolean includeFTS)
|
||||
public boolean like(NodeRef nodeRef, QName propertyQName, String sqlLikePattern, boolean includeFTS)
|
||||
throws InvalidNodeRefException;
|
||||
}
|
||||
|
@@ -100,25 +100,26 @@ public abstract class BaseApplicationContextHelper
|
||||
classpath[i] = resources[i].getURL();
|
||||
}
|
||||
// Let's give our classloader 'child-first' resource loading qualities!
|
||||
return new URLClassLoader(classpath, Thread.currentThread().getContextClassLoader())
|
||||
{
|
||||
@Override
|
||||
public URL getResource(String name)
|
||||
{
|
||||
URL ret = findResource(name);
|
||||
return ret == null ? super.getResource(name) : ret;
|
||||
}
|
||||
ClassLoader classLoader = new URLClassLoader(classpath, Thread.currentThread().getContextClassLoader())
|
||||
{
|
||||
@Override
|
||||
public URL getResource(String name)
|
||||
{
|
||||
URL ret = findResource(name);
|
||||
return ret == null ? super.getResource(name) : ret;
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public Enumeration<URL> getResources(String name) throws IOException
|
||||
{
|
||||
Enumeration[] tmp = new Enumeration[2];
|
||||
tmp[0] = findResources(name);
|
||||
tmp[1] = super.getResources(name);
|
||||
return new CompoundEnumeration<URL>(tmp);
|
||||
}
|
||||
};
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public Enumeration<URL> getResources(String name) throws IOException
|
||||
{
|
||||
Enumeration[] tmp = new Enumeration[2];
|
||||
tmp[0] = findResources(name);
|
||||
tmp[1] = super.getResources(name);
|
||||
return new CompoundEnumeration<URL>(tmp);
|
||||
}
|
||||
};
|
||||
return classLoader;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2021 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
@@ -57,10 +57,7 @@ public abstract class ConfigScheduler<Data>
|
||||
public static class ConfigSchedulerJob implements Job
|
||||
{
|
||||
@Override
|
||||
// Synchronized has little effect in normal operation, but on laptops that are suspended, there can be a number
|
||||
// of Threads calling execute concurrently without it, resulting in errors in the log. Theoretically possible in
|
||||
// production but not very likely.
|
||||
public synchronized void execute(JobExecutionContext context) throws JobExecutionException
|
||||
public void execute(JobExecutionContext context) throws JobExecutionException
|
||||
{
|
||||
JobDataMap dataMap = context.getJobDetail().getJobDataMap();
|
||||
ConfigScheduler configScheduler = (ConfigScheduler)dataMap.get(CONFIG_SCHEDULER);
|
||||
|
@@ -41,6 +41,9 @@
|
||||
<property name="dictionaryRegistryCache">
|
||||
<ref bean="compiledModelsCache"/>
|
||||
</property>
|
||||
<property name="defaultAnalyserResourceBundleName">
|
||||
<value>${lucene.defaultAnalyserResourceBundleName}</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="threadFactory" class="org.alfresco.util.TraceableThreadFactory">
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user