if(dc.loadResults().size()>0){
if(contentlet.getMap().get(Contentlet.DONT_VALIDATE_ME) != null){
Logger.debug(this, "forcing checking with no version as the _dont_validate_me is set and inode exists");
createNewVersion = false;
}else{
throw new DotContentletStateException("Contentlet must not exist already");
}
} else {
saveWithExistingID=true;
existingInode=contentlet.getInode();
contentlet.setInode(null);
Identifier ident=APILocator.getIdentifierAPI().find(contentlet.getIdentifier());
if(ident==null || !UtilMethods.isSet(ident.getId())) {
existingIdentifier=contentlet.getIdentifier();
contentlet.setIdentifier(null);
}
}
}
if (!createNewVersion && contentlet != null && !InodeUtils.isSet(contentlet.getInode()))
throw new DotContentletStateException("Contentlet must exist already");
if (contentlet != null && contentlet.isArchived() && contentlet.getMap().get(Contentlet.DONT_VALIDATE_ME) == null)
throw new DotContentletStateException("Unable to checkin an archived piece of content, please un-archive first");
if (!perAPI.doesUserHavePermission(InodeUtils.isSet(contentlet.getIdentifier()) ? contentlet : contentlet.getStructure(),
PermissionAPI.PERMISSION_WRITE, user, respectFrontendRoles)) {
List<Role> rolesPublish = perAPI.getRoles(contentlet.getStructure().getPermissionId(), PermissionAPI.PERMISSION_PUBLISH, "CMS Owner", 0, -1);
List<Role> rolesWrite = perAPI.getRoles(contentlet.getStructure().getPermissionId(), PermissionAPI.PERMISSION_WRITE, "CMS Owner", 0, -1);
Role cmsOwner = APILocator.getRoleAPI().loadCMSOwnerRole();