Skip to content
Snippets Groups Projects
Commit 7f669eab authored by Owen Arnold's avatar Owen Arnold
Browse files

refs #6490. Disable ICAT on facilities.

Also improve log message on the login algorithm.
parent 4cef43ce
No related branches found
No related tags found
No related merge requests found
......@@ -72,6 +72,8 @@ namespace Mantid
std::string testDownload(const std::string& URL,const std::string& fileName);
private:
/// Throw a catalog error.
void throwCatalogError() const;
/// Sets documentation strings for this algorithm
virtual void initDocs();
/// Overwrites Algorithm method.
......
......@@ -54,6 +54,7 @@ namespace Mantid
virtual const std::string category() const { return "DataHandling\\Catalog"; }
private:
void throwCatalogError() const;
/// Sets documentation strings for this algorithm
virtual void initDocs();
/// Overwrites Algorithm method.
......
......@@ -64,6 +64,18 @@ namespace Mantid
Direction::Output),
"A list of containing locations of files downloaded from data server");
}
/// Raise an error concerning catalog searching
void CatalogDownloadDataFiles::throwCatalogError() const
{
const std::string facilityName = ConfigService::Instance().getFacility().name();
std::stringstream ss;
ss << "Your current Facility, " << facilityName << ", does not have ICAT catalog information. "
<< std::endl;
ss << "The facilities.xml file may need updating. Contact the Mantid Team for help." << std::endl;
throw std::runtime_error(ss.str());
}
/// Execute the algorithm
void CatalogDownloadDataFiles::exec()
{
......@@ -76,11 +88,11 @@ namespace Mantid
}
catch(Kernel::Exception::NotFoundError&)
{
throw std::runtime_error("Error when getting the catalog information from the Facilities.xml file.");
throwCatalogError();
}
if(!catalog_sptr)
{
throw std::runtime_error("Error when getting the catalog information from the Facilities.xml file");
throwCatalogError();
}
//get file ids
std::vector<int64_t> fileids = getProperty("FileIds");
......
......@@ -52,16 +52,27 @@ namespace Mantid
}
catch(Kernel::Exception::NotFoundError&)
{
throw std::runtime_error("Error when getting the catalog information from the Facilities.xml file.");
throwCatalogError();
}
if(!catalog_sptr)
{
throw std::runtime_error("Error when getting the catalog information from the Facilities.xml file");
throwCatalogError();
}
catalog_sptr->login(username,password,"");
}
/// Raise an error concerning catalog searching
void CatalogLogin::throwCatalogError() const
{
const std::string facilityName = ConfigService::Instance().getFacility().name();
std::stringstream ss;
ss << "Your current Facility, " << facilityName << ", does not have ICAT catalog information. "
<< std::endl;
ss << "The facilities.xml file may need updating. Contact the Mantid Team for help." << std::endl;
throw std::runtime_error(ss.str());
}
}
}
......
......@@ -72,7 +72,11 @@ namespace Mantid
}
catch(Kernel::Exception::NotFoundError&)
{
throw std::runtime_error("Error when getting the catalog information from the Facilities.xml file.");
std::string facilityName = ConfigService::Instance().getFacility().name();
std::stringstream ss;
ss << "Your current Facility: " << facilityName << " does not have ICAT catalog information. " << std::endl;
ss << "The facilities.xml file may need updating. Contact the Mantid Team for help." << std::endl;
throw std::runtime_error(ss.str());
}
if(!catalog_sptr)
{
......
......@@ -219,9 +219,6 @@
<facility name="HFIR" FileExtensions=".nxs,.dat,.xml">
<catalog name="ICat3Catalog">
</catalog>
<instrument name="HB1">
<technique>Triple Axis Spectroscopy</technique>
</instrument>
......@@ -266,17 +263,6 @@
<facility name="SNS" delimiter="_" FileExtensions="_event.nxs,.nxs.h5,.nxs,.dat,_runinfo.xml,_histo.nxs">
<archive>
<archiveSearch plugin="SNSDataSearch" />
<archiveSearch plugin="SNSDataSearchICAT2" />
</archive>
<catalog name="ICat3Catalog">
</catalog>
<soapEndPoint url="https://icat.sns.gov:8181/ICATService/ICAT">
</soapEndPoint>
<instrument name="DAS">
<technique>technique</technique>
</instrument>
......
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