Hey Alan,

I'm sure that tool would generate a very nice REST API interface for us. 
It's written in Haskell <https://www.haskell.org/>, functional programming 
is the next OOP :D. 

I feel, however, that we don't really need a full-blown REST API, e.g., we 
don't need to create, update or delete items in the database.

All we need is a query-able listing interface with a response structure 
that we can use easily. I have been able to structure the response for ease 
of use <https://gist.github.com/tsega/c499135d6284611ca223efe3fc7feebd> on 
our websites. I created a Ruby on Rails pure API application for this, I'll 
have it up on GitHub tomorrow. 

Now what is remaining is to be able query items by communities, 
collections, subject etc. Coming very soon!

After that is the visualizations, digging deep in Apache Solr; hopefully 
someone here would be able to help us as well.

On Saturday, April 1, 2017 at 6:50:35 PM UTC+3, Alan Orth wrote:
>
> I've often wondered if it would be possible to use something like 
> PostgREST to automatically create a REST API from DSpace's PostgreSQL 
> database.
>
> https://github.com/begriffs/postgrest
>
> Has anyone tried this?
>
> On Sat, Apr 1, 2017 at 5:44 PM Tsegaselassie Tadesse <[email protected] 
> <javascript:>> wrote:
>
>> Pick an easy problem, OK?  :)
>>
>>
>> Thanks I will next time :D
>>
>> That query pointed me into the right direction. I had no idea the 
>> bitstream information was part of the metadata. 
>>
>> I would never have guessed it.
>>
>> Thanks again! 
>>
>> On Thursday, March 30, 2017 at 6:36:06 PM UTC+3, Chris Gray wrote:
>>>
>>> Pick an easy problem, OK?  :)
>>>
>>> I can get you started and get you to the file name and sequence number, 
>>> but the policy (isAllowed=y) is trickier because policies are hierarchical 
>>> and inheritable.  I haven't worked much with policies in the database.
>>>
>>> This will get you started, to get the other data given a handle:
>>>
>>> select item2bundle.item_id, bundle_id, bitstream_id, text_value as 
>>> filename, sequence_id
>>> from bitstream --here we go up the hierarchy
>>> join bundle2bitstream
>>> using (bitstream_id)
>>> join item2bundle
>>> using (bundle_id)
>>> join handle
>>> on (handle.resource_id = item2bundle.item_id)
>>> join metadatavalue
>>> on (bitstream.bitstream_id = metadatavalue.resource_id) --file name is 
>>> dc.title for the bitstream
>>> where handle = '10568/70234' -- your handle example
>>> and metadata_field_id = 64 -- dc.title
>>> and bitstream_format_id = 11;
>>>
>>> The text_value is the file name.  This will require some refinement, 
>>> since there may be other jpeg bitstreams (bitstream_format_id = 11).  You 
>>> could check that the file name ends in .pdf.jpg instead of using the 
>>> bitstream_format_id.
>>>
>>> You can look up the policies by using the resource_id in the 
>>> resourcepolicy table, but deciphering that isn't straightforward.  It 
>>> depends if you ever make thumbnails private.  We don't in our instance.
>>>
>>> Cheers,
>>> Chris
>>>
>>> On Thursday, March 30, 2017 at 10:35:57 AM UTC-4, Tsegaselassie Tadesse 
>>> wrote:
>>>>
>>>> I am trying to build a very light-weight API endpoint that lists items 
>>>> from the database. I want to provide a url link to the item's thumbnail 
>>>> but 
>>>> it seems DSpace works very differently from what I expected.
>>>>
>>>> I have read the Storage Layer 
>>>> <https://wiki.duraspace.org/display/DSDOC5x/Storage+Layer> documentation 
>>>> the Bitstream Store section to be specific on how to use the internal id 
>>>> to 
>>>> get to the directory of the bitstream; however, I am looking for is just 
>>>> to 
>>>> get the exact thumbnail for the item; e.g. on the detail page of an item, 
>>>> https://cgspace.cgiar.org/handle/10568/70234, you will see the 
>>>> thumbnail has a normal image source, https://cgspace.cgiar.org/
>>>> bitstream/handle/10568/70234/beca_africanRice_poster_feb2016.pdf.jpg?sequence=4&isAllowed=y
>>>> .
>>>>
>>>> How do I generate that?
>>>>
>>> -- 
>> 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] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> Visit this group at https://groups.google.com/group/dspace-tech.
>> For more options, visit https://groups.google.com/d/optout.
>>
> -- 
>
> Alan Orth
> [email protected] <javascript:>
> https://englishbulgaria.net
> https://alaninkenya.org
> https://mjanja.ch
>

-- 
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.

Reply via email to