diff --git a/ole-app/ole-db/ole-liquibase/ole-liquibase-changeset/src/main/resources/ole-bootstrap/attributes/krcr_parm_t.csv b/ole-app/ole-db/ole-liquibase/ole-liquibase-changeset/src/main/resources/ole-bootstrap/attributes/krcr_parm_t.csv index e0ade133d2..890368f0a9 100644 --- a/ole-app/ole-db/ole-liquibase/ole-liquibase-changeset/src/main/resources/ole-bootstrap/attributes/krcr_parm_t.csv +++ b/ole-app/ole-db/ole-liquibase/ole-liquibase-changeset/src/main/resources/ole-bootstrap/attributes/krcr_parm_t.csv @@ -862,3 +862,4 @@ OLE-DLVR,Deliver,ASR_ITEM_RETRIVED,118,"1","CONFG",csp,This is for configuring A "OLE-DESC","Describe","PROCESS_SOLR_IND","OLE7006","1","CONFG","true","This parameter is added for docstore API process for solr indexing","A","OLE" "OLE-DESC","Describe","SLEEP_TIME_FOR_ORDER_PROCESS","OLE7060","1","CONFG","1000","This parameter value is used for holding the sleep time for order process.","A","OLE" "OLE-DESC","Describe","MAX_NO_OF_THREAD_FOR_EXPORT_SERVICE","OLE7061","1","CONFG","10","This parameter value is used for holding the max number of thread for export process.","A","OLE" +"OLE-DESC","Describe","PROCESS_AUDIT_FOR_BIB_HOLDINGS_ITEM","OLE7062","1","CONFG","Y","This parameter value is used for holding value to decide whether need to do auditing for bib, holdings and item.","A","OLE" diff --git a/ole-app/ole-db/ole-liquibase/ole-liquibase-upgrade/src/main/resources/org/kuali/ole/2.1/data/krcr_parm_t.csv b/ole-app/ole-db/ole-liquibase/ole-liquibase-upgrade/src/main/resources/org/kuali/ole/2.1/data/krcr_parm_t.csv index 4ff5e08fcc..69fd81d9b8 100644 --- a/ole-app/ole-db/ole-liquibase/ole-liquibase-upgrade/src/main/resources/org/kuali/ole/2.1/data/krcr_parm_t.csv +++ b/ole-app/ole-db/ole-liquibase/ole-liquibase-upgrade/src/main/resources/org/kuali/ole/2.1/data/krcr_parm_t.csv @@ -17,4 +17,5 @@ NMSPC_CD,CMPNT_CD,PARM_NM,OBJ_ID,VER_NBR,PARM_TYP_CD,VAL,PARM_DESC_TXT,EVAL_OPRT "OLE-DLVR","Deliver","DEFAULT_USER_FOR_REST_CALLS","OLE7058","1","CONFG","ole-quickstart","This parameter value is used for configuring the default user for the rest calls.","A","OLE" "OLE-DESC","Describe","CHUNK_SIZE_FOR_BATCH_PROCESSING","OLE7059","1","CONFG","1000","This parameter value is used for configuring the chunk size for batch processing.","A","OLE" "OLE-DESC","Describe","SLEEP_TIME_FOR_ORDER_PROCESS","OLE7060","1","CONFG","1000","This parameter value is used for holding the sleep time for order process.","A","OLE" -"OLE-DESC","Describe","MAX_NO_OF_THREAD_FOR_EXPORT_SERVICE","OLE7061","1","CONFG","10","This parameter value is used for holding the max number of thread for export process.","A","OLE" \ No newline at end of file +"OLE-DESC","Describe","MAX_NO_OF_THREAD_FOR_EXPORT_SERVICE","OLE7061","1","CONFG","10","This parameter value is used for holding the max number of thread for export process.","A","OLE" +"OLE-DESC","Describe","PROCESS_AUDIT_FOR_BIB_HOLDINGS_ITEM","OLE7062","1","CONFG","Y","This parameter value is used for holding value to decide whether need to do auditing for bib, holdings and item.","A","OLE" \ No newline at end of file diff --git a/ole-common/ole-utility/src/main/java/org/kuali/ole/constants/OleNGConstants.java b/ole-common/ole-utility/src/main/java/org/kuali/ole/constants/OleNGConstants.java index 10dcca60c6..c8ce7d8cbf 100644 --- a/ole-common/ole-utility/src/main/java/org/kuali/ole/constants/OleNGConstants.java +++ b/ole-common/ole-utility/src/main/java/org/kuali/ole/constants/OleNGConstants.java @@ -416,5 +416,11 @@ public static final class BatchProcess { public final static String ERR_HOLDINGS_HAS_REQ_OR_PO = "Requisition/PO linked with holdings/eholdings : "; public final static String ERR_ITEM_HAS_REQ_OR_PO = "Requisition/PO linked with item : "; public static final String MAX_NO_OF_THREAD_FOR_EXPORT_SERVICE = "MAX_NO_OF_THREAD_FOR_EXPORT_SERVICE"; + public static final String PROCESS_AUDIT_FOR_BIB_HOLDINGS_ITEM = "PROCESS_AUDIT_FOR_BIB_HOLDINGS_ITEM"; + + + public static final String DESCRIBE_COMPONENT = "Describe"; + public static final String DESC_NMSPC = "OLE-DESC"; + public static final String APPL_ID_OLE = "OLE"; } diff --git a/ole-docstore/ole-docstore-engine/src/main/java/org/kuali/ole/docstore/engine/service/storage/rdbms/RdbmsAbstarctDocumentManager.java b/ole-docstore/ole-docstore-engine/src/main/java/org/kuali/ole/docstore/engine/service/storage/rdbms/RdbmsAbstarctDocumentManager.java index fbd8ed0a20..2b392d7a16 100644 --- a/ole-docstore/ole-docstore-engine/src/main/java/org/kuali/ole/docstore/engine/service/storage/rdbms/RdbmsAbstarctDocumentManager.java +++ b/ole-docstore/ole-docstore-engine/src/main/java/org/kuali/ole/docstore/engine/service/storage/rdbms/RdbmsAbstarctDocumentManager.java @@ -2,6 +2,7 @@ import org.apache.commons.lang.StringUtils; import org.kuali.ole.DocumentUniqueIDPrefix; +import org.kuali.ole.constants.OleNGConstants; import org.kuali.ole.docstore.DocStoreConstants; import org.kuali.ole.docstore.common.exception.DocstoreException; import org.kuali.ole.docstore.common.exception.DocstoreResources; @@ -182,4 +183,9 @@ public String getParameter(String applicationId, String namespace, String compon return parameter!=null?parameter.getValue():null; } + public boolean isAuditRequired() { + return ParameterValueResolver.getInstance().getParameterAsBoolean(OleNGConstants + .APPL_ID_OLE, OleNGConstants.DESC_NMSPC, OleNGConstants.DESCRIBE_COMPONENT, OleNGConstants.PROCESS_AUDIT_FOR_BIB_HOLDINGS_ITEM); + } + } diff --git a/ole-docstore/ole-docstore-engine/src/main/java/org/kuali/ole/docstore/engine/service/storage/rdbms/RdbmsBibDocumentManager.java b/ole-docstore/ole-docstore-engine/src/main/java/org/kuali/ole/docstore/engine/service/storage/rdbms/RdbmsBibDocumentManager.java index d5e125bbcb..116b9f7887 100644 --- a/ole-docstore/ole-docstore-engine/src/main/java/org/kuali/ole/docstore/engine/service/storage/rdbms/RdbmsBibDocumentManager.java +++ b/ole-docstore/ole-docstore-engine/src/main/java/org/kuali/ole/docstore/engine/service/storage/rdbms/RdbmsBibDocumentManager.java @@ -101,14 +101,16 @@ public void update(Object object) { } createBibInfoRecord(bibRecord); - try { - OleAuditManager.getInstance().audit(BibAudit.class,oldBibRecord,bibRecord,bibRecord.getBibId(),"ole"); - } catch (ClassNotFoundException e) { - e.printStackTrace(); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } catch (InstantiationException e) { - e.printStackTrace(); + if (Boolean.TRUE == isAuditRequired()) { + try { + OleAuditManager.getInstance().audit(BibAudit.class,oldBibRecord,bibRecord,bibRecord.getBibId(),"ole"); + } catch (ClassNotFoundException e) { + e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } catch (InstantiationException e) { + e.printStackTrace(); + } } } diff --git a/ole-docstore/ole-docstore-engine/src/main/java/org/kuali/ole/docstore/engine/service/storage/rdbms/RdbmsHoldingsDocumentManager.java b/ole-docstore/ole-docstore-engine/src/main/java/org/kuali/ole/docstore/engine/service/storage/rdbms/RdbmsHoldingsDocumentManager.java index 1445dd7ef8..3db977124e 100644 --- a/ole-docstore/ole-docstore-engine/src/main/java/org/kuali/ole/docstore/engine/service/storage/rdbms/RdbmsHoldingsDocumentManager.java +++ b/ole-docstore/ole-docstore-engine/src/main/java/org/kuali/ole/docstore/engine/service/storage/rdbms/RdbmsHoldingsDocumentManager.java @@ -473,16 +473,18 @@ public void update(Object object) { content = workHoldingOlemlRecordProcessor.toXML(oleHoldings); holdings.setContent(content); buildLabelForHoldings(holdingsRecord, holdings); - try { - oldHoldingsRecord = processHoldingsForAudit(oldHoldingsRecord); - holdingsRecord = processHoldingsForAudit(holdingsRecord); - List auditList= OleAuditManager.getInstance().audit(HoldingsAudit.class, oldHoldingsRecord, holdingsRecord, holdingsRecord.getHoldingsId(), "ole"); - } catch (ClassNotFoundException e) { - e.printStackTrace(); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } catch (InstantiationException e) { - e.printStackTrace(); + if (Boolean.TRUE == isAuditRequired()) { + try { + oldHoldingsRecord = processHoldingsForAudit(oldHoldingsRecord); + holdingsRecord = processHoldingsForAudit(holdingsRecord); + List auditList= OleAuditManager.getInstance().audit(HoldingsAudit.class, oldHoldingsRecord, holdingsRecord, holdingsRecord.getHoldingsId(), "ole"); + } catch (ClassNotFoundException e) { + e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } catch (InstantiationException e) { + e.printStackTrace(); + } } } diff --git a/ole-docstore/ole-docstore-engine/src/main/java/org/kuali/ole/docstore/engine/service/storage/rdbms/RdbmsItemDocumentManager.java b/ole-docstore/ole-docstore-engine/src/main/java/org/kuali/ole/docstore/engine/service/storage/rdbms/RdbmsItemDocumentManager.java index 1a8fdce7d4..1470a659c1 100644 --- a/ole-docstore/ole-docstore-engine/src/main/java/org/kuali/ole/docstore/engine/service/storage/rdbms/RdbmsItemDocumentManager.java +++ b/ole-docstore/ole-docstore-engine/src/main/java/org/kuali/ole/docstore/engine/service/storage/rdbms/RdbmsItemDocumentManager.java @@ -171,10 +171,12 @@ public void update(Object object) { String content = itemOlemlRecordProcessor.toXML(item); itemDocument.setContent(content); try { - oldItemRecord = processItemRecordForAudit(oldItemRecord); - ItemRecord modifiedItemRecord = (ItemRecord) SerializationUtils.clone(itemRecord); - modifiedItemRecord = processItemRecordForAudit(modifiedItemRecord); - List itemAuditedFields = OleAuditManager.getInstance().audit(ItemAudit.class, oldItemRecord, modifiedItemRecord, itemRecord.getItemId(), "ole"); + if (Boolean.TRUE == isAuditRequired()) { + oldItemRecord = processItemRecordForAudit(oldItemRecord); + ItemRecord modifiedItemRecord = (ItemRecord) SerializationUtils.clone(itemRecord); + modifiedItemRecord = processItemRecordForAudit(modifiedItemRecord); + List itemAuditedFields = OleAuditManager.getInstance().audit(ItemAudit.class, oldItemRecord, modifiedItemRecord, itemRecord.getItemId(), "ole"); + } String oldBarcode = oldItemRecord.getBarCode(); String newBarcode = itemRecord.getBarCode(); if((oldBarcode!=null && (!oldBarcode.equals(newBarcode))) || (oldBarcode==null && newBarcode!=null)){