From 851f6d571cecfc9c212d11b61d5d202d66b70e61 Mon Sep 17 00:00:00 2001 From: Bruno De Bel Date: Wed, 7 Feb 2018 12:50:09 +0100 Subject: [PATCH] Inventory for books --- namalysator/bookModel.cpp | 8 ++++---- namalysator/dbrequest.cpp | 9 ++++----- project/inventory.cpp | 4 +++- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/namalysator/bookModel.cpp b/namalysator/bookModel.cpp index eda5741..27b5c35 100644 --- a/namalysator/bookModel.cpp +++ b/namalysator/bookModel.cpp @@ -71,9 +71,9 @@ QVariant bookModelInventory::data(const QModelIndex &index, int role ) const{ } QVariant bookModel::headerData ( int section, Qt::Orientation orientation, int role ) const{ - //static char* table[]={"ID","PATH","METS", " ","Page","BIBREC_245a","BIBREC_245b","BIBREC_100a-1","BIBREC_100a-2","BIBREC_008-35-37","BIBREC_260b","BIBREC_260c","ITEMbarCode","BIBREC_SYS_NUM"}; + //static char* table[]={"ID","PATH","METS", " ","Page","UNIQKEY","BIBREC_245b","BIBREC_100a-1","BIBREC_100a-2","BIBREC_008-35-37","BIBREC_260b","BIBREC_260c","ITEMbarCode","BIBREC_SYS_NUM"}; static char* table[]={"PROGRESS","ID","PATH","METS", " ","BIBREC_245a", - "BIBREC_100a","BIBREC_260b","ITEMbarCode","BIBREC_SYS_NUM","CHECKED","R","N","D"}; + "BIBREC_100a","BIBREC_260b","TITLE","BIBREC_SYS_NUM","CHECKED","R","N","D"}; QVariant ret=QVariant(); if ( role == Qt::DisplayRole && section < 12 && section >= 0 ) { @@ -86,8 +86,8 @@ QVariant bookModel::headerData ( int section, Qt::Orientation orientation, int r QVariant bookModelInventory::headerData ( int section, Qt::Orientation orientation, int role ) const{ - static char* table[]={"CHECKED","BATCH","language", "BIBREC_SYS_NUM","ITEMbarCode","BIBREC_245a", - "BIBREC_100a","BIBREC_260b","BIBREC_008_7_10","N","D"}; + static char* table[]={"CHECKED","BATCH","language", "UNIQKEY","TITLE","TYPE", + "FORMALDATE","BIBREC_260b","BIBREC_008_7_10","N","D"}; QVariant ret=QVariant(); if ( role == Qt::DisplayRole && section < 9 && section >= 0 ) { diff --git a/namalysator/dbrequest.cpp b/namalysator/dbrequest.cpp index 4134e79..5bec0da 100644 --- a/namalysator/dbrequest.cpp +++ b/namalysator/dbrequest.cpp @@ -1940,7 +1940,7 @@ std::vector > dbrequest::getAllMets(int id_testset,bool sa //std::string selectSql = "SELECT a.ID_METS, a.PATH, a.FILENAME, b.PAGENB FROM METS a LEFT JOIN STRUCTUREERROR b ON a.ID_METS = b.ID_METS WHERE a.ID_TESTSET=?"; std::string selectSql = "SELECT ll.LABEL, a.ID_METS, a.PATH, a.FILENAME, c.UNIQUEBUILDKEY," - " c.UNIQUEBUILDKEY,c.UNIQUEBUILDKEY,c.UNIQUEBUILDKEY, c.UNIQUEBUILDKEY/*,c.CHECKED*/ FROM METS a" + " c.TITLE,c.TYPE,c.UNIQUEBUILDKEY, c.UNIQUEBUILDKEY/*,c.CHECKED*/ FROM METS a" " LEFT JOIN (SELECT * FROM INVENTORY h, METSINVENTORY b WHERE b.UNIQUEBUILDKEY = h.UNIQUEBUILDKEY) c " " ON a.ID_METS = c.ID_METS" " LEFT JOIN PROGRESSION_STATE aa" @@ -1952,7 +1952,7 @@ std::vector > dbrequest::getAllMets(int id_testset,bool sa if ( sampling ) { selectSql = "SELECT ll.LABEL, a.ID_METS, a.PATH, a.FILENAME, c.UNIQUEBUILDKEY," - " c.UNIQUEBUILDKEY,c.UNIQUEBUILDKEY,c.UNIQUEBUILDKEY, c.UNIQUEBUILDKEY/*,c.CHECKED*/ FROM METS a, SAMPLING_STRUCTURE ss" + " c.TITLE,c.TYPE,c.UNIQUEBUILDKEY, c.UNIQUEBUILDKEY/*,c.CHECKED*/ FROM METS a, SAMPLING_STRUCTURE ss" " LEFT JOIN (SELECT * FROM INVENTORY h, METSINVENTORY b WHERE b.UNIQUEBUILDKEY = h.UNIQUEBUILDKEY) c " " ON a.ID_METS = c.ID_METS" " LEFT JOIN PROGRESSION_STATE aa" @@ -2017,9 +2017,8 @@ std::vector > dbrequest::getAllBooks(int id_testset){ const char *zErrMsg= 0; - //std::string selectSql = "SELECT a.ID_METS, a.PATH, a.FILENAME, b.PAGENB FROM METS a LEFT JOIN STRUCTUREERROR b ON a.ID_METS = b.ID_METS WHERE a.ID_TESTSET=?"; - static std::string selectSql = "SELECT c.CHECKED, a.ID_TESTSET, c.LANGUAGES, c.UNIQUEBUILDKEY,c.UNIQUEBUILDKEY, c.UNIQUEBUILDKEY," - " c.UNIQUEBUILDKEY, c.UNIQUEBUILDKEY,c.UNIQUEBUILDKEY FROM " + static std::string selectSql = "SELECT c.CHECKED, a.ID_TESTSET, c.LANGUAGES, c.UNIQUEBUILDKEY,c.TITLE, c.TYPE," + " c.FORMALDATE, c.UNIQUEBUILDKEY,c.UNIQUEBUILDKEY FROM " " INVENTORY c" " LEFT JOIN ( SELECT ID_TESTSET, UNIQUEBUILDKEY FROM METS a, METSINVENTORY b WHERE a.ID_METS = b.ID_METS AND a.ID_TESTSET=? ) a" " ON a.UNIQUEBUILDKEY = c.UNIQUEBUILDKEY"; diff --git a/project/inventory.cpp b/project/inventory.cpp index 952641e..33f910f 100644 --- a/project/inventory.cpp +++ b/project/inventory.cpp @@ -40,7 +40,9 @@ void inventoryMapping::setCurrentInventory(std::string type){ void inventoryMapping::setCurrentInventoryValue(std::string field, std::string value){ if ( currentInventory == 0) return; - if ( field.compare("recordIdentifier")==0 ) currentInventory->uniquebuildkey=value; + + if ( field.compare("identifier")==0 ) currentInventory->uniquebuildkey=value; // Attention alimenter pour les monographies + if ( field.compare("recordIdentifier")==0 ) currentInventory->uniquebuildkey=value; // overloader pour les issues if ( field.compare("title")==0 ) currentInventory->title=value; if ( field.compare("subtitle")==0 ) currentInventory->subtitle=value;