Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
ab2f95f5
Commit
ab2f95f5
authored
5 years ago
by
vkovtun
Browse files
Options
Downloads
Patches
Plain Diff
SSDM-8405 Fixing hard-coded data store code. Taking the first datastore found using V3 API.
parent
a61bc2a8
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
openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/services/publication-api/publication-api.py
+8
-1
8 additions, 1 deletion
...eln-lims/1/as/services/publication-api/publication-api.py
with
8 additions
and
1 deletion
openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/services/publication-api/publication-api.py
+
8
−
1
View file @
ab2f95f5
...
...
@@ -4,7 +4,9 @@ from ch.ethz.sis.openbis.generic.asapi.v3.dto.dataset import DataSetKind
from
ch.ethz.sis.openbis.generic.asapi.v3.dto.dataset.create
import
DataSetCreation
from
ch.ethz.sis.openbis.generic.asapi.v3.dto.dataset.fetchoptions
import
DataSetFetchOptions
from
ch.ethz.sis.openbis.generic.asapi.v3.dto.dataset.id
import
DataSetPermId
from
ch.ethz.sis.openbis.generic.asapi.v3.dto.datastore.fetchoptions
import
DataStoreFetchOptions
from
ch.ethz.sis.openbis.generic.asapi.v3.dto.datastore.id
import
DataStorePermId
from
ch.ethz.sis.openbis.generic.asapi.v3.dto.datastore.search
import
DataStoreSearchCriteria
from
ch.ethz.sis.openbis.generic.asapi.v3.dto.entitytype
import
EntityKind
from
ch.ethz.sis.openbis.generic.asapi.v3.dto.entitytype.id
import
EntityTypePermId
from
ch.ethz.sis.openbis.generic.asapi.v3.dto.experiment.id
import
ExperimentIdentifier
...
...
@@ -63,7 +65,7 @@ def createDataSet(parameters, sessionToken, v3, sampleId):
dataSetIds
=
v3
.
getDataSets
(
sessionToken
,
identifiers
,
DataSetFetchOptions
()).
keys
()
operationLog
.
debug
(
'
Found %d data sets.
'
%
len
(
dataSetIds
))
dataStoreCode
=
parameters
.
get
(
'
dataStoreCode
'
)
dataStoreCode
=
getDefaultDataStoreCode
(
v3
,
sessionToken
)
dataSetCreation
=
DataSetCreation
()
dataSetCreation
.
setAutoGeneratedCode
(
True
)
...
...
@@ -75,6 +77,11 @@ def createDataSet(parameters, sessionToken, v3, sampleId):
v3
.
createDataSets
(
sessionToken
,
[
dataSetCreation
])
def
getDefaultDataStoreCode
(
v3
,
sessionToken
):
searchResult
=
v3
.
searchDataStores
(
sessionToken
,
DataStoreSearchCriteria
(),
DataStoreFetchOptions
())
return
searchResult
.
objects
.
get
(
0
).
code
def
createPublicationSample
(
parameters
,
sessionToken
,
v3
):
publicationOrganization
=
parameters
.
get
(
'
publicationOrganization
'
)
publicationType
=
parameters
.
get
(
'
publicationType
'
)
# The only valid value for now is "Public Repository"
...
...
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