Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F91367548
functionnew.html.wml
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Nov 10, 10:03
Size
3 KB
Mime Type
text/x-c
Expires
Tue, Nov 12, 10:03 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22251354
Attached To
R3600 invenio-infoscience
functionnew.html.wml
View Options
## $Id$
## This file is part of the CERN Document Server Software (CDSware).
## Copyright (C) 2002, 2003, 2004, 2005 CERN.
##
## The CDSware 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.
##
## The CDSware 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 CDSware; if not, write to the Free Software Foundation, Inc.,
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
#include "configbis.wml"
#include "cdspage.wml" \
title="Create a new function" \
navtrail_previous_links="<a class=navtrail href=<WEBURL>/admin/<lang:star: index.*.html>>_(Admin Area)_</a> > <a class=navtrail href=<WEBURL>/admin/websubmit/>_(WebSubmit Administration)_</a> > <a class=navtrail href=<lang:star: index.*.html>>_(Guide)_</a>" \
navbar_name="admin" \
navbar_select="websubmit-admin-guide"
<h3>How to get there?</h3>
<BLOCKQUOTE>
<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>
<span class="guideheader">E</span>nter the name of the new function as well as a text description if
you wish.<br>
<span class="guideheader">Y</span>ou will then reach a page where you can add parameters to your
new function.<br><br>
<span class="guideheader">D</span>on't forget to add the function file inside the
<LIBDIR>/python/cdsware/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>
<LIBDIR>/python/cdsware/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.<lang:star: *>.html">edit a function</A><BR>
<li><A HREF="functiondelete.<lang:star: *>.html">delete a function</A><BR>
</BLOCKQUOTE>
Event Timeline
Log In to Comment