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: [email protected] <[email protected]> On Behalf Of 
Chris Clawson
Sent: Tuesday, 18 January 2022 6:28 AM
To: DSpace Technical Support <[email protected]>
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.


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/<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<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






--
All messages to this mailing list should adhere to the Code of Conduct: 
https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx<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 
[email protected]<mailto:[email protected]>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dspace-tech/6dc88382-5ac6-480f-a1e2-2d0f3f849fdan%40googlegroups.com<https://groups.google.com/d/msgid/dspace-tech/6dc88382-5ac6-480f-a1e2-2d0f3f849fdan%40googlegroups.com?utm_medium=email&utm_source=footer>.

________________________________

"The contents of this e-mail (including any attachments) may be confidential 
and/or subject to copyright. Any unauthorised use, distribution, or copying of 
the contents is expressly prohibited. If you have received this e-mail in 
error, please advise the sender by return e-mail or telephone and then delete 
this e-mail together with all attachments from your system."

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dspace-tech/SYCPR01MB5037E45A3324CE5266B69275C5579%40SYCPR01MB5037.ausprd01.prod.outlook.com.

Reply via email to