project-cdsware-users@cern.ch archives


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding "Upload document" links to records


  • From: "Mike Marino" <mmarino@xxxxxxxxx>
  • Subject: Re: Adding "Upload document" links to records
  • Date: Thu, 20 Sep 2007 13:43:06 -0700

Hi Greg-

  Thanks a lot for your response, it was very helpful.  I found a workaround to avoid the intermediate page so that the link immediately proceeds to the upload page.  It's not especially pretty, but I am unsure as to how one creates an action that proceeds directly to function execution.

First one must set up a distinct action different from a normal submission where one enters a report number.  I'll call it AD1.  AD1 is completely the same as ADD (or perhaps SRV on the cdsware stock distibution) except that it has a different interface page.  This page should have one user-defined element that includes the following code:

<div align="center">
<INPUT TYPE="button" name="endS" width="400" height="50" value="continue"></div>
<SCRIPT LANGUAGE="_javascript_1.1" TYPE="text/_javascript_">
  document.forms[0].action="">  document.forms[0].step.value=1;
  document.forms[0].submit();
</SCRIPT>

The code is executed as soon as the browser reaches this point of the page load and the page itself is submitted.   The included button is unnecessary unless for some reason the page does not load completely. 

Cheers,
Mike

On 9/20/07, Gregory Favre <gregory.favre@xxxxxxx> wrote:
Hi Mike,
We got a similar feature at EPFL. If you look into
websubmit_webinterface.py, you'll perhaps notice a function called
"direct". This provides a link to the submission engine. As an
example here are some parts of my my bfe_edit_record_epfl file:


from invenio.config import weburl
from invenio.messages import gettext_set_language

def format(bfo, style):
     _ = gettext_set_language(bfo.lang)
     out = ""
     reportnumber = bfo.field('037__a')
     collection = bfo.field('980__a')

     # check user rights here...
     out += '<a href="">%s</a>' %
                     (weburl, collection, reportnumber, _("Revise the
fulltext"))


you could perhaps also want users to be able to use the websubmit
edit function:

     out += '<a href=""
%s</a>' % \
                     (weburl, collection, reportnumber, _("Edit this
record"))


This works for me with a small interface problem: the user is first
sent to a page where he can input the reportnumber (although the
field is already filled).

Hope this helps,

Best regards, Greg


Le 19 sept. 07 à 20:26, Mike Marino a écrit :

> Hi all-
>
>    I was wondering if it is possible to add an "Upload Document"
> link to the records.  Right now, there is an "Edit this record"
> link that is available (through the BFE_EDIT_RECORD function).  Has
> anyone uploaded a similar function for uploading a document for the
> record page?  This would vastly simplify the user interface because
> as it stands one must obtain the record number and then proceed to
> modify the record on another page.  Thanks!
>
> Cheers, Mike