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
912e22f5
Commit
912e22f5
authored
1 year ago
by
Marco Del Tufo
Browse files
Options
Downloads
Patches
Plain Diff
Update excel-import-service.md
parent
ecf289ae
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!40
SSDM-13578 : 2PT : Database and V3 Implementation - include the new AFS "free"...
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/user-documentation/advance-features/excel-import-service.md
+31
-34
31 additions, 34 deletions
...er-documentation/advance-features/excel-import-service.md
with
31 additions
and
34 deletions
docs/user-documentation/advance-features/excel-import-service.md
+
31
−
34
View file @
912e22f5
# Excel Import Service
-
Created by
[
Fuentes Serna Juan Mariano
(ID)
](
%20%20%20%20/display/~juanf%0A
)
, last modified on
[
Dec 05,
2022
](
/pages/diffpagesbyversion.action?pageId=53745981&selectedPageVersions=7&selectedPageVersions=8
"Show changes"
)
## Introduction
The Excel import service reads xls definitions for both types and
...
...
@@ -327,18 +321,21 @@ version.
For every TYPE found in the Excel sheet the next algorithm is performed:
IF ENTITY OR (TYPE.Version > STORED_VERSION) OR (TYPE.Version == FORCE): // If is a new version
IF ITEM NOT EXISTS in openBIS:
CREATE ITEM
ELSE: // Doesn't exist branch
IF FAIL_IF_EXISTS:
THROW EXCEPTION
IF UPDATE_IF_EXISTS:
UPDATE ITEM
ELSE IF IGNORE_EXISTING:
PASS // Ignore as requested
ELSE:
PASS // Ignore object that have not been updated
```
py
IF
ENTITY
OR
(
TYPE
.
Version
>
STORED_VERSION
)
OR
(
TYPE
.
Version
==
FORCE
):
//
If
is
a
new
version
IF
ITEM
NOT
EXISTS
in
openBIS
:
CREATE
ITEM
ELSE
:
//
Doesn
'
t exist branch
IF FAIL_IF_EXISTS:
THROW EXCEPTION
IF UPDATE_IF_EXISTS:
UPDATE ITEM
ELSE IF IGNORE_EXISTING:
PASS // Ignore as requested
ELSE:
PASS // Ignore object that have not been updated
```
...
...
@@ -510,22 +507,22 @@ be contained in ***scripts* directory** under master-data.
Contents of initialize-master-data.py:
from ch.ethz.sis.openbis.generic.server.asapi.v3 import ApplicationServerApi
from ch.
systemsx.c
is
d
.openbis.generic.server
import CommonServiceProvider
from ch.
ethz.s
is.openbis.generic.
asapi.v3.dto.service.id
import C
ustomAS
Service
Co
de
from ch.ethz.sis.openbis.generic.asapi.v3.dto.service import CustomASService
ExecutionOptions
from ch.
systemsx.c
is
d
.openbis.generic.
server.jython.api.v1.impl import MasterDataRegistrationHelper
import sys
helper = MasterDataRegistrationHelper(sys.path)
api = CommonServiceProvider.getApplicationContext().getBean(ApplicationServerApi.INTERNAL_SERVICE_NAME
)
sessionToken = api.loginAsSystem(
)
props = CustomASServiceExecutionOptions().withParameter('xls', helper.listXlsByteArrays()) \
.withParameter('xls_name', 'ELN-LIMS-LIFE-SCIENCES').withParameter('update_mode', 'UPDATE_IF_EXISTS'
) \
.withParameter('
scripts', helper.getAllScripts())
result = api.executeCustomASService(sessionToken, CustomASServiceCode("xls-import-api"), props
)
```
python
from
ch.
ethz.s
is.openbis.generic.server
.asapi.v3
import
ApplicationServerApi
from
ch.
systemsx.c
is
d
.openbis.generic.
server
import
C
ommon
Service
Provi
de
r
from
ch.ethz.sis.openbis.generic.asapi.v3.dto.service
.id
import
CustomASService
Code
from
ch.
ethz.s
is.openbis.generic.
asapi.v3.dto.service
import
CustomASServiceExecutionOptions
from
ch.systemsx.cisd.openbis.generic.server.jython.api.v1.impl
import
MasterDataRegistrationHelper
import
sys
helper
=
MasterDataRegistrationHelper
(
sys
.
path
)
api
=
CommonServiceProvider
.
getApplicationContext
().
getBean
(
ApplicationServerApi
.
INTERNAL_SERVICE_NAME
)
sessionToken
=
api
.
loginAsSystem
()
props
=
CustomASServiceExecutionOptions
().
withParameter
(
'
xls
'
,
helper
.
listXlsByteArrays
()
)
\
.
withParameter
(
'
xls_name
'
,
'
ELN-LIMS-LIFE-SCIENCES
'
).
withParameter
(
'
update_mode
'
,
'
UPDATE_IF_EXISTS
'
)
\
.
withParameter
(
'
scripts
'
,
helper
.
getAllScripts
()
)
result
=
api
.
executeCustomASService
(
sessionToken
,
CustomASServiceCode
(
"
xls-import-api
"
),
props
)
```
There are following parameters to fill (Easiest is to use
MasterDataRegistrationHelper to evaluate parameter values):
...
...
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