mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-09-24 14:32:01 +00:00
Compare commits
39 Commits
7.300-TEST
...
7.199.300-
Author | SHA1 | Date | |
---|---|---|---|
|
399a29eef2 | ||
|
4167f6810e | ||
|
01fe638d60 | ||
|
3ad2db96ab | ||
|
1c9366dcaf | ||
|
9c1daf0795 | ||
|
fb7a6a8a1f | ||
|
4307444e2d | ||
|
89ae5bc193 | ||
|
fe537e97d5 | ||
|
c7b29613d4 | ||
|
4d1f6ae91e | ||
|
1f2d85e252 | ||
|
efa330adf5 | ||
|
abde3fa4cb | ||
|
1d6a775f22 | ||
|
6596825462 | ||
|
30a9c0c065 | ||
|
1399b363cc | ||
|
6416432f42 | ||
|
1c7c87caee | ||
|
42de0e1607 | ||
|
9da76f53e0 | ||
|
c70fdd47a7 | ||
|
d96e726db4 | ||
|
fc66677977 | ||
|
2a9f61076c | ||
|
12c66a09d1 | ||
|
5882e3d002 | ||
|
c15bace290 | ||
|
40eb3f1649 | ||
|
edd5c3ac7b | ||
|
71eb5f3011 | ||
|
1bf2cf015c | ||
|
cd97fb3c3a | ||
|
fc729dd26f | ||
|
8c21deee57 | ||
|
0cf79474a1 | ||
|
5a840b7ecf |
@@ -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.
|
12
core/pom.xml
12
core/pom.xml
@@ -1,5 +1,6 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>alfresco-core</artifactId>
|
||||
<name>Alfresco Core</name>
|
||||
<description>Alfresco core libraries and utils</description>
|
||||
@@ -7,13 +8,14 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>7.300-TEST2</version>
|
||||
<version>7.199.300-TEST5</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
<version>1.14</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-httpclient</groupId>
|
||||
@@ -22,10 +24,12 @@
|
||||
<dependency>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
<version>1.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
@@ -50,6 +54,7 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-orm</artifactId>
|
||||
<version>${dependency.spring.version}</version>
|
||||
<!-- exclude spring-jcl which is brought in by spring-core -->
|
||||
<!-- see https://issues.alfresco.com/jira/browse/REPO-4774 -->
|
||||
<exclusions>
|
||||
@@ -62,10 +67,12 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context</artifactId>
|
||||
<version>${dependency.spring.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.quartz-scheduler</groupId>
|
||||
<artifactId>quartz</artifactId>
|
||||
<version>2.3.2</version>
|
||||
<!-- exclude c3p0 -->
|
||||
<!-- see https://issues.alfresco.com/jira/browse/REPO-3447 -->
|
||||
<exclusions>
|
||||
@@ -87,6 +94,7 @@
|
||||
<dependency>
|
||||
<groupId>com.sun.xml.bind</groupId>
|
||||
<artifactId>jaxb-impl</artifactId>
|
||||
<version>2.3.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sun.xml.bind</groupId>
|
||||
@@ -106,6 +114,7 @@
|
||||
<dependency>
|
||||
<groupId>joda-time</groupId>
|
||||
<artifactId>joda-time</artifactId>
|
||||
<version>2.10.5</version>
|
||||
</dependency>
|
||||
|
||||
<!-- provided dependencies -->
|
||||
@@ -125,6 +134,7 @@
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.13</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@@ -322,7 +322,7 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
|
||||
|
||||
try
|
||||
{
|
||||
keyInfoManager = getKeyInfoManager(getKeyStoreParameters());
|
||||
keyInfoManager = getKeyInfoManager(getKeyMetaDataFileLocation());
|
||||
KeyStore ks = loadKeyStore(keyStoreParameters, keyInfoManager);
|
||||
|
||||
logger.debug("Initializing key managers");
|
||||
@@ -355,7 +355,7 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
|
||||
|
||||
try
|
||||
{
|
||||
keyInfoManager = getKeyInfoManager(getKeyStoreParameters());
|
||||
keyInfoManager = getKeyInfoManager(getKeyMetaDataFileLocation());
|
||||
KeyStore ks = loadKeyStore(getKeyStoreParameters(), keyInfoManager);
|
||||
|
||||
logger.debug("Initializing trust managers");
|
||||
@@ -376,7 +376,12 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected String getKeyMetaDataFileLocation()
|
||||
{
|
||||
return keyStoreParameters.getKeyMetaDataFileLocation();
|
||||
}
|
||||
|
||||
protected InputStream getKeyStoreStream(String location) throws FileNotFoundException
|
||||
{
|
||||
if(location == null)
|
||||
@@ -391,17 +396,9 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
|
||||
return new FileOutputStream(getKeyStoreParameters().getLocation());
|
||||
}
|
||||
|
||||
protected KeyInfoManager getKeyInfoManager(KeyStoreParameters keyStoreParameters) throws IOException
|
||||
protected KeyInfoManager getKeyInfoManager(String metadataFileLocation) throws FileNotFoundException, IOException
|
||||
{
|
||||
return new KeyInfoManager(keyStoreParameters, keyResourceLoader);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
protected KeyInfoManager getKeyInfoManager(String metadataFileLocation) throws IOException
|
||||
{
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setKeyMetaDataFileLocation(metadataFileLocation);
|
||||
return new KeyInfoManager(keyStoreParameters, keyResourceLoader);
|
||||
return new KeyInfoManager(metadataFileLocation, keyResourceLoader);
|
||||
}
|
||||
|
||||
protected KeyMap cacheKeys(KeyStore ks, KeyInfoManager keyInfoManager)
|
||||
@@ -566,7 +563,7 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
|
||||
|
||||
try
|
||||
{
|
||||
keyInfoManager = getKeyInfoManager(keyStoreParameters);
|
||||
keyInfoManager = getKeyInfoManager(keyStoreParameters.getKeyMetaDataFileLocation());
|
||||
ks = loadKeyStore(keyStoreParameters, keyInfoManager);
|
||||
// Loaded
|
||||
}
|
||||
@@ -638,7 +635,7 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
|
||||
|
||||
try
|
||||
{
|
||||
keyInfoManager = getKeyInfoManager(getKeyStoreParameters());
|
||||
keyInfoManager = getKeyInfoManager(getKeyMetaDataFileLocation());
|
||||
Key key = getSecretKey(keyInfoManager.getKeyInformation(keyAlias));
|
||||
encryptionKeysRegistry.registerKey(keyAlias, key);
|
||||
keys.setKey(keyAlias, key);
|
||||
@@ -681,7 +678,7 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
|
||||
{
|
||||
if(!keyStoreExists(keyStoreParameters.getLocation()))
|
||||
{
|
||||
keyInfoManager = getKeyInfoManager(keyStoreParameters);
|
||||
keyInfoManager = getKeyInfoManager(keyStoreParameters.getKeyMetaDataFileLocation());
|
||||
KeyStore ks = initialiseKeyStore(keyStoreParameters.getType(), keyStoreParameters.getProvider());
|
||||
|
||||
String keyStorePassword = keyInfoManager.getKeyStorePassword();
|
||||
@@ -689,7 +686,7 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Key store password is null for keystore at location "
|
||||
+ getKeyStoreParameters().getLocation()
|
||||
+ ". Either specify it as a JVM property or in key store meta data location.");
|
||||
+ ", key store meta data location" + getKeyMetaDataFileLocation());
|
||||
}
|
||||
|
||||
for(String keyAlias : keys.getKeyAliases())
|
||||
@@ -768,13 +765,8 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
|
||||
}
|
||||
}
|
||||
|
||||
protected Key getSecretKey(KeyInformation keyInformation) throws AlfrescoRuntimeException, NoSuchAlgorithmException, InvalidKeyException, InvalidKeySpecException
|
||||
protected Key getSecretKey(KeyInformation keyInformation) throws NoSuchAlgorithmException, InvalidKeyException, InvalidKeySpecException
|
||||
{
|
||||
if (keyInformation == null)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Unable to get secret key: no key information is provided");
|
||||
}
|
||||
|
||||
byte[] keyData = keyInformation.getKeyData();
|
||||
|
||||
if(keyData == null)
|
||||
@@ -804,7 +796,7 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
|
||||
writeLock.lock();
|
||||
try
|
||||
{
|
||||
keyInfoManager = getKeyInfoManager(getKeyStoreParameters());
|
||||
keyInfoManager = getKeyInfoManager(getKeyMetaDataFileLocation());
|
||||
KeyStore ks = loadKeyStore(getKeyStoreParameters(), keyInfoManager);
|
||||
|
||||
// loading Key
|
||||
@@ -993,7 +985,7 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
|
||||
public static class KeyInfoManager
|
||||
{
|
||||
private KeyResourceLoader keyResourceLoader;
|
||||
private KeyStoreParameters keyStoreParameters;
|
||||
private String metadataFileLocation;
|
||||
private Properties keyProps;
|
||||
private String keyStorePassword = null;
|
||||
private Map<String, KeyInformation> keyInfo;
|
||||
@@ -1013,10 +1005,10 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
|
||||
}
|
||||
}
|
||||
|
||||
KeyInfoManager(KeyStoreParameters keyStoreParameters, KeyResourceLoader keyResourceLoader) throws IOException, FileNotFoundException
|
||||
KeyInfoManager(String metadataFileLocation, KeyResourceLoader keyResourceLoader) throws IOException, FileNotFoundException
|
||||
{
|
||||
this.keyResourceLoader = keyResourceLoader;
|
||||
this.keyStoreParameters = keyStoreParameters;
|
||||
this.metadataFileLocation = metadataFileLocation;
|
||||
keyInfo = new HashMap<String, KeyInformation>(2);
|
||||
loadKeyMetaData();
|
||||
}
|
||||
@@ -1033,73 +1025,31 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
|
||||
* Where required, <tt>null</tt> values must be inserted into the map to indicate the presence
|
||||
* of a key that is not protected by a password. They entry for {@link #KEY_KEYSTORE_PASSWORD}
|
||||
* is required if the keystore is password protected.
|
||||
*
|
||||
* WARNING. Storing passwords (keyMetaDataFileLocation) on the file system is not following best security practices.
|
||||
*
|
||||
* <p/>Loading of keys info from system (JVM) properties takes precedence over metadata file.
|
||||
* <p/>Set the unique ID of the keystore and remove the metadata file location property to use JVM properties lookup instead. The property lookup format is the following:
|
||||
* <ul>
|
||||
* <li>[keystore-id].password - keystore password</li>
|
||||
* <li>[keystore-id].aliases - comma separated list of aliases for the keys in the keystore</li>
|
||||
* <li>[keystore-id].[alias].keyData - key data bytes in base64</li>
|
||||
* <li>[keystore-id].[alias].algorithm - key algorithm</li>
|
||||
* <li>[keystore-id].[alias].password - key password</li>
|
||||
* </ul>
|
||||
*
|
||||
*/
|
||||
protected void loadKeyMetaData() throws IOException, FileNotFoundException
|
||||
{
|
||||
if (keyStoreParameters.getId() != null &&
|
||||
(keyStoreParameters.getKeyMetaDataFileLocation() == null ||
|
||||
keyStoreParameters.getKeyMetaDataFileLocation().isEmpty()))
|
||||
keyProps = keyResourceLoader.loadKeyMetaData(metadataFileLocation);
|
||||
if(keyProps != null)
|
||||
{
|
||||
Properties jvmProperties = System.getProperties();
|
||||
keyStorePassword = jvmProperties.getProperty(keyStoreParameters.getId() + ".password");
|
||||
String aliases = jvmProperties.getProperty(keyStoreParameters.getId() + ".aliases");
|
||||
if (aliases == null || aliases.isEmpty())
|
||||
String aliases = keyProps.getProperty("aliases");
|
||||
if(aliases == null)
|
||||
{
|
||||
logger.warn("No aliases were specified for " + keyStoreParameters.getId()
|
||||
+ " keystore");
|
||||
throw new AlfrescoRuntimeException("Passwords file must contain an aliases key");
|
||||
}
|
||||
else
|
||||
|
||||
this.keyStorePassword = keyProps.getProperty(KEY_KEYSTORE_PASSWORD);
|
||||
|
||||
StringTokenizer st = new StringTokenizer(aliases, ",");
|
||||
while(st.hasMoreTokens())
|
||||
{
|
||||
StringTokenizer st = new StringTokenizer(aliases, ",");
|
||||
while(st.hasMoreTokens())
|
||||
{
|
||||
String keyAlias = st.nextToken();
|
||||
keyInfo.put(keyAlias, loadKeyInformation(jvmProperties, keyAlias, keyStoreParameters.getId() + "."));
|
||||
}
|
||||
String keyAlias = st.nextToken();
|
||||
keyInfo.put(keyAlias, loadKeyInformation(keyAlias));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.warn("Storing passwords (" + keyStoreParameters.getKeyMetaDataFileLocation()
|
||||
+ ") on the file system is not following best security practices." +
|
||||
" Please refer to documentation and use JVM properties instead");
|
||||
|
||||
keyProps = keyResourceLoader.loadKeyMetaData(keyStoreParameters.getKeyMetaDataFileLocation());
|
||||
if(keyProps != null)
|
||||
{
|
||||
String aliases = keyProps.getProperty("aliases");
|
||||
if(aliases == null)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Passwords file must contain an aliases key");
|
||||
}
|
||||
|
||||
this.keyStorePassword = keyProps.getProperty(KEY_KEYSTORE_PASSWORD);
|
||||
|
||||
StringTokenizer st = new StringTokenizer(aliases, ",");
|
||||
while(st.hasMoreTokens())
|
||||
{
|
||||
String keyAlias = st.nextToken();
|
||||
keyInfo.put(keyAlias, loadKeyInformation(keyProps, keyAlias, ""));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO
|
||||
//throw new FileNotFoundException("Cannot find key metadata file " + getKeyMetaDataFileLocation());
|
||||
}
|
||||
// TODO
|
||||
//throw new FileNotFoundException("Cannot find key metadata file " + getKeyMetaDataFileLocation());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1117,11 +1067,11 @@ public class AlfrescoKeyStoreImpl implements AlfrescoKeyStore
|
||||
this.keyProps.remove(keyAlias);
|
||||
}
|
||||
|
||||
protected KeyInformation loadKeyInformation(Properties keyProps, String keyAlias, String prefix)
|
||||
protected KeyInformation loadKeyInformation(String keyAlias)
|
||||
{
|
||||
String keyPassword = keyProps.getProperty(prefix + keyAlias + ".password");
|
||||
String keyData = keyProps.getProperty(prefix + keyAlias + ".keyData");
|
||||
String keyAlgorithm = keyProps.getProperty(prefix + keyAlias + ".algorithm");
|
||||
String keyPassword = keyProps.getProperty(keyAlias + ".password");
|
||||
String keyData = keyProps.getProperty(keyAlias + ".keyData");
|
||||
String keyAlgorithm = keyProps.getProperty(keyAlias + ".algorithm");
|
||||
|
||||
byte[] keyDataBytes = null;
|
||||
if(keyData != null && !keyData.equals(""))
|
||||
|
@@ -22,15 +22,12 @@ import org.alfresco.util.PropertyCheck;
|
||||
|
||||
/**
|
||||
* Stores Java keystore initialisation parameters.
|
||||
*
|
||||
* WARNING. Storing passwords (keyMetaDataFileLocation) on the file system is not following best security practices.
|
||||
*
|
||||
*
|
||||
* @since 4.0
|
||||
*
|
||||
*/
|
||||
public class KeyStoreParameters
|
||||
{
|
||||
private String id;
|
||||
private String name;
|
||||
private String type;
|
||||
private String provider;
|
||||
@@ -41,40 +38,8 @@ public class KeyStoreParameters
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* WARNING. Storing passwords (keyMetaDataFileLocation) on the file system is not following best security practices.
|
||||
*
|
||||
* <p/>Set the unique ID of the keystore and aliases to use Java system properties lookup instead. The property lookup format is:
|
||||
* <ul>
|
||||
* <li>[keystore-id].password - keystore password</li>
|
||||
* <li>[keystore-id].aliases - comma separated list of aliases for the keys in the keystore</li>
|
||||
* <li>[keystore-id].[alias].keydata - key data bytes in base64</li>
|
||||
* <li>[keystore-id].[alias].algorithm - key algorithm</li>
|
||||
* <li>[keystore-id].[alias].password - key password</li>
|
||||
* </ul>
|
||||
*
|
||||
* Loading of keys info from system (JVM) properties takes precedence over metadata file.
|
||||
*
|
||||
* @param id unique identifier of the keystore
|
||||
* @param name human readable name of the keystore
|
||||
* @param type type of the keystore
|
||||
* @param keyStoreProvider keystore provider
|
||||
* @param keyMetaDataFileLocation path to keystore metadata file on the file system
|
||||
* @param location path to keystore on the file system
|
||||
*/
|
||||
public KeyStoreParameters(String id, String name, String type, String keyStoreProvider,
|
||||
String keyMetaDataFileLocation, String location)
|
||||
{
|
||||
this(name, type, keyStoreProvider, keyMetaDataFileLocation, location);
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use {@link #KeyStoreParameters(String, String, String, String, String, String)} instead
|
||||
*/
|
||||
@Deprecated()
|
||||
public KeyStoreParameters(String name, String type, String keyStoreProvider,
|
||||
String keyMetaDataFileLocation, String location)
|
||||
String keyMetaDataFileLocation, String location)
|
||||
{
|
||||
super();
|
||||
this.name = name;
|
||||
@@ -84,13 +49,8 @@ public class KeyStoreParameters
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
|
||||
public void init()
|
||||
{
|
||||
if (!PropertyCheck.isValidPropertyString(getId()))
|
||||
{
|
||||
setId(null);
|
||||
}
|
||||
if (!PropertyCheck.isValidPropertyString(getLocation()))
|
||||
{
|
||||
setLocation(null);
|
||||
@@ -109,11 +69,6 @@ public class KeyStoreParameters
|
||||
}
|
||||
}
|
||||
|
||||
public String getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
@@ -138,12 +93,7 @@ public class KeyStoreParameters
|
||||
{
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setId(String id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
|
@@ -1,388 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2020 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.alfresco.encryption;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.TestName;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.junit.MockitoJUnitRunner;
|
||||
|
||||
@RunWith(MockitoJUnitRunner.class)
|
||||
public class AlfrescoKeyStoreTest
|
||||
{
|
||||
@Mock
|
||||
private EncryptionKeysRegistry encryptionKeysRegistry;
|
||||
|
||||
@Rule
|
||||
public TestName testName = new TestName();
|
||||
|
||||
@Test
|
||||
public void testSysPropConfig()
|
||||
{
|
||||
String keyStoreId = testName.getMethodName() + "-keystore";
|
||||
String alias1 = "mykey1";
|
||||
String alias2 = "mykey2";
|
||||
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setId(keyStoreId);
|
||||
keyStoreParameters.setName(testName.getMethodName());
|
||||
keyStoreParameters.setType("JCEKS");
|
||||
keyStoreParameters.setProvider("SunJCE");
|
||||
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-2.jks");
|
||||
|
||||
System.setProperty(keyStoreId + "." + "password", "ksPwd2");
|
||||
System.setProperty(keyStoreId + "." + "aliases", alias1 + "," + alias2);
|
||||
System.setProperty(keyStoreId + "." + alias1 + "." + "password", "aliasPwd1");
|
||||
System.setProperty(keyStoreId + "." + alias2 + "." + "password", "aliasPwd2");
|
||||
|
||||
try
|
||||
{
|
||||
AlfrescoKeyStore alfrescoKeyStore = new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
|
||||
Set<String> expectedAliases = new HashSet<>();
|
||||
expectedAliases.add(alias1);
|
||||
expectedAliases.add(alias2);
|
||||
Assert.assertEquals("The aliases are not correct", expectedAliases, alfrescoKeyStore.getKeyAliases());
|
||||
|
||||
Assert.assertNotNull("Failed to retrieve a key from keystore.", alfrescoKeyStore.getKey(alias1));
|
||||
Assert.assertNotNull("Failed to retrieve a key from keystore.", alfrescoKeyStore.getKey(alias2));
|
||||
}
|
||||
finally
|
||||
{
|
||||
System.clearProperty(keyStoreId + "." + "password");
|
||||
System.clearProperty(keyStoreId + "." + "aliases");
|
||||
System.clearProperty(keyStoreId + "." + alias1 + "." + "password");
|
||||
System.clearProperty(keyStoreId + "." + alias2 + "." + "password");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSysPropConfigWithoutAliases()
|
||||
{
|
||||
String keyStoreId = testName.getMethodName() + "-keystore";
|
||||
String alias1 = "mykey1";
|
||||
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setId(keyStoreId);
|
||||
keyStoreParameters.setName(testName.getMethodName());
|
||||
keyStoreParameters.setType("JCEKS");
|
||||
keyStoreParameters.setProvider("SunJCE");
|
||||
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-1.jks");
|
||||
|
||||
System.setProperty(keyStoreId + "." + "password", "ksPwd1");
|
||||
System.setProperty(keyStoreId + "." + alias1 + "." + "password", "aliasPwd1");
|
||||
try
|
||||
{
|
||||
AlfrescoKeyStore keyStore = new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
|
||||
Assert.assertNull(keyStore.getKey(alias1));
|
||||
}
|
||||
finally
|
||||
{
|
||||
System.clearProperty(keyStoreId + "." + "password");
|
||||
System.clearProperty(keyStoreId + "." + alias1 + "." + "password");
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMetaDataFileConfig()
|
||||
{
|
||||
String alias1 = "mykey1";
|
||||
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setName(testName.getMethodName());
|
||||
keyStoreParameters.setType("JCEKS");
|
||||
keyStoreParameters.setProvider("SunJCE");
|
||||
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-1.jks");
|
||||
keyStoreParameters.setKeyMetaDataFileLocation("classpath:keystore-tests/ks1-metadata.properties");
|
||||
|
||||
AlfrescoKeyStore alfrescoKeyStore = new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
|
||||
Set<String> expectedAliases = new HashSet<>();
|
||||
expectedAliases.add(alias1);
|
||||
Assert.assertEquals("The aliases are not correct", expectedAliases, alfrescoKeyStore.getKeyAliases());
|
||||
|
||||
Assert.assertNotNull("Failed to retrieve a key from keystore.", alfrescoKeyStore.getKey(alias1));
|
||||
}
|
||||
|
||||
/**
|
||||
* Config via System props should be default, but if the metadata file location is set, it will be used instead.
|
||||
* This is done to maintain backwards compatibility and simplify testing use cases.
|
||||
*/
|
||||
@Test(expected = AlfrescoRuntimeException.class)
|
||||
public void testConfigBothSystemAndFile()
|
||||
{
|
||||
String keyStoreId = testName.getMethodName() + "-keystore";
|
||||
String alias1 = "mykey1";
|
||||
String alias2 = "mykey2";
|
||||
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setId(keyStoreId);
|
||||
keyStoreParameters.setName(testName.getMethodName());
|
||||
keyStoreParameters.setType("JCEKS");
|
||||
keyStoreParameters.setProvider("SunJCE");
|
||||
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-2.jks");
|
||||
// use metadata file from keystore with one key
|
||||
keyStoreParameters.setKeyMetaDataFileLocation("classpath:keystore-tests/ks1-metadata.properties");
|
||||
|
||||
System.setProperty(keyStoreId + "." + "password", "ksPwd2");
|
||||
System.setProperty(keyStoreId + "." + "aliases", alias1 + "," + alias2);
|
||||
System.setProperty(keyStoreId + "." + alias1 + "." + "password", "aliasPwd1");
|
||||
System.setProperty(keyStoreId + "." + alias2 + "." + "password", "aliasPwd2");
|
||||
|
||||
try
|
||||
{
|
||||
new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
|
||||
}
|
||||
finally
|
||||
{
|
||||
System.clearProperty(keyStoreId + "." + "password");
|
||||
System.clearProperty(keyStoreId + "." + "aliases");
|
||||
System.clearProperty(keyStoreId + "." + alias1 + "." + "password");
|
||||
System.clearProperty(keyStoreId + "." + alias2 + "." + "password");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Test(expected = AlfrescoRuntimeException.class)
|
||||
public void testValidateKeysWrongAliasMetadataFile() throws Exception
|
||||
{
|
||||
String alias1 = "mykey1";
|
||||
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setName(testName.getMethodName());
|
||||
keyStoreParameters.setType("JCEKS");
|
||||
keyStoreParameters.setProvider("SunJCE");
|
||||
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-1.jks");
|
||||
keyStoreParameters.setKeyMetaDataFileLocation("classpath:keystore-tests/wrong-alias-metadata.properties");
|
||||
|
||||
AlfrescoKeyStoreImpl alfrescoKeyStore = new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
|
||||
alfrescoKeyStore.setKeysToValidate(Collections.singleton(alias1));
|
||||
alfrescoKeyStore.setValidateKeyChanges(true);
|
||||
alfrescoKeyStore.setEncryptionKeysRegistry(encryptionKeysRegistry);
|
||||
alfrescoKeyStore.validateKeys();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEmptyKeysMetadataFile()
|
||||
{
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setName(testName.getMethodName());
|
||||
keyStoreParameters.setType("JCEKS");
|
||||
keyStoreParameters.setProvider("SunJCE");
|
||||
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-1.jks");
|
||||
keyStoreParameters.setKeyMetaDataFileLocation("classpath:keystore-tests/empty-alias-metadata.properties");
|
||||
|
||||
new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
|
||||
}
|
||||
|
||||
@Test(expected = AlfrescoRuntimeException.class)
|
||||
public void testWrongKeystorePasswordMetadataFile()
|
||||
{
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setName(testName.getMethodName());
|
||||
keyStoreParameters.setType("JCEKS");
|
||||
keyStoreParameters.setProvider("SunJCE");
|
||||
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-1.jks");
|
||||
keyStoreParameters.setKeyMetaDataFileLocation("classpath:keystore-tests/wrong-keystore-password-metadata.properties");
|
||||
|
||||
new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
|
||||
}
|
||||
|
||||
@Test(expected = AlfrescoRuntimeException.class)
|
||||
public void testWrongKeyPasswordMetadataFile()
|
||||
{
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setName(testName.getMethodName());
|
||||
keyStoreParameters.setType("JCEKS");
|
||||
keyStoreParameters.setProvider("SunJCE");
|
||||
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-1.jks");
|
||||
keyStoreParameters.setKeyMetaDataFileLocation("classpath:keystore-tests/wrong-key-password-metadata.properties");
|
||||
|
||||
new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
|
||||
}
|
||||
|
||||
@Test(expected = AlfrescoRuntimeException.class)
|
||||
public void testValidateKeysWrongAliasSysProps() throws Exception
|
||||
{
|
||||
String keyStoreId = testName.getMethodName() + "-keystore";
|
||||
String alias1 = "mykey1";
|
||||
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setId(keyStoreId);
|
||||
keyStoreParameters.setName(testName.getMethodName());
|
||||
keyStoreParameters.setType("JCEKS");
|
||||
keyStoreParameters.setProvider("SunJCE");
|
||||
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-1.jks");
|
||||
|
||||
System.setProperty(keyStoreId + "." + "aliases", "wrong-alias,another-wrong-alias");
|
||||
System.setProperty(keyStoreId + "." + "password", "ksPwd1");
|
||||
System.setProperty(keyStoreId + "." + alias1 + "." + "password", "aliasPwd1");
|
||||
|
||||
try
|
||||
{
|
||||
AlfrescoKeyStoreImpl alfrescoKeyStore = new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
|
||||
alfrescoKeyStore.setValidateKeyChanges(true);
|
||||
alfrescoKeyStore.setKeysToValidate(Collections.singleton(alias1));
|
||||
alfrescoKeyStore.setEncryptionKeysRegistry(encryptionKeysRegistry);
|
||||
alfrescoKeyStore.validateKeys();
|
||||
}
|
||||
finally
|
||||
{
|
||||
System.clearProperty(keyStoreId + "." + "aliases");
|
||||
System.clearProperty(keyStoreId + "." + "password");
|
||||
System.clearProperty(keyStoreId + "." + alias1 + "." + "password");
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEmptyKeysSysProps()
|
||||
{
|
||||
String keyStoreId = testName.getMethodName() + "-keystore";
|
||||
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setId(keyStoreId);
|
||||
keyStoreParameters.setName(testName.getMethodName());
|
||||
keyStoreParameters.setType("JCEKS");
|
||||
keyStoreParameters.setProvider("SunJCE");
|
||||
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-1.jks");
|
||||
|
||||
System.setProperty(keyStoreId + "." + "aliases", "empty-alias,another-empty-alias");
|
||||
System.setProperty(keyStoreId + "." + "password", "ksPwd1");
|
||||
|
||||
try
|
||||
{
|
||||
new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
|
||||
}
|
||||
finally
|
||||
{
|
||||
System.clearProperty(keyStoreId + "." + "aliases");
|
||||
System.clearProperty(keyStoreId + "." + "password");
|
||||
}
|
||||
}
|
||||
|
||||
@Test(expected = AlfrescoRuntimeException.class)
|
||||
public void testWrongKeystorePasswordSysProps()
|
||||
{
|
||||
String keyStoreId = testName.getMethodName() + "-keystore";
|
||||
String alias1 = "mykey1";
|
||||
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setId(keyStoreId);
|
||||
keyStoreParameters.setName(testName.getMethodName());
|
||||
keyStoreParameters.setType("JCEKS");
|
||||
keyStoreParameters.setProvider("SunJCE");
|
||||
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-1.jks");
|
||||
|
||||
System.setProperty(keyStoreId + "." + "aliases", alias1);
|
||||
System.setProperty(keyStoreId + "." + "password", "wrong-password");
|
||||
System.setProperty(keyStoreId + "." + alias1 + "." + "password", "aliasPwd1");
|
||||
|
||||
try
|
||||
{
|
||||
new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
|
||||
}
|
||||
finally
|
||||
{
|
||||
System.clearProperty(keyStoreId + "." + "aliases");
|
||||
System.clearProperty(keyStoreId + "." + "password");
|
||||
System.clearProperty(keyStoreId + "." + alias1 + "." + "password");
|
||||
}
|
||||
}
|
||||
|
||||
@Test(expected = AlfrescoRuntimeException.class)
|
||||
public void testWrongKeyPasswordSysProps()
|
||||
{
|
||||
String keyStoreId = testName.getMethodName() + "-keystore";
|
||||
String alias1 = "mykey1";
|
||||
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setId(keyStoreId);
|
||||
keyStoreParameters.setName(testName.getMethodName());
|
||||
keyStoreParameters.setType("JCEKS");
|
||||
keyStoreParameters.setProvider("SunJCE");
|
||||
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-1.jks");
|
||||
|
||||
System.setProperty(keyStoreId + "." + "aliases", alias1);
|
||||
System.setProperty(keyStoreId + "." + "password", "ksPwd1");
|
||||
System.setProperty(keyStoreId + "." + alias1 + "." + "password", "wrong-key-password");
|
||||
|
||||
try
|
||||
{
|
||||
new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
|
||||
}
|
||||
finally
|
||||
{
|
||||
System.clearProperty(keyStoreId + "." + "aliases");
|
||||
System.clearProperty(keyStoreId + "." + "password");
|
||||
System.clearProperty(keyStoreId + "." + alias1 + "." + "password");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* No exception is expected. An empty keystore can be created.
|
||||
*/
|
||||
@Test
|
||||
public void testConfigEmptyKeystore()
|
||||
{
|
||||
String keyStoreId = testName.getMethodName() + "-keystore";
|
||||
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setId(keyStoreId);
|
||||
keyStoreParameters.setName(testName.getMethodName());
|
||||
keyStoreParameters.setType("JCEKS");
|
||||
keyStoreParameters.setProvider("SunJCE");
|
||||
keyStoreParameters.setLocation("classpath:non-existing-path/some-keystore.jks");
|
||||
|
||||
new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
|
||||
}
|
||||
|
||||
@Test(expected = AlfrescoRuntimeException.class)
|
||||
public void testValidateKeysEmptyAliasSysProps() throws Exception
|
||||
{
|
||||
String keyStoreId = testName.getMethodName() + "-keystore";
|
||||
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters();
|
||||
keyStoreParameters.setId(keyStoreId);
|
||||
keyStoreParameters.setName(testName.getMethodName());
|
||||
keyStoreParameters.setType("JCEKS");
|
||||
keyStoreParameters.setProvider("SunJCE");
|
||||
keyStoreParameters.setLocation("classpath:keystore-tests/ks-test-1.jks");
|
||||
|
||||
System.setProperty(keyStoreId + "." + "password", "ksPwd1");
|
||||
|
||||
try
|
||||
{
|
||||
AlfrescoKeyStoreImpl alfrescoKeyStore = new AlfrescoKeyStoreImpl(keyStoreParameters, new SpringKeyResourceLoader());
|
||||
alfrescoKeyStore.setValidateKeyChanges(true);
|
||||
alfrescoKeyStore.setKeysToValidate(Collections.singleton("non-existing-alias"));
|
||||
alfrescoKeyStore.setEncryptionKeysRegistry(encryptionKeysRegistry);
|
||||
alfrescoKeyStore.validateKeys();
|
||||
}
|
||||
finally
|
||||
{
|
||||
System.clearProperty(keyStoreId + "." + "password");
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,2 +0,0 @@
|
||||
aliases=empty-alias
|
||||
keystore.password=ksPwd1
|
Binary file not shown.
Binary file not shown.
@@ -1,3 +0,0 @@
|
||||
aliases=mykey1
|
||||
keystore.password=ksPwd1
|
||||
mykey1.password=aliasPwd1
|
@@ -1,24 +0,0 @@
|
||||
The keystores contained in this folder are used by tests.
|
||||
|
||||
==================
|
||||
== ks-test-1.ks ==
|
||||
==================
|
||||
|
||||
Keystore password: ksPwd1
|
||||
Keystore type: JCEKS
|
||||
Keystore provider: SunJCE
|
||||
|
||||
Your keystore contains 1 entry
|
||||
mykey1: aliasPwd1
|
||||
|
||||
==================
|
||||
== ks-test-2.ks ==
|
||||
==================
|
||||
|
||||
Keystore password: ksPwd2
|
||||
Keystore type: JCEKS
|
||||
Keystore provider: SunJCE
|
||||
|
||||
Your keystore contains 2 entries
|
||||
mykey1: aliasPwd1
|
||||
mykey2: aliasPwd2
|
@@ -1,3 +0,0 @@
|
||||
aliases=non-existing-alias
|
||||
keystore.password=ksPwd1
|
||||
mykey1.password=aliasPwd1
|
@@ -1,3 +0,0 @@
|
||||
aliases=mykey1
|
||||
keystore.password=ksPwd1
|
||||
mykey1.password=wrong-key-password
|
@@ -1,3 +0,0 @@
|
||||
aliases=mykey1
|
||||
keystore.password=wrong-password
|
||||
mykey1.password=aliasPwd1
|
@@ -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,11 +7,11 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>7.300-TEST2</version>
|
||||
<version>7.199.300-TEST5</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<!-- Files to exclude from SonarQube analysis -->
|
||||
<!-- Files to exclude from SonarQube analysis -->
|
||||
<sonar.exclusions>
|
||||
source/java/org/alfresco/repo/search/impl/parsers/CMIS*er.java,
|
||||
source/java/org/alfresco/repo/search/impl/parsers/FTSParser.java,
|
||||
@@ -147,7 +147,8 @@
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-annotations</artifactId>
|
||||
</dependency>
|
||||
<version>2.10.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.antlr</groupId>
|
||||
@@ -225,6 +226,7 @@
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.13</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@@ -22,7 +22,6 @@
|
||||
|
||||
<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">
|
||||
@@ -109,28 +108,11 @@
|
||||
<extension>acp</extension>
|
||||
</mimetype>
|
||||
<mimetype mimetype="application/vnd.visio" display="Microsoft Visio">
|
||||
<extension default="true">vsd</extension>
|
||||
<extension>vss</extension>
|
||||
<extension>vst</extension>
|
||||
<extension>vsd</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>
|
||||
|
@@ -9,6 +9,6 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>7.300-TEST2</version>
|
||||
<version>7.199.300-TEST5</version>
|
||||
</parent>
|
||||
</project>
|
||||
|
@@ -20,7 +20,6 @@ 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
|
||||
|
||||
@@ -29,12 +28,10 @@ RUN mkdir -p ${TOMCAT_DIR}/shared/classes/alfresco/extension/mimetypes && \
|
||||
# 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 ${resource_path}/dependency/licenses/ /licenses/
|
||||
COPY ${resource_path}/dependency/keystore/metadata-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
|
||||
@@ -91,9 +88,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 644 ${TOMCAT_DIR}/alfresco-mmt/alfresco-mmt-*.jar && \
|
||||
find /licenses -type d -exec chmod 0755 {} \; && \
|
||||
find /licenses -type f -exec chmod 0644 {} \;
|
||||
chmod 664 ${TOMCAT_DIR}/alfresco-mmt/alfresco-mmt-*.jar && \
|
||||
find /licenses -type d -exec chmod 0775 {} \; && \
|
||||
find /licenses -type f -exec chmod 0664 {} \;
|
||||
|
||||
EXPOSE 10001
|
||||
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>7.300-TEST2</version>
|
||||
<version>7.199.300-TEST5</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
@@ -105,7 +105,7 @@
|
||||
</execution>
|
||||
|
||||
<execution>
|
||||
<id>unpack-licenses-and-keystore</id>
|
||||
<id>unpack-licenses</id>
|
||||
<phase>process-resources</phase>
|
||||
<goals>
|
||||
<goal>unpack</goal>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>7.300-TEST2</version>
|
||||
<version>7.199.300-TEST5</version>
|
||||
</parent>
|
||||
|
||||
<profiles>
|
||||
|
@@ -10,16 +10,6 @@ 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
|
||||
@@ -49,6 +39,10 @@ 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,16 +10,6 @@ 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
|
||||
@@ -45,6 +35,10 @@ 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.300-TEST2</version>
|
||||
<version>7.199.300-TEST5</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>7.300-TEST2</version>
|
||||
<version>7.199.300-TEST5</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>7.300-TEST2</version>
|
||||
<version>7.199.300-TEST5</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>7.300-TEST2</version>
|
||||
<version>7.199.300-TEST5</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>7.300-TEST2</version>
|
||||
<version>7.199.300-TEST5</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>7.300-TEST2</version>
|
||||
<version>7.199.300-TEST5</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
@@ -7,12 +7,12 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>7.300-TEST2</version>
|
||||
<version>7.199.300-TEST5</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<scm-path>${project.parent.parent.scm.url}</scm-path>
|
||||
<scm-revision>${build-number}</scm-revision>
|
||||
<scm-path>local/development/workspace</scm-path>
|
||||
<scm-revision>${buildNumber}</scm-revision>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
@@ -41,6 +41,7 @@
|
||||
<dependency>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
<version>1.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.avalon.framework</groupId>
|
||||
@@ -71,6 +72,7 @@
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>3.0.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- Test dependencies -->
|
||||
@@ -99,6 +101,7 @@
|
||||
<dependency>
|
||||
<groupId>commons-lang</groupId>
|
||||
<artifactId>commons-lang</artifactId>
|
||||
<version>2.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
|
17
pom.xml
17
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.300-TEST2</version>
|
||||
<version>7.199.300-TEST5</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>3</acs.version.revision>
|
||||
<acs.version.revision>2</acs.version.revision>
|
||||
<acs.version.label />
|
||||
|
||||
<version.edition>Community</version.edition>
|
||||
@@ -53,7 +53,7 @@
|
||||
<dependency.activiti.version>5.23.0</dependency.activiti.version>
|
||||
<dependency.transform.model.version>1.0.2.8</dependency.transform.model.version>
|
||||
<dependency.alfresco-legacy-lucene.version>6.2</dependency.alfresco-legacy-lucene.version>
|
||||
<dependency.alfresco-greenmail.version>6.2</dependency.alfresco-greenmail.version>
|
||||
<dependency.alfresco-greenmail.version>6.1</dependency.alfresco-greenmail.version>
|
||||
|
||||
<dependency.spring.version>5.1.15.RELEASE</dependency.spring.version>
|
||||
<dependency.antlr.version>3.5.2</dependency.antlr.version>
|
||||
@@ -93,7 +93,7 @@
|
||||
<alfresco.googledrive.version>3.2.0</alfresco.googledrive.version>
|
||||
<alfresco.aos-module.version>1.3.1</alfresco.aos-module.version>
|
||||
|
||||
<dependency.postgresql.version>42.2.14</dependency.postgresql.version>
|
||||
<dependency.postgresql.version>42.2.12</dependency.postgresql.version>
|
||||
<dependency.mysql.version>8.0.19</dependency.mysql.version>
|
||||
<dependency.mariadb.version>2.6.0</dependency.mariadb.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.300-TEST2</tag>
|
||||
<tag>7.199.300-TEST5</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>
|
||||
|
@@ -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.300-TEST2</version>
|
||||
<version>7.199.300-TEST5</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
@@ -78,6 +78,7 @@
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.13</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -239,54 +240,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>
|
||||
|
@@ -208,7 +208,7 @@ public abstract class BaseSSOAuthenticationFilter extends BaseAuthenticationFilt
|
||||
{
|
||||
match = container.getRegistry().findWebScript(req.getMethod(), getScriptUrl(req));
|
||||
}
|
||||
catch (NotFoundException notFoundEx)
|
||||
catch (NotFoundException | IllegalArgumentException Ex)
|
||||
{
|
||||
getLogger().debug(req.getMethod() + " " + getScriptUrl(req) + "not found in Public API Container.");
|
||||
}
|
||||
|
@@ -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.300-TEST2</version>
|
||||
<version>7.199.300-TEST5</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
@@ -65,7 +65,6 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-compress</artifactId>
|
||||
<version>1.19</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
@@ -75,21 +74,19 @@
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
<version>1.14</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-beanutils</groupId>
|
||||
<artifactId>commons-beanutils</artifactId>
|
||||
<version>1.9.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-collections</groupId>
|
||||
<artifactId>commons-collections</artifactId>
|
||||
<version>3.2.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-pool</groupId>
|
||||
@@ -343,6 +340,7 @@
|
||||
<dependency>
|
||||
<groupId>joda-time</groupId>
|
||||
<artifactId>joda-time</artifactId>
|
||||
<version>2.10.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jaxen</groupId>
|
||||
@@ -467,7 +465,8 @@
|
||||
<dependency>
|
||||
<groupId>org.quartz-scheduler</groupId>
|
||||
<artifactId>quartz</artifactId>
|
||||
<exclusions>
|
||||
<version>2.3.2</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.mchange</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
@@ -812,6 +811,7 @@
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.13</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -1020,54 +1020,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>
|
||||
|
||||
|
@@ -43,7 +43,6 @@ 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;
|
||||
@@ -85,7 +84,6 @@ public class CreateDownloadArchiveAction extends ActionExecuterAbstractBase
|
||||
private NodeService nodeService;
|
||||
private RetryingTransactionHelper transactionHelper;
|
||||
private DownloadStatusUpdateService updateService;
|
||||
private DictionaryService dictionaryService;
|
||||
|
||||
private long maximumContentSize = -1l;
|
||||
|
||||
@@ -169,11 +167,6 @@ 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.
|
||||
*
|
||||
@@ -253,7 +246,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, dictionaryService, actionedUponNodeRef, estimator.getSize(), estimator.getFileCount());
|
||||
final ZipDownloadExporter handler = new ZipDownloadExporter(tempFile, checkOutCheckInService, nodeService, transactionHelper, updateService, downloadStorage, actionedUponNodeRef, estimator.getSize(), estimator.getFileCount());
|
||||
|
||||
try {
|
||||
exporterService.exportView(handler, crawlerParameters, null);
|
||||
|
@@ -39,7 +39,6 @@ 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;
|
||||
@@ -78,7 +77,6 @@ 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>>();
|
||||
@@ -95,12 +93,11 @@ 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, DictionaryService dictionaryService, NodeRef downloadNodeRef, long total, long totalFileCount)
|
||||
public ZipDownloadExporter(File zipFile, CheckOutCheckInService checkOutCheckInService, NodeService nodeService, RetryingTransactionHelper transactionHelper, DownloadStatusUpdateService updateService, DownloadStorage downloadStorage, NodeRef downloadNodeRef, long total, long totalFileCount)
|
||||
{
|
||||
super(checkOutCheckInService, nodeService);
|
||||
try
|
||||
@@ -109,7 +106,6 @@ public class ZipDownloadExporter extends BaseExporter
|
||||
this.updateService = updateService;
|
||||
this.transactionHelper = transactionHelper;
|
||||
this.downloadStorage = downloadStorage;
|
||||
this.dictionaryService = dictionaryService;
|
||||
|
||||
this.downloadNodeRef = downloadNodeRef;
|
||||
this.total = total;
|
||||
@@ -138,7 +134,7 @@ public class ZipDownloadExporter extends BaseExporter
|
||||
{
|
||||
this.currentName = (String)nodeService.getProperty(nodeRef, ContentModel.PROP_NAME);
|
||||
path.push(new Pair<String, NodeRef>(currentName, nodeRef));
|
||||
if (dictionaryService.isSubClass(nodeService.getType(nodeRef), ContentModel.TYPE_FOLDER))
|
||||
if (ContentModel.TYPE_FOLDER.equals(nodeService.getType(nodeRef)))
|
||||
{
|
||||
String path = getPath() + PATH_SEPARATOR;
|
||||
ZipArchiveEntry archiveEntry = new ZipArchiveEntry(path);
|
||||
|
@@ -179,7 +179,9 @@ CREATE TABLE alf_transaction
|
||||
change_txn_id VARCHAR(56) NOT NULL,
|
||||
commit_time_ms BIGINT,
|
||||
PRIMARY KEY (id),
|
||||
KEY idx_alf_txn_ctms (commit_time_ms),
|
||||
KEY idx_alf_txn_ctms (commit_time_ms, id),
|
||||
KEY idx_alf_txn_ctms_sc (commit_time_ms),
|
||||
KEY idx_alf_txn_id_ctms (id, commit_time_ms),
|
||||
KEY fk_alf_txn_svr (server_id),
|
||||
CONSTRAINT fk_alf_txn_svr FOREIGN KEY (server_id) REFERENCES alf_server (id)
|
||||
) ENGINE=InnoDB;
|
||||
@@ -222,6 +224,8 @@ CREATE TABLE alf_node
|
||||
KEY idx_alf_node_crd (audit_created, store_id, type_qname_id),
|
||||
KEY idx_alf_node_mor (audit_modifier, store_id, type_qname_id),
|
||||
KEY idx_alf_node_mod (audit_modified, store_id, type_qname_id),
|
||||
KEY idx_alf_node_ver (version),
|
||||
KEY idx_alf_node_txn (transaction_id),
|
||||
CONSTRAINT fk_alf_node_acl FOREIGN KEY (acl_id) REFERENCES alf_access_control_list (id),
|
||||
CONSTRAINT fk_alf_node_store FOREIGN KEY (store_id) REFERENCES alf_store (id),
|
||||
CONSTRAINT fk_alf_node_tqn FOREIGN KEY (type_qname_id) REFERENCES alf_qname (id),
|
||||
|
@@ -1681,6 +1681,16 @@
|
||||
<columnname>type_qname_id</columnname>
|
||||
</columnnames>
|
||||
</index>
|
||||
<index name="idx_alf_node_ver" unique="false">
|
||||
<columnnames>
|
||||
<columnname>version</columnname>
|
||||
</columnnames>
|
||||
</index>
|
||||
<index name="idx_alf_node_txn" unique="false">
|
||||
<columnnames>
|
||||
<columnname>transaction_id</columnname>
|
||||
</columnnames>
|
||||
</index>
|
||||
</indexes>
|
||||
</table>
|
||||
<table name="alf_node_aspects">
|
||||
@@ -2674,6 +2684,18 @@
|
||||
<index name="idx_alf_txn_ctms" unique="false">
|
||||
<columnnames>
|
||||
<columnname>commit_time_ms</columnname>
|
||||
<columnname>id</columnname>
|
||||
</columnnames>
|
||||
</index>
|
||||
<index name="idx_alf_txn_ctms_sc" unique="false">
|
||||
<columnnames>
|
||||
<columnname>commit_time_ms</columnname>
|
||||
</columnnames>
|
||||
</index>
|
||||
<index name="idx_alf_txn_id_ctms" unique="false">
|
||||
<columnnames>
|
||||
<columnname>id</columnname>
|
||||
<columnname>commit_time_ms</columnname>
|
||||
</columnnames>
|
||||
</index>
|
||||
<index name="fk_alf_txn_svr" unique="false">
|
||||
|
@@ -196,6 +196,8 @@ CREATE TABLE alf_transaction
|
||||
CONSTRAINT fk_alf_txn_svr FOREIGN KEY (server_id) REFERENCES alf_server (id)
|
||||
);
|
||||
CREATE INDEX idx_alf_txn_ctms ON alf_transaction (commit_time_ms, id);
|
||||
CREATE INDEX idx_alf_txn_ctms_sc ON alf_transaction (commit_time_ms);
|
||||
CREATE INDEX idx_alf_txn_id_ctms ON alf_transaction (id, commit_time_ms);
|
||||
CREATE INDEX fk_alf_txn_svr ON alf_transaction (server_id);
|
||||
|
||||
CREATE SEQUENCE alf_store_seq START WITH 1 INCREMENT BY 1;
|
||||
@@ -244,6 +246,8 @@ CREATE INDEX fk_alf_node_acl ON alf_node (acl_id);
|
||||
CREATE INDEX fk_alf_node_store ON alf_node (store_id);
|
||||
CREATE INDEX idx_alf_node_tqn ON alf_node (type_qname_id, store_id, id);
|
||||
CREATE INDEX fk_alf_node_loc ON alf_node (locale_id);
|
||||
CREATE INDEX idx_alf_node_ver ON alf_node (version);
|
||||
CREATE INDEX idx_alf_node_txn ON alf_node (transaction_id);
|
||||
|
||||
CREATE INDEX fk_alf_store_root ON alf_store (root_node_id);
|
||||
ALTER TABLE alf_store ADD CONSTRAINT fk_alf_store_root FOREIGN KEY (root_node_id) REFERENCES alf_node (id);
|
||||
|
@@ -1740,6 +1740,16 @@
|
||||
<columnname>id</columnname>
|
||||
</columnnames>
|
||||
</index>
|
||||
<index name="idx_alf_node_ver" unique="false">
|
||||
<columnnames>
|
||||
<columnname>version</columnname>
|
||||
</columnnames>
|
||||
</index>
|
||||
<index name="idx_alf_node_txn" unique="false">
|
||||
<columnnames>
|
||||
<columnname>transaction_id</columnname>
|
||||
</columnnames>
|
||||
</index>
|
||||
</indexes>
|
||||
</table>
|
||||
<table name="alf_node_aspects">
|
||||
@@ -2753,6 +2763,17 @@
|
||||
<columnname>id</columnname>
|
||||
</columnnames>
|
||||
</index>
|
||||
<index name="idx_alf_txn_ctms_sc" unique="false">
|
||||
<columnnames>
|
||||
<columnname>commit_time_ms</columnname>
|
||||
</columnnames>
|
||||
</index>
|
||||
<index name="idx_alf_txn_id_ctms" unique="false">
|
||||
<columnnames>
|
||||
<columnname>id</columnname>
|
||||
<columnname>commit_time_ms</columnname>
|
||||
</columnnames>
|
||||
</index>
|
||||
</indexes>
|
||||
</table>
|
||||
<table name="alf_usage_delta">
|
||||
|
@@ -54,6 +54,7 @@
|
||||
<ref bean="patch.db-V5.1-metadata-query-indexes" />
|
||||
<ref bean="patch.db-V5.2-remove-jbpm-tables-from-db" />
|
||||
<ref bean="patch.db-V6.0-change-set-indexes" />
|
||||
<ref bean="patch.db-V6.3-add-indexes-node-transaction" />
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
@@ -0,0 +1,35 @@
|
||||
--
|
||||
-- Title: Update alf_node and alf_transaction indexes for more performance
|
||||
-- Database: MySQL
|
||||
-- Since: V6.3
|
||||
-- Author: Eva Vasques
|
||||
--
|
||||
-- Please contact support@alfresco.com if you need assistance with the upgrade.
|
||||
--
|
||||
|
||||
DROP INDEX idx_alf_node_ver; --(optional)
|
||||
CREATE INDEX idx_alf_node_ver ON alf_node (version);
|
||||
|
||||
DROP INDEX idx_alf_node_txn; --(optional)
|
||||
CREATE INDEX idx_alf_node_txn ON alf_node (transaction_id);
|
||||
|
||||
DROP INDEX idx_alf_txn_ctms; --(optional)
|
||||
CREATE INDEX idx_alf_txn_ctms ON alf_transaction (commit_time_ms, id);
|
||||
|
||||
DROP INDEX idx_alf_txn_ctms_sc; --(optional)
|
||||
CREATE INDEX idx_alf_txn_ctms_sc ON alf_transaction (commit_time_ms);
|
||||
|
||||
DROP INDEX idx_alf_txn_id_ctms; --(optional)
|
||||
CREATE INDEX idx_alf_txn_id_ctms ON alf_transaction (id, commit_time_ms);
|
||||
|
||||
--
|
||||
-- Record script finish
|
||||
--
|
||||
DELETE FROM alf_applied_patch WHERE id = 'patch.db-V6.3-add-indexes-node-transaction';
|
||||
INSERT INTO alf_applied_patch
|
||||
(id, description, fixes_from_schema, fixes_to_schema, applied_to_schema, target_schema, applied_on_date, applied_to_server, was_executed, succeeded, report)
|
||||
VALUES
|
||||
(
|
||||
'patch.db-V6.3-add-indexes-node-transaction', 'Create aditional indexes on alf_node and alf_transaction',
|
||||
0, 13005, -1, 13006, null, 'UNKNOWN', ${TRUE}, ${TRUE}, 'Script completed'
|
||||
);
|
@@ -0,0 +1,32 @@
|
||||
--
|
||||
-- Title: Update alf_node and alf_transaction indexes for more performance
|
||||
-- Database: PostgreSQL
|
||||
-- Since: V6.3
|
||||
-- Author: Eva Vasques
|
||||
--
|
||||
-- Please contact support@alfresco.com if you need assistance with the upgrade.
|
||||
--
|
||||
|
||||
DROP INDEX idx_alf_node_ver; --(optional)
|
||||
CREATE INDEX idx_alf_node_ver ON alf_node (version);
|
||||
|
||||
DROP INDEX idx_alf_node_txn; --(optional)
|
||||
CREATE INDEX idx_alf_node_txn ON alf_node (transaction_id);
|
||||
|
||||
DROP INDEX idx_alf_txn_ctms_sc; --(optional)
|
||||
CREATE INDEX idx_alf_txn_ctms_sc ON alf_transaction (commit_time_ms);
|
||||
|
||||
DROP INDEX idx_alf_txn_id_ctms; --(optional)
|
||||
CREATE INDEX idx_alf_txn_id_ctms ON alf_transaction (id, commit_time_ms);
|
||||
|
||||
--
|
||||
-- Record script finish
|
||||
--
|
||||
DELETE FROM alf_applied_patch WHERE id = 'patch.db-V6.3-add-indexes-node-transaction';
|
||||
INSERT INTO alf_applied_patch
|
||||
(id, description, fixes_from_schema, fixes_to_schema, applied_to_schema, target_schema, applied_on_date, applied_to_server, was_executed, succeeded, report)
|
||||
VALUES
|
||||
(
|
||||
'patch.db-V6.3-add-indexes-node-transaction', 'Create aditional indexes on alf_node and alf_transaction',
|
||||
0, 13005, -1, 13006, null, 'UNKNOWN', ${TRUE}, ${TRUE}, 'Script completed'
|
||||
);
|
@@ -89,19 +89,18 @@
|
||||
<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"/>
|
||||
<property name="dictionaryService" ref="dictionaryService"/>
|
||||
</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="downloadExporterComponent" parent="exporterComponent">
|
||||
<property name="exportSecondaryNodes" value="true"/>
|
||||
|
@@ -15,12 +15,10 @@
|
||||
</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>
|
||||
|
||||
@@ -32,22 +30,18 @@
|
||||
|
||||
<!-- 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>
|
||||
|
||||
@@ -77,12 +71,10 @@
|
||||
</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>
|
||||
|
||||
|
@@ -1,10 +1,7 @@
|
||||
# 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
|
||||
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
|
@@ -400,4 +400,6 @@ patch.updateAdminUserWhenDefault.result=\n\Successfully removed password2 proper
|
||||
|
||||
patch.db-V5.2-remove-jbpm-tables-from-db.description=Removes all JBPM related tables from the database.
|
||||
|
||||
patch.db-V6.0-change-set-indexes.description=Add additional indexes to support acl tracking.
|
||||
patch.db-V6.0-change-set-indexes.description=Add additional indexes to support acl tracking.
|
||||
|
||||
patch.db-V6.3-add-indexes-node-transaction.description=Create additional indexes on alf_node and alf_transaction
|
@@ -1397,5 +1397,17 @@
|
||||
<value>classpath:alfresco/dbscripts/upgrade/6.0/${db.script.dialect}/change-set-indexes.sql</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="patch.db-V6.3-add-indexes-node-transaction" class="org.alfresco.repo.admin.patch.impl.SchemaUpgradeScriptPatch" parent="basePatch">
|
||||
<property name="id"><value>patch.db-V6.3-add-indexes-node-transaction</value></property>
|
||||
<property name="description"><value>patch.db-V6.3-add-indexes-node-transaction.description</value></property>
|
||||
<property name="fixesFromSchema"><value>0</value></property>
|
||||
<property name="fixesToSchema"><value>13005</value></property>
|
||||
<property name="targetSchema"><value>13006</value></property>
|
||||
<property name="ignored"><value>${system.new-node-transaction-indexes.ignored}</value></property>
|
||||
<property name="scriptUrl">
|
||||
<value>classpath:alfresco/dbscripts/upgrade/6.3/${db.script.dialect}/add-indexes-node-transaction.sql</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
|
@@ -3,7 +3,7 @@
|
||||
repository.name=Main Repository
|
||||
|
||||
# Schema number
|
||||
version.schema=13010
|
||||
version.schema=13006
|
||||
|
||||
# Directory configuration
|
||||
|
||||
@@ -816,22 +816,20 @@ dir.keystore=classpath:alfresco/keystore
|
||||
|
||||
# general encryption parameters
|
||||
encryption.keySpec.class=org.alfresco.encryption.DESEDEKeyGenerator
|
||||
encryption.keyAlgorithm=AES
|
||||
encryption.cipherAlgorithm=AES/CBC/PKCS5Padding
|
||||
encryption.keyAlgorithm=DESede
|
||||
encryption.cipherAlgorithm=DESede/CBC/PKCS5Padding
|
||||
|
||||
# secret key keystore configuration
|
||||
encryption.keystore.location=${dir.keystore}/keystore
|
||||
# configuration via metadata is deprecated
|
||||
encryption.keystore.keyMetaData.location=
|
||||
encryption.keystore.keyMetaData.location=${dir.keystore}/keystore-passwords.properties
|
||||
encryption.keystore.provider=
|
||||
encryption.keystore.type=pkcs12
|
||||
encryption.keystore.type=JCEKS
|
||||
|
||||
# backup secret key keystore configuration
|
||||
encryption.keystore.backup.location=${dir.keystore}/backup-keystore
|
||||
# configuration via metadata is deprecated
|
||||
encryption.keystore.backup.keyMetaData.location=
|
||||
encryption.keystore.backup.keyMetaData.location=${dir.keystore}/backup-keystore-passwords.properties
|
||||
encryption.keystore.backup.provider=
|
||||
encryption.keystore.backup.type=pkcs12
|
||||
encryption.keystore.backup.type=JCEKS
|
||||
|
||||
# Should encryptable properties be re-encrypted with new encryption keys on botstrap?
|
||||
encryption.bootstrap.reencrypt=false
|
||||
@@ -844,13 +842,11 @@ encryption.mac.algorithm=HmacSHA1
|
||||
encryption.ssl.keystore.location=${dir.keystore}/ssl.keystore
|
||||
encryption.ssl.keystore.provider=
|
||||
encryption.ssl.keystore.type=JCEKS
|
||||
# configuration via metadata is deprecated
|
||||
encryption.ssl.keystore.keyMetaData.location=
|
||||
encryption.ssl.keystore.keyMetaData.location=${dir.keystore}/ssl-keystore-passwords.properties
|
||||
encryption.ssl.truststore.location=${dir.keystore}/ssl.truststore
|
||||
encryption.ssl.truststore.provider=
|
||||
encryption.ssl.truststore.type=JCEKS
|
||||
# configuration via metadata is deprecated
|
||||
encryption.ssl.truststore.keyMetaData.location=
|
||||
encryption.ssl.truststore.keyMetaData.location=${dir.keystore}/ssl-truststore-passwords.properties
|
||||
|
||||
# Re-encryptor properties
|
||||
encryption.reencryptor.chunkSize=100
|
||||
@@ -1317,3 +1313,6 @@ system.delete_not_exists.delete_batchsize=1000
|
||||
system.delete_not_exists.read_only=false
|
||||
system.delete_not_exists.timeout_seconds=-1
|
||||
system.prop_table_cleaner.algorithm=V2
|
||||
|
||||
# Creates additional indexes on alf_node and alf_transaction. Recommended for large repositories.
|
||||
system.new-node-transaction-indexes.ignored=true
|
@@ -65,9 +65,6 @@ import org.junit.runners.Suite;
|
||||
org.alfresco.repo.content.filestore.ReadOnlyFileContentStoreTest.class,
|
||||
org.alfresco.repo.content.RoutingContentStoreTest.class,
|
||||
|
||||
org.alfresco.encryption.EncryptionTests.class,
|
||||
org.alfresco.encryption.KeyStoreTests.class
|
||||
|
||||
// TODO REPO-2791 org.alfresco.repo.content.routing.StoreSelectorAspectContentStoreTest.class,
|
||||
})
|
||||
public class AppContext02TestSuite
|
||||
|
@@ -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.encryption;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -270,6 +270,28 @@ public class EncryptionTests extends TestCase
|
||||
mainEncryptor.setKeyProvider(mainKeyProvider);
|
||||
}
|
||||
}
|
||||
|
||||
public void testBootstrapReEncrypt()
|
||||
{
|
||||
try
|
||||
{
|
||||
// ensure that the backup key store is not available
|
||||
backupKeyStoreParameters.setLocation("");
|
||||
//backupKeyStore.reload();
|
||||
mainKeyStore.reload();
|
||||
|
||||
reEncryptor.bootstrapReEncrypt();
|
||||
fail("Should have caught missing backup key store");
|
||||
}
|
||||
catch(MissingKeyException e)
|
||||
{
|
||||
System.out.println("Successfully caught missing key exception");
|
||||
}
|
||||
catch(InvalidKeystoreException e)
|
||||
{
|
||||
fail("Unexpected exception: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
protected void testChangeKeysImpl(boolean cacheCiphers) throws Throwable
|
||||
{
|
||||
|
@@ -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.encryption;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
@@ -37,7 +37,6 @@ import java.security.NoSuchAlgorithmException;
|
||||
import java.security.SecureRandom;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
@@ -213,7 +212,7 @@ public class KeyStoreTests
|
||||
|
||||
TestAlfrescoKeyStore missingMainKeyStore = getKeyStore("main", "JCEKS", Collections.singletonMap(KeyProvider.ALIAS_METADATA, "metadata"),
|
||||
Collections.singletonMap(KeyProvider.ALIAS_METADATA, generateEncodedKey()), generateKeystoreName(), generateKeystoreName());
|
||||
missingMainKeyStore.setKeysToValidate(new HashSet<>(Collections.singletonList("metadata")));
|
||||
|
||||
encryptionKeysRegistry.unregisterKey(KeyProvider.ALIAS_METADATA);
|
||||
keyStoreChecker.setMainKeyStore(missingMainKeyStore);
|
||||
|
||||
@@ -241,7 +240,7 @@ public class KeyStoreTests
|
||||
// missing main keystore, missing backup keystore, metadata registered key -> error, re-instate the keystore
|
||||
TestAlfrescoKeyStore missingMainKeyStore = getKeyStore("main", "JCEKS", Collections.singletonMap(KeyProvider.ALIAS_METADATA, "metadata"),
|
||||
null, generateKeystoreName(), generateKeystoreName());
|
||||
missingMainKeyStore.setKeysToValidate(new HashSet<>(Collections.singletonList("metadata")));
|
||||
|
||||
assertTrue("", encryptionKeysRegistry.isKeyRegistered("metadata"));
|
||||
|
||||
keyStoreChecker.setMainKeyStore(missingMainKeyStore);
|
||||
@@ -269,7 +268,6 @@ public class KeyStoreTests
|
||||
// create main keystore
|
||||
TestAlfrescoKeyStore mainKeyStore = getKeyStore("main", "JCEKS", Collections.singletonMap(KeyProvider.ALIAS_METADATA, "metadata"),
|
||||
null, generateKeystoreName(), generateKeystoreName());
|
||||
mainKeyStore.setKeysToValidate(new HashSet<>(Collections.singletonList("metadata")));
|
||||
createAndPopulateKeyStore(mainKeyStore);
|
||||
|
||||
// de-register metadata key
|
||||
@@ -305,7 +303,6 @@ public class KeyStoreTests
|
||||
|
||||
TestAlfrescoKeyStore keyStore = getKeyStore("main", "JCEKS", Collections.singletonMap(KeyProvider.ALIAS_METADATA, "metadata"),
|
||||
null, generateKeystoreName(), generateKeystoreName());
|
||||
keyStore.setKeysToValidate(new HashSet<>(Collections.singletonList("metadata")));
|
||||
createAndPopulateKeyStore(keyStore);
|
||||
|
||||
keyStoreChecker.setMainKeyStore(keyStore);
|
||||
@@ -361,7 +358,6 @@ public class KeyStoreTests
|
||||
|
||||
TestAlfrescoKeyStore keyStore = getKeyStore("main", "JCEKS", Collections.singletonMap(KeyProvider.ALIAS_METADATA, "metadata"),
|
||||
null, generateKeystoreName(), generateKeystoreName());
|
||||
keyStore.setKeysToValidate(new HashSet<>(Collections.singletonList("metadata")));
|
||||
createAndPopulateKeyStore(keyStore);
|
||||
|
||||
try
|
||||
|
@@ -34,7 +34,6 @@ import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.security.permissions.AccessDeniedException;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||
import org.alfresco.service.cmr.admin.RepoAdminService;
|
||||
import org.alfresco.service.cmr.coci.CheckOutCheckInService;
|
||||
import org.alfresco.service.cmr.download.DownloadService;
|
||||
import org.alfresco.service.cmr.download.DownloadStatus;
|
||||
@@ -70,11 +69,8 @@ import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
import org.junit.rules.RuleChain;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -127,7 +123,6 @@ public class DownloadServiceIntegrationTest
|
||||
private static PermissionService PERMISSION_SERVICE;
|
||||
private static RetryingTransactionHelper TRANSACTION_HELPER;
|
||||
private static IntegrityChecker INTEGRITY_CHECKER;
|
||||
private static RepoAdminService REPO_ADMIN_SERVICE;
|
||||
|
||||
// Test Content
|
||||
private NodeRef rootFolder;
|
||||
@@ -141,41 +136,6 @@ public class DownloadServiceIntegrationTest
|
||||
private Set<String> allEntries;
|
||||
|
||||
private NodeRef fileToCheckout;
|
||||
|
||||
// MNT-21671 Download as zip does not include custom folders.
|
||||
// Define a custom model that is child of cm:folder
|
||||
private static final String CUSTOM_FOLDER_MODEL_XML =
|
||||
"<model name=\"custom:customModel\" xmlns=\"http://www.alfresco.org/model/dictionary/1.0\">" +
|
||||
" <description>Custom Model</description>" +
|
||||
" <author></author>" +
|
||||
" <version>1.0</version>" +
|
||||
|
||||
" <imports>" +
|
||||
" <import uri=\"http://www.alfresco.org/model/dictionary/1.0\" prefix=\"d\"/>" +
|
||||
" <import uri=\"http://www.alfresco.org/model/content/1.0\" prefix=\"cm\"/>" +
|
||||
" </imports>" +
|
||||
|
||||
" <namespaces>" +
|
||||
" <namespace uri=\"custom.model\" prefix=\"custom\"/>" +
|
||||
" </namespaces>" +
|
||||
|
||||
" <types>" +
|
||||
" <type name=\"custom:folderx\">" +
|
||||
" <title>Custom FolderX</title>" +
|
||||
" <parent>cm:folder</parent>" +
|
||||
" <properties>" +
|
||||
" <property name=\"custom:invoice\">" +
|
||||
" <type>d:text</type>" +
|
||||
" </property>" +
|
||||
" </properties>" +
|
||||
" <associations>" +
|
||||
" </associations>" +
|
||||
" </type>" +
|
||||
" </types>" +
|
||||
|
||||
" <aspects>" +
|
||||
" </aspects>" +
|
||||
"</model>";
|
||||
|
||||
@BeforeClass public static void init()
|
||||
{
|
||||
@@ -191,7 +151,6 @@ public class DownloadServiceIntegrationTest
|
||||
INTEGRITY_CHECKER.setEnabled(true);
|
||||
INTEGRITY_CHECKER.setFailOnViolation(true);
|
||||
INTEGRITY_CHECKER.setTraceOn(true);
|
||||
REPO_ADMIN_SERVICE = APP_CONTEXT_INIT.getApplicationContext().getBean("RepoAdminService", RepoAdminService.class);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -244,24 +203,6 @@ public class DownloadServiceIntegrationTest
|
||||
allEntries.add("rootFolder/level1Folder2/fileToCheckout.txt");
|
||||
PERMISSION_SERVICE.setPermission(level1Folder2, TEST_USER.getUsername(), PermissionService.ALL_PERMISSIONS, true);
|
||||
PERMISSION_SERVICE.setPermission(fileToCheckout, TEST_USER.getUsername(), PermissionService.ALL_PERMISSIONS, true);
|
||||
|
||||
// MNT-21671 Download as zip does not include custom folders.
|
||||
// deploy custom model
|
||||
final String modelFileName1 = "model-MNT-21671.xml";
|
||||
InputStream modelStream = null;
|
||||
try
|
||||
{
|
||||
modelStream = new ByteArrayInputStream(CUSTOM_FOLDER_MODEL_XML.getBytes("UTF-8"));
|
||||
}
|
||||
catch (UnsupportedEncodingException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
REPO_ADMIN_SERVICE.deployModel(modelStream, modelFileName1);
|
||||
final QName customFolderType = QName.createQName("{custom.model}folderx");
|
||||
|
||||
testNodes.createNode(rootFolder, "level1CustomFolder", customFolderType, AuthenticationUtil.getAdminUserName());
|
||||
allEntries.add("rootFolder/level1CustomFolder/");
|
||||
}
|
||||
|
||||
@Test public void createDownload() throws IOException, InterruptedException
|
||||
|
@@ -34,7 +34,6 @@ import java.io.Serializable;
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
@@ -85,7 +84,6 @@ import org.alfresco.util.testing.category.LuceneTests;
|
||||
import org.alfresco.util.testing.category.RedundantTests;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
@@ -398,73 +396,8 @@ public class ImapMessageTest extends TestCase
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSearchTermWithNonEnglishLocale() throws Exception
|
||||
{
|
||||
folder = (IMAPFolder) store.getFolder(TEST_FOLDER);
|
||||
folder.open(Folder.READ_ONLY);
|
||||
|
||||
Locale defaultLocale = Locale.getDefault();
|
||||
try
|
||||
{
|
||||
Locale.setDefault(Locale.FRENCH);
|
||||
String dateStr = "12-Jul-2020";
|
||||
final IMAPFolder.ProtocolCommand uid_search_since = new IMAPFolder.ProtocolCommand()
|
||||
{
|
||||
@Override
|
||||
public Object doCommand(IMAPProtocol protocol)
|
||||
{
|
||||
return protocol.command("UID SEARCH SINCE " + dateStr, null);
|
||||
}
|
||||
};
|
||||
// UID SEARCH SINCE
|
||||
Response[] ret = (Response[]) folder.doCommand(uid_search_since);
|
||||
IMAPResponse response = (IMAPResponse) ret[0];
|
||||
assertEquals("* SEARCH ", response.toString());
|
||||
}
|
||||
catch (MessagingException e)
|
||||
{
|
||||
fail("Date cannot be parsed");
|
||||
}
|
||||
finally
|
||||
{
|
||||
Locale.setDefault(defaultLocale);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSearchTermWithNonEnglishLocaleFalsePositive() throws Exception
|
||||
{
|
||||
Locale defaultLocale = Locale.getDefault();
|
||||
try
|
||||
{
|
||||
folder = (IMAPFolder) store.getFolder(TEST_FOLDER);
|
||||
folder.open(Folder.READ_ONLY);
|
||||
|
||||
Locale.setDefault(Locale.FRENCH);
|
||||
String dateStr = "12-juil.-2020";
|
||||
final IMAPFolder.ProtocolCommand uid_search_since = new IMAPFolder.ProtocolCommand()
|
||||
{
|
||||
@Override
|
||||
public Object doCommand(IMAPProtocol protocol)
|
||||
{
|
||||
return protocol.command("UID SEARCH SINCE " + dateStr, null);
|
||||
}
|
||||
};
|
||||
// UID SEARCH SINCE
|
||||
Response[] ret = (Response[]) folder.doCommand(uid_search_since);
|
||||
assertEquals("java.net.SocketException: Connection reset", ret[0].getException().toString());
|
||||
}
|
||||
catch (MessagingException e)
|
||||
{
|
||||
// expected
|
||||
}
|
||||
finally
|
||||
{
|
||||
Locale.setDefault(defaultLocale);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void testUnmodifiedMessage() throws Exception
|
||||
{
|
||||
// Get test message UID
|
||||
@@ -840,7 +773,7 @@ public class ImapMessageTest extends TestCase
|
||||
txn.commit();
|
||||
|
||||
// Closing client connection
|
||||
folder.forceClose();
|
||||
folder.close(false);
|
||||
store.close();
|
||||
logger.debug("tearDown end");
|
||||
}
|
||||
|
@@ -1151,7 +1151,7 @@ public class ImapServiceImplTest extends TestCase
|
||||
* MNT-12773
|
||||
* @throws AddressException
|
||||
*/
|
||||
public void testSearchTerms() throws AddressException
|
||||
public void testSearchTerms() throws AddressException
|
||||
{
|
||||
List<AlfrescoImapFolder> mf = imapService.listMailboxes(user, IMAP_ROOT+"/"+TEST_IMAP_FOLDER_NAME+"/_*", false);
|
||||
ArrayList<Long> res = new ArrayList<Long>();
|
||||
|
@@ -52,16 +52,9 @@ mimetype.config.cronExpression=0 0 0 ? JAN * 1970
|
||||
rendition.config.cronExpression=0 0 0 ? JAN * 1970
|
||||
local.transform.service.cronExpression=0 0 0 ? JAN * 1970
|
||||
transform.service.cronExpression=0 0 0 ? JAN * 1970
|
||||
|
||||
|
||||
system.delete_not_exists.batchsize=100000
|
||||
system.delete_not_exists.delete_batchsize=1000
|
||||
system.delete_not_exists.read_only=false
|
||||
system.delete_not_exists.timeout_seconds=-1
|
||||
system.prop_table_cleaner.algorithm=V2
|
||||
|
||||
# For testing only
|
||||
encryption.keystore.keyMetaData.location=${dir.keystore}/keystore-passwords.properties
|
||||
encryption.keyAlgorithm=DESede
|
||||
encryption.cipherAlgorithm=DESede/CBC/PKCS5Padding
|
||||
encryption.keystore.type=JCEKS
|
||||
encryption.keystore.backup.type=JCEKS
|
||||
|
Reference in New Issue
Block a user