Hi Christoph,

I know this answer is a bit late, but as far as I'm aware, the DSpace 5.x or 
6.x REST API does not have a way to flag an Item as "private".  This feature 
however will be coming in DSpace 7 (as that new REST API will provide all 
functionality available at the UI layer).

If you use the database approach of flipping the "discoverable" flag, that will 
work, but *only* if you also trigger a reindex of the Item.  That is likely the 
step you are missing...if you call the Java API directly, this API not only 
changes the database flag but also flags the Item as "modified", which triggers 
a reindex.  
https://github.com/DSpace/DSpace/blob/dspace-6_x/dspace-api/src/main/java/org/dspace/content/Item.java#L177

Hopefully that gives you another clue on how to make this work.

Tim
________________________________
From: [email protected] <[email protected]> on 
behalf of Christoph Weber <[email protected]>
Sent: Monday, December 16, 2019 9:50 AM
To: DSpace Community <[email protected]>
Subject: [dspace-community] Setting Item to private using REST or Database 
updates

Hello DSpace Community,

I upload items to DSpace using a self-written production tool for our 
publications which compiles TeX files and uploads the pdf to DSpace using the 
REST API.

These publications should be private at first until the TeX file authors have 
approved the publication.
This works perfectly by making the item "private" using the webinterface.

But I need to integrate this functionality to our production tool.

Is this possible with the REST API? I haven't found anything in the REST API 
docs.

Alternatively, I could modify some flags directly in the postgresql database.

I've found out that the "discoverable" flag changes when making an item privat, 
but the item does not become private when setting the flag manually.
Are there some other flags I need to set or do I need to trigger some function 
to hide the item in the collection?

Best regards,
Christoph

--
All messages to this mailing list should adhere to the DuraSpace Code of 
Conduct: https://duraspace.org/about/policies/code-of-conduct/
---
You received this message because you are subscribed to the Google Groups 
"DSpace Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:[email protected]>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dspace-community/94cdc816-db7c-496a-bee6-75b494408baa%40googlegroups.com<https://groups.google.com/d/msgid/dspace-community/94cdc816-db7c-496a-bee6-75b494408baa%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
All messages to this mailing list should adhere to the DuraSpace Code of 
Conduct: https://duraspace.org/about/policies/code-of-conduct/
--- 
You received this message because you are subscribed to the Google Groups 
"DSpace Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dspace-community/DM5PR2201MB1148C7DF5DAEDE7E15647675ED230%40DM5PR2201MB1148.namprd22.prod.outlook.com.

Reply via email to