Skip to content

Commit

Permalink
Merge pull request #877 from sheiksalahudeen/release-2.1
Browse files Browse the repository at this point in the history
Added functionality and fixed issue
  • Loading branch information
sheiksalahudeen authored Sep 8, 2016
2 parents c521717 + f15b785 commit f2b3d64
Show file tree
Hide file tree
Showing 12 changed files with 60 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Original file line number Diff line number Diff line change
Expand Up @@ -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"
"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"
Original file line number Diff line number Diff line change
Expand Up @@ -2828,7 +2828,10 @@ INSERT INTO KRCR_PARM_T (NMSPC_CD, CMPNT_CD, PARM_NM, OBJ_ID, VER_NBR, PARM_TYP_
INSERT INTO KRCR_PARM_T (NMSPC_CD, CMPNT_CD, PARM_NM, OBJ_ID, VER_NBR, PARM_TYP_CD, VAL, PARM_DESC_TXT, EVAL_OPRTR_CD, APPL_ID) VALUES ('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')
/

INSERT INTO DATABASECHANGELOG (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, LIQUIBASE) VALUES ('OLE_LOAD_KRCR_PARM_T_mysql', 'ole', 'bootstrap_krcr_data.xml', NOW(), 3, '7:39cefc01dd7ee741bdb260260c90568d', 'sql, loadData', '', 'EXECUTED', '3.2.0')
INSERT INTO KRCR_PARM_T (NMSPC_CD, CMPNT_CD, PARM_NM, OBJ_ID, VER_NBR, PARM_TYP_CD, VAL, PARM_DESC_TXT, EVAL_OPRTR_CD, APPL_ID) VALUES ('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')
/

INSERT INTO DATABASECHANGELOG (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, LIQUIBASE) VALUES ('OLE_LOAD_KRCR_PARM_T_mysql', 'ole', 'bootstrap_krcr_data.xml', NOW(), 3, '7:386395701f15359b86f48e05612c32d7', 'sql, loadData', '', 'EXECUTED', '3.2.0')
/

-- Changeset bootstrap_krcr_data.xml::OLE_LOAD_KRLC_POSTAL_CODE_T::ole
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2825,7 +2825,10 @@ INSERT INTO KRCR_PARM_T (NMSPC_CD, CMPNT_CD, PARM_NM, OBJ_ID, VER_NBR, PARM_TYP_
INSERT INTO KRCR_PARM_T (NMSPC_CD, CMPNT_CD, PARM_NM, OBJ_ID, VER_NBR, PARM_TYP_CD, VAL, PARM_DESC_TXT, EVAL_OPRTR_CD, APPL_ID) VALUES ('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')
/

INSERT INTO DATABASECHANGELOG (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, LIQUIBASE) VALUES ('OLE_LOAD_KRCR_PARM_T_oracle', 'ole', 'bootstrap_krcr_data.xml', SYSTIMESTAMP, 3, '7:c2bb900eb53afe020a61a620a4bd58a9', 'loadData', '', 'EXECUTED', '3.2.0')
INSERT INTO KRCR_PARM_T (NMSPC_CD, CMPNT_CD, PARM_NM, OBJ_ID, VER_NBR, PARM_TYP_CD, VAL, PARM_DESC_TXT, EVAL_OPRTR_CD, APPL_ID) VALUES ('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')
/

INSERT INTO DATABASECHANGELOG (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, LIQUIBASE) VALUES ('OLE_LOAD_KRCR_PARM_T_oracle', 'ole', 'bootstrap_krcr_data.xml', SYSTIMESTAMP, 3, '7:851d5aba89099775e2b0beefd272ebe8', 'loadData', '', 'EXECUTED', '3.2.0')
/

-- Changeset bootstrap_krcr_data.xml::OLE_LOAD_KRLC_POSTAL_CODE_T::ole
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ INSERT INTO KRCR_PARM_T (NMSPC_CD, CMPNT_CD, PARM_NM, OBJ_ID, VER_NBR, PARM_TYP_
INSERT INTO KRCR_PARM_T (NMSPC_CD, CMPNT_CD, PARM_NM, OBJ_ID, VER_NBR, PARM_TYP_CD, VAL, PARM_DESC_TXT, EVAL_OPRTR_CD, APPL_ID) VALUES ('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')
/

INSERT INTO DATABASECHANGELOG (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, LIQUIBASE) VALUES ('OLE_LOAD_KRCR_PARM_T_mysql', 'ole', 'org/kuali/ole/2.1/db.changelog-20151123.xml', NOW(), 1, '7:98d8aa1f06476d151c7f8f5a2f114aa8', 'sql, loadData', '', 'EXECUTED', '3.2.0')
INSERT INTO KRCR_PARM_T (NMSPC_CD, CMPNT_CD, PARM_NM, OBJ_ID, VER_NBR, PARM_TYP_CD, VAL, PARM_DESC_TXT, EVAL_OPRTR_CD, APPL_ID) VALUES ('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')
/

INSERT INTO DATABASECHANGELOG (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, LIQUIBASE) VALUES ('OLE_LOAD_KRCR_PARM_T_mysql', 'ole', 'org/kuali/ole/2.1/db.changelog-20151123.xml', NOW(), 1, '7:bd6e5066b5673ac4eb37a943888f7410', 'sql, loadData', '', 'EXECUTED', '3.2.0')
/

-- Changeset org/kuali/ole/2.1/db.changelog-20151123.xml::OLE_KRCR_PARM_T::ole
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ INSERT INTO KRCR_PARM_T (NMSPC_CD, CMPNT_CD, PARM_NM, OBJ_ID, VER_NBR, PARM_TYP_
INSERT INTO KRCR_PARM_T (NMSPC_CD, CMPNT_CD, PARM_NM, OBJ_ID, VER_NBR, PARM_TYP_CD, VAL, PARM_DESC_TXT, EVAL_OPRTR_CD, APPL_ID) VALUES ('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')
/

INSERT INTO DATABASECHANGELOG (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, LIQUIBASE) VALUES ('OLE_LOAD_KRCR_PARM_T_oracle', 'ole', 'org/kuali/ole/2.1/db.changelog-20151123.xml', SYSTIMESTAMP, 1, '7:2ad37cda600311010628ac0d08a40d42', 'loadData', '', 'EXECUTED', '3.2.0')
INSERT INTO KRCR_PARM_T (NMSPC_CD, CMPNT_CD, PARM_NM, OBJ_ID, VER_NBR, PARM_TYP_CD, VAL, PARM_DESC_TXT, EVAL_OPRTR_CD, APPL_ID) VALUES ('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')
/

INSERT INTO DATABASECHANGELOG (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, LIQUIBASE) VALUES ('OLE_LOAD_KRCR_PARM_T_oracle', 'ole', 'org/kuali/ole/2.1/db.changelog-20151123.xml', SYSTIMESTAMP, 1, '7:f611f21b69e511931608b33403d39146', 'loadData', '', 'EXECUTED', '3.2.0')
/

-- Changeset org/kuali/ole/2.1/db.changelog-20151123.xml::OLE_KRCR_PARM_T::ole
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ public List<String> getLocationLevelIds() {

public Map<String, String> getLocationMap(String itemLocation){
Map<String, String> locationMap = new HashMap<String, String>();
if(itemLocation!=null && itemLocation.isEmpty()) {
if(StringUtils.isNotBlank(itemLocation)) {
String[] locationArray = itemLocation.split("['/']");
List<String> locationList = Arrays.asList(locationArray);
for (String value : locationList) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";

}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Audit> 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<Audit> 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();
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Audit> 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<Audit> 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)){
Expand Down

0 comments on commit f2b3d64

Please sign in to comment.