Page MenuHomec4science

websubmit-admin-guide.webdoc
No OneTemporary

File Metadata

Created
Wed, Jul 10, 18:55

websubmit-admin-guide.webdoc

# -*- mode: html; coding: utf-8; -*-
# This file is part of Invenio.
# Copyright (C) 2007, 2008, 2010, 2011, 2013 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# Invenio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Invenio; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
<!-- WebDoc-Page-Title: _(WebSubmit Admin Guide)_ -->
<!-- WebDoc-Page-Navtrail: <a class="navtrail" href="<CFG_SITE_URL>/help/admin<lang:link/>">_(Admin Area)_</a> -->
<!-- WebDoc-Page-Revision: $Id$ -->
<style type="text/css">
<!--
.helpnote {
color: #333;
background-color: #ddd;
border: 1px solid #aaa;
padding:4px;
margin:4px;
}
.center {
margin:auto;
text-align:center;
margin:4px;
}
.center label{
clear:both;
text-align:center;
margin:auto;
font-style: italic;
display:block;
}
.code {
border: 1px solid #aaa;
overflow-x: auto;
padding: 8px;
}
-->
</style>
<p class="helpnote"><em>Disclaimer:</em> Though this guide provides
all the necessary information to start learning WebSubmit from scratch
and reach a good level in administrating it, this guide is not yet
fully complete, and might contain information that has not been
strictly verified (sample codes are for eg. provided "AS IS", only to
offer some guidance to the admin). <br/> Specific topics would gain to
be more developed, such as HOW-TOs, sample workflows (for eg. approval
workflows and referee management). At this point the demo submissions
that come standard with the Atlantis demo site remain essential
companions to this guide.<br/>
<b>Contributions are welcome (for eg. sample workflows, function
descriptions, etc.)</b>
</p>
<h2>Contents</h2>
<ul style="list-style-type:None">
<li><strong>1. <a href="#shortIntro">Overview</a></strong>
<ul style="list-style-type:None">
<li>1.1&nbsp;&nbsp;<a href="#philosophy">How WebSubmit works</a></li>
<li>1.2&nbsp;&nbsp;<a href="#behindthescenes">Behind the scenes</a></li>
</ul>
</li>
<li><strong>2. <a href="#2">Configure Submissions: a Tutorial</a></strong>
<ul style="list-style-type:None">
<li>2.1&nbsp;&nbsp;<a href="#2.1">Creating the submission</a></li>
<li>2.2&nbsp;&nbsp;<a href="#2.2">Building the interface</a></li>
<li>2.3&nbsp;&nbsp;<a href="#2.3">Adding the functions</a></li>
<li>2.4&nbsp;&nbsp;<a href="#2.4">Restricting the submission</a></li>
</ul>
</li>
<li><strong>3. <a href="#3">WebSubmit Elements</a></strong>
<ul style="list-style-type:None">
<li>3.1&nbsp;&nbsp;<a href="#3.1">Existing elements</a></li>
<li>3.2&nbsp;&nbsp;<a href="#3.2">Creating a new element</a></li>
<li>3.3&nbsp;&nbsp;<a href="#3.3">Creating a new check</a></li>
</ul>
</li>
<li><strong>4. <a href="#4">WebSubmit Functions</a></strong>
<ul style="list-style-type:None">
<li>4.1&nbsp;&nbsp;<a href="#4.1">Existing functions</a></li>
<li>4.2&nbsp;&nbsp;<a href="#4.2">Creating a new function</a></li>
</ul>
</li>
<!--<li><strong>2. <a href="#2"></a></strong>
<ul style="list-style-type:None">
<li>2.1&nbsp;&nbsp;<a href="#2.1"></a></li>
</ul>
</li>-->
<li><strong>5. <a href="#5">File Management with WebSubmit</a></strong>
<ul style="list-style-type:None">
<li>5.1&nbsp;&nbsp;<a href="#5.1"><b>Option 1:</b> File Input element + FFT</a></li>
<li>5.2&nbsp;&nbsp;<a href="#5.2"><b>Option 2:</b> File Input element + Move_Files_To_Storage function</a></li>
<li>5.3&nbsp;&nbsp;<a href="#5.3"><b>Option 3:</b> Create_Upload_Files_Interface + Move_Uploaded_Files_To_Storage functions</a></li>
<li>5.4&nbsp;&nbsp;<a href="#5.4"><b>Option 4:</b> Upload_File element instance + Move_Uploaded_Files_To_Storage function</a></li>
<li>5.5&nbsp;&nbsp;<a href="#5.5"><b>Option 5:</b> FCKeditor element instance + Move_FCKeditor_Files_To_Storage function</a></li>
<li>5.6&nbsp;&nbsp;<a href="#5.6"><b>Option 6:</b> Upload_Photo_interface element instance + Move_Photos_To_Storage function</a></li>
<li>5.7&nbsp;&nbsp;<a href="#5.7">Alternatives to WebSubmit: BibDocFile CLI or BibDocFile Web Interface</a></li>
</ul>
</li>
<li><strong>6. <a href="#6">Access restrictions</a></strong>
<ul style="list-style-type:None">
<li>6.1&nbsp;&nbsp;<a href="#6.1">Admin-level</a></li>
<li>6.2&nbsp;&nbsp;<a href="#6.2">User-level</a></li>
</ul>
</li>
<li><strong>7. <a href="#linking">Linking to submissions</a></strong>
<ul style="list-style-type:None">
<li>7.1&nbsp;&nbsp;<a href="#linkingfromsubmissions">Adding a link from the submissions page</a></li>
<li>7.2&nbsp;&nbsp;<a href="#linkingwithurl">Linking to a submission with direct URL (in email, formats, etc.)</a></li>
</ul>
</li>
<li><strong>8. <a href="#terminology">Terminology</a></strong>
<ul style="list-style-type:None">
<li>8.1&nbsp;&nbsp;<a href="#terminologydocumenttype">8.1 The document type of a file (<code>doctype</code>)</a></li>
<li>8.2&nbsp;&nbsp;<a href="#terminologycurdir">8.2 The submission directory (<code>curdir</code>)</a></li>
</ul>
</li>
<li><strong>9. <a href="#load_dump_cli">Load/dump Submissions</a></strong>
</li>
</ul>
&nbsp;&nbsp;&nbsp;&nbsp;(Check out the <a href="#oldwebsubmitguide">old WebSubmit admin guide</a>)<br/>
<h2><a name="shortIntro">1. Overview</a></h2>
<h3><a name="philosophy">1.1 How WebSubmit Works</a></h3>
<p>WebSubmit provides the infrastructure to set up customized pages
for your users to submit new metadata and files to your repository. It
is highly flexible in order to accomodate to the various type of
documents that you might need to archive. As a consequence of this
flexibility, it requires a good level of understanding of the
concepts behind WebSubmit.</p>
<p>A simplied schema of a typical WebSubmit workflow is the following
one (figure 1): one or several pages are presented to the user to
enter some information, such as title of the document, authors,
etc. Each of these pages contain a form with one or several <a href="#3">WebSubmit
elements</a>, which can either display some information to the user, or
ask for input from the user. <a href="#3">WebSubmit elements</a> are described more in
detailed further below. After the user has finished filling the forms
on all pages, a series of <a href="#4">WebSubmit functions</a> are called. These functions will
typically (1) post-process the data, (2) create a MARCXML, (3) upload
the created MARCXML file, and (4) send confirmation email(s).</p>
<div class="center">
<img id="figure1" src="<CFG_SITE_URL>/img/admin/websubmit-admin-guide-workflow1.png" />
<label for="figure1">Figure 1</label>
</div>
<p>One thing worth to learn from this simple workflow is that (1)
functions are executed one after each other, (2) that each function
can have side effects, such as sending email, and that (3) the output
of these functions is displayed to the user. Typical submissions use
many side-effect functions, and only one function that give some
feedback to the user (in the form of a web page). Also most submissions
usually need only a single page.</p>
<p>Finally note that you can plug check on each field of a page, so that
the user cannot proceed further if some invalid text has been input.</p>
<div class="center">
<img id="figure2" src="<CFG_SITE_URL>/img/admin/websubmit-admin-guide-workflow2.png" />
<label for="figure2">Figure 2</label>
</div>
<p>Functions are also organized in steps (Figure 2). By default,
WebSubmit runs the "step 1 block" and then stops: to run the next
steps one must have a function at the end of step 1 that jump to
another block (for eg. CaseEDS function) or have a WebSubmit element
that set the input form "step" to the value of the block number (such
as "<code>Create_Modify_Interface</code>" function).</p>
<div class="center">
<img id="figure3" src="<CFG_SITE_URL>/img/admin/websubmit-admin-guide-workflow3.png" />
<label for="figure3">Figure 3</label>
</div>
<div class="helpnote">A set of WebSubmit functions comes installed by
default in Invenio, to provide all the necessary functionalities
to create your own workflow. The behaviour of these functions can be
customized through their parameters. Advanced users can also create
their own functions in Python (see further below in this guide). The
main difficulty for beginners is to pick the adequate function and
carefully choose their ordering. It is recommended to get inspiration
from the sample demo submission at first.<br/><br/>
It is particulary important at this point to understand that the
WebSubmit engine more or less limits to 1) displaying page to collect data,
and 2) run functions. It does not take care of building a record and
inserting it into a collection, but expects to have a set of functions
configured to do so.
</div>
<p>Such a multi-page submission could appear to users as shown in
figure 4. Note that this figure shows a special page <em>0</em>. This
"cover" page is mandatory for all submissions, and is automatically
generated by WebSubmit. It can be customized to 1) display a
description of the submission, 2) show the available "actions"
(described further below) and 3) let the users chose among the
available "categories" (described further below).</p>
<div class="center">
<div style="width:100%;overflow-x:auto" id="figure4">
<table align="center" style="text-align:center"><tr>
<td><a href="<CFG_SITE_URL>/img/admin/websubmit-admin-guide-screenshot1.png"><img src="<CFG_SITE_URL>/img/admin/websubmit-admin-guide-screenshot1-small.png"></a></td><td> &rarr;</td>
<td><a href="<CFG_SITE_URL>/img/admin/websubmit-admin-guide-screenshot2.png"><img src="<CFG_SITE_URL>/img/admin/websubmit-admin-guide-screenshot2-small.png"></a></td><td> &rarr;</td>
<td><a href="<CFG_SITE_URL>/img/admin/websubmit-admin-guide-screenshot3.png"><img src="<CFG_SITE_URL>/img/admin/websubmit-admin-guide-screenshot3-small.png"></a></td><td> &rarr;</td>
<td><a href="<CFG_SITE_URL>/img/admin/websubmit-admin-guide-screenshot4.png"><img src="<CFG_SITE_URL>/img/admin/websubmit-admin-guide-screenshot4-small.png"></a></td>
<tr style="font-weight:700;font-size:x-small">
<td>Page "0" </td><td>&nbsp;</td>
<td>Page 1 </td><td>&nbsp;</td>
<td>Page 2 </td><td>&nbsp;</td>
<td>Functions ouput</td>
</tr>
</tr></table>
</div>
<label for="figure4">Figure 4</label>
</div>
<p>Indeed, typical submissions do not contain only one, but several
independant workflows called "actions": one action might be dedicated
to the submission of a document, while another one will let the user
modify a previously submitted record. Different actions can therefore
display different sets of pages and call different post-processing
functions. The first page of a submission (page "0") will let users
chose among the offered actions. <br/>By convention we use 3-letters
names for the actions of a submission. For example:
<ul>
<li><b>SBI</b>: submit a new record</li>
<li><b>MBI</b>: modify the metadata of a record</li>
<li><b>SRV</b>: submit a revised file</li>
</ul>
</p>
<div class="center">
<img id="figure5" src="<CFG_SITE_URL>/img/admin/websubmit-admin-guide-workflow4b.png" />
<label for="figure5">Figure 5</label>
</div>
<p>
Actions are displayed as several buttons (blue by default) for users
to choose from to start a new submission (Figure 6):
</p>
<div class="center">
<img id="figure6" src="<CFG_SITE_URL>/img/admin/websubmit-admin-guide-page0.jpg" />
<label for="figure6">Figure 6</label>
</div>
<p>Figure 6 also shows the possibility to select among various
categories prior to jumping into one of the available actions. These
categories usually don't have a direct impact on the chosen
workflow. Think of them simply as a simple WebSubmit element place on
the first page, that is common to all the actions of your submission
(indeed you could set up your submissions to have such categories
inside your submission actions pages, but that would require
additional work).</p>
<p>Last, but not least, a submission is usually referred to by a short
name (at most 5 letters), reused in many places in the WebSubmit admin
interface.</p>
To summarize:
<ul>
<li>A <b>submission</b> is made of different actions</li>
<li>An <b>action</b> is a workflow made of pages, checks and a flow of functions.</li>
<li>A <b>page</b> contains several WebSubmit elements, usually input elements with some label.</li>
<li>A <b>WebSubmit element</b> is a control on the interface to input or display values.</li>
<li>Javacript <b>checks</b> can be attached to WebSubmit elements, in order to validate the input data before going to a futher step of the submission.</li>
<li>A <b>function</b> performs some post-processing operations, usually
on data collected thanks to WebSubmit elements. Functions can have side-effects and outputs</li>
<li>Functions are organized in <b>steps</b>, blocks of functions</li>
</ul>
<p style="font-style: italic;">Another concept remains to be explained, but this functionality tends to disappear from submissions, and might be deprecated at some point. We provide the explanation about it below only for completeness, but it is strongly discouraged to go that way:<br/>
<blockquote>
It is possible to group actions in <b>sets</b>: an action set is a succession of actions which should be done in a given order when a user starts.<br/>
For example the submission of a document can be composed of two actions: Submission of Bibliographic Information (SBI) and Fulltext Transfer (FTT) which should be done one after the other.<br/>
When the user starts the submission, we want the submission to get him first in SBI and when he finishes SBI to carry him to FTT. SBI and FTT are in this case in the same action set. They will both have a level of 1 ("level" is a bad name, it should be "action set number"), SBI will have a score of 1, and FTT a score of 2 (which means it will be started after SBI). If you set the stpage of FTT to 2, the user will be directly carried to the 2nd page of the FTT web form. This value is usually set to 1.<br/>
The endtxt field contains the text which will be displayed to the user at the end of the first action (here it could be "you now have to transfer your files")<br/>
A single action like "Modify Bibliographic Information" should have the 3 columns to 0,0 and 1.
</blockquote>
</p>
<h3><a name="behindthescenes">1.2 Behind the scenes</a></h3>
<p>This section highlights a few key behaviours of WebSubmit which are
particularly important to understand when designing a submission.</p>
<p>When a user starts a new submission, a working directory is created
on disk in order to store all the collected values. This working
directory is usually called the "<code>curdir</code>". It is located
in a subdirectory
of <code>/opt/invenio/var/data/submit/storage/</code><small><em>{action
directory}</em></small><code>/</code><small><em>{submission
code}</em></small><code>/</code><small><em>{submission access
number}</em></small> where <small><em>{submission code}</em></small>
is the short name of a submission and <small><em>{submission access
number}</em></small> is a unique submission session identifier
(displayed on the web submission interface as the <em>submission
number</em>).<small><em>{action directory}</em></small>
is <code>running</code> for SBI actions, <code>modify</code> for "MBI"
actions, <code>revise</code> for "SRV" actions, etc. (This is
configured in the "Actions" part of the WebSubmit admin
interface)<br/> Whenever the user moves from one page to the other, or
submit the form, the curdir is populated with files named after the
submission elements displayed on the page, with their content being
the user inserted values (User uploaded files can be found by default
in the <code>curdir/files/</code> directory). It is these files that
WebSubmit functions such "<code>Create_Record</code>" or
"<code>Modify_Record</code>" will use in order to create the MARCXML
to upload (Note that the output of these functions will be a file
named "<code>recmysql</code>" in the <code>curdir</code>, that will
contain the MARCXML to upload)
</p>
<p>
The curdir contains a few other additional files:
<ul>
<li><code>function_log</code>: the list of functions called by the WebSubmit engines</li>
<li><code>SuE</code>: the email of the submitter</li>
<li><code>doctype</code>: the short name (code name) of the current submission</li>
<li><code>act</code>: the current action (SBI, MBI, etc.)</li>
<li><code>step</code>: the step of the functions</li>
<li><code>curpage</code>: the current page of the submission</li>
<li><code>ln</code>: the language chosen by the user to display the web interface</li>
<li><code>combo</code><small><em>{doctype}</em></small>: for
eg. <code>comboDEMOART</code> contains the chosen category on page
"0".</li>
<li>etc.</li>
</ul>
</p>
<p>The path to the <code>curdir</code> can sometimes be slightly
different, depending on the chosen action. For eg. the SRV action will
use <code>/opt/invenio/var/data/submit/storage/revise/</code><small><em>{submission
code}</em></small><code>/</code><small><em>{submission access
number}</em></small> where <small><em>{submission
code}</em></small></p>
<p>When the functions will run they will most probably create
additional files, such as "<code>SN</code>" created by the
"<code>Create_Recid</code>" function which reserves a record id,
"<code>RN</code>" created by function
"<code>Report_Number_Generation</code>" to reserve a report number, or
the "<code>recmysql</code>" file already mentionned above. Many of
these output file then become input parameters for the next functions
to be executed. This shows the importance of running a well defined
set of functions in a well defined order.</p>
<p>The <code>curdir</code> is not removed after the end of the
submission. This gives you the opportunity to keep track of past
submissions in case something would have gone unexpected. However the
use of the "<code>Move_to_Done</code>" function will create a zipped
archive of this directory (+ rename it using the report number of the
record, found in file <code>curdir/RN</code>), and will move it to a
different
directory, <code>/opt/invenio/var/data/submit/storage/done/running/</code>.
</p>
<a name="2"></a><h2>2. Configure Submissions: a Tutorial</h2>
<p>This chapter is a quick walkthrough for creating your submission.
It is not trying to explain everything, but simply goes through the main
steps necessary to configure a submission.</p>
<a name="2.1"></a><h3>2.1 Creating the submission</h3>
<p><b><a name="2.1.1"></a>1.</a></b> Go to
the <a href="<CFG_SITE_URL>/admin/websubmit/websubmitadmin.py">WebSubmit
admin interface</a> and click on the "Add New Doctype" button at the
bottom of the screen. Give your submission an ID
(eg. <code>DEMOTEST</code>. This cannot be changed later and should be
kept short. It is used in URLs to link to your submission), a name and
a description. The name and the description will be displayed on the
users end. The description can contain HTML markup. You can also
choose to clone from an already existing submission so that existing
configuration for pages, functions, elements, etc. are copied over to
your new submission (this might be not wanted if the submission you
copy from include submission specific elements).</p>
<p><b><a name="2.1.2"></a>2.</b> From the submission page, select from the "Add a new
Submission" menu the action to add to your newly created
submission. For eg. select "[SBI] Submit New Record" to create an
action that will allow users to submit new documents. Press the "Add
Submission" button to add the chosen action. You are given the
possibility to clone the configuration from another existing
submission. Start with a blank one or choose an existing one, then
press "Continue".</p>
<p><b><a name="2.1.3"></a>3.</b> On the following page, fill in the form:
<ul>
<li>Choose if the action is to be displayed on the start page of your
submission.<li>
</li>Specify the "<code>button order</code>" on the interface for this
action (to define an order between your actions buttons on splash page
(page 0) of your submission).</li>
<li> Enter the "<code>Status Text</code>": not really used in user
interface (<em>to be checked</em>): label for your action in the
WebSubmit admin interface.</li>
<li>Other fields are related to action sets (<em>chained
actions</em>). It is recommended to leave the default values.
<ul>
<li>Input the "<code>End text</code>": text displayed at the end of
the previous action to link to this one, provided that this action is
chained to another (leaving empty is recommended).</li>
<li> Choose the "<code>Stpage</code>": the page number that should be
used as starting point when reaching this action from another chained
action: leaving '0' is recommended).</li>
<li> The "<code>level</code>": the group of actions to which this one
belongs, in case it is chained with another action(s) (leaving emtpy
is recommended).</li>
<li> The "<code>score</code>": the order in which grouped actions are
chained (leaving empty is recommended).
</li>
</ul>
</li>
</ul>
Once done, press the "Save Details" button.
</p>
<p><b><a name="2.1.4"></a>4.</b> (Optional) Repeat steps 2 and 3 for any other workflow
you want to support in your submission. If the action you want to add
is not part of the list, click on
the <a href="<CFG_SITE_URL>/admin/websubmit/websubmitadmin.py/actionlist">available
actions</a> menu, press the "Add Action" button and enter the
"<code>action code</code>" (for eg. <code>SBI</code>),
"<code>description</code>" (displayed as the page title when going
through the submission pages), "<code>dir</code>" (in which
subdirectory of the default base submission folder the running/done
submissions for this action will be saved, for
eg. <code>submit</code>), and "<code>status text</code>" (displayed as
the label for the action button on the main submission
interface). Press Save Details, and you are ready to use this action.
</p>
<p><b><a name="2.1.5"></a>5.</b> (Optional) To propose a list of categories on the splash
page (page 0) of your submission, select your submission from the
main <a href="<CFG_SITE_URL>/admin/websubmit/websubmitadmin.py">WebSubmit
admin interface</a>, scroll down to the "Categories" section on the
page, enter a new category, with "<code>ID</code>" being the key code
of the new category you want to add (this value will be saved in the
corresponding file in <code>curdir</code> directory of your
submission. Reminder: the file in <code>curdir</code> containing this
value will be named <code>comboDEMOTEST</code>, provided that
"<code>DEMOTEST</code>" is your submission ID) and
"<code>description</code>" being the value displayed to the user for
this category. Press "<code>Add Category</code>" to add the category.
</p>
<p><b><a name="2.1.6"></a>6.</b> (Optional) To enter the list of
persons that will be recognized as referees of a submission (for
eg. by the "<code>Is_Referee</code>" function), select your
submission from the
main <a href="<CFG_SITE_URL>/admin/websubmit/websubmitadmin.py">WebSubmit
admin interface</a>, scroll down to the "Manage Referees" section on
the page, and click on the "Manage Referees" button.<br/> Select the
user(s) from the list (users must have an account on the system),
choose which category they manage, and click "Add". Once done, click
"Finished".
</p>
<p><b><a name="2.1.7"></a>7.</b> The skeleton of your submission is now basically
ready. You will need to add new pages to it, as well as insert
post-processing functions. These steps are defined in the next
sections. What you can do now is to make the submission visible on the
main <a href="<CFG_SITE_URL>/submit">submissions users page</a>. To do
so, click on
the <a href="<CFG_SITE_URL>/admin/websubmit/websubmitadmin.py/organisesubmissionpage">Organise
Main Page</a> of the main menu, select your submission in the
"Document Type Name" menu, choose from the next menu to which branch
of the submission tree you want to attach this submission, and press "Add".
Reorganize the tree as wanted from this interface.</b>
<a name="2.2"></a><h3>2.2 Building the interface</h3>
<p><b><a name="2.2.1"></a>1.</b> Go to the
main <a href="<CFG_SITE_URL>/admin/websubmit/websubmitadmin.py">WebSubmit
admin interface</a> and select your submission. Choose the action
(SBI, MBI, etc.) for which you want to build the interface and click
on the corresponding "view interface" link.
</p>
<p><b><a name="2.2.2"></a>2.</b>If you want to add a new page, click
on the "Add a Page" button. Follow the "view page" link displayed next
to the newly created page, or the one next to the page you want to
modify.
</p>
<p><b><a name="2.2.3"></a>3.</b> To add a new field on the page, press
the "Add a Field" button (at the bottom of the screen). On the following page:
<ul>
<li>Select a field from the existing list of WebSubmit elements.</li>
<li>Enter a field label. It will be displayed just before the field
on your page. The label can contain HTML. Note that this label will
not be used in modification actions (MBI) built using the
"<code>Create_Modify_Interface</code>" function. Instead, the
"Modification Text" attribute of the element will be used.</li>
<li>Set if the field should be mandatory or not. Note that some
elements (<a href="#3.2.1">User Defined Input Elements</a>,
<a href="#3.2.5">Hidden Input Elements</a>
and <a href="#3.2.5">Response Elements</a>) should never be set
"mandatory".</li>
<li>Give a short description to the label. It will be used for
eg. to notify the user that mandatory field named <em>XXX</em> has not been filled in.</li>
<li>Select a Javascript check from the list if you want to validate
the content of the field according to some criteria.</li>
</ul>
Once done, hit the "Add Field" button.<br/> Note that this step is
simply instantiating a WebSubmit element to include on your page. If
you want to include a field that does not exist in the available
elements, you should first create it. Learn more about the creation of
WebSubmit elements in the <a href="#3"><em>WebSubmit Elements</em></a>
chapter of this guide.
</p>
<p><b><a name="2.2.4"></a>4.</b>Repeat step 3 as many times as
needed. You can reorder the fields on the page, remove them or
change their attribute. The "edit" link next to each field will let
you change its attributes. The "element" link will however let you
change the attribute of the WebSubmit element itself, i.e. affecting
all the submissions having such a field on their page.</p>
<p><b><a name="2.2.5"></a>5.</b> You can preview the page by pressing
the "View Page Preview" button at the top of the page. Note that
<a href="#3.2.5">Response Elements</a> will however not be previewed.
</p>
<p><b><a name="2.2.6"></a>6.</b> From the "page" interface you can go
back successively to the action interface and the main submission
interface by clicking on the "Finished" buttons at the bottom of the
pages.
</p>
<a name="2.3"></a><h3>2.3 Adding the functions</h3>
<p><b><a name="2.3.1"></a>1.</b> Go to the
main <a href="<CFG_SITE_URL>/admin/websubmit/websubmitadmin.py">WebSubmit
admin interface</a> and select your submission. Choose the action
(SBI, MBI, etc.) for which you want to build the interface and click
on the corresponding "view functions" link.
</p>
<p><b><a name="2.3.2"></a>2.</b> To insert a function into the
workflow, press the "Add a Function" button at the bottom of the
screen. On the following page:
<ul>
<li>Select a function from the existing list of WebSubmit functions.</li>
<li>Enter the "<code>Step</code>" to which this function should be
added (for eg. "1").</li>
<li>Enter the "<code>Score</code>" of the function, i.e. its order
in the list of functions of the chosen step (for eg. 20). If a
function already exists for the chosen score, functions will simply
be shifted.</li>
</ul>
Once done, hit the "Save Details" button.<br/> Note that this step is
simply inserting an already existing WebSubmit function in your workflow. If
you want to include a totally new function you should first create it.
Learn more about the creation of
WebSubmit functions in the <a href="#4"><em>WebSubmit Functions</em></a>
chapter of this guide.
</p>
<p><b><a name="2.3.3"></a>3.</b> Once the function is inserted you can
change its parameters by clicking on the "View parameters" link. Each
function has a different set of parameters. Check the function
documentation (available from
the <a href="<CFG_SITE_URL>/admin/websubmit/websubmitadmin.py/functionlist">Available
Functions</a> menu of the WebSubmit admin interface) to learn more
about the offered options.
</p>
<p><b><a name="2.3.4"></a>4.</b> Repeat steps 2 and 3 as many times as
needed. You can reorder the functions on the page or remove them.
</p>
<a name="2.4"></a><h3>2.4 Restricting the submission</h3>
<p>Access to the submission interface is mostly restricted via the
WebAccess module. You can check out the <a href="#6">Access Restrictions</a>
chapter of this guide and refer to
the <a href="<CFG_SITE_URL>/help/admin/webaccess-admin-guide">WebAccess
admin</a> guide for detailed information.</p>
<p>In addition to WebAccess you can use the following functions
to restrict your submission:</p>
<p>If you have set up an action that requires to modify an existing
record (to add file, modify metadata, etc.) you can add the
"<code><a href="<CFG_SITE_URL>/admin/websubmit/websubmitadmin.py/functionedit?funcname=Is_Original_Submitter">Is_Original_Submitter</a></code>"
function in order to only let the original submitter of the record
modify the record. This function must be added at the beginning of
your list of functions (usually after the
"<code><a href="<CFG_SITE_URL>/admin/websubmit/websubmitadmin.py/functionedit?funcname=Get_Recid">Get_Recid</a></code>"
function), for <b>each action</b>, and <b>each step</b>. Check out
the <a href="#2.3"><em>Adding the functions</em></a> section of this
guide to learn how to add this function to your workflow.</p>
<p>You can also use the
"<code><a href="<CFG_SITE_URL>/admin/websubmit/websubmitadmin.py/functionedit?funcname=User_is_Record_Owner_or_Curator">User_is_Record_Owner_or_Curator</a></code>"
function to enable access to the original submitter of the record AND
users connected to a specific WebAccess role.</p>
<p>If you have set up an action (for eg. "APP") that requires to
approve a document by a referee (defined in the list of referees for
your submission) you can add the
"<code><a href="<CFG_SITE_URL>/admin/websubmit/websubmitadmin.py/functionedit?funcname=Is_Referee">Is_Referee</a></code>"
function in order to only let the referee go through. This function
must be added at the beginning of your list of functions (usually
after the
"<code><a href="<CFG_SITE_URL>/admin/websubmit/websubmitadmin.py/functionedit?funcname=Get_Recid">Get_Recid</a></code>"
function), for <b>each action</b>, and <b>each step</b>. Check out
the <a href="#2.3"><em>Adding the functions</em></a> section of this
guide to learn how to add this function to your workflow.</p>
<a name="3"></a><h2>3. WebSubmit Elements</h2>
<p>WebSubmit elements are the building blocks of submission
pages. This section focuses on how to use or create them. Refer to
the overview of this guide to learn more about the concept of
WebSubmit elements.</p>
<a name="3.1"></a><h3>3.1 Existing elements</h3>
<p>The list of existing elements can be found in
the <a href="<CFG_SITE_URL>/admin/websubmit/websubmitadmin.py/elementlist">"available
elements" section</a> of the WebSubmit admin interface. By default
these elements are instances used in the demo submissions. You can
reuse them, but it is recommended to create new elements to use in
your own submissions, excepted for complex "response" elements that are
generic enough.</p>
<p>Once instantiated for a submission, elements become <em>fields</em>
on the submission page. It is important to make a difference between
the fields attributes, which are submission specific, and the element
attributes, which apply to all submission using them.</p>
<a name="3.2"></a><h3>3.2 Creating a new element</h3>
<p>This section describes the creation of a customized element. It does
not show how to add an already existing element to your
submission. Refer to the <a href="#2">Tutorial</a> to learn how to add
an existing element to your submission.</p>
<p>To create a new element, go to the
the <a href="<CFG_SITE_URL>/admin/websubmit/websubmitadmin.py/elementlist">"available
elements" section</a> of the WebSubmit admin interface, scroll down to
the bottom of the page and press the "Add New Element" button.</p>
<p>Fill in the form:
<ul>
<li><b>Element Name</b>: The name of the element (Eg: <code>DEMO_TITLE</code>)</li>
<li><b>Modification Text</b>: The prefix to be used when the element
is used by the "<code>Create_Modify_Interface</code>" function
(i.e. in MBI actions)</li>
<li><b>Element Type</b>: The type of element:
<ul>
<li><em>User Defined Input</em>: the element is a static area
displaying the content of the field "Element Description". The
content must be HTML-escaped (or can be HTML).</li>
<li><em>File Input</em>: the element is a basic control to upload files</li>
<li><em>Hidden Input</em>: the element is an hidden form input
field, and its value is the one defined in the "Value"
field (below).</li>
<li><em>Text Input</em>: the element is a simple text field. Initial
value is the one defined in the "Value" field.</li>
<li><em>Response</em>: the element executes the Python code from the
"Element Description" field. The code is executed at runtime when
displaying the page. The element output consists in the value
assigned to the variable "<code>text</code>" in the scope of this
field at the end of the execution of the element.</li>
<li><em>Select Box</em>: a list control. The full HTML code of the
list must be given in the "Element Description" field. For eg:
<pre>
&lt;select name="DEMO_LANG"&gt;
&lt;option value="eng"&gt;English&lt;/option&gt;
&lt;option value="fre"&gt;French&lt;/option&gt;
&lt;option value="ger"&gt;German&lt;/option&gt;
&lt;/select&gt;
</pre>
The submitted value will be the one defined in the
"<code>value</code>" parameter.
</li>
<li><em>Text Area Element</em>: An HTML text area field.</li>
</ul></li>
<li><b>Marc Code</b>: the MARC code from which the value could be
retrieved when the element is used by the
"<code>Create_Modify_Interface</code>" function (i.e. in MBI
actions)</li>
<li><b>Size</b>: The size of the text input field (for "Text Input" Element Types)</li>
<li><b>No. Rows</b>: The number of rows for "Text Area" Element Types</li>
<li><b>No. Columns</b>: The number of columns for "Text Area" Element Types</li>
<li><b>Maximum Length</b>: The maximum length (in characters) for
"Text Input" Element Types. Note that it only sets a limits in the
user's browser, but is not check server-side.</li>
<li><b>Value</b>: The initial value for "Text Input" or "Hidden Input" elements</li>
<li><b>Element Description</b>: The content/code for "User Defined Input", "Select Box" and "Response" elements</li>
</ul>
</p>
<p>Once done, hit the "Save Details" button. You are done with the
creation of your element. You can then add it to your submission
page.</p>
<p><b id="reservedelementnames">About element names</b>: some
names are "reserved", and should not be used as names for elements, as
they would overlap with filenames created internally by WebSubmit in
the submission directory (curdir). You can still use these element
names, but should be aware of the potential side effects of changing
such variables with user submitted values. An up-to-date list of
reserved filenames for your installation can be found by
running <code>python -c 'from invenio.legacy.websubmit.config import
CFG_RESERVED_SUBMISSION_FILENAMES;print
CFG_RESERVED_SUBMISSION_FILENAMES'</code>.</p>
<a name="3.2.1"></a><h4>3.2.1 User Defined Input Elements</h4>
<p>This element is simply displaying the the content defined in the
field "Element Description". The content must be HTML-escaped (or
can be HTML). This is element is not really suitable for user-input
values.
</p>
<a name="3.2.2"></a><h4>3.2.2 File Input Elements</h4>
<p>The element displays a basic control to upload files. The file
uploaded with this element can be found upon submission inside
<code>[..]/files/ELEMENT_NAME/</code>
(where <code>ELEMENT_NAME</code> is your element name, for
eg. <code>DEMOART_FILE</code>) within the submission directory.</p>
<p>You can then further process the uploaded file with relevant
WebSubmit functions (eg. stamp the file), and attach it to the record
(see <a href="#5">section 5. <em>File Management with WebSubmit</em></a>
of this guide).</p>
<a name="3.2.3"></a><h4>3.2.3 Hidden Input Elements</h4>
<p>Simply create an hidden input field, with the value defined in the
"Value" field of the element. The uploaded value can be found as any
other element in the submission directory upon submission of the
form.</p>
<p>The main usage of this field is to upload a statically defined
value in order to check if the form has already been submitted. Static
values to be part of the record would better be defined in the
BibConvert configuration file used to create the record.</p>
<a name="3.2.4"></a><h4>3.2.4 Text Input Elements</h4>
<p>A simple text input field, Nothing much to say about it excepted
that it is usually the most used of all elements.</p>
<a name="3.2.5"></a><h4>3.2.5 Response Elements</h4>
<p>Response elements are elements evaluated at runtime, which execute
the Python code they embed. These elements are useful when you need to
display complex controls that are not supported by default by
WebSubmit, or if you need to generate content dynamically. The
returned output (displayed on the submission form) of response
elements is the one defined at the end of the execution in the
"<code>text</code>" variable.<br/> For eg. to display a radio button
one would write:</p>
<pre class="code">
# Sample radio button element
text = ""
options = [1, 2, 3]
for option in options:
text += '&lt;input type="radio" name="group1" id="%(opt)i" value="%(opt)i"&gt;&lt;label for="%(opt)i"&gt;Option %(opt)i&lt;/label&gt;' % {'opt': option}
</pre>
which would display as: <br/>
<input type="radio" name="group1" id="g1" value="1"><label for="g1">Option 1</label>
<input type="radio" name="group1" id="g2" value="2"><label for="g2">Option 2</label>
<input type="radio" name="group1" id="g3" value="3"><label for="g3">Option 3</label>
<p>Upon submission of the form, a file named "<code>group1</code>"
would be created in that case with the chosen value in the submission
directory.</p>
<p>Response elements have "magically" access to some global variables,
provided that they have been set at the moment of executing the element:
<ul>
<li><b><code>sysno</code></b> the current record id</li>
<li><b><code>rn</code></b> the current report number</li>
<li><b><code>act</code></b> the current submission action (SBI, MBI, etc.)</li>
<li><b><code>curdir</code></b> the path of the current submission directory</li>
<li><b><code>uid</code></b> the user ID of the current submitter</li>
<li><b><code>uid_email</code></b> the email of the current submitter</li>
</ul>
</p>
<p>When defining a response element you should be aware of a few traps:
<ul>
<li>You must expect that the page can be reloaded. In that case
possible actions performed by your element should not be done
twice. You also have to take care of the displayed state of your
element. For eg. a list generated by a response element should not
reset to the default value when the page refreshes if the user has
already chosen a custom value. You take care of this by reading the
corresponding file in the submission directory.</li>
<li>When used in MBI (modify) actions with the
"<code>Create_Modify_Interface</code>" function (which takes care of
building the modification form by mirroring the page defined for the
initial submission, SBI), you should read the initial state from the
record (if defined in the record), or from the curdir if the page is
refreshed.</li>
<li>You should never specify a response element as "mandatory" when
including it on your page.</li>
</ul>
A possible skeleton for a response element could be: (FIXME: Check...)
</p>
<pre class="code">
import os
from invenio.legacy.websubmit.functions.ParamFile import ParamFromFile
from invenio.legacy.bibrecord import get_fieldvalues
this_element_name = "DEMOART_TEST" # This would be your element name
if act == "SBI" and not os.path.exists(os.path.join(curdir, this_element_name)):
# Set initial value in case user has not already chosen one.
# This is only needed if you want to set a non-empty default
# value, for eg. retrieved from a remote service, etc.
# Otherwise the 'else' statement would be enough.
default_value = "A default value" # or any default value
elif act == "MBI" and not os.path.exists(os.path.join(curdir, this_element_name)):
# We are displaying a modification interface for the first time:
# Read initial value from the record for eg.
default_value = get_fieldvalues(sysno, '245__a')
else:
# Get user chosen value in case page is reloaded.
# The ParamFromFile() returns empty string if value was not set,
# so this is also suitable for setting empty initial values.
default_value = ParamFromFile(os.path.join(curdir, this_element_name))
# Do something ...
text = '&lt;input type="text" name="%s" value="%s"/&gt;' % (this_element_name, default_value)
</pre>
<p>Since response element needs the submission context and can
possibly have side effects, they are never executed when previewing
your submission pages from the WebSubmit admin interface.</p>
<a name="3.2.6"></a><h4>3.2.6 Select Box Elements</h4>
<p>Select Box elements are used to display lists menus (either as
dropdown menu or multiple selection list). The element is not smart
enough to save you from specifying the HTML markup of the list, but
will at least set the right intial state when reloading the submission
page or when used in MBI actions.</p>
<p>You would for eg. define the following "description" for an element
displaying a list of languages:</p>
<pre>
&lt;select name="DEMOART_LANG"&gt;
&lt;option&gt;Select:&lt;/option&gt;
&lt;option value="eng"&gt;English&lt;/option&gt;
&lt;option value="fre"&gt;French&lt;/option&gt;
&lt;option value="ger"&gt;German&lt;/option&gt;
&lt;option value="dut"&gt;Dutch&lt;/option&gt;
&lt;/select&gt;
</pre>
<p>In the above example a file named "DEMOART_LANG" will be created
with the user chosen value (for eg. "ger") in the submission
directory.</p>
<p>Note that if you set the element as being "mandatory" on your page,
the initial "Select:" value must be the first option of your list (you
can otherwise let specify the element as optional, and remove this
item if wanted). </p>
<a name="3.3"></a><h3>3.3 Creating a new check</h3>
<p>When adding an existing element to your submission page you can
associate a Javacript check to the element. You can choose from the
existing one or define your own check from
the <a href="<CFG_SITE_URL>/admin/websubmit/websubmitadmin.py/jschecklist">Available
Checks</a> menu of the WebSubmit admin interface.</p>
<p>From the "Available Checks" page, select "Add check", give it a
name and a "description": the description corresponds to the
Javascript code to be executed to validate the form before submitting
it. In this description you should define a Javascript function named
after your check, that takes a string (the value to validate) as
input. The function must then return <code>0</code> if the check fails
(the form cannot be submitted) or <code>1</code> if the check passes.
In addition you may want to raise an alert notifying the user about
the error.
</p>
<p>For eg. to check if the given number of a field is smaller than 10,
we create a "check" named <code>Smaller_Ten</code>:</p>
<pre class="code">
def Smaller_Ten(txt) {
/* Check if input is strictly smaller than 10 */
if (parseInt(txt) < 10 && parseInt(txt).toString()==txt) {
// Note that parseInt('9a') returns 9, hence the '.toString()==txt' test.
return 1;
} else {
alert("The given number is not smaller than 10! Please fix it.");
return 0;
}
}
</pre>
<a name="4"></a><h2>4. WebSubmit Functions</h2>
<p>This section focuses on how to create new WebSubmit functions and
use existing ones. To learn more about the concept of WebSubmit
functions, read the <a href="#shortIntro">Overview</a> section of this
guide.</p>
<a name="4.1"></a><h3>4.1 Existing functions</h3>
<p>The list of existing functions can be found in
the <a href="<CFG_SITE_URL>/admin/websubmit/websubmitadmin.py/functionlist">"available
functions" section</a> of the WebSubmit admin interface. Click on "Edit
Details" links to read more about the functions.</p>
<p>You add existing functions in the functions list of each action
(SBI, MBI, etc.) of your submission in order to post-process
user-submitted values and build your customized workflow. Some
functions have some prerequisites on the order they are run, and the
functions that must precede them. For eg. many functions expect the
"<code>Get_Recid</code>" function to run before them. You can check
the workflows provided with the Atlantis Demo installation</p>
<a name="4.2"></a><h3>4.2 Creating a new function</h3>
<p>This section describes the creation of a customized function. It
does not show how to add an already existing function to your
submission. Refer to the <a href="#2">Tutorial</a> to learn how to add
an existing function to your submission.</p>
<p>A WebSubmit function corresponds to a Python file, which must be
named after the function name (eg "<code>My_Function</code>" =&gt;
"<code>My_Function.py</code>") and placed into
the <code>/opt/invenio/lib/python/invenio/websubmit_functions/</code>
directory. The file must also contain a Python function with the same
"<code>My_Function</code>" name. This function interface must be
the following one:
<pre>
def My_Function(parameters, curdir, form, user_info=None):
</pre>
where
<ul>
<li><code>parameters</code>: a dictionary containing the parameters
and values that can be configured in the submission web interface.</li>
<li><code>curdir</code>: the path to the current working directory.</li>
<li><code>form</code>: the form passed to the current web page for possible reference from inside the function. </li>
<li><code>user_info</code>: the user_info objet reprenting the current user</li>
</ul>
The values returned by the function are printed on the last
submission page.
</p>
<p>For the function to be available from the WebSubmit admin
interface, it must be specifically inserted from
the <a href="<CFG_SITE_URL>/admin/websubmit/websubmitadmin.py/functionlist">admin
interface</a>. Scroll down to the bottom of the list, and press "Add
New Function". Insert the function name, as well as all the wished
parameters for the function.</p>
<a name="5"></a><h2>5. File Management with WebSubmit</h2>
<p>This chapters introduces different strategies to enable file upload
in WebSubmit submissions. You should already have a good understanding
of how WebSubmit works before reading further. Some practice in
WebSubmit submission implementation is also highly recommended in
order to understand the techniques introduced below. To some extent,
you might want to come back to this chapter only once you have
already set up your submission, and are about to implement file
support, as the documentation below is sometimes describing detailed
implementation steps.</p>
<p>Several techniques exists to handle files, to accommodate to
various use cases. Just read further below to choose the most
appropriate technique based on your needs.</p>
<a name="5.1"></a><h3>5.1 File Input + FFT Technique</h3>
<p>The most "basic" way of letting your users submit files is to add a
<em>File Input</em> element to your submission page(s), one for each possible
file to upload, in the same way as you add other input fields.<br/>
This technique is useful if you need to handle a well known number of
files. </p>
<b>Limitations:</b>
<ul>
<li>incompatible with function "<code>Move_to_Done</code>", as the path in the FFT tag would be wrong.</li>
<li>revision of files requires well-defined filenames</li>
<li>cannot easily delete files</li>
<li>cannot easily support file attributes (description, restriction, name, etc.) modifications</li>
</ul>
<b>Procedure:</b>
<p><b>1)</b> You can reuse an already existing <em>File Input</em> element, or create
your own. If you want to reuse an existing one, jump straight to
point 3 below. Otherwise, head to the WebSubmit admin interface,
select "6. Available Elements" in the menu, scroll down the opening
page and hit "Add New Element" button.
<p><b>2)</b> Choose a name for your new element (For e.g. "<code>DEMO_FILE</code>"). Select
the "<em>File Input</em>" item of the "Element Type" menu. Once done, click on
the "Save Detais" button.
<p><b>3)</b> Go to the main WebSubmit admin interface and select the submission
you want to edit (for e.g. "DEMOART"), then action (for e.g. "SBI"),
then the page. Scroll to the bottom of the page, and click on the "Add
a Field" button.
<p><b>4)</b> From the "Field Name" menu, select the desired input file element
(for e.g. "<code>DEMO_FILE</code>", if you have created it in previous steps). Fill
in the other usual fields, and click "Add Field". Reorder the elements
on the page as needed.
<p>At this step your users will be able to upload a file to the server
during the submission process. Indeed if you have a look at the
corresponding submission directory in
<code>/opt/invenio/var/data/submit/storage/</code> you will see the uploaded
file in the <code>/files/DEMO_FILE/</code> directory, plus a standard <code>DEMO_FILE</code>
file containing the path to the uploaded file. However the file is not
attached to the uploaded record: you must add a corresponding entry in
the BibConvert template, in a similar fashion as you would with other
input fields.</p>
<p><b>5)</b> Open your BibConvert "target" template used by the "<code>Make_Record</code>" or
"<code>Make_Modify_Record</code>" in your preferred editor. If you know where to
find your BibConvert templates, jump to point 6. Otherwise continue
reading: the BibConvert templates are used by the "<code>Make_Record</code>" and
"<code>Make_Modify_Record</code>" to create a MARCXML according to some specific
rules. From your submission page, click on "view functions" of the
action you want to edit, then "view parameters" of the
<code>Make_Record</code>/<code>Make_Modify_Record</code> function. The "create/modifyTemplate"
and "sourceTemplate" are the names of the BibConvert templates you can
find in the <code>/opt/invenio/etc/bibconvert/config/</code> directory
(Depending on the authorization on disk, you might even be able to
edit the files from the web interface). Read more about BibConvert in
the <a href="<CFG_SITE_URL>/help/admin/bibconvert-admin-guide">BibConvert admin guide</a>.
<p><b>6)</b> Add an <em>FFT</em> tag to your target BibConvert template. FFT is a special
tag interpreted by BibUpload in order to handle files. You will find
an example below, but you can read more about the FFT syntax in the
<a href="<CFG_SITE_URL>/help/admin/bibupload-admin-guide#3.5">BibUpload admin guide</a></p>
<pre style="overflow-x:auto">
FFT::REPL(EOL,)---&lt;datafield tag="FFT" ind1=" " ind2=" "&gt;&lt;subfield code="a"&gt;&lt;:curdir::curdir:&gt;/files/DEMO_FILE/&lt;:DEMO_FILE::DEMO_FILE:&gt;&lt;/subfield&gt;&lt;subfield code="n"&gt;My File&lt;/subfield&gt;&lt;subfield code="t"&gt;Main&lt;/subfield&gt;&lt;/datafield&gt;
</pre>
<p>The sample line above will rename the uploaded record to "My File",
and then attach it to the record (once the created MARCXML will be
BibUploaded). Note that you could keep the original name, or name the
file after the report number, specify a <code>doctype</code> such as "Main", or
"additional", include a comment specified in another field,
etc. Simply modify the FFT tag according to your needs. Note however
that this technique will allow to revise the file only if you can
identify it later by a well defined name. The above line is also uploading
the file in the category, or <em>doctype</em> "Main"</p>
<p><b>7)</b> One last thing not to forget is to
add <code>DEMO_FILE</code> to the source BibConvert template, as you
would for any other WebSubmit element. Open the source BibConvert
template (which is also given as parameter to
the <code>Make_Record</code>/<code>Make_Modify_Record</code>
functions, and can be found in
the <code>/opt/invenio/etc/bibconvert/config/</code> directory),
and add for example:</p>
<pre>
DEMO_FILE---<:DEMO_FILE:>
</pre>
<p>Repeat this procedure to add additional input file fields. It is
perfectly ok to have several FFT field instances in the
templates.</p>
<p>Note that if one of the <code>file input</code> fields is left empty by the
user, no file is uploaded, no <code>DEMO_FILE</code> file is created
in the submission directory, but an erroneous FFT line is still
inserted in the created output. It is why you might want to make all
the <code>File Input</code> fields mandatory, or use the
BibConvert <code>MINLW(..)</code> function to ensure that the field is
created only if the output line is at least a given number of
characters (to be computed based on the default length of an empty
line). This shows that this technique reaches its limits quite quickly
in terms of flexibility.
</p>
<a name="5.1revise"></a><h4>Revising/deleting files</h4>
<p>To revise files you would create a BibConvert template with the
adequate FFT tag. We assume below that you set up the modification
interface by using the <code>Create_Modify_Interface</code>
function/technique, so that we can reuse the submission page set up
for the "SBI" action. The key point is that the <code>Input
File</code> element name is well known ("<code>DEMO_FILE</code>" in
our case).</p>
<p><b>1)</b> Open your BibConvert "target" template used by the
"<code>Make_Modify_Record</code>" function. Note that it should not be
the same one as used in the "SBI" action of your submission, as it
must create different outputs.</p>
<p><b>2)</b> Add an FFT tag to revise your file:</p>
<pre>
&lt;datafield tag="FFT" ind1=" " ind2=" "&gt;
&lt;subfield code="a"&gt;&lt;:curdir::curdir:&gt;/files/DEMO_FILE/&lt;:DEMO_FILE::DEMO_FILE:&gt;&lt;/subfield&gt;
&lt;subfield code="n"&gt;My File&lt;/subfield&gt;
&lt;subfield code="d"&gt;KEEP-OLD-VALUE&lt;/subfield&gt;
&lt;subfield code="z"&gt;KEEP-OLD-VALUE&lt;/subfield&gt;
&lt;subfield code="r"&gt;KEEP-OLD-VALUE&lt;/subfield&gt;
&lt;/datafield&gt;
</pre>
<p><b>3)</b> The above FFT will be <em>bibuploaded</em> in
<code>--correct</code> mode, hence revising the file named "My File"
with the new one. Note in this example the use of the special keyword
<code>KEEP-OLD-VALUE</code> to keep the previous comment, description or
restriction applied to the file, if any (so that comment is not lost
for e.g. if you don't ask a new one). </p>
<p>You will notice the following limitation: you must be able to map
the uploaded file to the target file to revise by its name. This means
that you should be able to initially control your filename(s), for e.g. by
having it fixed ("Main", "additional", "figure", etc) or guessable,
for e.g. using the report number
(<code>&lt;:DEMOART_RN::DEMOART_RN:&gt;-main,
&lt;:DEMOART_RN::DEMOART_RN:&gt;-additional</code>). </p>
<p>To circumvent this limitation (as well as the impossibility to
delete files), you might combine this technique with one of the
techniques described below (For eg: with
the <code>Move_Revised_Files_To_Storage</code> function detailed in
the <a href="#2.2revise">Revising/deleting files</a> section of
the <a href="#2.2">File Input element + Move_Files_To_Storage
function</a> technique) </p>
<a name="5.2"></a><h3>5.2 File Input element + Move_Files_To_Storage function</h3>
<p>This way of doing is similar to the <a href="#2.1">technique
described above</a>. The main difference is that it leaves the job of
actually uploading/revisings the file(s) to a WebSubmit functions,
instead of the FFT in the uploaded MARCXML.</p>
<b>Limitations:</b>
<ul>
<li>revision of files requires
well-defined <code>doctype</code>. The consequence is that you can
have only one file per doctype (1 "Main", 1 "Additionnal",
etc.)</li>
<li>cannot easily delete files</li>
<li>does not support setting some additional file attributes (description, name, etc.)</li>
<li>uploaded doctypes must inherit the names of their <code>File Input</code> elements. For eg. "DEMO_FILE", instead of "Main", "Additional", "Figure", etc.</li>
</ul>
<p><b>1-4)</b> Add a file input field to your submission page as
describe in <a href="#2.1">previous technique</a>.</p>
<p>As before, the file is uploaded to the server once the user ends
the submission, but it is not attached to the created record. The
solution is to rely on the "<code>Move_Files_To_Storage</code>" function:</p>
<p><b>5)</b> Add the "<code>Move_Files_To_Storage</code>" function to your submission
functions. It is suggested to insert it after the function
"Insert_Record".</p>
<p><b>6)</b> Configure the <code>Move_Files_To_Storage</code>
function. The key parameter is <code>paths_and_suffixes</code>, which
must contain your <code>File Input</code> element names, and possibly
map to some suffixes to be added to the corresponding uploaded
files.<br/> For example, add <code>{'DEMO_FILE':'',
'DEMO_FILE2':'_additional'}</code> to have the files uploaded with
DEMO_FILE and DEMO_FILE2 elements attached to the record (with the
DEMO_FILE2 filename suffixed with
"_additional"). The <code>paths_and_restriction</code> works similarly
to set the files restrictions.
</p>
<p>Each file is simply attached to the record, with its document type
(<code>doctype</code>) being the name of your input file element (for e.g. file
uploaded with the "<code>DEMO_FILE</code>" element is attached with document type
"<code>DEMO_FILE</code>"). The filenames are kept.</p>
<a name="5.2revise"></a><h4>Revising/deleting files</h4>
<p>The "<code>Move_Revised_Files_To_Storage</code>" must be added to your modification
workflow ("MBI"). It will use the file uploaded with your "<code>DEMO_FILE</code>"
input element to revise the file with <code>doctype</code> "<code>DEMO_FILE</code>", the file
from "<code>DEMO_FILE2</code>" input element to revise file with <code>doctype</code>
"<code>DEMO_FILE2</code>", etc.</p>
<p><b>1)</b> Go to your modification workflow (MBI), and add
<code>Move_Revised_Files_To_Storage</code> to your submission
functions (usually after the "<code>Insert_Modify_Record</code>").</p>
<p><b>2)</b> Set up the <code>elementNameToDoctype</code> parameter of
this function so it maps your <code>File Input</code> field name to
the doctype to revise. For eg: "<code>DEMO_FILE=Main</code>" so that
file uploaded using the <code>DEMO_FILE</code> input field will be
used to replace the file with <code>doctype</code> "Main". This makes
the assumption that you indeed previously uploaded (for eg. with an
FFT during an SBI step) a file with this doctype.<br/> You can define
several mappings, by using character <code>|</code> as separator. For
eg:
<code>DEMO_FILE=Main|DEMO_FILE2=Additional</code>.<br/> If you have
initially uploaded your files with
the <code>Move_Files_To_Storage</code> function, you will for
eg. configure the parameter with "<code>DEMO_FILE=DEMO_FILE</code>",
so that file uploaded with <code>DEMO_FILE</code> input field will
replace the files that have been previously uploaded with doctype
"DEMO_FILE".
</p>
<p>Note that function <code>Move_Revised_Files_To_Storage</code> can
be used in combination with other techniques, as long as the mapping
in <code>elementNameToDoctype</code> can be done unambiguously.</p>
<p>Check
the <a href="<CFG_SITE_URL>/admin/websubmit/websubmitadmin.py/functionedit?funcname=Move_Revised_Files_to_Storage"><code>Move_Revised_Files_To_Storage</code>
function documentation for more detailed information.</p>
<a name="5.3"></a><h3>5.3 Create_Upload_Files_Interface +
Move_Uploaded_Files_To_Storage functions</h3>
<p>This option offers a full-featured file manager, that can be
easily configured to support file upload, revision, deletion,
commenting, restrictions, etc. It can handle an "unlimited" number of
files.</p>
<p>The strategy consists in adding a WebSubmit function
("<code>Create_Upload_Files_Interface</code>") to your submission functions list,
in order to display a file submission interface. The interface will
therefore only show up after all the submission pages have been filled
in and submitted. Once displayed, the interface lets the user upload
new/revised files: the function refreshes the interface for each
upload (runs through the functions list again and stops on the
<code>Create_Upload_Files_Interface</code>). When the user applies the
modifications, the submission "step" is incremented and executes the
submissions function of step 2, skipping the display of the
interface. In this step 2 you can perform the usual tasks of your
submission. You also must add an additional function
(<code>Move_Uploaded_Files_To_Storage</code>) to run at step 2 in order to attach
the files that have been submitted at step 1.</p>
<p>These functions are incompatible with function
"Create_Modify_Interface". It is therefore suggested to create a
dedicated submission action (in addition to "SBI" and "MBI") to let
your users edit the files independently of the bibliographic data. An
example of such setup can be found in DEMOPIC submission.</p>
<b>Limitations:</b>
<ul>
<li>Use of a WebSubmit function to draw the interface, which prevents
the interface to be used inside a submission form (is displayed at a
later step). Not as integrated as a simple input file form
element.</li>
<li>Requires Javascript to be enabled user-side (is applicable to all
submissions anyway.</li>
</ul>
<p><b>1)</b> Go to your submission in WebSubmit admin, and add a new
submission action (for e.g. "[SRV] Submit New File"). If necessary,
create your own action in <a href="<CFG_SITE_URL>/admin/websubmit/websubmitadmin.py/actionlist">WebSubmit admin "Available WebSubmit Actions"</a>
page. You can clone from another existing action (in that case move to
point 4 below), or simply create an empty action.</p>
<p><b>2)</b> Go to the new SRV action interface ("View Interface"), add a
page, open it and add fields that will allow users to specify the record
to update. Typically you will add a "<code>DEMO_RN</code>" field to enter the
report number, and "<code>DEMO_CONTINUE</code>" button to submit the form.</p>
<p><b>3)</b> Go the the new SRV action functions ("View" functions) and add
the necessary functions: for e.g. at step 1, "<code>Get_Report_Number</code>",
"<code>Get_Recid</code>" and "<code>Create_Upload_Files_Interface</code>". At step 2,
"<code>Get_Recid</code>", "<code>Move_Uploaded_Files_to_Storage</code>" and "<code>Print_Success</code>".</p>
<p><b>4)</b> Configure the <code>Create_Upload_Files_Interface</code> parameters. There
are many options available. Briefly, the most important one is the
"<code>doctype</code>" parameter, which lets you specify the document types users
are allowed to submit. Use "<code>|</code>" to separate doctypes, and "<code>=</code>" to
separate <code>doctype</code> and <code>doctype</code> description. For e.g. input "<code>Main=Main
File|Additional=Additional Document</code>" to let users choose either Main
or Additional types (which will show as "Main File" and "Additional
Document" to users). Other parameters will let you define for which
<code>doctype</code> users can revise or delete files (for e.g. specify for
<code>canDeleteDoctypes</code> "Additional" so that only these
documents can be deleted once they have been uploaded). Use
"<code>*</code>" to specify "any declared doctype", and
"<code>|</code>" as separator (for all <code>can_*_doctypes</code>
parameters).</p>
<p>To read more about the parameters available for this function, check the <a href="<CFG_SITE_URL>/admin/websubmit/websubmitadmin.py/functionedit?funcname=Create_Upload_Files_Interface"><code>Create_Upload_Files_Interface</code> function documentation</a>.</p>
<p><b>5)</b> Configure the <code>Move_Uploaded_Files_To_Storage</code>. There are less options
than in <code>Create_Upload_Files_Interface</code> function. Specify for e.g. in
<code>createIconDoctypes</code> for which doctypes icons will be
created, or in "<code>forceFileRevision</code>" if revisions of file
attributes trigger a new file revision. For an up-to-date
documentation check
the <a href="<CFG_SITE_URL>/admin/websubmit/websubmitadmin.py/functionedit?funcname=Move_Uploaded_Files_to_Storage"><code>Move_Uploaded_Files_to_Storage</code>
function documentation</a>.</p>
<h4>Revising/deleting files</h4>
<p>File revisions and deletions comes for free with the
functions. Simply allow deletion or revision of files when
configuring <code>Create_Upload_Files_Interface</code>.</p>
<a name="5.4"></a><h3>5.4 Upload_File element instance + Move_Uploaded_Files_To_Storage function</h3>
<p>This is similar to <a href="#2.3">option 3</a>, except that instead of using a
WebSubmit function to build the interface, you use a regular WebSubmit
response element. The advantage is that you can plug the WebSubmit
element wherever you want on your submission page.</p>
<b>Limitations:</b>
<ul>
<li>Requires Javascript enabled users-side + support for JQuery library
(most "recent" browsers)</li>
</ul>
<p>To set up a file upload interface using this technique:</p>
<p><b>1)</b> Go to your submission page, and add an element: choose the
"<code>Upload_Files</code>" response element. <b>But wait!</b> Read further before:</p>
<p><b>2)</b> You most probably want to customize the upload interface (set
which types of files can be uploaded, how many, etc.). To do so, you
would have to edit the code of the <code>Upload_Files</code> response element and
change the parameters of the "<code>create_file_upload_interface(..)</code>"
function. However this would affect all submissions using this
element. The solution is to "clone" this element (by creating a new
element: "Available elements"-&gt; scroll down -&gt; "Add New
Element". Choose for e.g. name "<code>DEMO_UploadFiles</code>", Element Type-&gt;
"Response" and paste the code of the <code>Upload_Files</code> element in the
"Element Description" field). Once done, add the "<code>DEMO_UploadFiles</code>"
element to your page.</p>
<p><b>3)</b> Go to your submission functions. Add
the <code>Move_Uploaded_Files_to_Storage</code> function, and
configure it in the same way as it would be done with
the <a href="#2.3">option 3</a>, step 5.</p>
<h4>Revising/deleting files</h4>
<p>File revisions and deletions comes for free with the
this technique. Simply allow deletion or revision of files when
configuring <code>Upload_Files</code> element of the MBI or SRV steps.</p>
<a name="5.5"></a><h3>5.5 FCKeditor element instance + Move_FCKeditor_Files_To_Storage function</h3>
<p>This technique relies on the popular HTML rich text editor
"FCKeditor", which embeds an interface to upload files. As a
consequence it only makes sense to use this technique in the cases
where you want files to be uploaded as part of some HTML context.
Typical use cases are submissions for the WebJournal module, for which
you want to upload articles. The <code>DEMOJRN</code> submission is an
example of submission using this technique.</p>
<b>Limitations:</b>
<ul>
<li>Requires Javascript enabled users-side + support for the FCKeditor
(most "recent" browsers)</li>
<li>File revisions and deletions are not supported as such (must be
done through other options).</li>
</ul>
<p>Setting up a submission to use the FCKeditor is really similar to
the strategy described in <a href="#2.4">option 4</a>: the principle is
to instantiate a custom "Response Element" that will call a function taking
care of the interface, and then plug a WebSubmit function to take care
of attaching the files.</p>
<p><b>1)</b> Go to your submission page, and add an element: choose the
"<code>DEMOJRN_ABSE</code>" response element. <b>But wait!</b> Read further before:</p>
<p><b>2)</b> You will want and need to customize the behaviour of the
FCKeditor, but you don't want to alter the behaviour of other
submissions using this element. The solution is to "clone" this
element: create a new element: "Available elements"-&gt; scroll down
-&gt; "Add New Element". Choose for e.g. name
"<code>DEMO_FCKEDITOR</code>", Element Type-&gt; "Response" and paste
the code of the <code>DEMOJRN_ABSE</code> element in the "Element
Description" field). Customize the element according to your
needs. This will need some development skills and good overview of your
metadata and submission in order to have the editor correctly
initialized. Additional information can be found in
the <a href="<CFG_SITE_URL>/help/hacking/fckeditor">FCKeditor
Integration guide</a>.</p>
<p><b>3)</b> Once done, add the "<code>DEMO_FCKEDITOR</code>" element to your
page.</p>
<p><b>4)</b> Go to your submission functions. Add
the <code>Move_FCKeditor_Files_To_Storage</code> function, and
configure it so that the <code>input_fields</code> parameter list the
name(s) (separated by comma if several instances) given to the
FCKeditor instance(s) created in by the <code>DEMO_FCKEDITOR</code>
response element.</p>
<h4>Revising/deleting files</h4>
<p>The way this editor is currently used does not let you
delete/revise file right from the editor interface. To set up file
deletion/revision, combine this technique with <a href="#2.3">option
3</a> for example.</p>
<a name="5.6"></a><h3>5.6 Upload_Photo_interface element instance + Move_Photos_To_Storage function</h3>
<p>This interface is specifically dedicated to pictures: it enables
the selection of bunch of photos to upload, and let you preview and
comment them before submitting the record.</p>
<b>Limitations:</b>
<ul>
<li>Requires Javascript enabled users-side + support for the Flash plugin
(version >= 9.0.24)</li>
<li>Support for deletions, but not revisions</li>
</ul>
<p>Setting up a submission to use this interface is really similar to
the strategy described in <a href="#2.4">option 4</a>: the principle is
to instantiate a custom "Response Element" that will call a function taking
care of the interface, and then plug a WebSubmit function to take care
of attaching the files.</p>
<p><b>1)</b> Go to your submission page, and add an element: choose
the "<code>Upload_Photos</code>" response element. <b>But wait!</b>
Read further before:</p>
<p><b>2)</b>As in other strategies that use a response element to
layout the interface, you might want to customize the behaviour of the
photos uploader, but you don't want to alter the behaviour of other
submissions using this element. If so (though it is not needed in the
case of this interface), the solution is to "clone" this element:
create a new element: "Available elements"-&gt; scroll down -&gt; "Add
New Element". Choose for e.g. name "<code>DEMO_UPLOADPHOTO</code>",
Element Type-&gt; "Response" and paste the code of
the <code>Upload_Photos</code> element in the "Element Description"
field). Customize the element according to your needs. This will need
some development skills in order to have the interface correctly
customized.</a>.</p>
<p><b>3)</b> Once done, add the "<code>DEMO_UPLOADPHOTO</code>"
(or <code>Upload_Photos</code> if you kept the original file) element
to your page.</p>
<p><b>4)</b> Go to your submission functions. Add
the <code>Move_Photos_To_Storage</code> function, and
configure it according to your needs.</p>
<h4>Revising/deleting files</h4>
<p>The interface lets user add or remove files, but cannot
specifically revise a file. If needed, it can be combined with another
strategy such as <a href="#2.3">option 3</a>.</p>
<a name="5.7"></a><h3>5.7 Alternatives: BibDocFile CLI or BibDocFile Web Interface</h3>
<p>These last techniques are not meant to be used in WebSubmit
submissions, but are admin tools that can be used to manage files,
independently of any submission. They are described here for the sake
of completness.</p>
<p>The BibDocFile command line interface is describe in more details
in <a href="<CFG_SITE_URL>/help/admin/howto-fulltext">How to manage
your fulltext files through BibDocFile</a>.</p>
<p>The <a href="<CFG_SITE_URL>/submit/managedocfiles">BibDocFile admin
interface</a> gives access to some of the functionalities offered by
its command-line equivalent through a graphical web interface. Its
interface is similar to the one offered by
the <code>Upload_File</code> element or
the <code>Create_Upload_Files_Interface</code> function, but is not
tied to a specific submission (and therefore won't automatically
execute post-processing steps such a stamping).<br/> Access to the
BibDocFile admin interface is restricted via the
WebAccess <code>runbibdocfile</code> action.
</p>
<a name="6"></a><h2>6. Access restrictions</h2>
<p>This section focuses on restricting the access to the submission
themselves, not to produce content (records, files, etc.) which are
restricted. Refer to the adequate document to restrict the
collections or files.</p>
<a name="6.1"></a><h3>6.1 Admin-level</h3>
<p>Access to the WebSubmit admin interface is controlled via the
WebAccess <code>cfgwebsubmit</code> action.</p>
<a name="6.2"></a><h3>6.2 User-level</h3>
<p>Access to the submissions is controlled via the
WebAccess <code>submit</code> action. The action has the following
parameters:
<ul>
<li><b><code>doctype</code></b>: the submission code
(eg. <code>DEMOART</code>) for which you want to set
restrictions.</li>
<li><b><code>act</code></b>: the action (for eg. "SBI") for which you
want to set the restriction. Can be <b>*</b> to mean any action for
the given submission.</li>
<li><b><code>categ</code></b>: the category (for eg. "Article",
"Preprint") for which you wan to set the restriction. Can be <b>*</b>
to mean any category for the given submission.</li>
</ul>
</p>
<p>Connect for eg. a role to the <code>submit</code> action with parameters
<code>doctype=DEMOART, act=SBI, categ=*</code> to let people of this
role submit new documents in the <code>DEMOART</code> submission, in
any category.</p>
<p>
<b>If you do not add an authorization for a given submission doctype
and action (even an empty role), the submission is open to
anybody.</b> For eg. in the above example, provided that an MBI action
exists, even with a restricted SBI action anybody will be able to
modify existing documents with MBI unless the MBI action is also
connected to a role. To make it short: a submission it not restricted
until it is...
</p>
<p>Note that it is your responsibility as WebSubmit admin to <b>ensure
that your workflow is not modifying records outside the desired
scope</b>. Given that records are independant of the submission that
created them, there is no mechanism in the WebSubmit engine that
prevents the DEMOART submission to modify records created with the
DEMOBOOK submission. A check must be added at the level of WebSubmit
functions of your submission to make sure that chosen submission and
category well match the record to be modified (for eg. retrieved via
the <code>Get_Report_Number</code> function)</p>.
<p>All the above checks also do not <b>prevent any authorized user to
modify documents submitted by others</b>. To enable finer-grained
restrictions, use the WebSubmit function
"<code>Is_Original_Submitter</code>" or
"<code>User_is_Record_Owner_or_Curator</code>" in your MBI, SRV,
etc. submission workflow (for eg. just after the "Get_Recid"
function). Check also the <a href="#2.4">Restricting the
submission</a> how-to from this guide.</p>
<a name="linking"></a><h2>7. Linking to submissions</h2>
<a name="linkingfromsubmissions"></a><h3>7.1 Adding a link from the submissions page</h3>
<p>Please refer to the tutorial (<a href="#2.1.7">section 2.1.7</a>) to learn how to populate the list
of submissions on the main submission page (at <em><CFG_SITE_URL>/submit/</em>).</p>
<a name="linkingwithurl"></a><h3>7.2 Linking to a submission with direct URL (in email, formats, etc.)</h3>
<p>It might be necessary to construct URL that lead to the submission,
for eg. when sending emails, or when displaying some actions from the
Detailed record view (formats).</p>
<h4 id="linkingwithurlmainpage">7.2.1 URL to main submission page</h4>
<p>A url to the main page of a submission can be built with this pattern:</p>
<pre class="code"><CFG_SITE_URL>/submit?doctype=DEMOART</pre>
<p>where <code>DEMOART</code> would be your submission code.</p>
<h4 id="linkingwithurljump">7.2.2 URL to jump straight into the submission</h4>
<p>One can directly move into the submission by building such a URL:</p>
<pre class="code"><CFG_SITE_URL>/submit/direct?sub={action}(submission_code)</pre>
<p>For eg: <code><CFG_SITE_URL>/submit/direct?sub=MBIDEMOART</code>
<p>In that way one would skip the submission "splash" page (<i>Page "0"</i>) and jump straight to the submission page 1.
For an action that must deal with a specific record (eg. MBI, APP) one can already pre-fill for eg. the "report number" field:</p>
<pre class="code"><CFG_SITE_URL>/submit/direct?sub=MBIDEMOART&DEMOART_RN=TESLA-FEL-99-07</pre>
<p>Depending on the way your submission is built, you might <strong>have</strong> also to specify the category of the document to modify (the category is usually chosen on page "0" of the submission):</p>
<pre class="code"><CFG_SITE_URL>/submit/direct?sub=MBIDEMOART&DEMOART_RN=TESLA-FEL-99-07&comboDEMOART=Article</pre>
<p>(Note how the category field is constructed: <code>combo{submission_code}</code> )</p>
<p>You can add as many parameters as needed to ensure that the form is filled with adequate values before being presented to the user. The parameters names correspond to the fields names in WebSubmit. For eg:</p>
<pre class="code"><CFG_SITE_URL>/submit/direct?sub=MBIDEMOART&DEMOART_RN=TESLA-FEL-99-07&comboDEMOART=Article&DEMOART_CHANGE=DEMOART_TITLE</pre>
<p>The parameters that you have to specify will depend on the usage which is made of them on the submission side.</p>
<p>For fields that can take several values as input (for eg. selection lists, as in the <code>DEMOART_CHANGE</code> example above) and that translate into a file in the submission direction with one value per line, you would have to specify all the values in the same URL argument, separated by <code>"%0A"</code> (newline <code>"\n"</code> encoded for URL):</p>
<pre class="code"><CFG_SITE_URL>/submit/direct?sub=MBIDEMOART&DEMOART_RN=TESLA-FEL-99-07&comboDEMOART=Article&DEMOART_CHANGE=DEMOART_TITLE%0ADEMOART_ABS</pre>
<p>Depending on how your submission is build, you can also move to another page ("<code>curpage</code>" param) or another step of the workflow("<code>step</code>" param):</p>
<pre class="code"><CFG_SITE_URL>/submit/direct?sub=MBIDEMOART&DEMOART_RN=TESLA-FEL-99-07&comboDEMOART=Article&DEMOART_CHANGE=DEMOART_TITLE&step=1</pre>
<p>(In the above example a logged in user would skip the submission splash page AND the modificaton interface to select the document and fields to update, to jump directly to the <code>DEMOART_TITLE</code> modification field)</p>
<p>In such cases you have to make sure that you provide all the information requested by the submission at each of the steps/pages until the provided step/page. Depending on how your submission is built it might be simply not possible to do that. This would be especially true when advancing steps, as functions netween the steps would not be run &mdash; most probably advancing directly to step 1 will be a maximum one can easily support &mdash; while controlling "<code>curpage</code>" parameter might be easier.</p>
<a name="terminology"></a><h2>8. Terminology</h2>
<a name="terminologydocumenttype"></a><h3>8.1 The document type of a file (<code>doctype</code>)</h3>
<p>The document type is an attribute of a file. It can be seen as a
category which lets you organize your files: "Main" file,
"Additional", "Figures", "source", whatever you need. It is not so
much used excepted on <code><CFG_SITE_RECORD>/XXX/files/</code> pages to group
files by category. It can however come handy during file upload
processes, to assign different kinds of restrictions based on the
document type, or simply to make the configuration of the submission
easier, depending on which technique you use to manage files.</p>
<a name="terminologycurdir"></a><h3>8.2 The submission directory (<code>curdir</code>)</h3>
<p>The WebSubmit workflow mainly splits in two parts: data gathering
(user interface side, with WebSubmit pages and elements) and data
integration part as a second step (with WebSubmit functions involved,
plus BibConvert templates). In the middle stands the submission
directory (also called "<code>curdir</code>"). Each submission session corresponds
to a unique submission directory, which stores the values collected
from the submission pages, in the form of a series of textual files,
one for each input field. These files are named after the submission
WebSubmit elements, and their content is the value input by the
submitter. Note that uploaded files are stored in
a <code>/files/</code> subdirectory.</p>
<p>WebSubmit functions process the files in this directory. For example
"<code>Make_Record</code>" which creates the MARCXML (through BibConvert
templates), or the <code>Stamp_Uploaded_Files</code>, which will stamp
the uploaded files in the <code>/files/</code> directory. If you
happen to write a customized WebSubmit response element that writes
files to disk, or implement a WebSubmit function that must retrieve
submitted values, you will certainly use the submission directory.</p>
<p>These submission directories are also helpful to debug submissions,
and can act as a backup when something goes wrong during a submission.</p>
<p>An example of submission directory could be found at this
path <code>/opt/invenio/var/data/submit/storage/running/DEMOART/1245135338_62620</code>,
where DEMOART is your submission code,
and <code>1245135338_62620</code> is the submission session ID, as
found at the bottom of each WebSubmit web page during the submission
process. Just after the user has finished the submission, this
directory would contain all the collected values of the form. But the
life of the submission directory does not stop there. Immediately
after the user completed the submission, the WebSubmit functions are
executed: for e.g. (depending on how you have configured your
submission) creation of a report number (stored in the submission
directory too!) (Function <code>Report_Number_Generation</code>),
creation of the MARCXML (usually named "<code>recmysql</code>", in the
submission directory again!) (Function <code>Make_Record</code>),
upload of the MARCXML (Function <code>Insert_Record</code>)
and <code>Move_To_Done</code>. This last function moves the submission
directory to a new place. It could be for
e.g.: <code>/opt/invenio/var/data/submit/storage/done/DEMOART/DEMO-ARTICLE-2010-001.tar.gz</code>,
supposedly that the report number of the submitted record
is <code>ARTICLE-2010-001</code>. Some other functions will move the
submission directory to other places, and some functions will even let
you configure where to move it.</p>
<a name="load_dump_cli"></a><h2>9. Load/dump Submissions</h2>
<p>Use <code>websubmitadmin</code> to dump a given submission
configuration from the database to a file. For example:
<pre>
$ /opt/invenio/bin/websubmitadmin --dump=DEMOART > DEMOART_db_dump.sql
</pre>
</p>
<p>
The submission dumper tool relies on the fact that submission-specific
elements and functions are prefixed with the submission doctype (for
example <code>DEMOART</code>), and will only dump those. Functions,
elements, etc. without prefix are considered "shared", and not dumped by
default, in order to eliminate duplicates). See also
option <code>--method</code> to change that behaviour.
</p>
<p><code>websubmitadmin</code> can also help you "diff" between
different submission versions (for eg. between a dump file and the
database). This tool will optionally hide differences solely due to
ordering of statements in the dump, or different modification
dates. For example:
<pre>
$ /opt/invenio/bin/websubmitadmin --diff=DEMOART --ignore=d,o < DEMOART_db_dump.sql
</pre>
</p>
<p>Run <code>/opt/invenio/bin/websubmitadmin --help</code> for more
info and more examples.</p>
<p>Use <code>dbexec</code> to load a submission dumped
with <code>websubmitadmin</code>. For example:
<pre>
$ /opt/invenio/bin/dbexec < DEMOART_db_dump.sql
</pre>
</p>
<code>- End of new WebSubmit admin guide -</code>
<hr/>
<a name="oldwebsubmitguide"></a>
<div style="background-color:#bbb;border:3px dashed #444">
<p><table class="errorbox">
<thead>
<tr>
<th class="errorboxheader">
WARNING: OLD WEBSUBMIT ADMIN GUIDE FOLLOWS
</th>
</tr>
</thead>
<tbody>
<tr>
<td class="errorboxbody">
This WebSubmit Admin Guide was written for the previous PHP-based
version of the admin tool. The submission concepts and pipeline
description remain valid, but the interface snapshot examples
would now differ. The guide is to be updated soon.
</td>
</tr>
</tbody>
</table>
<h1>Table of Contents</h1>
<ul>
<li><b>Introduction</b>
<ul>
<li><a href="#introduction">General Overview of the Manager Tool</a>
<li><a href="#example">Using the manager through an example</a>
<li><a href="#philosophy">Philosophy behind the document submission system</a>
</ul>
<li><b>The Interface</b>
<ul>
<li><a href="#description">Description</a>
</ul>
<li><b><a href="#documents">Types of Document</a></b>
<ul>
<li><a href="#documentnew">Add a New Type of Document</a>
<li><a href="#documentremove">Remove a type of document</a>
<li><a href="#documentmodify">Modify an Existing Type of Document</a>
</ul>
<li><b><a href="#actions">Actions</a></b>
<ul>
<li><a href="#actionnew">Add a New Action</a>
<li><a href="#actionremove">Remove an Action</a>
<li><a href="#actionmodify">Modify an Existing Action</a>
<li><a href="#actionimplement">Implement an Action over a Document Type</a>
<ul>
<li><a href="#implementwebform">Create and Maintain the Web Form</a>
<li><a href="#implementfunctions">Create and Maintain the Data Treatment</a>
</ul>
</ul>
<li><b><a href="#functions">Functions</a></b>
<ul>
<li><a href="#functionnew">Create a New Function</a>
<li><a href="#functiondelete">Remove a Function</a>
<li><a href="#functionedit">Edit a Function</a>
<li><a href="#functiondescription">All Functions Explained</a>
</ul>
<li><b><a href="#protection">Protection</a></b>
<li><b><a href="#catalogues">Catalogues Organisation</a></b>
<li><b><a href="#bibconvert">BibConvert</a></b>
<li><b>Notes</b>
<ul>
</ul>
<li><b><a href="#faq">FAQ</a></b>
</ul>
<p>&nbsp;<p>
<p>&nbsp;<p>
<a name="introduction"></a>
<h1>General Overview of the Manager Tool</h1>
<h3>Things to know before using the Manager:</h3>
<blockquote>
<ul>
&nbsp;<span class="guideheader">T</span>his manager tool allows you to administrate all the WebSubmit
interface. With it, you will be able to create new actions, new types of documents and edit the existing ones.
<br/><br/>
&nbsp;<span class="guideheader">T</span>he main objects in webSubmit are the "action" (such as
"Submit New Record", "Submit New File", "Modify Record"...) and the "type of document" (such as "preprint",
"photo"...).<br/><br/>
&nbsp;<span class="guideheader">T</span>o one given type of document can be attached several actions.
An action is the addition of two processes:
<ul>
<li>The first one is the <a href="#implementwebform">data gathering</a>. The manager
will allow you to create new web forms corresponding to the fields the user will have to fill in when using
webSubmit.
<li>The second one is the <a href="#implementfunctions">data treatement</a>.
Basically, what the program will do with the data gathered during the first phase. The treatment appears
in this tool as a sequence of functions. This manager will allow you to add functions to an action, edit the
existing functions, and reorder the functions.
</ul>
</ul>
</blockquote>
<h3>See also:</h3>
<blockquote>
<li><a href="#example">using the manager through an example</a><br/>
<li><a href="#description">interface description</a><br/>
<li><a href="#actions">actions</a><br/>
<li><a href="#documents">document types</a><br/>
</blockquote>
<p>&nbsp;<p>
<p>&nbsp;<p>
<a name="example"></a>
<h1>Using the manager through an example</h1>
<h3>what is this?</h3>
<blockquote>
<ul>
This page presents you the typical situations a user could meet using WebSubmit, and for each situation how to use the manager to configure it.
</ul>
</blockquote>
<h3>The user reaches WebSubmit main page.</h3>
<IMG src="<CFG_SITE_URL>/img/admin/websubmit-admin-guide-main_menu.png" alt="Main Page" class="guideimg" align="left">
&nbsp;<span class="guideheader">T</span>o add a document type to WebSubmit, you should go to the <a target=top href="<CFG_SITE_URL>/admin/websubmit/index.php">main page</a>
and click on "New Doctype" in the left blue panel.<br/><br/>
&nbsp;<span class="guideheader">E</span>ven once created, a document type will not appear automatically on this page. To configure the list of catalogues and document
types displayed on this page, the administrator shall go to the <a target=top href="<CFG_SITE_URL>/admin/websubmit/editCatalogues.php">edit catalogues</a>
page. (see the <a href="#catalogues">guide section</a>)<br clear="all"/>
<h3>The user can then click on the document type he is interested in.</h3>
<IMG src="<CFG_SITE_URL>/img/admin/websubmit-admin-guide-menu_doc.png" alt="Document type Page" class="guideimg" align="left">
&nbsp;<span class="guideheader">T</span>he text appearing under the header containing the name of the document
can be configured by going to the <a target=top href="websubmit-admin">main page</a>, click on
the title of the document type then on the "Edit Document Types Details" button.<br/><br/>
&nbsp;<span class="guideheader">Y</span>ou can associate several categories to a document type which can be defined by going to the
<a target=top href="websubmit-admin">main page</a>, click on the title of the document type
then on the "View Categories" button. The selected category will be saved in a file named "comboXXX"
(where XXX is the short name of the document type) in the submission directory.<br/><br/>
&nbsp;<span class="guideheader">T</span>o add an action button to this page, first implement this action by going to the
<a target=top href="websubmit-admin">main page</a>, click on the title of the document type then
on the "Add a new submission" button. If the action is already implemented and the button still does not appear
on the submision page, then you should edit the details of this implementation: go to the
<a target=top href="websubmit-admin">main page</a>, click on the title of the document type then
on the icon in the "Edit Submission" column and in the line of the desired action. There you should set the
"Displayed" form field to "YES".<br/><br/>
&nbsp;<span class="guideheader">Y</span>ou can also change the order of the buttons, by going to the <a target=top href="websubmit-admin">
main page</a>, click on the title of the document type then on the icon in the "Edit Submission" column and in the
line of the desired action. There you can set the "buttonorder" form field.<br/><br clear="all"/>
<h3>The user now may choose a category, then click on the action button he wishes.<br/>The submission starts, the first page of the web form appears.</h3>
<IMG src="<CFG_SITE_URL>/img/admin/websubmit-admin-guide-form.png" alt="Document type Page" class="guideimg" align="left">
&nbsp;<span class="guideheader">T</span>his web form is composed of several pages, on each of these
pages form fields can be found. To modify the number of pages, add or withdraw form fields and modify
the texts before each form field, you shall go to the <a target=top href="websubmit-admin">main page</a>,
click on the title of the document type then on the icon in the "Edit Submission Pages" column and in the line of the
desired action. (see the <a href="#actionimplement">guide section</a>)<br/><br clear="all"/>
<h3>On the last page of the submission, there should be a button like in the following image which will
trigger the end script</h3>
<IMG src="<CFG_SITE_URL>/img/admin/websubmit-admin-guide-end_action.png" alt="Document type End Page" class="guideimg" align="left">
&nbsp;<span class="guideheader">T</span>his button is defined like any other form field. Its definition should include
a <i> onclick="finish();"</i> javascript attribute.<br/><br/>
&nbsp;<span class="guideheader">A</span>fter clicking this button, WebSubmit will apply the end script functions
to the gathered data. To modify the end script, you shall go to the <a target=top href="websubmit-admin">
main page</a>, click on the title of the document type then on the icon in the "Edit Functions" column and in the line
of the desired action. (see the <a href="#implementfunctions">guide section</a>)<br clear="all"/>
<h3>See also:</h3>
<blockquote>
<a href="#description">interface description</a><br/>
<a href="#actions">actions</a><br/>
<a href="#documents">document types</a><br/>
</blockquote>
<p>&nbsp;<p>
<p>&nbsp;<p>
<a name="philosophy"></a>
<h1>Philosophy behind the document submission system</h1>
<p>This page will explain some philosophical issues behind the document submission system.
<h3>On the relation between a search collection and a submission doctype:</h3>
<blockquote>
<ul>
&nbsp;<span class="guideheader">T</span>he relation
between a search collection and a submission document
type may be prone to certain confusion for Invenio
administrators. This comes from the fact that there is
no one-to-one direct mapping between them, as is usual
elsewhere. The relation is more flexible than that.<br/><br/>
&nbsp;<span class="guideheader">A</span> search
collection in Invenio is defined through a search
query. For example, "all records where field F
contains the value V belong to collection C". Several
assertions can be deduced from this definition:<br/>
&nbsp;1/ A single record can appear in several collections.<br/>
&nbsp;2/ There is no limitation to the number of
collections in which a record can appear.<br/>
&nbsp;3/ Any query can be used to build a
collection. The query can also be a complex one using
logical operators, hence can rely on the value of
several fields.<br/><br/>
&nbsp;(In addition, a search collection can be defined
via a set of its subcollections in the hierarchy tree.
Refer to the <a
href="websearch-guide">WebSearch
Admin Guide</a> for that matter.)<br/><br/>
&nbsp;<span class="guideheader">T</span>he submission
system basically creates an XML MARC record and stores
it in the database. To which collection this new
record belongs depends exclusively on the content of
the XML MARC record. This XML MARC record is created
by the <a href="#Make_Record">Make_Record</a> function. So the
secret of the matching of a submitted record to a
particular collection lies in the configuration of
this function. Some examples will clarify this
point:<br/><br/>
&nbsp;<span class="guideheader">E</span>xample 1:
Let's consider a "Preprints" collection which is
defined by this query: "980__a:PREPRINT". We want to
create a submission document type from which all
records will go to this "Preprints" collection. For
this, the Make_Record function should be configured so
that a 980__a field containing "PREPRINT" will always
be created.<br/>
&nbsp;<span class="guideheader">E</span>xample 2:
Let's still consider the same "Preprints" collection,
and an additional "Theses" collection based on a
slightly different query "980__a:THESIS". We want to
create a single submission type from which the records
will go in the "Preprints" or "Theses" collections
depending on a field chosen by the submitter. In this
case, the Make_Record function should be configured so
that a 980__a field will contain either "PREPRINT" or
"THESIS" depending on the value entered by
the submitter.<br/><br/>
&nbsp;<span class="guideheader">T</span>he apparent
disconnection between a submission document type and a
search collection allows a great flexibility, allowing
administrators to create 1 to 1, 1 to n, n to 1 or
even 1 to 0 (not very useful!) relations.
</ul>
</blockquote>
<p>&nbsp;<p>
<p>&nbsp;<p>
<a name="description"></a>
<h1>Interface Description</h1>
<h3>Welcome to webSubmit Management tool:</h3>
<blockquote>
<ul>
&nbsp;<span class="guideheader">o</span>n the websubmit admin <a href="websubmit-admin">main page</a> you will find:<br/><br/>
<IMG src="<CFG_SITE_URL>/img/admin/websubmit-admin-guide-main_page.png" class="guideimg"><br/><br/>
<ul>
<li>The list of all existing document type in the middle of the page. Click on one line in the list to have
access to the main document modification panel
<li>The right menu panel with the following links inside:
<ul>
<li>"<b>webSubmit Admin</b>": This links leads you back to the main page of the manager.
<li>"<b>New Doctype</b>": Click here if you wish to create a new document type.
<li>"<b>Remove Doctype</b>": Click here if you want to remove an existing document type.
<li>"<b>Available Actions</b>": Lists all existing actions
<li>"<b>Available Javascript Checks</b>": Lists all existing Javascript checking functions.
<li>"<b>Available Element Description</b>": Lists all existing html form element descriptions.
<li>"<b>Available Functions</b>": Lists all existing functions in CDS Submit.
<li>"<b>Organise Main Page</b>": Allows you to manage the appearance and order of the list of document
types on CDS Submit User main page.
</ul>
</ul>
</blockquote>
<h3>See also:</h3>
<blockquote>
<a href="#description">interface description</a><br/>
<a href="#actions">actions</a><br/>
<a href="#documents">document types</a><br/>
</blockquote>
<p>&nbsp;<p>
<p>&nbsp;<p>
<a name="documents"></a>
<h1>Document Types</h1>
<blockquote>
<ul>
&nbsp;<span class="guideheader">W</span>ebSubmit can propose several actions on different document
types. Each of these document type may or may not implement all possible actions. The main difference
between each document type is the metadata which define each of them, and may also be the kind of fulltext
files attached to one record. <br/><br/>
&nbsp;<span class="guideheader">A</span> document type can be one of "Thesis", "Photos", "Videotapes"...
or whatever type of document you may invent. A document type is always defined by its metadata. It may or
may not have a fulltext file attached to it.<br/><br/>
&nbsp;<span class="guideheader">T</span>his tool leaves you free to create the web forms adapted to whatever type of document you want to
create (see "<a href="#implementwebform">Create and Maintain the Web Form</a>") as well as free
to determine what treatment you wish to apply to the collected data (see
"<a href="#implementfunctions">Create and Maintain the Data Treatment</a>").
</ul>
</blockquote>
<h3>See also:</h3>
<blockquote>
<a href="#documentnew">add a new type of document</a><br/>
<a href="#documentremove">remove a type of document</a><br/>
<a href="#documentmodify">modify a type of document</a><br/>
<a href="#actionimplement">implement an action over a type of document</a><br/>
</blockquote>
<p>&nbsp;<p>
<p>&nbsp;<p>
<a name="documentnew"></a>
<h1>Ading new type of document</h1>
<h3>How to get there?</h3>
<blockquote>
&nbsp;<span class="guideheader">C</span>lick on the "New Doctype" link in the webSubmit right menu.
</blockquote>
<h3>How to do this?</h3>
<blockquote>
&nbsp;<span class="guideheader">A</span> new document type is defined by 6 fields:<br/>
<ul>
<li><b>Creation Date</b> and <b>Modification Dates</b> are generated and modified automatically.<br/>
<li><b>Document Type ID</b>: This is the acronym for your new document type. We usually use a 3 letters
acronym.
<li><b>Document Type Name</b>: This is the full name of your new document. This is the text which will
appear on the list of available documents and catalogues on webSubmit main page.
<li><b>Document Type Description</b>: This is the text which will appear on the document type submission
page. This can be pure text or html.
<li><b>Doctype to clone</b>: Here you can choose to create your document type as a clone of another
existing document type. If so, the new document type will implement all actions implemented by the chosen
one. The web forms will be the same, and the functions also, as well as the values of the parameters for
these functions. Of course once cloned, you will be able to modify the implemented actions.
</ul>
</blockquote>
<h3>See also:</h3>
<blockquote>
<li><a href="#documentremove">remove a type of document</a><br/>
<li><a href="#documentmodify">modify a type of document</a><br/>
<li><a href="#actionimplement">implement an action over a type of document</a><br/>
</blockquote>
<p>&nbsp;<p>
<p>&nbsp;<p>
<a name="documentremove"></a>
<h1>Removing a Document Type</h1>
<h3>How to get there?</h3>
<blockquote>
&nbsp;<span class="guideheader">C</span>lick on the "Remove Doctype" link in the
webSubmit admin right menu
</blockquote>
<h3>How to do this?</h3>
<blockquote>
&nbsp;<span class="guideheader">S</span>elect the document type to delete then click on the "Remove Doctype" button. Remember by doing this, you
will delete this document type as well as all the implementation of actions for this document type!
</blockquote>
<h3>See also:</h3>
<blockquote>
<li><a href="#documentnew">create a type of document</a><br/>
<li><a href="#documentmodify">modify a type of document</a><br/>
<li><a href="#actionimplement">implement an action over a type of document</a><br/>
</blockquote>
<p>&nbsp;<p>
<p>&nbsp;<p>
<a name="documentmodify"></a>
<h1>Modifying a Document Type</h1>
<h3>What is it?</h3>
<blockquote>
&nbsp;<span class="guideheader">M</span>odifying a document type in webSubmit - this will modify its
general data description, not the implementations of
the actions on this document type. For the later, please see <a href="#actionimplement">
implement an action over a type of document</a>.
</blockquote>
<h3>How to get there?</h3>
<blockquote>
&nbsp;<span class="guideheader">F</span>rom the main page of the manager, click on the title of the
document type you want to modify, then click on the "Edit Document Type Details".
</blockquote>
<h3>How to do this?</h3>
<blockquote>
&nbsp;<span class="guideheader">O</span>nce here, you can modify 2 fields:<br/>
<li><b>Document Type Name</b>: This is the full name of your new document. This is the text which will appear
on the list of available documents and catalogues on webSubmit main page.
<li><b>Document Type Description</b>: This is the text which will appear on the right of the screen when the user
moves the mouse over the document type title and on the document type submission page. This can be pure
text or html.
</blockquote>
<h3>See also:</h3>
<blockquote>
<li><a href="#documentremove">remove a type of document</a><br/>
<li><a href="#documentnew">create a type of document</a><br/>
<li><a href="#actionimplement">implement an action over a type of document</a><br/>
</blockquote>
<p>&nbsp;<p>
<p>&nbsp;<p>
<a name="actions"></a>
<h1>Actions</h1>
<blockquote>
&nbsp;<span class="guideheader">I</span>n webSubmit you can create several actions (for example
"Submit New Record", "Submit a New File", "Send to a Distribution List", etc. in fact any action you can imagine
to perform on a document stored in your database). The creation of an action is very simple and consists in
filling in a name, description and associating a directory to this action. The directory parameter indicates where
the collected data will be stored when the action is carried on.<br/><br/>
&nbsp;<span class="guideheader">O</span>nce an action is created, you have to implement it over a document
type. Implementing an action means defining the web form which will be displayed to a user, and defining the
treatment (set of functions) applied to the data which have been gathered. The implementation of the same action
over two document types can be very different. The fields in the web form can be different as well as the functions
applied at the end of this action.
</blockquote>
<h3>See also:</h3>
<blockquote>
<li><a href="#actionnew">create a new action</a><br/>
<li><a href="#actionremove">remove an action</a><br/>
<li><a href="#actionmodify">modify an action</a><br/>
<li><a href="#actionimplement">implement an action over a type of document</a><br/>
</blockquote>
<p>&nbsp;<p>
<p>&nbsp;<p>
<a name="actionnew"></a>
<h1>Adding a New Action</h1>
<h3>How to get there?</h3>
<blockquote>
&nbsp;<span class="guideheader">C</span>lick on the "Available Actions" link in the websubmit right menu,
then on the "Add an Action" button.
</blockquote>
<h3>How to do this?</h3>
<blockquote>
&nbsp;<span class="guideheader">A</span> new action is defined by 6 fields:<br/><br/>
<ul>
<li><b>Creation Date</b> and <b>Modification Dates</b> are generated and modified automatically.<br/>
<li><b>Action Code</b>: This is the acronym for your new action. We usually use a 3 letters acronym.
<li><b>Action Description</b>: This is a short description of the new action.
<li><b>dir</b>: This is the name of the directory in which the submission data will be stored temporarily. If
the dir value is "running" as for the "Submit New Record" action (SBI), then the submission data for a
Text Document (document acronym "TEXT") will be stored in the
/opt/invenio/var/data/submit/storage/running/TEXT/9089760_90540 directory (where 9089760_90540 is what we call
the submission number. It is a string automatically generated at the beginning of each submission). Once
finished, the submission data will be moved to the
/opt/invenio/var/data/submit/storage/done/running/TEXT/ directory by the "Move_to_Done" function.
<li><b>statustext</b>: text displayed in the status bar of the browser when the user moves his mouse upon
the action button.
</ul>
</blockquote>
<h3>See also:</h3>
<blockquote>
<li><a href="#actionremove">remove an action</a><br/>
<li><a href="#actionmodify">modify an action</a><br/>
<li><a href="#actionimplement">implement an action over a type of document</a><br/>
</blockquote>
<p>&nbsp;<p>
<p>&nbsp;<p>
<a name="actionremove"></a>
<h1>Removing an Action</h1>
<h3>What is it?</h3>
<blockquote>
&nbsp;<span class="guideheader">R</span>emoving the implementation of an action over a document type -
Please note the removal of the action itself is not allowed with this tool.
</blockquote>
<h3>How to get there?</h3>
<blockquote>
&nbsp;<span class="guideheader">F</span>rom the websubmit admin main page, click on the title of the
relevant document type. Then click on the red cross corresponding to the line of the action you want to remove.
</blockquote>
<h3>See also:</h3>
<blockquote>
<li><a href="#actionnew">create an action</a><br/>
<li><a href="#actionmodify">modify an action</a><br/>
<li><a href="#actionimplement">implement an action over a type of document</a><br/>
</blockquote>
<p>&nbsp;<p>
<p>&nbsp;<p>
<a name="actionmodify"></a>
<h1>Modifying an Action</h1>
<h3>What is it?</h3>
<blockquote>
&nbsp;<span class="guideheader">T</span>his page is about how to modify the general data about an
action - for modifying the implementation of an action over a document type, see
<a href="#actionimplement">implement an action over a type of document</a>
</blockquote>
<h3>How to get there?</h3>
<blockquote>
&nbsp;<span class="guideheader">C</span>lick on the "View Actions" link in the right menu of the websubmit
admin, then on the title of the action you want to modify...
</blockquote>
<h3>How to do this?</h3>
<blockquote>
&nbsp;<span class="guideheader">Y</span>ou may modify 3 fields:<br/>
<ul>
<li><b>Action Description</b>: This is a short description of the new action.
<li><b>dir</b>: This is the name of the directory in which the submission data will be stored temporarily.
See the meaning of this parameter in <a href="#actionnew">create an action</a>.
<li><b>statustext</b>: text displayed in the status bar of the browser when the user moves his mouse
upon the action button.
</ul>
</blockquote>
<h3>See also:</h3>
<blockquote>
<li><a href="#actionremove">remove an action</a><br/>
<li><a href="#actionnew">create an action</a><br/>
<li><a href="#actionimplement">implement an action over a type of document</a><br/>
</blockquote>
<p>&nbsp;<p>
<p>&nbsp;<p>
<a name="actionimplement"></a>
<h1>Implement an action over a document type</h1>
<h3>What is it?</h3>
<blockquote>
&nbsp;<span class="guideheader">I</span>mplement an action over a document type. Create the web forms
and the treatment process.
</blockquote>
<h3>How to get there?</h3>
<blockquote>
&nbsp;<span class="guideheader">F</span>rom the main page of the manager, click on the title of the
relevant document type.<br/>Then click on the "Add a New Submission" button.
</blockquote>
<h3>How to do this?</h3>
<blockquote>
&nbsp;<span class="guideheader">J</span>ust select the name of the action you want to implement. When you
select an action, the list of document which already implement this action appears. Then you can select from
this list the document from which you want to clone the implementation, or just choose "No Clone" if you want
to build this implementation from scratch.<br/><br/>
&nbsp;<span class="guideheader">A</span>fter selecting the correct fields, click on the "Add Submission"
button.<br/><br/>
&nbsp;<span class="guideheader">Y</span>ou then go back to the document type manager page where you
can see that in the bottom array your newly implemented action appears (check the acronym in the first
column).<br/><br/>
<img src="<CFG_SITE_URL>/img/admin/websubmit-admin-guide-implement.png" class="guideimg"><br/><br/>
<ul>
<li>Clicking on the action acronym will allow you to modify the general data about the action (remember
in this case that all the other implementations of this particular action will also be changed).
<li>The second column indicates whether the button representing this action will appear on the submission page.
<li>The third column shows you the number of pages composing the web form for this implementation.
(see <a href="#implementwebform">create and maintain the web form</a>).
<li>The 4th and 5th columns indicate the creation and last modification dates for this implementation.
<li>In the 6th column, you can find the order in which the button will be displayed on the submission page
of this document type.<br/>
<li>The following 4 columns (level, score, stpage, endtxt) deal with the insertion of this action in an action
set.<br/><br/>
<table border=0 bgcolor="eeeeff"><tr><td><small><br/>
An action set is a succession of actions which should be done in a given order when a user starts.<br/>
For example the submission of a document is usually composed of two actions: Submission of Bibliographic
Information (SBI) and Fulltext Transfer (FTT) which should be done one after the other.<br/>
When the user starts the submission, we want CDS Submit to get him first in SBI and when he finishes SBI to
carry him to FTT.<br/>
SBI and FTT are in this case in the same action set.<br/>
They will both have a level of 1 ("level" is a bad name, it should be "action set number"), SBI will have a
score of 1, and FTT a score of 2 (which means it will be started after SBI). If you set the stpage of FTT to 2,
the user will be directly carried to the 2nd page of the FTT web form. This value is usually set to 1.<br/>
The endtxt field contains the text which will be display to the user at the end of the first action (here
it could be "you now have to transfer your files")
<br/><br/>
A single action like "Modify Bibliographic Information" should have the 3 columns to 0,0 and 1.<br/>&nbsp;
</small></td></tr></TABLE>
<br/><br/>
<li>Click on the icon in the 12th column ("Edit Submission Pages") to
<a href="#implementwebform">create or edit the web form</a>.
<li>Click on the icon in the 13th column ("Edit Functions") to
<a href="#implementfunctions">create or edit the function list</a>.
<li>The "Edit Submission" column allows you to modify the data (level, status text...) for this implementation.
<li> Finally the last column allows you to delete this implementation.<br/>&nbsp;
</ul><br/>
&nbsp;<span class="guideheader">I</span>f you chose to clone the implementation from an existing one,
the web form as well as the functions list will already be defined. Else you will have to create them from scratch.
</blockquote>
<h3>See also:</h3>
<blockquote>
<li><a href="#implementwebform">create and maintain the web form</a><br/>
<li><a href="#implementfunctions">create and maintain the data treatment</a><br/>
</blockquote>
<p>&nbsp;<p>
<p>&nbsp;<p>
<a name="implementwebform"></a>
<h1>Create and maintain the web form</h1>
<h3>What is it?</h3>
<blockquote>
&nbsp;<span class="guideheader">C</span>reate and define the web form used during an action.
</blockquote>
<h3>How to get there?</h3>
<blockquote>
&nbsp;<span class="guideheader">F</span>rom the main page of the manager, click on the title of the relevant
document type. Then click on the icon in the "Edit Submission Pages" column of the relevant line.
</blockquote>
<h3>List of the form pages</h3>
<blockquote>
&nbsp;<span class="guideheader">A</span> web form can be split over several pages. This is a matter
of easiness for the user: he will have an overview of all form fields present on the page without having to scroll it.
Moreover, each time the user goes from one page to the other, all entered data are saved. If he wants to stop
then come back later (or if the browser crashes!) he will be able to get back to the submission at the exact
moment he left it.<br/><br/>
&nbsp;<span class="guideheader">O</span>nce here:<br/><br/>
<IMG src="<CFG_SITE_URL>/img/admin/websubmit-admin-guide-menu_page.png" class="guideimg"><br/><br/>
you can see the ordered list of already existing pages in the web form. In this example there are 4 pages.
You can then:
<ul>
<li> Move one page from one place to an other, using the small blue arrows under each page number.
<li>Suppress one page by clicking on the relevant red cross.
<li>Add a page, by clicking the "ADD A PAGE" button!
<li><a href="#onepage">Edit the content of one page</a> by clicking on the page number.
<li>Go back to the document main page.
</ul>
</blockquote>
<a name="onepage"></a>
<h3>Edit one form page</h3>
<blockquote>
&nbsp;<span class="guideheader">C</span>lick on a page number, you then arrive to a place where you can
edit this form page.<br/><br/>
&nbsp;<span class="guideheader">A</span> form page is composed of a list of form elements. Each of these
form elements is roughly made of an html template and a text displayed before the form field.<br/><br/>
&nbsp;<span class="guideheader">I</span>n the first part of the page, you have a preview of what the form
will look like to the user:<br/>
<IMG src="<CFG_SITE_URL>/img/admin/websubmit-admin-guide-preview.png" class="guideimg"><br/><br/>
&nbsp;<span class="guideheader">T</span>hen the second table shows you the list of the form elements
present on the page:<br/>
<IMG src="<CFG_SITE_URL>/img/admin/websubmit-admin-guide-elements.png" class="guideimg"><br/><br/>
&nbsp;<span class="guideheader">Y</span>ou can then:
<ul>
<li>Move one element from one place to another using the drop-down menus in the first
column ("Item No") of the table, or the little blue arrows in the second column.
<li><a href="#edittemplate">Edit the html template of one form element</a> by clicking on the name of the
template in the 3rd column ("Name").
<li><a href="#editelement">Edit one of the form elements</a> by clicking on the icon in the 10th column.
<li>delete one form element by clicking on the relevant red cross.
<li><a href="#addelement">Add an element to the page</a> by clicking the "ADD ELEMENT TO PAGE" button.
</ul>
</blockquote>
<a name="edittemplate"></a>
<h3>Edit the html template of one form element</h3>
<blockquote>
&nbsp;<span class="guideheader">I</span>n the html template edition page, you can modify the following values:
<ul>
<li><b>Element type</b>: indicates which html form element to create
<li><b>Aleph code</b>: <font color=red>Aleph users only!</font> - This indicates in which field of the Aleph
document database to retrieve the original value when modifying this information (function
Create_Modify_Interface of action MBI).
<li><b>Marc Code</b>: <font color=red>MySQL users only!</font> - This indicates in which field of the MySQL
document database to retrieve the original value when modifying this information (function
Create_Modify_Interface of action MBI).
<li><b>Cookies</b>: indicates whether WebSubmit will set a cookie on the value filled in by the user. If yes,
next time the user will come to this submission, the value he has entered last time will be filled in
automatically. <span style="font-weight: bold;">Note:</span> <span style="color: red; font-weight: bold;">
This feature has been REMOVED.</span>
<li><b>other fields</b>: The other fields help defining the html form element.
</ul>
<font color=red>Important warning!</font> Please remember this is a template! This means it can be used in
many different web forms/implementations. When you modify this template the modification will take place in
each of the implementations this template has been used.
</blockquote>
<a name="editelement"></a>
<h3>Edit one form element</h3>
<blockquote>
&nbsp;<span class="guideheader">I</span>n the form element edition page, you may modify the following values:
<ul>
<li><b>element label</b>: This is the text displayed before the actual form field.
<li><b>level</b>: can be one of "mandatory" or "optional". If mandatory, the user won't be able to leave
this page before filling this field in.
<li><b>short desc</b>: This is the text displayed in the summary window when it is opened.
<li><b>Check</b>: Select here the <a href="#addcheck">javascript checking function</a> to be applied to
the submitted value of this field
<li><b>Modify Text</b>: This text will be displayed before the form field when modifying the value (action
"Modify Record", function "Create_Modify_Interface")
</ul>
</blockquote>
<a name="addelement"></a>
<h3>Add one form element</h3>
<blockquote>
&nbsp;<span class="guideheader">C</span>lick on the "ADD ELEMENT TO PAGE" button. There you will have
to decide which <a href="#addtemplate">html template field</a> to use ("Element Description code"), and
also the field mentioned <a href="#editelement">above</a>.
</blockquote>
<a name="addtemplate"></a>
<h3>Create a new html template</h3>
<blockquote>
&nbsp;<span class="guideheader">Y</span>ou have access to the list of all existing html templates by clicking
on the "View element descriptions" link in the websubmit admin right menu.<br/>
By clicking on one of them, you will have access to its description.<br/>
If no template corresponds to the one you seek, click on the "ADD NEW ELEMENT DESCRIPTION" button to
create one.<br/>
&nbsp;<span class="guideheader">T</span>he fields you have to enter in the creation form are the one
described in the <a href="#edittemplate">Edit the html template of one form element</a> section.<br/>
You also have to choose a name for this new element.<br/>
<font color=red>IMPORTANT!</font> The name you choose for your html element is also the name of the file
in which webSubmit will save the value entered in this field. This is also the one you will use in your
<a href="#bibconvert">BibConvert</a> configuration. Bibconvert is the program which will
convert the data gathered in webSubmit in a formatted XML file for insertion in the documents database.
<br/>
&nbsp;<span class="guideheader">T</span>ips:
<li>Elements of type "select box" which are used as a mandatory field in a form must start with "&lt;option&gt;Select:&lt;/option&gt;"
</blockquote>
<a name="addcheck"></a>
<h3>Create and edit a checking function.</h3>
<blockquote>
&nbsp;<span class="guideheader">C</span>lick on the "View Checks" link in the websubmit admin right menu.
You then have access to a list of all the defined javascript functions.<br/>
You can then click on the name of the function you want to modify, or click on the "ADD NEW CHECK" button
to create a new javascript function.<br/>
These functions are inserted in the web page when the user is doing his submission. When he clicks on
"next page", this function will be called with the value entered by the user as a parameter. If the function returns
false, the page does not change and an error message should be output. If the function returns true, everything
is correct, so page can be changed.
</blockquote>
<h3>See also:</h3>
<blockquote>
<li><a href="#implementfunctions">create and maintain the data treatment</a><br/>
</blockquote>
<p>&nbsp;<p>
<p>&nbsp;<p>
<a name="implementfunctions"></a>
<h1>Setup the Data Treatment</h1>
<h3>What is it?</h3>
<blockquote>
&nbsp;<span class="guideheader">A</span>t the end of a submission, we have to tell webSubmit what to do
with the data it has gathered. This is expressed through one or several lists of functions (we call this the
"end script").
</blockquote>
<h3>How to get there?</h3>
<blockquote>
&nbsp;<span class="guideheader">F</span>rom the main page of the manager, click on the title of the relevant
document type.<br/>Then click on the icon in the "Edit Functions" column of the relevant line.
</blockquote>
<h3>List of functions</h3>
<blockquote>
&nbsp;<span class="guideheader">H</span>ere is what you may see then (this is the end script list of functions
for a document type named "TEST" and action "FTT" - Fulltext Transfer):<br/><br/>
<IMG src="<CFG_SITE_URL>/img/admin/websubmit-admin-guide-list_functions.png" class="guideimg"><br/><br/>
&nbsp;<span class="guideheader">Y</span>ou can see the ordered list of all the functions in the end script.
This end script is composed of 2 steps (see the "step" column). The functions composing the first step are called,
then there should be action from the user which would trigger step 2 - in the present case the
<a href="#Upload_Files">Upload_Files</a> function (last of step 1) allows
the user to upload additional files by creating a web form, then when the user finishes, he presses another
button created by the function, which ends the process. Functions of step 2 are then called.<br/><br/>
&nbsp;<span class="guideheader">W</span>hy implement multiple steps? The reason can vary with the task
you want to accomplish. For example with the example above (Fulltext Transfer), we use the first step to allow
the upload of multiple additional files (dynamic action) which could not be done in the
<a href="#implementwebform">static web form</a>. In the case of the
"Modify Bibliographic Information" action, the first step is used to display the fields the user wants to modify,
prefilled with the existing values. The reason is once again that the task we want to realise is dynamic.<br/><br/>
&nbsp;<span class="guideheader">T</span>he "score" column is used to order the functions. The function
which has the smallest score will be called first, and the largest score will be called last.<br/><br/>
&nbsp;<span class="guideheader">Y</span>ou can then:
<ul>
<li> View and edit the parameters of each function by clicking on the name of the function.
<li> Move one function up and down, by using the small blue arrows.
<li> Suppress one function by clicking on the relevant red cross.
<li> Add a function to the list by clicking the "ADD FUNCTION" button.
<li> Go back to the document main page ("FINISHED" button).
</ul>
&nbsp;<span class="guideheader">P</span>lease note: To pass one function from one step to another,
you have to delete it then add it again in the proper step.
</ul>
</blockquote>
<h3>See also:</h3>
<blockquote>
<li><a href="#functions">all about functions</a><br/>
</blockquote>
<p>&nbsp;<p>
<p>&nbsp;<p>
<a name="functions"></a>
<h1>Functions</h1>
<h3>Description:</h3>
<blockquote>
&nbsp;<span class="guideheader">I</span>n webSubmit, each action process is divided into two phases: the
gathering of data (through a web form) and the treatment of the data.<br/><br/>
&nbsp;<span class="guideheader">T</span>he treatment is organised in a succession of functions, each of
which has its own input and output.<br/><br/>
&nbsp;<span class="guideheader">T</span>he functions themselves are stored in separate files (one per
function) in the /opt/invenio/lib/python/invenio/websubmit_functions directory. A file containing a function MUST
be named after the function name itself. For example, a function called "Move_to_Done" MUST be stored in a
file called Move_to_Done.py. The case is important here.<br/><br/>
&nbsp;<span class="guideheader">F</span>or a description of what should be inside the file, have a look to
the "create a new function" page of this guide.<br/><br/>
&nbsp;<span class="guideheader">T</span>o each function you can associate one or several parameters,
which may have different values according to the document type the function is used for. One parameter may
be used for different functions. For example one standard parameter used in several functions is called "edsrn".
It contains the name of the file in which the reference of the document is stored.
</blockquote>
<h3>See also:</h3>
<blockquote>
<li><a href="#functionnew">create a new function</a><br/>
<li><a href="#functiondelete">delete a function</a><br/>
<li><a href="#functionedit">edit a function</a><br/>
</blockquote>
<p>&nbsp;<p>
<p>&nbsp;<p>
<a name="functionnew"></a>
<h1>Creating a New Function</h1>
<h3>How to get there?</h3>
<blockquote>
&nbsp;<span class="guideheader">C</span>lick on the "Available Functions" link in the websubmit admin right
menu. Then click on the "Add New Function" button.
</blockquote>
<h3>How to do this?</h3>
<blockquote>
&nbsp;<span class="guideheader">E</span>nter the name of the new function as well as a text description if
you wish.<br/>
&nbsp;<span class="guideheader">Y</span>ou will then reach a page where you can add parameters to your
new function.<br/><br/>
&nbsp;<span class="guideheader">D</span>on't forget to add the function file inside the
/opt/invenio/lib/python/invenio/websubmit_functions directory and to name the file after the function. Functions must
be written in Python. Here is an example implementation of a function:<br/><br/>
/opt/invenio/lib/python/invenio/websubmit_functions/Get_Report_Number.py:</small>
<table border=0 width=75% bgcolor="eeeeff"><tr><td><small><pre><br/>
def Get_Report_Number (parameters,curdir,form):
global rn
#Path of file containing report number
if os.path.exists("%s/%s" % (curdir,parameters['edsrn'])):
fp = open("%s/%s" % (curdir,parameters['edsrn']),"r")
rn = fp.read()
rn = rn.replace("/","_")
rn = re.sub("[\n\r ]+","",rn)
else:
rn = ""
return ""
<pre></small></td></tr></TABLE>
<br/>
The function parameters are passed to the function through the parameters dictionary.<br/>
The curdir parameter contains the current submission directory path.<br/>
The form parameter contains the form passed to the current web page for possible reference from inside the
function.
</blockquote>
<h3>See also:</h3>
<blockquote>
<li><a href="#functionedit">edit a function</a><br/>
<li><a href="#functiondelete">delete a function</a><br/>
</blockquote>
<p>&nbsp;<p>
<p>&nbsp;<p>
<a name="functiondelete"></a>
<h1>Removing a Function</h1>
<h3>Note</h3>
<blockquote>
&nbsp;<span class="guideheader">T</span>here are currently no way of deleting a function through this
interface. Use the direct MySQL command line interface for this.
</blockquote>
<h3>See also:</h3>
<blockquote>
<li><a href="#functionedit">edit a function</a><br/>
<li><a href="#functionnew">create a function</a><br/>
</blockquote>
<p>&nbsp;<p>
<p>&nbsp;<p>
<a name="functionedit"></a>
<h1>Editing a Function</h1>
<h3>What is it?</h3>
<blockquote>
&nbsp;<span class="guideheader">E</span>dit a function, add parameters to it...
</blockquote>
<h3>How to get there?</h3>
<blockquote>
&nbsp;<span class="guideheader">C</span>lick on the "Available Functions" link in the websubmit admin
right menu.
</blockquote>
<h3>How to do this?</h3>
<blockquote>
&nbsp;<span class="guideheader">O</span>n this page appears a list of all functions defined into the system.
Two columns give you access to some features:
<ul>
<li><font color=green>View function usage</font> Click here to have access to the list of all document
types and all actions in which this function is used. Then by clicking on one of the items, you will be given a
chance to modify the parameters value for the given document type.
<li><font color=green>View/Edit function details</font> There you will be able to modify the function
description, as well as add/withdraw parameters for this function.
</ul>
</blockquote>
<h3>See also:</h3>
<blockquote>
<li><a href="#functionnew">create a new function</a><br/>
<li><a href="#functiondelete">delete a function</a><br/>
</blockquote>
<p>&nbsp;<p>
<p>&nbsp;<p>
<a name="functiondescription"></a>
<h1>All functions explained</h1>
<h3>Description:</h3>
<blockquote>
&nbsp;<span class="guideheader">T</span>his page lists and explains all the functions used in the demo
provided with the Invenio package. This list is not exhaustive since you can add any new function you need.<br/>
&nbsp;<span class="guideheader">C</span>lick on one function name to get its description.<br/>
&nbsp;<span class="guideheader">P</span>lease note in this page when we refer to [param] this means the
value of the parameter 'param' for a given document type.<br/><br/>
<table cellspacing=5><tr>
<td valign="top">
<a href="#CaseEDS">CaseEDS</a><br/>
<a href="#Create_Modify_Interface">Create_Modify_Interface</a><br/>
<a href="#Create_Recid">Create_Recid</a><br/>
<a href="#Finish_Submission">Finish_Submission</a><br/>
<a href="#Get_Info">Get_Info</a><br/>
<a href="#Get_Recid">Get_Recid</a><br/>
<a href="#Get_Report_Number">Get_Report_Number</a><br/>
<a href="#Get_Sysno">Get_Sysno</a><br/>
<a href="#Get_TFU_Files">Get_TFU_Files</a><br/>
<a href="#Insert_Modify_Record">Insert_Modify_Record</a><br/>
<a href="#Insert_Record">Insert_Record</a><br/>
</td>
<td valign="top">
<a href="#Is_Original_Submitter">Is_Original_Submitter</a><br/>
<a href="#Is_Referee">Is_Referee</a><br/>
<a href="#Mail_Submitter">Mail_Submitter</a><br/>
<a href="#Make_Modify_Record">Make_Modify_Record</a><br/>
<a href="#Make_Record">Make_Record</a><br/>
<a href="#Move_From_Pending">Move_From_Pending</a><br/>
<a href="#Move_to_Done">Move_to_Done</a><br/>
<a href="#Move_to_Pending">Move_to_Pending</a><br/>
<a href="#Print_Success">Print_Success</a><br/>
<a href="#Print_Success_APP">Print_Success_APP</a><br/>
<a href="#Print_Success_MBI">Print_Success_MBI</a><br/>
</td>
<td valign="top">
<a href="#Print_Success_SRV">Print_Success_SRV</a><br/>
<a href="#Report_Number_Generation">Report_Number_Generation</a><br/>
<a href="#Send_Approval_Request">Send_Approval_Request</a><br/>
<a href="#Send_APP_Mail">Send_APP_Mail</a><br/>
<a href="#Send_Modify_Mail">Send_Modify_Mail</a><br/>
<a href="#Send_SRV_Mail">Send_SRV_Mail</a><br/>
<a href="#Test_Status">Test_Status</a><br/>
<a href="#Update_Approval_DB">Update_Approval_DB</a><br/>
<a href="#Upload_Files">Upload_Files</a><br/>
</td>
</tr></table>
</blockquote>
<br/><br/><a name="CaseEDS">
<table border="1" width="80%">
<tr><td colspan="2" bgcolor="#ddddff"><small><b>CaseEDS</b></small></td></tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>description</small></td></tr>
<tr>
<td colspan="2">
<small>
This function may be used if the treatment to be done after a submission depends on a field entered by
the user. Typically this is used in an approval interface. If the referee approves then we do this. If he rejects,
then we do other thing.<br/>
More specifically, the function gets the value from the file named [casevariable] and compares it with the
values stored in [casevalues]. If a value matches, the function directly goes to the corresponding step stored
in [casesteps]. If no value is matched, it goes to step [casedefault].
</small>
</td>
</tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>parameters</small></td></tr>
<tr>
<td valign="top"><small><b>casevariable</b></small></td>
<td><small>
This parameters contains the name of the file in which the function will get the chosen value.<br/>
Eg: "decision"
</small></td>
</tr>
<tr>
<td valign="top"><small><b>casevalues</b></small></td>
<td><small>
Contains the list of recognized values to match with the chosen value. Should be a comma separated list of words.<br/>
Eg: "approve,reject"
</small></td>
</tr>
<tr>
<td valign="top"><small><b>casesteps</b></small></td>
<td><small>
Contains the list of steps corresponding to the values matched in [casevalue]. It should be a comma
separated list of numbers<br/>
Eg: "2,3"<br/>
<i>In this example, if the value stored in the file named "decision" is "approved", then the function launches
step 2 of this action. If it is "reject", then step 3 is launched.</i>
</small></td>
</tr>
<tr>
<td valign="top"><small><b>casedefault</b></small></td>
<td><small>
Contains the step number to go by default if no match is found.<br/>
Eg: "4"<br/>
<i>In this example, if the value stored in the file named "decision" is not "approved" nor "reject", then
step 4 is launched.</i>
</small></td>
</tr>
</TABLE>
<br/><br/><a name="Create_Modify_Interface">
<table border="1" width="80%">
<tr><td colspan="2" bgcolor="#ddddff"><small><b>Create_Modify_Interface</b></small></td></tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>description</small></td></tr>
<tr>
<td colspan="2">
<small>
To be used in the MBI-Modify Record action.
It displays a web form allowing the user to modify the fields he chose. The fields are prefilled with the existing
values extracted from the documents database.
This functions takes the values stored in the [fieldnameMBI] file. This file contains a list of field name separated
with "+" (it is usually generated from a multiple select form field). Then the function retrieves the corresponding
tag name (marc-21) stored in the element definition. Finally it displays the web form and fills it with the existing
values found in the documents database.
</small>
</td>
</tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>parameters</small></td></tr>
<tr>
<td valign="top"><small><b>fieldnameMBI</b></small></td>
<td><small>
Contains the name of the file in which the function will find the list of fields the user wants to modify. Depends
on the web form configuration.
</small></td>
</tr>
</TABLE>
<br/><br/><a name="Create_Recid">
<table border="1" width="80%">
<tr><td colspan="2" bgcolor="#ddddff"><small><b>Create_Recid</b></small></td></tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>description</small></td></tr>
<tr>
<td colspan="2">
<small>
This function retrieves a new record id from the records database. This record id will then be used to create the
XML record afterwards, or to link with the fulltext files. The created id is stored in a file named "SN".
</small>
</td>
</tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>parameters</small></td></tr>
<tr>
<td valign="top" colspan="2"><small>none</small></td>
</tr>
</TABLE>
<br/><br/><a name="Finish_Submission">
<table border="1" width="80%">
<tr><td colspan="2" bgcolor="#ddddff"><small><b>Finish_Submission</b></small></td></tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>description</small></td></tr>
<tr>
<td colspan="2">
<small>
This function stops the data treatment process even if further steps exist. This is used for example in the
approval action. In the first step, the program determines whether the user approved or rejected the
document (see <a href="#CaseEDS">CaseEDS</a> function description). Then depending on the result, it
executes step 2 or step 3. If it executes step 2, then it should continue with step 3 if nothing stopped it. The
Finish_Submission function plays this role.
</small>
</td>
</tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>parameters</small></td></tr>
<tr>
<td valign="top" colspan="2"><small>none</td>
</tr>
</TABLE>
<br/><br/><a name="Get_Info">
<table border="1" width="80%">
<tr><td colspan="2" bgcolor="#ddddff"><small><b>Get_Info</b></small></td></tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>description</small></td></tr>
<tr>
<td colspan="2">
<small>
This function tries to retrieve in the "pending" directory or directly in the documents database, some information
about the document: title, original submitter's email and author(s).<br/>
If found, this information is stored in 3 global variables: $emailvalue, $titlevalue, $authorvalue to be used
in other functions.<br/>
If not found, an error message is displayed.
</small>
</td>
</tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>parameters</small></td></tr>
<tr>
<td valign="top"><small><b>authorFile</b></small></td>
<td><small>
Name of the file in which the author may be found if the document has not yet been integrated (in this case
it is still in the "pending" directory).
</small></td>
</tr>
<tr>
<td valign="top"><small><b>emailFile</b></small></td>
<td><small>
Name of the file in which the email of the original submitter may be found if the document has not yet been
integrated (in this case it is still in the "pending" directory).
</small></td>
</tr>
<tr>
<td valign="top"><small><b>titleFile</b></small></td>
<td><small>
Name of the file in which the title may be found if the document has not yet been integrated (in this case it is
still in the "pending" directory).
</small></td>
</tr>
</TABLE>
<br/><br/><a name="Get_Recid">
<table border="1" width="80%">
<tr><td colspan="2" bgcolor="#ddddff"><small><b>Get_Recid</b></small></td></tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>description</small></td></tr>
<tr>
<td colspan="2">
<small>
This function searches for the document in the database and stores the recid of this document in the "SN" file and in a global variable "sysno".<br/>
The function conducts the search based upon the document's report-number (and relies upon the global variable "rn") so the "Get_Report_Number" function should be called before this one.<br/>
<i>This function replaces the older function "Get_Sysno".</i><br/>
</small>
</td>
</tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>parameters</small></td></tr>
<tr>
<td valign="top" colspan="2"><small>none</td>
</tr>
</TABLE>
<br/><br/><a name="Get_Report_Number">
<table border="1" width="80%">
<tr><td colspan="2" bgcolor="#ddddff"><small><b>Get_Report_Number</b></small></td></tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>description</small></td></tr>
<tr>
<td colspan="2">
<small>
This function gets the value contained in the [edsrn] file and stores it in the reference global variable.
</small>
</td>
</tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>parameters</small></td></tr>
<tr>
<td valign="top"><small><b>edsrn</b></small></td>
<td><small>
Name of the file which stores the reference.<br/>
This value depends on the web form configuration you did. It should contain the name of the form element used for storing the reference of the document.
</small></td>
</tr>
</TABLE>
<br/><br/><a name="Get_Sysno">
<table border="1" width="80%">
<tr><td colspan="2" bgcolor="#ddddff"><small><b>Get_Sysno</b></small></td></tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>description</small></td></tr>
<tr>
<td colspan="2">
<small>
This function searches for the document in the database and stores the system number of this document in the "SN" file and in a global variable.<br/>
"Get_Report_Number" should be called before.<br/>
<span style="color: red; font-style: italic;">Deprecated: Use Get_Recid instead.</span>
</small>
</td>
</tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>parameters</small></td></tr>
<tr>
<td valign="top" colspan="2"><small>none</td>
</tr>
</TABLE>
<br/><br/><a name="Insert_Modify_Record">
<table border="1" width="80%">
<tr><td colspan="2" bgcolor="#ddddff"><small><b>Insert_Modify_Record</b></small></td></tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>description</small></td></tr>
<tr>
<td colspan="2">
<small>
This function gets the output of bibconvert and uploads it into the MySQL bibliographical database.
</small>
</td>
</tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>parameters</small></td></tr>
<tr>
<td valign="top" colspan="2"><small>none</td>
</tr>
</TABLE>
<br/><br/><a name="Insert_Record">
<table border="1" width="80%">
<tr><td colspan="2" bgcolor="#ddddff"><small><b>Insert_Record</b></small></td></tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>description</small></td></tr>
<tr>
<td colspan="2">
<small>
This function gets the output of bibFormat and uploads it into the MySQL bibliographical database.
</small>
</td>
</tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>parameters</small></td></tr>
<tr>
<td valign="top" colspan="2"><small>none</td>
</tr>
</TABLE>
<br/><br/><a name="Is_Original_Submitter">
<table border="1" width="80%">
<tr><td colspan="2" bgcolor="#ddddff"><small><b>Is_Original_Submitter</b></small></td></tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>description</small></td></tr>
<tr>
<td colspan="2">
<small>
If the authentication module (login) is active in webSubmit, this function compares the current login with the email of the original submitter. If it is the same (or if the current user has superuser rights), we go on. If it differs, an error message is issued.
</small>
</td>
</tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>parameters</small></td></tr>
<tr>
<td valign="top" colspan="2"><small>none</td>
</tr>
</TABLE>
<br/><br/><a name="Is_Referee">
<table border="1" width="80%">
<tr><td colspan="2" bgcolor="#ddddff"><small><b>Is_Referee</b></small></td></tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>description</small></td></tr>
<tr>
<td colspan="2">
<small>
This function checks whether the currently logged user is a referee for this document.
</small>
</td>
</tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>parameters</small></td></tr>
<tr>
<td valign="top" colspan="2"><small>none</td>
</tr>
</TABLE>
<br/><br/><a name="Mail_Submitter">
<table border="1" width="80%">
<tr><td colspan="2" bgcolor="#ddddff"><small><b>Mail_Submitter</b></small></td></tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>description</small></td></tr>
<tr>
<td colspan="2">
<small>
This function send an email to the submitter to warn him the document he has just submitted has been
correctly received.
</small>
</td>
</tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>parameters</small></td></tr>
<tr>
<td valign="top"><small><b>authorfile</b></small></td>
<td><small>
Name of the file containing the authors of the document<br/>
</small></td>
</tr>
<tr>
<td valign="top"><small><b>titleFile</b></small></td>
<td><small>
Name of the file containing the title of the document<br/>
</small></td>
</tr>
<tr>
<td valign="top"><small><b>emailFile</b></small></td>
<td><small>
Name of the file containing the email of the submitter of the document<br/>
</small></td>
</tr>
<tr>
<td valign="top"><small><b>status</b></small></td>
<td><small>
Depending on the value of this parameter, the function adds an additional text to the email.<br/>
This parameter can be one of:<br/>
<b>ADDED</b>: The file has been integrated in the database.<br/>
<b>APPROVAL</b>: The file has been sent for approval to a referee.<br/>
or can stay empty.
</small></td>
</tr>
<tr>
<td valign="top"><small><b>edsrn</b></small></td>
<td><small>
Name of the file containing the reference of the document<br/>
</small></td>
</tr>
<tr>
<td valign="top"><small><b>newrnin</b></small></td>
<td><small>
Name of the file containing the 2nd reference of the document (if any)<br/>
</small></td>
</tr>
</TABLE>
<br/><br/><a name="Make_Modify_Record">
<table border="1" width="80%">
<tr><td colspan="2" bgcolor="#ddddff"><small><b>Make_Modify_Record</b></small></td></tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>description</small></td></tr>
<tr>
<td colspan="2">
<small>
This function creates the record file formatted for a direct insertion in the documents database. It uses the
<a href="#bibconvert">BibConvert</a> tool.<br/>
The main difference between all the Make_..._Record functions are the parameters.<br/>
As its name says, this particular function should be used for the modification of a record. (MBI- Modify
Record action).
</small>
</td>
</tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>parameters</small></td></tr>
<tr>
<td valign="top"><small><b>modifyTemplate</b></small></td>
<td><small>
Name of bibconvert's configuration file used for creating the mysql record.
</small></td>
</tr>
<tr>
<td valign="top"><small><b>sourceTemplate</b></small></td>
<td><small>
Name of bibconvert's source file.
</small></td>
</tr>
</TABLE>
<br/><br/><a name="Make_Record">
<table border="1" width="80%">
<tr><td colspan="2" bgcolor="#ddddff"><small><b>Make_Record</b></small></td></tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>description</small></td></tr>
<tr>
<td colspan="2">
<small>
This function creates the record file formatted for a direct insertion in the documents database. It uses the
<a href="#bibconvert">BibConvert</a> tool.<br/>
The main difference between all the Make_..._Record functions are the parameters.<br/>
As its name does not say :), this particular function should be used for the submission of a document.
</small>
</td>
</tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>parameters</small></td></tr>
<tr>
<td valign="top"><small><b>createTemplate</b></small></td>
<td><small>
Name of bibconvert's configuration file used for creating the mysql record.
</small></td>
</tr>
<tr>
<td valign="top"><small><b>sourceTemplate</b></small></td>
<td><small>
Name of bibconvert's source file.
</small></td>
</tr>
</TABLE>
<br/><br/><a name="Move_From_Pending">
<table border="1" width="80%">
<tr><td colspan="2" bgcolor="#ddddff"><small><b>Move_From_Pending</b></small></td></tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>description</small></td></tr>
<tr>
<td colspan="2">
<small>
This function retrieves the data of a submission which was temporarily stored in the "pending" directory
(waiting for an approval for example), and moves it to the current action directory.
</small>
</td>
</tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>parameters</small></td></tr>
<tr>
<td valign="top" colspan="2"><small>none</td>
</tr>
</TABLE>
<br/><br/><a name="Move_to_Done">
<table border="1" width="80%">
<tr><td colspan="2" bgcolor="#ddddff"><small><b>Move_to_Done</b></small></td></tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>description</small></td></tr>
<tr>
<td colspan="2">
<small>
This function moves the existing submission directory to the /opt/invenio/var/data/submit/storage/done directory. If the
Then it tars and gzips the directory.
</small>
</td>
</tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>parameters</small></td></tr>
<tr>
<td valign="top" colspan="2"><small>none</td>
</tr>
</TABLE>
<br/><br/><a name="Move_to_Pending">
<table border="1" width="80%">
<tr><td colspan="2" bgcolor="#ddddff"><small><b>Move_to_Pending</b></small></td></tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>description</small></td></tr>
<tr>
<td colspan="2">
<small>
This function moves the existing submission directory to the /opt/invenio/var/data/submit/storage/pending directory. It is
used to store temporarily this data until it is approved or...
</small>
</td>
</tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>parameters</small></td></tr>
<tr>
<td valign="top" colspan="2"><small>none</td>
</tr>
</TABLE>
<br/><br/><a name="Print_Success">
<table border="1" width="80%">
<tr><td colspan="2" bgcolor="#ddddff"><small><b>Print_Success</b></small></td></tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>description</small></td></tr>
<tr>
<td colspan="2">
<small>
This function simply displays a text on the screen, telling the user the submission went fine. To be used in
the "Submit New Record" action.
</small>
</td>
</tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>parameters</small></td></tr>
<tr>
<td valign="top"><small><b>status</b></small></td>
<td><small>
Depending on the value of this parameter, the function adds an additional text to the email.<br/>
This parameter can be one of:<br/>
<b>ADDED</b>: The file has been integrated in the database.<br/>
<b>APPROVAL</b>: The file has been sent for approval to a referee.<br/>
or can stay empty.
</small></td>
</tr>
<tr>
<td valign="top"><small><b>edsrn</b></small></td>
<td><small>
Name of the file containing the reference of the document<br/>
</small></td>
</tr>
<tr>
<td valign="top"><small><b>newrnin</b></small></td>
<td><small>
Name of the file containing the 2nd reference of the document (if any)<br/>
</small></td>
</tr>
</TABLE>
<br/><br/><a name="Print_Success_APP">
<table border="1" width="80%">
<tr><td colspan="2" bgcolor="#ddddff"><small><b>Print_Success_APP</b></small></td></tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>description</small></td></tr>
<tr>
<td colspan="2">
<small>
This function simply displays a text on the screen, telling the referee his decision has been taken into account.
To be used in the Approve (APP) action.
</small>
</td>
</tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>parameters</small></td></tr>
<tr>
<td valign="top" colspan="2"><small>none</td>
</tr>
</TABLE>
<br/><br/><a name="Print_Success_MBI">
<table border="1" width="80%">
<tr><td colspan="2" bgcolor="#ddddff"><small><b>Print_Success_MBI</b></small></td></tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>description</small></td></tr>
<tr>
<td colspan="2">
<small>
This function simply displays a text on the screen, telling the user the modification went fine. To be used in
the Modify Record (MBI) action.
</small>
</td>
</tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>parameters</small></td></tr>
<tr>
<td valign="top" colspan="2"><small>none</td>
</tr>
</TABLE>
<br/><br/><a name="Print_Success_SRV">
<table border="1" width="80%">
<tr><td colspan="2" bgcolor="#ddddff"><small><b>Print_Success_SRV</b></small></td></tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>description</small></td></tr>
<tr>
<td colspan="2">
<small>
This function simply displays a text on the screen, telling the user the revision went fine. To be used in the
Submit New File (SRV) action.
</small>
</td>
</tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>parameters</small></td></tr>
<tr>
<td valign="top" colspan="2"><small>none</td>
</tr>
</TABLE>
<br/><br/><a name="Report_Number_Generation">
<table border="1" width="80%">
<tr><td colspan="2" bgcolor="#ddddff"><small><b>Report_Number_Generation</b></small></td></tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>description</small></td></tr>
<tr>
<td colspan="2">
<small>
This function is used to automatically generate a reference number.<br/>
After generating the reference, the function saves it into the [newrnin] file and sets the global variable
containing this reference.
</small>
</td>
</tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>parameters</small></td></tr>
<tr>
<td valign="top"><small><b>autorngen</b></small></td>
<td><small>
If set to "<b>Y</b>": The reference number is generated.<br/>
If set to "<b>N</b>": The reference number is read from a file ([newrnin])<br/>
If set to "<b>A</b>": The reference number will be the access number of the submission.
</small></td>
</tr>
<tr>
<td valign="top"><small><b>counterpath</b></small></td>
<td><small>
indicates the file in which the program will find the counter for this reference generation.<br/>
The value of this parameter may contain one of:<br/>
"<b>&lt;PA&gt;categ&lt;/PA&gt;</b>": in this case this string is replaced with the content of the file [altrnin]<br/>
"<b>&lt;PA&gt;yy&lt;/PA&gt;</b>": in this case this string is replaced by the current year (4 digits) if [altyeargen]
is set to "AUTO", or by the content of the [altyeargen] file in any other case. (this content should be formatted
as a date (dd/mm/yyyy).<br/>
"<b>&lt;PA&gt;file:<i>name_of_file</i>&lt;/PA&gt;</b>": in this case, this string is replaced by the first line of the given file<br />
"<b>&lt;PA&gt;file*:<i>name_of_file</i>&lt;/PA&gt;</b>": in this case, this string is replaced by all the lines of the given file, separated by a dash ('-') character.
</small></td>
</tr>
<tr>
<td valign="top"><small><b>rnformat</b></small></td>
<td><small>
This is the format used by the program to create the reference. The program computes the value of the
parameter and appends a "-" followed by the current value of the counter increased by 1.<br/>
The value of this parameter may contain one of:<br/>
"<b>&lt;PA&gt;categ&lt;/PA&gt;</b>": in this case this string is replaced with the content of the file [altrnin]<br/>
"<b>&lt;PA&gt;yy&lt;/PA&gt;</b>": in this case this string is replaced by the current year (4 digits) if [altyeargen]
is set to "AUTO", or by the content of the [altyeargen] file in any other case. (this content should be formatted
as a date (dd/mm/yyyy).
<br/>
"<b>&lt;PA&gt;file:<i>name_of_file</i>&lt;/PA&gt;</b>": in this case, this string is replaced by the first line of the given file<br />
"<b>&lt;PA&gt;file*:<i>name_of_file</i>&lt;/PA&gt;</b>": in this case, this string is replaced by all the lines of the given file, separated by a dash ('-') character.
</small></td>
</tr>
<tr>
<td valign="top"><small><b>rnin</b></small></td>
<td><small>
This parameter contains the name of the file in which the program will find the category if needed. The content
of thif file will then replace the string &lt;PA&gt;categ&lt;/PA&gt; in the reference format or in the counter
path.
</small></td>
</tr>
<tr>
<td valign="top"><small><b>yeargen</b></small></td>
<td><small>
This parameter can be one of:<br/>
"<b>AUTO</b>": in this case the program takes the current 4 digit year.<br/>
"<b>&lt;filename&gt;</b>": in this case the program extract the year from the file which name is
&lt;filename&gt;. This file should contain a date (dd/mm/yyyy).
</small></td>
</tr>
<tr>
<td valign="top"><small><b>edsrn</b></small></td>
<td><small>
Name of the file in which the created reference will be stored.
</small></td>
</tr>
</TABLE>
<br/><br/><a name="Send_Approval_Request">
<table border="1" width="80%">
<tr><td colspan="2" bgcolor="#ddddff"><small><b>Send_Approval_Request</b></small></td></tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>description</small></td></tr>
<tr>
<td colspan="2">
<small>
This function sends an email to the referee in order to start the simple approval process.<br/>
This function is very CERN-specific and should be changed in case of external use.<br/>
Must be called after the <a href=#Get_Report_Number>Get_Report_Number</a> function.
</small>
</td>
</tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>parameters</small></td></tr>
<tr>
<td valign="top"><small><b>addressesDAM</b></small></td>
<td><small>
email addresses of the people who will receive this email (comma separated list). this parameter may contain the <b>&lt;CATEG&gt;</b> string. In which case the variable computed from the [categformatDAM] parameter replaces this string.<br/>
eg.: "&lt;CATEG&gt;-email@cern.ch"
</small></td>
</tr>
<tr>
<td valign="top"><small><b>categformatDAM</b></small></td>
<td><small>
contains a regular expression used to compute the category of the document given the reference of the document.<br/>
eg.: if [categformatAFP]="TEST-&lt;CATEG&gt;-.*" and the reference of the document is "TEST-CATEGORY1-2001-001", then the computed category equals "CATEGORY1"
</small></td>
</tr>
<tr>
<td valign="top"><small><b>authorfile</b></small></td>
<td><small>
name of the file in which the authors are stored
</small></td>
</tr>
<tr>
<td valign="top"><small><b>titlefile</b></small></td>
<td><small>
name of the file in which the title is stored.
</small></td>
</tr>
<tr>
<td valign="top"><small><b>directory</b></small></td>
<td><small>
parameter used to create the URL to access the files.
</small></td>
</tr>
</TABLE>
<br/><br/><a name="Send_APP_Mail">
<table border="1" width="80%">
<tr><td colspan="2" bgcolor="#ddddff"><small><b>Send_APP_Mail</b></small></td></tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>description</small></td></tr>
<tr>
<td colspan="2">
<small>
Sends an email to warn people that a document has been approved.
</small>
</td>
</tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>parameters</small></td></tr>
<tr>
<td valign="top"><small><b>addressesAPP</b></small></td>
<td><small>
email addresses of the people who will receive this email (comma separated list). this parameter may contain
the <b>&lt;CATEG&gt;</b> string. In which case the variable computed from the [categformatAFP] parameter
replaces this string.<br/>
eg.: "&lt;CATEG&gt;-email@cern.ch"
</small></td>
</tr>
<tr>
<td valign="top"><small><b>categformatAPP</b></small></td>
<td><small>
contains a regular expression used to compute the category of the document given the reference of the
document.<br/>
eg.: if [categformatAFP]="TEST-&lt;CATEG&gt;-.*" and the reference of the document is
"TEST-CATEGORY1-2001-001", then the computed category equals "CATEGORY1"
</small></td>
</tr>
<tr>
<td valign="top"><small><b>newrnin</b></small></td>
<td><small>
Name of the file containing the 2nd reference of the approved document (if any).
</small></td>
</tr>
<tr>
<td valign="top"><small><b>edsrn</b></small></td>
<td><small>
Name of the file containing the reference of the approved document.
</small></td>
</tr>
</TABLE>
<br/><br/><a name="Send_Modify_Mail">
<table border="1" width="80%">
<tr><td colspan="2" bgcolor="#ddddff"><small><b>Send_Modify_Mail</b></small></td></tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>description</small></td></tr>
<tr>
<td colspan="2">
<small>
This function sends an email to warn people a document has been modified and the user his modifications
have been taken into account..
</small>
</td>
</tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>parameters</small></td></tr>
<tr>
<td valign="top"><small><b>addressesMBI</b></small></td>
<td><small>
email addresses of the people who will receive this email (comma separated list).
</small></td>
</tr>
<tr>
<td valign="top"><small><b>fieldnameMBI</b></small></td>
<td><small>
name of the file containing the modified fields.
</small></td>
</tr>
<tr>
<td valign="top"><small><b>sourceDoc</b></small></td>
<td><small>
Long name for the type of document. This name will be displayed in the mail.
</small></td>
</tr>
<tr>
<td valign="top"><small><b>emailfile</b></small></td>
<td><small>
name of the file in which the email of the modifier will be found.
</small></td>
</tr>
</TABLE>
<br/><br/><a name="Send_SRV_Mail">
<table border="1" width="80%">
<tr><td colspan="2" bgcolor="#ddddff"><small><b>Send_SRV_Mail</b></small></td></tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>description</small></td></tr>
<tr>
<td colspan="2">
<small>
This function sends an email to warn people a revision has been carried out.
</small>
</td>
</tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>parameters</small></td></tr>
<tr>
<td valign="top"><small><b>notefile</b></small></td>
<td><small>
name of the file in which the note can be found
</small></td>
</tr>
<tr>
<td valign="top"><small><b>emailfile</b></small></td>
<td><small>
name of the file containing the submitter's email
</small></td>
</tr>
<tr>
<td valign="top"><small><b>addressesSRV</b></small></td>
<td><small>
email addresses of the people who will receive this email (comma separated list). this parameter may contain the <b>&lt;CATEG&gt;</b> string. In which case the variable computed from the [categformatDAM] parameter replaces this string.<br/>
eg.: "&lt;CATEG&gt;-email@cern.ch"
</small></td>
</tr>
<tr>
<td valign="top"><small><b>categformatDAM</b></small></td>
<td><small>
contains a regular expression used to compute the category of the document given the reference of the
document.<br/>
eg.: if [categformatAFP]="TEST-&lt;CATEG&gt;-.*" and the reference of the document is
"TEST-CATEGORY1-2001-001", then the computed category equals "CATEGORY1"
</small></td>
</tr>
</TABLE>
<br/><br/><a name="Test_Status">
<table border="1" width="80%">
<tr><td colspan="2" bgcolor="#ddddff"><small><b>Test_Status</b></small></td></tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>description</small></td></tr>
<tr>
<td colspan="2">
<small>
This function checks whether the considered document has been requested for approval and is still waiting
for approval. It also checks whether the password stored in file "password" of the submission directory
corresponds to the password associated with the document..
</small>
</td>
</tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>parameters</small></td></tr>
<tr>
<td valign="top" colspan="2"><small><b>none</b></small></td>
</tr>
</TABLE>
<br/><br/><a name="Update_Approval_DB">
<table border="1" width="80%">
<tr><td colspan="2" bgcolor="#ddddff"><small><b>Update_Approval_DB</b></small></td></tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>description</small></td></tr>
<tr>
<td colspan="2">
<small>
This function updates the approval database when a document has just been approved or rejected. It uses
the [categformatDAM] parameter to compute the category of the document.<br/>
Must be called after the <a href=#Get_Report_Number>Get_Report_Number</a> function.
</small>
</td>
</tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>parameters</small></td></tr>
<tr>
<td valign="top"><small><b>categformatDAM</b></small></td>
<td><small>
It contains the regular expression which allows the retrieval of the category from the reference number.<br/>
Eg: if [categformatDAM]="TEST-&lt;CATEG&gt;-.*" and the reference is "TEST-CATEG1-2001-001" then the
category will be recognized as "CATEG1".
</small></td>
</tr>
</TABLE>
<br/><br/><a name="Upload_Files">
<table border="1" width="80%">
<tr><td colspan="2" bgcolor="#ddddff"><small><b>Upload_Files</b></small></td></tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>description</small></td></tr>
<tr>
<td colspan="2">
<small>
This function displays the list of already transfered files (main and additional ones), and also outputs an html
form for uploading other files (pictures or fulltexts).
</small>
</td>
</tr>
<tr><td colspan="2" bgcolor="#eeeeff" align="center"><small>parameters</small></td></tr>
<tr>
<td valign="top"><small><b>maxsize</b></small></td>
<td><small>
Maximum allowed size for the transfered files (size in bits)
</small></td>
</tr>
<tr>
<td valign="top"><small><b>minsize</b></small></td>
<td><small>
Minimum allowed size for the transfered files (size in bits)
</small></td>
</tr>
<tr>
<td valign="top"><small><b>iconsize</b></small></td>
<td><small>
In case the transfered files are pictures (jpg, gif or pdf), the function will automatically try to create icons from them.
This parameter indicates the size in pixel of the created icon.
</small></td>
</tr>
<tr>
<td valign="top"><small><b>type</b></small></td>
<td><small>
This can be one of "fulltext" or "picture". If the type is set to "picture" then the function will try to create icons
(uses the ImageMagick's "convert" tool)
</small></td>
</tr>
</TABLE>
<h3>See also:</h3>
<blockquote>
<li><a href="#functionnew">create a new function</a><br/>
<li><a href="#functiondelete">delete a function</a><br/>
<li><a href="#functionedit">edit a function</a><br/>
</blockquote>
<p>&nbsp;<p>
<p>&nbsp;<p>
<a name="protection"></a>
<h1>Protection and Restriction</h1>
<h3>Description:</h3>
<blockquote>
&nbsp;<span class="guideheader">I</span>n webSubmit, you can restrict the use of some actions on a given
document type to a list of users. You can use the <a href="webaccess-admin">webAccess</a>
manager for this.<br/><br/>
&nbsp;<span class="guideheader">L</span>et's say you want to restrict the submission of new TEXT documents
to a given user. You should then create a role in webAccess which will authorize the action "submit" over doctype
"TEXT" and act "SBI" (Submit new record). You can call this role "submitter_TEXT_SBI" for example.
Then link the role to the proper users.<br/>
&nbsp;<span class="guideheader">A</span>nother example: if you wish to authorize a user to Modify the
bibliographic data of PICT documents, you have to create a role which authorize the action "submit" over doctype
"PICT" and act "MBI". This role can be called "submitter_PICT_MBI" or whatever you want.<br/><br/>
&nbsp;<span class="guideheader">I</span>f no role is defined for a given action and a given document type,
then all users will be allowed to use it.
</blockquote>
<p>&nbsp;<p>
<p>&nbsp;<p>
<a name="catalogues"></a>
<h1>Submission Catalogue Organisation</h1>
<h3>What is it?</h3>
<blockquote>
&nbsp;<span class="guideheader">T</span>his feature allows you to organise the way webSubmit main page
will look like. You will be able to group document types inside catalogues and order the catalogues the way you
wish.
</blockquote>
<h3>How to get there?</h3>
<blockquote>
&nbsp;<span class="guideheader">C</span>lick on the "Organisation" link in the websubmit admin right menu.
</blockquote>
<h3>How to do this?</h3>
<blockquote>
&nbsp;<span class="guideheader">O</span>nce on the "Edit Catalogues page", you will find the currently
defined organisation chart in the middle of the page. To the right, one form allows you to create a new catalogue
("Add a Catalogue") and one to add a document type to an existing catalogue ("Add a document type").
<br/>&nbsp;<br/>
<ul>
<li><font color=green>To add a catalogue:</font> Enter the name of your new catalogue in the
"Catalogue Name" free text field then choose to which existing catalogue this one will be attached to. If you
attach the new one to an already existing catalogue, you can create a sub-catalogue. To actually create it,
click on "ADD".
<li><font color=green>To add a document type to a catalogue:</font> Choose in the list of existing
"Document type names" the one you want to add to the chart. Then choose to which catalogue the document
type will be associated. Click on "ADD" to finalise this action.
<li><font color=green>To withdraw a document type or a catalogue from the chart:</font> Click on the
red cross next to the item you want to withdraw. If you withdraw a catalogue all document types attached to
it will be withdrawn also (of course the actual document types in webSubmit won't be destroyed!).
<li><font color=green>To move a document type or a catalogue in the chart:</font> Use the small up
and down arrows next to the document type/catalogue title.
</ul>
</blockquote>
<h3>See also:</h3>
<blockquote>
<li><a href="#newtype">Create a New Document Type</a><br/>
<li><a href="#documents">document types</a><br/>
</blockquote>
<p>&nbsp;<p>
<p>&nbsp;<p>
<a name="bibconvert"></a>
<h1>BibConvert</h1>
<h3>What is it?</h3>
<blockquote>
&nbsp;<span class="guideheader">W</span>ebSubmit stores the data gathered during a submission in a
directory. In this directory each file corresponds to a field saved during the submission. <br/>
&nbsp;<span class="guideheader">B</span>ibConvert is used to create a formatted file which will be easy to
upload in the bibliographical database from this directory.<br/>
&nbsp;<span class="guideheader">T</span>his BibConvert program is called from the
<a href="#Make_Record">Make_Record</a> and
<a href="#Make_Modify_Record">Make_Modify_Record</a> functions
from the <a href="#functions">end script</a> system of webSubmit.<br/>
&nbsp;<span class="guideheader">T</span>he BibConvert configuration files used by webSubmit are in the
<ETCDIR>/bibconvert/config directory.<br/><br/>
&nbsp;<span class="guideheader">F</span>or more info about bibconvert, please see the dedicated
<a href="bibconvert-admin-guide">guide</a>.
</blockquote>
<p>&nbsp;<p>
<p>&nbsp;<p>
<a name="faq"></a>
<h1>FAQ</h1>
&nbsp;<span class="guideheader">Q</span>1. <a href="#Q1">I'd like to be warned each time there is an error, or an important
action is made through the manager. Is this possible?
</a><br/>
&nbsp;<span class="guideheader">Q</span>2. <a href="#Q2">Where are all the files stored in this system?
</a><br/>
&nbsp;<span class="guideheader">Q</span>3. <a href="#Q3">How is the documents archive organised?
</a><br/><br/><br/><br/>
<a name="Q1"></a>
<i>&nbsp;<span class="guideheader">Q</span>1. I'd like to be warned each time there is an error, or an important
action is made through the manager. Is this possible?
</i>
<blockquote>
Yes, it is. Edit the invenio-local.conf file, the "CFG_SITE_ADMIN_EMAIL" definition and set it to your email
address. You will then receive all the warning emails issued by the manager.
</blockquote>
<a name="Q2"></a>
<i>&nbsp;<span class="guideheader">Q</span>2. Where are all the files stored in this system?
</i>
<blockquote>
<li>the counter files are here: /opt/invenio/var/data/submit/counters. There are used by the
<a href="#Report_Number_Generation">Report_Number_Generation</a>
function.
<li>all running and completed submissions are stored here: /opt/invenio/var/data/submit/storage.
<li>all the document files attached to records are stored here: /opt/invenio/var/data/files.
<li>all python functions used by webSubmit are stored here: /opt/invenio/lib/python/invenio/websubmit_functions
</blockquote>
<a name="Q3"></a>
<i>&nbsp;<span class="guideheader">Q</span>3. How is the documents archive organised?
</i>
<blockquote>
First of all, the documents files attached to records are stored here: /opt/invenio/var/data/files. <br/><br/>
The <a href="#Upload_Files">Upload_Files</a> webSubmit function is used
to link a document with a record.<br/><br/>
All documents get an id from the system and are stored in the "bibdoc" table in the database. The link between a
document and a record is stored using the "bibdoc_bibrec" table.<br/><br/>
The document id is used to determine where the files are stored. For example the files of document #14 will be
stored here: /opt/invenio/var/data/files/g0/14<br/><br/>
The subdirectory g0 is used to split the documents accross the filesystem. The CFG_FILE_DIR_SIZE variable from
invenio.conf determines how many documents will be stored under one subdirectory.<br/><br/>
Several files may be stored under the same document directory: they are the different formats and versions of the
same document. Versions are indicated by a string of the form ";1.0" concatenated to the name of the file.<br/><br/>
Please see the <href="/help/admin/howto-fulltext">HOWTO Manage Fulltext Files</a> for more information on the administrative command line tools available to manipulate fulltext files.
</blockquote>
<h3>See also:</h3>
<blockquote>
notes
</blockquote>
</div>

Event Timeline