Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
d65291e3
Commit
d65291e3
authored
10 years ago
by
Alex Buts
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'origin/feature/9332_icat_get_data_sets'
parents
427649fc
9e6658ac
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Code/Mantid/Framework/ICat/src/ICat4/ICat4Catalog.cpp
+33
-19
33 additions, 19 deletions
Code/Mantid/Framework/ICat/src/ICat4/ICat4Catalog.cpp
with
33 additions
and
19 deletions
Code/Mantid/Framework/ICat/src/ICat4/ICat4Catalog.cpp
+
33
−
19
View file @
d65291e3
...
@@ -475,14 +475,13 @@ namespace Mantid
...
@@ -475,14 +475,13 @@ namespace Mantid
ns1__search
request
;
ns1__search
request
;
ns1__searchResponse
response
;
ns1__searchResponse
response
;
std
::
string
query
=
"Data
file <-> Dataset
<-> Investigation[name = '"
+
investigationId
+
"']"
;
std
::
string
query
=
"Data
set INCLUDE DatasetType, Datafile, Investigation
<-> Investigation[name = '"
+
investigationId
+
"']"
;
request
.
query
=
&
query
;
request
.
query
=
&
query
;
std
::
string
sessionID
=
m_session
->
getSessionId
();
std
::
string
sessionID
=
m_session
->
getSessionId
();
request
.
sessionId
=
&
sessionID
;
request
.
sessionId
=
&
sessionID
;
g_log
.
debug
()
<<
"ICat4Catalog::getDataSets -> { "
<<
query
<<
" }"
<<
std
::
endl
;
g_log
.
debug
()
<<
"The query for ICat4Catalog::getDataSets is:
\n
"
<<
query
<<
std
::
endl
;
int
result
=
icat
.
search
(
&
request
,
&
response
);
int
result
=
icat
.
search
(
&
request
,
&
response
);
if
(
result
==
0
)
if
(
result
==
0
)
...
@@ -505,26 +504,41 @@ namespace Mantid
...
@@ -505,26 +504,41 @@ namespace Mantid
if
(
outputws
->
getColumnNames
().
empty
())
if
(
outputws
->
getColumnNames
().
empty
())
{
{
// Add rows headers to the output workspace.
// Add rows headers to the output workspace.
outputws
->
addColumn
(
"long64"
,
"ID"
);
outputws
->
addColumn
(
"str"
,
"Name"
);
outputws
->
addColumn
(
"str"
,
"Name"
);
outputws
->
addColumn
(
"str"
,
"Status"
);
outputws
->
addColumn
(
"str"
,
"Type"
);
outputws
->
addColumn
(
"str"
,
"Description"
);
outputws
->
addColumn
(
"str"
,
"Description"
);
outputws
->
addColumn
(
"str"
,
"Sample Id"
);
outputws
->
addColumn
(
"str"
,
"Type"
);
outputws
->
addColumn
(
"str"
,
"Related investigation ID"
);
outputws
->
addColumn
(
"size_t"
,
"Number of datafiles"
);
}
}
std
::
string
temp
(
""
);
std
::
string
emptyCell
=
""
;
for
(
auto
iter
=
response
.
begin
();
iter
!=
response
.
end
();
++
iter
)
std
::
vector
<
xsd__anyType
*>::
const_iterator
iter
;
for
(
iter
=
response
.
begin
();
iter
!=
response
.
end
();
++
iter
)
{
{
API
::
TableRow
table
=
outputws
->
appendRow
();
ns1__dataset
*
dataset
=
dynamic_cast
<
ns1__dataset
*>
(
*
iter
);
// These are just temporary values in order for the GUI to not die.
if
(
dataset
)
// These along with related GUI aspects will be removed in another ticket.
{
savetoTableWorkspace
(
&
temp
,
table
);
API
::
TableRow
table
=
outputws
->
appendRow
();
savetoTableWorkspace
(
&
temp
,
table
);
savetoTableWorkspace
(
&
temp
,
table
);
savetoTableWorkspace
(
dataset
->
id
,
table
);
savetoTableWorkspace
(
&
temp
,
table
);
savetoTableWorkspace
(
dataset
->
name
,
table
);
savetoTableWorkspace
(
&
temp
,
table
);
if
(
dataset
->
description
)
savetoTableWorkspace
(
dataset
->
description
,
table
);
else
savetoTableWorkspace
(
&
emptyCell
,
table
);
if
(
dataset
->
type
)
savetoTableWorkspace
(
dataset
->
type
->
name
,
table
);
else
savetoTableWorkspace
(
&
emptyCell
,
table
);
if
(
dataset
->
investigation
)
savetoTableWorkspace
(
dataset
->
investigation
->
name
,
table
);
else
savetoTableWorkspace
(
&
emptyCell
,
table
);
size_t
datafileCount
=
dataset
->
datafiles
.
size
();
savetoTableWorkspace
(
&
datafileCount
,
table
);
}
else
{
throw
std
::
runtime_error
(
"ICat4Catalog::saveDataSets expected a dataset. Please contact the Mantid development team."
);
}
}
}
}
}
...
@@ -547,7 +561,7 @@ namespace Mantid
...
@@ -547,7 +561,7 @@ namespace Mantid
std
::
string
sessionID
=
m_session
->
getSessionId
();
std
::
string
sessionID
=
m_session
->
getSessionId
();
request
.
sessionId
=
&
sessionID
;
request
.
sessionId
=
&
sessionID
;
g_log
.
debug
()
<<
"The query for ICat4Catalog::getData
Set
s is:
\n
"
<<
query
<<
std
::
endl
;
g_log
.
debug
()
<<
"The query for ICat4Catalog::getData
File
s is:
\n
"
<<
query
<<
std
::
endl
;
int
result
=
icat
.
search
(
&
request
,
&
response
);
int
result
=
icat
.
search
(
&
request
,
&
response
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment