Commit 8c77e8a3 authored by Beatriz Sanchez's avatar Beatriz Sanchez
Browse files

more rules

parent 0eea3111
########################################################
# Return a string value:
# Parameters:
#
# *path [IN] Path of collection
# *user [IN] irods user
#
# *response [OUT] return the name of the comunities
#
# Author: Beatriz Sanchez, MPCDF 02.05.2020
##############################################
#
# wrap script ist needed in the msiExecCmd() call because the script b2shareclientCLI.py is python3 and the
# acctual version of epicclient.py is python2
#
##############################################
eudatlistb2shareComunities{
# get the b2share parameter
# getConfParameters(*authzEnabled, *b2shareConf);
*b2shareConf='/opt/eudat/b2safe/conf/b2share_client.json';
# crontrol
writeLine("stdout","[EUDATListB2shareCommunities] Listing b2share communities");
writeLine("stdout","[EUDATListB2shareCommunities] config file *b2shareConf");
writeLine("stdout","[EUDATListB2shareCommunities] user *user");
writeLine("stdout","[EUDATListB2shareCommunities] collection *collection");
*b2sharearg="-h";
writeLine("stdout","[EUDATListB2shareCommunities] arguments for b2shareclientCLI.py is *b2sharearg");
logDebug("[EUDATListB2shareCommunities] Listing b2share communities");
msiExecCmd("P3b2share", "*b2sharearg", "null", "null", "null", *outB2shcl);
msiGetStdoutInExecCmdOut(*outB2shcl, *output);
writeLine("stdout","[EUDATListB2shareCommunities] *output");
# to do: format the response as a string of community names separated by ","
}
INPUT *user='rods', *collection='/tempZone/home/rods/', *community='', *home=''
OUTPUT ruleExecOut
########################################################
# check AVU needed for the publication of a collection in b2share
# and call python3 b2shareclientCLI.py -h
# usage: b2shareclientCLI.py [-h] [--confpath CONFPATH] [--irodsenv IRODSENV]
# --user USER --collection_path COLLECTION_PATH [-d]
# [-v]
# {draft,meta,pub,listCommunities,communitySchema,getDraft,deleteDraft}
# ...
# for the generation of a b2share draft if no draft exits
# for the generation of a metadata file if not exists
# for the publication of the draft and frozen of the collection
########################################################
# Return a string value:
# Parameters:
#
# *path [IN] Path of collection
# *title [IN] publication title forthe collection
#
# *response [OUT] true or false
#
# Author: Beatriz Sanchez, MPCDF 6.4.2020
##############################################
eudatisb2sharepublisch{
# check the existence of AVU EUDAT_B2SHARE_PUBLISHED_ID
msiExecStrCondQuery("SELECT COLL_NAME WHERE META_COLL_ATTR_NAME = 'EUDAT_B2SHARE_PUBLISHED_ID'",*C)
foreach (*C) {
writeLine("stdout","the output is *C ");
# msiGetValByKey(*C,"META_COLL_ATTR_VALUE",*acces_token);
msiGetValByKey(*C,"COLL_NAME",*col_name);
writeLine("stdout","the collection is *col_name ");
}
}
INPUT *home=''
OUTPUT ruleExecOut
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment