mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-09-24 14:32:01 +00:00
Compare commits
172 Commits
7.183.300-
...
7.302
Author | SHA1 | Date | |
---|---|---|---|
|
64483cdf29 | ||
|
6f8879686a | ||
|
e722ec080b | ||
|
d44dc63519 | ||
|
b34b58c6bc | ||
|
81838290a1 | ||
|
82ae1d8a8f | ||
|
d61efd18b4 | ||
|
e6b2101197 | ||
|
18854bb28f | ||
|
99d5680c69 | ||
|
4d5ae34b07 | ||
|
673e326672 | ||
|
76dfa8e445 | ||
|
72aa1b0a84 | ||
|
596dfe0940 | ||
|
c1a56ee22f | ||
|
106476287d | ||
|
01f7df6ff0 | ||
|
d83fb0a942 | ||
|
903c2828d2 | ||
|
c59d485eab | ||
|
b3b3c4c9f5 | ||
|
9e014128f4 | ||
|
36ccfe2bea | ||
|
56e9417e00 | ||
|
d5317444c8 | ||
|
f0d09767e7 | ||
|
eb8f4da6c9 | ||
|
bfc6e4c490 | ||
|
43815223ba | ||
|
4da02fcae2 | ||
|
a7f4f02dcf | ||
|
048c456580 | ||
|
1cd59480f9 | ||
|
c655c97421 | ||
|
7625df9166 | ||
|
515b8d1720 | ||
|
32e4a7bf8b | ||
|
fbb581f527 | ||
|
a6caa9953b | ||
|
69e16a3ffc | ||
|
28bebe0e6d | ||
|
9b4a43896a | ||
|
58c5160aeb | ||
|
94b4f4eefd | ||
|
c75e3cd7c4 | ||
|
58764feccd | ||
|
c5bceb0427 | ||
|
64e225dd0e | ||
|
30be7fdb61 | ||
|
8145afb29c | ||
|
5690f15967 | ||
|
2a7306cc8b | ||
|
70839f8d9a | ||
|
f895938f04 | ||
|
bcb7cc1400 | ||
|
a6511a3fd1 | ||
|
f0cdecac08 | ||
|
d9e16374d9 | ||
|
7c2d66bf2c | ||
|
f3f3ed7e61 | ||
|
15ca57bcd2 | ||
|
b24b144c3e | ||
|
f56726a75a | ||
|
3f78c9a729 | ||
|
2ffcfaee4e | ||
|
73784ab389 | ||
|
ff612b2233 | ||
|
60093108db | ||
|
3e2b0a0f22 | ||
|
fe9f6b73cd | ||
|
3d1e326d38 | ||
|
2b6185021e | ||
|
8b2b52bd47 | ||
|
41eeacac47 | ||
|
81e9ae40ca | ||
|
d9283af46b | ||
|
d8d00b1430 | ||
|
ec22b6b39a | ||
|
69fc15dd0c | ||
|
19a31ec32b | ||
|
4a83e7f83f | ||
|
023583e67a | ||
|
daf7ec44e4 | ||
|
ec131b33a5 | ||
|
d1ce85398c | ||
|
c79e3f8550 | ||
|
7a8996463a | ||
|
8242b34604 | ||
|
f34dd7ad16 | ||
|
4f517f9c41 | ||
|
187038d4ca | ||
|
f189f71fb8 | ||
|
82425433c4 | ||
|
0703d10899 | ||
|
5ffacd315e | ||
|
70ad374f8a | ||
|
88bec51910 | ||
|
fdce5a76ca | ||
|
93a4b9c0dd | ||
|
d123af8664 | ||
|
2ef82ccc56 | ||
|
7a6beb433a | ||
|
257fa68432 | ||
|
7c07b6c974 | ||
|
87ca3ac91a | ||
|
6f4ebcca3e | ||
|
eb1b7c320f | ||
|
cf476f4629 | ||
|
109e87f7af | ||
|
bc96fcb4e2 | ||
|
098ef5f8e9 | ||
|
12d1f2f7fd | ||
|
bc6dd55629 | ||
|
d3d4f3bf35 | ||
|
e627010d1b | ||
|
4b82c70015 | ||
|
5f1d7432ae | ||
|
251fb079a7 | ||
|
da57e725c0 | ||
|
70423195e9 | ||
|
90574ee73b | ||
|
2e412f2e59 | ||
|
5b3e93c077 | ||
|
2c9c91d7be | ||
|
b7479205d5 | ||
|
5238f1297c | ||
|
0632e1268e | ||
|
8e36d4f4c1 | ||
|
99b92f67ee | ||
|
8f97585cb7 | ||
|
323f26850d | ||
|
e667470f66 | ||
|
90210bd532 | ||
|
afbc56e6e2 | ||
|
0a39b667c8 | ||
|
2c1d7ac627 | ||
|
c081c3a420 | ||
|
670b4e6245 | ||
|
700491d80a | ||
|
d161574edc | ||
|
3e1d862c2d | ||
|
c19f2d71f8 | ||
|
c1d2b84582 | ||
|
c7d7bf9347 | ||
|
8b03573135 | ||
|
5759d76953 | ||
|
70bad61905 | ||
|
fe4e738521 | ||
|
080787a3f2 | ||
|
2ed64c64db | ||
|
ff769bc6c7 | ||
|
2d6397c367 | ||
|
d56e81154c | ||
|
8329ef8cc8 | ||
|
1cc88ff688 | ||
|
a1a00c8bb1 | ||
|
933d0505d7 | ||
|
86d8739af2 | ||
|
38c07132e5 | ||
|
b3a3b76112 | ||
|
a90529b8fc | ||
|
332fed005f | ||
|
e0050d99f1 | ||
|
46ac5eaaa1 | ||
|
489bf035de | ||
|
574fa342f1 | ||
|
b90d617c15 | ||
|
ef5eb81c8a | ||
|
d8c415e74a | ||
|
fea086de8d |
@@ -80,14 +80,14 @@ jobs:
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:11.7 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.15.8
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.3.4
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.3.5
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=AppContext03TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco -Dalfresco-pdf-renderer.url=http://localhost:8090/ -Djodconverter.url=http://localhost:8090/ -Dimg.url=http://localhost:8090/ -Dtika.url=http://localhost:8090/ -Dtransform.misc.url=http://localhost:8090/
|
||||
|
||||
- name: "Repository - AppContext04TestSuite"
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:11.7 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.15.8
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.3.4
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.3.5
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=AppContext04TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
|
||||
- name: "Repository - AppContext05TestSuite"
|
||||
@@ -104,7 +104,7 @@ jobs:
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:11.7 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.15.8
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.3.4
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.3.5
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=AppContext06TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco -Dalfresco-pdf-renderer.url=http://localhost:8090/ -Djodconverter.url=http://localhost:8090/ -Dimg.url=http://localhost:8090/ -Dtika.url=http://localhost:8090/ -Dtransform.misc.url=http://localhost:8090/
|
||||
|
||||
- name: "Repository - AppContextExtraTestSuite"
|
||||
@@ -117,7 +117,7 @@ jobs:
|
||||
before_script:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:11.7 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 61616:61616 -p 5672:5672 alfresco/alfresco-activemq:5.15.8
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.3.4
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-transform-core-aio:2.3.5
|
||||
script: travis_wait 20 mvn -B test -pl repository -Dtest=MiscContextTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco -Dalfresco-pdf-renderer.url=http://localhost:8090/ -Djodconverter.url=http://localhost:8090/ -Dimg.url=http://localhost:8090/ -Dtika.url=http://localhost:8090/ -Dtransform.misc.url=http://localhost:8090/
|
||||
|
||||
- name: "Repository - MySQL tests"
|
||||
|
@@ -1,42 +0,0 @@
|
||||
### Alfresco Core
|
||||
[](https://travis-ci.com/Alfresco/alfresco-core)
|
||||
|
||||
Alfresco Core is a library packaged as a jar file which is part of [Alfresco Content Services Repository](https://community.alfresco.com/docs/DOC-6385-project-overview-repository).
|
||||
The library contains the following:
|
||||
* Various helpers and utils
|
||||
* Canned queries interface and supporting classes
|
||||
* Generic encryption supporting classes
|
||||
|
||||
Version 7 of the library uses Spring 5, Quartz 2.3 and does not have Hibernate dependency.
|
||||
|
||||
### Building and testing
|
||||
The project can be built and tested by running Maven command:
|
||||
~~~
|
||||
mvn clean install
|
||||
~~~
|
||||
|
||||
### Artifacts
|
||||
The artifacts can be obtained by:
|
||||
* downloading from [Alfresco repository](https://artifacts.alfresco.com/nexus/content/groups/public)
|
||||
* getting as Maven dependency by adding the dependency to your pom file:
|
||||
~~~
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-core</artifactId>
|
||||
<version>version</version>
|
||||
</dependency>
|
||||
~~~
|
||||
and Alfresco repository:
|
||||
~~~
|
||||
<repository>
|
||||
<id>alfresco-maven-repo</id>
|
||||
<url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
|
||||
</repository>
|
||||
~~~
|
||||
The SNAPSHOT version of the artifact is **never** published.
|
||||
|
||||
### Old version history
|
||||
The history for older versions can be found in [Alfresco SVN](https://svn.alfresco.com/repos/alfresco-open-mirror/services/alfresco-core/)
|
||||
|
||||
### Contributing guide
|
||||
Please use [this guide](CONTRIBUTING.md) to make a contribution to the project.
|
20
core/pom.xml
20
core/pom.xml
@@ -7,18 +7,13 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>7.183.300-TEST1</version>
|
||||
<version>7.302</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<dependency.org-json.version>20160212</dependency.org-json.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
<version>1.14</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-httpclient</groupId>
|
||||
@@ -27,12 +22,10 @@
|
||||
<dependency>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
<version>1.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
@@ -53,12 +46,10 @@
|
||||
<dependency>
|
||||
<groupId>org.json</groupId>
|
||||
<artifactId>json</artifactId>
|
||||
<version>20160212</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-orm</artifactId>
|
||||
<version>${dependency.spring.version}</version>
|
||||
<!-- exclude spring-jcl which is brought in by spring-core -->
|
||||
<!-- see https://issues.alfresco.com/jira/browse/REPO-4774 -->
|
||||
<exclusions>
|
||||
@@ -71,12 +62,10 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context</artifactId>
|
||||
<version>${dependency.spring.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.quartz-scheduler</groupId>
|
||||
<artifactId>quartz</artifactId>
|
||||
<version>2.3.2</version>
|
||||
<!-- exclude c3p0 -->
|
||||
<!-- see https://issues.alfresco.com/jira/browse/REPO-3447 -->
|
||||
<exclusions>
|
||||
@@ -89,7 +78,6 @@
|
||||
<dependency>
|
||||
<groupId>org.alfresco.surf</groupId>
|
||||
<artifactId>spring-surf-core-configservice</artifactId>
|
||||
<version>${dependency.webscripts.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.xml.bind</groupId>
|
||||
@@ -99,7 +87,6 @@
|
||||
<dependency>
|
||||
<groupId>com.sun.xml.bind</groupId>
|
||||
<artifactId>jaxb-impl</artifactId>
|
||||
<version>2.3.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sun.xml.bind</groupId>
|
||||
@@ -119,14 +106,12 @@
|
||||
<dependency>
|
||||
<groupId>joda-time</groupId>
|
||||
<artifactId>joda-time</artifactId>
|
||||
<version>2.10.5</version>
|
||||
</dependency>
|
||||
|
||||
<!-- provided dependencies -->
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>3.0.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -139,19 +124,16 @@
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.13</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<version>3.2.4</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-dbcp</groupId>
|
||||
<artifactId>commons-dbcp</artifactId>
|
||||
<version>1.4-DBCP330</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
@@ -322,7 +322,7 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
|
||||
|
||||
try
|
||||
{
|
||||
keyInfoManager = getKeyInfoManager(getKeyMetaDataFileLocation());
|
||||
keyInfoManager = getKeyInfoManager(getKeyStoreParameters());
|
||||
KeyStore ks = loadKeyStore(keyStoreParameters, keyInfoManager);
|
||||
|
||||
logger.debug("Initializing key managers");
|
||||
@@ -355,7 +355,7 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
|
||||
|
||||
try
|
||||
{
|
||||
keyInfoManager = getKeyInfoManager(getKeyMetaDataFileLocation());
|
||||
keyInfoManager = getKeyInfoManager(getKeyStoreParameters());
|
||||
KeyStore ks = loadKeyStore(getKeyStoreParameters(), keyInfoManager);
|
||||
|
||||
logger.debug("Initializing trust managers");
|
||||
@@ -376,12 +376,7 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected String getKeyMetaDataFileLocation()
|
||||
{
|
||||
return keyStoreParameters.getKeyMetaDataFileLocation();
|
||||
}
|
||||
|
||||
|
||||
protected InputStream getKeyStoreStream(String location) throws FileNotFoundException
|
||||
{
|
||||
if(location == null)
|
||||
@@ -396,9 +391,17 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
|
||||
return new FileOutputStream(getKeyStoreParameters().getLocation());
|
||||
}
|
||||
|
||||
protected KeyInfoManager getKeyInfoManager(String metadataFileLocation) throws FileNotFoundException, IOException
|
||||
protected KeyInfoManager getKeyInfoManager(KeyStoreParameters keyStoreParameters) throws IOException
|
||||
{
|
||||
return new KeyInfoManager(metadataFileLocation, keyResourceLoader);
|
||||
return new KeyInfoManager(keyStoreParameters, keyResourceLoader);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
protected KeyInfoManager getKeyInfoManager(String metadataFileLocation) throws IOException
|
||||
{
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setKeyMetaDataFileLocation(metadataFileLocation);
|
||||
return new KeyInfoManager(keyStoreParameters, keyResourceLoader);
|
||||
}
|
||||
|
||||
protected KeyMap cacheKeys(KeyStore ks, KeyInfoManager keyInfoManager)
|
||||
@@ -563,7 +566,7 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
|
||||
|
||||
try
|
||||
{
|
||||
keyInfoManager = getKeyInfoManager(keyStoreParameters.getKeyMetaDataFileLocation());
|
||||
keyInfoManager = getKeyInfoManager(keyStoreParameters);
|
||||
ks = loadKeyStore(keyStoreParameters, keyInfoManager);
|
||||
// Loaded
|
||||
}
|
||||
@@ -635,7 +638,7 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
|
||||
|
||||
try
|
||||
{
|
||||
keyInfoManager = getKeyInfoManager(getKeyMetaDataFileLocation());
|
||||
keyInfoManager = getKeyInfoManager(getKeyStoreParameters());
|
||||
Key key = getSecretKey(keyInfoManager.getKeyInformation(keyAlias));
|
||||
encryptionKeysRegistry.registerKey(keyAlias, key);
|
||||
keys.setKey(keyAlias, key);
|
||||
@@ -678,7 +681,7 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
|
||||
{
|
||||
if(!keyStoreExists(keyStoreParameters.getLocation()))
|
||||
{
|
||||
keyInfoManager = getKeyInfoManager(keyStoreParameters.getKeyMetaDataFileLocation());
|
||||
keyInfoManager = getKeyInfoManager(keyStoreParameters);
|
||||
KeyStore ks = initialiseKeyStore(keyStoreParameters.getType(), keyStoreParameters.getProvider());
|
||||
|
||||
String keyStorePassword = keyInfoManager.getKeyStorePassword();
|
||||
@@ -686,7 +689,7 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Key store password is null for keystore at location "
|
||||
+ getKeyStoreParameters().getLocation()
|
||||
+ ", key store meta data location" + getKeyMetaDataFileLocation());
|
||||
+ ". Either specify it as a JVM property or in key store meta data location.");
|
||||
}
|
||||
|
||||
for(String keyAlias : keys.getKeyAliases())
|
||||
@@ -765,8 +768,13 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
|
||||
}
|
||||
}
|
||||
|
||||
protected Key getSecretKey(KeyInformation keyInformation) throws NoSuchAlgorithmException, InvalidKeyException, InvalidKeySpecException
|
||||
protected Key getSecretKey(KeyInformation keyInformation) throws AlfrescoRuntimeException, NoSuchAlgorithmException, InvalidKeyException, InvalidKeySpecException
|
||||
{
|
||||
if (keyInformation == null)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Unable to get secret key: no key information is provided");
|
||||
}
|
||||
|
||||
byte[] keyData = keyInformation.getKeyData();
|
||||
|
||||
if(keyData == null)
|
||||
@@ -796,7 +804,7 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
|
||||
writeLock.lock();
|
||||
try
|
||||
{
|
||||
keyInfoManager = getKeyInfoManager(getKeyMetaDataFileLocation());
|
||||
keyInfoManager = getKeyInfoManager(getKeyStoreParameters());
|
||||
KeyStore ks = loadKeyStore(getKeyStoreParameters(), keyInfoManager);
|
||||
|
||||
// loading Key
|
||||
@@ -985,7 +993,7 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
|
||||
public static class KeyInfoManager
|
||||
{
|
||||
private KeyResourceLoader keyResourceLoader;
|
||||
private String metadataFileLocation;
|
||||
private KeyStoreParameters keyStoreParameters;
|
||||
private Properties keyProps;
|
||||
private String keyStorePassword = null;
|
||||
private Map<String, KeyInformation> keyInfo;
|
||||
@@ -1005,10 +1013,10 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
|
||||
}
|
||||
}
|
||||
|
||||
KeyInfoManager(String metadataFileLocation, KeyResourceLoader keyResourceLoader) throws IOException, FileNotFoundException
|
||||
KeyInfoManager(KeyStoreParameters keyStoreParameters, KeyResourceLoader keyResourceLoader) throws IOException, FileNotFoundException
|
||||
{
|
||||
this.keyResourceLoader = keyResourceLoader;
|
||||
this.metadataFileLocation = metadataFileLocation;
|
||||
this.keyStoreParameters = keyStoreParameters;
|
||||
keyInfo = new HashMap<String, KeyInformation>(2);
|
||||
loadKeyMetaData();
|
||||
}
|
||||
@@ -1025,31 +1033,73 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
|
||||
* Where required, <tt>null</tt> values must be inserted into the map to indicate the presence
|
||||
* of a key that is not protected by a password. They entry for {@link #KEY_KEYSTORE_PASSWORD}
|
||||
* is required if the keystore is password protected.
|
||||
*
|
||||
* WARNING. Storing passwords (keyMetaDataFileLocation) on the file system is not following best security practices.
|
||||
*
|
||||
* <p/>Loading of keys info from system (JVM) properties takes precedence over metadata file.
|
||||
* <p/>Set the unique ID of the keystore and remove the metadata file location property to use JVM properties lookup instead. The property lookup format is the following:
|
||||
* <ul>
|
||||
* <li>[keystore-id].password - keystore password</li>
|
||||
* <li>[keystore-id].aliases - comma separated list of aliases for the keys in the keystore</li>
|
||||
* <li>[keystore-id].[alias].keyData - key data bytes in base64</li>
|
||||
* <li>[keystore-id].[alias].algorithm - key algorithm</li>
|
||||
* <li>[keystore-id].[alias].password - key password</li>
|
||||
* </ul>
|
||||
*
|
||||
*/
|
||||
protected void loadKeyMetaData() throws IOException, FileNotFoundException
|
||||
{
|
||||
keyProps = keyResourceLoader.loadKeyMetaData(metadataFileLocation);
|
||||
if(keyProps != null)
|
||||
if (keyStoreParameters.getId() != null &&
|
||||
(keyStoreParameters.getKeyMetaDataFileLocation() == null ||
|
||||
keyStoreParameters.getKeyMetaDataFileLocation().isEmpty()))
|
||||
{
|
||||
String aliases = keyProps.getProperty("aliases");
|
||||
if(aliases == null)
|
||||
Properties jvmProperties = System.getProperties();
|
||||
keyStorePassword = jvmProperties.getProperty(keyStoreParameters.getId() + ".password");
|
||||
String aliases = jvmProperties.getProperty(keyStoreParameters.getId() + ".aliases");
|
||||
if (aliases == null || aliases.isEmpty())
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Passwords file must contain an aliases key");
|
||||
logger.warn("No aliases were specified for " + keyStoreParameters.getId()
|
||||
+ " keystore");
|
||||
}
|
||||
|
||||
this.keyStorePassword = keyProps.getProperty(KEY_KEYSTORE_PASSWORD);
|
||||
|
||||
StringTokenizer st = new StringTokenizer(aliases, ",");
|
||||
while(st.hasMoreTokens())
|
||||
else
|
||||
{
|
||||
String keyAlias = st.nextToken();
|
||||
keyInfo.put(keyAlias, loadKeyInformation(keyAlias));
|
||||
StringTokenizer st = new StringTokenizer(aliases, ",");
|
||||
while(st.hasMoreTokens())
|
||||
{
|
||||
String keyAlias = st.nextToken();
|
||||
keyInfo.put(keyAlias, loadKeyInformation(jvmProperties, keyAlias, keyStoreParameters.getId() + "."));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO
|
||||
//throw new FileNotFoundException("Cannot find key metadata file " + getKeyMetaDataFileLocation());
|
||||
logger.warn("Storing passwords (" + keyStoreParameters.getKeyMetaDataFileLocation()
|
||||
+ ") on the file system is not following best security practices." +
|
||||
" Please refer to documentation and use JVM properties instead");
|
||||
|
||||
keyProps = keyResourceLoader.loadKeyMetaData(keyStoreParameters.getKeyMetaDataFileLocation());
|
||||
if(keyProps != null)
|
||||
{
|
||||
String aliases = keyProps.getProperty("aliases");
|
||||
if(aliases == null)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Passwords file must contain an aliases key");
|
||||
}
|
||||
|
||||
this.keyStorePassword = keyProps.getProperty(KEY_KEYSTORE_PASSWORD);
|
||||
|
||||
StringTokenizer st = new StringTokenizer(aliases, ",");
|
||||
while(st.hasMoreTokens())
|
||||
{
|
||||
String keyAlias = st.nextToken();
|
||||
keyInfo.put(keyAlias, loadKeyInformation(keyProps, keyAlias, ""));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO
|
||||
//throw new FileNotFoundException("Cannot find key metadata file " + getKeyMetaDataFileLocation());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1067,11 +1117,11 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
|
||||
this.keyProps.remove(keyAlias);
|
||||
}
|
||||
|
||||
protected KeyInformation loadKeyInformation(String keyAlias)
|
||||
protected KeyInformation loadKeyInformation(Properties keyProps, String keyAlias, String prefix)
|
||||
{
|
||||
String keyPassword = keyProps.getProperty(keyAlias + ".password");
|
||||
String keyData = keyProps.getProperty(keyAlias + ".keyData");
|
||||
String keyAlgorithm = keyProps.getProperty(keyAlias + ".algorithm");
|
||||
String keyPassword = keyProps.getProperty(prefix + keyAlias + ".password");
|
||||
String keyData = keyProps.getProperty(prefix + keyAlias + ".keyData");
|
||||
String keyAlgorithm = keyProps.getProperty(prefix + keyAlias + ".algorithm");
|
||||
|
||||
byte[] keyDataBytes = null;
|
||||
if(keyData != null && !keyData.equals(""))
|
||||
|
@@ -22,12 +22,15 @@ import org.alfresco.util.PropertyCheck;
|
||||
|
||||
/**
|
||||
* Stores Java keystore initialisation parameters.
|
||||
*
|
||||
*
|
||||
* WARNING. Storing passwords (keyMetaDataFileLocation) on the file system is not following best security practices.
|
||||
*
|
||||
* @since 4.0
|
||||
*
|
||||
*/
|
||||
public class KeyStoreParameters
|
||||
{
|
||||
private String id;
|
||||
private String name;
|
||||
private String type;
|
||||
private String provider;
|
||||
@@ -38,8 +41,40 @@ public class KeyStoreParameters
|
||||
{
|
||||
}
|
||||
|
||||
public KeyStoreParameters(String name, String type, String keyStoreProvider,
|
||||
/**
|
||||
* WARNING. Storing passwords (keyMetaDataFileLocation) on the file system is not following best security practices.
|
||||
*
|
||||
* <p/>Set the unique ID of the keystore and aliases to use Java system properties lookup instead. The property lookup format is:
|
||||
* <ul>
|
||||
* <li>[keystore-id].password - keystore password</li>
|
||||
* <li>[keystore-id].aliases - comma separated list of aliases for the keys in the keystore</li>
|
||||
* <li>[keystore-id].[alias].keydata - key data bytes in base64</li>
|
||||
* <li>[keystore-id].[alias].algorithm - key algorithm</li>
|
||||
* <li>[keystore-id].[alias].password - key password</li>
|
||||
* </ul>
|
||||
*
|
||||
* Loading of keys info from system (JVM) properties takes precedence over metadata file.
|
||||
*
|
||||
* @param id unique identifier of the keystore
|
||||
* @param name human readable name of the keystore
|
||||
* @param type type of the keystore
|
||||
* @param keyStoreProvider keystore provider
|
||||
* @param keyMetaDataFileLocation path to keystore metadata file on the file system
|
||||
* @param location path to keystore on the file system
|
||||
*/
|
||||
public KeyStoreParameters(String id, String name, String type, String keyStoreProvider,
|
||||
String keyMetaDataFileLocation, String location)
|
||||
{
|
||||
this(name, type, keyStoreProvider, keyMetaDataFileLocation, location);
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use {@link #KeyStoreParameters(String, String, String, String, String, String)} instead
|
||||
*/
|
||||
@Deprecated()
|
||||
public KeyStoreParameters(String name, String type, String keyStoreProvider,
|
||||
String keyMetaDataFileLocation, String location)
|
||||
{
|
||||
super();
|
||||
this.name = name;
|
||||
@@ -49,8 +84,13 @@ public class KeyStoreParameters
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
|
||||
public void init()
|
||||
{
|
||||
if (!PropertyCheck.isValidPropertyString(getId()))
|
||||
{
|
||||
setId(null);
|
||||
}
|
||||
if (!PropertyCheck.isValidPropertyString(getLocation()))
|
||||
{
|
||||
setLocation(null);
|
||||
@@ -69,6 +109,11 @@ public class KeyStoreParameters
|
||||
}
|
||||
}
|
||||
|
||||
public String getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
@@ -93,7 +138,12 @@ public class KeyStoreParameters
|
||||
{
|
||||
return location;
|
||||
}
|
||||
|
||||
|
||||
public void setId(String id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
|
@@ -0,0 +1,388 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2020 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.alfresco.encryption;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.TestName;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.junit.MockitoJUnitRunner;
|
||||
|
||||
@RunWith(MockitoJUnitRunner.class)
|
||||
public class AlfrescoKeyStoreTest
|
||||
{
|
||||
@Mock
|
||||
private EncryptionKeysRegistry encryptionKeysRegistry;
|
||||
|
||||
@Rule
|
||||
public TestName testName = new TestName();
|
||||
|
||||
@Test
|
||||
public void testSysPropConfig()
|
||||
{
|
||||
String keyStoreId = testName.getMethodName() + "-keystore";
|
||||
String alias1 = "mykey1";
|
||||
String alias2 = "mykey2";
|
||||
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setId(keyStoreId);
|
||||
keyStoreParameters.setName(testName.getMethodName());
|
||||
keyStoreParameters.setType("JCEKS");
|
||||
keyStoreParameters.setProvider("SunJCE");
|
||||
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-2.jks");
|
||||
|
||||
System.setProperty(keyStoreId + "." + "password", "ksPwd2");
|
||||
System.setProperty(keyStoreId + "." + "aliases", alias1 + "," + alias2);
|
||||
System.setProperty(keyStoreId + "." + alias1 + "." + "password", "aliasPwd1");
|
||||
System.setProperty(keyStoreId + "." + alias2 + "." + "password", "aliasPwd2");
|
||||
|
||||
try
|
||||
{
|
||||
AlfrescoKeyStore alfrescoKeyStore = new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
|
||||
Set<String> expectedAliases = new HashSet<>();
|
||||
expectedAliases.add(alias1);
|
||||
expectedAliases.add(alias2);
|
||||
Assert.assertEquals("The aliases are not correct", expectedAliases, alfrescoKeyStore.getKeyAliases());
|
||||
|
||||
Assert.assertNotNull("Failed to retrieve a key from keystore.", alfrescoKeyStore.getKey(alias1));
|
||||
Assert.assertNotNull("Failed to retrieve a key from keystore.", alfrescoKeyStore.getKey(alias2));
|
||||
}
|
||||
finally
|
||||
{
|
||||
System.clearProperty(keyStoreId + "." + "password");
|
||||
System.clearProperty(keyStoreId + "." + "aliases");
|
||||
System.clearProperty(keyStoreId + "." + alias1 + "." + "password");
|
||||
System.clearProperty(keyStoreId + "." + alias2 + "." + "password");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSysPropConfigWithoutAliases()
|
||||
{
|
||||
String keyStoreId = testName.getMethodName() + "-keystore";
|
||||
String alias1 = "mykey1";
|
||||
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setId(keyStoreId);
|
||||
keyStoreParameters.setName(testName.getMethodName());
|
||||
keyStoreParameters.setType("JCEKS");
|
||||
keyStoreParameters.setProvider("SunJCE");
|
||||
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-1.jks");
|
||||
|
||||
System.setProperty(keyStoreId + "." + "password", "ksPwd1");
|
||||
System.setProperty(keyStoreId + "." + alias1 + "." + "password", "aliasPwd1");
|
||||
try
|
||||
{
|
||||
AlfrescoKeyStore keyStore = new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
|
||||
Assert.assertNull(keyStore.getKey(alias1));
|
||||
}
|
||||
finally
|
||||
{
|
||||
System.clearProperty(keyStoreId + "." + "password");
|
||||
System.clearProperty(keyStoreId + "." + alias1 + "." + "password");
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMetaDataFileConfig()
|
||||
{
|
||||
String alias1 = "mykey1";
|
||||
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setName(testName.getMethodName());
|
||||
keyStoreParameters.setType("JCEKS");
|
||||
keyStoreParameters.setProvider("SunJCE");
|
||||
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-1.jks");
|
||||
keyStoreParameters.setKeyMetaDataFileLocation("classpath:keystore-tests/ks1-metadata.properties");
|
||||
|
||||
AlfrescoKeyStore alfrescoKeyStore = new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
|
||||
Set<String> expectedAliases = new HashSet<>();
|
||||
expectedAliases.add(alias1);
|
||||
Assert.assertEquals("The aliases are not correct", expectedAliases, alfrescoKeyStore.getKeyAliases());
|
||||
|
||||
Assert.assertNotNull("Failed to retrieve a key from keystore.", alfrescoKeyStore.getKey(alias1));
|
||||
}
|
||||
|
||||
/**
|
||||
* Config via System props should be default, but if the metadata file location is set, it will be used instead.
|
||||
* This is done to maintain backwards compatibility and simplify testing use cases.
|
||||
*/
|
||||
@Test(expected = AlfrescoRuntimeException.class)
|
||||
public void testConfigBothSystemAndFile()
|
||||
{
|
||||
String keyStoreId = testName.getMethodName() + "-keystore";
|
||||
String alias1 = "mykey1";
|
||||
String alias2 = "mykey2";
|
||||
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setId(keyStoreId);
|
||||
keyStoreParameters.setName(testName.getMethodName());
|
||||
keyStoreParameters.setType("JCEKS");
|
||||
keyStoreParameters.setProvider("SunJCE");
|
||||
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-2.jks");
|
||||
// use metadata file from keystore with one key
|
||||
keyStoreParameters.setKeyMetaDataFileLocation("classpath:keystore-tests/ks1-metadata.properties");
|
||||
|
||||
System.setProperty(keyStoreId + "." + "password", "ksPwd2");
|
||||
System.setProperty(keyStoreId + "." + "aliases", alias1 + "," + alias2);
|
||||
System.setProperty(keyStoreId + "." + alias1 + "." + "password", "aliasPwd1");
|
||||
System.setProperty(keyStoreId + "." + alias2 + "." + "password", "aliasPwd2");
|
||||
|
||||
try
|
||||
{
|
||||
new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
|
||||
}
|
||||
finally
|
||||
{
|
||||
System.clearProperty(keyStoreId + "." + "password");
|
||||
System.clearProperty(keyStoreId + "." + "aliases");
|
||||
System.clearProperty(keyStoreId + "." + alias1 + "." + "password");
|
||||
System.clearProperty(keyStoreId + "." + alias2 + "." + "password");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Test(expected = AlfrescoRuntimeException.class)
|
||||
public void testValidateKeysWrongAliasMetadataFile() throws Exception
|
||||
{
|
||||
String alias1 = "mykey1";
|
||||
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setName(testName.getMethodName());
|
||||
keyStoreParameters.setType("JCEKS");
|
||||
keyStoreParameters.setProvider("SunJCE");
|
||||
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-1.jks");
|
||||
keyStoreParameters.setKeyMetaDataFileLocation("classpath:keystore-tests/wrong-alias-metadata.properties");
|
||||
|
||||
AlfrescoKeyStoreImpl alfrescoKeyStore = new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
|
||||
alfrescoKeyStore.setKeysToValidate(Collections.singleton(alias1));
|
||||
alfrescoKeyStore.setValidateKeyChanges(true);
|
||||
alfrescoKeyStore.setEncryptionKeysRegistry(encryptionKeysRegistry);
|
||||
alfrescoKeyStore.validateKeys();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEmptyKeysMetadataFile()
|
||||
{
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setName(testName.getMethodName());
|
||||
keyStoreParameters.setType("JCEKS");
|
||||
keyStoreParameters.setProvider("SunJCE");
|
||||
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-1.jks");
|
||||
keyStoreParameters.setKeyMetaDataFileLocation("classpath:keystore-tests/empty-alias-metadata.properties");
|
||||
|
||||
new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
|
||||
}
|
||||
|
||||
@Test(expected = AlfrescoRuntimeException.class)
|
||||
public void testWrongKeystorePasswordMetadataFile()
|
||||
{
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setName(testName.getMethodName());
|
||||
keyStoreParameters.setType("JCEKS");
|
||||
keyStoreParameters.setProvider("SunJCE");
|
||||
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-1.jks");
|
||||
keyStoreParameters.setKeyMetaDataFileLocation("classpath:keystore-tests/wrong-keystore-password-metadata.properties");
|
||||
|
||||
new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
|
||||
}
|
||||
|
||||
@Test(expected = AlfrescoRuntimeException.class)
|
||||
public void testWrongKeyPasswordMetadataFile()
|
||||
{
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setName(testName.getMethodName());
|
||||
keyStoreParameters.setType("JCEKS");
|
||||
keyStoreParameters.setProvider("SunJCE");
|
||||
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-1.jks");
|
||||
keyStoreParameters.setKeyMetaDataFileLocation("classpath:keystore-tests/wrong-key-password-metadata.properties");
|
||||
|
||||
new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
|
||||
}
|
||||
|
||||
@Test(expected = AlfrescoRuntimeException.class)
|
||||
public void testValidateKeysWrongAliasSysProps() throws Exception
|
||||
{
|
||||
String keyStoreId = testName.getMethodName() + "-keystore";
|
||||
String alias1 = "mykey1";
|
||||
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setId(keyStoreId);
|
||||
keyStoreParameters.setName(testName.getMethodName());
|
||||
keyStoreParameters.setType("JCEKS");
|
||||
keyStoreParameters.setProvider("SunJCE");
|
||||
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-1.jks");
|
||||
|
||||
System.setProperty(keyStoreId + "." + "aliases", "wrong-alias,another-wrong-alias");
|
||||
System.setProperty(keyStoreId + "." + "password", "ksPwd1");
|
||||
System.setProperty(keyStoreId + "." + alias1 + "." + "password", "aliasPwd1");
|
||||
|
||||
try
|
||||
{
|
||||
AlfrescoKeyStoreImpl alfrescoKeyStore = new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
|
||||
alfrescoKeyStore.setValidateKeyChanges(true);
|
||||
alfrescoKeyStore.setKeysToValidate(Collections.singleton(alias1));
|
||||
alfrescoKeyStore.setEncryptionKeysRegistry(encryptionKeysRegistry);
|
||||
alfrescoKeyStore.validateKeys();
|
||||
}
|
||||
finally
|
||||
{
|
||||
System.clearProperty(keyStoreId + "." + "aliases");
|
||||
System.clearProperty(keyStoreId + "." + "password");
|
||||
System.clearProperty(keyStoreId + "." + alias1 + "." + "password");
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEmptyKeysSysProps()
|
||||
{
|
||||
String keyStoreId = testName.getMethodName() + "-keystore";
|
||||
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setId(keyStoreId);
|
||||
keyStoreParameters.setName(testName.getMethodName());
|
||||
keyStoreParameters.setType("JCEKS");
|
||||
keyStoreParameters.setProvider("SunJCE");
|
||||
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-1.jks");
|
||||
|
||||
System.setProperty(keyStoreId + "." + "aliases", "empty-alias,another-empty-alias");
|
||||
System.setProperty(keyStoreId + "." + "password", "ksPwd1");
|
||||
|
||||
try
|
||||
{
|
||||
new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
|
||||
}
|
||||
finally
|
||||
{
|
||||
System.clearProperty(keyStoreId + "." + "aliases");
|
||||
System.clearProperty(keyStoreId + "." + "password");
|
||||
}
|
||||
}
|
||||
|
||||
@Test(expected = AlfrescoRuntimeException.class)
|
||||
public void testWrongKeystorePasswordSysProps()
|
||||
{
|
||||
String keyStoreId = testName.getMethodName() + "-keystore";
|
||||
String alias1 = "mykey1";
|
||||
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setId(keyStoreId);
|
||||
keyStoreParameters.setName(testName.getMethodName());
|
||||
keyStoreParameters.setType("JCEKS");
|
||||
keyStoreParameters.setProvider("SunJCE");
|
||||
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-1.jks");
|
||||
|
||||
System.setProperty(keyStoreId + "." + "aliases", alias1);
|
||||
System.setProperty(keyStoreId + "." + "password", "wrong-password");
|
||||
System.setProperty(keyStoreId + "." + alias1 + "." + "password", "aliasPwd1");
|
||||
|
||||
try
|
||||
{
|
||||
new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
|
||||
}
|
||||
finally
|
||||
{
|
||||
System.clearProperty(keyStoreId + "." + "aliases");
|
||||
System.clearProperty(keyStoreId + "." + "password");
|
||||
System.clearProperty(keyStoreId + "." + alias1 + "." + "password");
|
||||
}
|
||||
}
|
||||
|
||||
@Test(expected = AlfrescoRuntimeException.class)
|
||||
public void testWrongKeyPasswordSysProps()
|
||||
{
|
||||
String keyStoreId = testName.getMethodName() + "-keystore";
|
||||
String alias1 = "mykey1";
|
||||
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setId(keyStoreId);
|
||||
keyStoreParameters.setName(testName.getMethodName());
|
||||
keyStoreParameters.setType("JCEKS");
|
||||
keyStoreParameters.setProvider("SunJCE");
|
||||
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-1.jks");
|
||||
|
||||
System.setProperty(keyStoreId + "." + "aliases", alias1);
|
||||
System.setProperty(keyStoreId + "." + "password", "ksPwd1");
|
||||
System.setProperty(keyStoreId + "." + alias1 + "." + "password", "wrong-key-password");
|
||||
|
||||
try
|
||||
{
|
||||
new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
|
||||
}
|
||||
finally
|
||||
{
|
||||
System.clearProperty(keyStoreId + "." + "aliases");
|
||||
System.clearProperty(keyStoreId + "." + "password");
|
||||
System.clearProperty(keyStoreId + "." + alias1 + "." + "password");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* No exception is expected. An empty keystore can be created.
|
||||
*/
|
||||
@Test
|
||||
public void testConfigEmptyKeystore()
|
||||
{
|
||||
String keyStoreId = testName.getMethodName() + "-keystore";
|
||||
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setId(keyStoreId);
|
||||
keyStoreParameters.setName(testName.getMethodName());
|
||||
keyStoreParameters.setType("JCEKS");
|
||||
keyStoreParameters.setProvider("SunJCE");
|
||||
keyStoreParameters.setLocation("classpath:non-existing-path/some-keystore.jks");
|
||||
|
||||
new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
|
||||
}
|
||||
|
||||
@Test(expected = AlfrescoRuntimeException.class)
|
||||
public void testValidateKeysEmptyAliasSysProps() throws Exception
|
||||
{
|
||||
String keyStoreId = testName.getMethodName() + "-keystore";
|
||||
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setId(keyStoreId);
|
||||
keyStoreParameters.setName(testName.getMethodName());
|
||||
keyStoreParameters.setType("JCEKS");
|
||||
keyStoreParameters.setProvider("SunJCE");
|
||||
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-1.jks");
|
||||
|
||||
System.setProperty(keyStoreId + "." + "password", "ksPwd1");
|
||||
|
||||
try
|
||||
{
|
||||
AlfrescoKeyStoreImpl alfrescoKeyStore = new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
|
||||
alfrescoKeyStore.setValidateKeyChanges(true);
|
||||
alfrescoKeyStore.setKeysToValidate(Collections.singleton("non-existing-alias"));
|
||||
alfrescoKeyStore.setEncryptionKeysRegistry(encryptionKeysRegistry);
|
||||
alfrescoKeyStore.validateKeys();
|
||||
}
|
||||
finally
|
||||
{
|
||||
System.clearProperty(keyStoreId + "." + "password");
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,2 @@
|
||||
aliases=empty-alias
|
||||
keystore.password=ksPwd1
|
BIN
core/src/test/resources/keystore-tests/ks-test-1.jks
Normal file
BIN
core/src/test/resources/keystore-tests/ks-test-1.jks
Normal file
Binary file not shown.
BIN
core/src/test/resources/keystore-tests/ks-test-2.jks
Normal file
BIN
core/src/test/resources/keystore-tests/ks-test-2.jks
Normal file
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
aliases=mykey1
|
||||
keystore.password=ksPwd1
|
||||
mykey1.password=aliasPwd1
|
24
core/src/test/resources/keystore-tests/passwords.txt
Normal file
24
core/src/test/resources/keystore-tests/passwords.txt
Normal file
@@ -0,0 +1,24 @@
|
||||
The keystores contained in this folder are used by tests.
|
||||
|
||||
==================
|
||||
== ks-test-1.ks ==
|
||||
==================
|
||||
|
||||
Keystore password: ksPwd1
|
||||
Keystore type: JCEKS
|
||||
Keystore provider: SunJCE
|
||||
|
||||
Your keystore contains 1 entry
|
||||
mykey1: aliasPwd1
|
||||
|
||||
==================
|
||||
== ks-test-2.ks ==
|
||||
==================
|
||||
|
||||
Keystore password: ksPwd2
|
||||
Keystore type: JCEKS
|
||||
Keystore provider: SunJCE
|
||||
|
||||
Your keystore contains 2 entries
|
||||
mykey1: aliasPwd1
|
||||
mykey2: aliasPwd2
|
@@ -0,0 +1,3 @@
|
||||
aliases=non-existing-alias
|
||||
keystore.password=ksPwd1
|
||||
mykey1.password=aliasPwd1
|
@@ -0,0 +1,3 @@
|
||||
aliases=mykey1
|
||||
keystore.password=ksPwd1
|
||||
mykey1.password=wrong-key-password
|
@@ -0,0 +1,3 @@
|
||||
aliases=mykey1
|
||||
keystore.password=wrong-password
|
||||
mykey1.password=aliasPwd1
|
@@ -1,47 +0,0 @@
|
||||
### Alfresco Data Model
|
||||
[](https://travis-ci.com/Alfresco/alfresco-data-model)
|
||||
|
||||
Data model is a library packaged as a jar file which is part of [Alfresco Content Services Repository](https://community.alfresco.com/docs/DOC-6385-project-overview-repository).
|
||||
The library contains the following:
|
||||
* Dictionary, Repository and Search Services interfaces
|
||||
* Models for data types and Dictionary implementation
|
||||
* Parsers
|
||||
|
||||
Please note that the data model uses version 2 of the Jackson libraries.
|
||||
The upgrade from version 1 was not backward compatible, any projects
|
||||
that are dependent on data model using Jackson 1.x should use the data-model 6.N branch.
|
||||
|
||||
Version 8.0 of data-model depends on alfresco-core 7.0 which is based on Spring 5.
|
||||
|
||||
|
||||
### Building and testing
|
||||
The project can be built and tested by running Maven command:
|
||||
~~~
|
||||
mvn clean install
|
||||
~~~
|
||||
|
||||
### Artifacts
|
||||
The artifacts can be obtained by:
|
||||
* downloading from [Alfresco repository](https://artifacts.alfresco.com/nexus/content/groups/public)
|
||||
* getting as Maven dependency by adding the dependency to your pom file:
|
||||
~~~
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-data-model</artifactId>
|
||||
<version>version</version>
|
||||
</dependency>
|
||||
~~~
|
||||
and Alfresco repository:
|
||||
~~~
|
||||
<repository>
|
||||
<id>alfresco-maven-repo</id>
|
||||
<url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
|
||||
</repository>
|
||||
~~~
|
||||
The SNAPSHOT version of the artifact is **never** published.
|
||||
|
||||
### Old version history
|
||||
The history for older versions can be found in [Alfresco SVN](https://svn.alfresco.com/repos/alfresco-open-mirror/alfresco/HEAD/root/projects/data-model)
|
||||
|
||||
### Contributing guide
|
||||
Please use [this guide](CONTRIBUTING.md) to make a contribution to the project.
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>7.183.300-TEST1</version>
|
||||
<version>7.302</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
@@ -133,7 +133,6 @@
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>3.0.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!--
|
||||
@@ -147,8 +146,7 @@
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-annotations</artifactId>
|
||||
<version>2.10.2</version>
|
||||
</dependency>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.antlr</groupId>
|
||||
@@ -194,7 +192,6 @@
|
||||
<dependency>
|
||||
<groupId>xerces</groupId>
|
||||
<artifactId>xercesImpl</artifactId>
|
||||
<version>2.12.0-alfresco-patched-20191004</version>
|
||||
</dependency>
|
||||
<!-- Tika -->
|
||||
<dependency>
|
||||
@@ -226,19 +223,16 @@
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.13</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.antlr</groupId>
|
||||
<artifactId>gunit</artifactId>
|
||||
<version>3.5.2</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<version>3.2.4</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
@@ -618,7 +618,13 @@ public class AuthenticationUtil implements InitializingBean
|
||||
{
|
||||
if (originalFullAuthentication == null)
|
||||
{
|
||||
AuthenticationUtil.clearCurrentSecurityContext();
|
||||
if (logger.isTraceEnabled())
|
||||
{
|
||||
logger.trace("Removing the current security information for thread: " + Thread.currentThread().getName());
|
||||
}
|
||||
ContextHolder.setContext(null);
|
||||
TenantContextHolder.clearTenantDomain();
|
||||
|
||||
logNDC(null);
|
||||
}
|
||||
else
|
||||
|
@@ -37,7 +37,6 @@ import org.alfresco.repo.cache.SimpleCache;
|
||||
import org.alfresco.service.cmr.repository.datatype.Duration;
|
||||
import org.alfresco.util.GUID;
|
||||
import org.apache.commons.codec.binary.Hex;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.safehaus.uuid.UUIDGenerator;
|
||||
@@ -63,7 +62,7 @@ public class InMemoryTicketComponentImpl implements TicketComponent
|
||||
private boolean oneOff;
|
||||
private String guid;
|
||||
private SimpleCache<String, Ticket> ticketsCache; // Can't use Ticket as it's private
|
||||
private SimpleCache<String, String> usernameKey;
|
||||
private SimpleCache<String, String> usernameToTicketIdCache;
|
||||
private ExpiryMode expiryMode = ExpiryMode.AFTER_INACTIVITY;
|
||||
private boolean useSingleTicketPerUser = true;
|
||||
|
||||
@@ -85,10 +84,10 @@ public class InMemoryTicketComponentImpl implements TicketComponent
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the usernameKey cache as secondary map for supporting cache clustering
|
||||
* Set the usernameToTicketIdCache as secondary map for supporting cache clustering
|
||||
*/
|
||||
public void setUsernameKey (SimpleCache<String, String> usernameKey) {
|
||||
this.usernameKey = usernameKey;
|
||||
public void setUsernameToTicketIdCache (SimpleCache<String, String> usernameToTicketIdCache) {
|
||||
this.usernameToTicketIdCache = usernameToTicketIdCache;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -146,55 +145,55 @@ public class InMemoryTicketComponentImpl implements TicketComponent
|
||||
}
|
||||
|
||||
/**
|
||||
* All put operations into ticketsCache should go through this method,
|
||||
* All put operations into ticketsCache and usernameToTicketIdCache should go through this method,
|
||||
* so we can debug/trace ticket problems easier from the logs
|
||||
*/
|
||||
private void putTicketIntoTicketsCache(Ticket ticket)
|
||||
private void putIntoCache (Ticket ticket)
|
||||
{
|
||||
if (logger.isTraceEnabled())
|
||||
{
|
||||
logger.trace("Putting into ticketsCache " + ticketsCache.toString() + " ticket: " + ticket);
|
||||
}
|
||||
ticketsCache.put(ticket.getTicketId(), ticket);
|
||||
}
|
||||
|
||||
/**
|
||||
* All put operations into usernameKey cache should go through this method,
|
||||
* so we can debug/trace problems easier from the logs
|
||||
*/
|
||||
private void putTicketIntoUsernameKeyCache (Ticket ticket)
|
||||
{
|
||||
if (logger.isTraceEnabled())
|
||||
{
|
||||
logger.trace("Putting into usernameKey " + usernameKey.toString() + " username and key of ticket: " + ticket);
|
||||
logger.trace("Putting into usernameToTicketIdCache " + usernameToTicketIdCache.toString() + " username and ticketId of: " + ticket);
|
||||
}
|
||||
usernameKey.put(ticket.getUserName(), ticket.getTicketId());
|
||||
usernameToTicketIdCache.put(ticket.getUserName(), ticket.getTicketId());
|
||||
}
|
||||
|
||||
/**
|
||||
* All remove operations from ticketsCache should go through this method,
|
||||
* All remove operations from ticketsCache and usernameToTicketIdCache should go through this method,
|
||||
* so we can debug/trace ticket problems easier from the logs
|
||||
*/
|
||||
private void removeTicketFromTicketsCache(String ticketId)
|
||||
private void removeFromCache (String ticketId)
|
||||
{
|
||||
Ticket ticket = null;
|
||||
if(ticketId != null)
|
||||
{
|
||||
ticket = ticketsCache.get(ticketId);
|
||||
}
|
||||
|
||||
if (logger.isTraceEnabled())
|
||||
{
|
||||
logger.trace("Removing ticket from ticketsCache: " + ticketId);
|
||||
}
|
||||
ticketsCache.remove(ticketId);
|
||||
}
|
||||
|
||||
/**
|
||||
* All remove operations from usernameKey cache should go through this method,
|
||||
* so we can debug/trace problems easier from the logs
|
||||
*/
|
||||
private void removeFromUsernameKey(String username)
|
||||
{
|
||||
if (logger.isTraceEnabled())
|
||||
if(ticket != null)
|
||||
{
|
||||
logger.trace("Removing ticket key from usernameKey: " + username);
|
||||
String username = ticket.getUserName();
|
||||
String actualUserTicketIdFromCache = usernameToTicketIdCache.get(username);
|
||||
if(ticketId.equals(actualUserTicketIdFromCache))
|
||||
{
|
||||
if (logger.isTraceEnabled())
|
||||
{
|
||||
logger.trace("Removing ticketId from usernameToTicketIdCache for: " + username);
|
||||
}
|
||||
usernameToTicketIdCache.remove(username);
|
||||
}
|
||||
}
|
||||
usernameKey.remove(username);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -214,8 +213,7 @@ public class InMemoryTicketComponentImpl implements TicketComponent
|
||||
expiryDate = Duration.add(new Date(), validDuration);
|
||||
}
|
||||
ticket = new Ticket(ticketsExpire ? expiryMode : ExpiryMode.DO_NOT_EXPIRE, expiryDate, userName, validDuration);
|
||||
putTicketIntoTicketsCache(ticket);
|
||||
putTicketIntoUsernameKeyCache(ticket);
|
||||
putIntoCache(ticket);
|
||||
}
|
||||
|
||||
String ticketString = GRANTED_AUTHORITY_TICKET_PREFIX + ticket.getTicketId();
|
||||
@@ -229,40 +227,20 @@ public class InMemoryTicketComponentImpl implements TicketComponent
|
||||
|
||||
private Ticket findNonExpiredUserTicket(String userName)
|
||||
{
|
||||
String keyFromCache = usernameKey.get(userName);
|
||||
if(StringUtils.isNotBlank(keyFromCache)) {
|
||||
Ticket ticketFromCache = ticketsCache.get(keyFromCache);
|
||||
if(ticketFromCache != null) {
|
||||
String userTicketIdFromCache = usernameToTicketIdCache.get(userName);
|
||||
if(userTicketIdFromCache != null)
|
||||
{
|
||||
Ticket ticketFromCache = ticketsCache.get(userTicketIdFromCache);
|
||||
if(ticketFromCache != null)
|
||||
{
|
||||
Ticket newTicket = ticketFromCache.getNewEntry();
|
||||
if(newTicket != null)
|
||||
{
|
||||
if (newTicket != ticketFromCache)
|
||||
{
|
||||
putTicketIntoTicketsCache(newTicket);
|
||||
putTicketIntoUsernameKeyCache(newTicket);
|
||||
}
|
||||
return ticketFromCache;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (String key : ticketsCache.getKeys())
|
||||
{
|
||||
Ticket ticket = ticketsCache.get(key);
|
||||
if (ticket != null)
|
||||
{
|
||||
if(ticket.getUserName().equals(userName))
|
||||
{
|
||||
Ticket newTicket = ticket.getNewEntry();
|
||||
if(newTicket != null)
|
||||
{
|
||||
if (newTicket != ticket)
|
||||
{
|
||||
putTicketIntoTicketsCache(newTicket);
|
||||
putTicketIntoUsernameKeyCache(newTicket);
|
||||
}
|
||||
return ticket;
|
||||
}
|
||||
putIntoCache(newTicket);
|
||||
}
|
||||
return newTicket;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -301,16 +279,11 @@ public class InMemoryTicketComponentImpl implements TicketComponent
|
||||
{
|
||||
//this feature is deprecated
|
||||
|
||||
removeTicketFromTicketsCache(ticketKey);
|
||||
String userName = newTicket.getUserName();
|
||||
if(StringUtils.isNotBlank(userName)) {
|
||||
removeFromUsernameKey(userName);
|
||||
}
|
||||
removeFromCache(ticketKey);
|
||||
}
|
||||
else if (newTicket != ticket)
|
||||
{
|
||||
putTicketIntoTicketsCache(newTicket);
|
||||
putTicketIntoUsernameKeyCache(newTicket);
|
||||
putIntoCache(newTicket);
|
||||
}
|
||||
currentTicket.set(ticketString);
|
||||
if (logger.isTraceEnabled())
|
||||
@@ -357,7 +330,7 @@ public class InMemoryTicketComponentImpl implements TicketComponent
|
||||
public void invalidateTicketById(String ticketString)
|
||||
{
|
||||
String key = ticketString.substring(GRANTED_AUTHORITY_TICKET_PREFIX.length());
|
||||
removeTicketFromTicketsCache(key);
|
||||
removeFromCache(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -419,10 +392,11 @@ public class InMemoryTicketComponentImpl implements TicketComponent
|
||||
logger.trace("Clearing all tickets from the ticketsCache, that used to have size: " + count);
|
||||
}
|
||||
ticketsCache.clear();
|
||||
usernameToTicketIdCache.clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
Set<String> toRemove = new HashSet<String>();
|
||||
Set<String> toRemove = new HashSet<>();
|
||||
for (String key : ticketsCache.getKeys())
|
||||
{
|
||||
Ticket ticket = ticketsCache.get(key);
|
||||
@@ -434,7 +408,7 @@ public class InMemoryTicketComponentImpl implements TicketComponent
|
||||
}
|
||||
for (String id : toRemove)
|
||||
{
|
||||
removeTicketFromTicketsCache(id);
|
||||
removeFromCache(id);
|
||||
}
|
||||
}
|
||||
return count;
|
||||
@@ -443,35 +417,26 @@ public class InMemoryTicketComponentImpl implements TicketComponent
|
||||
@Override
|
||||
public void invalidateTicketByUser(String userName)
|
||||
{
|
||||
Set<String> toRemove = new HashSet<String>();
|
||||
Set<String> toRemove = new HashSet<>();
|
||||
|
||||
String keyFromCache = usernameKey.get(userName);
|
||||
if(StringUtils.isNotBlank(keyFromCache)) {
|
||||
Ticket ticketFromCache = ticketsCache.get(keyFromCache);
|
||||
if(ticketFromCache != null) {
|
||||
toRemove.add(ticketFromCache.getTicketId());
|
||||
}
|
||||
} else {
|
||||
for (String key : ticketsCache.getKeys())
|
||||
for (String key : ticketsCache.getKeys())
|
||||
{
|
||||
Ticket ticket = ticketsCache.get(key);
|
||||
// Hack: The getKeys() call might return keys for null marker objects, yielding null values
|
||||
if(ticket == null)
|
||||
{
|
||||
Ticket ticket = ticketsCache.get(key);
|
||||
// Hack: The getKeys() call might return keys for null marker objects, yielding null values
|
||||
if (ticket == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (ticket.getUserName().equals(userName))
|
||||
{
|
||||
toRemove.add(ticket.getTicketId());
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if(ticket.getUserName().equals(userName))
|
||||
{
|
||||
toRemove.add(ticket.getTicketId());
|
||||
}
|
||||
}
|
||||
|
||||
for (String id : toRemove)
|
||||
{
|
||||
removeTicketFromTicketsCache(id);
|
||||
removeFromCache(id);
|
||||
}
|
||||
removeFromUsernameKey(userName);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -22,6 +22,7 @@
|
||||
|
||||
<mimetype mimetype="application/vnd.ms-project" display="Microsoft Project">
|
||||
<extension default="true">mpp</extension>
|
||||
<extension>mpt</extension>
|
||||
</mimetype>
|
||||
|
||||
<mimetype mimetype="image/vnd.adobe.photoshop" display="Adobe Photoshop">
|
||||
@@ -108,11 +109,28 @@
|
||||
<extension>acp</extension>
|
||||
</mimetype>
|
||||
<mimetype mimetype="application/vnd.visio" display="Microsoft Visio">
|
||||
<extension>vsd</extension>
|
||||
<extension default="true">vsd</extension>
|
||||
<extension>vss</extension>
|
||||
<extension>vst</extension>
|
||||
</mimetype>
|
||||
<mimetype mimetype="application/vnd.visio2013" display="Microsoft Visio 2013">
|
||||
<extension>vsdx</extension>
|
||||
</mimetype>
|
||||
<mimetype mimetype="application/vnd.ms-visio.drawing.macroenabled.main+xml" display="Microsoft Visio macro-enabled drawing">
|
||||
<extension>vsdm</extension>
|
||||
</mimetype>
|
||||
<mimetype mimetype="application/vnd.ms-visio.stencil.main+xml" display="Microsoft Visio stencil">
|
||||
<extension>vssx</extension>
|
||||
</mimetype>
|
||||
<mimetype mimetype="application/vnd.ms-visio.stencil.macroenabled.main+xml" display="Microsoft Visio macro-enabled stencil">
|
||||
<extension>vssm</extension>
|
||||
</mimetype>
|
||||
<mimetype mimetype="application/vnd.ms-visio.template.main+xml" display="Microsoft Visio template">
|
||||
<extension>vstx</extension>
|
||||
</mimetype>
|
||||
<mimetype mimetype="application/vnd.ms-visio.template.macroenabled.main+xml" display="Microsoft Visio macro-enabled template">
|
||||
<extension>vstm</extension>
|
||||
</mimetype>
|
||||
<mimetype mimetype="application/vnd.adobe.xdp+xml" display="Adobe Acrobat XML Data Package">
|
||||
<extension>xdp</extension>
|
||||
</mimetype>
|
||||
|
14
packaging/distribution/pom.xml
Normal file
14
packaging/distribution/pom.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-distribution</artifactId>
|
||||
<name>Package Licences and Keystore for Distribution</name>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>7.302</version>
|
||||
</parent>
|
||||
</project>
|
@@ -0,0 +1,141 @@
|
||||
Instructions for Generating Repository SSL Keystores
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
<store password> is the keystore password. The file ${dir.keystore}/ssl-keystore-passwords.properties contains passwords for the SSL keystore,
|
||||
${dir.keystore}/ssl-truststore-passwords.properties contains passwords for the SSL truststore.
|
||||
|
||||
These instructions will create an RSA public/private key pair for the repository with a certificate that has been signed by the Alfresco Certificate Authority (CA).
|
||||
It will also create a truststore for the repository containing the CA certificate; this will be used to authenticate connections to specific repository
|
||||
URLs from Solr. It assumes the existence of the Alfresco CA key and certificate to sign the repository certificate; for security reasons these are not generally available.
|
||||
You can either generate your own CA key and certificate (see instructions below) or use a recognised Certificate Authority such as Verisign. For Alfresco employees the key
|
||||
and certificate are available in svn.
|
||||
|
||||
(i) Generate the repository public/private key pair in a keystore:
|
||||
|
||||
$ keytool -genkey -alias ssl.repo -keyalg RSA -keystore ssl.keystore -storetype JCEKS -storepass <store password>
|
||||
Enter keystore password:
|
||||
Re-enter new password:
|
||||
What is your first and last name?
|
||||
[Unknown]: Alfresco Repository
|
||||
What is the name of your organizational unit?
|
||||
[Unknown]:
|
||||
What is the name of your organization?
|
||||
[Unknown]: Alfresco Software Ltd.
|
||||
What is the name of your City or Locality?
|
||||
[Unknown]: Maidenhead
|
||||
What is the name of your State or Province?
|
||||
[Unknown]: UK
|
||||
What is the two-letter country code for this unit?
|
||||
[Unknown]: GB
|
||||
Is CN=Alfresco Repository, OU=Unknown, O=Alfresco Software Ltd., L=Maidenhead, ST=UK, C=GB correct?
|
||||
[no]: yes
|
||||
|
||||
Enter key password for <ssl.repo>
|
||||
(RETURN if same as keystore password):
|
||||
|
||||
(ii) Generate a certificate request for the repository key
|
||||
|
||||
$ keytool -keystore ssl.keystore -alias ssl.repo -certreq -file repo.csr -storetype JCEKS -storepass <store password>
|
||||
|
||||
(iii) Alfresco CA signs the certificate request, creating a certificate that is valid for 365 days.
|
||||
|
||||
$ openssl x509 -CA ca.crt -CAkey ca.key -CAcreateserial -req -in repo.csr -out repo.crt -days 365
|
||||
Signature ok
|
||||
subject=/C=GB/ST=UK/L=Maidenhead/O=Alfresco Software Ltd./OU=Unknown/CN=Alfresco Repository
|
||||
Getting CA Private Key
|
||||
Enter pass phrase for ca.key:
|
||||
|
||||
(iv) Import the Alfresco CA key into the repository key store
|
||||
|
||||
$ keytool -import -alias ssl.alfreco.ca -file ca.crt -keystore ssl.keystore -storetype JCEKS -storepass <store password>
|
||||
Enter keystore password:
|
||||
Owner: CN=Alfresco CA, O=Alfresco Software Ltd., L=Maidenhead, ST=UK, C=GB
|
||||
Issuer: CN=Alfresco CA, O=Alfresco Software Ltd., L=Maidenhead, ST=UK, C=GB
|
||||
Serial number: 805ba6dc8f62f8b8
|
||||
Valid from: Fri Aug 12 13:28:58 BST 2011 until: Mon Aug 09 13:28:58 BST 2021
|
||||
Certificate fingerprints:
|
||||
MD5: 4B:45:94:2D:8E:98:E8:12:04:67:AD:AE:48:3C:F5:A0
|
||||
SHA1: 74:42:22:D0:52:AD:82:7A:FD:37:46:37:91:91:F4:77:89:3A:C9:A3
|
||||
Signature algorithm name: SHA1withRSA
|
||||
Version: 3
|
||||
|
||||
Extensions:
|
||||
|
||||
#1: ObjectId: 2.5.29.14 Criticality=false
|
||||
SubjectKeyIdentifier [
|
||||
KeyIdentifier [
|
||||
0000: 08 42 40 DC FE 4A 50 87 05 2B 38 4D 92 70 8E 51 .B@..JP..+8M.p.Q
|
||||
0010: 4E 38 71 D6 N8q.
|
||||
]
|
||||
]
|
||||
|
||||
#2: ObjectId: 2.5.29.19 Criticality=false
|
||||
BasicConstraints:[
|
||||
CA:true
|
||||
PathLen:2147483647
|
||||
]
|
||||
|
||||
#3: ObjectId: 2.5.29.35 Criticality=false
|
||||
AuthorityKeyIdentifier [
|
||||
KeyIdentifier [
|
||||
0000: 08 42 40 DC FE 4A 50 87 05 2B 38 4D 92 70 8E 51 .B@..JP..+8M.p.Q
|
||||
0010: 4E 38 71 D6 N8q.
|
||||
]
|
||||
|
||||
[CN=Alfresco CA, O=Alfresco Software Ltd., L=Maidenhead, ST=UK, C=GB]
|
||||
SerialNumber: [ 805ba6dc 8f62f8b8]
|
||||
]
|
||||
|
||||
Trust this certificate? [no]: yes
|
||||
Certificate was added to keystore
|
||||
|
||||
(v) Import the CA-signed repository certificate into the repository keystore
|
||||
|
||||
$ keytool -import -alias ssl.repo -file repo.crt -keystore ssl.keystore -storetype JCEKS -storepass <store password>
|
||||
Enter keystore password:
|
||||
Certificate reply was installed in keystore
|
||||
|
||||
(vi) Convert the repository keystore to a pkcs12 keystore (for use in browsers such as Firefox). Give the pkcs12 key store the key store password 'alfresco'.
|
||||
|
||||
keytool -importkeystore -srckeystore ssl.keystore -srcstorepass <keystore password> -srcstoretype JCEKS -srcalias ssl.repo -srckeypass kT9X6oe68t -destkeystore firefox.p12 -deststoretype pkcs12 -deststorepass alfresco -destalias ssl.repo -destkeypass alfresco
|
||||
|
||||
(vi) Create a repository truststore containing the Alfresco CA certificate
|
||||
|
||||
keytool -import -alias ssl.alfreco.ca -file ca.crt -keystore ssl.keystore -storetype JCEKS -storepass <store password>
|
||||
keytool -import -alias alfreco.ca -file ca.crt -keystore ssl.truststore -storetype JCEKS -storepass <store password>
|
||||
|
||||
(vii) Copy the keystore and truststore to the repository keystore location defined by the property 'dir.keystore'.
|
||||
(viii) Update the SSL properties i.e. properties starting with the prefixes 'alfresco.encryption.ssl.keystore' and 'alfresco.encryption.ssl.truststore'.
|
||||
|
||||
Instructions for Generating a Certificate Authority (CA) Key and Certificate
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
(i) Generate the CA private key
|
||||
|
||||
$ openssl genrsa -des3 -out ca.key 1024
|
||||
Generating RSA private key, 1024 bit long modulus
|
||||
..........++++++
|
||||
..++++++
|
||||
e is 65537 (0x10001)
|
||||
Enter pass phrase for ca.key:
|
||||
Verifying - Enter pass phrase for ca.key:
|
||||
|
||||
(ii) Generate the CA self-signed certificate
|
||||
|
||||
$ openssl req -new -x509 -days 3650 -key ca.key -out ca.crt
|
||||
Enter pass phrase for ca.key:
|
||||
You are about to be asked to enter information that will be incorporated
|
||||
into your certificate request.
|
||||
What you are about to enter is what is called a Distinguished Name or a DN.
|
||||
There are quite a few fields but you can leave some blank
|
||||
For some fields there will be a default value,
|
||||
If you enter '.', the field will be left blank.
|
||||
-----
|
||||
Country Name (2 letter code) [AU]:GB
|
||||
State or Province Name (full name) [Some-State]:UK
|
||||
Locality Name (eg, city) []:Maidenhead
|
||||
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Alfresco Software Ltd.
|
||||
Organizational Unit Name (eg, section) []:
|
||||
Common Name (eg, YOUR name) []:Alfresco CA
|
||||
Email Address []:
|
||||
|
@@ -0,0 +1,58 @@
|
||||
@rem Please edit the variables below to suit your installation
|
||||
@rem Note: for an installation created by the Alfresco installer, you only need to edit ALFRESCO_HOME
|
||||
|
||||
@rem Alfresco installation directory
|
||||
set ALFRESCO_HOME=C:\Alfresco-5.2
|
||||
@rem The directory containing the alfresco keystores, as referenced by keystoreFile and truststoreFile attributes in tomcat\conf\server.xml
|
||||
set ALFRESCO_KEYSTORE_HOME=%ALFRESCO_HOME%\alf_data\keystore
|
||||
@rem Java installation directory
|
||||
set JAVA_HOME=%ALFRESCO_HOME%\java
|
||||
@rem Location in which new keystore files will be generated
|
||||
set CERTIFICATE_HOME=%USERPROFILE%
|
||||
@rem The repository server certificate subject name, as specified in tomcat\conf\tomcat-users.xml with roles="repository"
|
||||
set REPO_CERT_DNAME=CN=Alfresco Repository, OU=Unknown, O=Alfresco Software Ltd., L=Maidenhead, ST=UK, C=GB
|
||||
@rem The SOLR client certificate subject name, as specified in tomcat\conf\tomcat-users.xml with roles="repoclient"
|
||||
set SOLR_CLIENT_CERT_DNAME=CN=Alfresco Repository Client, OU=Unknown, O=Alfresco Software Ltd., L=Maidenhead, ST=UK, C=GB
|
||||
@rem The number of days before the certificate expires
|
||||
set CERTIFICATE_VALIDITY=36525
|
||||
|
||||
@rem Ensure certificate output dir exists
|
||||
@if not exist "%CERTIFICATE_HOME%" mkdir "%CERTIFICATE_HOME%"
|
||||
|
||||
@rem Remove old output files (note they are backed up elsewhere)
|
||||
@if exist "%CERTIFICATE_HOME%\ssl.keystore" del "%CERTIFICATE_HOME%\ssl.keystore"
|
||||
@if exist "%CERTIFICATE_HOME%\ssl.truststore" del "%CERTIFICATE_HOME%\ssl.truststore"
|
||||
@if exist "%CERTIFICATE_HOME%\browser.p12" del "%CERTIFICATE_HOME%\browser.p12"
|
||||
@if exist "%CERTIFICATE_HOME%\ssl.repo.client.keystore" del "%CERTIFICATE_HOME%\ssl.repo.client.keystore"
|
||||
@if exist "%CERTIFICATE_HOME%\ssl.repo.client.truststore" del "%CERTIFICATE_HOME%\ssl.repo.client.truststore"
|
||||
|
||||
@rem Generate new self-signed certificates for the repository and solr
|
||||
"%JAVA_HOME%\bin\keytool" -genkeypair -keyalg RSA -dname "%REPO_CERT_DNAME%" -validity %CERTIFICATE_VALIDITY% -alias ssl.repo -keypass kT9X6oe68t -keystore "%CERTIFICATE_HOME%\ssl.keystore" -storetype JCEKS -storepass kT9X6oe68t
|
||||
"%JAVA_HOME%\bin\keytool" -exportcert -alias ssl.repo -file "%CERTIFICATE_HOME%\ssl.repo.crt" -keystore "%CERTIFICATE_HOME%\ssl.keystore" -storetype JCEKS -storepass kT9X6oe68t
|
||||
"%JAVA_HOME%\bin\keytool" -genkeypair -keyalg RSA -dname "%SOLR_CLIENT_CERT_DNAME%" -validity %CERTIFICATE_VALIDITY% -alias ssl.repo.client -keypass kT9X6oe68t -keystore "%CERTIFICATE_HOME%\ssl.repo.client.keystore" -storetype JCEKS -storepass kT9X6oe68t
|
||||
"%JAVA_HOME%\bin\keytool" -exportcert -alias ssl.repo.client -file "%CERTIFICATE_HOME%\ssl.repo.client.crt" -keystore "%CERTIFICATE_HOME%\ssl.repo.client.keystore" -storetype JCEKS -storepass kT9X6oe68t
|
||||
|
||||
@rem Create trust relationship between repository and solr
|
||||
"%JAVA_HOME%\bin\keytool" -importcert -noprompt -alias ssl.repo.client -file "%CERTIFICATE_HOME%\ssl.repo.client.crt" -keystore "%CERTIFICATE_HOME%\ssl.truststore" -storetype JCEKS -storepass kT9X6oe68t
|
||||
@rem Create trust relationship between repository and itself - used for searches
|
||||
"%JAVA_HOME%\bin\keytool" -importcert -noprompt -alias ssl.repo -file "%CERTIFICATE_HOME%\ssl.repo.crt" -keystore "%CERTIFICATE_HOME%\ssl.truststore" -storetype JCEKS -storepass kT9X6oe68t
|
||||
@rem Create trust relationship between solr and repository
|
||||
"%JAVA_HOME%\bin\keytool" -importcert -noprompt -alias ssl.repo -file "%CERTIFICATE_HOME%\ssl.repo.crt" -keystore "%CERTIFICATE_HOME%\ssl.repo.client.truststore" -storetype JCEKS -storepass kT9X6oe68t
|
||||
@rem Export repository keystore to pkcs12 format for browser compatibility
|
||||
"%JAVA_HOME%\bin\keytool" -importkeystore -srckeystore "%CERTIFICATE_HOME%\ssl.keystore" -srcstorepass kT9X6oe68t -srcstoretype JCEKS -srcalias ssl.repo -srckeypass kT9X6oe68t -destkeystore "%CERTIFICATE_HOME%\browser.p12" -deststoretype pkcs12 -deststorepass alfresco -destalias ssl.repo -destkeypass alfresco
|
||||
|
||||
@rem Ensure keystore dir actually exists
|
||||
@if not exist "%ALFRESCO_KEYSTORE_HOME%" mkdir "%ALFRESCO_KEYSTORE_HOME%"
|
||||
|
||||
@rem Install the new files
|
||||
copy /Y "%CERTIFICATE_HOME%\ssl.keystore" "%ALFRESCO_KEYSTORE_HOME%\ssl.keystore"
|
||||
copy /Y "%CERTIFICATE_HOME%\ssl.truststore" "%ALFRESCO_KEYSTORE_HOME%\ssl.truststore"
|
||||
copy /Y "%CERTIFICATE_HOME%\browser.p12" "%ALFRESCO_KEYSTORE_HOME%\browser.p12"
|
||||
|
||||
@echo ****************************************
|
||||
@echo You must copy the following files to the correct location.
|
||||
@echo %CERTIFICATE_HOME%\ssl.repo.client.keystore
|
||||
@echo %CERTIFICATE_HOME%\ssl.repo.client.truststore
|
||||
@echo eg. for Solr 4 the location is SOLR_HOME\workspace-SpacesStore\conf and SOLR_HOME\archive-SpacesStore\conf
|
||||
@echo Please ensure that you set dir.keystore=%ALFRESCO_KEYSTORE_HOME% in alfresco-global.properties
|
||||
@echo ****************************************
|
@@ -0,0 +1,82 @@
|
||||
#! /bin/sh
|
||||
# Please edit the variables below to suit your installation
|
||||
# Note: for an installation created by the Alfresco installer, you only need to edit ALFRESCO_HOME
|
||||
|
||||
# Alfresco installation directory
|
||||
if [ -z "$ALFRESCO_HOME" ]; then
|
||||
ALFRESCO_HOME=/opt/alfresco-5.2
|
||||
echo "Setting ALFRESCO_HOME to $ALFRESCO_HOME"
|
||||
fi
|
||||
|
||||
# The directory containing the alfresco keystores, as referenced by keystoreFile and truststoreFile attributes in tomcat/conf/server.xml
|
||||
ALFRESCO_KEYSTORE_HOME=$ALFRESCO_HOME/alf_data/keystore
|
||||
|
||||
# Location in which new keystore files will be generated
|
||||
if [ -z "$CERTIFICATE_HOME" ]; then
|
||||
CERTIFICATE_HOME=$HOME
|
||||
echo "Certificates will be generated in $CERTIFICATE_HOME and then moved to $ALFRESCO_KEYSTORE_HOME"
|
||||
fi
|
||||
|
||||
# Java installation directory
|
||||
JAVA_HOME=$ALFRESCO_HOME/java
|
||||
|
||||
# The repository server certificate subject name, as specified in tomcat/conf/tomcat-users.xml with roles="repository"
|
||||
REPO_CERT_DNAME="CN=Alfresco Repository, OU=Unknown, O=Alfresco Software Ltd., L=Maidenhead, ST=UK, C=GB"
|
||||
# The SOLR client certificate subject name, as specified in tomcat/conf/tomcat-users.xml with roles="repoclient"
|
||||
SOLR_CLIENT_CERT_DNAME="CN=Alfresco Repository Client, OU=Unknown, O=Alfresco Software Ltd., L=Maidenhead, ST=UK, C=GB"
|
||||
# The number of days before the certificate expires
|
||||
CERTIFICATE_VALIDITY=36525
|
||||
|
||||
# Stop
|
||||
if [ -f "$ALFRESCO_HOME/alfresco.sh" ]; then "$ALFRESCO_HOME/alfresco.sh" stop; fi
|
||||
|
||||
# Ensure certificate output dir exists
|
||||
mkdir -p "$CERTIFICATE_HOME"
|
||||
|
||||
# Remove old output files (note they are backed up elsewhere)
|
||||
if [ -f "$CERTIFICATE_HOME/ssl.keystore" ]; then rm "$CERTIFICATE_HOME/ssl.keystore"; fi
|
||||
if [ -f "$CERTIFICATE_HOME/ssl.truststore" ]; then rm "$CERTIFICATE_HOME/ssl.truststore"; fi
|
||||
if [ -f "$CERTIFICATE_HOME/browser.p12" ]; then rm "$CERTIFICATE_HOME/browser.p12"; fi
|
||||
if [ -f "$CERTIFICATE_HOME/ssl.repo.client.keystore" ]; then rm "$CERTIFICATE_HOME/ssl.repo.client.keystore"; fi
|
||||
if [ -f "$CERTIFICATE_HOME/ssl.repo.client.truststore" ]; then rm "$CERTIFICATE_HOME/ssl.repo.client.truststore"; fi
|
||||
|
||||
# Generate new self-signed certificates for the repository and solr
|
||||
"$JAVA_HOME/bin/keytool" -genkeypair -keyalg RSA -dname "$REPO_CERT_DNAME" -validity $CERTIFICATE_VALIDITY -alias ssl.repo -keypass kT9X6oe68t -keystore "$CERTIFICATE_HOME/ssl.keystore" -storetype JCEKS -storepass kT9X6oe68t
|
||||
"$JAVA_HOME/bin/keytool" -exportcert -alias ssl.repo -file "$CERTIFICATE_HOME/ssl.repo.crt" -keystore "$CERTIFICATE_HOME/ssl.keystore" -storetype JCEKS -storepass kT9X6oe68t
|
||||
"$JAVA_HOME/bin/keytool" -genkeypair -keyalg RSA -dname "$SOLR_CLIENT_CERT_DNAME" -validity $CERTIFICATE_VALIDITY -alias ssl.repo.client -keypass kT9X6oe68t -keystore "$CERTIFICATE_HOME/ssl.repo.client.keystore" -storetype JCEKS -storepass kT9X6oe68t
|
||||
"$JAVA_HOME/bin/keytool" -exportcert -alias ssl.repo.client -file "$CERTIFICATE_HOME/ssl.repo.client.crt" -keystore "$CERTIFICATE_HOME/ssl.repo.client.keystore" -storetype JCEKS -storepass kT9X6oe68t
|
||||
|
||||
# Create trust relationship between repository and solr
|
||||
"$JAVA_HOME/bin/keytool" -importcert -noprompt -alias ssl.repo.client -file "$CERTIFICATE_HOME/ssl.repo.client.crt" -keystore "$CERTIFICATE_HOME/ssl.truststore" -storetype JCEKS -storepass kT9X6oe68t
|
||||
# Create trust relationship between repository and itself - used for searches
|
||||
"$JAVA_HOME/bin/keytool" -importcert -noprompt -alias ssl.repo -file "$CERTIFICATE_HOME/ssl.repo.crt" -keystore "$CERTIFICATE_HOME/ssl.truststore" -storetype JCEKS -storepass kT9X6oe68t
|
||||
# Create trust relationship between solr and repository
|
||||
"$JAVA_HOME/bin/keytool" -importcert -noprompt -alias ssl.repo -file "$CERTIFICATE_HOME/ssl.repo.crt" -keystore "$CERTIFICATE_HOME/ssl.repo.client.truststore" -storetype JCEKS -storepass kT9X6oe68t
|
||||
# Export repository keystore to pkcs12 format for browser compatibility
|
||||
"$JAVA_HOME/bin/keytool" -importkeystore -srckeystore "$CERTIFICATE_HOME/ssl.keystore" -srcstorepass kT9X6oe68t -srcstoretype JCEKS -srcalias ssl.repo -srckeypass kT9X6oe68t -destkeystore "$CERTIFICATE_HOME/browser.p12" -deststoretype pkcs12 -deststorepass alfresco -destalias ssl.repo -destkeypass alfresco
|
||||
|
||||
# Ensure keystore dir actually exists
|
||||
mkdir -p "$ALFRESCO_KEYSTORE_HOME"
|
||||
|
||||
# Back up old files
|
||||
cp "$ALFRESCO_KEYSTORE_HOME/ssl.keystore" "$ALFRESCO_KEYSTORE_HOME/ssl.keystore.old"
|
||||
cp "$ALFRESCO_KEYSTORE_HOME/ssl.truststore" "$ALFRESCO_KEYSTORE_HOME/ssl.truststore.old"
|
||||
cp "$ALFRESCO_KEYSTORE_HOME/browser.p12" "$ALFRESCO_KEYSTORE_HOME/browser.p12.old"
|
||||
|
||||
# Install the new files
|
||||
cp "$CERTIFICATE_HOME/ssl.keystore" "$ALFRESCO_KEYSTORE_HOME/ssl.keystore"
|
||||
cp "$CERTIFICATE_HOME/ssl.truststore" "$ALFRESCO_KEYSTORE_HOME/ssl.truststore"
|
||||
cp "$CERTIFICATE_HOME/browser.p12" "$ALFRESCO_KEYSTORE_HOME/browser.p12"
|
||||
|
||||
echo " "
|
||||
echo "*******************************************"
|
||||
echo "You must copy the following files to the correct location."
|
||||
echo " "
|
||||
echo " $CERTIFICATE_HOME/ssl.repo.client.keystore"
|
||||
echo " $CERTIFICATE_HOME/ssl.repo.client.truststore"
|
||||
echo " eg. for Solr 4 the location is SOLR_HOME/workspace-SpacesStore/conf/ and SOLR_HOME/archive-SpacesStore/conf/"
|
||||
echo " "
|
||||
echo "$ALFRESCO_KEYSTORE_HOME/browser.p12 has also been generated."
|
||||
echo " "
|
||||
echo "Please ensure that you set dir.keystore=$ALFRESCO_KEYSTORE_HOME in alfresco-global.properties"
|
||||
echo "*******************************************"
|
@@ -1,7 +1,10 @@
|
||||
aliases=metadata
|
||||
# The password protecting the keystore entries
|
||||
keystore.password=mp6yc0UD9e
|
||||
# The password protecting the alias: metadata
|
||||
metadata.keyData=
|
||||
metadata.algorithm=DESede
|
||||
# This file and the keystore is deprecated
|
||||
# Please generate a new keystore for new systems and use JVM properties for it's configuration
|
||||
|
||||
aliases=metadata
|
||||
# The password protecting the keystore entries
|
||||
keystore.password=mp6yc0UD9e
|
||||
# The password protecting the alias: metadata
|
||||
metadata.keyData=
|
||||
metadata.algorithm=DESede
|
||||
metadata.password=oKIWzVdEdA
|
@@ -0,0 +1,7 @@
|
||||
See https://wiki.alfresco.com/wiki/Data_Encryption and https://wiki.alfresco.com/wiki/Alfresco_And_SOLR.
|
||||
|
||||
keystore is the secret key keystore, containing the secret key used to encrypt and decrypt node properties.
|
||||
ssl.keystore is the repository keystore, containing the repository private/public key pair and certificate.
|
||||
ssl.truststore is the repository truststore, containing certificates that the repository trusts.
|
||||
|
||||
browser.p12 is a pkcs12 keystore generated from ssl.keystore that contains the repository private key and certificate for use in browsers such as Firefox.
|
@@ -19,6 +19,8 @@ ARG TOMCAT_DIR=/usr/local/tomcat
|
||||
RUN mkdir -p ${TOMCAT_DIR}/shared/classes/alfresco/extension/mimetypes && \
|
||||
mkdir -p ${TOMCAT_DIR}/shared/classes/alfresco/extension/transform/renditions && \
|
||||
mkdir -p ${TOMCAT_DIR}/shared/classes/alfresco/extension/transform/pipelines && \
|
||||
mkdir /licenses && \
|
||||
mkdir -p ${TOMCAT_DIR}/shared/classes/alfresco/extension/keystore && \
|
||||
mkdir ${TOMCAT_DIR}/alfresco-mmt && \
|
||||
touch ${TOMCAT_DIR}/shared/classes/alfresco-global.properties
|
||||
|
||||
@@ -26,13 +28,13 @@ RUN mkdir -p ${TOMCAT_DIR}/shared/classes/alfresco/extension/mimetypes && \
|
||||
# Copy the WAR files to the appropriate location for your application server
|
||||
# Copy the JDBC drivers for the database you are using to the lib/ directory.
|
||||
# Copy the alfresco-mmt.jar
|
||||
# Copy Licenses to the root of the Docker image
|
||||
# Copy default keystore
|
||||
COPY ${resource_path}/war ${TOMCAT_DIR}/webapps
|
||||
COPY ${resource_path}/connector/* ${TOMCAT_DIR}/lib/
|
||||
COPY ${resource_path}/alfresco-mmt/* ${TOMCAT_DIR}/alfresco-mmt/
|
||||
|
||||
# Copy Licenses to the root of the Docker image
|
||||
RUN mkdir /licenses
|
||||
COPY ${resource_path}/licenses/ /licenses/
|
||||
COPY ${resource_path}/dependency/licenses/ /licenses/
|
||||
COPY ${resource_path}/dependency/keystore/metadata-keystore/keystore ${TOMCAT_DIR}/shared/classes/alfresco/extension/keystore
|
||||
|
||||
# Change the value of the shared.loader= property to the following:
|
||||
# shared.loader=${catalina.base}/shared/classes
|
||||
@@ -70,15 +72,7 @@ RUN yum install -y fontconfig-2.13.0-4.3.el7 \
|
||||
dejavu-sans-fonts-2.33-6.el7 && \
|
||||
yum clean all
|
||||
|
||||
# Generate default keystore. Please generate new one for production systems
|
||||
ARG CERT_DNAME="CN=Alfresco Repository, OU=Unknown, O=Alfresco Software Ltd., L=Maidenhead, ST=UK, C=GB"
|
||||
ARG CERT_VALIDITY=36525
|
||||
ARG KEYSTORE_PASSWORD=mp6yc0UD9e
|
||||
RUN mkdir ${TOMCAT_DIR}/shared/classes/alfresco/keystore && \
|
||||
keytool -genseckey -dname "$CERT_DNAME" -validity ${CERT_VALIDITY} -alias metadata -keyalg AES -keysize 256 -keystore ${TOMCAT_DIR}/shared/classes/alfresco/keystore/keystore -storetype pkcs12 -storepass ${KEYSTORE_PASSWORD}
|
||||
|
||||
|
||||
# The standard configuration is to have all Tomcat files owned by root with group GROUPNAME and whilst owner has read/write privileges,
|
||||
# The standard configuration is to have all Tomcat files owned by root with group GROUPNAME and whilst owner has read/write privileges,
|
||||
# group only has restricted permissions and world has no permissions.
|
||||
RUN mkdir -p ${TOMCAT_DIR}/conf/Catalina/localhost && \
|
||||
mkdir -p ${TOMCAT_DIR}/alf_data && \
|
||||
@@ -97,9 +91,9 @@ RUN mkdir -p ${TOMCAT_DIR}/conf/Catalina/localhost && \
|
||||
chmod g+rwx ${TOMCAT_DIR}/temp && \
|
||||
chmod g+rwx ${TOMCAT_DIR}/work && \
|
||||
chmod o-w ${TOMCAT_DIR}/work && \
|
||||
chmod 664 ${TOMCAT_DIR}/alfresco-mmt/alfresco-mmt-*.jar && \
|
||||
find /licenses -type d -exec chmod 0775 {} \; && \
|
||||
find /licenses -type f -exec chmod 0664 {} \;
|
||||
chmod 644 ${TOMCAT_DIR}/alfresco-mmt/alfresco-mmt-*.jar && \
|
||||
find /licenses -type d -exec chmod 0755 {} \; && \
|
||||
find /licenses -type f -exec chmod 0644 {} \;
|
||||
|
||||
EXPOSE 10001
|
||||
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>7.183.300-TEST1</version>
|
||||
<version>7.302</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
@@ -16,29 +16,6 @@
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-licenses</id>
|
||||
<phase>process-resources</phase>
|
||||
<goals>
|
||||
<goal>copy-resources</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<resources>
|
||||
<resource>
|
||||
<!-- Extract licenses directory -->
|
||||
<directory>../distribution/src/main/resources/licenses</directory>
|
||||
<filtering>false</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
<outputDirectory>${project.build.directory}/licenses</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
@@ -126,6 +103,24 @@
|
||||
</artifactItems>
|
||||
</configuration>
|
||||
</execution>
|
||||
|
||||
<execution>
|
||||
<id>unpack-licenses-and-keystore</id>
|
||||
<phase>process-resources</phase>
|
||||
<goals>
|
||||
<goal>unpack</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifactItems>
|
||||
<artifactItem>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-distribution</artifactId>
|
||||
<type>jar</type>
|
||||
<version>${project.version}</version>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>7.183.300-TEST1</version>
|
||||
<version>7.302</version>
|
||||
</parent>
|
||||
|
||||
<profiles>
|
||||
@@ -18,6 +18,7 @@
|
||||
</activation>
|
||||
<modules>
|
||||
<module>war</module>
|
||||
<module>distribution</module>
|
||||
<module>docker-alfresco</module>
|
||||
</modules>
|
||||
</profile>
|
||||
@@ -25,18 +26,21 @@
|
||||
<id>community</id>
|
||||
<modules>
|
||||
<module>war</module>
|
||||
<module>distribution</module>
|
||||
</modules>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>communityDocker</id>
|
||||
<modules>
|
||||
<module>war</module>
|
||||
<module>distribution</module>
|
||||
<module>docker-alfresco</module>
|
||||
</modules>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>all-tas-tests</id>
|
||||
<modules>
|
||||
<module>distribution</module>
|
||||
<module>tests</module>
|
||||
</modules>
|
||||
</profile>
|
||||
|
@@ -1,4 +1,4 @@
|
||||
TRANSFORMERS_TAG=2.3.1
|
||||
SOLR6_TAG=1.4.2
|
||||
TRANSFORMERS_TAG=2.3.5
|
||||
SOLR6_TAG=2.0.0
|
||||
POSTGRES_TAG=11.7
|
||||
ACTIVEMQ_TAG=5.15.8
|
||||
|
@@ -10,6 +10,16 @@ services:
|
||||
image: alfresco/alfresco-community-repo-base:latest
|
||||
environment:
|
||||
CATALINA_OPTS : "-agentlib:jdwp=transport=dt_socket,address=*:8000,server=y,suspend=n"
|
||||
JAVA_TOOL_OPTIONS: "
|
||||
-Dencryption.keystore.type=JCEKS
|
||||
-Dencryption.cipherAlgorithm=DESede/CBC/PKCS5Padding
|
||||
-Dencryption.keyAlgorithm=DESede
|
||||
-Dencryption.keystore.location=/usr/local/tomcat/shared/classes/alfresco/extension/keystore/keystore
|
||||
-Dmetadata-keystore.password=mp6yc0UD9e
|
||||
-Dmetadata-keystore.aliases=metadata
|
||||
-Dmetadata-keystore.metadata.password=oKIWzVdEdA
|
||||
-Dmetadata-keystore.metadata.algorithm=DESede
|
||||
"
|
||||
JAVA_OPTS :
|
||||
"
|
||||
-Ddb.driver=org.postgresql.Driver
|
||||
@@ -39,10 +49,6 @@ services:
|
||||
-Dftp.port=1221
|
||||
-Dcors.enabled=true
|
||||
-Dcors.allowed.origins=http://localhost:4200,http://localhost:8080
|
||||
-Dmetadata-keystore.password=mp6yc0UD9e
|
||||
-Dmetadata-keystore.aliases=metadata
|
||||
-Dmetadata-keystore.metadata.password=mp6yc0UD9e
|
||||
-Dmetadata-keystore.metadata.algorithm=AES
|
||||
"
|
||||
ports:
|
||||
- 8082:8080
|
||||
|
@@ -10,6 +10,16 @@ services:
|
||||
image: alfresco/alfresco-community-repo-base:latest
|
||||
environment:
|
||||
CATALINA_OPTS : "-agentlib:jdwp=transport=dt_socket,address=*:8000,server=y,suspend=n"
|
||||
JAVA_TOOL_OPTIONS: "
|
||||
-Dencryption.keystore.type=JCEKS
|
||||
-Dencryption.cipherAlgorithm=DESede/CBC/PKCS5Padding
|
||||
-Dencryption.keyAlgorithm=DESede
|
||||
-Dencryption.keystore.location=/usr/local/tomcat/shared/classes/alfresco/extension/keystore/keystore
|
||||
-Dmetadata-keystore.password=mp6yc0UD9e
|
||||
-Dmetadata-keystore.aliases=metadata
|
||||
-Dmetadata-keystore.metadata.password=oKIWzVdEdA
|
||||
-Dmetadata-keystore.metadata.algorithm=DESede
|
||||
"
|
||||
JAVA_OPTS :
|
||||
"
|
||||
-Ddb.driver=org.postgresql.Driver
|
||||
@@ -35,10 +45,6 @@ services:
|
||||
-Dftp.port=1221
|
||||
-Dcors.enabled=true
|
||||
-Dcors.allowed.origins=http://localhost:4200,http://localhost:8080
|
||||
-Dmetadata-keystore.password=mp6yc0UD9e
|
||||
-Dmetadata-keystore.aliases=metadata
|
||||
-Dmetadata-keystore.metadata.password=mp6yc0UD9e
|
||||
-Dmetadata-keystore.metadata.algorithm=AES
|
||||
"
|
||||
ports:
|
||||
- 8082:8080
|
||||
|
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>7.183.300-TEST1</version>
|
||||
<version>7.302</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>7.183.300-TEST1</version>
|
||||
<version>7.302</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>7.183.300-TEST1</version>
|
||||
<version>7.302</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>7.183.300-TEST1</version>
|
||||
<version>7.302</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>7.183.300-TEST1</version>
|
||||
<version>7.302</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>7.183.300-TEST1</version>
|
||||
<version>7.302</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
@@ -7,12 +7,12 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>7.183.300-TEST1</version>
|
||||
<version>7.302</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<scm-path>local/development/workspace</scm-path>
|
||||
<scm-revision>${buildNumber}</scm-revision>
|
||||
<scm-path>${project.parent.parent.scm.url}</scm-path>
|
||||
<scm-revision>${build-number}</scm-revision>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
@@ -41,7 +41,6 @@
|
||||
<dependency>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
<version>1.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.avalon.framework</groupId>
|
||||
@@ -72,7 +71,6 @@
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>3.0.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- Test dependencies -->
|
||||
@@ -101,18 +99,15 @@
|
||||
<dependency>
|
||||
<groupId>commons-lang</groupId>
|
||||
<artifactId>commons-lang</artifactId>
|
||||
<version>2.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-test</artifactId>
|
||||
<version>${dependency.spring.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<version>3.3.3</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -124,13 +119,11 @@
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<version>${dependency.postgresql.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>${dependency.mysql.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
@@ -271,6 +264,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>3.2.0</version>
|
||||
<configuration>
|
||||
<source>${maven.build.sourceVersion}</source>
|
||||
</configuration>
|
||||
|
47
pom.xml
47
pom.xml
@@ -2,7 +2,7 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>7.183.300-TEST1</version>
|
||||
<version>7.302</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>Alfresco Community Repo Parent</name>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<properties>
|
||||
<acs.version.major>6</acs.version.major>
|
||||
<acs.version.minor>2</acs.version.minor>
|
||||
<acs.version.revision>1</acs.version.revision>
|
||||
<acs.version.revision>3</acs.version.revision>
|
||||
<acs.version.label />
|
||||
|
||||
<version.edition>Community</version.edition>
|
||||
@@ -57,15 +57,15 @@
|
||||
|
||||
<dependency.spring.version>5.1.15.RELEASE</dependency.spring.version>
|
||||
<dependency.antlr.version>3.5.2</dependency.antlr.version>
|
||||
<dependency.jackson.version>2.10.2</dependency.jackson.version>
|
||||
<dependency.jackson-databind.version>2.10.1</dependency.jackson-databind.version>
|
||||
<dependency.jackson.version>2.10.5</dependency.jackson.version>
|
||||
<dependency.jackson-databind.version>2.10.5</dependency.jackson-databind.version>
|
||||
<dependency.cxf.version>3.3.5</dependency.cxf.version>
|
||||
<dependency.opencmis.version>1.0.0</dependency.opencmis.version>
|
||||
<dependency.pdfbox.version>2.0.19</dependency.pdfbox.version>
|
||||
<dependency.webscripts.version>7.14</dependency.webscripts.version>
|
||||
<dependency.webscripts.version>7.16</dependency.webscripts.version>
|
||||
<dependency.bouncycastle.version>1.64</dependency.bouncycastle.version>
|
||||
<dependency.mockito-core.version>3.2.4</dependency.mockito-core.version>
|
||||
<dependency.org-json.version>20090211</dependency.org-json.version>
|
||||
<dependency.mockito-core.version>3.4.6</dependency.mockito-core.version>
|
||||
<dependency.org-json.version>20200518</dependency.org-json.version>
|
||||
<dependency.commons-dbcp.version>1.4-DBCP330</dependency.commons-dbcp.version>
|
||||
<dependency.guava.version>28.2-jre</dependency.guava.version>
|
||||
<dependency.commons-io.version>2.6</dependency.commons-io.version>
|
||||
@@ -75,32 +75,32 @@
|
||||
<dependency.commons-httpclient.version>3.1-HTTPCLIENT-1265</dependency.commons-httpclient.version>
|
||||
<dependency.xercesImpl.version>2.12.0-alfresco-patched-20191004</dependency.xercesImpl.version>
|
||||
<dependency.slf4j.version>1.7.30</dependency.slf4j.version>
|
||||
<dependency.gytheio.version>0.11.3</dependency.gytheio.version>
|
||||
<dependency.gytheio.version>0.11.6</dependency.gytheio.version>
|
||||
<dependency.jaxb.version>2.3.2</dependency.jaxb.version>
|
||||
<dependency.groovy.version>2.5.9</dependency.groovy.version>
|
||||
<dependency.javax.mail.version>1.6.2</dependency.javax.mail.version>
|
||||
<dependency.tika.version>1.21-20190624-alfresco-patched</dependency.tika.version>
|
||||
<dependency.tika.version>1.24.1</dependency.tika.version>
|
||||
<dependency.spring-security.version>5.1.9.RELEASE</dependency.spring-security.version>
|
||||
<dependency.truezip.version>7.7.10</dependency.truezip.version>
|
||||
<dependency.poi.version>4.1.1</dependency.poi.version>
|
||||
<dependency.poi.version>4.1.2</dependency.poi.version>
|
||||
<dependency.ooxml-schemas.version>1.4</dependency.ooxml-schemas.version>
|
||||
<dependency.keycloak.version>9.0.3</dependency.keycloak.version>
|
||||
<dependency.keycloak.version>11.0.0-alfresco-001</dependency.keycloak.version>
|
||||
<dependency.jboss.logging.version>3.4.1.Final</dependency.jboss.logging.version>
|
||||
<dependency.camel.version>2.24.2</dependency.camel.version>
|
||||
<dependency.activemq.version>5.15.11</dependency.activemq.version>
|
||||
<dependency.apache.taglibs.version>1.2.5</dependency.apache.taglibs.version>
|
||||
|
||||
<alfresco.googledrive.version>3.2.0</alfresco.googledrive.version>
|
||||
<alfresco.aos-module.version>1.3.1</alfresco.aos-module.version>
|
||||
<alfresco.aos-module.version>1.3.2-RC1</alfresco.aos-module.version>
|
||||
|
||||
<dependency.postgresql.version>42.2.12</dependency.postgresql.version>
|
||||
<dependency.postgresql.version>42.2.14</dependency.postgresql.version>
|
||||
<dependency.mysql.version>8.0.19</dependency.mysql.version>
|
||||
<dependency.mariadb.version>2.6.0</dependency.mariadb.version>
|
||||
|
||||
<dependency.tas-utility.version>3.0.20</dependency.tas-utility.version>
|
||||
<dependency.tas-utility.version>3.0.21</dependency.tas-utility.version>
|
||||
<dependency.rest-assured.version>3.3.0</dependency.rest-assured.version>
|
||||
<dependency.javax.json.version>1.1.4</dependency.javax.json.version>
|
||||
<dependency.tas-restapi.version>1.33</dependency.tas-restapi.version>
|
||||
<dependency.tas-restapi.version>1.43</dependency.tas-restapi.version>
|
||||
<dependency.tas-cmis.version>1.13</dependency.tas-cmis.version>
|
||||
<dependency.tas-email.version>1.8</dependency.tas-email.version>
|
||||
<dependency.tas-webdav.version>1.6</dependency.tas-webdav.version>
|
||||
@@ -112,7 +112,7 @@
|
||||
<connection>scm:git:https://github.com/Alfresco/alfresco-community-repo.git</connection>
|
||||
<developerConnection>scm:git:https://github.com/Alfresco/alfresco-community-repo.git</developerConnection>
|
||||
<url>https://github.com/Alfresco/alfresco-community-repo</url>
|
||||
<tag>7.183.300-TEST1</tag>
|
||||
<tag>7.302</tag>
|
||||
</scm>
|
||||
|
||||
<distributionManagement>
|
||||
@@ -172,11 +172,6 @@
|
||||
<classifier>win64</classifier>
|
||||
<type>tgz</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-pdf-renderer</artifactId>
|
||||
<version>${dependency.alfresco-pdf-renderer.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-server-root</artifactId>
|
||||
@@ -232,7 +227,7 @@
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
<version>1.2</version>
|
||||
</dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-beanutils</groupId>
|
||||
<artifactId>commons-beanutils</artifactId>
|
||||
@@ -488,12 +483,6 @@
|
||||
<artifactId>xercesImpl</artifactId>
|
||||
<version>${dependency.xercesImpl.version}</version>
|
||||
</dependency>
|
||||
<!-- Newer metadata-extractor, used in TIKA, see ACS-370 -->
|
||||
<dependency>
|
||||
<groupId>com.drewnoakes</groupId>
|
||||
<artifactId>metadata-extractor</artifactId>
|
||||
<version>2.11.0</version>
|
||||
</dependency>
|
||||
<!-- upgrade dependency from TIKA -->
|
||||
<dependency>
|
||||
<groupId>com.github.junrar</groupId>
|
||||
@@ -678,7 +667,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>3.1.1</version>
|
||||
<version>3.2.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
|
@@ -1,41 +0,0 @@
|
||||
### Alfresco Remote API
|
||||
[](https://travis-ci.com/Alfresco/alfresco-remote-api)
|
||||
|
||||
Remote API is a library packaged as a jar file which is part of [Alfresco Content Services Repository](https://community.alfresco.com/docs/DOC-6385-project-overview-repository).
|
||||
The library contains the following:
|
||||
* REST API framework
|
||||
* WebScript implementations including [V1 REST APIs](https://community.alfresco.com/community/ecm/blog/2017/05/02/v1-rest-api-10-things-you-should-know)
|
||||
* [OpenCMIS](https://chemistry.apache.org/java/opencmis.html) implementations
|
||||
|
||||
### Building and testing
|
||||
The project can be built by running Maven command:
|
||||
~~~
|
||||
mvn clean install
|
||||
~~~
|
||||
The tests are combined in test classes split by test type or Spring application context used in the test, see classes in _src/test/java/org/alfresco_. All of these classes as well as individual tests can be run by specifying the test class name and a set of DB connection properties, for example:
|
||||
~~~
|
||||
mvn clean test -Dtest=SomeTest -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql:alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
~~~
|
||||
|
||||
### Artifacts
|
||||
The artifacts can be obtained by:
|
||||
* downloading from [Alfresco repository](https://artifacts.alfresco.com/nexus/content/groups/public)
|
||||
* getting as Maven dependency by adding the dependency to your pom file:
|
||||
~~~
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-remote-api</artifactId>
|
||||
<version>version</version>
|
||||
</dependency>
|
||||
~~~
|
||||
and Alfresco Maven repository:
|
||||
~~~
|
||||
<repository>
|
||||
<id>alfresco-maven-repo</id>
|
||||
<url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
|
||||
</repository>
|
||||
~~~
|
||||
The SNAPSHOT version of the artifact is **never** published.
|
||||
|
||||
### Contributing guide
|
||||
Please use [this guide](CONTRIBUTING.md) to make a contribution to the project.
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>7.183.300-TEST1</version>
|
||||
<version>7.302</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
@@ -24,28 +24,23 @@
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-core</artifactId>
|
||||
<version>${dependency.jackson.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
<version>${dependency.jackson-databind.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-annotations</artifactId>
|
||||
<version>${dependency.jackson.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>3.0.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-csv</artifactId>
|
||||
<version>1.8</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.santuario</groupId>
|
||||
@@ -56,7 +51,6 @@
|
||||
<dependency>
|
||||
<groupId>org.alfresco.surf</groupId>
|
||||
<artifactId>spring-webscripts</artifactId>
|
||||
<version>${dependency.webscripts.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.xml</groupId>
|
||||
@@ -78,19 +72,16 @@
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.13</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<version>3.3.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-test</artifactId>
|
||||
<version>${dependency.spring.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -110,14 +101,12 @@
|
||||
<dependency>
|
||||
<groupId>org.alfresco.surf</groupId>
|
||||
<artifactId>spring-webscripts</artifactId>
|
||||
<version>${dependency.webscripts.version}</version>
|
||||
<classifier>tests</classifier>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<version>${dependency.postgresql.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -158,7 +147,6 @@
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-pdf-renderer</artifactId>
|
||||
<version>${dependency.alfresco-pdf-renderer.version}</version>
|
||||
<classifier>win64</classifier>
|
||||
<type>tgz</type>
|
||||
</dependency>
|
||||
@@ -203,7 +191,6 @@
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-pdf-renderer</artifactId>
|
||||
<version>${dependency.alfresco-pdf-renderer.version}</version>
|
||||
<classifier>linux</classifier>
|
||||
<type>tgz</type>
|
||||
</dependency>
|
||||
@@ -240,54 +227,6 @@
|
||||
<alfresco-pdf-renderer.exe>${project.build.directory}/test-binaries/alfresco-pdf-renderer/alfresco-pdf-renderer</alfresco-pdf-renderer.exe>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>osx-alfresco-pdf-renderer-test</id>
|
||||
<activation>
|
||||
<os>
|
||||
<family>mac</family>
|
||||
</os>
|
||||
</activation>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-pdf-renderer</artifactId>
|
||||
<version>${dependency.alfresco-pdf-renderer.version}</version>
|
||||
<classifier>osx</classifier>
|
||||
<type>tgz</type>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<inherited>false</inherited>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>extract-alfresco-pdf-renderer-test</id>
|
||||
<phase>generate-test-resources</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<skip>${skipTests}</skip>
|
||||
<target>
|
||||
<echo message="Extracting alfresco-pdf-renderer (OS-X) for testing..." />
|
||||
<mkdir dir="${project.build.directory}/test-binaries/alfresco-pdf-renderer" />
|
||||
<exec failonerror="true" executable="tar" dir="${project.build.directory}/test-binaries/alfresco-pdf-renderer">
|
||||
<arg value="xf" />
|
||||
<arg value="${settings.localRepository}/org/alfresco/alfresco-pdf-renderer/${dependency.alfresco-pdf-renderer.version}/alfresco-pdf-renderer-${dependency.alfresco-pdf-renderer.version}-osx.tgz" />
|
||||
</exec>
|
||||
</target>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<properties>
|
||||
<alfresco-pdf-renderer.exe>${project.build.directory}/test-binaries/alfresco-pdf-renderer/alfresco-pdf-renderer</alfresco-pdf-renderer.exe>
|
||||
</properties>
|
||||
</profile>
|
||||
</profiles>
|
||||
<build>
|
||||
<pluginManagement>
|
||||
|
@@ -438,7 +438,7 @@ import org.springframework.extensions.webscripts.json.JSONUtils;
|
||||
{
|
||||
public String convert(ChildAssociationRef source)
|
||||
{
|
||||
return source.toString();
|
||||
return org.json.simple.JSONObject.escape(source.toString());
|
||||
}
|
||||
});
|
||||
|
||||
@@ -454,7 +454,7 @@ import org.springframework.extensions.webscripts.json.JSONUtils;
|
||||
{
|
||||
public String convert(AssociationRef source)
|
||||
{
|
||||
return source.toString();
|
||||
return org.json.simple.JSONObject.escape(source.toString());
|
||||
}
|
||||
});
|
||||
|
||||
|
@@ -366,7 +366,22 @@ public abstract class BaseKerberosAuthenticationFilter extends BaseSSOAuthentica
|
||||
}
|
||||
|
||||
// Send back a request for SPNEGO authentication
|
||||
logonStartAgain(context, req, resp, true);
|
||||
|
||||
// MNT-21702 fixing Kerberos SSO fallback machanism for WebDAV
|
||||
if (req.getRequestURL().toString().contains("webdav"))
|
||||
{
|
||||
if ( getLogger().isDebugEnabled()) {
|
||||
getLogger().debug("WebDAV request, fallback");
|
||||
}
|
||||
logonStartAgain(context, req, resp, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( getLogger().isDebugEnabled()) {
|
||||
getLogger().debug("Non-WebDAV request, don't fallback");
|
||||
}
|
||||
logonStartAgain(context, req, resp, true);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@@ -52,6 +52,7 @@ import org.alfresco.repo.security.authentication.AuthenticationException;
|
||||
import org.alfresco.repo.web.auth.WebCredentials;
|
||||
import org.alfresco.repo.web.filter.beans.DependencyInjectedFilter;
|
||||
import org.alfresco.rest.api.PublicApiTenantWebScriptServletRequest;
|
||||
import org.alfresco.rest.framework.core.exceptions.NotFoundException;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.extensions.webscripts.RuntimeContainer;
|
||||
@@ -201,7 +202,16 @@ public abstract class BaseSSOAuthenticationFilter extends BaseAuthenticationFilt
|
||||
// Get the HTTP request/response
|
||||
HttpServletRequest req = (HttpServletRequest) request;
|
||||
|
||||
Match match = container.getRegistry().findWebScript(req.getMethod(), getScriptUrl(req));
|
||||
Match match = null;
|
||||
|
||||
try
|
||||
{
|
||||
match = container.getRegistry().findWebScript(req.getMethod(), getScriptUrl(req));
|
||||
}
|
||||
catch (NotFoundException | IllegalArgumentException Ex)
|
||||
{
|
||||
getLogger().debug(req.getMethod() + " " + getScriptUrl(req) + "not found in Public API Container.");
|
||||
}
|
||||
|
||||
// If a filter up the chain has marked the request as not requiring auth then respect it
|
||||
if (request.getAttribute(NO_AUTH_REQUIRED) != null)
|
||||
|
@@ -280,21 +280,28 @@ public class AuditImpl implements Audit
|
||||
|
||||
// clear null elements
|
||||
entriesAudit.removeAll(Collections.singleton(null));
|
||||
int totalItems = entriesAudit.size();
|
||||
int totalRetrievedItems = entriesAudit.size();
|
||||
int end = Math.min(limit - 1, totalRetrievedItems);
|
||||
boolean hasMoreItems = totalRetrievedItems > end;
|
||||
|
||||
if (skipCount >= totalItems)
|
||||
String omitTotalItemsParameter = parameters.getParameter("omitTotalItems");
|
||||
boolean omitTotalItems = (null != omitTotalItemsParameter) && Boolean.parseBoolean(omitTotalItemsParameter);
|
||||
|
||||
Integer totalItems;
|
||||
|
||||
if (omitTotalItems)
|
||||
{
|
||||
List<AuditEntry> empty = Collections.emptyList();
|
||||
return CollectionWithPagingInfo.asPaged(paging, empty, false, totalItems);
|
||||
totalItems = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
int end = Math.min(limit - 1, totalItems);
|
||||
boolean hasMoreItems = totalItems > end;
|
||||
|
||||
entriesAudit = entriesAudit.subList(skipCount, end);
|
||||
return CollectionWithPagingInfo.asPaged(paging, entriesAudit, hasMoreItems, totalItems);
|
||||
totalItems = hasMoreItems ? getAuditEntriesCountByApp(auditApplication) : totalRetrievedItems;
|
||||
}
|
||||
|
||||
entriesAudit = (skipCount >= totalRetrievedItems)
|
||||
? Collections.emptyList()
|
||||
: entriesAudit.subList(skipCount, end);
|
||||
return CollectionWithPagingInfo.asPaged(paging, entriesAudit, hasMoreItems, totalItems);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -882,4 +889,10 @@ public class AuditImpl implements Audit
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public int getAuditEntriesCountByApp(AuditService.AuditApplication auditApplication)
|
||||
{
|
||||
final String applicationName = auditApplication.getKey().substring(1);
|
||||
return auditService.getAuditEntriesCountByApp(applicationName);
|
||||
}
|
||||
}
|
||||
|
@@ -82,9 +82,8 @@ public class JacksonHelper implements InitializingBean
|
||||
//Configure the objectMapper ready for use
|
||||
objectMapper = new ObjectMapper();
|
||||
objectMapper.registerModule(module);
|
||||
objectMapper.setDefaultPropertyInclusion(JsonInclude.Include.NON_EMPTY);
|
||||
objectMapper.configOverride(java.util.Map.class)
|
||||
.setInclude(JsonInclude.Value.construct(JsonInclude.Include.NON_EMPTY, null));
|
||||
objectMapper.setDefaultPropertyInclusion(
|
||||
JsonInclude.Value.construct(JsonInclude.Include.NON_EMPTY, JsonInclude.Include.ALWAYS));
|
||||
objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
|
||||
DateFormat DATE_FORMAT_ISO8601 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
|
||||
DATE_FORMAT_ISO8601.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||
|
@@ -4,57 +4,121 @@
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2016 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.repo.web.scripts.solr;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.web.scripts.solr.SOLRSerializer.SOLRTypeConverter;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
import org.alfresco.service.cmr.repository.AssociationRef;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.util.ISO8601DateFormat;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
import org.junit.Test;
|
||||
import org.mockito.Mockito;
|
||||
|
||||
public class SOLRSerializerTest
|
||||
public class SOLRSerializerTest
|
||||
{
|
||||
@Test
|
||||
@Test
|
||||
public void testDateSerializer()
|
||||
{
|
||||
SOLRTypeConverter typeConverter = new SOLRTypeConverter(null);
|
||||
|
||||
trip(typeConverter, "1912-01-01T00:40:00-06:00", "1912-01-01T06:40:00.000Z");
|
||||
trip(typeConverter, "1812-01-01T00:40:00-06:00", "1812-01-01T06:40:00.000Z");
|
||||
trip(typeConverter, "1845-01-01T00:40:00-06:00", "1845-01-01T06:40:00.000Z");
|
||||
trip(typeConverter, "1846-01-01T00:40:00-06:00", "1846-01-01T06:40:00.000Z");
|
||||
trip(typeConverter, "1847-01-01T00:40:00-06:00", "1847-01-01T06:40:00.000Z");
|
||||
trip(typeConverter, "1848-01-01T00:40:00-06:00", "1848-01-01T06:40:00.000Z");
|
||||
|
||||
|
||||
SOLRTypeConverter typeConverter = new SOLRTypeConverter(null);
|
||||
|
||||
trip(typeConverter, "1912-01-01T00:40:00-06:00", "1912-01-01T06:40:00.000Z");
|
||||
trip(typeConverter, "1812-01-01T00:40:00-06:00", "1812-01-01T06:40:00.000Z");
|
||||
trip(typeConverter, "1845-01-01T00:40:00-06:00", "1845-01-01T06:40:00.000Z");
|
||||
trip(typeConverter, "1846-01-01T00:40:00-06:00", "1846-01-01T06:40:00.000Z");
|
||||
trip(typeConverter, "1847-01-01T00:40:00-06:00", "1847-01-01T06:40:00.000Z");
|
||||
trip(typeConverter, "1848-01-01T00:40:00-06:00", "1848-01-01T06:40:00.000Z");
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void trip( SOLRTypeConverter typeConverter, String iso, String zulu)
|
||||
{
|
||||
Date testDate = ISO8601DateFormat.parse(iso);
|
||||
String strDate = typeConverter.INSTANCE.convert(String.class, testDate);
|
||||
assertEquals(zulu, strDate);
|
||||
}
|
||||
|
||||
private void trip(SOLRTypeConverter typeConverter, String iso, String zulu)
|
||||
{
|
||||
Date testDate = ISO8601DateFormat.parse(iso);
|
||||
String strDate = typeConverter.INSTANCE.convert(String.class, testDate);
|
||||
assertEquals(zulu, strDate);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test SOLR Serialization including values with special characters for ChildAssociationRef
|
||||
*/
|
||||
@Test
|
||||
public void testChildAssociationRefToJSONString()
|
||||
{
|
||||
SOLRSerializer solrSerializer = new SOLRSerializer();
|
||||
solrSerializer.setDictionaryService(Mockito.mock(DictionaryService.class));
|
||||
solrSerializer.setNamespaceService(Mockito.mock(NamespaceService.class));
|
||||
solrSerializer.init();
|
||||
|
||||
// Create a Child QName including special character \
|
||||
QName childQName = QName.createQName("hello", "wo\rld");
|
||||
|
||||
ChildAssociationRef childAssociationRef = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS,
|
||||
new NodeRef("workspace://SpacesStore/parent"), childQName,
|
||||
new NodeRef("workspace://SpacesStore/child"));
|
||||
String validJsonString = solrSerializer.serializeToJSONString(childAssociationRef);
|
||||
String jsonObjectString = String.format("{ \"key\": \"%s\" }", validJsonString);
|
||||
|
||||
try
|
||||
{
|
||||
new JSONObject(jsonObjectString);
|
||||
}
|
||||
catch (JSONException e)
|
||||
{
|
||||
assertTrue("JSON String " + jsonObjectString + " is not a valid JSON", false);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test SOLR Serialization including values with special characters for AssociationRef
|
||||
*/
|
||||
@Test
|
||||
public void testAssociationRefToJSONString()
|
||||
{
|
||||
SOLRSerializer solrSerializer = new SOLRSerializer();
|
||||
solrSerializer.setDictionaryService(Mockito.mock(DictionaryService.class));
|
||||
solrSerializer.setNamespaceService(Mockito.mock(NamespaceService.class));
|
||||
solrSerializer.init();
|
||||
AssociationRef associationRef = new AssociationRef(
|
||||
new NodeRef("workspace://SpacesStore/wo\rld"),
|
||||
ContentModel.ASSOC_ATTACHMENTS,
|
||||
new NodeRef("workspace://SpacesStore/hello"));
|
||||
String validJsonString = solrSerializer.serializeToJSONString(associationRef);
|
||||
String jsonObjectString = String.format("{ \"key\": \"%s\" }", validJsonString);
|
||||
|
||||
try
|
||||
{
|
||||
new JSONObject(jsonObjectString);
|
||||
}
|
||||
catch (JSONException e)
|
||||
{
|
||||
assertTrue("JSON String " + jsonObjectString + " is not a valid JSON", false);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -26,6 +26,7 @@
|
||||
package org.alfresco.rest.api.tests;
|
||||
|
||||
import static org.alfresco.rest.api.tests.util.RestApiUtil.toJsonAsStringNonNull;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
@@ -405,6 +406,31 @@ public class AuditAppTest extends AbstractSingleNetworkSiteTest
|
||||
validateAuditEntryFields(ae, auditApp);
|
||||
}
|
||||
|
||||
// MNT-21936 Audit query Rest API does not return the correct totalItems
|
||||
int auditEntriesTotalItems = auditEntries.getPaging().getTotalItems();
|
||||
|
||||
// set maxItems to 1
|
||||
Map<String, String> params = new HashMap<>();
|
||||
params.put("maxItems","1");
|
||||
|
||||
auditEntries = auditAppsProxy.getAuditAppEntries(auditApp.getId(), params,
|
||||
HttpServletResponse.SC_OK);
|
||||
|
||||
int AuditEntriesTotalItemsAfterLimit = auditEntries.getPaging().getTotalItems();
|
||||
int retrievedAuditEntriesCount = auditEntries.getPaging().getCount();
|
||||
// When totalItems are retrieved using getAuditEntriesCountByApp() method that was introduced in MNT-21936
|
||||
// 2 audit entries will be created.
|
||||
assertEquals(auditEntriesTotalItems + 2, AuditEntriesTotalItemsAfterLimit);
|
||||
assertEquals(1, retrievedAuditEntriesCount);
|
||||
|
||||
// set omitTotalItems to true.
|
||||
params.put("omitTotalItems", "true");
|
||||
auditEntries = auditAppsProxy.getAuditAppEntries(auditApp.getId(), params,
|
||||
HttpServletResponse.SC_OK);
|
||||
|
||||
// verify that totalItems is null.
|
||||
assertNull(auditEntries.getPaging().getTotalItems());
|
||||
|
||||
// Negative tests
|
||||
// 401
|
||||
setRequestContext(networkOne.getId(), networkAdmin, "wrongPassword");
|
||||
|
@@ -1,41 +0,0 @@
|
||||
### Alfresco Repository
|
||||
[](https://travis-ci.com/Alfresco/alfresco-repository)
|
||||
|
||||
Repository is a library packaged as a jar file which is part of [Alfresco Content Services Repository](https://community.alfresco.com/docs/DOC-6385-project-overview-repository).
|
||||
The library contains the following:
|
||||
* DAOs and SQL scripts
|
||||
* Various Service implementations
|
||||
* Utility classes
|
||||
|
||||
### Building and testing
|
||||
The project can be built by running Maven command:
|
||||
~~~
|
||||
mvn clean install
|
||||
~~~
|
||||
The tests are combined in test classes split by test type or Spring application context used in the test, see classes in _src/test/java/org/alfresco_. All of these classes as well as individual tests can be run by specifying the test class name and a set of DB connection properties, for example:
|
||||
~~~
|
||||
mvn clean test -Dtest=SomeRepoTest -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql:alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
~~~
|
||||
|
||||
### Artifacts
|
||||
The artifacts can be obtained by:
|
||||
* downloading from [Alfresco repository](https://artifacts.alfresco.com/nexus/content/groups/public)
|
||||
* getting as Maven dependency by adding the dependency to your pom file:
|
||||
~~~
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-repository</artifactId>
|
||||
<version>version</version>
|
||||
</dependency>
|
||||
~~~
|
||||
and Alfresco Maven repository:
|
||||
~~~
|
||||
<repository>
|
||||
<id>alfresco-maven-repo</id>
|
||||
<url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
|
||||
</repository>
|
||||
~~~
|
||||
The SNAPSHOT version of the artifact is **never** published.
|
||||
|
||||
### Contributing guide
|
||||
Please use [this guide](CONTRIBUTING.md) to make a contribution to the project.
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>7.183.300-TEST1</version>
|
||||
<version>7.302</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
@@ -19,7 +19,6 @@
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-jlan-embed</artifactId>
|
||||
<version>${dependency.alfresco-jlan.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>*</groupId>
|
||||
@@ -40,7 +39,6 @@
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-heartbeat-data-sender</artifactId>
|
||||
<version>${dependency.alfresco-hb-data-sender.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sun.mail</groupId>
|
||||
@@ -55,12 +53,10 @@
|
||||
<dependency>
|
||||
<groupId>commons-dbcp</groupId>
|
||||
<artifactId>commons-dbcp</artifactId>
|
||||
<version>1.4-DBCP330</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-fileupload</groupId>
|
||||
<artifactId>commons-fileupload</artifactId>
|
||||
<version>1.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
@@ -86,7 +82,6 @@
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-pool</groupId>
|
||||
@@ -126,7 +121,6 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-core</artifactId>
|
||||
<version>${dependency.spring.version}</version>
|
||||
<!-- exclude spring-jcl which is brought in by spring-core -->
|
||||
<!-- see https://issues.alfresco.com/jira/browse/REPO-4774 -->
|
||||
<exclusions>
|
||||
@@ -139,7 +133,6 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-orm</artifactId>
|
||||
<version>${dependency.spring.version}</version>
|
||||
<!-- exclude spring-jcl which is brought in by spring-orm -->
|
||||
<!-- see https://issues.alfresco.com/jira/browse/REPO-4774 -->
|
||||
<exclusions>
|
||||
@@ -152,17 +145,14 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context</artifactId>
|
||||
<version>${dependency.spring.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context-support</artifactId>
|
||||
<version>${dependency.spring.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-web</artifactId>
|
||||
<version>${dependency.spring.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.subethamail</groupId>
|
||||
@@ -215,22 +205,18 @@
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
<version>1.7.30</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
<version>1.7.30</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>xerces</groupId>
|
||||
<artifactId>xercesImpl</artifactId>
|
||||
<version>2.12.0-alfresco-patched-20191004</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>xalan</groupId>
|
||||
<artifactId>xalan</artifactId>
|
||||
<version>2.7.2-alfresco</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>xml-apis</groupId>
|
||||
@@ -271,7 +257,6 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.pdfbox</groupId>
|
||||
<artifactId>pdfbox</artifactId>
|
||||
<version>${dependency.pdfbox.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.pdfbox</groupId>
|
||||
@@ -342,7 +327,6 @@
|
||||
<dependency>
|
||||
<groupId>joda-time</groupId>
|
||||
<artifactId>joda-time</artifactId>
|
||||
<version>2.10.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jaxen</groupId>
|
||||
@@ -379,7 +363,6 @@
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>3.0.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -392,19 +375,16 @@
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
<version>${dependency.jackson-databind.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Spring Surf -->
|
||||
<dependency>
|
||||
<groupId>org.alfresco.surf</groupId>
|
||||
<artifactId>spring-surf-core-configservice</artifactId>
|
||||
<version>${dependency.webscripts.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.alfresco.surf</groupId>
|
||||
<artifactId>spring-webscripts</artifactId>
|
||||
<version>${dependency.webscripts.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.sun</groupId>
|
||||
@@ -427,7 +407,6 @@
|
||||
<dependency>
|
||||
<groupId>org.alfresco.surf</groupId>
|
||||
<artifactId>spring-webscripts-api</artifactId>
|
||||
<version>${dependency.webscripts.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Chemistry -->
|
||||
@@ -451,7 +430,6 @@
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>28.2-jre</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
@@ -467,8 +445,7 @@
|
||||
<dependency>
|
||||
<groupId>org.quartz-scheduler</groupId>
|
||||
<artifactId>quartz</artifactId>
|
||||
<version>2.3.2</version>
|
||||
<exclusions>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.mchange</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
@@ -801,19 +778,16 @@
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<version>3.3.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-test</artifactId>
|
||||
<version>${dependency.spring.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.13</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -852,19 +826,16 @@
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<version>${dependency.postgresql.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>${dependency.mysql.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mariadb.jdbc</groupId>
|
||||
<artifactId>mariadb-java-client</artifactId>
|
||||
<version>${dependency.mariadb.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -876,13 +847,11 @@
|
||||
<dependency>
|
||||
<groupId>org.antlr</groupId>
|
||||
<artifactId>gunit</artifactId>
|
||||
<version>${dependency.antlr.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.alfresco.surf</groupId>
|
||||
<artifactId>spring-webscripts</artifactId>
|
||||
<version>${dependency.webscripts.version}</version>
|
||||
<classifier>tests</classifier>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
@@ -940,7 +909,6 @@
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-pdf-renderer</artifactId>
|
||||
<version>${dependency.alfresco-pdf-renderer.version}</version>
|
||||
<classifier>win64</classifier>
|
||||
<type>tgz</type>
|
||||
</dependency>
|
||||
@@ -985,7 +953,6 @@
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-pdf-renderer</artifactId>
|
||||
<version>${dependency.alfresco-pdf-renderer.version}</version>
|
||||
<classifier>linux</classifier>
|
||||
<type>tgz</type>
|
||||
</dependency>
|
||||
@@ -1022,54 +989,6 @@
|
||||
<alfresco-pdf-renderer.exe>${project.build.directory}/test-binaries/alfresco-pdf-renderer/alfresco-pdf-renderer</alfresco-pdf-renderer.exe>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>osx-alfresco-pdf-renderer-test</id>
|
||||
<activation>
|
||||
<os>
|
||||
<family>mac</family>
|
||||
</os>
|
||||
</activation>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-pdf-renderer</artifactId>
|
||||
<version>${dependency.alfresco-pdf-renderer.version}</version>
|
||||
<classifier>osx</classifier>
|
||||
<type>tgz</type>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<inherited>false</inherited>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>extract-alfresco-pdf-renderer-test</id>
|
||||
<phase>generate-test-resources</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<skip>${skipTests}</skip>
|
||||
<target>
|
||||
<echo message="Extracting alfresco-pdf-renderer (OS-X) for testing..." />
|
||||
<mkdir dir="${project.build.directory}/test-binaries/alfresco-pdf-renderer" />
|
||||
<exec failonerror="true" executable="tar" dir="${project.build.directory}/test-binaries/alfresco-pdf-renderer">
|
||||
<arg value="xf" />
|
||||
<arg value="${settings.localRepository}/org/alfresco/alfresco-pdf-renderer/${dependency.alfresco-pdf-renderer.version}/alfresco-pdf-renderer-${dependency.alfresco-pdf-renderer.version}-osx.tgz" />
|
||||
</exec>
|
||||
</target>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<properties>
|
||||
<alfresco-pdf-renderer.exe>${project.build.directory}/test-binaries/alfresco-pdf-renderer/alfresco-pdf-renderer</alfresco-pdf-renderer.exe>
|
||||
</properties>
|
||||
</profile>
|
||||
|
||||
</profiles>
|
||||
|
||||
|
@@ -81,22 +81,19 @@ public class TransactionAwareHolder<T> extends Holder<T>
|
||||
{
|
||||
this.internalHolder = internalHolder;
|
||||
this.value = internalHolder.getValue();
|
||||
txListener = new TxAwareHolderListener();
|
||||
}
|
||||
|
||||
@Override
|
||||
public T getValue()
|
||||
{
|
||||
if (TransactionSynchronizationManager.isSynchronizationActive())
|
||||
{
|
||||
AlfrescoTransactionSupport.bindListener(txListener);
|
||||
}
|
||||
registerTxListenerIfNeeded();
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(T value)
|
||||
{
|
||||
registerTxListenerIfNeeded();
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@@ -109,6 +106,17 @@ public class TransactionAwareHolder<T> extends Holder<T>
|
||||
'}';
|
||||
}
|
||||
|
||||
// MNT-21800 CMIS Web Service Check Out returns error
|
||||
private void registerTxListenerIfNeeded()
|
||||
{
|
||||
if (this.txListener == null && TransactionSynchronizationManager.isSynchronizationActive())
|
||||
{
|
||||
TxAwareHolderListener listener = new TxAwareHolderListener();
|
||||
AlfrescoTransactionSupport.bindListener(listener);
|
||||
this.txListener = listener;
|
||||
}
|
||||
}
|
||||
|
||||
private class TxAwareHolderListener extends TransactionListenerAdapter
|
||||
{
|
||||
@Override
|
||||
|
@@ -177,13 +177,13 @@ public class CMISResultSetRow implements ResultSetRow
|
||||
context.setScore(getScore());
|
||||
for (Column column : query.getColumns())
|
||||
{
|
||||
// When an SCORE selector is included, score must be adapted to range 0..1 due to CMIS specification
|
||||
if (column.getFunction()!= null && column.getFunction().getName().equals(Score.NAME))
|
||||
{
|
||||
return getNormalisedScore();
|
||||
}
|
||||
else if (column.getAlias().equals(columnName))
|
||||
if (column.getAlias().equals(columnName))
|
||||
{
|
||||
//When an SCORE selector is included, score must be adapted to range 0..1 due to CMIS specification
|
||||
if (column.getFunction()!= null && column.getFunction().getName().equals(Score.NAME))
|
||||
{
|
||||
return getNormalisedScore();
|
||||
}
|
||||
return column.getFunction().getValue(column.getFunctionArguments(), context);
|
||||
}
|
||||
// Special case for one selector - ignore any table aliases
|
||||
|
@@ -261,4 +261,15 @@ public interface AuditComponent
|
||||
* @return a map containing min/max and the associated value
|
||||
*/
|
||||
HashMap<String, Long> getAuditMinMaxByApp(String applicationName, List<String> extremes);
|
||||
|
||||
/**
|
||||
* Issue an audit query to retrieve count of records for a given application.
|
||||
*
|
||||
* @param applicationName the name of the application
|
||||
* @return a map containing min/max and the associated value
|
||||
*/
|
||||
default int getAuditEntriesCountByApp(String applicationName)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
@@ -941,4 +941,18 @@ public class AuditComponentImpl implements AuditComponent
|
||||
|
||||
return auditDAO.getAuditMinMaxByApp(applicationId, extremes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAuditEntriesCountByApp(String applicationName)
|
||||
{
|
||||
// Get the id for the application
|
||||
AuditApplication app = auditModelRegistry.getAuditApplicationByName(applicationName);
|
||||
Long applicationId = app.getApplicationId();
|
||||
if (applicationId == null)
|
||||
{
|
||||
throw new AuditException("No persisted instance exists for audit application: " + app);
|
||||
}
|
||||
|
||||
return auditDAO.getAuditEntriesCountByApp(applicationId);
|
||||
}
|
||||
}
|
||||
|
@@ -177,4 +177,13 @@ public class AuditServiceImpl implements AuditService
|
||||
{
|
||||
return auditComponent.getAuditMinMaxByApp(applicationName, extremes);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public int getAuditEntriesCountByApp(String applicationName)
|
||||
{
|
||||
return auditComponent.getAuditEntriesCountByApp(applicationName);
|
||||
}
|
||||
}
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2016 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
@@ -36,6 +36,8 @@ import org.apache.tika.parser.dwg.DWGParser;
|
||||
|
||||
|
||||
/**
|
||||
* @deprecated OOTB extractors are being moved to T-Engines.
|
||||
*
|
||||
* Metadata extractor for the
|
||||
* {@link org.alfresco.repo.content.MimetypeMap#MIMETYPE_APP_DWG MIMETYPE_APP_DWG}
|
||||
* and
|
||||
@@ -55,6 +57,7 @@ import org.apache.tika.parser.dwg.DWGParser;
|
||||
* @since 3.4
|
||||
* @author Nick Burch
|
||||
*/
|
||||
@Deprecated
|
||||
public class DWGMetadataExtracter extends TikaPoweredMetadataExtracter
|
||||
{
|
||||
private static final String KEY_KEYWORD = "keyword";
|
||||
|
@@ -24,7 +24,7 @@
|
||||
* #L%
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2005 Jesper Steen Møller
|
||||
* Copyright (C) 2005 - 2020 Jesper Steen Møller
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
@@ -61,6 +61,8 @@ import org.alfresco.repo.content.MimetypeMap;
|
||||
import org.alfresco.service.cmr.repository.ContentReader;
|
||||
|
||||
/**
|
||||
* @deprecated OOTB extractors are being moved to T-Engines.
|
||||
*
|
||||
* Extracts the following values from HTML documents:
|
||||
* <pre>
|
||||
* <b>author:</b> -- cm:author
|
||||
@@ -75,6 +77,7 @@ import org.alfresco.service.cmr.repository.ContentReader;
|
||||
* @author Jesper Steen Møller
|
||||
* @author Derek Hulley
|
||||
*/
|
||||
@Deprecated
|
||||
public class HtmlMetadataExtracter extends AbstractMappingMetadataExtracter
|
||||
{
|
||||
private static final String KEY_AUTHOR = "author";
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2017 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
@@ -39,6 +39,8 @@ import org.alfresco.service.cmr.repository.ContentReader;
|
||||
import org.alfresco.util.PropertyCheck;
|
||||
|
||||
/**
|
||||
* @deprecated OOTB extractors are being moved to T-Engines.
|
||||
*
|
||||
* Extracts values from Open Office documents into the following:
|
||||
* <pre>
|
||||
* <b>author:</b> -- cm:author
|
||||
@@ -48,6 +50,7 @@ import org.alfresco.util.PropertyCheck;
|
||||
*
|
||||
* @author Neil McErlean
|
||||
*/
|
||||
@Deprecated
|
||||
public class JodConverterMetadataExtracter extends AbstractMappingMetadataExtracter implements OpenOfficeMetadataWorker
|
||||
{
|
||||
private OpenOfficeMetadataWorker worker;
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2017 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
@@ -59,6 +59,10 @@ import com.sun.star.util.CloseVetoException;
|
||||
import com.sun.star.util.XCloseable;
|
||||
import com.sun.star.util.XRefreshable;
|
||||
|
||||
/**
|
||||
* @deprecated OOTB extractors are being moved to T-Engines.
|
||||
*/
|
||||
@Deprecated
|
||||
public class JodConverterMetadataExtracterWorker implements
|
||||
OpenOfficeMetadataWorker
|
||||
{
|
||||
@@ -120,6 +124,7 @@ public class JodConverterMetadataExtracterWorker implements
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
class ExtractMetadataOfficeTask implements OfficeTask
|
||||
{
|
||||
/*
|
||||
@@ -259,6 +264,7 @@ class ExtractMetadataOfficeTask implements OfficeTask
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
class ResultsCallback
|
||||
{
|
||||
private Map<String, Serializable> results = new HashMap<String, Serializable>();
|
||||
|
@@ -1,28 +1,28 @@
|
||||
/*
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2016 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
/*
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.repo.content.metadata;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -36,6 +36,8 @@ import org.apache.tika.parser.Parser;
|
||||
import org.apache.tika.parser.mp3.Mp3Parser;
|
||||
|
||||
/**
|
||||
* @deprecated OOTB extractors are being moved to T-Engines.
|
||||
*
|
||||
* Extracts the following values from MP3 files:
|
||||
* <pre>
|
||||
* <b>songTitle:</b> -- cm:title
|
||||
@@ -57,6 +59,7 @@ import org.apache.tika.parser.mp3.Mp3Parser;
|
||||
*
|
||||
* @author Nick Burch
|
||||
*/
|
||||
@Deprecated
|
||||
public class MP3MetadataExtracter extends TikaAudioMetadataExtracter
|
||||
{
|
||||
private static final String KEY_SONG_TITLE = "songTitle";
|
||||
|
@@ -1,28 +1,28 @@
|
||||
/*
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2016 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
/*
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.repo.content.metadata;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -35,6 +35,8 @@ import org.apache.tika.parser.Parser;
|
||||
import org.apache.tika.parser.microsoft.OfficeParser;
|
||||
|
||||
/**
|
||||
* @deprecated OOTB extractors are being moved to T-Engines.
|
||||
*
|
||||
* Outlook MAPI format email meta-data extractor extracting the following values:
|
||||
* <pre>
|
||||
* <b>sentDate:</b> -- cm:sentdate
|
||||
@@ -53,6 +55,7 @@ import org.apache.tika.parser.microsoft.OfficeParser;
|
||||
* @since 2.1
|
||||
* @author Kevin Roast
|
||||
*/
|
||||
@Deprecated
|
||||
public class MailMetadataExtracter extends TikaPoweredMetadataExtracter
|
||||
{
|
||||
private static final String KEY_SENT_DATE = "sentDate";
|
||||
|
@@ -1,28 +1,28 @@
|
||||
/*
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2016 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
/*
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.repo.content.metadata;
|
||||
|
||||
import java.util.List;
|
||||
@@ -31,11 +31,14 @@ import org.apache.tika.extractor.DocumentSelector;
|
||||
import org.apache.tika.metadata.Metadata;
|
||||
|
||||
/**
|
||||
* @deprecated OOTB extractors are being moved to T-Engines.
|
||||
*
|
||||
* Tika 1.6 has the ability to parse embedded artifacts, such as images in a PDF,
|
||||
* but this can be very resource intensive so adding this selector
|
||||
* to parsers and transformers that handle formats with embedded artifacts
|
||||
* will disable parsing of the specified content types.
|
||||
*/
|
||||
@Deprecated
|
||||
public class MediaTypeDisablingDocumentSelector implements DocumentSelector
|
||||
{
|
||||
private List<String> disabledMediaTypes;
|
||||
|
@@ -1,30 +1,30 @@
|
||||
/*
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2016 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2005 Jesper Steen Møller
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2005 - 2020 Jesper Steen Møller
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
@@ -53,6 +53,8 @@ import org.apache.tika.parser.Parser;
|
||||
import org.apache.tika.parser.microsoft.OfficeParser;
|
||||
|
||||
/**
|
||||
* @deprecated OOTB extractors are being moved to T-Engines.
|
||||
*
|
||||
* Office file format Metadata Extracter. This extracter uses the POI library to extract
|
||||
* the following:
|
||||
* <pre>
|
||||
@@ -78,6 +80,7 @@ import org.apache.tika.parser.microsoft.OfficeParser;
|
||||
* @author Derek Hulley
|
||||
* @author Nick Burch
|
||||
*/
|
||||
@Deprecated
|
||||
public class OfficeMetadataExtracter extends TikaPoweredMetadataExtracter
|
||||
{
|
||||
public static final String KEY_CREATE_DATETIME = "createDateTime";
|
||||
|
@@ -1,30 +1,30 @@
|
||||
/*
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2016 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2005 Antti Jokipii
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2016 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2005 - 2020 Antti Jokipii
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
@@ -59,6 +59,8 @@ import org.joda.time.format.DateTimeFormatter;
|
||||
|
||||
|
||||
/**
|
||||
* @deprecated OOTB extractors are being moved to T-Engines.
|
||||
*
|
||||
* Metadata extractor for the
|
||||
* {@link org.alfresco.repo.content.MimetypeMap#MIMETYPE_OPENDOCUMENT_TEXT MIMETYPE_OPENDOCUMENT_XXX}
|
||||
* mimetypes.
|
||||
@@ -86,6 +88,7 @@ import org.joda.time.format.DateTimeFormatter;
|
||||
* @author Antti Jokipii
|
||||
* @author Derek Hulley
|
||||
*/
|
||||
@Deprecated
|
||||
public class OpenDocumentMetadataExtracter extends TikaPoweredMetadataExtracter
|
||||
{
|
||||
private static final String KEY_CREATION_DATE = "creationDate";
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2016 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
@@ -23,28 +23,31 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.repo.content.metadata;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.service.cmr.repository.ContentReader;
|
||||
|
||||
/**
|
||||
* An interface that allows separation between the metadata extractor registry and the third party subsystem owning the
|
||||
* open office connection.
|
||||
*
|
||||
* @author dward
|
||||
*/
|
||||
public interface OpenOfficeMetadataWorker
|
||||
{
|
||||
/**
|
||||
* @return Returns true if a connection to the Uno server could be established
|
||||
*/
|
||||
public boolean isConnected();
|
||||
|
||||
/**
|
||||
* @see AbstractMappingMetadataExtracter#extractRaw(ContentReader)
|
||||
*/
|
||||
public Map<String, Serializable> extractRaw(ContentReader reader) throws Throwable;
|
||||
package org.alfresco.repo.content.metadata;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.service.cmr.repository.ContentReader;
|
||||
|
||||
/**
|
||||
* @deprecated OOTB extractors are being moved to T-Engines.
|
||||
*
|
||||
* An interface that allows separation between the metadata extractor registry and the third party subsystem owning the
|
||||
* open office connection.
|
||||
*
|
||||
* @author dward
|
||||
*/
|
||||
@Deprecated
|
||||
public interface OpenOfficeMetadataWorker
|
||||
{
|
||||
/**
|
||||
* @return Returns true if a connection to the Uno server could be established
|
||||
*/
|
||||
public boolean isConnected();
|
||||
|
||||
/**
|
||||
* @see AbstractMappingMetadataExtracter#extractRaw(ContentReader)
|
||||
*/
|
||||
public Map<String, Serializable> extractRaw(ContentReader reader) throws Throwable;
|
||||
}
|
@@ -1,30 +1,30 @@
|
||||
/*
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2016 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2005 Jesper Steen Møller
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2016 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2005 - 2020 Jesper Steen Møller
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
@@ -52,6 +52,8 @@ import org.apache.tika.parser.Parser;
|
||||
import org.apache.tika.parser.pdf.PDFParser;
|
||||
|
||||
/**
|
||||
* @deprecated OOTB extractors are being moved to T-Engines.
|
||||
*
|
||||
* Metadata extractor for the PDF documents.
|
||||
* <pre>
|
||||
* <b>author:</b> -- cm:author
|
||||
@@ -66,6 +68,7 @@ import org.apache.tika.parser.pdf.PDFParser;
|
||||
* @author Jesper Steen Møller
|
||||
* @author Derek Hulley
|
||||
*/
|
||||
@Deprecated
|
||||
public class PdfBoxMetadataExtracter extends TikaPoweredMetadataExtracter
|
||||
{
|
||||
protected static Log pdfLogger = LogFactory.getLog(PdfBoxMetadataExtracter.class);
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2016 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
@@ -36,6 +36,8 @@ import org.apache.tika.parser.microsoft.ooxml.OOXMLParser;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
|
||||
/**
|
||||
* @deprecated OOTB extractors are being moved to T-Engines.
|
||||
*
|
||||
* POI-based metadata extractor for Office 07 documents.
|
||||
* See http://poi.apache.org/ for information on POI.
|
||||
* <pre>
|
||||
@@ -52,6 +54,7 @@ import org.springframework.beans.factory.InitializingBean;
|
||||
* @author Neil McErlean
|
||||
* @author Dmitry Velichkevich
|
||||
*/
|
||||
@Deprecated
|
||||
public class PoiMetadataExtracter extends TikaPoweredMetadataExtracter
|
||||
{
|
||||
protected static Log logger = LogFactory.getLog(PoiMetadataExtracter.class);
|
||||
|
@@ -1,28 +1,28 @@
|
||||
/*
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2016 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
/*
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.repo.content.metadata;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -47,6 +47,8 @@ import org.alfresco.service.cmr.repository.ContentReader;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
|
||||
/**
|
||||
* @deprecated OOTB extractors are being moved to T-Engines.
|
||||
*
|
||||
* Metadata extractor for RFC822 mime emails.
|
||||
*
|
||||
* Default configuration: (see RFC822MetadataExtractor.properties)
|
||||
@@ -66,6 +68,7 @@ import org.alfresco.service.namespace.QName;
|
||||
* @author Derek Hulley
|
||||
* @since 3.2
|
||||
*/
|
||||
@Deprecated
|
||||
public class RFC822MetadataExtracter extends AbstractMappingMetadataExtracter
|
||||
{
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2016 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
@@ -42,6 +42,8 @@ import org.gagravarr.tika.FlacParser;
|
||||
import org.gagravarr.tika.VorbisParser;
|
||||
|
||||
/**
|
||||
* @deprecated OOTB extractors are being moved to T-Engines.
|
||||
*
|
||||
* A Metadata Extractor which makes use of the Apache
|
||||
* Tika Audio Parsers to extract metadata from your
|
||||
* media files.
|
||||
@@ -64,6 +66,7 @@ import org.gagravarr.tika.VorbisParser;
|
||||
* @since 4.0
|
||||
* @author Nick Burch
|
||||
*/
|
||||
@Deprecated
|
||||
public class TikaAudioMetadataExtracter extends TikaPoweredMetadataExtracter
|
||||
{
|
||||
protected static final String KEY_LYRICS = "lyrics";
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2016 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
@@ -40,6 +40,8 @@ import org.apache.tika.parser.AutoDetectParser;
|
||||
import org.apache.tika.parser.Parser;
|
||||
|
||||
/**
|
||||
* @deprecated OOTB extractors are being moved to T-Engines.
|
||||
*
|
||||
* A Metadata Extractor which makes use of the Apache
|
||||
* Tika auto-detection to select the best parser
|
||||
* to extract the metadata from your document.
|
||||
@@ -60,16 +62,16 @@ import org.apache.tika.parser.Parser;
|
||||
* @since 3.4
|
||||
* @author Nick Burch
|
||||
*/
|
||||
@Deprecated
|
||||
public class TikaAutoMetadataExtracter extends TikaPoweredMetadataExtracter
|
||||
{
|
||||
protected static Log logger = LogFactory.getLog(TikaAutoMetadataExtracter.class);
|
||||
private static AutoDetectParser parser;
|
||||
private static TikaConfig config;
|
||||
private static String EXIF_IMAGE_HEIGHT_TAG = "Exif Image Height";
|
||||
private static String EXIF_IMAGE_WIDTH_TAG = "Exif Image Width";
|
||||
private static String EXIF_IMAGE_HEIGHT_TAG = "Exif SubIFD:Exif Image Height";
|
||||
private static String EXIF_IMAGE_WIDTH_TAG = "Exif SubIFD:Exif Image Width";
|
||||
private static String JPEG_IMAGE_HEIGHT_TAG = "Image Height";
|
||||
private static String JPEG_IMAGE_WIDTH_TAG = "Image Width";
|
||||
private static String COMPRESSION_TAG = "Compression";
|
||||
|
||||
public static ArrayList<String> SUPPORTED_MIMETYPES;
|
||||
private static ArrayList<String> buildMimeTypes(TikaConfig tikaConfig)
|
||||
@@ -119,24 +121,19 @@ public class TikaAutoMetadataExtracter extends TikaPoweredMetadataExtracter
|
||||
*/
|
||||
@Override
|
||||
protected Map<String, Serializable> extractSpecific(Metadata metadata,
|
||||
Map<String, Serializable> properties, Map<String,String> headers)
|
||||
Map<String, Serializable> properties, Map<String, String> headers)
|
||||
{
|
||||
if(MimetypeMap.MIMETYPE_IMAGE_JPEG.equals(metadata.get(Metadata.CONTENT_TYPE)))
|
||||
if (MimetypeMap.MIMETYPE_IMAGE_JPEG.equals(metadata.get(Metadata.CONTENT_TYPE)))
|
||||
{
|
||||
//check if the image has exif information
|
||||
if(metadata.get(EXIF_IMAGE_WIDTH_TAG) != null
|
||||
&& metadata.get(EXIF_IMAGE_HEIGHT_TAG) != null
|
||||
&& metadata.get(COMPRESSION_TAG) != null)
|
||||
if (metadata.get(EXIF_IMAGE_WIDTH_TAG) != null && metadata.get(EXIF_IMAGE_HEIGHT_TAG) != null)
|
||||
{
|
||||
//replace the exif size properties that will be embedded in the node with
|
||||
//the guessed dimensions from Tika
|
||||
putRawValue(TIFF.IMAGE_LENGTH.getName(), extractSize(metadata.get(EXIF_IMAGE_HEIGHT_TAG)), properties);
|
||||
putRawValue(TIFF.IMAGE_WIDTH.getName(), extractSize(metadata.get(EXIF_IMAGE_WIDTH_TAG)), properties);
|
||||
putRawValue(JPEG_IMAGE_HEIGHT_TAG, metadata.get(EXIF_IMAGE_HEIGHT_TAG), properties);
|
||||
putRawValue(JPEG_IMAGE_WIDTH_TAG, metadata.get(EXIF_IMAGE_WIDTH_TAG), properties);
|
||||
putRawValue(TIFF.IMAGE_LENGTH.getName(), extractSize(metadata.get(JPEG_IMAGE_HEIGHT_TAG)), properties);
|
||||
putRawValue(TIFF.IMAGE_WIDTH.getName(), extractSize(metadata.get(JPEG_IMAGE_WIDTH_TAG)), properties);
|
||||
}
|
||||
}
|
||||
return properties;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2016 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
@@ -74,6 +74,8 @@ import org.xml.sax.SAXException;
|
||||
|
||||
|
||||
/**
|
||||
* @deprecated extractors have been moved to a T-Engine.
|
||||
*
|
||||
* The parent of all Metadata Extractors which use
|
||||
* Apache Tika under the hood. This handles all the
|
||||
* common parts of processing the files, and the common
|
||||
@@ -92,6 +94,7 @@ import org.xml.sax.SAXException;
|
||||
* @author Nick Burch
|
||||
*/
|
||||
@AlfrescoPublicApi
|
||||
@Deprecated
|
||||
public abstract class TikaPoweredMetadataExtracter
|
||||
extends AbstractMappingMetadataExtracter
|
||||
implements MetadataEmbedder
|
||||
|
@@ -1,28 +1,28 @@
|
||||
/*
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2016 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
/*
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.repo.content.metadata;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -37,6 +37,8 @@ import org.apache.tika.parser.ParseContext;
|
||||
import org.apache.tika.parser.Parser;
|
||||
|
||||
/**
|
||||
* @deprecated OOTB extractors are being moved to T-Engines.
|
||||
*
|
||||
* A Metadata Extractor which makes use of Apache Tika,
|
||||
* and allows the selection of the Tika parser to be
|
||||
* sprung-in to extract the metadata from your document.
|
||||
@@ -56,6 +58,7 @@ import org.apache.tika.parser.Parser;
|
||||
* @author Nick Burch
|
||||
*/
|
||||
@AlfrescoPublicApi
|
||||
@Deprecated
|
||||
public class TikaSpringConfiguredMetadataExtracter extends TikaPoweredMetadataExtracter
|
||||
{
|
||||
protected static Log logger = LogFactory.getLog(TikaSpringConfiguredMetadataExtracter.class);
|
||||
|
@@ -233,4 +233,15 @@ public interface AuditDAO
|
||||
* @return a map containing min/max and the associated value
|
||||
*/
|
||||
HashMap<String, Long> getAuditMinMaxByApp(long appId, List<String> extremes);
|
||||
|
||||
/**
|
||||
* Issue an audit query to retrieve count of records for a given application.
|
||||
*
|
||||
* @param applicationId the database id of the application
|
||||
* @return a map containing min/max and the associated value
|
||||
*/
|
||||
default int getAuditEntriesCountByApp(long applicationId)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
@@ -65,6 +65,7 @@ public class AuditDAOImpl extends AbstractAuditDAOImpl
|
||||
private static final String DELETE_ENTRIES_BY_ID = "alfresco.audit.delete_AuditEntriesById";
|
||||
private static final String INSERT_ENTRY = "alfresco.audit.insert.insert_AuditEntry";
|
||||
private static final String SELECT_MINMAX_ENTRY_FOR_APP = "alfresco.audit.select_MinMaxAuditEntryId";
|
||||
private static final String SELECT_COUNT_ENTRIES_FOR_APP = "alfresco.audit.select_CountAuditEntryId";
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private static final String SELECT_ENTRIES_SIMPLE = "alfresco.audit.select_AuditEntriesSimple";
|
||||
@@ -223,6 +224,17 @@ public class AuditDAOImpl extends AbstractAuditDAOImpl
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAuditEntriesCountByApp(long applicationId)
|
||||
{
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("auditAppId", applicationId);
|
||||
|
||||
int result = template.selectOne(SELECT_COUNT_ENTRIES_FOR_APP, params);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
protected void findAuditEntries(
|
||||
|
@@ -430,8 +430,8 @@ public class ADMAccessControlListDAO implements AccessControlListDAO
|
||||
// {
|
||||
// setFixedAcls(child.getId(), inheritFrom, mergeFrom, sharedAclToReplace, changes, false);
|
||||
// }
|
||||
// Already replaced
|
||||
if(acl.equals(sharedAclToReplace))
|
||||
// Still has old shared ACL or already replaced
|
||||
if(acl.equals(sharedAclToReplace) || acl.equals(mergeFrom))
|
||||
{
|
||||
propagateOnChildren = setFixAclPending(child.getId(), inheritFrom, mergeFrom, sharedAclToReplace, changes, false, asyncCall, propagateOnChildren);
|
||||
}
|
||||
@@ -459,52 +459,62 @@ public class ADMAccessControlListDAO implements AccessControlListDAO
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* If async call required adds ASPECT_PENDING_FIX_ACL aspect to nodes when transactionTime reaches max admitted time
|
||||
*/
|
||||
private boolean setFixAclPending(Long nodeId, Long inheritFrom, Long mergeFrom, Long sharedAclToReplace, List<AclChange> changes,
|
||||
boolean set, boolean asyncCall, boolean propagateOnChildren)
|
||||
{
|
||||
// check if async call is required
|
||||
if (!asyncCall)
|
||||
{
|
||||
// make regular method call
|
||||
setFixedAcls(nodeId, inheritFrom, mergeFrom, sharedAclToReplace, changes, set, asyncCall, propagateOnChildren);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// check transaction time
|
||||
long transactionStartTime = AlfrescoTransactionSupport.getTransactionStartTime();
|
||||
long transactionTime = System.currentTimeMillis() - transactionStartTime;
|
||||
|
||||
/**
|
||||
* Adds ASPECT_PENDING_FIX_ACL aspect to nodes when transactionTime reaches max admitted time
|
||||
* MNT-18308: No longer checks if call is async in order to evaluate time passed to decide if nodes should be
|
||||
* processed by job. This is now the default behavior for both sync and async calls: when fixedAclMaxTransactionTime
|
||||
* is exceeded, call turns async and all remaining nodes should be processed by job FixedACLUpdater
|
||||
*
|
||||
* @param nodeId
|
||||
* the nodeId of the current node being processed
|
||||
* @param inheritFrom
|
||||
* the parent node's ACL
|
||||
* @param mergeFrom
|
||||
* the new shared ACL, if already known.
|
||||
* @param sharedAclToReplace
|
||||
* the old shared ACL, to be replaced
|
||||
* @param changes
|
||||
* the list in which to record changes
|
||||
* @param set
|
||||
* if to set the shared ACL on the parent
|
||||
* @param asyncCall
|
||||
* if the call was initially set as async
|
||||
* @param propagateOnChildren
|
||||
* current setting of child propagation of ACL creation
|
||||
* @return new setting on child propagation of ACL creation
|
||||
*
|
||||
*/
|
||||
private boolean setFixAclPending(Long nodeId, Long inheritFrom, Long mergeFrom, Long sharedAclToReplace,
|
||||
List<AclChange> changes, boolean set, boolean asyncCall, boolean propagateOnChildren)
|
||||
{
|
||||
// check transaction time
|
||||
long transactionStartTime = AlfrescoTransactionSupport.getTransactionStartTime();
|
||||
long transactionTime = System.currentTimeMillis() - transactionStartTime;
|
||||
if (transactionTime < fixedAclMaxTransactionTime)
|
||||
{
|
||||
// make regular method call if time is under max transaction configured time
|
||||
setFixedAcls(nodeId, inheritFrom, mergeFrom, sharedAclToReplace, changes, set, asyncCall, propagateOnChildren);
|
||||
return true;
|
||||
}
|
||||
|
||||
// If flag is still unset or false, the call until now has been sync and will turn async, we should throw a
|
||||
// warning
|
||||
if (log.isWarnEnabled() && (AlfrescoTransactionSupport.getResource(FixedAclUpdater.FIXED_ACL_ASYNC_REQUIRED_KEY) == null
|
||||
|| (Boolean) AlfrescoTransactionSupport.getResource(FixedAclUpdater.FIXED_ACL_ASYNC_REQUIRED_KEY) == false))
|
||||
{
|
||||
log.warn("The ACL processing time in transaction " + AlfrescoTransactionSupport.getTransactionId()
|
||||
+ " exceeded the configured limit of " + fixedAclMaxTransactionTime
|
||||
+ " ms. The rest of the ACL processing will be done asynchronously.");
|
||||
}
|
||||
// set ASPECT_PENDING_FIX_ACL aspect on node to be later on processed with FixedAclUpdater amd switch flag
|
||||
// FIXED_ACL_ASYNC_REQUIRED_KEY
|
||||
addFixedAclPendingAspect(nodeId, sharedAclToReplace, inheritFrom);
|
||||
AlfrescoTransactionSupport.bindResource(FixedAclUpdater.FIXED_ACL_ASYNC_REQUIRED_KEY, true);
|
||||
// stop propagating on children nodes
|
||||
return false;
|
||||
}
|
||||
|
||||
if (transactionTime < fixedAclMaxTransactionTime)
|
||||
{
|
||||
// make regular method call if time is under max transaction configured time
|
||||
setFixedAcls(nodeId, inheritFrom, mergeFrom, sharedAclToReplace, changes, set, asyncCall, propagateOnChildren);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// time exceeded;
|
||||
if (nodeDAO.getPrimaryChildrenAcls(nodeId).size() == 0)
|
||||
{
|
||||
// if node is leaf in tree hierarchy call setFixedAcls now as processing with FixedAclUpdater would be more time consuming
|
||||
setFixedAcls(nodeId, inheritFrom, mergeFrom, sharedAclToReplace, changes, set, asyncCall, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
// set ASPECT_PENDING_FIX_ACL aspect on node to be later on processed with FixedAclUpdater
|
||||
addFixedAclPendingAspect(nodeId, sharedAclToReplace, inheritFrom);
|
||||
AlfrescoTransactionSupport.bindResource(FixedAclUpdater.FIXED_ACL_ASYNC_REQUIRED_KEY, true);
|
||||
}
|
||||
// stop propagating on children nodes
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void addFixedAclPendingAspect(Long nodeId, Long sharedAclToReplace, Long inheritFrom)
|
||||
{
|
||||
Set<QName> aspect = new HashSet<>();
|
||||
|
@@ -321,7 +321,10 @@ public class FixedAclUpdater extends TransactionListenerAdapter implements Appli
|
||||
if (nodes.size() < maxItemBatchSize)
|
||||
{
|
||||
nodes.add(nodePair.getSecond());
|
||||
maxNodeId = nodePair.getFirst();
|
||||
if (nodePair.getFirst() > maxNodeId)
|
||||
{
|
||||
maxNodeId = nodePair.getFirst();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@@ -43,6 +43,7 @@ import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransacti
|
||||
import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.action.ParameterDefinition;
|
||||
import org.alfresco.service.cmr.coci.CheckOutCheckInService;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
import org.alfresco.service.cmr.download.DownloadRequest;
|
||||
import org.alfresco.service.cmr.download.DownloadStatus;
|
||||
import org.alfresco.service.cmr.download.DownloadStatus.Status;
|
||||
@@ -84,6 +85,7 @@ public class CreateDownloadArchiveAction extends ActionExecuterAbstractBase
|
||||
private NodeService nodeService;
|
||||
private RetryingTransactionHelper transactionHelper;
|
||||
private DownloadStatusUpdateService updateService;
|
||||
private DictionaryService dictionaryService;
|
||||
|
||||
private long maximumContentSize = -1l;
|
||||
|
||||
@@ -167,6 +169,11 @@ public class CreateDownloadArchiveAction extends ActionExecuterAbstractBase
|
||||
this.updateService = updateService;
|
||||
}
|
||||
|
||||
public void setDictionaryService(DictionaryService dictionaryService)
|
||||
{
|
||||
this.dictionaryService = dictionaryService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an archive file containing content from the repository.
|
||||
*
|
||||
@@ -246,7 +253,7 @@ public class CreateDownloadArchiveAction extends ActionExecuterAbstractBase
|
||||
{
|
||||
// perform the actual export
|
||||
final File tempFile = TempFileProvider.createTempFile(TEMP_FILE_PREFIX, TEMP_FILE_SUFFIX);
|
||||
final ZipDownloadExporter handler = new ZipDownloadExporter(tempFile, checkOutCheckInService, nodeService, transactionHelper, updateService, downloadStorage, actionedUponNodeRef, estimator.getSize(), estimator.getFileCount());
|
||||
final ZipDownloadExporter handler = new ZipDownloadExporter(tempFile, checkOutCheckInService, nodeService, transactionHelper, updateService, downloadStorage, dictionaryService, actionedUponNodeRef, estimator.getSize(), estimator.getFileCount());
|
||||
|
||||
try {
|
||||
exporterService.exportView(handler, crawlerParameters, null);
|
||||
|
@@ -39,6 +39,7 @@ import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||
import org.alfresco.service.cmr.coci.CheckOutCheckInService;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
import org.alfresco.service.cmr.download.DownloadStatus;
|
||||
import org.alfresco.service.cmr.download.DownloadStatus.Status;
|
||||
import org.alfresco.service.cmr.repository.ContentData;
|
||||
@@ -77,6 +78,7 @@ public class ZipDownloadExporter extends BaseExporter
|
||||
|
||||
private RetryingTransactionHelper transactionHelper;
|
||||
private DownloadStorage downloadStorage;
|
||||
private DictionaryService dictionaryService;
|
||||
private DownloadStatusUpdateService updateService;
|
||||
|
||||
private Deque<Pair<String, NodeRef>> path = new LinkedList<Pair<String, NodeRef>>();
|
||||
@@ -93,11 +95,12 @@ public class ZipDownloadExporter extends BaseExporter
|
||||
* @param transactionHelper RetryingTransactionHelper
|
||||
* @param updateService DownloadStatusUpdateService
|
||||
* @param downloadStorage DownloadStorage
|
||||
* @param dictionaryService DictionaryService
|
||||
* @param downloadNodeRef NodeRef
|
||||
* @param total long
|
||||
* @param totalFileCount long
|
||||
*/
|
||||
public ZipDownloadExporter(File zipFile, CheckOutCheckInService checkOutCheckInService, NodeService nodeService, RetryingTransactionHelper transactionHelper, DownloadStatusUpdateService updateService, DownloadStorage downloadStorage, NodeRef downloadNodeRef, long total, long totalFileCount)
|
||||
public ZipDownloadExporter(File zipFile, CheckOutCheckInService checkOutCheckInService, NodeService nodeService, RetryingTransactionHelper transactionHelper, DownloadStatusUpdateService updateService, DownloadStorage downloadStorage, DictionaryService dictionaryService, NodeRef downloadNodeRef, long total, long totalFileCount)
|
||||
{
|
||||
super(checkOutCheckInService, nodeService);
|
||||
try
|
||||
@@ -106,6 +109,7 @@ public class ZipDownloadExporter extends BaseExporter
|
||||
this.updateService = updateService;
|
||||
this.transactionHelper = transactionHelper;
|
||||
this.downloadStorage = downloadStorage;
|
||||
this.dictionaryService = dictionaryService;
|
||||
|
||||
this.downloadNodeRef = downloadNodeRef;
|
||||
this.total = total;
|
||||
@@ -134,7 +138,7 @@ public class ZipDownloadExporter extends BaseExporter
|
||||
{
|
||||
this.currentName = (String)nodeService.getProperty(nodeRef, ContentModel.PROP_NAME);
|
||||
path.push(new Pair<String, NodeRef>(currentName, nodeRef));
|
||||
if (ContentModel.TYPE_FOLDER.equals(nodeService.getType(nodeRef)))
|
||||
if (dictionaryService.isSubClass(nodeService.getType(nodeRef), ContentModel.TYPE_FOLDER))
|
||||
{
|
||||
String path = getPath() + PATH_SEPARATOR;
|
||||
ZipArchiveEntry archiveEntry = new ZipArchiveEntry(path);
|
||||
|
@@ -196,7 +196,7 @@ public class PreferenceServiceImpl implements PreferenceService, Extensible
|
||||
{
|
||||
if(jsonPrefs.has(preferenceName))
|
||||
{
|
||||
preferenceValue = jsonPrefs.getString(preferenceName);
|
||||
preferenceValue = String.valueOf(jsonPrefs.get(preferenceName));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,28 +1,28 @@
|
||||
/*
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2016 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
/*
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2016 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.repo.rule.ruletrigger;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -141,7 +141,7 @@ public class OnPropertyUpdateRuleTrigger extends RuleTriggerAbstractBase
|
||||
for (QName name : keys)
|
||||
{
|
||||
// Skip rule firing on this content property for performance reasons
|
||||
if (name.equals(ContentModel.PROP_PREFERENCE_VALUES))
|
||||
if (name.equals(ContentModel.PROP_PREFERENCE_VALUES) || name.equals(ContentModel.PROP_CASCADE_CRC))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@@ -1,28 +1,28 @@
|
||||
/*
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2016 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
/*
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2016 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
package org.alfresco.repo.search;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -136,7 +136,7 @@ public class QueryRegisterComponentImpl implements QueryRegisterComponent
|
||||
try
|
||||
{
|
||||
InputStream is = this.getClass().getClassLoader().getResourceAsStream(location);
|
||||
SAXReader reader = new SAXReader();
|
||||
SAXReader reader = SAXReader.createDefault();
|
||||
Document document = reader.read(is);
|
||||
is.close();
|
||||
QueryCollection collection = QueryCollectionImpl.createQueryCollection(document.getRootElement(), dictionaryService, namespaceService);
|
||||
|
@@ -240,6 +240,11 @@ public class DBResultSet extends AbstractResultSet
|
||||
nodeRefs[n+1] = nodeRef == null ? null : tenantService.getBaseName(nodeRef);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public NodeService getNodeService()
|
||||
{
|
||||
return nodeService;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -25,11 +25,13 @@
|
||||
*/
|
||||
package org.alfresco.repo.search.impl.querymodel.impl.db;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.repo.search.AbstractResultSetRow;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.search.ResultSet;
|
||||
import org.alfresco.service.cmr.search.ResultSet;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
|
||||
/**
|
||||
* @author Andy
|
||||
@@ -82,6 +84,13 @@ public class DBResultSetRow extends AbstractResultSetRow
|
||||
public float getScore(String selectorName)
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<QName, Serializable> getDirectProperties()
|
||||
{
|
||||
DBResultSet rs = (DBResultSet) getResultSet();
|
||||
return rs.getNodeService().getProperties(rs.getNodeRef(getIndex()));
|
||||
}
|
||||
|
||||
|
||||
|
@@ -54,6 +54,7 @@ import javax.naming.InvalidNameException;
|
||||
import javax.naming.Name;
|
||||
import javax.naming.NamingEnumeration;
|
||||
import javax.naming.NamingException;
|
||||
import javax.naming.ServiceUnavailableException;
|
||||
import javax.naming.directory.Attribute;
|
||||
import javax.naming.directory.Attributes;
|
||||
import javax.naming.directory.DirContext;
|
||||
@@ -882,6 +883,16 @@ public class LDAPUserRegistry implements UserRegistry, LDAPNameResolver, Initial
|
||||
continue;
|
||||
}
|
||||
}
|
||||
catch (ServiceUnavailableException | CommunicationException e)
|
||||
{
|
||||
// MNT-21614: Check & fail if communication breaks due to ServiceUnavailableException or CommunicationException
|
||||
if (e.getMessage() != null)
|
||||
{
|
||||
Object[] params = {e.getLocalizedMessage() };
|
||||
throw new AlfrescoRuntimeException("synchronization.err.ldap.search", params, e);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
catch (NamingException e)
|
||||
{
|
||||
// Check if it is a timeout and fail
|
||||
|
@@ -691,20 +691,18 @@ public class SOLRTrackingComponentImpl implements SOLRTrackingComponent
|
||||
return new ArrayList<Long>(visited);
|
||||
}
|
||||
|
||||
|
||||
/** Get properties that we want to be indexed. */
|
||||
protected Map<QName, Serializable> getProperties(Long nodeId)
|
||||
{
|
||||
Map<QName, Serializable> props = null;
|
||||
|
||||
// ALF-10641
|
||||
// Residual properties are un-indexed -> break serlialisation
|
||||
// Residual properties are un-indexed -> break serialisation
|
||||
nodeDAO.setCheckNodeConsistency();
|
||||
Map<QName, Serializable> sourceProps = nodeDAO.getNodeProperties(nodeId);
|
||||
props = new HashMap<QName, Serializable>((int)(sourceProps.size() * 1.3));
|
||||
Map<QName, Serializable> props = new HashMap<>(sourceProps.size());
|
||||
for(QName propertyQName : sourceProps.keySet())
|
||||
{
|
||||
PropertyDefinition propDef = dictionaryService.getProperty(propertyQName);
|
||||
if(propDef != null)
|
||||
if(propDef != null && propDef.isIndexed())
|
||||
{
|
||||
props.put(propertyQName, sourceProps.get(propertyQName));
|
||||
}
|
||||
@@ -865,7 +863,22 @@ public class SOLRTrackingComponentImpl implements SOLRTrackingComponent
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Nodes with no type are ignored by SOLR");
|
||||
QName typeQName = null;
|
||||
TypeDefinition typeDefinition = null;
|
||||
|
||||
String errorMessage = "NodeId " + nodeId + " with nodeRef " + nodeRef;
|
||||
|
||||
typeQName = nodeDAO.getNodeType(nodeId);
|
||||
if (typeQName != null)
|
||||
{
|
||||
errorMessage += " has type " + typeQName + ", but this type is not registered in DictionaryService.";
|
||||
}
|
||||
else
|
||||
{
|
||||
errorMessage += " has no type.";
|
||||
}
|
||||
|
||||
throw new AlfrescoRuntimeException(errorMessage + " It will be ignored by SOLR.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -241,4 +241,15 @@ public interface AuditService
|
||||
* @return a map containing min/max and the associated value
|
||||
*/
|
||||
HashMap<String, Long> getAuditMinMaxByApp(String applicationName, List<String> extremes);
|
||||
|
||||
/**
|
||||
* Issue an audit query to retrieve min / max audit record id for a given application.
|
||||
*
|
||||
* @param applicationName the name of the application
|
||||
* @return a map containing min/max and the associated value
|
||||
*/
|
||||
default int getAuditEntriesCountByApp(String applicationName)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
@@ -598,8 +598,8 @@
|
||||
<property name="ticketsCache">
|
||||
<ref bean="ticketsCache" />
|
||||
</property>
|
||||
<property name="usernameKey">
|
||||
<ref bean="usernameKeyCache" />
|
||||
<property name="usernameToTicketIdCache">
|
||||
<ref bean="usernameToTicketIdCache" />
|
||||
</property>
|
||||
<!-- The period for which tickets are valid in XML duration format. -->
|
||||
<!-- The default is PT1H for one hour. -->
|
||||
|
@@ -281,8 +281,8 @@
|
||||
<constructor-arg value="cache.ticketsCache"/>
|
||||
</bean>
|
||||
|
||||
<bean name="usernameKeyCache" factory-bean="cacheFactory" factory-method="createCache">
|
||||
<constructor-arg value="cache.usernameKeyCache"/>
|
||||
<bean name="usernameToTicketIdCache" factory-bean="cacheFactory" factory-method="createCache">
|
||||
<constructor-arg value="cache.usernameToTicketIdCache"/>
|
||||
</bean>
|
||||
|
||||
<!-- ===================================== -->
|
||||
|
@@ -333,14 +333,14 @@ cache.ticketsCache.eviction-policy=LRU
|
||||
cache.ticketsCache.merge-policy=com.hazelcast.map.merge.PutIfAbsentMapMergePolicy
|
||||
cache.ticketsCache.readBackupData=false
|
||||
|
||||
cache.usernameKeyCache.maxItems=1000
|
||||
cache.usernameKeyCache.timeToLiveSeconds=0
|
||||
cache.usernameKeyCache.maxIdleSeconds=0
|
||||
cache.usernameKeyCache.cluster.type=fully-distributed
|
||||
cache.usernameKeyCache.backup-count=1
|
||||
cache.usernameKeyCache.eviction-policy=LRU
|
||||
cache.usernameKeyCache.merge-policy=com.hazelcast.map.merge.PutIfAbsentMapMergePolicy
|
||||
cache.usernameKeyCache.readBackupData=false
|
||||
cache.usernameToTicketIdCache.maxItems=1000
|
||||
cache.usernameToTicketIdCache.timeToLiveSeconds=0
|
||||
cache.usernameToTicketIdCache.maxIdleSeconds=0
|
||||
cache.usernameToTicketIdCache.cluster.type=fully-distributed
|
||||
cache.usernameToTicketIdCache.backup-count=1
|
||||
cache.usernameToTicketIdCache.eviction-policy=LRU
|
||||
cache.usernameToTicketIdCache.merge-policy=com.hazelcast.map.merge.PutIfAbsentMapMergePolicy
|
||||
cache.usernameToTicketIdCache.readBackupData=false
|
||||
|
||||
cache.authorityEntitySharedCache.tx.maxItems=50000
|
||||
cache.authorityEntitySharedCache.tx.statsEnabled=${caches.tx.statsEnabled}
|
||||
|
@@ -89,18 +89,19 @@
|
||||
<bean id="downloadContentServiceHelper" class="org.alfresco.repo.download.LocalContentServiceHelper">
|
||||
<property name="contentService" ref="contentService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="createDownloadArchiveAction" class="org.alfresco.repo.download.CreateDownloadArchiveAction" parent="action-executer">
|
||||
<property name="checkOutCheckInSerivce" ref="checkOutCheckInService"/>
|
||||
<property name="contentServiceHelper" ref="downloadContentServiceHelper" />
|
||||
<property name="downloadStorage" ref="downloadStorage" />
|
||||
<property name="exporterService" ref="downloadExporterComponent" />
|
||||
<property name="maximumContentSize" value="${download.maxContentSize}" />
|
||||
<property name="nodeService" ref="nodeService" />
|
||||
<property name="publicAction" value="false"/>
|
||||
<property name="transactionHelper" ref="retryingTransactionHelper"/>
|
||||
<property name="updateService" ref="downloadStatusUpdateService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="createDownloadArchiveAction" class="org.alfresco.repo.download.CreateDownloadArchiveAction" parent="action-executer">
|
||||
<property name="checkOutCheckInSerivce" ref="checkOutCheckInService"/>
|
||||
<property name="contentServiceHelper" ref="downloadContentServiceHelper"/>
|
||||
<property name="downloadStorage" ref="downloadStorage"/>
|
||||
<property name="exporterService" ref="downloadExporterComponent"/>
|
||||
<property name="maximumContentSize" value="${download.maxContentSize}"/>
|
||||
<property name="nodeService" ref="nodeService"/>
|
||||
<property name="publicAction" value="false"/>
|
||||
<property name="transactionHelper" ref="retryingTransactionHelper"/>
|
||||
<property name="updateService" ref="downloadStatusUpdateService"/>
|
||||
<property name="dictionaryService" ref="dictionaryService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="downloadExporterComponent" parent="exporterComponent">
|
||||
<property name="exportSecondaryNodes" value="true"/>
|
||||
|
@@ -15,10 +15,12 @@
|
||||
</bean>
|
||||
|
||||
<bean id="keyStoreParameters" class="org.alfresco.encryption.KeyStoreParameters" init-method="init">
|
||||
<property name="id" value="metadata-keystore"/>
|
||||
<property name="name" value="Key Store"/>
|
||||
<property name="location" value="${encryption.keystore.location}"/>
|
||||
<property name="provider" value="${encryption.keystore.provider}"/>
|
||||
<property name="type" value="${encryption.keystore.type}"/>
|
||||
<!-- This property is left for backwards compatibility -->
|
||||
<property name="keyMetaDataFileLocation" value="${encryption.keystore.keyMetaData.location}"/>
|
||||
</bean>
|
||||
|
||||
@@ -30,18 +32,22 @@
|
||||
|
||||
<!-- TODO i18n for key store names -->
|
||||
<bean id="sslKeyStoreParameters" class="org.alfresco.encryption.KeyStoreParameters" init-method="init">
|
||||
<property name="id" value="ssl-keystore"/>
|
||||
<property name="name" value="SSL Key Store"/>
|
||||
<property name="location" value="${encryption.ssl.keystore.location}"/>
|
||||
<property name="type" value="${encryption.ssl.keystore.type}"/>
|
||||
<property name="provider" value="${encryption.ssl.keystore.provider}"/>
|
||||
<!-- This property is left for backwards compatibility -->
|
||||
<property name="keyMetaDataFileLocation" value="${encryption.ssl.keystore.keyMetaData.location}"/>
|
||||
</bean>
|
||||
|
||||
<bean id="sslTrustStoreParameters" class="org.alfresco.encryption.KeyStoreParameters" init-method="init">
|
||||
<property name="id" value="ssl-truststore"/>
|
||||
<property name="name" value="SSL Trust Store"/>
|
||||
<property name="location" value="${encryption.ssl.truststore.location}"/>
|
||||
<property name="type" value="${encryption.ssl.truststore.type}"/>
|
||||
<property name="provider" value="${encryption.ssl.truststore.provider}"/>
|
||||
<!-- This property is left for backwards compatibility -->
|
||||
<property name="keyMetaDataFileLocation" value="${encryption.ssl.truststore.keyMetaData.location}"/>
|
||||
</bean>
|
||||
|
||||
@@ -71,10 +77,12 @@
|
||||
</bean>
|
||||
|
||||
<bean id="backupKeyStoreParameters" class="org.alfresco.encryption.KeyStoreParameters" init-method="init">
|
||||
<property name="id" value="metadata-backup-keystore"/>
|
||||
<property name="name" value="Backup Key Store"/>
|
||||
<property name="location" value="${encryption.keystore.backup.location}"/>
|
||||
<property name="provider" value="${encryption.keystore.backup.provider}"/>
|
||||
<property name="type" value="${encryption.keystore.backup.type}"/>
|
||||
<!-- This property is left for backwards compatibility -->
|
||||
<property name="keyMetaDataFileLocation" value="${encryption.keystore.backup.keyMetaData.location}"/>
|
||||
</bean>
|
||||
|
||||
|
@@ -59,6 +59,10 @@
|
||||
<parameter property="min" jdbcType="VARCHAR" javaType="String"/>
|
||||
<parameter property="max" jdbcType="VARCHAR" javaType="String"/>
|
||||
</parameterMap>
|
||||
|
||||
<parameterMap id="parameter_AuditAppId" type="map">
|
||||
<parameter property="auditAppId" jdbcType="BIGINT" javaType="Long"/>
|
||||
</parameterMap>
|
||||
|
||||
<!-- -->
|
||||
<!-- SQL Snippets -->
|
||||
@@ -277,6 +281,16 @@
|
||||
<include refid="select_AuditEntriesOrderBySnippet"/>
|
||||
</sql>
|
||||
|
||||
<!-- Get the count of audit entries for application -->
|
||||
<select id="select_CountAuditEntryId" parameterMap="parameter_AuditAppId" resultType="int">
|
||||
select
|
||||
COUNT(id)
|
||||
from
|
||||
alf_audit_entry
|
||||
where
|
||||
alf_audit_entry.audit_app_id = #{auditAppId}
|
||||
</select>
|
||||
|
||||
<!-- Get the maximum/minimum audit entry id for application -->
|
||||
<select id="select_MinMaxAuditEntryId" parameterMap="parameter_IdMinMaxMap" resultMap="result_minMaxMap">
|
||||
select
|
||||
|
@@ -286,8 +286,8 @@ cm_contentmodel.property.cm_originator.title=From
|
||||
cm_contentmodel.property.cm_originator.description=From
|
||||
cm_contentmodel.property.cm_addressee.title=To
|
||||
cm_contentmodel.property.cm_addressee.description=To
|
||||
cm_contentmodel.property.cm_addressees.title=CC
|
||||
cm_contentmodel.property.cm_addressees.description=CC
|
||||
cm_contentmodel.property.cm_addressees.title=All Recipients
|
||||
cm_contentmodel.property.cm_addressees.description=All Recipients
|
||||
cm_contentmodel.property.cm_subjectline.title=Subject
|
||||
cm_contentmodel.property.cm_subjectline.description=Subject
|
||||
cm_contentmodel.property.cm_sentdate.title=Sent Date
|
||||
|
@@ -286,8 +286,8 @@ cm_contentmodel.property.cm_originator.title=Od
|
||||
cm_contentmodel.property.cm_originator.description=Od
|
||||
cm_contentmodel.property.cm_addressee.title=Komu
|
||||
cm_contentmodel.property.cm_addressee.description=Komu
|
||||
cm_contentmodel.property.cm_addressees.title=Kopie
|
||||
cm_contentmodel.property.cm_addressees.description=Kopie
|
||||
cm_contentmodel.property.cm_addressees.title=V\u0161ichni p\u0159\u00edjemci
|
||||
cm_contentmodel.property.cm_addressees.description=V\u0161ichni p\u0159\u00edjemci
|
||||
cm_contentmodel.property.cm_subjectline.title=P\u0159edm\u011bt
|
||||
cm_contentmodel.property.cm_subjectline.description=P\u0159edm\u011bt
|
||||
cm_contentmodel.property.cm_sentdate.title=Datum odesl\u00e1n\u00ed
|
||||
|
@@ -286,8 +286,8 @@ cm_contentmodel.property.cm_originator.title=Fra
|
||||
cm_contentmodel.property.cm_originator.description=Fra
|
||||
cm_contentmodel.property.cm_addressee.title=Til
|
||||
cm_contentmodel.property.cm_addressee.description=Til
|
||||
cm_contentmodel.property.cm_addressees.title=Cc
|
||||
cm_contentmodel.property.cm_addressees.description=Cc
|
||||
cm_contentmodel.property.cm_addressees.title=Alle modtagere
|
||||
cm_contentmodel.property.cm_addressees.description=Alle modtagere
|
||||
cm_contentmodel.property.cm_subjectline.title=Emne
|
||||
cm_contentmodel.property.cm_subjectline.description=Emne
|
||||
cm_contentmodel.property.cm_sentdate.title=Afsendelsesdato
|
||||
|
@@ -286,8 +286,8 @@ cm_contentmodel.property.cm_originator.title=Von
|
||||
cm_contentmodel.property.cm_originator.description=Von
|
||||
cm_contentmodel.property.cm_addressee.title=An
|
||||
cm_contentmodel.property.cm_addressee.description=An
|
||||
cm_contentmodel.property.cm_addressees.title=Cc
|
||||
cm_contentmodel.property.cm_addressees.description=Cc
|
||||
cm_contentmodel.property.cm_addressees.title=Alle Empf\u00e4nger
|
||||
cm_contentmodel.property.cm_addressees.description=Alle Empf\u00e4nger
|
||||
cm_contentmodel.property.cm_subjectline.title=Betreff
|
||||
cm_contentmodel.property.cm_subjectline.description=Betreff
|
||||
cm_contentmodel.property.cm_sentdate.title=Sendedatum
|
||||
|
@@ -286,8 +286,8 @@ cm_contentmodel.property.cm_originator.title=De
|
||||
cm_contentmodel.property.cm_originator.description=De
|
||||
cm_contentmodel.property.cm_addressee.title=Para
|
||||
cm_contentmodel.property.cm_addressee.description=Para
|
||||
cm_contentmodel.property.cm_addressees.title=CC
|
||||
cm_contentmodel.property.cm_addressees.description=CC
|
||||
cm_contentmodel.property.cm_addressees.title=Todos los destinatarios
|
||||
cm_contentmodel.property.cm_addressees.description=Todos los destinatarios
|
||||
cm_contentmodel.property.cm_subjectline.title=Asunto
|
||||
cm_contentmodel.property.cm_subjectline.description=Asunto
|
||||
cm_contentmodel.property.cm_sentdate.title=Fecha de env\u00edo
|
||||
|
@@ -286,8 +286,8 @@ cm_contentmodel.property.cm_originator.title=L\u00e4hett\u00e4j\u00e4
|
||||
cm_contentmodel.property.cm_originator.description=L\u00e4hett\u00e4j\u00e4
|
||||
cm_contentmodel.property.cm_addressee.title=Vastaanottaja
|
||||
cm_contentmodel.property.cm_addressee.description=Vastaanottaja
|
||||
cm_contentmodel.property.cm_addressees.title=Kopio
|
||||
cm_contentmodel.property.cm_addressees.description=Kopio
|
||||
cm_contentmodel.property.cm_addressees.title=Kaikki vastaanottajat
|
||||
cm_contentmodel.property.cm_addressees.description=Kaikki vastaanottajat
|
||||
cm_contentmodel.property.cm_subjectline.title=Aihe
|
||||
cm_contentmodel.property.cm_subjectline.description=Aihe
|
||||
cm_contentmodel.property.cm_sentdate.title=L\u00e4hetysp\u00e4iv\u00e4m\u00e4\u00e4r\u00e4
|
||||
|
@@ -286,8 +286,8 @@ cm_contentmodel.property.cm_originator.title=De
|
||||
cm_contentmodel.property.cm_originator.description=De
|
||||
cm_contentmodel.property.cm_addressee.title=\u00c0
|
||||
cm_contentmodel.property.cm_addressee.description=\u00c0
|
||||
cm_contentmodel.property.cm_addressees.title=CC
|
||||
cm_contentmodel.property.cm_addressees.description=CC
|
||||
cm_contentmodel.property.cm_addressees.title=Tous les destinataires
|
||||
cm_contentmodel.property.cm_addressees.description=Tous les destinataires
|
||||
cm_contentmodel.property.cm_subjectline.title=Sujet
|
||||
cm_contentmodel.property.cm_subjectline.description=Sujet
|
||||
cm_contentmodel.property.cm_sentdate.title=Date d'envoi
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user