mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
RM-817: Error: "Unknown aspect specified in query: rma:unpublishedUpdate" in alfresco with RM
* ensure the job doesn't execute before the RM content model is loaded git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@54461 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -30,6 +30,7 @@ import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
|||||||
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
||||||
import org.alfresco.repo.transaction.RetryingTransactionHelper;
|
import org.alfresco.repo.transaction.RetryingTransactionHelper;
|
||||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||||
|
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
import org.alfresco.service.cmr.repository.NodeService;
|
import org.alfresco.service.cmr.repository.NodeService;
|
||||||
import org.alfresco.service.cmr.repository.StoreRef;
|
import org.alfresco.service.cmr.repository.StoreRef;
|
||||||
@@ -57,29 +58,47 @@ public class PublishUpdatesJobExecuter extends RecordsManagementJobExecuter
|
|||||||
/** Publish executor register */
|
/** Publish executor register */
|
||||||
private PublishExecutorRegistry publishExecutorRegistry;
|
private PublishExecutorRegistry publishExecutorRegistry;
|
||||||
|
|
||||||
|
/** Dictionary service */
|
||||||
|
private DictionaryService dictionaryService;
|
||||||
|
|
||||||
/** Behaviour filter */
|
/** Behaviour filter */
|
||||||
private BehaviourFilter behaviourFilter;
|
private BehaviourFilter behaviourFilter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param nodeService node service
|
||||||
|
*/
|
||||||
public void setNodeService(NodeService nodeService)
|
public void setNodeService(NodeService nodeService)
|
||||||
{
|
{
|
||||||
this.nodeService = nodeService;
|
this.nodeService = nodeService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param searchService search service
|
||||||
|
*/
|
||||||
public void setSearchService(SearchService searchService)
|
public void setSearchService(SearchService searchService)
|
||||||
{
|
{
|
||||||
this.searchService = searchService;
|
this.searchService = searchService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param publishExecutorRegistry public executor registry
|
||||||
|
*/
|
||||||
public void setPublishExecutorRegistry(PublishExecutorRegistry publishExecutorRegistry)
|
public void setPublishExecutorRegistry(PublishExecutorRegistry publishExecutorRegistry)
|
||||||
{
|
{
|
||||||
this.publishExecutorRegistry = publishExecutorRegistry;
|
this.publishExecutorRegistry = publishExecutorRegistry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param behaviourFilter behaviour filter
|
||||||
|
*/
|
||||||
public void setBehaviourFilter(BehaviourFilter behaviourFilter)
|
public void setBehaviourFilter(BehaviourFilter behaviourFilter)
|
||||||
{
|
{
|
||||||
this.behaviourFilter = behaviourFilter;
|
this.behaviourFilter = behaviourFilter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see org.alfresco.module.org_alfresco_module_rm.job.RecordsManagementJobExecuter#executeImpl()
|
||||||
|
*/
|
||||||
public void executeImpl()
|
public void executeImpl()
|
||||||
{
|
{
|
||||||
if (logger.isDebugEnabled() == true)
|
if (logger.isDebugEnabled() == true)
|
||||||
@@ -90,6 +109,8 @@ public class PublishUpdatesJobExecuter extends RecordsManagementJobExecuter
|
|||||||
AuthenticationUtil.runAs(new RunAsWork<Object>()
|
AuthenticationUtil.runAs(new RunAsWork<Object>()
|
||||||
{
|
{
|
||||||
public Object doWork() throws Exception
|
public Object doWork() throws Exception
|
||||||
|
{
|
||||||
|
if (rmLoaded() == true)
|
||||||
{
|
{
|
||||||
// Get a list of the nodes that have updates that need to be published
|
// Get a list of the nodes that have updates that need to be published
|
||||||
List<NodeRef> nodeRefs = getUpdatedNodes();
|
List<NodeRef> nodeRefs = getUpdatedNodes();
|
||||||
@@ -132,6 +153,7 @@ public class PublishUpdatesJobExecuter extends RecordsManagementJobExecuter
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
}, AuthenticationUtil.getSystemUserName());
|
}, AuthenticationUtil.getSystemUserName());
|
||||||
@@ -142,6 +164,24 @@ public class PublishUpdatesJobExecuter extends RecordsManagementJobExecuter
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper method to determine whether the RM content model has been loaded yet.
|
||||||
|
*
|
||||||
|
* @return boolean true if RM content model loaded, false otherwise
|
||||||
|
*/
|
||||||
|
private boolean rmLoaded()
|
||||||
|
{
|
||||||
|
boolean result = false;
|
||||||
|
|
||||||
|
// ensure that the rm content model has been loaded
|
||||||
|
if (dictionaryService.getAspect(ASPECT_UNPUBLISHED_UPDATE) != null)
|
||||||
|
{
|
||||||
|
result = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a list of the nodes with updates pending publish
|
* Get a list of the nodes with updates pending publish
|
||||||
* @return List<NodeRef> list of node refences with updates pending publication
|
* @return List<NodeRef> list of node refences with updates pending publication
|
||||||
|
Reference in New Issue
Block a user