Merge branch 'master' into dependabot/maven/e2e-test/rm.version-3.3.1

This commit is contained in:
Tom Page
2020-07-16 11:10:36 +01:00
committed by GitHub
396 changed files with 10521 additions and 3006 deletions
+1
View File
@@ -0,0 +1 @@
* alex.mukha@alfresco.com
@@ -17,8 +17,10 @@ $ tree generators/app/templates/
│   ├── .env
│   ├── docker-compose-ce.yml
│   └── docker-compose-ee.yml
├── empty
│   ── empty
├── latest
│   ── .env
│   ├── docker-compose-ce.yml
│   └── docker-compose-ee.yml├── empty
├── images
│   ├── alfresco
│   │   ├── Dockerfile
@@ -42,7 +44,7 @@ $ tree generators/app/templates/
│   │   └── sharding-share-config-custom.xml
│   └── zeppelin
│   └── Dockerfile
└── keystores
└── keystores :: 6.x / 7.x
├── alfresco
├── client
├── solr
@@ -50,8 +52,8 @@ $ tree generators/app/templates/
```
* `.env` includes default values for Docker Compose environment variables
* `docker-compose-ce.yml` is the base Docker Compose Template for Alfresco Community deployment (for ACS 6.2 and ACS 6.1)
* `docker-compose-ee.yml` is the base Docker Compose Template for Alfresco Enterprise deployment (for ACS 6.2 and ACS 6.1)
* `docker-compose-ce.yml` is the base Docker Compose Template for Alfresco Community deployment (for latest, ACS 6.2 and ACS 6.1)
* `docker-compose-ee.yml` is the base Docker Compose Template for Alfresco Enterprise deployment (for latest, ACS 6.2 and ACS 6.1)
* `alfresco` includes a Dockerfile template to start Alfresco Repository
* `model` includes a default content model (Sharding Explicit Routing or empty). This `empty` file is required for Dockerfile to work, so it should not be deleted.
* `share` includes a Dockerfile template to start Share Web Application
@@ -59,7 +61,7 @@ $ tree generators/app/templates/
* `search` includes a Dockerfile template to start Search Services and Insight Engine
* `config` includes configuration for HTTP Web Proxy (NGINX)
* `zeppelin` includes a Dockerfile template to start Zeppelin with SSL
* `keystores` includes every truststore and keystore required for SSL configuration
* `keystores` includes every truststore and keystore required for SSL configuration. Included different stores for ACS 6.x and ACS 7.x, as there were changes between this versions
## Installation
@@ -80,15 +82,17 @@ $ yo alfresco-docker-compose
## ACS Version
Currently supported ACS Versions are `6.2` and `6.1`
Currently supported ACS Versions are `latest`, `6.2` and `6.1`
This is the first choice to be selected when the generator is executed.
```
? Which ACS version do you want to use?
6.1
6.2
6.2
latest
```
## AGS Version
Currently supported AGS Version is `latest` (based in ACS 6.1).
@@ -197,7 +201,7 @@ $ yo alfresco-docker-compose --acsVersion=6.2 --alfrescoVersion=community --http
**Parameter names reference**
`--acsVersion`: default 6.2, but could be set to 6.1
`--acsVersion`: default latest, but could be set to 6.2 or 6.1
`--ags:`: only available when acsVersion=6.1
`--alfrescoVersion`: community or enterprise
`--httpMode`: http or https
@@ -21,8 +21,8 @@ module.exports = class extends Generator {
type: 'list',
name: 'acsVersion',
message: 'Which ACS version do you want to use?',
choices: [ "6.1", "6.2" ],
default: '6.2'
choices: [ '6.1', '6.2', 'latest' ],
default: 'latest'
},
{
whenFunction: response => response.acsVersion == '6.1',
@@ -102,6 +102,19 @@ module.exports = class extends Generator {
],
default: 'DB_ID'
},
{
type: 'list',
name: 'searchLogLevel',
message: 'What log level do you want to use for search?',
choices: [
"TRACE",
"DEBUG",
"INFO",
"WARN",
"ERROR"
],
default: 'WARN'
},
{
whenFunction: response => response.alfrescoVersion == 'enterprise',
type: 'confirm',
@@ -143,10 +156,8 @@ module.exports = class extends Generator {
// Generate boilerplate from "templates" folder
writing() {
var dockerComposeTemplateDirectory = '6.2';
if (this.props.acsVersion.startsWith('6.1')) {
dockerComposeTemplateDirectory = '6.1';
}
// Set base template directory: 6.1, 6.2, latest
var dockerComposeTemplateDirectory = this.props.acsVersion;
// Docker Compose environment variables values
this.fs.copyTpl(
@@ -181,10 +192,10 @@ module.exports = class extends Generator {
(this.props.alfrescoVersion == 'community' ?
(this.props.ags ?
'alfresco/alfresco-governance-share-community' :
'alfresco/alfresco-share') :
'quay.io/alfresco/alfresco-share') :
(this.props.ags ?
'quay.io/alfresco/alfresco-governance-share-enterprise':
'alfresco/alfresco-share'
'quay.io/alfresco/alfresco-share'
)
);
@@ -216,7 +227,8 @@ module.exports = class extends Generator {
zeppelin: (this.props.zeppelin ? "true" : "false"),
sharding: (this.props.sharding ? "true" : "false"),
shardingMethod: (this.props.shardingMethod),
gzip: (this.props.gzip ? "true" : "false")
gzip: (this.props.gzip ? "true" : "false"),
searchLogLevel: this.props.searchLogLevel
}
);
@@ -297,21 +309,23 @@ module.exports = class extends Generator {
// Add resources for SSL configuration
if (this.props.httpMode == 'https') {
// Currently Community 'latest' only supports OLD keystores and trustores format
var subfolder = (this.props.acsVersion == 'latest' && this.props.alfrescoVersion == 'enterprise') ? '7.x' : '6.x'
this.fs.copy(
this.templatePath('keystores/alfresco'),
this.templatePath('keystores/' + subfolder + '/alfresco'),
this.destinationPath('keystores/alfresco')
)
this.fs.copy(
this.templatePath('keystores/solr'),
this.templatePath('keystores/' + subfolder + '/solr'),
this.destinationPath('keystores/solr')
)
this.fs.copy(
this.templatePath('keystores/client'),
this.templatePath('keystores/' + subfolder + '/client'),
this.destinationPath('keystores/client')
)
if (this.props.zeppelin == true) {
this.fs.copy(
this.templatePath('keystores/zeppelin'),
this.templatePath('keystores/' + subfolder + '/zeppelin'),
this.destinationPath('keystores/zeppelin')
)
}
@@ -50,6 +50,7 @@ services:
KEYSTORE_TYPE: JCEKS <% } %> <% if (replication) { %>
ENABLE_MASTER: "true"
ENABLE_SLAVE: "false" <% } %>
SEARCH_LOG_LEVEL: <%=searchLogLevel%>
mem_limit: 1200m
environment:
#Solr needs to know how to register itself with Alfresco
@@ -183,4 +184,4 @@ services:
- alfresco
- share
- solr6
- content-app
- content-app
@@ -69,6 +69,7 @@ services:
SHARD_KEY: "shard:shardId" <% } %> <% if (shardingMethod == 'EXPLICIT_ID' || shardingMethod == 'EXPLICIT_ID_FALLBACK_LRIS') { %>
SHARD_KEY: "shard:shardId" <% } %>
SHARDING_METHOD: <%=shardingMethod%> <% } %>
SEARCH_LOG_LEVEL: <%=searchLogLevel%>
mem_limit: 1200m
environment:
#Solr needs to know how to register itself with Alfresco
@@ -331,4 +332,4 @@ volumes:
shared-file-store-volume:
driver_opts:
type: tmpfs
device: tmpfs
device: tmpfs
@@ -1,15 +1,13 @@
ALFRESCO_TAG=latest
SHARE_TAG=6.2.0
ALFRESCO_TAG=6.2.1
ALFRESCO_CE_TAG=6.2.0-ga
SHARE_TAG=6.2.1
POSTGRES_TAG=11.4
TRANSFORM_ROUTER_TAG=1.1.0
PDF_RENDERER_TAG=2.1.0
IMAGE_MAGICK_TAG=2.1.0
LIBREOFFICE_TAG=2.1.0
TIKA_TAG=2.1.0
TRANSFORM_MISC_TAG=2.1.0
SHARED_FILE_STORE_TAG=0.5.3
TRANSFORM_ROUTER_TAG=1.2.0
TRANSFORM_CORE_AIO_TAG=2.2.1
TRANSFORMER_TAG=2.1.0
SHARED_FILE_STORE_TAG=0.7.0
ACTIVE_MQ_TAG=5.15.8
DIGITAL_WORKSPACE_TAG=1.3.0
DIGITAL_WORKSPACE_TAG=1.5.0
ACS_NGINX_TAG=3.0.1
ACS_COMMUNITY_NGINX_TAG=1.0.0
SEARCH_TAG=latest
@@ -7,7 +7,7 @@ services:
build:
context: ./alfresco
args:
ALFRESCO_TAG: ${ALFRESCO_TAG}
ALFRESCO_TAG: ${ALFRESCO_CE_TAG}
SOLR_COMMS: <%=secureComms%> <% if (httpMode == 'https') { %>
TRUSTSTORE_TYPE: JCEKS
TRUSTSTORE_PASS: kT9X6oe68t
@@ -68,6 +68,7 @@ services:
ENABLE_MASTER: "true"
ENABLE_SLAVE: "false" <% } %>
COMPRESS_CONTENT: "<%=gzip%>"
SEARCH_LOG_LEVEL: <%=searchLogLevel%>
mem_limit: 1200m
environment:
#Solr needs to know how to register itself with Alfresco
@@ -141,7 +142,7 @@ services:
<% } %>
alfresco-pdf-renderer:
image: alfresco/alfresco-pdf-renderer:${PDF_RENDERER_TAG}
image: alfresco/alfresco-pdf-renderer:${TRANSFORMER_TAG}
mem_limit: 1g
environment:
JAVA_OPTS: " -Xms256m -Xmx512m"
@@ -149,7 +150,7 @@ services:
- 8090:8090
imagemagick:
image: alfresco/alfresco-imagemagick:${IMAGE_MAGICK_TAG}
image: alfresco/alfresco-imagemagick:${TRANSFORMER_TAG}
mem_limit: 1g
environment:
JAVA_OPTS: " -Xms256m -Xmx512m"
@@ -157,7 +158,7 @@ services:
- 8091:8090
libreoffice:
image: alfresco/alfresco-libreoffice:${LIBREOFFICE_TAG}
image: alfresco/alfresco-libreoffice:${TRANSFORMER_TAG}
mem_limit: 1g
environment:
JAVA_OPTS: " -Xms256m -Xmx512m"
@@ -165,7 +166,7 @@ services:
- 8092:8090
tika:
image: alfresco/alfresco-tika:${TIKA_TAG}
image: alfresco/alfresco-tika:${TRANSFORMER_TAG}
mem_limit: 1g
environment:
JAVA_OPTS: " -Xms256m -Xmx512m"
@@ -173,7 +174,7 @@ services:
- 8093:8090
transform-misc:
image: alfresco/alfresco-transform-misc:${TRANSFORM_MISC_TAG}
image: alfresco/alfresco-transform-misc:${TRANSFORMER_TAG}
mem_limit: 1g
environment:
JAVA_OPTS: " -Xms256m -Xmx512m"
@@ -242,4 +243,4 @@ services:
- alfresco
- share
- solr6
- content-app
- content-app
@@ -34,20 +34,12 @@ services:
-Dtransform.service.enabled=true
-Dtransform.service.url=http://transform-router:8095
-Dsfs.url=http://shared-file-store:8099/
-Dlocal.transform.service.enabled=true
-DlocalTransform.pdfrenderer.url=http://alfresco-pdf-renderer:8090/
-DlocalTransform.imagemagick.url=http://imagemagick:8090/
-DlocalTransform.libreoffice.url=http://libreoffice:8090/
-DlocalTransform.tika.url=http://tika:8090/
-DlocalTransform.misc.url=http://transform-misc:8090/
-Dlegacy.transform.service.enabled=true
-Dalfresco-pdf-renderer.url=http://alfresco-pdf-renderer:8090/
-Djodconverter.url=http://libreoffice:8090/
-Dimg.url=http://imagemagick:8090/
-Dtika.url=http://tika:8090/
-Dtransform.misc.url=http://transform-misc:8090/
-DlocalTransform.core-aio.url=http://transform-core-aio:8090/
-Dalfresco-pdf-renderer.url=http://transform-core-aio:8090/
-Djodconverter.url=http://transform-core-aio:8090/
-Dimg.url=http://transform-core-aio:8090/
-Dtika.url=http://transform-core-aio:8090/
-Dtransform.misc.url=http://transform-core-aio:8090/
-Dcsrf.filter.enabled=false
-Dalfresco.restApi.basicAuthScheme=true
@@ -80,6 +72,7 @@ services:
SHARD_KEY: "shard:shardId" <% } %>
SHARDING_METHOD: <%=shardingMethod%> <% } %>
COMPRESS_CONTENT: "<%=gzip%>"
SEARCH_LOG_LEVEL: <%=searchLogLevel%>
mem_limit: 1200m
environment:
#Solr needs to know how to register itself with Alfresco
@@ -207,75 +200,24 @@ services:
environment:
JAVA_OPTS: " -Xms256m -Xmx512m"
ACTIVEMQ_URL: "nio://activemq:61616"
IMAGEMAGICK_URL: "http://imagemagick:8090"
PDF_RENDERER_URL : "http://alfresco-pdf-renderer:8090"
LIBREOFFICE_URL : "http://libreoffice:8090"
TIKA_URL : "http://tika:8090"
CORE_AIO_URL : "http://transform-core-aio:8090"
FILE_STORE_URL: "http://shared-file-store:8099/alfresco/api/-default-/private/sfs/versions/1/file"
ports:
- 8095:8095
links:
- activemq
alfresco-pdf-renderer:
image: alfresco/alfresco-pdf-renderer:${PDF_RENDERER_TAG}
mem_limit: 1g
transform-core-aio:
image: alfresco/alfresco-transform-core-aio:${TRANSFORM_CORE_AIO_TAG}
mem_limit: 1536m
environment:
JAVA_OPTS: " -Xms256m -Xmx512m"
JAVA_OPTS: " -Xms256m -Xmx1536m"
ACTIVEMQ_URL: "nio://activemq:61616"
FILE_STORE_URL: "http://shared-file-store:8099/alfresco/api/-default-/private/sfs/versions/1/file"
ports:
- 8090:8090
links:
- activemq
imagemagick:
image: alfresco/alfresco-imagemagick:${IMAGE_MAGICK_TAG}
mem_limit: 1g
environment:
JAVA_OPTS: " -Xms256m -Xmx512m"
ACTIVEMQ_URL: "nio://activemq:61616"
FILE_STORE_URL: "http://shared-file-store:8099/alfresco/api/-default-/private/sfs/versions/1/file"
ports:
- 8091:8090
links:
- activemq
libreoffice:
image: alfresco/alfresco-libreoffice:${LIBREOFFICE_TAG}
mem_limit: 1g
environment:
JAVA_OPTS: " -Xms256m -Xmx512m"
ACTIVEMQ_URL: "nio://activemq:61616"
FILE_STORE_URL: "http://shared-file-store:8099/alfresco/api/-default-/private/sfs/versions/1/file"
ports:
- 8092:8090
links:
- activemq
tika:
image: alfresco/alfresco-tika:${TIKA_TAG}
mem_limit: 1g
environment:
JAVA_OPTS: " -Xms256m -Xmx512m"
ACTIVEMQ_URL: "nio://activemq:61616"
FILE_STORE_URL: "http://shared-file-store:8099/alfresco/api/-default-/private/sfs/versions/1/file"
ports:
- 8093:8090
links:
- activemq
transform-misc:
image: alfresco/alfresco-transform-misc:${TRANSFORM_MISC_TAG}
mem_limit: 1g
environment:
JAVA_OPTS: " -Xms256m -Xmx512m"
ACTIVEMQ_URL: "nio://activemq:61616"
FILE_STORE_URL: "http://shared-file-store:8099/alfresco/api/-default-/private/sfs/versions/1/file"
ports:
- 8094:8090
links:
- activemq
- activemq
shared-file-store:
image: alfresco/alfresco-shared-file-store:${SHARED_FILE_STORE_TAG}
@@ -320,7 +262,7 @@ services:
activemq:
image: alfresco/alfresco-activemq:${ACTIVE_MQ_TAG}
mem_limit: 512m
mem_limit: 1g
ports:
- 8161:8161 # Web Console
- 5672:5672 # AMQP
@@ -32,16 +32,31 @@ ENV TRUSTSTORE_TYPE $TRUSTSTORE_TYPE
ARG KEYSTORE_TYPE
ENV KEYSTORE_TYPE $KEYSTORE_TYPE
# Passwords using Env Vars
ARG PASSWORDS_AS_ENV_VARS
ENV PASSWORDS_AS_ENV_VARS $PASSWORDS_AS_ENV_VARS
# Set SSL properties
RUN if [ "$ALFRESCO_COMMS" == "https" ] ; then \
sed -i '/^bash.*/i \
sed -i "'"s/alfresco.encryption.ssl.keystore.location=.*/alfresco.encryption.ssl.keystore.location=\\\/opt\\\/<%=searchPath%>\\\/keystore\\\/ssl.repo.client.keystore/g"'" ${DIST_DIR}/solrhome/templates/rerank/conf/solrcore.properties && \
sed -i "'"s/alfresco.encryption.ssl.keystore.passwordFileLocation=.*/alfresco.encryption.ssl.keystore.passwordFileLocation=\\\/opt\\\/<%=searchPath%>\\\/keystore\\\/ssl-keystore-passwords.properties/g"'" ${DIST_DIR}/solrhome/templates/rerank/conf/solrcore.properties && \
sed -i "'"s/alfresco.encryption.ssl.keystore.type=.*/alfresco.encryption.ssl.keystore.type=${KEYSTORE_TYPE}/g"'" ${DIST_DIR}/solrhome/templates/rerank/conf/solrcore.properties && \
sed -i "'"s/alfresco.encryption.ssl.truststore.location=.*/alfresco.encryption.ssl.truststore.location=\\\/opt\\\/<%=searchPath%>\\\/keystore\\\/ssl.repo.client.truststore/g"'" ${DIST_DIR}/solrhome/templates/rerank/conf/solrcore.properties && \
sed -i "'"s/alfresco.encryption.ssl.truststore.passwordFileLocation=.*/alfresco.encryption.ssl.truststore.passwordFileLocation=\\\/opt\\\/<%=searchPath%>\\\/keystore\\\/ssl-truststore-passwords.properties/g"'" ${DIST_DIR}/solrhome/templates/rerank/conf/solrcore.properties && \
sed -i "'"s/alfresco.encryption.ssl.truststore.type=.*/alfresco.encryption.ssl.truststore.type=${TRUSTSTORE_TYPE}/g"'" ${DIST_DIR}/solrhome/templates/rerank/conf/solrcore.properties' \
${DIST_DIR}/solr/bin/search_config_setup.sh; \
if [ "$PASSWORDS_AS_ENV_VARS" == "true" ]; then \
sed -i '/^bash.*/i \
sed -i "'"s/alfresco.encryption.ssl.keystore.location=.*/alfresco.encryption.ssl.keystore.location=\\\/opt\\\/<%=searchPath%>\\\/keystore\\\/ssl-repo-client.keystore/g"'" ${DIST_DIR}/solrhome/templates/rerank/conf/solrcore.properties && \
sed -i "'"s/alfresco.encryption.ssl.keystore.passwordFileLocation=.*/alfresco.encryption.ssl.keystore.passwordFileLocation=/g"'" ${DIST_DIR}/solrhome/templates/rerank/conf/solrcore.properties && \
sed -i "'"s/alfresco.encryption.ssl.keystore.type=.*/alfresco.encryption.ssl.keystore.type=${KEYSTORE_TYPE}/g"'" ${DIST_DIR}/solrhome/templates/rerank/conf/solrcore.properties && \
sed -i "'"s/alfresco.encryption.ssl.truststore.location=.*/alfresco.encryption.ssl.truststore.location=\\\/opt\\\/<%=searchPath%>\\\/keystore\\\/ssl-repo-client.truststore/g"'" ${DIST_DIR}/solrhome/templates/rerank/conf/solrcore.properties && \
sed -i "'"s/alfresco.encryption.ssl.truststore.passwordFileLocation=.*/alfresco.encryption.ssl.truststore.passwordFileLocation=/g"'" ${DIST_DIR}/solrhome/templates/rerank/conf/solrcore.properties && \
sed -i "'"s/alfresco.encryption.ssl.truststore.type=.*/alfresco.encryption.ssl.truststore.type=${TRUSTSTORE_TYPE}/g"'" ${DIST_DIR}/solrhome/templates/rerank/conf/solrcore.properties' \
${DIST_DIR}/solr/bin/search_config_setup.sh; \
else \
sed -i '/^bash.*/i \
sed -i "'"s/alfresco.encryption.ssl.keystore.location=.*/alfresco.encryption.ssl.keystore.location=\\\/opt\\\/<%=searchPath%>\\\/keystore\\\/ssl.repo.client.keystore/g"'" ${DIST_DIR}/solrhome/templates/rerank/conf/solrcore.properties && \
sed -i "'"s/alfresco.encryption.ssl.keystore.passwordFileLocation=.*/alfresco.encryption.ssl.keystore.passwordFileLocation=\\\/opt\\\/<%=searchPath%>\\\/keystore\\\/ssl-keystore-passwords.properties/g"'" ${DIST_DIR}/solrhome/templates/rerank/conf/solrcore.properties && \
sed -i "'"s/alfresco.encryption.ssl.keystore.type=.*/alfresco.encryption.ssl.keystore.type=${KEYSTORE_TYPE}/g"'" ${DIST_DIR}/solrhome/templates/rerank/conf/solrcore.properties && \
sed -i "'"s/alfresco.encryption.ssl.truststore.location=.*/alfresco.encryption.ssl.truststore.location=\\\/opt\\\/<%=searchPath%>\\\/keystore\\\/ssl.repo.client.truststore/g"'" ${DIST_DIR}/solrhome/templates/rerank/conf/solrcore.properties && \
sed -i "'"s/alfresco.encryption.ssl.truststore.passwordFileLocation=.*/alfresco.encryption.ssl.truststore.passwordFileLocation=\\\/opt\\\/<%=searchPath%>\\\/keystore\\\/ssl-truststore-passwords.properties/g"'" ${DIST_DIR}/solrhome/templates/rerank/conf/solrcore.properties && \
sed -i "'"s/alfresco.encryption.ssl.truststore.type=.*/alfresco.encryption.ssl.truststore.type=${TRUSTSTORE_TYPE}/g"'" ${DIST_DIR}/solrhome/templates/rerank/conf/solrcore.properties' \
${DIST_DIR}/solr/bin/search_config_setup.sh; \
fi \
fi
# REPLICATION
@@ -137,4 +152,12 @@ fi
RUN mkdir ${DIST_DIR}/keystore \
&& chown -R solr:solr ${DIST_DIR}/keystore
# Set the search log level if requested.
ARG SEARCH_LOG_LEVEL
ENV SEARCH_LOG_LEVEL $SEARCH_LOG_LEVEL
RUN if [ "$SEARCH_LOG_LEVEL" ] ; then \
sed -i '/^bash.*/i sed -i "'"s/log4j.rootLogger=WARN, file, CONSOLE/log4j.rootLogger=${SEARCH_LOG_LEVEL}, file, CONSOLE/g"'" ${DIST_DIR}/logs/log4j.properties\n' \
${DIST_DIR}/solr/bin/search_config_setup.sh; \
fi
VOLUME ["${DIST_DIR}/keystore"]
@@ -0,0 +1,14 @@
ALFRESCO_TAG=6.3.0-A10
ALFRESCO_CE_TAG=latest
SHARE_TAG=latest
POSTGRES_TAG=11.4
TRANSFORM_ROUTER_TAG=1.2.0
TRANSFORM_CORE_AIO_TAG=2.2.1
SHARED_FILE_STORE_TAG=0.7.0
ACTIVE_MQ_TAG=5.15.8
DIGITAL_WORKSPACE_TAG=1.5.0
ACS_NGINX_TAG=3.0.1
ACS_COMMUNITY_NGINX_TAG=1.0.0
SEARCH_TAG=latest
ZEPPELIN_TAG=latest
ACA_TAG=master-latest
@@ -0,0 +1,207 @@
# Using version 2 as 3 does not support resource constraint options (cpu_*, mem_* limits) for non swarm mode in Compose
version: "2"
services:
alfresco:
build:
context: ./alfresco
args:
ALFRESCO_TAG: ${ALFRESCO_CE_TAG}
SOLR_COMMS: <%=secureComms%> <% if (httpMode == 'https') { %>
TRUSTSTORE_TYPE: JCEKS
TRUSTSTORE_PASS: kT9X6oe68t
KEYSTORE_TYPE: JCEKS
KEYSTORE_PASS: kT9X6oe68t <% } %>
COMPRESS_CONTENT: "<%=gzip%>"
mem_limit: 1800m
environment:
JAVA_OPTS : "
-Ddb.driver=org.postgresql.Driver
-Ddb.username=alfresco
-Ddb.password=alfresco
-Ddb.url=jdbc:postgresql://postgres:5432/alfresco
-Dsolr.host=<%=searchSolrHost%>
-Dsolr.port.ssl=8983
-Dsolr.secureComms=<%=secureComms%>
-Dsolr.baseUrl=/solr
-Dindex.subsystem.name=solr6
-Dshare.host=localhost
-Dalfresco.port=8080
-Daos.baseUrlOverwrite=http://localhost:8080/alfresco/aos
-Dmessaging.broker.url=\"failover:(nio://activemq:61616)?timeout=3000&jms.useCompression=true\"
-Ddeployment.method=DOCKER_COMPOSE
-DlocalTransform.core-aio.url=http://transform-core-aio:8090/
-Dalfresco-pdf-renderer.url=http://transform-core-aio:8090/
-Djodconverter.url=http://transform-core-aio:8090/
-Dimg.url=http://transform-core-aio:8090/
-Dtika.url=http://transform-core-aio:8090/
-Dtransform.misc.url=http://transform-core-aio:8090/
-Dcsrf.filter.enabled=false
-Dalfresco.restApi.basicAuthScheme=true
-Xms1500m -Xmx1500m
" <% if (httpMode == 'https') { %>
ports:
- 8443:8443
volumes:
- ./keystores/alfresco:/usr/local/tomcat/alf_data/keystore <% } %>
solr6:
build:
context: ./search
args:
SEARCH_TAG: ${SEARCH_TAG}
SOLR_HOSTNAME: solr6
ALFRESCO_HOSTNAME: alfresco
ALFRESCO_COMMS: <%=secureComms%> <% if (httpMode == 'https') { %>
TRUSTSTORE_TYPE: JCEKS
KEYSTORE_TYPE: JCEKS <% } %> <% if (replication) { %>
ENABLE_MASTER: "true"
ENABLE_SLAVE: "false" <% } %>
COMPRESS_CONTENT: "<%=gzip%>"
SEARCH_LOG_LEVEL: <%=searchLogLevel%>
mem_limit: 1200m
environment:
#Solr needs to know how to register itself with Alfresco
SOLR_ALFRESCO_HOST: "alfresco"
SOLR_ALFRESCO_PORT: "<%=alfrescoPort%>"
ALFRESCO_SECURE_COMMS: <%=secureComms%>
#Alfresco needs to know how to call solr
SOLR_SOLR_HOST: "solr6"
SOLR_SOLR_PORT: "8983"
#Create the default alfresco and archive cores
SOLR_CREATE_ALFRESCO_DEFAULTS: "alfresco,archive"
SOLR_JAVA_MEM: "-Xms1g -Xmx1g" <% if (httpMode == 'https') { %>
SOLR_SSL_TRUST_STORE: "/opt/<%=searchPath%>/keystore/ssl.repo.client.truststore"
SOLR_SSL_TRUST_STORE_PASSWORD: "kT9X6oe68t"
SOLR_SSL_TRUST_STORE_TYPE: "JCEKS"
SOLR_SSL_KEY_STORE: "/opt/<%=searchPath%>/keystore/ssl.repo.client.keystore"
SOLR_SSL_KEY_STORE_PASSWORD: "kT9X6oe68t"
SOLR_SSL_KEY_STORE_TYPE: "JCEKS"
SOLR_SSL_NEED_CLIENT_AUTH: "true"
SOLR_OPTS: "
-Dsolr.ssl.checkPeerName=false
-Dsolr.allow.unsafe.resourceloading=true
" <% } %>
ports:
- 8083:8983 <% if (httpMode == 'https') { %>
volumes:
- ./keystores/solr:/opt/<%=searchPath%>/keystore <% } %>
<% if (replication) { %>
solr6secondary:
build:
context: ./search
args:
SEARCH_TAG: ${SEARCH_TAG}
SOLR_HOSTNAME: solr6secondary
ALFRESCO_HOSTNAME: alfresco
ALFRESCO_COMMS: <%=secureComms%> <% if (httpMode == 'https') { %>
TRUSTSTORE_TYPE: JCEKS
KEYSTORE_TYPE: JCEKS <% } %> <% if (replication) { %>
ENABLE_MASTER: <% if (replication == 'master-master') { %>"true"<% } else { %>"false"<% } %>
ENABLE_SLAVE: <% if (replication == 'master-master') { %>"false"<% } else { %>"true"<% } %>
MASTER_HOST: solr6 <% } %>
COMPRESS_CONTENT: "<%=gzip%>"
mem_limit: 1200m
environment:
#Solr needs to know how to register itself with Alfresco
SOLR_ALFRESCO_HOST: "alfresco"
SOLR_ALFRESCO_PORT: "<%=alfrescoPort%>"
ALFRESCO_SECURE_COMMS: <%=secureComms%>
#Alfresco needs to know how to call solr
SOLR_SOLR_HOST: "solr6secondary"
SOLR_SOLR_PORT: "8983"
#Create the default alfresco and archive cores
SOLR_CREATE_ALFRESCO_DEFAULTS: "alfresco,archive"
SOLR_JAVA_MEM: "-Xms1g -Xmx1g" <% if (httpMode == 'https') { %>
SOLR_SSL_TRUST_STORE: "/opt/<%=searchPath%>/keystore/ssl.repo.client.truststore"
SOLR_SSL_TRUST_STORE_PASSWORD: "kT9X6oe68t"
SOLR_SSL_TRUST_STORE_TYPE: "JCEKS"
SOLR_SSL_KEY_STORE: "/opt/<%=searchPath%>/keystore/ssl.repo.client.keystore"
SOLR_SSL_KEY_STORE_PASSWORD: "kT9X6oe68t"
SOLR_SSL_KEY_STORE_TYPE: "JCEKS"
SOLR_SSL_NEED_CLIENT_AUTH: "true"
SOLR_OPTS: "
-Dsolr.ssl.checkPeerName=false
-Dsolr.allow.unsafe.resourceloading=true
" <% } %>
ports:
- 8084:8983 <% if (httpMode == 'https') { %>
volumes:
- ./keystores/solr:/opt/<%=searchPath%>/keystore <% } %>
<% } %>
transform-core-aio:
image: alfresco/alfresco-transform-core-aio:${TRANSFORM_CORE_AIO_TAG}
mem_limit: 1536m
environment:
JAVA_OPTS: " -Xms256m -Xmx1536m"
ports:
- 8090:8090
share:
build:
context: ./share
args:
SHARE_TAG: ${SHARE_TAG}
mem_limit: 1g
environment:
REPO_HOST: "alfresco"
REPO_PORT: "8080"
JAVA_OPTS: "
-Xms500m
-Xmx500m
-Dalfresco.host=localhost
-Dalfresco.port=8080
-Dalfresco.context=alfresco
-Dalfresco.protocol=http
"
postgres:
image: postgres:${POSTGRES_TAG}
mem_limit: 512m
environment:
- POSTGRES_PASSWORD=alfresco
- POSTGRES_USER=alfresco
- POSTGRES_DB=alfresco
command: postgres -c max_connections=300 -c log_min_messages=LOG
ports:
- 5432:5432
activemq:
image: alfresco/alfresco-activemq:${ACTIVE_MQ_TAG}
mem_limit: 1g
ports:
- 8161:8161 # Web Console
- 5672:5672 # AMQP
- 61616:61616 # OpenWire
- 61613:61613 # STOMP
content-app:
image: alfresco/alfresco-content-app:${ACA_TAG}
mem_limit: 256m
depends_on:
- alfresco
# HTTP proxy to provide HTTP Default port access to services
# SOLR API and SOLR Web Console are protected to avoid unauthenticated access
proxy:
image: nginx:stable-alpine
mem_limit: 128m
depends_on:
- alfresco
volumes:
- ./config/nginx.conf:/etc/nginx/nginx.conf
- ./config/nginx.htpasswd:/etc/nginx/conf.d/nginx.htpasswd <% if (httpWebMode == 'https') { %>
- ./config/cert/localhost.cer:/etc/nginx/localhost.cer
- ./config/cert/localhost.key:/etc/nginx/localhost.key <% } %>
ports:
- <%=port%>:<%=port%>
links:
- alfresco
- share
- solr6
- content-app
@@ -0,0 +1,346 @@
# Using version 2 as 3 does not support resource constraint options (cpu_*, mem_* limits) for non swarm mode in Compose
version: "2"
services:
alfresco:
build:
context: ./alfresco
args:
ALFRESCO_TAG: ${ALFRESCO_TAG}
SOLR_COMMS: <%=secureComms%> <% if (httpMode == 'https') { %>
TRUSTSTORE_TYPE: JCEKS
TRUSTSTORE_PASS: kT9X6oe68t
KEYSTORE_TYPE: JCEKS
KEYSTORE_PASS: kT9X6oe68t <% } %>
COMPRESS_CONTENT: "<%=gzip%>"
mem_limit: 1800m
environment:
JAVA_TOOL_OPTIONS: "
-Dmetadata-keystore.password=mp6yc0UD9e
-Dmetadata-keystore.aliases=metadata
-Dmetadata-keystore.metadata.password=mp6yc0UD9e
-Dmetadata-keystore.metadata.algorithm=AES
<% if (httpMode == 'https') { %>
-Dencryption.keystore.type=pkcs12
-Dencryption.cipherAlgorithm=AES/CBC/PKCS5Padding
-Dencryption.keyAlgorithm=AES
-Dssl-keystore.password=kT9X6oe68t
-Dssl-keystore.aliases=ssl-alfresco-ca,ssl-repo
-Dssl-keystore.ssl-alfresco-ca.password=kT9X6oe68t
-Dssl-keystore.ssl-repo.password=kT9X6oe68t
-Dssl-truststore.password=kT9X6oe68t
-Dssl-truststore.aliases=alfresco-ca,ssl-repo-client
-Dssl-truststore.alfresco-ca.password=kT9X6oe68t
-Dssl-truststore.ssl-repo-client.password=kT9X6oe68t <% } %>
"
JAVA_OPTS: "
-Ddb.driver=org.postgresql.Driver
-Ddb.username=alfresco
-Ddb.password=alfresco
-Ddb.url=jdbc:postgresql://postgres:5432/alfresco
-Dsolr.host=<%=searchSolrHost%>
-Dsolr.port.ssl=8983
-Dsolr.secureComms=<%=secureComms%>
-Dsolr.baseUrl=/solr <% if (sharding == 'true') { %>
-Dsolr.useDynamicShardRegistration=true <% } %>
-Dindex.subsystem.name=solr6
-Daos.baseUrlOverwrite=http://localhost:8080/alfresco/aos
-Dmessaging.broker.url=\"failover:(nio://activemq:61616)?timeout=3000&jms.useCompression=true\"
-Ddeployment.method=DOCKER_COMPOSE
-Dtransform.service.enabled=true
-Dtransform.service.url=http://transform-router:8095
-Dsfs.url=http://shared-file-store:8099/
-DlocalTransform.core-aio.url=http://transform-core-aio:8090/
-Dalfresco-pdf-renderer.url=http://transform-core-aio:8090/
-Djodconverter.url=http://transform-core-aio:8090/
-Dimg.url=http://transform-core-aio:8090/
-Dtika.url=http://transform-core-aio:8090/
-Dtransform.misc.url=http://transform-core-aio:8090/
-Dcsrf.filter.enabled=false
-Dalfresco.restApi.basicAuthScheme=true
-Xms1500m -Xmx1500m
" <% if (httpMode == 'https') { %>
ports:
- 8443:8443
volumes:
- ./keystores/alfresco:/usr/local/tomcat/alf_data/keystore <% } %>
solr6:
build:
context: ./search
args:
SEARCH_TAG: ${SEARCH_TAG}
SOLR_HOSTNAME: solr6
ALFRESCO_HOSTNAME: alfresco
ALFRESCO_COMMS: <%=secureComms%> <% if (httpMode == 'https') { %>
TRUSTSTORE_TYPE: JCEKS
KEYSTORE_TYPE: JCEKS
PASSWORDS_AS_ENV_VARS: "true" <% } %> <% if (replication) { %>
ENABLE_MASTER: "true"
ENABLE_SLAVE: "false" <% } %> <% if (sharding == 'true') { %>
ENABLE_SHARDING: "true"
NUM_SHARDS: "2"
SHARD_ID: "0" <% if (shardingMethod == 'DB_ID_RANGE') { %>
SHARD_RANGE: "0-800" <% } %> <% if (shardingMethod == 'DATE') { %>
SHARD_KEY: "cm:created"
SHARD_DATE_GROUPING: "2" <% } %> <% if (shardingMethod == 'PROPERTY') { %>
SHARD_KEY: "shard:shardId" <% } %> <% if (shardingMethod == 'EXPLICIT_ID' || shardingMethod == 'EXPLICIT_ID_FALLBACK_LRIS') { %>
SHARD_KEY: "shard:shardId" <% } %>
SHARDING_METHOD: <%=shardingMethod%> <% } %>
COMPRESS_CONTENT: "<%=gzip%>"
SEARCH_LOG_LEVEL: <%=searchLogLevel%>
mem_limit: 1200m
environment:
#Solr needs to know how to register itself with Alfresco
SOLR_ALFRESCO_HOST: "alfresco"
SOLR_ALFRESCO_PORT: "<%=alfrescoPort%>"
ALFRESCO_SECURE_COMMS: <%=secureComms%>
#Alfresco needs to know how to call solr
SOLR_SOLR_HOST: "solr6"
SOLR_SOLR_PORT: "8983"
#Create the default alfresco and archive cores
SOLR_CREATE_ALFRESCO_DEFAULTS: "alfresco,archive"
SOLR_JAVA_MEM: "-Xms1g -Xmx1g" <% if (httpMode == 'https') { %>
SOLR_SSL_TRUST_STORE: "/opt/<%=searchPath%>/keystore/ssl-repo-client.truststore"
SOLR_SSL_TRUST_STORE_TYPE: "JCEKS"
SOLR_SSL_KEY_STORE: "/opt/<%=searchPath%>/keystore/ssl-repo-client.keystore"
SOLR_SSL_KEY_STORE_TYPE: "JCEKS"
SOLR_SSL_NEED_CLIENT_AUTH: "true" <% if (sharding == 'true') { %>
SOLR_SSL_CLIENT_KEY_STORE: "/opt/<%=searchPath%>/keystore/ssl-repo-client.keystore"
SOLR_SSL_CLIENT_KEY_STORE_TYPE: "JCEKS"
SOLR_SSL_CLIENT_TRUST_STORE: "/opt/<%=searchPath%>/keystore/ssl-repo-client.keystore"
SOLR_SSL_CLIENT_TRUST_STORE_TYPE: "JCEKS" <% } %>
JAVA_TOOL_OPTIONS: "
-Dsolr.jetty.truststore.password=kT9X6oe68t
-Dsolr.jetty.keystore.password=kT9X6oe68t <% if (sharding == 'true') { %>
-Djavax.net.ssl.keyStorePassword=kT9X6oe68t
-Djavax.net.ssl.trustStorePassword=kT9X6oe68t <% } %>
-Dssl-keystore.password=kT9X6oe68t
-Dssl-keystore.aliases=ssl-alfresco-ca,ssl-repo-client
-Dssl-keystore.ssl-alfresco-ca.password=kT9X6oe68t
-Dssl-keystore.ssl-repo-client.password=kT9X6oe68t
-Dssl-truststore.password=kT9X6oe68t
-Dssl-truststore.aliases=ssl-alfresco-ca,ssl-repo,ssl-repo-client
-Dssl-truststore.ssl-alfresco-ca.password=kT9X6oe68t
-Dssl-truststore.ssl-repo.password=kT9X6oe68t
-Dssl-truststore.ssl-repo-client.password=kT9X6oe68t
"
SOLR_OPTS: "
-Dsolr.ssl.checkPeerName=false
-Dsolr.allow.unsafe.resourceloading=true
" <% } %>
ports:
- 8083:8983 <% if (httpMode == 'https') { %>
volumes:
- ./keystores/solr:/opt/<%=searchPath%>/keystore <% } %>
<% if (sharding == 'true' || replication) { %>
solr6secondary:
build:
context: ./search
args:
SEARCH_TAG: ${SEARCH_TAG}
SOLR_HOSTNAME: solr6secondary
ALFRESCO_HOSTNAME: alfresco
ALFRESCO_COMMS: <%=secureComms%> <% if (httpMode == 'https') { %>
TRUSTSTORE_TYPE: JCEKS
KEYSTORE_TYPE: JCEKS
PASSWORDS_AS_ENV_VARS: "true" <% } %> <% if (replication) { %>
ENABLE_MASTER: <% if (replication == 'master-master') { %>"true"<% } else { %>"false"<% } %>
ENABLE_SLAVE: <% if (replication == 'master-master') { %>"false"<% } else { %>"true"<% } %>
MASTER_HOST: solr6 <% } %> <% if (sharding == 'true') { %>
ENABLE_SHARDING: "true"
NUM_SHARDS: "2"
SHARD_ID: "1" <% if (shardingMethod == 'DB_ID_RANGE') { %>
SHARD_RANGE: "801-40000" <% } %> <% if (shardingMethod == 'DATE') { %>
SHARD_KEY: "cm:created"
SHARD_DATE_GROUPING: "2" <% } %> <% if (shardingMethod == 'PROPERTY') { %>
SHARD_KEY: "shard:shardId" <% } %> <% if (shardingMethod == 'EXPLICIT_ID' || shardingMethod == 'EXPLICIT_ID_FALLBACK_LRIS') { %>
SHARD_KEY: "shard:shardId" <% } %>
SHARDING_METHOD: <%=shardingMethod%> <% } %>
COMPRESS_CONTENT: "<%=gzip%>"
mem_limit: 1200m
environment:
#Solr needs to know how to register itself with Alfresco
SOLR_ALFRESCO_HOST: "alfresco"
SOLR_ALFRESCO_PORT: "<%=alfrescoPort%>"
ALFRESCO_SECURE_COMMS: <%=secureComms%>
#Alfresco needs to know how to call solr
SOLR_SOLR_HOST: "solr6secondary"
SOLR_SOLR_PORT: "8983"
#Create the default alfresco and archive cores
SOLR_CREATE_ALFRESCO_DEFAULTS: "alfresco,archive"
SOLR_JAVA_MEM: "-Xms1g -Xmx1g" <% if (httpMode == 'https') { %>
SOLR_SSL_TRUST_STORE: "/opt/<%=searchPath%>/keystore/ssl-repo-client.truststore"
SOLR_SSL_TRUST_STORE_TYPE: "JCEKS"
SOLR_SSL_KEY_STORE: "/opt/<%=searchPath%>/keystore/ssl-repo-client.keystore"
SOLR_SSL_KEY_STORE_TYPE: "JCEKS"
SOLR_SSL_NEED_CLIENT_AUTH: "true" <% if (sharding == 'true') { %>
SOLR_SSL_CLIENT_KEY_STORE: "/opt/<%=searchPath%>/keystore/ssl-repo-client.keystore"
SOLR_SSL_CLIENT_KEY_STORE_TYPE: "JCEKS"
SOLR_SSL_CLIENT_TRUST_STORE: "/opt/<%=searchPath%>/keystore/ssl-repo-client.keystore"
SOLR_SSL_CLIENT_TRUST_STORE_TYPE: "JCEKS" <% } %>
JAVA_TOOL_OPTIONS: "
-Dsolr.jetty.truststore.password=kT9X6oe68t
-Dsolr.jetty.keystore.password=kT9X6oe68t <% if (sharding == 'true') { %>
-Djavax.net.ssl.keyStorePassword=kT9X6oe68t
-Djavax.net.ssl.trustStorePassword=kT9X6oe68t <% } %>
-Dssl-keystore.password=kT9X6oe68t
-Dssl-keystore.aliases=ssl-alfresco-ca,ssl-repo-client
-Dssl-keystore.ssl-alfresco-ca.password=kT9X6oe68t
-Dssl-keystore.ssl-repo-client.password=kT9X6oe68t
-Dssl-truststore.password=kT9X6oe68t
-Dssl-truststore.aliases=ssl-alfresco-ca,ssl-repo,ssl-repo-client
-Dssl-truststore.ssl-alfresco-ca.password=kT9X6oe68t
-Dssl-truststore.ssl-repo.password=kT9X6oe68t
-Dssl-truststore.ssl-repo-client.password=kT9X6oe68t
"
SOLR_OPTS: "
-Dsolr.ssl.checkPeerName=false
-Dsolr.allow.unsafe.resourceloading=true
" <% } %>
ports:
- 8084:8983 <% if (httpMode == 'https') { %>
volumes:
- ./keystores/solr:/opt/<%=searchPath%>/keystore <% } %>
<% } %>
<% if (zeppelin == 'true') { %>
zeppelin:
build:
context: ./zeppelin
args:
ZEPPELIN_TAG: ${ZEPPELIN_TAG}
ALFRESCO_COMMS: <%=secureComms%>
mem_limit: 768m
environment: <% if (httpMode == 'https') { %>
REPO_PROTOCOL: "https" <% } %>
REPO_HOST: "alfresco"
REPO_PORT: "<%=alfrescoPort%>" <% if (httpMode == 'https') { %>
JAVA_TOOL_OPTIONS: "
-Djavax.net.ssl.keyStore=/zeppelin/keystore/ssl-repo-client.keystore
-Djavax.net.ssl.keyStorePassword=kT9X6oe68t
-Djavax.net.ssl.keyStoreType=JCEKS
-Djavax.net.ssl.trustStore=/zeppelin/keystore/ssl-repo-client.truststore
-Djavax.net.ssl.trustStorePassword=kT9X6oe68t
-Djavax.net.ssl.trustStoreType=JCEKS
"
JAVA_OPTS: "
-Dalfresco.enable.ssl=true
-Dsolr.ssl.checkPeerName=false
" <% } %>
ports:
- 9090:9090 <% if (httpMode == 'https') { %>
volumes:
- ./keystores/zeppelin:/zeppelin/keystore <% } %>
<% } %>
transform-router:
mem_limit: 512m
image: quay.io/alfresco/alfresco-transform-router:${TRANSFORM_ROUTER_TAG}
environment:
JAVA_OPTS: " -Xms256m -Xmx512m"
ACTIVEMQ_URL: "nio://activemq:61616"
CORE_AIO_URL : "http://transform-core-aio:8090"
FILE_STORE_URL: "http://shared-file-store:8099/alfresco/api/-default-/private/sfs/versions/1/file"
ports:
- 8095:8095
links:
- activemq
transform-core-aio:
image: alfresco/alfresco-transform-core-aio:${TRANSFORM_CORE_AIO_TAG}
mem_limit: 1536m
environment:
JAVA_OPTS: " -Xms256m -Xmx1536m"
ACTIVEMQ_URL: "nio://activemq:61616"
FILE_STORE_URL: "http://shared-file-store:8099/alfresco/api/-default-/private/sfs/versions/1/file"
ports:
- 8090:8090
links:
- activemq
shared-file-store:
image: alfresco/alfresco-shared-file-store:${SHARED_FILE_STORE_TAG}
mem_limit: 512m
environment:
JAVA_OPTS: " -Xms256m -Xmx512m"
scheduler.content.age.millis: 86400000
scheduler.cleanup.interval: 86400000
ports:
- 8099:8099
volumes:
- shared-file-store-volume:/tmp/Alfresco/sfs
share:
build:
context: ./share
args:
SHARE_TAG: ${SHARE_TAG}
mem_limit: 1g
environment:
REPO_HOST: "alfresco"
REPO_PORT: "8080"
JAVA_OPTS: "
-Xms500m
-Xmx500m
-Dalfresco.host=localhost
-Dalfresco.port=8080
-Dalfresco.context=alfresco
-Dalfresco.protocol=http
"
postgres:
image: postgres:${POSTGRES_TAG}
mem_limit: 512m
environment:
- POSTGRES_PASSWORD=alfresco
- POSTGRES_USER=alfresco
- POSTGRES_DB=alfresco
command: postgres -c max_connections=300 -c log_min_messages=LOG
ports:
- 5432:5432
activemq:
image: alfresco/alfresco-activemq:${ACTIVE_MQ_TAG}
mem_limit: 1g
ports:
- 8161:8161 # Web Console
- 5672:5672 # AMQP
- 61616:61616 # OpenWire
- 61613:61613 # STOMP
content-app:
image: quay.io/alfresco/alfresco-digital-workspace:${DIGITAL_WORKSPACE_TAG}
mem_limit: 128m
environment:
BASEPATH: ./
# HTTP proxy to provide HTTP Default port access to services
# SOLR API and SOLR Web Console are protected to avoid unauthenticated access
proxy:
image: nginx:stable-alpine
mem_limit: 128m
depends_on:
- alfresco
volumes:
- ./config/nginx.conf:/etc/nginx/nginx.conf
- ./config/nginx.htpasswd:/etc/nginx/conf.d/nginx.htpasswd <% if (httpWebMode == 'https') { %>
- ./config/cert/localhost.cer:/etc/nginx/localhost.cer
- ./config/cert/localhost.key:/etc/nginx/localhost.key <% } %>
ports:
- <%=port%>:<%=port%>
links:
- alfresco
- share
- solr6
- content-app
volumes:
shared-file-store-volume:
driver_opts:
type: tmpfs
device: tmpfs
File diff suppressed because it is too large Load Diff
@@ -21,8 +21,9 @@
"npm": ">= 4.0.0"
},
"dependencies": {
"yeoman-generator": "^2.0.1",
"chalk": "^2.1.0",
"yeoman-generator": "^2.0.1",
"yo": "^3.1.1",
"yosay": "^2.0.1"
},
"jest": {
+7 -7
View File
@@ -1,24 +1,24 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-search-and-insight-parent</artifactId>
<version>1.5.0-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>
<groupId>search-analytics-e2e-test</groupId>
<artifactId>search-analytics-e2e-test</artifactId>
<name>Search Analytics E2E Tests</name>
<description>Test Project to test Search Service and Analytics Features on a complete setup of Alfresco, Share</description>
<properties>
<tas.rest.api.version>1.38</tas.rest.api.version>
<tas.rest.api.version>1.42</tas.rest.api.version>
<tas.cmis.api.version>1.13</tas.cmis.api.version>
<tas.utility.version>3.0.20</tas.utility.version>
<tas.utility.version>3.0.21</tas.utility.version>
<rm.version>3.3.1</rm.version>
<suiteXmlFile>src/test/resources/SearchSuite.xml</suiteXmlFile>
<test.exclude></test.exclude>
<test.include></test.include>
<test.exclude />
<test.include />
<jackson.databind.version>2.7.7</jackson.databind.version>
<licenseName>community</licenseName>
</properties>
<build>
<plugins>
@@ -1,21 +1,29 @@
/*
* Copyright (C) 2018 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* #%L
* Alfresco Search Services E2E Test
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.search;
public class TestGroup
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<model name="index:contentModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
<description>Indexed and Non Indexed field comparison</description>
<imports>
<import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
<import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
</imports>
<namespaces>
<namespace uri="http://www.alfresco.org/model/index/1.0" prefix="index"/>
</namespaces>
<types>
<type name="index:sample">
<title>Sample</title>
<parent>cm:content</parent>
<properties>
<property name="index:indexed">
<type>d:text</type>
</property>
<property name="index:nonIndexed">
<type>d:text</type>
<index enabled="false" />
</property>
</properties>
</type>
</types>
</model>
@@ -1,9 +1,29 @@
/*
* Copyright 2019 Alfresco Software, Ltd. All rights reserved.
* License rights for this program may be obtained from Alfresco Software, Ltd.
* pursuant to a written agreement and any use of this program without such an
* agreement is prohibited.
* #%L
* Alfresco Search Services E2E Test
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.test.search.functional;
import static java.util.Optional.ofNullable;
@@ -1,3 +1,29 @@
/*
* #%L
* Alfresco Search Services E2E Test
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.test.search.functional.searchServices.cmis;
import java.lang.reflect.Method;
@@ -1,3 +1,29 @@
/*
* #%L
* Alfresco Search Services E2E Test
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.test.search.functional.searchServices.cmis;
import org.alfresco.search.TestGroup;
@@ -1,3 +1,29 @@
/*
* #%L
* Alfresco Search Services E2E Test
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.test.search.functional.searchServices.cmis;
import org.alfresco.search.TestGroup;
@@ -1,3 +1,29 @@
/*
* #%L
* Alfresco Search Services E2E Test
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.test.search.functional.searchServices.cmis;
import org.alfresco.search.TestGroup;
@@ -1,3 +1,29 @@
/*
* #%L
* Alfresco Search Services E2E Test
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.test.search.functional.searchServices.cmis;
import java.util.List;
@@ -1,3 +1,29 @@
/*
* #%L
* Alfresco Search Services E2E Test
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.test.search.functional.searchServices.cmis;
import org.alfresco.utility.Utility;
@@ -1,3 +1,29 @@
/*
* #%L
* Alfresco Search Services E2E Test
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.test.search.functional.searchServices.cmis;
import org.alfresco.search.TestGroup;
@@ -1,3 +1,29 @@
/*
* #%L
* Alfresco Search Services E2E Test
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.test.search.functional.searchServices.cmis;
import java.math.BigDecimal;
@@ -1,3 +1,29 @@
/*
* #%L
* Alfresco Search Services E2E Test
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.test.search.functional.searchServices.cmis;
import org.testng.annotations.Test;
@@ -1,8 +1,27 @@
/*
* Copyright 2018 Alfresco Software, Ltd. All rights reserved.
* License rights for this program may be obtained from Alfresco Software, Ltd.
* pursuant to a written agreement and any use of this program without such an
* agreement is prohibited.
* #%L
* Alfresco Search Services E2E Test
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.test.search.functional.searchServices.sanity;
@@ -1,17 +1,29 @@
/*
* Copyright (C) 2018 Alfresco Software Limited.
* This file is part of Alfresco
* #%L
* Alfresco Search Services E2E Test
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.test.search.functional.searchServices.search;
import org.alfresco.test.search.functional.AbstractE2EFunctionalTest;
@@ -1,3 +1,29 @@
/*
* #%L
* Alfresco Search Services E2E Test
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.test.search.functional.searchServices.search;
import org.alfresco.search.TestGroup;
@@ -1,21 +1,29 @@
/*
* Copyright (C) 2019 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* #%L
* Alfresco Search Services E2E Test
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.test.search.functional.searchServices.search;
import javax.json.Json;
@@ -1,21 +1,29 @@
/*
* Copyright (C) 2017 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* #%L
* Alfresco Search Services E2E Test
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.test.search.functional.searchServices.search;
import org.alfresco.rest.model.RestErrorModel;
@@ -1,21 +1,29 @@
/*
* Copyright (C) 2017 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* #%L
* Alfresco Search Services E2E Test
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.test.search.functional.searchServices.search;
import static org.hamcrest.MatcherAssert.assertThat;
@@ -1,21 +1,29 @@
/*
* Copyright (C) 2018 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* #%L
* Alfresco Search Services E2E Test
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.test.search.functional.searchServices.search;
import java.util.ArrayList;
@@ -1,3 +1,29 @@
/*
* #%L
* Alfresco Search Services E2E Test
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.test.search.functional.searchServices.search;
import org.alfresco.rest.search.SearchResponse;
@@ -1,21 +1,29 @@
/*
* Copyright (C) 2018 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* #%L
* Alfresco Search Services E2E Test
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.test.search.functional.searchServices.search;
import static jersey.repackaged.com.google.common.collect.Sets.newHashSet;
@@ -1,21 +1,29 @@
/*
* Copyright (C) 2017 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* #%L
* Alfresco Search Services E2E Test
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.test.search.functional.searchServices.search;
import java.time.LocalDateTime;
@@ -1,8 +1,27 @@
/*
* Copyright 2019 Alfresco Software, Ltd. All rights reserved.
* License rights for this program may be obtained from Alfresco Software, Ltd.
* pursuant to a written agreement and any use of this program without such an
* agreement is prohibited.
* #%L
* Alfresco Search Services E2E Test
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.test.search.functional.searchServices.search;
@@ -1,21 +1,29 @@
/*
* Copyright (C) 2018 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* #%L
* Alfresco Search Services E2E Test
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.test.search.functional.searchServices.search;
@@ -1,17 +1,29 @@
/*
* Copyright (C) 2017 Alfresco Software Limited.
* This file is part of Alfresco
* #%L
* Alfresco Search Services E2E Test
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.test.search.functional.searchServices.search;
import java.util.ArrayList;
@@ -0,0 +1,138 @@
/*
* #%L
* Alfresco Search Services E2E Test
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.test.search.functional.searchServices.search;
import java.util.HashMap;
import java.util.Map;
import org.alfresco.rest.core.RestRequest;
import org.alfresco.rest.model.RestTextResponse;
import org.alfresco.rest.search.SearchResponse;
import org.alfresco.test.search.functional.AbstractE2EFunctionalTest;
import org.alfresco.utility.constants.UserRole;
import org.alfresco.utility.model.FileModel;
import org.alfresco.utility.model.FileType;
import org.alfresco.utility.model.FolderModel;
import org.apache.chemistry.opencmis.commons.PropertyIds;
import org.apache.chemistry.opencmis.commons.enums.VersioningState;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import io.restassured.RestAssured;
/**
* Testing that fields declared as non indexed (index="true" in Alfresco Content Model)
* are not created in SOLR Schema and that are not stored in SOLR Index.
*
* @author aborroy
*
*/
public class SearchNonIndexedFields extends AbstractE2EFunctionalTest
{
@BeforeClass(alwaysRun = true)
public void dataPreparation() throws Exception
{
serverHealth.assertServerIsOnline();
deployCustomModel("model/indexing-disabled-content-model.xml");
dataUser.addUserToSite(testUser, testSite, UserRole.SiteContributor);
FolderModel testFolder = dataContent.usingSite(testSite).usingUser(testUser).createFolder();
FileModel sampleFile = FileModel.getRandomFileModel(FileType.TEXT_PLAIN, "Sample");
sampleFile.setName("in1-" + sampleFile.getName());
// One field indexed and one field not indexed
Map<String, Object> properties = new HashMap<>();
properties.put(PropertyIds.OBJECT_TYPE_ID, "D:index:sample");
properties.put(PropertyIds.NAME, sampleFile.getName());
properties.put("index:indexed", "Indexed");
properties.put("index:nonIndexed", "Not indexed");
cmisApi.authenticateUser(testUser).usingSite(testSite).usingResource(testFolder).createFile(sampleFile, properties, VersioningState.MAJOR)
.assertThat().existsInRepo();
sampleFile = FileModel.getRandomFileModel(FileType.TEXT_PLAIN, "Sample");
sampleFile.setName("in2-" + sampleFile.getName());
// Only one field not indexed
properties = new HashMap<>();
properties.put(PropertyIds.OBJECT_TYPE_ID, "D:index:sample");
properties.put(PropertyIds.NAME, sampleFile.getName());
properties.put("index:nonIndexed", "Not indexed");
cmisApi.authenticateUser(testUser).usingSite(testSite).usingResource(testFolder).createFile(sampleFile, properties, VersioningState.MAJOR)
.assertThat().existsInRepo();
waitForIndexing(sampleFile.getName(), true);
}
/**
* Test that non indexed fields are not stored in SOLR Index
*/
@Test(priority = 1)
public void testIndexedAndNonIndexedField()
{
SearchResponse response = queryAsUser(testUser, "index_indexed:[* TO *]");
restClient.assertStatusCodeIs(HttpStatus.OK);
Assert.assertEquals(response.getPagination().getCount(), 1);
response = queryAsUser(testUser, "index_nonIndexed:[* TO *]");
restClient.assertStatusCodeIs(HttpStatus.OK);
Assert.assertEquals(response.getPagination().getCount(), 0);
}
/**
* Test that non indexed fields are not created in SOLR Schema
*/
@Test(priority = 2)
public void testNonIndexedDoesNotExist()
{
RestAssured.basePath = "solr/alfresco";
restClient.configureSolrEndPoint();
restClient.configureRequestSpec().setBasePath(RestAssured.basePath);
RestRequest request = RestRequest.simpleRequest(HttpMethod.GET, "admin/luke");
RestTextResponse response = restClient.processTextResponse(request);
String bodyResponse = response.getResponse().getBody().print();
Assert.assertTrue(bodyResponse.contains("{http://www.alfresco.org/model/index/1.0}indexed"),
"Expecting index:indexed field to be present in SOLR Schema");
Assert.assertFalse(bodyResponse.contains("{http://www.alfresco.org/model/index/1.0}nonIndexed"),
"Expecting index:nonIndexed field NOT to be present in SOLR Schema");
}
}
@@ -1,21 +1,29 @@
/*
* Copyright (C) 2020 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* #%L
* Alfresco Search Services E2E Test
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.test.search.functional.searchServices.search;
import javax.json.Json;
@@ -1,8 +1,27 @@
/*
* Copyright 2019 Alfresco Software, Ltd. All rights reserved.
* License rights for this program may be obtained from Alfresco Software, Ltd.
* pursuant to a written agreement and any use of this program without such an
* agreement is prohibited.
* #%L
* Alfresco Search Services E2E Test
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.test.search.functional.searchServices.search;
@@ -1,8 +1,27 @@
/*
* Copyright 2019 Alfresco Software, Ltd. All rights reserved.
* License rights for this program may be obtained from Alfresco Software, Ltd.
* pursuant to a written agreement and any use of this program without such an
* agreement is prohibited.
* #%L
* Alfresco Search Services E2E Test
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.test.search.functional.searchServices.search;
@@ -1,21 +1,29 @@
/*
* Copyright (C) 2018 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* #%L
* Alfresco Search Services E2E Test
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.test.search.functional.searchServices.search;
import org.alfresco.dataprep.SiteService.Visibility;
@@ -1,21 +1,29 @@
/*
* Copyright (C) 2018 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* #%L
* Alfresco Search Services E2E Test
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.test.search.functional.searchServices.search;
import static java.util.Arrays.asList;
@@ -1,8 +1,27 @@
/*
* Copyright 2019 Alfresco Software, Ltd. All rights reserved.
* License rights for this program may be obtained from Alfresco Software, Ltd.
* pursuant to a written agreement and any use of this program without such an
* agreement is prohibited.
* #%L
* Alfresco Search Services E2E Test
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.test.search.functional.searchServices.search;
@@ -1,17 +1,29 @@
/*
* Copyright (C) 2005-2018 Alfresco Software Limited.
* This file is part of Alfresco
* #%L
* Alfresco Search Services E2E Test
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.test.search.functional.searchServices.search;
import org.testng.annotations.Test;
@@ -1,21 +1,29 @@
/*
* Copyright (C) 2019 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* #%L
* Alfresco Search Services E2E Test
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.test.search.functional.searchServices.search;
import org.alfresco.test.search.functional.AbstractE2EFunctionalTest;
@@ -1,21 +1,29 @@
/*
* Copyright (C) 2017 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* #%L
* Alfresco Search Services E2E Test
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.test.search.functional.searchServices.search;
import static org.testng.Assert.assertEquals;
@@ -1,9 +1,29 @@
/*
* Copyright 2019 Alfresco Software, Ltd. All rights reserved.
* License rights for this program may be obtained from Alfresco Software, Ltd.
* pursuant to a written agreement and any use of this program without such an
* agreement is prohibited.
* #%L
* Alfresco Search Services E2E Test
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.test.search.functional.searchServices.search.tracker;
import java.util.List;
@@ -1,17 +1,29 @@
/*
* Copyright (C) 2018 Alfresco Software Limited.
* This file is part of Alfresco
* #%L
* Alfresco Search Services E2E Test
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.test.search.functional.searchServices.solr;
import javax.json.JsonArrayBuilder;
@@ -1,22 +1,35 @@
/*
* Copyright (C) 2020 Alfresco Software Limited.
* This file is part of Alfresco
* #%L
* Alfresco Search Services E2E Test
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.test.search.functional.searchServices.solr.admin;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import org.alfresco.rest.core.RestResponse;
import org.alfresco.search.TestGroup;
@@ -591,56 +604,48 @@ public class SolrE2eAdminTest extends AbstractE2EFunctionalTest
Assert.assertEquals(actionStatus, "scheduled");
}
/**
* FIX for every core.
* @throws Exception
*/
@Test(priority = 27, dependsOnMethods = "testPurge")
public void testFix() throws Exception
{
RestResponse response = restClient.withSolrAdminAPI().getAction("fix");
checkResponseStatusOk(response);
DEFAULT_CORE_NAMES.forEach(core -> {
List<String> txToReindex = response.getResponse().body().jsonPath().get("action." + core +".txToReindex");
Assert.assertTrue(txToReindex.size() >= 0, "Expected a list of transactions (or empty list) to be reindexed,");
List<String> aclToReindex = response.getResponse().body().jsonPath().get("action." + core + ".aclChangeSetToReindex");
Assert.assertTrue(aclToReindex.size() >= 0, "Expected a list of ACLs (or empty list) to be reindexed,");
});
String actionStatus = response.getResponse().body().jsonPath().get("action.status");
Assert.assertEquals(actionStatus, "scheduled");
}
/**
* FIX for specific core.
* @throws Exception
* The test checks the response structure in order to make sure the expected sections are present.
*
* We are not testing the content of each section because due to the underlying E2E infrastructure, we cannot know
* in advance the transactions that will be scheduled for reindexing.
*/
@Test(priority = 28)
public void testFixCore() throws Exception
public void testFixCore()
{
DEFAULT_CORE_NAMES.forEach(core -> {
try
{
RestResponse response = restClient.withParams("core=" + core).withSolrAdminAPI().getAction("fix");
checkResponseStatusOk(response);
List<String> txToReindex = response.getResponse().body().jsonPath().get("action." + core +".txToReindex");
Assert.assertTrue(txToReindex.size() >= 0, "Expected a list of transactions (or empty list) to be reindexed,");
List<String> aclToReindex = response.getResponse().body().jsonPath().get("action." + core + ".aclChangeSetToReindex");
Assert.assertTrue(aclToReindex.size() >= 0, "Expected a list of ACLs (or empty list) to be reindexed,");
Map<String, Object> txInIndexNotInDb = response.getResponse().body().jsonPath().get("action." + core +".txToReindex.txInIndexNotInDb");
Assert.assertNotNull(txInIndexNotInDb, "Expected a list of transactions (even empty) that are in index but not in the database to be reindexed,");
Map<String, Object> duplicatedTx = response.getResponse().body().jsonPath().get("action." + core +".txToReindex.duplicatedTxInIndex");
Assert.assertNotNull(duplicatedTx, "Expected a list of duplicated transactions (even empty) to be reindexed,");
Map<String, Object> missingTx = response.getResponse().body().jsonPath().get("action." + core +".txToReindex.missingTxInIndex");
Assert.assertNotNull(missingTx, "Expected a list of missing transactions (or empty list) to be reindexed,");
Map<String, Object> aclTxInIndexNotInDb = response.getResponse().body().jsonPath().get("action." + core + ".aclChangeSetToReindex.aclTxInIndexNotInDb");
Assert.assertNotNull(aclTxInIndexNotInDb, "Expected a list of ACLs (or empty list) to be reindexed,");
Map<String, Object> duplicatedAclTxInIndex = response.getResponse().body().jsonPath().get("action." + core + ".aclChangeSetToReindex.duplicatedAclTxInIndex");
Assert.assertNotNull(duplicatedAclTxInIndex, "Expected a list of ACLs (or empty list) to be reindexed,");
Map<String, Object> missingAclTxInIndex = response.getResponse().body().jsonPath().get("action." + core + ".aclChangeSetToReindex.missingAclTxInIndex");
Assert.assertNotNull(missingAclTxInIndex, "Expected a list of ACLs (or empty list) to be reindexed,");
String actionStatus = response.getResponse().body().jsonPath().get("action.status");
Assert.assertEquals(actionStatus, "scheduled");
Assert.assertEquals(actionStatus, "notScheduled");
}
catch (Exception e)
{
throw new RuntimeException(e);
}
});
}
@@ -1,3 +1,29 @@
/*
* #%L
* Alfresco Search Services E2E Test
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.test.search.nonFunctional.backup;
import java.io.File;
@@ -1,3 +1,29 @@
/*
* #%L
* Alfresco Search Services E2E Test
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.test.search.nonFunctional.backup;
import org.testng.annotations.Test;
@@ -1,3 +1,29 @@
/*
* #%L
* Alfresco Search Services E2E Test
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.test.search.nonFunctional.backup;
import org.testng.annotations.Test;
@@ -1,3 +1,29 @@
/*
* #%L
* Alfresco Search Services E2E Test
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.test.search.nonFunctional.backup;
import static org.hamcrest.MatcherAssert.assertThat;
@@ -1,3 +1,29 @@
/*
* #%L
* Alfresco Search Services E2E Test
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.test.search.nonFunctional.upgrade;
import org.alfresco.cmis.CmisWrapper;
@@ -1,3 +1,29 @@
/*
* #%L
* Alfresco Search Services E2E Test
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.test.search.nonFunctional.upgrade;
import org.alfresco.utility.LogFactory;
+69 -3
View File
@@ -21,9 +21,9 @@
</snapshotRepository>
</distributionManagement>
<scm>
<connection>scm:git:https://git.alfresco.com/search_discovery/insightengine.git</connection>
<developerConnection>scm:git:https://git.alfresco.com/search_discovery/insightengine.git</developerConnection>
<url>https://git.alfresco.com/search_discovery/insightengine.git</url>
<connection>scm:git:ssh://git@github.com/Alfresco/InsightEngine.git</connection>
<developerConnection>scm:git:ssh://git@github.com/Alfresco/InsightEngine.git</developerConnection>
<url>scm:git:ssh://git@github.com/Alfresco/InsightEngine.git</url>
<tag>HEAD</tag>
</scm>
<properties>
@@ -35,6 +35,8 @@
<!-- Solr startup scripts do not work with any Java version higher than 9 so the scripts have been patched -->
<solr.zip>https://artifacts.alfresco.com/nexus/content/repositories/public/org/apache/solr/solr/solr-${solr.version}/solr-solr-${solr.version}.zip</solr.zip>
<solr.directory>${project.build.directory}/solr-${solr.version}</solr.directory>
<licenseName>enterprise</licenseName>
<license.update.dryrun>true</license.update.dryrun>
</properties>
<modules>
<module>search-services</module>
@@ -70,6 +72,70 @@
<runOrder>alphabetical</runOrder>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>
<configuration>
<addJavaLicenseAfterPackage>false</addJavaLicenseAfterPackage>
<organizationName>Alfresco Software Limited</organizationName>
<canUpdateCopyright>true</canUpdateCopyright>
<failOnMissingHeader>true</failOnMissingHeader>
<failOnNotUptodateHeader>true</failOnNotUptodateHeader>
<licenseResolver>classpath://alfresco</licenseResolver>
<licenseName>${licenseName}</licenseName>
<dryRun>${license.update.dryrun}</dryRun>
<roots>
<root>src</root>
</roots>
<includes>
<include>**/*.java</include>
<include>**/*.jsp</include>
</includes>
<!-- Classes derivated from SOLR Source code include the Apache License header -->
<excludes>
<exclude>**/org/alfresco/solr/component/AsyncBuildSuggestComponent.java</exclude>
<exclude>**/org/apache/solr/client/solrj/io/sql/ConnectionImpl.java</exclude>
<exclude>**/org/apache/solr/client/solrj/io/sql/DatabaseMetaDataImpl.java</exclude>
<exclude>**/org/apache/solr/client/solrj/io/sql/ResultSetImpl.java</exclude>
<exclude>**/org/apache/solr/client/solrj/io/sql/StatementImpl.java</exclude>
<exclude>**/org/alfresco/solr/sql/SolrAggregate.java</exclude>
<exclude>**/org/alfresco/solr/sql/SolrEnumerator.java</exclude>
<exclude>**/org/alfresco/solr/sql/SolrFilter.java</exclude>
<exclude>**/org/alfresco/solr/sql/SolrMethod.java</exclude>
<exclude>**/org/alfresco/solr/sql/SolrProject.java</exclude>
<exclude>**/org/alfresco/solr/sql/SolrRel.java</exclude>
<exclude>**/org/alfresco/solr/sql/SolrRules.java</exclude>
<exclude>**/org/alfresco/solr/sql/SolrSort.java</exclude>
<exclude>**/org/alfresco/solr/sql/SolrTable.java</exclude>
<exclude>**/org/alfresco/solr/sql/SolrTableScan.java</exclude>
<exclude>**/org/alfresco/solr/sql/SolrToEnumerableConverter.java</exclude>
<exclude>**/org/alfresco/solr/sql/SolrToEnumerableConverterRule.java</exclude>
<exclude>**/org/alfresco/solr/stream/FacetStream.java</exclude>
<exclude>**/org/alfresco/solr/stream/JDBCStream.java</exclude>
<exclude>**/org/alfresco/solr/stream/JSONTupleStream.java</exclude>
<exclude>**/org/alfresco/solr/stream/LimitStream.java</exclude>
<exclude>**/org/alfresco/solr/stream/StatsStream.java</exclude>
<exclude>**/org/alfresco/solr/stream/StreamHandler.java</exclude>
<exclude>**/org/alfresco/solr/stream/TimeSeriesStream.java</exclude>
</excludes>
</configuration>
<executions>
<execution>
<id>check-licenses</id>
<phase>compile</phase>
<goals>
<goal>update-file-header</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-license-headers</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<dependencies>
+15 -1
View File
@@ -270,7 +270,7 @@ $ docker build -t insightengine:develop .
**Configuration**
To pass an environment variable, it can be used the "-e" argument:
The "-e" argument can be used to pass an environment variable:
```bash
$ docker run -e SOLR_JAVA_MEM="-Xms4g -Xmx4g" -p 8983:8983 searchservices:develop
@@ -282,6 +282,20 @@ To pass several environment variables (e.g. SOLR\_ALFRESCO\_HOST, SOLR\_ALFRESCO
$ docker run -e SOLR_ALFRESCO_HOST=localhost -e SOLR_ALFRESCO_PORT=8080 -p 8983:8983 searchservices:develop
```
The following environment variables are supported:
| Name | Format | Description |
|------|--------|-------------|
| SOLR_OPTS | "-Dparam=value ..." | Options to pass when starting the Java process. |
| SOLR_HEAP | Memory amount (e.g. 2g) | The Java heap assigned to Solr. |
| SOLR_JAVA_MEM | "-Xms... -Xmx..." | The exact memory settings for Solr. Note that SOLR_HEAP takes precedence over this. |
| MAX_SOLR_RAM_PERCENTAGE | Integer | The percentage of available memory to assign to Solr. Note that SOLR_HEAP and SOLR_JAVA_MEM take precedence over this. |
| SEARCH_LOG_LEVEL | ERROR, WARN, INFO, DEBUG or TRACE | The root logger level. |
| ENABLE_SPELLCHECK | true or false | Whether spellchecking is enabled or not. |
| DISABLE_CASCADE_TRACKING | true or false | Whether cascade tracking is enabled or not. Disabling cascade tracking will improve performance, but result in some feature loss (e.g. path queries). |
| ALFRESCO_SECURE_COMMS | https or none | Whether communication with the repository is secured. See below. |
| SOLR_SSL_... | --- | These variables are also used to configure SSL. See below. |
**Using Mutual Auth TLS (SSL)**
This Docker image is exposing as VOLUME the folder `/opt/alfresco-search-services/keystores`, that can be used to mount `keystores` folder from host.
@@ -1,21 +1,29 @@
/*
* Copyright (C) 2005-2010 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* #%L
* Alfresco Search Services
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.repo.search.impl.lucene.analysis;
import org.alfresco.error.AlfrescoRuntimeException;
@@ -1,21 +1,29 @@
/*
* Copyright (C) 2005-2010 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* #%L
* Alfresco Search Services
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.repo.search.impl.lucene.analysis;
import java.io.BufferedReader;
@@ -1,21 +1,29 @@
/*
* Copyright (C) 2005-2010 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* #%L
* Alfresco Search Services
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.repo.search.impl.lucene.analysis;
import java.io.IOException;
@@ -1,21 +1,29 @@
/*
* Copyright (C) 2005-2014 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* #%L
* Alfresco Search Services
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.repo.search.impl.lucene.analysis;
import org.apache.lucene.analysis.Analyzer;
@@ -1,21 +1,29 @@
/*
* Copyright (C) 2005-2010 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* #%L
* Alfresco Search Services
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.repo.search.impl.lucene.analysis;
import java.io.IOException;
@@ -1,21 +1,29 @@
/*
* Copyright (C) 2005-2013 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* #%L
* Alfresco Search Services
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.solr;
import org.alfresco.repo.search.MLAnalysisMode;
@@ -1,21 +1,29 @@
/*
* Copyright (C) 2005-2014 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* #%L
* Alfresco Search Services
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.solr;
import java.io.IOException;
@@ -1,21 +1,29 @@
/*
* Copyright (C) 2005-2014 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* #%L
* Alfresco Search Services
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.solr;
import java.io.IOException;
@@ -1,20 +1,27 @@
/*
* Copyright (C) 2005-2020 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* #%L
* Alfresco Search Services
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.solr;
@@ -26,12 +33,12 @@ import org.alfresco.solr.adapters.IOpenBitSet;
import org.alfresco.solr.client.SOLRAPIClientFactory;
import org.alfresco.solr.config.ConfigUtil;
import org.alfresco.solr.tracker.AclTracker;
import org.alfresco.solr.tracker.CoreStatePublisher;
import org.alfresco.solr.tracker.AbstractShardInformationPublisher;
import org.alfresco.solr.tracker.DBIDRangeRouter;
import org.alfresco.solr.tracker.DocRouter;
import org.alfresco.solr.tracker.IndexHealthReport;
import org.alfresco.solr.tracker.MetadataTracker;
import org.alfresco.solr.tracker.SlaveCoreStatePublisher;
import org.alfresco.solr.tracker.NodeStatePublisher;
import org.alfresco.solr.tracker.SolrTrackerScheduler;
import org.alfresco.solr.tracker.Tracker;
import org.alfresco.solr.tracker.TrackerRegistry;
@@ -47,6 +54,7 @@ import org.apache.solr.common.util.NamedList;
import org.apache.solr.common.util.SimpleOrderedMap;
import org.apache.solr.core.CoreContainer;
import org.apache.solr.core.SolrCore;
import org.apache.solr.core.SolrResourceLoader;
import org.apache.solr.handler.admin.CoreAdminHandler;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.response.SolrQueryResponse;
@@ -69,16 +77,19 @@ import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Properties;
import java.util.Set;
import java.util.TreeSet;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Consumer;
import java.util.function.LongToIntFunction;
import java.util.stream.Collectors;
import static java.util.Arrays.asList;
import static java.util.Arrays.stream;
import static java.util.Optional.of;
import static java.util.Optional.ofNullable;
import static org.alfresco.repo.search.adaptor.lucene.QueryConstants.FIELD_INACLTXID;
import static org.alfresco.repo.search.adaptor.lucene.QueryConstants.FIELD_INTXID;
import static org.alfresco.solr.HandlerOfResources.extractCustomProperties;
import static org.alfresco.solr.HandlerOfResources.getSafeBoolean;
import static org.alfresco.solr.HandlerOfResources.getSafeLong;
@@ -92,6 +103,7 @@ import static org.alfresco.solr.HandlerReportHelper.buildAclTxReport;
import static org.alfresco.solr.HandlerReportHelper.buildNodeReport;
import static org.alfresco.solr.HandlerReportHelper.buildTrackerReport;
import static org.alfresco.solr.HandlerReportHelper.buildTxReport;
import static org.alfresco.solr.utils.Utils.isNullOrEmpty;
import static org.alfresco.solr.utils.Utils.notNullOrEmpty;
/**
@@ -153,22 +165,39 @@ public class AlfrescoCoreAdminHandler extends CoreAdminHandler
*/
private static final String ACTION_STATUS_SUCCESS = "success";
private static final String ACTION_STATUS_ERROR = "error";
private static final String ACTION_STATUS_SCHEDULED = "scheduled";
static final String ACTION_STATUS_SCHEDULED = "scheduled";
static final String ACTION_STATUS_NOT_SCHEDULED = "notScheduled";
static final String DRY_RUN_PARAMETER_NAME = "dryRun";
static final String FROM_TX_COMMIT_TIME_PARAMETER_NAME = "fromTxCommitTime";
static final String TO_TX_COMMIT_TIME_PARAMETER_NAME = "toTxCommitTime";
static final String MAX_TRANSACTIONS_TO_SCHEDULE_PARAMETER_NAME = "maxScheduledTransactions";
static final String MAX_TRANSACTIONS_TO_SCHEDULE_CONF_PROPERTY_NAME = "alfresco.admin.fix.maxScheduledTransactions";
static final String TX_IN_INDEX_NOT_IN_DB = "txInIndexNotInDb";
static final String DUPLICATED_TX_IN_INDEX = "duplicatedTxInIndex";
static final String MISSING_TX_IN_INDEX = "missingTxInIndex";
static final String ACL_TX_IN_INDEX_NOT_IN_DB = "aclTxInIndexNotInDb";
static final String DUPLICATED_ACL_TX_IN_INDEX = "duplicatedAclTxInIndex";
static final String MISSING_ACL_TX_IN_INDEX = "missingAclTxInIndex";
/**
* JSON/XML labels for the Action response
*/
private static final String ACTION_LABEL = "action";
private static final String ACTION_STATUS_LABEL = "status";
private static final String ACTION_ERROR_MESSAGE_LABEL = "errorMessage";
static final String ACTION_STATUS_LABEL = "status";
static final String ACTION_ERROR_MESSAGE_LABEL = "errorMessage";
static final String UNKNOWN_CORE_MESSAGE = "Unknown core:";
static final String UNPROCESSABLE_REQUEST_ON_SLAVE_NODES = "Requested action cannot be performed on slave nodes.";
private static final String ACTION_TX_TO_REINDEX = "txToReindex";
private static final String ACTION_ACL_CHANGE_SET_TO_REINDEX = "aclChangeSetToReindex";
private SolrTrackerScheduler scheduler;
private TrackerRegistry trackerRegistry;
private ConcurrentHashMap<String, InformationServer> informationServers;
TrackerRegistry trackerRegistry;
ConcurrentHashMap<String, InformationServer> informationServers;
private static List<String> CORE_PARAMETER_NAMES = asList(CoreAdminParams.CORE, "coreName", "index");
private final static List<String> CORE_PARAMETER_NAMES = asList(CoreAdminParams.CORE, "coreName", "index");
public AlfrescoCoreAdminHandler()
{
@@ -931,8 +960,7 @@ public class AlfrescoCoreAdminHandler extends CoreAdminHandler
*
* Synchronous execution
*
* @param req Query Request without parameters
* - coreName, optional, the name of the core to be checked
* @param cname, optional, the name of the core to be checked
*
* @return Response including the action result:
* - status: success, when the core has been created
@@ -1359,7 +1387,6 @@ public class AlfrescoCoreAdminHandler extends CoreAdminHandler
* - fromAclTx, optional: from ACL transaction Id to filter report results
* - toCalTx, optional: to ACL transaction Id to filter report results
*
* @param Response including the action result:
* - report.core: multiple Objects with the details of the report ("core" is the name of the Core)
*
* @throws JSONException
@@ -1490,7 +1517,6 @@ public class AlfrescoCoreAdminHandler extends CoreAdminHandler
*
* @param params Query Request with following parameters:
* - core, optional: The name of the SOLR Core
* @param rsp Query Response including the action result:
* - action.status: scheduled, as it will be executed by Trackers on the next maintenance operation
* - core: list of Document Ids with error that are going to reindexed
*/
@@ -1587,66 +1613,140 @@ public class AlfrescoCoreAdminHandler extends CoreAdminHandler
* - action.status: scheduled, as it will be executed by Trackers on the next maintenance operation
* - txToReindex: list of Transaction Ids that are going to be reindexed
* - aclChangeSetToReindex: list of ACL Change Set Ids that are going to be reindexed
* @throws JSONException
*/
private NamedList<Object> actionFIX(SolrParams params) throws JSONException
NamedList<Object> actionFIX(SolrParams params) throws JSONException
{
String requestedCoreName = coreName(params);
var wrapper = new Object()
{
NamedList<Object> response = new SimpleOrderedMap<>();;
final NamedList<Object> response = new SimpleOrderedMap<>();
};
if (isNullOrEmpty(requestedCoreName))
{
return wrapper.response;
}
if (!coreNames().contains(requestedCoreName))
{
wrapper.response.add(ACTION_ERROR_MESSAGE_LABEL, UNKNOWN_CORE_MESSAGE + requestedCoreName);
return wrapper.response;
}
if (!isMasterOrStandalone(requestedCoreName)) {
wrapper.response.add(ACTION_ERROR_MESSAGE_LABEL, UNPROCESSABLE_REQUEST_ON_SLAVE_NODES);
return wrapper.response;
}
Long fromTxCommitTime = params.getLong(FROM_TX_COMMIT_TIME_PARAMETER_NAME);
Long toTxCommitTime = params.getLong(TO_TX_COMMIT_TIME_PARAMETER_NAME);
boolean dryRun = params.getBool(DRY_RUN_PARAMETER_NAME, true);
int maxTransactionsToSchedule = getMaxTransactionToSchedule(params);
LOGGER.debug("FIX Admin request on core {}, parameters: " +
FROM_TX_COMMIT_TIME_PARAMETER_NAME + " = {}, " +
TO_TX_COMMIT_TIME_PARAMETER_NAME + " = {}, " +
DRY_RUN_PARAMETER_NAME + " = {}, " +
MAX_TRANSACTIONS_TO_SCHEDULE_PARAMETER_NAME + " = {}",
requestedCoreName,
ofNullable(fromTxCommitTime).map(Object::toString).orElse("N.A."),
ofNullable(toTxCommitTime).map(Object::toString).orElse("N.A."),
dryRun,
maxTransactionsToSchedule);
coreNames().stream()
.filter(coreName -> requestedCoreName == null || coreName.equals(requestedCoreName))
.filter(this::isMasterOrStandalone)
.forEach(coreName -> {
wrapper.response.add(coreName, fixOnSpecificCore(coreName));
});
.forEach(coreName ->
wrapper.response.add(
coreName,
fixOnSpecificCore(coreName, fromTxCommitTime, toTxCommitTime, dryRun, maxTransactionsToSchedule)));
if (wrapper.response.size() > 0)
{
wrapper.response.add(DRY_RUN_PARAMETER_NAME, dryRun);
ofNullable(fromTxCommitTime).ifPresent(value -> wrapper.response.add(FROM_TX_COMMIT_TIME_PARAMETER_NAME, value));
ofNullable(toTxCommitTime).ifPresent(value -> wrapper.response.add(TO_TX_COMMIT_TIME_PARAMETER_NAME, value));
wrapper.response.add(MAX_TRANSACTIONS_TO_SCHEDULE_PARAMETER_NAME, maxTransactionsToSchedule);
wrapper.response.add(ACTION_STATUS_LABEL, dryRun ? ACTION_STATUS_NOT_SCHEDULED : ACTION_STATUS_SCHEDULED);
}
wrapper.response.add(ACTION_STATUS_LABEL, ACTION_STATUS_SCHEDULED);
return wrapper.response;
}
private NamedList<Object> fixOnSpecificCore(String coreName)
/**
* Detects the transactions that need a FIX (i.e. reindexing) because the following reasons:
*
* <ul>
* <li>A transaction is in the index but not in repository</li>
* <li>A transaction is duplicated in the index</li>
* <li>A transaction is missing in the index</li>
* </ul>
*
* Depending on the dryRun parameter, other than collecting, this method could also schedule the transactions for
* reindexing.
*
* @param coreName the target core name.
* @param fromTxCommitTime the start commit time we consider for collecting transaction.
* @param toTxCommitTime the end commit time we consider for collecting transaction.
* @param dryRun a flag indicating if the collected transactions must be actually scheduled for reindexing.
* @param maxTransactionsToSchedule the maximum number of transactions to be scheduled for reindexing.
* @return a report about transactions that need to be fixed.
*/
NamedList<Object> fixOnSpecificCore(String coreName, Long fromTxCommitTime, Long toTxCommitTime, boolean dryRun, int maxTransactionsToSchedule)
{
try
{
// Gets Metadata health and fixes any problems
MetadataTracker metadataTracker = trackerRegistry.getTrackerForCore(coreName, MetadataTracker.class);
IndexHealthReport indexHealthReport = metadataTracker.checkIndex(null, null, null, null);
IOpenBitSet toReindex = indexHealthReport.getTxInIndexButNotInDb();
toReindex.or(indexHealthReport.getDuplicatedTxInIndex());
toReindex.or(indexHealthReport.getMissingTxFromIndex());
long current = -1;
// Goes through problems in the index
Set<Long> txToReindex = new TreeSet<>();
while ((current = toReindex.nextSetBit(current + 1)) != -1)
{
metadataTracker.addTransactionToReindex(current);
txToReindex.add(current);
}
final IndexHealthReport metadataTrackerIndexHealthReport =
metadataTracker.checkIndex(null, fromTxCommitTime, toTxCommitTime);
LOGGER.debug("FIX Admin action built the MetadataTracker Index Health Report on core {}, parameters: " +
FROM_TX_COMMIT_TIME_PARAMETER_NAME + " = {}, " +
TO_TX_COMMIT_TIME_PARAMETER_NAME + " = {}, " +
DRY_RUN_PARAMETER_NAME + " = {}, " +
MAX_TRANSACTIONS_TO_SCHEDULE_PARAMETER_NAME + " = {}",
coreName,
ofNullable(fromTxCommitTime).map(Object::toString).orElse("N.A."),
ofNullable(toTxCommitTime).map(Object::toString).orElse("N.A."),
dryRun,
maxTransactionsToSchedule);
// Gets the Acl health and fixes any problems
AclTracker aclTracker = trackerRegistry.getTrackerForCore(coreName, AclTracker.class);
indexHealthReport = aclTracker.checkIndex(null, null, null, null);
toReindex = indexHealthReport.getAclTxInIndexButNotInDb();
toReindex.or(indexHealthReport.getDuplicatedAclTxInIndex());
toReindex.or(indexHealthReport.getMissingAclTxFromIndex());
current = -1;
// Goes through the problems in the index
Set<Long> aclChangeSetToReindex = new TreeSet<>();
while ((current = toReindex.nextSetBit(current + 1)) != -1)
{
aclTracker.addAclChangeSetToReindex(current);
aclChangeSetToReindex.add(current);
}
final IndexHealthReport aclTrackerIndexHealthReport =
aclTracker.checkIndex(null, fromTxCommitTime, toTxCommitTime);
LOGGER.debug("FIX Admin action built the AclTracker Index Health Report on core {}, parameters: " +
FROM_TX_COMMIT_TIME_PARAMETER_NAME + " = {}, " +
TO_TX_COMMIT_TIME_PARAMETER_NAME + " = {}, " +
DRY_RUN_PARAMETER_NAME + " = {}, " +
MAX_TRANSACTIONS_TO_SCHEDULE_PARAMETER_NAME + " = {}",
coreName,
ofNullable(fromTxCommitTime).map(Object::toString).orElse("N.A."),
ofNullable(toTxCommitTime).map(Object::toString).orElse("N.A."),
dryRun,
maxTransactionsToSchedule);
NamedList<Object> response = new SimpleOrderedMap<>();
response.add(ACTION_TX_TO_REINDEX, txToReindex);
response.add(ACTION_ACL_CHANGE_SET_TO_REINDEX, aclChangeSetToReindex);
return response;
response.add(ACTION_TX_TO_REINDEX,
txToReindex(
coreName,
metadataTracker,
metadataTrackerIndexHealthReport,
dryRun ? txid -> {} : metadataTracker::addTransactionToReindex,
maxTransactionsToSchedule));
response.add(ACTION_ACL_CHANGE_SET_TO_REINDEX,
aclTxToReindex(
coreName,
aclTracker,
aclTrackerIndexHealthReport,
dryRun ? txid -> {} : aclTracker::addAclChangeSetToReindex,
maxTransactionsToSchedule));
return response;
}
catch(Exception exception)
{
@@ -1654,6 +1754,153 @@ public class AlfrescoCoreAdminHandler extends CoreAdminHandler
}
}
/**
* Detects the transactions that need a FIX (i.e. reindexing) because the following reasons:
*
* <ul>
* <li>A transaction is in the index but not in repository</li>
* <li>A transaction is duplicated in the index</li>
* <li>A transaction is missing in the index</li>
* </ul>
*
* Note: the method, as a side effect, could also schedule the detected transactions for reindexing.
* That is controlled by the scheduler input param (which is directly connected with the FIX tool "dryRun" parameter).
*
* @param coreName the target core name.
* @param tracker the {@link MetadataTracker} instance associated with the target core.
* @param report the index healt report produced by the tracker.
* @param scheduler the controller which manages the actual transaction scheduling.
* @param maxTransactionsToSchedule the maximum number of transactions to schedule for reindexing.
* @return a report which includes the transactions that need a reindexing.
* @see <a href="https://issues.alfresco.com/jira/browse/SEARCH-2233">SEARCH-2233</a>
* @see <a href="https://issues.alfresco.com/jira/browse/SEARCH-2248">SEARCH-2248</a>
*/
NamedList<Object> txToReindex(
String coreName,
MetadataTracker tracker,
final IndexHealthReport report,
Consumer<Long> scheduler,
int maxTransactionsToSchedule)
{
final AtomicInteger globalLimit = new AtomicInteger(maxTransactionsToSchedule);
final LongToIntFunction retrieveTransactionRelatedNodesCountFromRepository =
txid -> notNullOrEmpty(tracker.getFullNodesForDbTransaction(txid)).size();
final LongToIntFunction retrieveTransactionRelatedNodesCountFromIndex =
txid -> of(getInformationServers().get(coreName))
.map(SolrInformationServer.class::cast)
.map(server -> server.getDocListSize(FIELD_INTXID + ":" + txid))
.orElse(0);
NamedList<Object> txToReindex = new SimpleOrderedMap<>();
txToReindex.add(TX_IN_INDEX_NOT_IN_DB,
manageTransactionsToBeFixed(
report.getTxInIndexButNotInDb(),
retrieveTransactionRelatedNodesCountFromIndex,
scheduler,
globalLimit));
txToReindex.add(DUPLICATED_TX_IN_INDEX,
manageTransactionsToBeFixed(
report.getDuplicatedTxInIndex(),
retrieveTransactionRelatedNodesCountFromIndex,
scheduler,
globalLimit));
txToReindex.add(MISSING_TX_IN_INDEX,
manageTransactionsToBeFixed(
report.getMissingTxFromIndex(),
retrieveTransactionRelatedNodesCountFromRepository,
scheduler,
globalLimit));
return txToReindex;
}
/**
* Detects the ACL transactions that need a FIX (i.e. reindexing) because the following reasons:
*
* <ul>
* <li>A transaction is in the index but not in repository</li>
* <li>A transaction is duplicated in the index</li>
* <li>A transaction is missing in the index</li>
* </ul>
*
* This method is almost the same as {@link #txToReindex(String, MetadataTracker, IndexHealthReport, Consumer, int)}.
* The main difference is the target tracker ({@link AclTracker} in this case, instead of {@link MetadataTracker}).
*
* Note: the method, as a side effect, could also schedule the detected transactions for reindexing.
* That is controlled by the scheduler input param (which is directly connected with the FIX tool "dryRun" parameter).
*
* @param coreName the target core name.
* @param tracker the {@link AclTracker} instance associated with the target core.
* @param report the index healt report produced by the tracker.
* @param scheduler the controller which manages the actual transaction scheduling.
* @return a report which includes the transactions that need a reindexing.
* @see <a href="https://issues.alfresco.com/jira/browse/SEARCH-2233">SEARCH-2233</a>
* @see <a href="https://issues.alfresco.com/jira/browse/SEARCH-2248">SEARCH-2248</a>
*/
NamedList<Object> aclTxToReindex(
String coreName,
AclTracker tracker,
final IndexHealthReport report,
Consumer<Long> scheduler,
int maxTransactionsToSchedule)
{
final AtomicInteger globalLimit = new AtomicInteger(maxTransactionsToSchedule);
final LongToIntFunction retrieveAclTransactionRelatedNodesCountFromRepository =
txid -> notNullOrEmpty(tracker.getAclsForDbAclTransaction(txid)).size();
final LongToIntFunction retrieveAclTransactionRelatedNodesCountFromIndex =
txid -> of(getInformationServers().get(coreName))
.map(SolrInformationServer.class::cast)
.map(server -> server.getDocListSize(FIELD_INACLTXID + ":" + txid))
.orElse(0);
NamedList<Object> aclTxToReindex = new SimpleOrderedMap<>();
aclTxToReindex.add(ACL_TX_IN_INDEX_NOT_IN_DB,
manageTransactionsToBeFixed(
report.getAclTxInIndexButNotInDb(),
retrieveAclTransactionRelatedNodesCountFromIndex,
scheduler,
globalLimit));
aclTxToReindex.add(DUPLICATED_ACL_TX_IN_INDEX,
manageTransactionsToBeFixed(
report.getDuplicatedAclTxInIndex(),
retrieveAclTransactionRelatedNodesCountFromIndex,
scheduler,
globalLimit));
aclTxToReindex.add(MISSING_ACL_TX_IN_INDEX,
manageTransactionsToBeFixed(
report.getMissingAclTxFromIndex(),
retrieveAclTransactionRelatedNodesCountFromRepository,
scheduler,
globalLimit));
return aclTxToReindex;
}
NamedList<Object> manageTransactionsToBeFixed(
IOpenBitSet transactions,
LongToIntFunction nodesCounter,
Consumer<Long> scheduler,
AtomicInteger limit)
{
final NamedList<Object> transactionsList = new SimpleOrderedMap<>();
long txid = -1;
while ((txid = transactions.nextSetBit(txid + 1)) != -1 && limit.decrementAndGet() >= 0)
{
transactionsList.add(String.valueOf(txid), nodesCounter.applyAsInt(txid));
scheduler.accept(txid);
}
return transactionsList;
}
/**
* Get detailed report for a core or for every core including information
* related with handlers and trackers.
@@ -1762,11 +2009,11 @@ public class AlfrescoCoreAdminHandler extends CoreAdminHandler
* @param coreName the owning core name.
* @return the component which is in charge to publish the core state.
*/
CoreStatePublisher coreStatePublisher(String coreName)
AbstractShardInformationPublisher coreStatePublisher(String coreName)
{
return ofNullable(trackerRegistry.getTrackerForCore(coreName, MetadataTracker.class))
.map(CoreStatePublisher.class::cast)
.orElse(trackerRegistry.getTrackerForCore(coreName, SlaveCoreStatePublisher.class));
.map(AbstractShardInformationPublisher.class::cast)
.orElse(trackerRegistry.getTrackerForCore(coreName, NodeStatePublisher.class));
}
/**
@@ -1823,4 +2070,18 @@ public class AlfrescoCoreAdminHandler extends CoreAdminHandler
.findFirst()
.orElse(null);
}
int getMaxTransactionToSchedule(SolrParams params)
{
String requestedCoreName = coreName(params);
return ofNullable(params.getInt(MAX_TRANSACTIONS_TO_SCHEDULE_PARAMETER_NAME))
.orElseGet(() ->
ofNullable(coreContainer)
.map(container -> container.getCore(requestedCoreName))
.map(SolrCore::getResourceLoader)
.map(SolrResourceLoader::getCoreProperties)
.map(conf -> conf.getProperty(MAX_TRANSACTIONS_TO_SCHEDULE_CONF_PROPERTY_NAME))
.map(Integer::parseInt)
.orElse(Integer.MAX_VALUE)); // Last fallback if we don't have a request param and a value in configuration
}
}
@@ -1,21 +1,29 @@
/*
* Copyright (C) 2005-2014 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* #%L
* Alfresco Search Services
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.solr;
import java.io.IOException;
@@ -1,21 +1,29 @@
/*
* Copyright (C) 2005-2020 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* #%L
* Alfresco Search Services
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.solr;
/**
@@ -1,21 +1,29 @@
/*
* Copyright (C) 2005-2014 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* #%L
* Alfresco Search Services
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.solr;
import org.alfresco.repo.search.impl.parsers.AlfrescoFunctionEvaluationContext;
@@ -1,21 +1,29 @@
/*
* Copyright (C) 2005-2014 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* #%L
* Alfresco Search Services
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.solr;
import static java.util.Collections.unmodifiableList;
@@ -108,6 +116,13 @@ import org.springframework.beans.BeansException;
import org.springframework.context.support.FileSystemXmlApplicationContext;
import static java.util.Optional.ofNullable;
import static org.alfresco.solr.SolrInformationServer.UNIT_OF_TIME_DAY_FIELD_SUFFIX;
import static org.alfresco.solr.SolrInformationServer.UNIT_OF_TIME_HOUR_FIELD_SUFFIX;
import static org.alfresco.solr.SolrInformationServer.UNIT_OF_TIME_MINUTE_FIELD_SUFFIX;
import static org.alfresco.solr.SolrInformationServer.UNIT_OF_TIME_MONTH_FIELD_SUFFIX;
import static org.alfresco.solr.SolrInformationServer.UNIT_OF_TIME_SECOND_FIELD_SUFFIX;
import static org.alfresco.solr.SolrInformationServer.UNIT_OF_TIME_QUARTER_FIELD_SUFFIX;
import static org.alfresco.solr.SolrInformationServer.UNIT_OF_TIME_YEAR_FIELD_SUFFIX;
/**
* @author Andy
@@ -130,8 +145,9 @@ public class AlfrescoSolrDataModel implements QueryConstants
public enum FieldUse
{
FTS, // Term/Phrase/Range/Fuzzy/Prefix/Proximity/Wild
ID, // Exact/ExactRange - Comparison, In, Upper, Lower
FTS, // Term/Phrase/Range/Fuzzy/Prefix/Proximity
ID, // ExactRange - Comparison, In, Upper, Lower, Wildcard
EXACT, // Exact
FACET, // Field, Range, Query
MULTI_FACET, // Text fields will require cross language support to avoid tokenisation for facets
STATS, // Stats
@@ -141,33 +157,43 @@ public class AlfrescoSolrDataModel implements QueryConstants
HIGHLIGHT
}
public enum ContentFieldType
public enum SpecializedFieldType
{
DOCID,
SIZE,
LOCALE,
MIMETYPE,
ENCODING,
CONTENT_DOCID,
CONTENT_SIZE,
CONTENT_LOCALE,
CONTENT_MIMETYPE,
CONTENT_ENCODING,
TRANSFORMATION_STATUS,
TRANSFORMATION_TIME,
TRANSFORMATION_EXCEPTION
TRANSFORMATION_EXCEPTION,
UNIT_OF_TIME_SECOND,
UNIT_OF_TIME_MINUTE,
UNIT_OF_TIME_HOUR,
UNIT_OF_TIME_DAY,
UNIT_OF_TIME_MONTH,
UNIT_OF_TIME_QUARTER,
UNIT_OF_TIME_YEAR
}
public static final String CONTENT_S_LOCALE_PREFIX = "content@s__locale@";
static final String PART_FIELDNAME_PREFIX = "part@sd@";
static final Set<String> DATE_PART_SUFFIXES =
Set.of(UNIT_OF_TIME_YEAR_FIELD_SUFFIX,
UNIT_OF_TIME_QUARTER_FIELD_SUFFIX,
UNIT_OF_TIME_MONTH_FIELD_SUFFIX,
UNIT_OF_TIME_DAY_FIELD_SUFFIX,
UNIT_OF_TIME_HOUR_FIELD_SUFFIX,
UNIT_OF_TIME_MINUTE_FIELD_SUFFIX,
UNIT_OF_TIME_SECOND_FIELD_SUFFIX);
/**
* Infix used for denoting a primitive single valued field with no doc values enabled
*
* @see #getFieldForText
*/
private static final String SINGLE_VALUE_WITHOUT_DOC_VALUES_MARKER = "@s_@";
/**
* Infix used for denoting a primitive single valued field with no doc values enabled
*
* @see #getFieldForText
*/
private static final String SINGLE_VALUE_WITH_DOC_VALUES_MARKER = "@sd@";
@@ -183,26 +209,22 @@ public class AlfrescoSolrDataModel implements QueryConstants
private final static AlfrescoSolrDataModel INSTANCE = new AlfrescoSolrDataModel();
private TenantService tenantService;
private final TenantService tenantService;
private NamespaceDAO namespaceDAO;
private final NamespaceDAO namespaceDAO;
private DictionaryDAOImpl dictionaryDAO;
private final DictionaryDAOImpl dictionaryDAO;
private Map<String,DictionaryComponent> dictionaryServices;
private final Map<String,DictionaryComponent> dictionaryServices;
private Map<DictionaryKey,CMISAbstractDictionaryService> cmisDictionaryServices;
private final Map<DictionaryKey,CMISAbstractDictionaryService> cmisDictionaryServices;
private Map<String, Set<String>> modelErrors = new HashMap<>();
private Set<QName> suggestableProperties = new HashSet<>();
private Set<QName> crossLocaleSearchDataTypes = new HashSet<>();
private Set<QName> crossLocaleSearchProperties = new HashSet<>();
private Set<QName> identifierProperties = new HashSet<>();
private ThreadPoolExecutor threadPool;
private final Map<String, Set<String>> modelErrors = new HashMap<>();
private final Set<QName> suggestableProperties = new HashSet<>();
private final Set<QName> crossLocaleSearchDataTypes = new HashSet<>();
private final Set<QName> crossLocaleSearchProperties = new HashSet<>();
private final Set<QName> identifierProperties = new HashSet<>();
private final ThreadPoolExecutor threadPool;
public void close() {
threadPool.shutdown();
@@ -595,7 +617,7 @@ public class AlfrescoSolrDataModel implements QueryConstants
return dictionaryComponent;
}
public IndexedField getIndexedFieldForContentPropertyMetadata(QName propertyQName, ContentFieldType type)
public IndexedField getIndexedFieldForSpecializedPropertyMetadata(QName propertyQName, SpecializedFieldType type)
{
IndexedField indexedField = new IndexedField();
PropertyDefinition propertyDefinition = getPropertyDefinition(propertyQName);
@@ -620,19 +642,19 @@ public class AlfrescoSolrDataModel implements QueryConstants
builder.append('_');
switch (type)
{
case DOCID:
case CONTENT_DOCID:
builder.append("docid");
break;
case ENCODING:
case CONTENT_ENCODING:
builder.append("encoding");
break;
case LOCALE:
case CONTENT_LOCALE:
builder.append("locale");
break;
case MIMETYPE:
case CONTENT_MIMETYPE:
builder.append("mimetype");
break;
case SIZE:
case CONTENT_SIZE:
builder.append("size");
break;
case TRANSFORMATION_EXCEPTION:
@@ -647,21 +669,29 @@ public class AlfrescoSolrDataModel implements QueryConstants
default:
break;
}
builder.append('@');
builder.append(propertyQName);
indexedField.addField(builder.toString(), false, false);
}
else if (isDateOrDatetime(dataTypeDefinition))
{
String dateDerivedSuffix = getDateDerivedSuffix(type);
if (dateDerivedSuffix != null)
{
indexedField.addField(getDateDerivedField(propertyQName, dateDerivedSuffix), false, true);
}
}
return indexedField;
}
public IndexedField getQueryableFields(QName propertyQName, ContentFieldType type, FieldUse fieldUse)
public IndexedField getQueryableFields(QName propertyQName, SpecializedFieldType type, FieldUse fieldUse)
{
if(type != null)
{
return getIndexedFieldForContentPropertyMetadata(propertyQName, type);
return getIndexedFieldForSpecializedPropertyMetadata(propertyQName, type);
}
IndexedField indexedField = new IndexedField();
@@ -693,6 +723,9 @@ public class AlfrescoSolrDataModel implements QueryConstants
case ID:
addIdentifierSearchFields(propertyDefinition, indexedField);
break;
case EXACT:
addExactSearchFields(propertyDefinition, indexedField);
break;
case MULTI_FACET:
addMultiSearchFields(propertyDefinition, indexedField);
break;
@@ -800,9 +833,10 @@ public class AlfrescoSolrDataModel implements QueryConstants
}
/*
* Adds best identifier fields in order of preference
* If the untokenised version is available, go for it.
* If not it takes the tokenised versions available.
*/
private void addIdentifierSearchFields(PropertyDefinition propertyDefinition, IndexedField indexedField)
private void addIdentifierSearchFields( PropertyDefinition propertyDefinition , IndexedField indexedField)
{
if ((propertyDefinition.getIndexTokenisationMode() == IndexTokenisationMode.FALSE)
|| (propertyDefinition.getIndexTokenisationMode() == IndexTokenisationMode.BOTH))
@@ -821,6 +855,30 @@ public class AlfrescoSolrDataModel implements QueryConstants
}
}
/*
* If only the untokenised version is available, go for it.
* If not it takes the tokenised cross locale version.
*/
private void addExactSearchFields(PropertyDefinition propertyDefinition, IndexedField indexedField)
{
if ((propertyDefinition.getIndexTokenisationMode() == IndexTokenisationMode.FALSE)
|| !(propertyDefinition.getIndexTokenisationMode() == IndexTokenisationMode.BOTH))
{
indexedField.addField(getFieldForText(true, false, false, propertyDefinition), true, false);
indexedField.addField(getFieldForText(false, false, false, propertyDefinition), false, false);
}
else
{
if(crossLocaleSearchDataTypes.contains(propertyDefinition.getDataType().getName()) || crossLocaleSearchProperties.contains(propertyDefinition.getName()))
{
indexedField.addField(getFieldForText(false, true, false, propertyDefinition), false, false);
} else{
throw new UnsupportedOperationException("Exact Term search is not supported unless you configure the field <"+propertyDefinition.getName()+"> for cross locale search");
}
}
}
/*
* Adds best identifier fields in order of preference
*/
@@ -942,6 +1000,11 @@ public class AlfrescoSolrDataModel implements QueryConstants
public String getStoredTextField(QName propertyQName)
{
return getStoredTextField(propertyQName, null);
}
public String getStoredTextField(QName propertyQName, String suffix)
{
PropertyDefinition propertyDefinition = getPropertyDefinition(propertyQName);
@@ -967,11 +1030,21 @@ public class AlfrescoSolrDataModel implements QueryConstants
sb.append("@");
sb.append(propertyDefinition.getName().toString());
if (suffix != null)
{
sb.append(suffix);
}
return sb.toString();
}
public String getStoredMLTextField(QName propertyQName)
{
return getStoredMLTextField(propertyQName, null);
}
public String getStoredMLTextField(QName propertyQName, String suffix)
{
PropertyDefinition propertyDefinition = getPropertyDefinition(propertyQName);
@@ -995,11 +1068,21 @@ public class AlfrescoSolrDataModel implements QueryConstants
sb.append("@");
sb.append(propertyDefinition.getName().toString());
if (suffix != null)
{
sb.append(suffix);
}
return sb.toString();
}
public String getStoredContentField(QName propertyQName)
{
return getStoredContentField(propertyQName, null);
}
public String getStoredContentField(QName propertyQName, String suffix)
{
PropertyDefinition propertyDefinition = getPropertyDefinition(propertyQName);
@@ -1023,10 +1106,44 @@ public class AlfrescoSolrDataModel implements QueryConstants
sb.append("@");
sb.append(propertyDefinition.getName().toString());
if (suffix != null)
{
sb.append(suffix);
}
return sb.toString();
}
public String getDateDerivedField(QName propertyQName, String suffix)
{
PropertyDefinition propertyDefinition = getPropertyDefinition(propertyQName);
return "part@sd@" + propertyDefinition.getName().toString() + suffix;
}
public String getDateDerivedSuffix(SpecializedFieldType type)
{
switch (type)
{
case UNIT_OF_TIME_SECOND:
return UNIT_OF_TIME_SECOND_FIELD_SUFFIX;
case UNIT_OF_TIME_MINUTE:
return UNIT_OF_TIME_MINUTE_FIELD_SUFFIX;
case UNIT_OF_TIME_HOUR:
return UNIT_OF_TIME_HOUR_FIELD_SUFFIX;
case UNIT_OF_TIME_DAY:
return UNIT_OF_TIME_DAY_FIELD_SUFFIX;
case UNIT_OF_TIME_MONTH:
return UNIT_OF_TIME_MONTH_FIELD_SUFFIX;
case UNIT_OF_TIME_QUARTER:
return UNIT_OF_TIME_QUARTER_FIELD_SUFFIX;
case UNIT_OF_TIME_YEAR:
return UNIT_OF_TIME_YEAR_FIELD_SUFFIX;
default:
return null;
}
}
/**
* Get all the field names into which we must copy the source data
@@ -1174,43 +1291,6 @@ public class AlfrescoSolrDataModel implements QueryConstants
}
}
private boolean isPrimitive(DataTypeDefinition dataType)
{
if(dataType.getName().equals(DataTypeDefinition.INT))
{
return true;
}
else if(dataType.getName().equals(DataTypeDefinition.LONG))
{
return true;
}
else if(dataType.getName().equals(DataTypeDefinition.FLOAT))
{
return true;
}
else if(dataType.getName().equals(DataTypeDefinition.DOUBLE))
{
return true;
}
else if(dataType.getName().equals(DataTypeDefinition.DATE))
{
return true;
}
else if(dataType.getName().equals(DataTypeDefinition.DATETIME))
{
return true;
}
else if(dataType.getName().equals(DataTypeDefinition.BOOLEAN))
{
return true;
}
else if(dataType.getName().equals(DataTypeDefinition.CATEGORY))
{
return true;
}
else return dataType.getName().equals(DataTypeDefinition.NODE_REF);
}
public String getFieldForNonText(PropertyDefinition propertyDefinition)
{
StringBuilder builder = new StringBuilder();
@@ -1297,30 +1377,6 @@ public class AlfrescoSolrDataModel implements QueryConstants
dictionaryDAO.removeModel(modelQName);
}
private Set<String> validateModel(M2Model model)
{
try
{
dictionaryDAO.getCompiledModel(QName.createQName(model.getName(), namespaceDAO));
}
catch (DictionaryException | NamespaceException exception)
{
// No model to diff
return Collections.emptySet();
}
// namespace unknown - no model
List<M2ModelDiff> modelDiffs = dictionaryDAO.diffModelIgnoringConstraints(model);
return modelDiffs.stream()
.filter(diff -> diff.getDiffType().equals(M2ModelDiff.DIFF_UPDATED))
.map(diff ->
String.format("Model not updated: %s Failed to validate model update - found non-incrementally updated %s '%s'",
model.getName(),
diff.getElementType(),
diff.getElementName()))
.collect(Collectors.toSet());
}
M2Model getM2Model(QName modelQName)
{
return dictionaryDAO.getCompiledModel(modelQName).getM2Model();
@@ -1626,28 +1682,39 @@ public class AlfrescoSolrDataModel implements QueryConstants
}
}
if (propertyDef == null || propertyDef.getName() == null){
if (propertyDef == null || propertyDef.getName() == null)
{
return mapNonPropertyFields(luceneField);
}
if (propertyDef.getName().equals(DataTypeDefinition.TEXT))
if (isDateOrDatetime(propertyDef.getDataType()) && isDerivedDateField(fieldNameAndEnding.getSecond()))
{
return getStoredTextField(propertyDef.getName());
return getDateDerivedField(propertyDef.getName(), fieldNameAndEnding.getSecond());
}
else if (propertyDef.getName().equals(DataTypeDefinition.MLTEXT))
else if (propertyDef.getDataType().getName().equals(DataTypeDefinition.TEXT))
{
return getStoredMLTextField(propertyDef.getName());
return getStoredTextField(propertyDef.getName(), fieldNameAndEnding.getSecond());
}
else if (propertyDef.getName().equals(DataTypeDefinition.CONTENT))
else if (propertyDef.getDataType().getName().equals(DataTypeDefinition.MLTEXT))
{
return getStoredContentField(propertyDef.getName());
return getStoredMLTextField(propertyDef.getName(), fieldNameAndEnding.getSecond());
}
else if (propertyDef.getDataType().getName().equals(DataTypeDefinition.CONTENT))
{
return getStoredContentField(propertyDef.getName(), fieldNameAndEnding.getSecond());
}
else
{
return mapAlfrescoField(FieldUse.FTS, 0, fieldNameAndEnding, luceneField, propertyDef);
return mapAlfrescoField(FieldUse.FTS, 0, fieldNameAndEnding, luceneField, propertyDef)
+ fieldNameAndEnding.getSecond();
}
}
public boolean isDerivedDateField(String suffix)
{
return DATE_PART_SUFFIXES.contains(suffix);
}
public String mapProperty(String potentialProperty, FieldUse fieldUse, SolrQueryRequest req, int position)
{
if(potentialProperty.equals("asc") || potentialProperty.equals("desc") || potentialProperty.equals("_docid_"))
@@ -1690,7 +1757,109 @@ public class AlfrescoSolrDataModel implements QueryConstants
return solrSortField;
}
private String mapAlfrescoField(FieldUse fieldUse, int position, Pair<String, String> fieldNameAndEnding, String luceneField, PropertyDefinition propertyDef) {
public String mapNonPropertyFields(String queryField)
{
switch(queryField)
{
case "ID":
return "LID";
case "EXACTTYPE":
return "TYPE";
default:
return queryField;
}
}
/**
* @param ending String
* @return SpecializedFieldType
*/
public SpecializedFieldType getTextField(String ending)
{
switch(ending)
{
case FIELD_MIMETYPE_SUFFIX:
return SpecializedFieldType.CONTENT_MIMETYPE;
case FIELD_SIZE_SUFFIX:
return SpecializedFieldType.CONTENT_SIZE;
case FIELD_LOCALE_SUFFIX:
return SpecializedFieldType.CONTENT_LOCALE;
case FIELD_ENCODING_SUFFIX:
return SpecializedFieldType.CONTENT_ENCODING;
case UNIT_OF_TIME_SECOND_FIELD_SUFFIX:
return SpecializedFieldType.UNIT_OF_TIME_SECOND;
case UNIT_OF_TIME_MINUTE_FIELD_SUFFIX:
return SpecializedFieldType.UNIT_OF_TIME_MINUTE;
case UNIT_OF_TIME_HOUR_FIELD_SUFFIX:
return SpecializedFieldType.UNIT_OF_TIME_HOUR;
case UNIT_OF_TIME_DAY_FIELD_SUFFIX:
return SpecializedFieldType.UNIT_OF_TIME_DAY;
case UNIT_OF_TIME_MONTH_FIELD_SUFFIX:
return SpecializedFieldType.UNIT_OF_TIME_MONTH;
case UNIT_OF_TIME_QUARTER_FIELD_SUFFIX:
return SpecializedFieldType.UNIT_OF_TIME_QUARTER;
case UNIT_OF_TIME_YEAR_FIELD_SUFFIX:
return SpecializedFieldType.UNIT_OF_TIME_YEAR;
case FIELD_TRANSFORMATION_STATUS_SUFFIX:
case FIELD_TRANSFORMATION_TIME_SUFFIX:
case FIELD_TRANSFORMATION_EXCEPTION_SUFFIX:
default:
return null;
}
}
public void setCMDefaultUri()
{
if(getNamespaceDAO().getURIs().contains(NamespaceService.CONTENT_MODEL_1_0_URI))
{
getNamespaceDAO().addPrefix("", NamespaceService.CONTENT_MODEL_1_0_URI);
}
}
/**
* Returns the prefix used for denoting a field which is meant to represent a constituent part of a
* date or datetime (e.g. year, month, second, minute).
*
* @param sourceFieldName the date/datetime source field name.
* @return the prefix that can be used for denoting a date or datetime part
*/
public String destructuredDateTimePartFieldNamePrefix(String sourceFieldName) {
// source field name example: datetime@sd@{http://www.alfresco.org/model/content/1.0}created
// prefix: datetime
String prefix = sourceFieldName.substring(0, sourceFieldName.indexOf("@"));
// prefix, docValues disabled option: datetime@s_@
String sourceFieldNamePrefixWithoutDocValues = prefix + SINGLE_VALUE_WITHOUT_DOC_VALUES_MARKER;
// prefix, docValues enabled option: datetime@sd@
String sourceFieldNamePrefixWithDocValues = prefix + SINGLE_VALUE_WITH_DOC_VALUES_MARKER;
return sourceFieldName.replace(sourceFieldNamePrefixWithoutDocValues, PART_FIELDNAME_PREFIX)
.replace(sourceFieldNamePrefixWithDocValues, PART_FIELDNAME_PREFIX);
}
private boolean isDateOrDatetime(DataTypeDefinition dataType)
{
return dataType.getName().equals(DataTypeDefinition.DATE) ||
dataType.getName().equals(DataTypeDefinition.DATETIME);
}
private boolean isPrimitive(DataTypeDefinition dataType)
{
QName name = dataType.getName();
return name.equals(DataTypeDefinition.INT)
|| name.equals(DataTypeDefinition.LONG)
|| name.equals(DataTypeDefinition.FLOAT)
|| name.equals(DataTypeDefinition.DOUBLE)
|| isDateOrDatetime(dataType)
|| name.equals(DataTypeDefinition.BOOLEAN)
|| name.equals(DataTypeDefinition.CATEGORY)
|| name.equals(DataTypeDefinition.NODE_REF);
}
private String mapAlfrescoField(FieldUse fieldUse, int position, Pair<String, String> fieldNameAndEnding, String luceneField, PropertyDefinition propertyDef)
{
String solrSortField;
if(propertyDef != null)
{
@@ -1719,72 +1888,27 @@ public class AlfrescoSolrDataModel implements QueryConstants
return solrSortField;
}
public String mapNonPropertyFields(String queryField)
private Set<String> validateModel(M2Model model)
{
switch(queryField)
try
{
case "ID":
return "LID";
case "EXACTTYPE":
return "TYPE";
default:
return queryField;
dictionaryDAO.getCompiledModel(QName.createQName(model.getName(), namespaceDAO));
}
}
/**
* @param ending String
* @return ContentFieldType
*/
public ContentFieldType getTextField(String ending)
{
switch(ending)
catch (DictionaryException | NamespaceException exception)
{
case FIELD_MIMETYPE_SUFFIX:
return ContentFieldType.MIMETYPE;
case FIELD_SIZE_SUFFIX:
return ContentFieldType.SIZE;
case FIELD_LOCALE_SUFFIX:
return ContentFieldType.LOCALE;
case FIELD_ENCODING_SUFFIX:
return ContentFieldType.ENCODING;
case FIELD_TRANSFORMATION_STATUS_SUFFIX:
case FIELD_TRANSFORMATION_TIME_SUFFIX:
case FIELD_TRANSFORMATION_EXCEPTION_SUFFIX:
default:
return null;
// No model to diff
return Collections.emptySet();
}
}
public void setCMDefaultUri()
{
if(getNamespaceDAO().getURIs().contains(NamespaceService.CONTENT_MODEL_1_0_URI))
{
getNamespaceDAO().addPrefix("", NamespaceService.CONTENT_MODEL_1_0_URI);
}
}
/**
* Returns the prefix used for denoting a field which is meant to represent a constituent part of a
* date or datetime (e.g. year, month, second, minute).
*
* @param sourceFieldName the date/datetime source field name.
* @param sourceDataTypeDefinition the datatype of the source field name (date or datetime)
* @return the prefix that can be used for denoting a date or datetime part
*/
public String destructuredDateTimePartFieldNamePrefix(String sourceFieldName, DataTypeDefinition sourceDataTypeDefinition) {
// source field name example: datetime@sd@{http://www.alfresco.org/model/content/1.0}created
// prefix: datetime
String prefix = sourceFieldName.substring(0, sourceFieldName.indexOf("@"));
// prefix, docValues disabled option: datetime@s_@
String sourceFieldNamePrefixWithoutDocValues = prefix + SINGLE_VALUE_WITHOUT_DOC_VALUES_MARKER;
// prefix, docValues enabled option: datetime@sd@
String sourceFieldNamePrefixWithDocValues = prefix + SINGLE_VALUE_WITH_DOC_VALUES_MARKER;
return sourceFieldName.replace(sourceFieldNamePrefixWithoutDocValues, PART_FIELDNAME_PREFIX)
.replace(sourceFieldNamePrefixWithDocValues, PART_FIELDNAME_PREFIX);
// namespace unknown - no model
List<M2ModelDiff> modelDiffs = dictionaryDAO.diffModelIgnoringConstraints(model);
return modelDiffs.stream()
.filter(diff -> diff.getDiffType().equals(M2ModelDiff.DIFF_UPDATED))
.map(diff ->
String.format("Model not updated: %s Failed to validate model update - found non-incrementally updated %s '%s'",
model.getName(),
diff.getElementType(),
diff.getElementName()))
.collect(Collectors.toSet());
}
}
@@ -1,20 +1,27 @@
/*
* Copyright (C) 2014 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* #%L
* Alfresco Search Services
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.solr;
@@ -1,21 +1,29 @@
/*
* Copyright (C) 2005-2010 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* #%L
* Alfresco Search Services
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.solr;
import java.io.IOException;
@@ -1,21 +1,29 @@
/*
* Copyright (C) 2005-2013 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* #%L
* Alfresco Search Services
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.solr;
import java.util.Comparator;
@@ -1,24 +1,29 @@
/*
* Copyright (C) 2005 - 2016 Alfresco Software Limited
*
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* #%L
* Alfresco Search Services
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.solr;
import java.io.File;
@@ -1,24 +1,29 @@
/*
* Copyright (C) 2005 - 2016 Alfresco Software Limited
*
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* #%L
* Alfresco Search Services
* %%
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.solr;
import org.alfresco.error.AlfrescoRuntimeException;
@@ -120,7 +125,7 @@ class HandlerReportHelper
return nr;
}
static NamedList<Object> buildNodeReport(CoreStatePublisher publisher, Long dbid) throws JSONException
static NamedList<Object> buildNodeReport(AbstractShardInformationPublisher publisher, Long dbid) throws JSONException
{
NodeReport nodeReport = publisher.checkNode(dbid);
@@ -152,7 +157,7 @@ class HandlerReportHelper
{
// ACL
AclTracker aclTracker = trackerRegistry.getTrackerForCore(coreName, AclTracker.class);
IndexHealthReport aclReport = aclTracker.checkIndex(toTx, toAclTx, fromTime, toTime);
IndexHealthReport aclReport = aclTracker.checkIndex(toAclTx, fromTime, toTime);
NamedList<Object> ihr = new SimpleOrderedMap<>();
ihr.add("DB acl transaction count", aclReport.getDbAclTransactionCount());
ihr.add("Count of duplicated acl transactions in the index", aclReport.getDuplicatedAclTxInIndex()
@@ -182,7 +187,7 @@ class HandlerReportHelper
// Metadata
MetadataTracker metadataTracker = trackerRegistry.getTrackerForCore(coreName, MetadataTracker.class);
IndexHealthReport metaReport = metadataTracker.checkIndex(toTx, toAclTx, fromTime, toTime);
IndexHealthReport metaReport = metadataTracker.checkIndex(toTx, fromTime, toTime);
ihr.add("DB transaction count", metaReport.getDbTransactionCount());
ihr.add("Count of duplicated transactions in the index", metaReport.getDuplicatedTxInIndex()
.cardinality());
@@ -243,7 +248,7 @@ class HandlerReportHelper
NamedList<Object> coreSummary = new SimpleOrderedMap<>();
coreSummary.addAll((SimpleOrderedMap<Object>) srv.getCoreStats());
SlaveCoreStatePublisher statePublisher = trackerRegistry.getTrackerForCore(cname, SlaveCoreStatePublisher.class);
NodeStatePublisher statePublisher = trackerRegistry.getTrackerForCore(cname, NodeStatePublisher.class);
TrackerState trackerState = statePublisher.getTrackerState();
long lastIndexTxCommitTime = trackerState.getLastIndexedTxCommitTime();

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