Skip to content

Commit

Permalink
Add better logging messages for publishing. Refs #8538.
Browse files Browse the repository at this point in the history
  • Loading branch information
jawrainey committed May 16, 2014
1 parent 4b1e897 commit e1b0fc6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Code/Mantid/Framework/ICat/src/CatalogPublish.cpp
Expand Up @@ -64,7 +64,7 @@ namespace Mantid
declareProperty("Session","","The session information of the catalog to use.");
declareProperty("GenerateDOI",true, "Generates a DOI for the datafile being published."
"Once a DOI is generated the datafile will be made public.");
declareProperty<int64_t>("InvestigationID",0,"The database row ID of the investigation that you want to publish to.");
declareProperty<int64_t>("DatabaseID",-1,"The database row ID of the investigation that you want to publish to.");
}

/// Execute the algorithm
Expand Down Expand Up @@ -136,7 +136,7 @@ namespace Mantid
// The file was uploaded successfully. Generate a DOI if requested.
if (boost::lexical_cast<bool>(getPropertyValue("GenerateDOI")))
{
int64_t investigationID = getProperty("InvestigationID");
int64_t investigationID = getProperty("DatabaseID");
std::string generatedDOI = catalogInfoService->registerDatafileDOI(investigationID);
g_log.notice("The DOI registered for datafile " + Poco::Path(filePath).getFileName() + " was: " + generatedDOI);
}
Expand Down Expand Up @@ -191,7 +191,10 @@ namespace Mantid
catch(Poco::Exception&) {}

// Cancel the algorithm and display the message if it exists.
if(!IDSError.empty()) throw std::runtime_error(IDSError);
if(!IDSError.empty())
throw std::runtime_error(IDSError);
else
g_log.notice() << "Publishing the datafile to the archives was a success.\n";
}

/**
Expand Down
3 changes: 3 additions & 0 deletions Code/Mantid/Framework/ICat/src/ICat4/ICat4Catalog.cpp
Expand Up @@ -668,18 +668,21 @@ namespace Mantid

std::string session = m_session->getSessionId();
request.arg0 = &session;
g_log.debug() << "The database ID used inside ICat4Catalog::registerDatafileDOI is: " << databaseID << "\n";
request.arg1 = databaseID;

std::string registeredDOI = "";

if (icatDOI.registerDatafileDOI(&request,&response) == SOAP_OK)
{
g_log.debug() << "Registering a datafile DOI was a success. The DOI generated was: " << *(response.return_) << "\n";
registeredDOI = *(response.return_);
}
else
{
throwSoapError(icatDOI);
}

return registeredDOI;
}

Expand Down

0 comments on commit e1b0fc6

Please sign in to comment.