I am trying to populate a Wordpress page with DSpace content, directly from my own repository on the same server. I have a demo of this idea at https://montaguearchive.org/index.php/hurricane-of-1938-page-3/ . This example uses a php script to read a server side list of URIs I wish to place in a gallery. It then uses CURL to make web calls to these links, extract the information and then populate a web page in Wordpress.
Might someone please help in achieving this by using direct queries to DSpace's postgresql database?
I am attaching a demo script based on the information at https://wiki.lyrasis.org/display/DSPACE/The+metadatavalue+table .
When I edit this script to match my DSpace db login and use an 'id' (from an exported metadata .csv), it will execute and echo the dc.contributor.author of this item inside a terminal shell. Try this only if you have installed the proper php module which allows a login to your database. In my case, it was php7.1-pgsql.
Is there better documentation somewhere which hints or explains how to use the DSpace tables in a direct SQL query? Are there human readable forms in the DSpace installation files, which would hint at some of these methods?
Might someone provide specific examples, based on this script I have provided?
Using an exported csv as a reference, I need to build queries for these specific terms (using the 'id' of an item in the csv column 1):
dc.description
dc.identifier.uri
dc.title
----** and importantly, how may an image bitstream be retrieved in a manner which can be placed in a web page?
I
really believe this technique may help promote DSpace by making it
easier to create visual galleries and presentations in Wordpress (or
other) websites. DSpace is an incredible resource for creating and
managing repositories, but really should have an easier way to
present it's content to an audience interested in casual browsing or
authored presentations. My web visitors are just not motivated when I
tell them “go and explore the database”.
Please help.,
Chris
Do you need to use direct queries to the database? Even if you are on the same server it might be simpler to use the REST API (see documentation at https://wiki.lyrasis.org/display/DSDOC7x/REST+API) and if you ever might split the Wordpress site onto a different server it would be more robust.
Other options (probably not as good, but included for completeness) might be to call an OAI feed (would work best by collection and/or by date - https://wiki.lyrasis.org/display/DSDOC7x/OAI) or OpenSearch (can work via keyword queries - https://wiki.lyrasis.org/display/DSDOC7x/Business+Logic+Layer#BusinessLogicLayer-OpenSearchSupport).
Deborah
From: dspac...@googlegroups.com <dspac...@googlegroups.com>
On Behalf Of Chris Clawson
Sent: Tuesday, 18 January 2022 6:28 AM
To: DSpace Technical Support <dspac...@googlegroups.com>
Subject: [dspace-tech] Using PHP for DSpace content in Wordpress?
|
Caution: This email originated from outside our organisation. Do not click links or open attachments unless you recognize the sender and know the content is safe. |
--
All messages to this mailing list should adhere to the Code of Conduct:
https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
---
You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
dspace-tech...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/dspace-tech/6dc88382-5ac6-480f-a1e2-2d0f3f849fdan%40googlegroups.com.
I’ve only interacted with DSpace’s RESTful interface via another software integration so can’t help much. But I *think*(1) that if you’re only dealing with open access collections anyway, then you mightn’t need to worry about any authentication stuff at all, and then you can probably just make a bunch of cURL GET requests which it sounds like you’re already familiar with. (Plus some json_decode functions, see the PHP manual if needed there.)
Deborah
(1) Ie I’m too lazy to double-check but am pretty sure I made some browser-based GET calls without authenticating at some point.
To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-tech/633ec4dc-b051-4aa7-ba80-71ad576ee15bn%40googlegroups.com.