-
Notifications
You must be signed in to change notification settings - Fork 2
Collections
Mehmood Asghar edited this page Jul 24, 2021
·
2 revisions
The collections API allows the following actions:
- Create new collection
- Update collection options
- Rename collection
- Delete collection
- Get studies by collection
- Get owner collection and linked collections by studies
- Set owner collection and link collections to studies
Parameters
-
repositoryid
: Unique ID for the collection -
title
: Collection title -
short_text
: Short description for the collection -
long_text
: Long description for the collection -
thumbnail
: Path to the thumbnail file -
weight
: Weight to control the sort order -
section
: Section/Group type for collection - [2
= Regional collection,3
=Specialized collection] -
ispublished
: Set publish status - valid values: [0
=draft,1
=publish]
collection_add(repositoryid, title, short_text, long_text, ...)
collection_add(
repositoryid = 'demo',
title='Demo collection',
short_text = 'Mauris nec arcu ac lorem ornare semper',
long_text = '<p>Mauris nec arcu ac lorem ornare semper. Duis eleifend purus scelerisque, varius justo eu, tempus velit. Vestibulum porta, quam non aliquam commodo, elit ligula finibus risus, eu lobortis felis nunc at mi. Pellentesque pharetra in tortor nec efficitur.</p>',
ispublished = 1,
thumbnail='path/to/thumbnail.jpg'
)
Parameters: All parameters are optional except repositoryid
-
repositoryid
: (REQUIRED) Unique ID for the collection -
title
: Collection title -
short_text
: Short description for the collection -
long_text
: Long description for the collection -
thumbnail
: Path to the thumbnail file -
weight
: Weight to control the sort order -
section
: Section/Group type for collection - [2
= Regional collection,3
=Specialized collection] -
ispublished
: Set publish status - valid values: [0
=draft,1
=publish]
collection_update(repositoryid, title, short_text, long_text, ...)
collection_update(
repositoryid = 'demo,
title='Demo collection title'
)
collection_update(
repositoryid = 'demo,
title='Demo collection',
thumbnail='path/to/thumbnail.jpg'
)
Parameters
-
repositoryid
: (REQUIRED) Unique ID for the collection
collection_delete(repositoryid)
collection_delete(
repositoryid = 'demo'
)
Parameters
-
old_idno
: (REQUIRED) Collection IDNo to be replaced -
new_idno
: (REQUIRED) New Collection IDNo
collection_rename(old_idno, new_idno)
collection_rename(
old_idno = 'demo',
new_idno = 'demo-v2'
)
Use this function to set owner collection for a study and add a study to multiple collections for display
Parameters
-
study_idno
: (REQUIRED) Study IDNo -
owner_collection
: Owner collection IDNo -
link_collections
: List of collections that should display the study -
mode
: (REQUIRED) Update or replace the linked collections. Valid valuesupdate
orreplace
. Default isupdate
dataset_attach_collections(
study_idno,
owner_collection=NULL,
link_collections=list(),
mode="update")
dataset_attach_collections (
study_idno='study-idno-001',
owner_collection='demo',
link_collections=list('collection1','collection2'),
mode="update")