mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Improve the exception if you try to check out an older version of the document
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@34369 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1769,10 +1769,17 @@ public class AlfrescoCmisServiceImpl extends AbstractCmisService implements Alfr
|
||||
|
||||
CMISNodeInfo info = getOrCreateNodeInfo(objectId.getValue(), "Object");
|
||||
|
||||
// check for current version
|
||||
if (!info.isVariant(CMISObjectVariant.CURRENT_VERSION))
|
||||
// Check for current version
|
||||
if (info.isVariant(CMISObjectVariant.CURRENT_VERSION))
|
||||
{
|
||||
throw new CmisInvalidArgumentException("Only documents can be checked out!");
|
||||
// Good
|
||||
}
|
||||
else if (info.isVariant(CMISObjectVariant.VERSION))
|
||||
{
|
||||
throw new CmisInvalidArgumentException("Can't check out an old version of a document");
|
||||
}
|
||||
else {
|
||||
throw new CmisInvalidArgumentException("Only documents can be checked out! Object was a " + info.getObjectVariant().toString());
|
||||
}
|
||||
|
||||
// get object
|
||||
|
Reference in New Issue
Block a user