Difference between revisions of "MultiLang Fields Bazaar Package"

From EPrints Documentation
Jump to: navigation, search
(Editing the workflow)
Line 27: Line 27:
 
</source>
 
</source>
  
As can be seen, the default lookup script is replaced by the plugin's lookup script ('''ml_title_duplicates''') which supports the new '''ml_'''fields.
+
As can be seen, the default lookup script is replaced by the plugin's lookup script ('''ml_title_duplicates''') which supports the new '''ml_'''fields. Once the workflow has changed, the repository needs to be reloaded for the changes to take effect:
 +
 
 +
<source>
 +
./epadmin reload reponame
 +
</source>
 +
 
 +
== How the plugin works ==
 +
Basically, what the plugin does is that it replaces EPrints default '''title''' and '''abstract''' fields with two new fields that support multiple languages. The procedure that we followed in order to achieve this functionality was the following:
 +
 
 +
* We introduced a new fileld's type, '''virtualwithvalue''', that would allow our fields to override EPrints fields' default behaviour.
 +
* We introduced our new fields' names, types and functionality to EPrints via a configuration file located in '''~eprints/archives/<reponame>/cfg/cfg.d/'''
 +
* We updated EPrints' database to include the new fields. This was achieved by running:
 +
<source> ./bin/padmin update reponame</source>
 +
as user eprints from within his working directory.
 +
* We added the appropriate phrases in each language's phrase file.
 +
*

Revision as of 12:50, 6 June 2016


The MultiLang plugins introduces multiple language support in EPrints fields. The specific plugin replaces the title and abstract fields with their multilingual version (ml_title and ml_abstract respectively). The wiki-page that explains how one can add custom multilang-fields in EPrints -which basically explains how this plugin was created- is Adding multilang fields.

Installation Prerequisites

None.

Installation

Install through the EPrints Bazaar.

How to use the plugin

Once the plugin has been installed, the user needs to edit the workflow to contain the multilingual fields' versions instead of the default ones. This procedure is explained in MultiLang Fields Bazaar Package#How_the_plugin_works section.


Editing the workflow

In order for the plugin to be usable, the default field versions need to be commented out and the new multilingual ones need to be added. So, ~eprints/archives/reponame/cfg/workflows/eprint/default.xml has to be edited as follows:

<!--    
    <component><field ref="title" required="yes" input_lookup_url="{$config{rel_cgipath}}/users/lookup/title_duplicates" input_lookup_params="id={eprintid}&amp;dataset=eprint&amp;field=title" /></component>
    <component><field ref="abstract"/></component>
-->
 
    <component><field ref="ml_title" required="yes" input_lookup_url="{$config{rel_cgipath}}/users/lookup/<component><field ref="abstract"/></component> -->" input_lookup_params="id={eprintid}&amp;dataset=eprint&amp;field=ml_title"/></component>  
    <component><field ref="ml_abstract"/></component>

As can be seen, the default lookup script is replaced by the plugin's lookup script (ml_title_duplicates) which supports the new ml_fields. Once the workflow has changed, the repository needs to be reloaded for the changes to take effect:

Invalid language.

You need to specify a language like this: <source lang="html4strict">...</source>

Supported languages for syntax highlighting:

4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript, actionscript3, ada, algol68, apache, applescript, apt_sources, arm, asm, asp, asymptote, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_loadrunner, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, coffeescript, cpp, cpp-qt, csharp, css, cuesheet, d, dcl, dcpu16, dcs, delphi, diff, div, dos, dot, e, ecmascript, eiffel, email, epc, erlang, euphoria, f1, falcon, fo, fortran, freebasic, freeswitch, fsharp, gambas, gdb, genero, genie, gettext, glsl, gml, gnuplot, go, groovy, gwbasic, haskell, haxe, hicest, hq9plus, html4strict, html5, icon, idl, ini, inno, intercal, io, j, java, java5, javascript, jquery, kixtart, klonec, klonecpp, latex, lb, ldif, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, mmix, modula2, modula3, mpasm, mxml, mysql, nagios, netrexx, newlisp, nsis, oberon2, objc, objeck, ocaml, ocaml-brief, octave, oobas, oorexx, oracle11, oracle8, oxygene, oz, parasail, parigp, pascal, pcre, per, perl, perl6, pf, php, php-brief, pic16, pike, pixelbender, pli, plsql, postgresql, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, pys60, python, q, qbasic, rails, rebol, reg, rexx, robots, rpmspec, rsplus, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, spark, sparql, sql, stonescript, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, upc, urbi, uscript, vala, vb, vbnet, vedit, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xbasic, xml, xorg_conf, xpp, yaml, z80, zxbasic


./epadmin reload reponame

How the plugin works

Basically, what the plugin does is that it replaces EPrints default title and abstract fields with two new fields that support multiple languages. The procedure that we followed in order to achieve this functionality was the following:

  • We introduced a new fileld's type, virtualwithvalue, that would allow our fields to override EPrints fields' default behaviour.
  • We introduced our new fields' names, types and functionality to EPrints via a configuration file located in ~eprints/archives/<reponame>/cfg/cfg.d/
  • We updated EPrints' database to include the new fields. This was achieved by running:

Invalid language.

You need to specify a language like this: <source lang="html4strict">...</source>

Supported languages for syntax highlighting:

4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript, actionscript3, ada, algol68, apache, applescript, apt_sources, arm, asm, asp, asymptote, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_loadrunner, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, coffeescript, cpp, cpp-qt, csharp, css, cuesheet, d, dcl, dcpu16, dcs, delphi, diff, div, dos, dot, e, ecmascript, eiffel, email, epc, erlang, euphoria, f1, falcon, fo, fortran, freebasic, freeswitch, fsharp, gambas, gdb, genero, genie, gettext, glsl, gml, gnuplot, go, groovy, gwbasic, haskell, haxe, hicest, hq9plus, html4strict, html5, icon, idl, ini, inno, intercal, io, j, java, java5, javascript, jquery, kixtart, klonec, klonecpp, latex, lb, ldif, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, mmix, modula2, modula3, mpasm, mxml, mysql, nagios, netrexx, newlisp, nsis, oberon2, objc, objeck, ocaml, ocaml-brief, octave, oobas, oorexx, oracle11, oracle8, oxygene, oz, parasail, parigp, pascal, pcre, per, perl, perl6, pf, php, php-brief, pic16, pike, pixelbender, pli, plsql, postgresql, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, pys60, python, q, qbasic, rails, rebol, reg, rexx, robots, rpmspec, rsplus, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, spark, sparql, sql, stonescript, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, upc, urbi, uscript, vala, vb, vbnet, vedit, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xbasic, xml, xorg_conf, xpp, yaml, z80, zxbasic


 ./bin/padmin update reponame

as user eprints from within his working directory.

  • We added the appropriate phrases in each language's phrase file.