mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Merged V2.0 to HEAD
5450: (from V1.4) 5423 (V1.4): CIFS authentication 5451: (from V1.4) 5432 (V1.4): 'No root node' fix 5437 (V1.4): EHCache upgrade 5440 (V1.4): AR-1355 - Ticket cache config fix 5442 (V1.4): Bootstrap reorganization 5446 (V1.4): AR-1353 5452: (from V1.4) 5391: AR-1310 (script rename fix) 5453: Win32NetBIOS LANA 5454: CIFS unused code git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5483 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -46,7 +46,9 @@ import org.alfresco.service.ServiceRegistry;
|
||||
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
import org.alfresco.service.cmr.lock.LockStatus;
|
||||
import org.alfresco.service.cmr.model.FileExistsException;
|
||||
import org.alfresco.service.cmr.model.FileInfo;
|
||||
import org.alfresco.service.cmr.model.FileNotFoundException;
|
||||
import org.alfresco.service.cmr.repository.AssociationRef;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.ContentData;
|
||||
@@ -298,6 +300,24 @@ public class Node implements Serializable, Scopeable
|
||||
{
|
||||
if (name != null)
|
||||
{
|
||||
QName typeQName = getType();
|
||||
if ((services.getDictionaryService().isSubClass(typeQName, ContentModel.TYPE_FOLDER) &&
|
||||
!services.getDictionaryService().isSubClass(typeQName, ContentModel.TYPE_SYSTEM_FOLDER)) ||
|
||||
services.getDictionaryService().isSubClass(typeQName, ContentModel.TYPE_CONTENT))
|
||||
{
|
||||
try
|
||||
{
|
||||
this.services.getFileFolderService().rename(this.nodeRef, name);
|
||||
}
|
||||
catch (FileExistsException e)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Failed to rename node " + nodeRef + " to " + name, e);
|
||||
}
|
||||
catch (FileNotFoundException e)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Failed to rename node " + nodeRef + " to " + name, e);
|
||||
}
|
||||
}
|
||||
this.getProperties().put(ContentModel.PROP_NAME.toString(), name.toString());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user