Skip to content
Snippets Groups Projects
Commit d65291e3 authored by Alex Buts's avatar Alex Buts
Browse files

Merge remote-tracking branch 'origin/feature/9332_icat_get_data_sets'

parents 427649fc 9e6658ac
No related branches found
No related tags found
No related merge requests found
...@@ -475,14 +475,13 @@ namespace Mantid ...@@ -475,14 +475,13 @@ namespace Mantid
ns1__search request; ns1__search request;
ns1__searchResponse response; ns1__searchResponse response;
std::string query = "Datafile <-> Dataset <-> Investigation[name = '" + investigationId + "']"; std::string query = "Dataset INCLUDE DatasetType, Datafile, Investigation <-> Investigation[name = '" + investigationId + "']";
request.query = &query; request.query = &query;
std::string sessionID = m_session->getSessionId(); std::string sessionID = m_session->getSessionId();
request.sessionId = &sessionID; request.sessionId = &sessionID;
g_log.debug() << "ICat4Catalog::getDataSets -> { " << query << " }" << std::endl; g_log.debug() << "The query for ICat4Catalog::getDataSets is:\n" << query << std::endl;
int result = icat.search(&request, &response); int result = icat.search(&request, &response);
if (result == 0) if (result == 0)
...@@ -505,26 +504,41 @@ namespace Mantid ...@@ -505,26 +504,41 @@ namespace Mantid
if (outputws->getColumnNames().empty()) if (outputws->getColumnNames().empty())
{ {
// Add rows headers to the output workspace. // Add rows headers to the output workspace.
outputws->addColumn("long64","ID");
outputws->addColumn("str","Name"); outputws->addColumn("str","Name");
outputws->addColumn("str","Status");
outputws->addColumn("str","Type");
outputws->addColumn("str","Description"); outputws->addColumn("str","Description");
outputws->addColumn("str","Sample Id"); outputws->addColumn("str","Type");
outputws->addColumn("str","Related investigation ID");
outputws->addColumn("size_t","Number of datafiles");
} }
std::string temp(""); std::string emptyCell = "";
for(auto iter = response.begin(); iter != response.end(); ++iter)
std::vector<xsd__anyType*>::const_iterator iter;
for(iter = response.begin(); iter != response.end(); ++iter)
{ {
API::TableRow table = outputws->appendRow(); ns1__dataset * dataset = dynamic_cast<ns1__dataset*>(*iter);
// These are just temporary values in order for the GUI to not die. if (dataset)
// These along with related GUI aspects will be removed in another ticket. {
savetoTableWorkspace(&temp, table); API::TableRow table = outputws->appendRow();
savetoTableWorkspace(&temp, table);
savetoTableWorkspace(&temp, table); savetoTableWorkspace(dataset->id, table);
savetoTableWorkspace(&temp, table); savetoTableWorkspace(dataset->name, table);
savetoTableWorkspace(&temp, table);
if (dataset->description) savetoTableWorkspace(dataset->description, table);
else savetoTableWorkspace(&emptyCell, table);
if (dataset->type) savetoTableWorkspace(dataset->type->name,table);
else savetoTableWorkspace(&emptyCell, table);
if (dataset->investigation) savetoTableWorkspace(dataset->investigation->name, table);
else savetoTableWorkspace(&emptyCell, table);
size_t datafileCount = dataset->datafiles.size();
savetoTableWorkspace(&datafileCount, table);
}
else
{
throw std::runtime_error("ICat4Catalog::saveDataSets expected a dataset. Please contact the Mantid development team.");
}
} }
} }
...@@ -547,7 +561,7 @@ namespace Mantid ...@@ -547,7 +561,7 @@ namespace Mantid
std::string sessionID = m_session->getSessionId(); std::string sessionID = m_session->getSessionId();
request.sessionId = &sessionID; request.sessionId = &sessionID;
g_log.debug() << "The query for ICat4Catalog::getDataSets is:\n" << query << std::endl; g_log.debug() << "The query for ICat4Catalog::getDataFiles is:\n" << query << std::endl;
int result = icat.search(&request, &response); int result = icat.search(&request, &response);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment