Hi Johnny,

In data lunedì 11 marzo 2013 15:09:08, Johnny Mariéthoz ha scritto:
> I'm not sure if an icon is attached to a file or to a record. How to attach
> it to a specific file of a record? Is it related to the name of the file?
> When I use FFT using bibupload I can specify $x foreach file no?

OK, that calls for a broad explanation of the BibDocFile architecture. :-)

You should find most of the information in the presentation I made at the last 
workshop:
<http://indico.cern.ch/contributionDisplay.py?contribId=31&sessionId=25&confId=183318>

Summarizing, for you specific case, a record can have zero or more "bibdocs" 
attached. A bibdoc (a.k.a. document) is identified by a “docname” and can be 
instantiated in several revisions, and each revision can come in several 
formats. Formats are identified by the corresponding extension of the file 
(e.g. .pdf, .gif etc). 

Since a format is identified by the extension, it was not possible to a 
documents instantiated e.g. as two different .gif. Therefore, in Invenio we 
have further introduced the concept of “subformat”: (syntactically it is a 
string which is appended as a suffix to the format after a semicolon, e.g. 
“;icon”, “;pdfa”, etc.), which let us expand the possibilities of attaching 
files of identical types (e.g. .gif) but differnt uses (.gif;icon, .gif;high-
res, etc.)

So e.g. an example of record can have two bibdoc "foo" and “bar”, and have 
each one or more revision, and each revisions having a “foo.pdf” file 
attached, a “foo.gif;icon-small” and “foo.gif;icon-large” attached.
(up to the system configuration and workflows to decides which formats and 
subformats do exists).

In FFT (for legacy reason) there is a convention where you can specify in $a a 
file to upload and in $x the corresponding icon/thumbnail.

If you have for example:

$a /tmp/foo.pdf
$x /tmp/bar.gif

what will automatically happen is that a BibDoc identified by the docname 
“foo” is created and attached to the corresponding record, the file “foo.pdf” 
is attached to it, and as well the file “foo.gif;icon”. This happens 
automatically, i.e. only the format of the icon is considered. The name is 
attributed automatically and the default “;icon” is appended.

The above is equivalent to two FFTs

$a /tmp/foo.pdf

and

$a /tmp/bar.gif
$f .gif;icon
$n foo

You can specify a $x per every file you append in FFT. However since a $x is 
implicitly translated in the above couple of FFTs the limitation of the 
format+subformat to be a unique identifier for a file still remains, so you 
should not append more than once the same icon for the same "docname".

Hope this helps!

Cheers!
        Sam
-- 
Samuele Kaplun
Invenio Developer ** <http://invenio-software.org/>

Reply via email to