[ 
https://jira.duraspace.org/browse/DS-749?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=19580#action_19580
 ] 

Tim Donohue commented on DS-749:
--------------------------------

This issue was discussed in the Developers Meeting on March 23, 2011:

[20:12] <tdonohue> Next one: DS-749
[20:12] <kompewter> [ https://jira.duraspace.org/browse/DS-749 ] - [#DS-749] 
allow for bitstream display order to be changed - DuraSpace JIRA
[20:12] <kshepherd> an oldie but a goodie ;)
[20:13] <mdiggory> kompewter rules
[20:13] <mdiggory> aahh PERL code
[20:13] <PeterDietz> Ds-749 is a feature improvement, involves a new field in DB
[20:14] <tdonohue> yea, it also has perl code :(
[20:14] <kshepherd> and people ask for it all the time
[20:15] <tdonohue> +1 to the idea. Needs analysis and improvements on 
implementation (no perl code please)
[20:15] <kshepherd> heh
[20:15] <richardrodgers> my vote would be to add it to the 'general metadata on 
DSpace objects' project....
[20:15] <kshepherd> also +1 to the general idea, think the impl could be a bit 
more simple
[20:15] <mhwood> +1 idea
[20:15] * dungth ([email protected]) Quit (Read error: Connection reset 
by peer)
[20:16] <tdonohue> Any volunteers to look at? Should we add to 'metadata on all 
objects' project (like richardrodgers suggests)?
[20:16] <mdiggory> TBH, I don't like how this is written
[20:16] <mdiggory> -1
[20:17] <kshepherd> how would it work as metadata?
[20:17] <mdiggory> Order is an attribute of the Bundle the Bitstream are in, 
not the Bitstream itself
[20:17] <kshepherd> i would have thought it was more of a bitstream table thing
[20:17] <KevinVdV> What about using sequence id ?
[20:18] <KevinVdV> To hold the order
[20:18] <kshepherd> mdiggory: well... that's not going to appease all the 
repository managers who want to line up the multiple PDFs they have in 
ORIGINAL, etc..
[20:18] <tdonohue> Summary DS-749: +1 total, several concerns about 
implementation, but idea is good. Needs volunteer to analyze & suggest a 
resolution
[20:18] <PeterDietz> sequence_id = internal, can't be used for display, might 
break things
[20:18] * tdonohue reminds us that we are trying to do 'quick reviews' here :)
[20:18] <mdiggory> kshepherd: not saying its not important... saying its 
implemented in the JIRA ticket wrong
[20:18] <PeterDietz> DS-192 allows for sorting based on order
[20:18] <kompewter> [ https://jira.duraspace.org/browse/DS-192 ] - [#DS-192] 
Bitstreams should be returned ordered - DuraSpace JIRA
[20:18] <kshepherd> oh yeah well i was +1 idea, not +1 patch, to be clear ;)
[20:19] <PeterDietz> ...and this one needs to be implemented as slick 
drag-n-drop for reordering
...
[20:19] <mdiggory> sorry, my vote was for applying the patch (if thats what 
posting code into a description is)
[20:19] <tdonohue> (Please feel free to add impl details/ideas directly to 
Ds-749 if you have them)
[20:19] <mdiggory> +1 for idea, needs to be written properly though

> allow for bitstream display order to be changed
> -----------------------------------------------
>
>                 Key: DS-749
>                 URL: https://jira.duraspace.org/browse/DS-749
>             Project: DSpace
>          Issue Type: New Feature
>          Components: JSPUI
>            Reporter: Jose Blanco
>
> This patch allows user with access priviledges to edit an item to change the 
> order in which a bitstream is displayed 
> in the item display.  This patch is for the JSPUI. 
> The first thing that needs to be done is that a new field needs to be added 
> to the bitstream table with the following SQL:
> alter table bitstream add display_order integer;
> Then that field needs to be populated with the values in the sequence_id 
> table.  I have provided a perl script 
> that I used to do this: fix-display-order.
> Once this is done, make the following code changes.
> File =>tools/edit-item-form.jsp
> +             <th id="t11" class="oddRowOddCol"><strong><fmt:message 
> key="jsp.tools.edit-item-form.elem10"/></strong></th>
>               <th id="t11" class="oddRowEvenCol"><strong><fmt:message 
> key="jsp.tools.edit-item-form.elem5"/></strong></th>
> AND
> +                <td headers="t11" class="<%= row %>RowOddCol">
> +                    <input type="text" name="bitstream_order_<%= key %>" 
> value="<%= (Integer.toString(bitstreams[j].getDisplayOrder()) == null ? "" : 
> Integer.toString(bitstreams[j].getDisplayOrder())) %>" size="4"/>
> +                </td>
>               <% if (bundles[i].getName().equals("ORIGINAL"))
>                  { %>
> File => Messages.properties
> jsp.tools.edit-item-form.elem9                                  = Description
> +jsp.tools.edit-item-form.elem10                                = 
> Display<BR>Order
> file Biststream.java
> +     public int getDisplayOrder()
> +     {
> +         return bRow.getIntColumn("display_order");
> +     }
> + 
> +     public void setDisplayOrder(int order)
> +     {
> +         bRow.setColumn("display_order", order);
> +         modifiedMetadata = true;
> +         addDetails("DisplayOrder");
> +     }
>  
> File => Item.java
>                 if (streams[k].getSequenceID() < 0)
>                 {
>                     streams[k].setSequenceID(sequence);
> +                    streams[k].setDisplayOrder(sequence);
>                     sequence++;
>                     streams[k].update();
>                 }
> File => Bundle.java
> -                        + "bundle2bitstream.bundle_id= ? ",
> +                         + "bundle2bitstream.bundle_id= ? "
> +                       + "ORDER BY bitstream.display_order",
> File =>  EditItemServlet.java
>                     int formatID = UIUtil.getIntParameter(request,
>                             "bitstream_format_id_" + key);
> +                    int display_order = UIUtil.getIntParameter(request,
> +                            "bitstream_order_" + key);
> AND
>                     bitstream.setName(name);
>                     bitstream.setSource(source);
>                     bitstream.setDescription(desc);
> +                    bitstream.setDisplayOrder(display_order);
> ==============================================
> This is the fix-display-order perl script used to iniailize display_order:
> #!/usr/bin/perl
> RE.
> BEGIN
> {
>         require "strict.pm";
>         strict::import();
> }
> # ----------------------------------------------------------------------
> #               start of MAIN
> # ----------------------------------------------------------------------
> use Encode;
> use utf8;
> use DBI;
> use File::Path;
> my $dbhP = DBI->connect("dbi:Pg:dbname=dspace-name", "dspace-user", 
> "password");
> &UpdateDisplayOrder ();
> $dbhP->disconnect;
> exit;
> sub UpdateDisplayOrder
> {
>     
>   my $statement = qq{select bitstream_id, sequence_id from bitstream};
>     my $sth = $dbhP->prepare($statement)
>       or die "Couldn't prepare statement: " . $dbhP->errstr;
>     
>     # Read the matching records and print them out
>     $sth->execute()             # Execute the query
>       or die "Couldn't execute statement: " . $sth->errstr;
>     my $count = 0;
>     my ( $url, $msg );
>     my ( $bitstream_id, $sequence_id, @data );
>     while (@data = $sth->fetchrow_array()) {
>       $bitstream_id       = $data[0];
>       $sequence_id        = $data[1];
>      
>       if ( $sequence_id )
>       {
>       my $sql = qq{update bitstream set display_order = $sequence_id where 
> bitstream_id= $bitstream_id};
>         &ProcessSQL ( $sql );
>       }
>     }
>     $sth->finish;
> }
> sub ProcessSQL 
>   {
>     my ( $statement ) = @_;
>     my $sth = $dbhP->prepare($statement)
>       or die "Couldn't prepare statement: " . $dbhP->errstr;
>   
>     # Read the matching records and print them out
>     $sth->execute()             # Execute the query
>       or die "Couldn't execute statement: " . $sth->errstr;
>     $sth->finish;
>   }
> __END__;
> ==============================================

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://jira.duraspace.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Dspace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-devel

Reply via email to