mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Merged V2.0 to HEAD
5136: AR-918 5137, 5138: AWC-1083 5139: WCM-309, WCM-311 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5325 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -204,7 +204,7 @@ public class TransformActionExecuter extends ActionExecuterAbstractBase
|
||||
|
||||
// Calculate the destination name
|
||||
String originalName = (String)nodeService.getProperty(actionedUponNodeRef, ContentModel.PROP_NAME);
|
||||
String newName = transformName(this.mimetypeService, originalName, mimeType);
|
||||
String newName = transformName(this.mimetypeService, originalName, mimeType, true);
|
||||
|
||||
// Since we are overwriting we need to figure out whether the destination node exists
|
||||
NodeRef copyNodeRef = null;
|
||||
@@ -260,7 +260,7 @@ public class TransformActionExecuter extends ActionExecuterAbstractBase
|
||||
String originalTitle = (String)nodeService.getProperty(actionedUponNodeRef, ContentModel.PROP_TITLE);
|
||||
if (originalTitle != null && originalTitle.length() > 0)
|
||||
{
|
||||
String newTitle = transformName(this.mimetypeService, originalTitle, mimeType);
|
||||
String newTitle = transformName(this.mimetypeService, originalTitle, mimeType, false);
|
||||
nodeService.setProperty(copyNodeRef, ContentModel.PROP_TITLE, newTitle);
|
||||
}
|
||||
}
|
||||
@@ -317,7 +317,7 @@ public class TransformActionExecuter extends ActionExecuterAbstractBase
|
||||
*
|
||||
* @return name with new extension as appropriate for the mimetype
|
||||
*/
|
||||
public static String transformName(MimetypeService mimetypeService, String original, String newMimetype)
|
||||
public static String transformName(MimetypeService mimetypeService, String original, String newMimetype, boolean alwaysAdd)
|
||||
{
|
||||
// get the current extension
|
||||
int dotIndex = original.lastIndexOf('.');
|
||||
@@ -326,15 +326,23 @@ public class TransformActionExecuter extends ActionExecuterAbstractBase
|
||||
{
|
||||
// we found it
|
||||
sb.append(original.substring(0, dotIndex));
|
||||
}
|
||||
else
|
||||
{
|
||||
// no extension
|
||||
sb.append(original);
|
||||
}
|
||||
|
||||
// add the new extension
|
||||
String newExtension = mimetypeService.getExtension(newMimetype);
|
||||
sb.append('.').append(newExtension);
|
||||
}
|
||||
else
|
||||
{
|
||||
// no extension so dont add a new one
|
||||
sb.append(original);
|
||||
|
||||
if (alwaysAdd == true)
|
||||
{
|
||||
// add the new extension
|
||||
String newExtension = mimetypeService.getExtension(newMimetype);
|
||||
sb.append('.').append(newExtension);
|
||||
}
|
||||
}
|
||||
// done
|
||||
return sb.toString();
|
||||
}
|
||||
|
@@ -171,6 +171,9 @@ public class DbAccessControlListImpl extends LifecycleAdapter
|
||||
// remove from the entry list
|
||||
entry.delete();
|
||||
}
|
||||
// Fix issues with deleting and adding permissions
|
||||
// See AR-918
|
||||
this.getSession().flush();
|
||||
// done
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
|
@@ -1390,7 +1390,7 @@ public class Node implements Serializable, Scopeable
|
||||
{
|
||||
// Copy the content node to a new node
|
||||
String copyName = TransformActionExecuter.transformName(this.services.getMimetypeService(), getName(),
|
||||
mimetype);
|
||||
mimetype, true);
|
||||
NodeRef copyNodeRef = this.services.getCopyService().copy(this.nodeRef, destination,
|
||||
ContentModel.ASSOC_CONTAINS,
|
||||
QName.createQName(ContentModel.PROP_CONTENT.getNamespaceURI(), QName.createValidLocalName(copyName)),
|
||||
|
Reference in New Issue
Block a user