Compare commits

..

9 Commits

Author SHA1 Message Date
kshah
4c406c1301 Merge branch 'master' into APPS-2000_Data_dictionary_Issue 2023-07-24 19:21:26 +05:30
Kacper Magdziarz
693f8cd5c9 [ACS-5578] Remove cmistck servlet (#2083) 2023-07-24 15:24:01 +02:00
pksingh
32bdf67969 Fixing failure issues 2023-07-24 17:53:19 +05:30
alfresco-build
083bd3ce35 [maven-release-plugin][skip ci] prepare for next development iteration 2023-07-23 00:08:00 +00:00
alfresco-build
aef7febbf5 [maven-release-plugin][skip ci] prepare release 23.1.0.167 2023-07-23 00:07:57 +00:00
Alfresco CI User
db1644dbb2 [force] Force release for 2023-07-23. 2023-07-23 00:03:20 +00:00
pksingh
b5076c6fdd Fixing failure issues 2023-07-19 21:55:11 +05:30
pksingh
78359d396f Fixing failure issue 2023-07-19 16:56:59 +05:30
pksingh
bcba412d73 [APPS-2000] Data Dictionary folder deletion behaviour should be consistent 2023-07-19 14:25:45 +05:30
29 changed files with 50 additions and 76 deletions

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-amps</artifactId>
<version>23.1.0.167-SNAPSHOT</version>
<version>23.1.0.168-SNAPSHOT</version>
</parent>
<modules>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-governance-services-community-parent</artifactId>
<version>23.1.0.167-SNAPSHOT</version>
<version>23.1.0.168-SNAPSHOT</version>
</parent>
<modules>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-governance-services-automation-community-repo</artifactId>
<version>23.1.0.167-SNAPSHOT</version>
<version>23.1.0.168-SNAPSHOT</version>
</parent>
<build>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-governance-services-community-parent</artifactId>
<version>23.1.0.167-SNAPSHOT</version>
<version>23.1.0.168-SNAPSHOT</version>
</parent>
<modules>

View File

@@ -8,7 +8,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
<version>23.1.0.167-SNAPSHOT</version>
<version>23.1.0.168-SNAPSHOT</version>
</parent>
<properties>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
<version>23.1.0.167-SNAPSHOT</version>
<version>23.1.0.168-SNAPSHOT</version>
</parent>
<build>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>23.1.0.167-SNAPSHOT</version>
<version>23.1.0.168-SNAPSHOT</version>
</parent>
<modules>

View File

@@ -8,7 +8,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-amps</artifactId>
<version>23.1.0.167-SNAPSHOT</version>
<version>23.1.0.168-SNAPSHOT</version>
</parent>
<properties>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>23.1.0.167-SNAPSHOT</version>
<version>23.1.0.168-SNAPSHOT</version>
</parent>
<dependencies>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>23.1.0.167-SNAPSHOT</version>
<version>23.1.0.168-SNAPSHOT</version>
</parent>
<properties>

View File

@@ -39,7 +39,6 @@ public class DirectAccessUrl implements Serializable
private String contentUrl;
private Date expiryTime;
private boolean attachment;
private String fileName;
public String getContentUrl()
{
@@ -71,28 +70,18 @@ public class DirectAccessUrl implements Serializable
this.attachment = attachment;
}
public String getFileName()
{
return fileName;
}
public void setFileName(String fileName)
{
this.fileName = fileName;
}
@Override public boolean equals(Object obj)
{
if (this == obj) return true;
if (obj == null || getClass() != obj.getClass()) return false;
DirectAccessUrl that = (DirectAccessUrl) obj;
return Objects.equals(fileName, that.fileName) && attachment == that.attachment && Objects.equals(contentUrl,
return attachment == that.attachment && Objects.equals(contentUrl,
that.contentUrl) && Objects.equals(expiryTime, that.expiryTime);
}
@Override public int hashCode()
{
return Objects.hash(contentUrl, expiryTime, attachment, fileName);
return Objects.hash(contentUrl, expiryTime, attachment);
}
}

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>23.1.0.167-SNAPSHOT</version>
<version>23.1.0.168-SNAPSHOT</version>
</parent>
<dependencies>

View File

@@ -9,6 +9,6 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-packaging</artifactId>
<version>23.1.0.167-SNAPSHOT</version>
<version>23.1.0.168-SNAPSHOT</version>
</parent>
</project>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-packaging</artifactId>
<version>23.1.0.167-SNAPSHOT</version>
<version>23.1.0.168-SNAPSHOT</version>
</parent>
<properties>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>23.1.0.167-SNAPSHOT</version>
<version>23.1.0.168-SNAPSHOT</version>
</parent>
<modules>

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-packaging</artifactId>
<version>23.1.0.167-SNAPSHOT</version>
<version>23.1.0.168-SNAPSHOT</version>
</parent>
<modules>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-tests</artifactId>
<version>23.1.0.167-SNAPSHOT</version>
<version>23.1.0.168-SNAPSHOT</version>
</parent>
<organization>

View File

@@ -9,7 +9,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-tests</artifactId>
<version>23.1.0.167-SNAPSHOT</version>
<version>23.1.0.168-SNAPSHOT</version>
</parent>
<developers>

View File

@@ -9,7 +9,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-tests</artifactId>
<version>23.1.0.167-SNAPSHOT</version>
<version>23.1.0.168-SNAPSHOT</version>
</parent>
<developers>

View File

@@ -8,7 +8,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-tests</artifactId>
<version>23.1.0.167-SNAPSHOT</version>
<version>23.1.0.168-SNAPSHOT</version>
</parent>
<properties>

View File

@@ -9,7 +9,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-tests</artifactId>
<version>23.1.0.167-SNAPSHOT</version>
<version>23.1.0.168-SNAPSHOT</version>
</parent>
<developers>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-packaging</artifactId>
<version>23.1.0.167-SNAPSHOT</version>
<version>23.1.0.168-SNAPSHOT</version>
</parent>
<properties>

View File

@@ -388,12 +388,6 @@
<load-on-startup>8</load-on-startup>
</servlet>
<servlet>
<servlet-name>cmistck</servlet-name>
<servlet-class>org.apache.chemistry.opencmis.tck.runner.WebRunnerServlet</servlet-class>
<load-on-startup>8</load-on-startup>
</servlet>
<servlet>
<servlet-name>publicapiServlet</servlet-name>
<servlet-class>org.alfresco.rest.api.PublicApiWebScriptServlet</servlet-class>
@@ -469,14 +463,6 @@
<servlet-name>publicapiServlet</servlet-name>
<url-pattern>/api/*</url-pattern>
</servlet-mapping>
<!-- The CMIS TCK is deactivated by default. -->
<!-- CMISTCK
<servlet-mapping>
<servlet-name>cmistck</servlet-name>
<url-pattern>/cmistck</url-pattern>
</servlet-mapping>
CMISTCK -->
<!-- Enterprise servlet-mapping placeholder -->

View File

@@ -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>23.1.0.167-SNAPSHOT</version>
<version>23.1.0.168-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Alfresco Community Repo Parent</name>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>23.1.0.167-SNAPSHOT</version>
<version>23.1.0.168-SNAPSHOT</version>
</parent>
<dependencies>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>23.1.0.167-SNAPSHOT</version>
<version>23.1.0.168-SNAPSHOT</version>
</parent>
<dependencies>

View File

@@ -655,9 +655,6 @@ public class ContentServiceImpl implements ContentService, ApplicationContextAwa
try
{
directAccessUrl = store.requestContentDirectUrl(contentUrl, attachment, fileName, contentMimetype, validFor);
if (directAccessUrl != null) {
directAccessUrl.setFileName(fileName);
}
}
catch (UnsupportedOperationException ex)
{

View File

@@ -101,7 +101,9 @@ import org.alfresco.util.PropertyMap;
import org.alfresco.util.transaction.TransactionListenerAdapter;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.dao.ConcurrencyFailureException;
import org.springframework.extensions.surf.util.I18NUtil;
import org.springframework.transaction.annotation.Transactional;
/**
* Node service using database persistence layer to fulfill functionality
@@ -1068,11 +1070,13 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl implements Extens
* @param allowArchival <tt>true</tt> if normal archival may occur or
* <tt>false</tt> if the node must be forcibly deleted
*/
@Transactional
private void deleteNode(NodeRef nodeRef, boolean allowArchival)
{
// The node(s) involved may not be pending deletion
checkPendingDelete(nodeRef);
// Pair contains NodeId, NodeRef
Pair<Long, NodeRef> nodePair = getNodePairNotNull(nodeRef);
Long nodeId = nodePair.getFirst();
@@ -1100,7 +1104,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl implements Extens
// Gather information about the hierarchy
NodeHierarchyWalker walker = new NodeHierarchyWalker(nodeDAO);
walker.walkHierarchy(nodePair, childAssocPair);
// Protect the nodes from being link/unlinked for the remainder of the process
Set<NodeRef> nodesPendingDelete = new HashSet<NodeRef>(walker.getNodes(false).size());
for (VisitedNode visitedNode : walker.getNodes(true))
@@ -1109,7 +1113,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl implements Extens
}
Set<NodeRef> nodesPendingDeleteTxn = TransactionalResourceHelper.getSet(KEY_PENDING_DELETE_NODES);
nodesPendingDeleteTxn.addAll(nodesPendingDelete); // We need to remove these later, again
// Work out whether we need to archive or delete the node.
if (!allowArchival)
{
@@ -1150,7 +1154,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl implements Extens
}
}
}
// Propagate timestamps
propagateTimeStamps(childAssocRef);
@@ -1199,7 +1203,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl implements Extens
}
invokeBeforeDeleteChildAssociation(secondaryParentAssocPair.getSecond());
}
// Primary child associations
if (archive)
{
@@ -1207,7 +1211,7 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl implements Extens
}
invokeBeforeDeleteNode(nodeToDelete.nodeRef);
}
// Archive, if necessary
if (archive)
{
@@ -1263,8 +1267,18 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl implements Extens
QName childNodeTypeQName = nodeDAO.getNodeType(nodeToDelete.id);
Set<QName> childAspectQnames = nodeDAO.getNodeAspects(nodeToDelete.id);
// Delete the node
nodeDAO.deleteChildAssoc(nodeToDelete.primaryParentAssocPair.getFirst());
nodeDAO.deleteNode(nodeToDelete.id);
for (VisitedNode assocRefRemoved : nodesToDelete)
{
if (!nodeDAO.exists(assocRefRemoved.id))
{
throw new ConcurrencyFailureException("Child association not found : " + assocRefRemoved.id);
}
nodeDAO.deleteChildAssoc(assocRefRemoved.id);
invokeOnDeleteNode(assocRefRemoved.primaryParentAssocPair.getSecond(),
childNodeTypeQName, childAspectQnames, archive);
}
invokeOnDeleteNode(
nodeToDelete.primaryParentAssocPair.getSecond(),
childNodeTypeQName, childAspectQnames, archive);

View File

@@ -166,46 +166,34 @@ public class ContentServiceImplUnitTest
@Test
public void testRequestContentDirectUrl_StoreRequestContentDirectUrlIsCalledWithFileNameOverride()
{
DirectAccessUrl mockDirectAccessUrl = new DirectAccessUrl();
mockDirectAccessUrl.setAttachment(true);
mockDirectAccessUrl.setContentUrl(SOME_CONTENT_URL);
final String fileNameOverride = "fileNameOverride.txt";
setupSystemWideDirectAccessConfig(ENABLED);
when(mockContentStore.isContentDirectUrlEnabled()).thenReturn(ENABLED);
when(mockContentStore.requestContentDirectUrl(anyString(), eq(true), eq(fileNameOverride), anyString(), anyLong())).thenReturn(mockDirectAccessUrl);
DirectAccessUrl directAccessUrl = contentService.requestContentDirectUrl(NODE_REF, PROP_CONTENT_QNAME, true, 20L, fileNameOverride);
assertEquals("fileName was not set properly on the DirectAccessUrl response", fileNameOverride, directAccessUrl.getFileName());
assertNull(directAccessUrl);
verify(mockContentStore, times(1)).requestContentDirectUrl(anyString(), eq(true), eq(fileNameOverride), anyString(), anyLong());
}
@Test
public void testRequestContentDirectUrl_StoreRequestContentDirectUrlIsCalledWithNodeNamePropertyWhenFileNameOverrideIsNull()
{
DirectAccessUrl mockDirectAccessUrl = new DirectAccessUrl();
mockDirectAccessUrl.setAttachment(true);
mockDirectAccessUrl.setContentUrl(SOME_CONTENT_URL);
setupSystemWideDirectAccessConfig(ENABLED);
when(mockContentStore.isContentDirectUrlEnabled()).thenReturn(ENABLED);
when(mockContentStore.requestContentDirectUrl(anyString(), eq(true), eq(SOME_FILE_NAME), anyString(), anyLong())).thenReturn(mockDirectAccessUrl);
DirectAccessUrl directAccessUrl = contentService.requestContentDirectUrl(NODE_REF, PROP_CONTENT_QNAME, true, 20L, null);
assertEquals("fileName was not set properly on the DirectAccessUrl response", SOME_FILE_NAME, directAccessUrl.getFileName());
assertNull(directAccessUrl);
verify(mockContentStore, times(1)).requestContentDirectUrl(anyString(), eq(true), eq(SOME_FILE_NAME), anyString(), anyLong());
}
@Test
public void testRequestContentDirectUrl_StoreRequestContentDirectUrlIsCalledWithNodeNamePropertyWhenFileNameOverrideIsEmpty()
{
DirectAccessUrl mockDirectAccessUrl = new DirectAccessUrl();
mockDirectAccessUrl.setAttachment(true);
mockDirectAccessUrl.setContentUrl(SOME_CONTENT_URL);
setupSystemWideDirectAccessConfig(ENABLED);
when(mockContentStore.isContentDirectUrlEnabled()).thenReturn(ENABLED);
when(mockContentStore.requestContentDirectUrl(anyString(), eq(true), eq(SOME_FILE_NAME), anyString(), anyLong())).thenReturn(mockDirectAccessUrl);
DirectAccessUrl directAccessUrl = contentService.requestContentDirectUrl(NODE_REF, PROP_CONTENT_QNAME, true, 20L, "");
assertEquals("fileName was not set properly on the DirectAccessUrl response", SOME_FILE_NAME, directAccessUrl.getFileName());
assertNull(directAccessUrl);
verify(mockContentStore, times(1)).requestContentDirectUrl(anyString(), eq(true), eq(SOME_FILE_NAME), anyString(), anyLong());
}