Skip to content

Commit

Permalink
Added property to publish algorithm. Refs #8742.
Browse files Browse the repository at this point in the history
- Made publish dialog use publishing algorithm's property.
  • Loading branch information
jawrainey committed Jan 31, 2014
1 parent a5fe015 commit 4bbe13e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Code/Mantid/Framework/ICat/src/CatalogPublish.cpp
Expand Up @@ -56,6 +56,7 @@ namespace Mantid
declareProperty("NameInCatalog","","The name to give to the file being saved. The file name or workspace name is used by default. "
"This can only contain alphanumerics, underscores or periods.");
declareProperty("InvestigationNumber","","The investigation number where the published file will be saved to.");
declareProperty("DataFileDescription","","A short description of the datafile you are publishing to the catalog.");
}

/// Execute the algorithm
Expand Down Expand Up @@ -115,7 +116,8 @@ namespace Mantid
// Verify that the file can be opened correctly.
if (fileStream.rdstate() & std::ios::failbit) throw Mantid::Kernel::Exception::FileError("Error on opening file at: ", filePath);
// Publish the contents of the file to the server.
publish(fileStream,catalog->getUploadURL(getPropertyValue("InvestigationNumber"), getPropertyValue("NameInCatalog")));
publish(fileStream,catalog->getUploadURL(
getPropertyValue("InvestigationNumber"), getPropertyValue("NameInCatalog"), getPropertyValue("DataFileDescription")));
// If a workspace was published, then we want to also publish the history of a workspace.
if (!ws.empty()) publishWorkspaceHistory(catalog, workspace);
}
Expand Down Expand Up @@ -221,7 +223,7 @@ namespace Mantid
// Use the name the use wants to save the file to the server as and append .py
std::string fileName = Poco::Path(Poco::Path(getPropertyValue("NameInCatalog")).getFileName()).getBaseName() + ".py";
// Publish the workspace history to the server.
publish(ss, catalog->getUploadURL(getPropertyValue("InvestigationNumber"), fileName));
publish(ss, catalog->getUploadURL(getPropertyValue("InvestigationNumber"), fileName, getPropertyValue("DataFileDescription")));
}

/**
Expand Down
Expand Up @@ -34,6 +34,7 @@ namespace MantidQt
tie(m_uiForm.inputWorkspaceCb,"InputWorkspace");
tie(m_uiForm.nameInCatalogTxt,"NameInCatalog");
tie(m_uiForm.investigationNumberCb,"InvestigationNumber");
tie(m_uiForm.descriptionInput,"DataFileDescription");

// Allows the combo box to show workspaces when they are loaded into Mantid.
m_uiForm.inputWorkspaceCb->setValidatingAlgorithm(m_algName);
Expand Down

0 comments on commit 4bbe13e

Please sign in to comment.