ACE-3195 "Master key removal leads to Document Library and Dashboards errors"

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@89115 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Steven Glover
2014-10-24 14:05:03 +00:00
parent 613db46e5f
commit 5018316faf
4 changed files with 140 additions and 6 deletions

View File

@@ -614,9 +614,56 @@ public abstract class AbstractContentDataDAOImpl implements ContentDataDAO
* @return Returns the number of rows deleted
*/
protected abstract int deleteContentDataEntity(Long id);
protected abstract int deleteContentUrlEntity(long id);
protected abstract int updateContentUrlEntity(ContentUrlEntity existing, ContentUrlEntity entity);
@Override
public boolean updateContentUrlKey(String contentUrl, ContentUrlKeyEntity contentUrlKey)
{
boolean success = true;
ContentUrlEntity existing = getContentUrl(contentUrl);
if(existing != null)
{
ContentUrlEntity entity = ContentUrlEntity.setContentUrlKey(existing, contentUrlKey);
updateContentUrl(entity);
}
else
{
if (logger.isDebugEnabled())
{
logger.debug("No content url, not updating symmetric key");
}
success = false;
}
return success;
}
@Override
public boolean updateContentUrlKey(long contentUrlId, ContentUrlKeyEntity contentUrlKey)
{
boolean success = true;
ContentUrlEntity existing = getContentUrl(contentUrlId);
if(existing != null)
{
ContentUrlEntity entity = ContentUrlEntity.setContentUrlKey(existing, contentUrlKey);
updateContentUrl(entity);
}
else
{
if (logger.isDebugEnabled())
{
logger.debug("No content url, not updating symmetric key");
}
success = false;
}
return success;
}
/**
* Transactional listener that deletes unreferenced <b>content_url</b> entities.
*