Skip to content

Commit

Permalink
refs #6490. Disable ICAT on facilities.
Browse files Browse the repository at this point in the history
Also improve log message on the login algorithm.
  • Loading branch information
OwenArnold committed Jan 31, 2013
1 parent 4cef43c commit 7f669ea
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 19 deletions.
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions Code/Mantid/Framework/ICat/inc/MantidICat/CatalogLogin.h
Expand Up @@ -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.
Expand Down
16 changes: 14 additions & 2 deletions Code/Mantid/Framework/ICat/src/CatalogDownloadDataFiles.cpp
Expand Up @@ -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()
{
Expand All @@ -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");
Expand Down
15 changes: 13 additions & 2 deletions Code/Mantid/Framework/ICat/src/CatalogLogin.cpp
Expand Up @@ -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());
}


}
}
Expand Down
6 changes: 5 additions & 1 deletion Code/Mantid/Framework/ICat/src/CatalogSearch.cpp
Expand Up @@ -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)
{
Expand Down
14 changes: 0 additions & 14 deletions Code/Mantid/instrument/Facilities.xml
Expand Up @@ -219,9 +219,6 @@

<facility name="HFIR" FileExtensions=".nxs,.dat,.xml">

<catalog name="ICat3Catalog">
</catalog>

<instrument name="HB1">
<technique>Triple Axis Spectroscopy</technique>
</instrument>
Expand Down Expand Up @@ -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>
Expand Down

0 comments on commit 7f669ea

Please sign in to comment.