mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM-3727 - fixed query and exposed cron job expression in properties
This commit is contained in:
@@ -51,6 +51,11 @@ rm.autocompletesuggestion.nodeParameterSuggester.aspectsAndTypes=rma:record,cm:c
|
|||||||
#
|
#
|
||||||
rm.dispositionlifecycletrigger.cronexpression=0 0/5 * * * ?
|
rm.dispositionlifecycletrigger.cronexpression=0 0/5 * * * ?
|
||||||
|
|
||||||
|
#
|
||||||
|
# Global RM notify of records due for review cron job expression
|
||||||
|
#
|
||||||
|
rm.notifyOfRecordsDueForReview.cronExpression=0 0/8 * * * ?
|
||||||
|
|
||||||
#
|
#
|
||||||
# Records contributors group
|
# Records contributors group
|
||||||
#
|
#
|
||||||
|
@@ -47,7 +47,7 @@
|
|||||||
</property>
|
</property>
|
||||||
<property name="cronExpression">
|
<property name="cronExpression">
|
||||||
<!-- <value>0 30 2 * * ?</value> -->
|
<!-- <value>0 30 2 * * ?</value> -->
|
||||||
<value>0 0/15 * * * ?</value>
|
<value>${rm.notifyOfRecordsDueForReview.cronExpression}</value>
|
||||||
</property>
|
</property>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
|
@@ -91,12 +91,8 @@ public class NotifyOfRecordsDueForReviewJobExecuter extends RecordsManagementJob
|
|||||||
// Query is for all records that are due for review and for which
|
// Query is for all records that are due for review and for which
|
||||||
// notification has not been sent.
|
// notification has not been sent.
|
||||||
StringBuilder queryBuffer = new StringBuilder();
|
StringBuilder queryBuffer = new StringBuilder();
|
||||||
queryBuffer.append("+ASPECT:\"rma:vitalRecord\" ");
|
queryBuffer.append("ASPECT:\"rma:vitalRecord\" ");
|
||||||
queryBuffer.append("+(@rma\\:reviewAsOf:[MIN TO NOW] ) ");
|
queryBuffer.append("AND @rma\\:reviewAsOf:[MIN TO NOW] ");
|
||||||
queryBuffer.append("+( ");
|
|
||||||
queryBuffer.append("@rma\\:notificationIssued:false ");
|
|
||||||
queryBuffer.append("OR ISNULL:\"rma:notificationIssued\" ");
|
|
||||||
queryBuffer.append(") ");
|
|
||||||
String query = queryBuffer.toString();
|
String query = queryBuffer.toString();
|
||||||
|
|
||||||
ResultSet results = searchService.query(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, SearchService.LANGUAGE_FTS_ALFRESCO, query);
|
ResultSet results = searchService.query(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, SearchService.LANGUAGE_FTS_ALFRESCO, query);
|
||||||
|
@@ -30,6 +30,7 @@ package org.alfresco.module.org_alfresco_module_rm.vital;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import org.alfresco.module.org_alfresco_module_rm.action.RMActionExecuterAbstractBase;
|
import org.alfresco.module.org_alfresco_module_rm.action.RMActionExecuterAbstractBase;
|
||||||
|
import org.alfresco.repo.dictionary.types.period.Immediately;
|
||||||
import org.alfresco.service.cmr.action.Action;
|
import org.alfresco.service.cmr.action.Action;
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
@@ -78,6 +79,21 @@ public class ReviewedAction extends RMActionExecuterAbstractBase
|
|||||||
private void reviewRecord(NodeRef nodeRef, VitalRecordDefinition vrDef)
|
private void reviewRecord(NodeRef nodeRef, VitalRecordDefinition vrDef)
|
||||||
{
|
{
|
||||||
// Calculate the next review date
|
// Calculate the next review date
|
||||||
|
if (vrDef.getReviewPeriod().getPeriodType().equals(Immediately.PERIOD_TYPE))
|
||||||
|
{
|
||||||
|
// Log
|
||||||
|
if (logger.isDebugEnabled())
|
||||||
|
{
|
||||||
|
StringBuilder msg = new StringBuilder();
|
||||||
|
msg.append("Removind reviewAsOf property from")
|
||||||
|
.append(nodeRef);
|
||||||
|
logger.debug(msg.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
this.getNodeService().removeProperty(nodeRef, PROP_REVIEW_AS_OF);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
Date reviewAsOf = vrDef.getNextReviewDate();
|
Date reviewAsOf = vrDef.getNextReviewDate();
|
||||||
if (reviewAsOf != null)
|
if (reviewAsOf != null)
|
||||||
{
|
{
|
||||||
@@ -93,7 +109,8 @@ public class ReviewedAction extends RMActionExecuterAbstractBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.getNodeService().setProperty(nodeRef, PROP_REVIEW_AS_OF, reviewAsOf);
|
this.getNodeService().setProperty(nodeRef, PROP_REVIEW_AS_OF, reviewAsOf);
|
||||||
//TODO And record previous review date, time, user
|
// TODO And record previous review date, time, user
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user