The following query might help. I use this to generate thumbnail links in
a PHP report tool.
This assumes you have already queried an item from table item i. You would
need additional logic to extract the primary bitstream.
select array_to_string(array_agg(text('{$handleContext}/bitstream/id/' ||
bit.bitstream_id || '/' || bit.name)), '<hr/>')
from bitstream bit
inner join bundle2bitstream b2b
on b2b.bitstream_id = bit.bitstream_id
inner join bundle b
on b2b.bundle_id = b.bundle_id
and b.name = 'THUMBNAIL'
inner join item2bundle i2b
on i2b.bundle_id = b.bundle_id
and i2b.item_id=i.item_id
https://github.com/Georgetown-University-Libraries/batch-tools/blob/master/web/query/auxFields.php#L38-L49
Terry
On Wed, Dec 10, 2014 at 9:11 AM, Mark Ehle <marke...@gmail.com> wrote:
> Folks -
>
> I am in need of a way to query postgres in Dspace to give me the ID of the
> primary bitstream's thumbnail ID. I am able to get the primary bitstream ID
> from the handle (thanks to helix84
> <http://dspace.2283337.n4.nabble.com/template/NamlServlet.jtp?macro=user_nodes&user=211466>,
>
> http://dspace.2283337.n4.nabble.com/Get-item-id-from-bitstream-handle-td4662208.html)
> but I don't know where to match up the thumbnail to it.
>
> Thanks!
>
> Mark Ehle
> Computer Support Librarian
> Willard Library
> Battle Creek, MI
>
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
>
> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
> _______________________________________________
> DSpace-tech mailing list
> DSpace-tech@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/dspace-tech
> List Etiquette:
> https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
>
--
Terry Brady
Applications Programmer Analyst
Georgetown University Library Information Technology
https://www.library.georgetown.edu/lit/code
425-298-5498
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette