On Tue, Nov 20, 2012 at 5:12 PM, Mark Ehle <[email protected]> wrote:
> Ah - thanks. Now I get the whole /dspace/assetstore/14/85/80 thing. It's
> location is in the bitstream name, too.
Yep, easy, but hard to notice :)
> As I don't know squat about postgres (I'm a MySQL guy) in your SQL are you
> actually running the copy command, or just spelling it out? I run it and I
> get 5 lines of the same thing. What I will probably have is the filename
> itself, so what I wind up with is:
>
> SELECT 'cp /dspace/assetstore/' || substr(bitstream.internal_id, 1, 2) ||
> '/' || substr(bitstream.internal_id, 3, 2) || '/' ||
> substr(bitstream.internal_id, 5, 2) || '/' || bitstream.internal_id || '
> /var/www/' || bitstream.name
> FROM bitstream,bundle2bitstream
> WHERE bitstream.source = '(filename)' LIMIT 1
Nevermind that, I was editing another example without much looking at it.
Also remove "|| ' /var/www/' || bitstream.name" and ",bundle2bitstream".
About the 5 lines... The immediate problem is that filename is stored in
bitstream.name, not bitstream.source. The major problem here is that file
name is not unique bitstream identification. Can't you just use the
bitstream_id (easy)? Or item handle + bitstream sequence_id (requires a few
natural joins)?
This gives me something to play with. Now all I have to do is get php to
> talk to postgres and I can have some fun.
>
That should be easy. On Debian, you would just install the php5-pgsql
package. Here's the command reference:
http://php.net/manual/en/book.pgsql.php
While you're at it, also install Adminer:
http://www.adminer.org/
It's like phpMyAdmin, only smaller (a single file) and supports multiple
database backends.
Regards,
~~helix84
Compulsory reading: DSpace Mailing List Etiquette
https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech