mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-15 15:02:20 +00:00
Merged 5.0.N (5.0.4) to 5.1.N (5.1.1)
120957 rneamtu: Merged NESS/5.0.N-2016-01-05/ (5.0.4) to 5.0.N (5.0.4) 120843: MNT-14386 : renditionService.render method is creating a temporary file in User's trashcan - Added temporary aspect on temporary rendition before delete it 120927: MNT-14386 : renditionService.render method is creating a temporary file in User's trashcan - Added a test for case git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.1.N/root@120969 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -980,6 +980,9 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
|
||||
String renditionName = getRenditionName(tempRenditionNode, renditionLocation, renditionDefinition);
|
||||
nodeService.setProperty(renditionNode.getChildRef(), ContentModel.PROP_NAME, renditionName); // to manager
|
||||
|
||||
// Add temporary aspect for temporary rendition node
|
||||
// When this node id deleted, will not appear in user's trashcan
|
||||
nodeService.addAspect(tempRendition.getChildRef(), ContentModel.ASPECT_TEMPORARY, null);
|
||||
// Delete the temporary rendition.
|
||||
nodeService.removeChildAssociation(tempRendition);
|
||||
if (logger.isDebugEnabled())
|
||||
|
@@ -264,6 +264,7 @@ public class RenditionServiceIntegrationTest extends BaseAlfrescoSpringTest
|
||||
final QName renditionName = QName.createQName(NamespaceService.RENDITION_MODEL_1_0_URI,
|
||||
"htmlRenderingDefinition");
|
||||
|
||||
int numberOfItemsInTrashcanBeforeRendition = getNumberOfItemsInTrashcan();
|
||||
this.renditionNode = transactionHelper
|
||||
.doInTransaction(new RetryingTransactionHelper.RetryingTransactionCallback<NodeRef>()
|
||||
{
|
||||
@@ -294,6 +295,22 @@ public class RenditionServiceIntegrationTest extends BaseAlfrescoSpringTest
|
||||
}
|
||||
});
|
||||
|
||||
//testcase for MNT-14386
|
||||
int numberOfItemsInTrashcanAfterRendition = getNumberOfItemsInTrashcan();
|
||||
assertEquals(numberOfItemsInTrashcanBeforeRendition, numberOfItemsInTrashcanAfterRendition);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method returns the number of items from trashcan
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
private int getNumberOfItemsInTrashcan()
|
||||
{
|
||||
NodeRef archiveRootNodeRef = nodeService.getRootNode(StoreRef.STORE_REF_ARCHIVE_SPACESSTORE);
|
||||
return nodeService.countChildAssocs(archiveRootNodeRef, true);
|
||||
|
||||
}
|
||||
|
||||
public void testRenderFreeMarkerTemplateOneTransaction() throws Exception
|
||||
|
Reference in New Issue
Block a user