project-cdsware-users@cern.ch archives


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

Re: websubmit utmost confusion


  • From: Nicholas Robinson <Nicholas.Robinson@xxxxxxx>
  • Subject: Re: websubmit utmost confusion
  • Date: Thu, 17 Nov 2005 13:15:50 +0100

Dear Ferran,

I'm sorry for the late reply.


1. How to add a collection identifier (980__a) to a new record:


So far I've tried multitude of different combinations of the following
items:


- A few new elements, including a 'Collection' one with a MARC code
980__a, hoping to address the lack of a clear 'submit by collection'
feature.
- Document types, either brand new or cloned from the demo-site examples,
with and without Categories, hoping that a category seems to work like
a collection identifier, according to my grepping into
modules/miscutil/sql/tabfill.sql.


No luck. I can (some times) submit those records, but as they don't have
980__a, they are not searchable, because they don't belong to any collection.


Hmm, OK. If I have understood correctly, you need to add a collection identifier to the MARC record at the time of creation. Let us say that you want to identify a collection of Photographs with the 980__a value "PHOTOS" to identify this collection. You would need to add the following line to the bibconvert configuration template (e.g. EDSTEXTcreate.tpl):

980::DEFP()---<datafield tag="980" ind1="" ind2=""><subfield code="a">PHOTOS</subfield></datafield>

This would ensure that the record for the given collection would contain the necessary 980__a field, and should then be searchable in your Photographs collection.

Please note that if you have tried to clone the "TEXT" submission, then you may be seeing the following in your tempate:

DB---<datafield tag="980" ind1="" ind2=""><subfield code="a"><:comboTEXT::comboTEXT:></subfield></datafield>

This is because this submission was configured to use collection based on the category of document selected. "comboTEXT" contains the value of the category selected (e.g. POETRY). In my "Photos" example above though, this "combo" stuff isn't necessary.


2. Which of the demo-site element types implements 'upload file'?


Uploading a file is not an element, but is rather performed by an end of submission function. Websubmit basically works in two phases:


1. Fill the form elements in the interface.
2. After clicking "submit", the "processing" phase is started, and functions are called which actually process the information and create a record.


Please take a look at the websubmit admin guide for further details...

There is a function called "Upload_Files". After the usual bibliographic information form fields have been filled and the finish submission button has been clicked, the system begins to call the "functions" that have been configured for it (See Edit Functions link). If you want to upload files to a document, you should include the "Upload_Files" as the last function of the first step for that submission. Take a look at the functions (under "Edit Functions") called for SBI on RTEXT in the demo site. You will see that the function is there.

The Upload_Files function effectively creates an interface that allows a user to attach files to a document. After they have submitted their files to it, they click yet another "finish submission" button, which moves the function processing on to the next step, and the creation of the new record continues.

3. What is the difference between EndButton and EndButton2? Which is the
one that *really* finishes the submission and sends the form to the web
server?


No real difference! Just the text displayed in the button. EndButton displays "finish submission", whereas EndButton2 displays the text "finish selection". You could make your own "EndButton3" or even "FinishButton", and just copy the description of EndButton, changing the displayed text to whatever you want. Example: I make a new element. Type user-defined intput, called "FinishButton", with the following description:

<div align="center">
<INPUT TYPE="button" width="400" height="50" name="endS" value="Finish Submission!" onclick="finish();">
</div>


As you can see, the JavaScript function "finish()" is called when the button is clicked. This function is generated dynamically, and is used to stop the submission in the cases where certain mandatory elements have not been filled. Let's take an example. I go to the demo submission "pictorial document (Picture)" and begin a submission.

The first page contains 2 elements: title of the picture, and "photographers". Instead of filling them, I click the summary(2) link in the top corner, then click on the "Report Numbers" link. This takes me to the last page of the submission, and I have effectively bypassed the checks for mandatory title, etc. Now, I click view source, and look in the code for the JavaScript function "finish()". I paste it here for you:

function finish() {
alert ("The field 'Title' is mandatory.\nGoing back to page 1");
document.forms[0].curpage.value="1";
document.forms[0].submit();
}


Because I did not fill my Title element on page 1, it is warning me, and sending me back to page 1. I click the EndButton, and I end up on page 1. OK, this time I go through all of the pages filling in the elements until I get to the last page....

Now when I view the source on the last page, the "finish()" function looks like this:

function finish() {
                    if (tester2()) {
                             document.forms[0].action="submit.py";
                             document.forms[0].step.value=1;
                             document.forms[0].submit();
                           } else {
                             return false;
                           }
                         }

Notice that this time, it calls a function "tester2()". What this function does is to execute any JavaScript checks that have been requested at configuration time on each form element. (JavaScript checks can be defined by you, and you can view the example ones such as DatCheckNew, which checks that the dateis in the correct format, by following the Available JavaScript Checks link in the websubmit manager interface).

tester2() looks like this in this case, as there are no JavaScript checks requested:

function tester2() {
                 el = document.forms[0].elements['NO'];
  el = document.forms[0].elements['Rep'];
  el = document.forms[0].elements['EndButton'];
  return 1;
                  }

These are the elements listed on the current page. In this case, nothing much is done. Anyway, tester2() will return 1, as everything is OK, and "finish()" will execute this code, which will send the form and begin the processing of the submission:

			     document.forms[0].action="submit.py";
                             document.forms[0].step.value=1;
                             document.forms[0].submit();


It's complicated, I know, but at this time it is not easy to change due to legacy reasons. Actually, we plan to refactor the submission system and remove the all of the JavaScript, as soon as time permits.



4. What could be the reason that clicking on the '[finish submission]'
button (at this very moment an EndButton element, although I've also
tried EndButton2, or both), does nothing?


Hmm, odd. Your forms never submit? I can only imagine that there is a JavaScript error somewhere? When you installed the Demo site, did it work (were you able to submit documents?) Have you defined some new elements (user-defined), that could possibly break the JavaScript? How about new JavaScript checks. If you give me some more details, I will try to help, but I can't really say without having seen the code.

5. Is it possible to implement an approval policy per collection? How?


Actually, yes. This functionality already exists in cdsware. Consider for example, the "textual document" in the demo site. There are 2 textual document submissions - one without refereeing, and one "with simple refereeing" (RTEXT). Let's look at RTEXT.


When a document is submitted to this collection, a request for approval is automatically sent to the referees allocated for that given collection. These referees can be allocated in the websubmit manager by using the "SIMPLE APPROVAL REFEREES" button for that document type.

After having submitted a document to this collection, if you log into the system using the account of the allocated referee, and go to the "Your Account" page, you will see link to a section entitled "Your Approvals". Follow the link.

It will take you to a page listing all of the document types and categories for which you are referee. If you click one of these links, you will see details of any documents that are awaiting approval. From the page displaying details of the document, you will see that there is a button "approve/reject" the document. Clicking this button will take you to a websubmit interface that allows you to approve/reject, and send comments to the author.



I hope that this information is helpful to you. Please don't hesitate to ask me if I can help with anything else.

Best wishes,
Nick
--
CERN Document Server ** <http://cds.cern.ch/> ** <cds.support@xxxxxxx>
Room: Bldg 513-R-063 ** Voice: +41-22-76-70966 **