RM-7051 simplyfing sql and adding check for links

This commit is contained in:
Ross Gale
2019-11-21 01:16:37 +00:00
parent 9099444e2d
commit 022647d84b
3 changed files with 14 additions and 19 deletions

View File

@@ -9,7 +9,6 @@
</parameterMap> </parameterMap>
<parameterMap id="parameter_folderPatchPaging" type="map"> <parameterMap id="parameter_folderPatchPaging" type="map">
<parameter property="dispositionQnameId" jdbcType="BIGINT" javaType="java.lang.Long"/>
<parameter property="processed" jdbcType="BIGINT" javaType="java.lang.Long"/> <parameter property="processed" jdbcType="BIGINT" javaType="java.lang.Long"/>
<parameter property="folderQnameId" jdbcType="BIGINT" javaType="java.lang.Long"/> <parameter property="folderQnameId" jdbcType="BIGINT" javaType="java.lang.Long"/>
<parameter property="start" jdbcType="BIGINT" javaType="java.lang.Long"/> <parameter property="start" jdbcType="BIGINT" javaType="java.lang.Long"/>
@@ -42,15 +41,10 @@
select alfn.id , alfs.protocol, alfs.identifier, alfn.uuid select alfn.id , alfs.protocol, alfs.identifier, alfn.uuid
from alf_node alfn, from alf_node alfn,
alf_store alfs alf_store alfs
where alfn.id in ( where alfn.id not in (
select node_id
from alf_node_properties
where qname_id = ?
and boolean_value = true
and node_id not in (
select node_id select node_id
from alf_node_aspects from alf_node_aspects
where qname_id = ? )) where qname_id = ? )
and type_qname_id = ? and type_qname_id = ?
and alfn.store_id = alfs.id and alfn.store_id = alfs.id
and alfn.id between ? and ? and alfn.id between ? and ?

View File

@@ -109,8 +109,6 @@ public class RecordsManagementQueryDAOImpl implements RecordsManagementQueryDAO,
public List<NodeRef> getRecordFoldersWithSchedules(Long start, Long end) public List<NodeRef> getRecordFoldersWithSchedules(Long start, Long end)
{ {
Map<String, Object> params = new HashMap<String, Object>(2); Map<String, Object> params = new HashMap<String, Object>(2);
params.put("dispositionQnameId", qnameDAO.getQName(PROP_RS_HAS_DISPOITION_SCHEDULE)
.getFirst());
params.put("processed", qnameDAO.getQName(ASPECT_DISPOSITION_PROCESSED) params.put("processed", qnameDAO.getQName(ASPECT_DISPOSITION_PROCESSED)
.getFirst()); .getFirst());
params.put("folderQnameId",qnameDAO.getQName(TYPE_RECORD_FOLDER).getFirst()); params.put("folderQnameId",qnameDAO.getQName(TYPE_RECORD_FOLDER).getFirst());

View File

@@ -96,7 +96,7 @@ public class UpdateRecordScheduleGet extends AbstractWebScript implements Record
private static final String SUCCESS_STATUS = "success"; private static final String SUCCESS_STATUS = "success";
private static final String MODEL_STATUS = "responsestatus"; private static final String MODEL_STATUS = "responsestatus";
private static final String MODEL_MESSAGE = "message"; private static final String MODEL_MESSAGE = "message";
private static final String MESSAGE_ALL_TEMPLATE = "Updated {0} records with updated disposition instructions."; private static final String MESSAGE_ALL_TEMPLATE = "Updated {0} records from {1} folders with updated disposition instructions.";
private static final String MESSAGE_FOLDER_TEMPLATE = "Updated records in folder {0} with updated disposition instructions."; private static final String MESSAGE_FOLDER_TEMPLATE = "Updated records in folder {0} with updated disposition instructions.";
/** services */ /** services */
@@ -204,7 +204,7 @@ public class UpdateRecordScheduleGet extends AbstractWebScript implements Record
break; break;
} }
} }
message = MessageFormat.format(MESSAGE_ALL_TEMPLATE, processedRecords); message = MessageFormat.format(MESSAGE_ALL_TEMPLATE, processedRecords, processedRecordFolders);
} }
model.put(MODEL_STATUS, SUCCESS_STATUS); model.put(MODEL_STATUS, SUCCESS_STATUS);
@@ -374,7 +374,7 @@ public class UpdateRecordScheduleGet extends AbstractWebScript implements Record
{ {
DispositionSchedule schedule = dispositionService.getDispositionSchedule(recordFolder); DispositionSchedule schedule = dispositionService.getDispositionSchedule(recordFolder);
int innerRecordCount = 0; int innerRecordCount = 0;
if (schedule.isRecordLevelDisposition()) if (schedule != null && schedule.isRecordLevelDisposition())
{ {
List<NodeRef> records = recordService.getRecords(recordFolder); List<NodeRef> records = recordService.getRecords(recordFolder);
@@ -382,14 +382,17 @@ public class UpdateRecordScheduleGet extends AbstractWebScript implements Record
{ {
if (!nodeService.hasAspect(record, ASPECT_DISPOSITION_LIFECYCLE)) if (!nodeService.hasAspect(record, ASPECT_DISPOSITION_LIFECYCLE))
{ {
if (logger.isDebugEnabled()) if (recordFolder.equals(nodeService.getPrimaryParent(record).getParentRef()))
{ {
logger.info("updating record: " + record); if (logger.isDebugEnabled())
{
logger.info("updating record: " + record);
}
behaviourFilter.disableBehaviour(record);
dispositionService.updateNextDispositionAction(record, schedule);
innerRecordCount++;
behaviourFilter.enableBehaviour(record);
} }
behaviourFilter.disableBehaviour(record);
dispositionService.updateNextDispositionAction(record, schedule);
innerRecordCount++;
behaviourFilter.enableBehaviour(record);
} }
} }