Skip to content

Commit

Permalink
Add registerDatafileDOI to interface & inherited classes. Refs #8538.
Browse files Browse the repository at this point in the history
  • Loading branch information
jawrainey committed Apr 7, 2014
1 parent b0e3af7 commit 78723d5
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Code/Mantid/Framework/API/inc/MantidAPI/ICatalogInfoService.h
Expand Up @@ -45,6 +45,8 @@ namespace Mantid
virtual const std::string getDownloadURL(const long long&)=0;
/// Obtain the url to upload a file to.
virtual const std::string getUploadURL(const std::string&,const std::string&,const std::string&)=0;
/// Generate a DOI for a datafile based on the related investigation.
virtual const std::string registerDatafileDOI(const long long&)=0;
};

typedef boost::shared_ptr<ICatalogInfoService> ICatalogInfoService_sptr;
Expand Down
Expand Up @@ -62,15 +62,18 @@ namespace Mantid
virtual void listInstruments(std::vector<std::string>& instruments);
/// get investigationtypes list
virtual void listInvestigationTypes(std::vector<std::string>& invstTypes);
/// keep alive
virtual void keepAlive();

/// get file location strings
virtual const std::string getFileLocation(const long long&fileid);
/// get urls
virtual const std::string getDownloadURL(const long long& fileid);
/// get URL of where to PUT (publish) files.
virtual const std::string getUploadURL(
const std::string &investigationID, const std::string &createFileName, const std::string &dataFileDescription);
/// keep alive
virtual void keepAlive();
/// Generate a DOI for a datafile based on the related investigation.
virtual const std::string registerDatafileDOI(const long long& investigationID);

private:
/// The helper class that accesses ICAT functionality.
Expand Down
Expand Up @@ -59,15 +59,18 @@ namespace Mantid
virtual void listInstruments(std::vector<std::string>& instruments);
/// Get investigationtypes list
virtual void listInvestigationTypes(std::vector<std::string>& invstTypes);
/// Keep current session alive
virtual void keepAlive();

/// Get the file location string(s) from archive.
virtual const std::string getFileLocation(const long long&fileID);
/// Get the url(s) based on the fileID.
virtual const std::string getDownloadURL(const long long& fileID);
/// get URL of where to PUT (publish) files.
virtual const std::string getUploadURL(
const std::string &investigationID, const std::string &createFileName, const std::string &dataFileDescription);
/// Keep current session alive
virtual void keepAlive();
/// Generate a DOI for a datafile based on the related investigation.
virtual const std::string registerDatafileDOI(const long long& investigationID);

private:
// Ensures human friendly error messages are provided to the user.
Expand Down
12 changes: 12 additions & 0 deletions Code/Mantid/Framework/ICat/src/ICat3/ICat3Catalog.cpp
Expand Up @@ -116,6 +116,18 @@ namespace Mantid
throw std::runtime_error("ICat3Catalog does not support publishing.");
}


/**
* Generate a DOI for a datafile based on the related investigation.
* @param investigationID :: The investigation of the datafile to register the DOI for.
* @return The DOI that was generated for the datafile.
*/
const std::string ICat3Catalog::registerDatafileDOI(const long long& investigationID)
{
UNUSED_ARG(investigationID);
throw std::runtime_error("ICat3Catalog does not support registrations of DOIs.");
}

/**This method method does the search for investigations
*@param inputs :: reference to a class conatains search inputs
*@param ws_sptr :: -shared pointer to search results workspace
Expand Down
10 changes: 10 additions & 0 deletions Code/Mantid/Framework/ICat/src/ICat4/ICat4Catalog.cpp
Expand Up @@ -777,6 +777,16 @@ namespace Mantid
return url;
}

/**
* Generate a DOI for a datafile based on the related investigation.
* @param investigationID :: The investigation of the datafile to register the DOI for.
* @return The DOI that was generated for the datafile.
*/
const std::string ICat4Catalog::registerDatafileDOI(const long long& investigationID)
{
UNUSED_ARG(investigationID);
return "";
}

/**
* Search the archive & obtain the dataset ID for a specific investigation.
Expand Down

0 comments on commit 78723d5

Please sign in to comment.