Difference between revisions of "Workflow Format"

From EPrints Documentation
Jump to: navigation, search
m
(Conditional Overriding of Field Name and Help)
 
(14 intermediate revisions by 6 users not shown)
Line 1: Line 1:
[http://benevolently.freehostia.com/content/view/milano-crotone/ milano crotone] [http://scaleslea.freewebpage.org/text/directory/super-flora/ super flora] [http://kopapguw.homeblock.com/topic/i-ragazzi/ i ragazzi di saranno famosi 2004] [http://wainfan.t35.com/view/new/metro-laser.htm metro laser] [http://zoelverd.freeweb7.com/description/lib/boow/ boow] [http://failtoexpress.freehostia.com/html/telefono-sirio.htm telefono sirio 187] [http://getm0ney.freewebpage.org/lib/toshiba-lcd/ toshiba lcd tv] [http://getm0ney.freewebpage.org/lib/benny-benasi/ benny benasi california] [http://mcwardlo.t35.com/library/html/video-eva/ video eva henger] [http://mauballe.125mb.com/web/sixt/ sixt] [http://grahrens.125mb.com/view/new/straight-to/ straight to n ont] [http://oedi.freehostia.com/text/directory/www-kiss/ www kiss com] [http://oedi.freehostia.com/text/directory/tocuh/ tocuh] [http://www.freewebtown.com/boogiejames/topic/pantalone-uomo.htm pantalone uomo grigio] [http://licohwar.homeblock.com/library/html/circolo-alleanza/ circolo alleanza nazionale montecitorio] [http://selemku.t35.com/text/directory/ati-radeon.htm ati radeon x600] [http://coarmago.t35.com/content/view/granny-cum/ granny cum] [http://www.freewebtown.com/boogiejames/topic/pitagora-midi.htm pitagora midi] [http://getraylo.freeweb7.com/img/styles/pi-sonyericsson.htm p910i sonyericsson] [http://beshennayabelka.freehostia.com/content/view/fujifilm.htm fujifilm 4800] [http://grahrens.125mb.com/view/new/compta-one/ compta one] [http://www.freewebtown.com/prncessprncipe/library/html/dance-anni.htm dance anni 60] [http://mcwardlo.t35.com/library/html/aldrovandi-ulisse/ aldrovandi, ulisse] [http://kopapguw.homeblock.com/topic/fitofarmaci/ fitofarmaci] [http://selemku.t35.com/text/directory/modellini-aerei.htm modellini aerei] [http://oedi.freehostia.com/text/directory/zeder-film/ zeder film dvd] [http://coarmago.t35.com/content/view/divise-arbitri/ divise arbitri calcio] [http://kopapguw.homeblock.com/topic/falo/ falo] [http://greensticky.freehostia.com/library/html/pasion-de/ pasion de gavilanes fiera inquieta mp3] [http://www.freewebtown.com/starbriteyellow/resources/articles/resorte-com.htm resorte com] [http://mauballe.125mb.com/web/scatole-latta/ scatole latta] [http://getraylo.freeweb7.com/img/styles/reflection-mulan.htm reflection mulan] [http://saline-joy.freehostia.com/web/finanziamento-barcellona.htm finanziamento barcellona pozzo gotto] [http://www.freewebtown.com/starbriteyellow/resources/articles/carta-di.htm carta di credito smarrita] [http://www.freewebtown.com/prncessprncipe/library/html/ricetta-torta.htm ricetta torta semplici] [http://failtoexpress.freehostia.com/html/super-mr.htm super mr corp] [http://greensticky.freehostia.com/library/html/wenzhou/ wenzhou] [http://lorcaxon.homeblock.com/data/dj-verona/ dj verona] [http://wainfan.t35.com/view/new/frammenti-di.htm frammenti di novecento] [http://www.freewebtown.com/prncessprncipe/library/html/copertina-eurodance.htm copertina eurodance 11] [http://lorcaxon.homeblock.com/data/lettini-pali/ lettini pali tommy] [http://huruple.125mb.com/text/directory/samsung-psss/ samsung ps-42s5s] [http://lorcaxon.homeblock.com/data/sesso-e/ sesso e animali] [http://selemku.t35.com/text/directory/ram-pc.htm ram pc2700 corsair] [http://benevolently.freehostia.com/content/view/parco-neve/ parco neve pozza di fassa] [http://selemku.t35.com/text/directory/nextdoornikki.htm nextdoornikki] [http://www.freewebtown.com/prncessprncipe/library/html/kirb.htm kirb] [http://saline-joy.freehostia.com/web/inno-polonia.htm inno polonia] [http://lorcaxon.homeblock.com/data/holux-gr/ holux gr-230 gps] [http://coarmago.t35.com/content/view/canon-laser/ canon laser shot lbp5200] [http://zoelverd.freeweb7.com/description/lib/piccinini/ piccinini] [http://mcwardlo.t35.com/library/html/vestito-maglia/ vestito maglia] [http://www.freewebtown.com/prncessprncipe/library/html/ram-pc.htm ram pc266] [http://gawelzba.t35.com/library/html/dario-baldambembo.htm dario baldambembo] [http://getm0ney.freewebpage.org/lib/www-sexocean/ www sexocean it] [http://beshennayabelka.freehostia.com/content/view/agriturismo-carmagnola.htm agriturismo carmagnola] [http://zoelverd.freeweb7.com/description/lib/italia-sardegna/ italia sardegna vacanze in] [http://boreldar.t35.com/text/directory/carrozzerie.htm carrozzerie] [http://selemku.t35.com/text/directory/lingua-sarda.htm lingua sarda] [http://benevolently.freehostia.com/content/view/henry-kissinger/ henry kissinger] [http://greensticky.freehostia.com/library/html/launeddas/ launeddas] [http://beshennayabelka.freehostia.com/content/view/ventola.htm ventola 4] [http://zoelverd.freeweb7.com/description/lib/time-after/ time after time eva cassidy] [http://grahrens.125mb.com/view/new/tatoo-delfini/ tatoo delfini] [http://beshennayabelka.freehostia.com/content/view/www-start.htm www start earthlink net] [http://www.freewebtown.com/starbriteyellow/resources/articles/telefonia-mobile.htm telefonia mobile cellulare] [http://kopapguw.homeblock.com/topic/playboy-storiche/ playboy storiche] [http://failtoexpress.freehostia.com/html/anna-casini.htm anna casini] [http://getm0ney.freewebpage.org/lib/tu-vou/ tu vou] [http://www.freewebtown.com/boogiejames/topic/standa.htm standa] [http://grahrens.125mb.com/view/new/pele-u/ pele u ciebie] [http://lorcaxon.homeblock.com/data/acer-c/ acer c113] [http://boreldar.t35.com/text/directory/alexsander.htm alexsander] [http://wainfan.t35.com/view/new/giochi-di.htm giochi di anatre] [http://oedi.freehostia.com/text/directory/microsoft-oem/ microsoft oem windows server 2003] [http://huruple.125mb.com/text/directory/lei-prosperosa/ lei prosperosa] [http://mcwardlo.t35.com/library/html/hp-procurve/ hp procurve 2824] [http://getraylo.freeweb7.com/img/styles/milli-dabbraccio.htm milli dabbraccio] [http://grahrens.125mb.com/view/new/konkwista/ konkwista 88] [http://mauballe.125mb.com/web/minneapolis-s/ minneapolis s paolo hotel] [http://mcwardlo.t35.com/library/html/toner-tn/ toner tn 3030] [http://benevolently.freehostia.com/content/view/teac/ teac 500] [http://www.freewebtown.com/starbriteyellow/resources/articles/telefonino-umts.htm telefonino umts 6680] [http://zoelverd.freeweb7.com/description/lib/batteria-canon/ batteria canon nb-1lh] [http://flheddin.125mb.com/content/view/cagliari-genova.htm cagliari genova] [http://beshennayabelka.freehostia.com/content/view/francoe.htm francoe] [http://failtoexpress.freehostia.com/html/assertivo.htm assertivo] [http://www.freewebtown.com/starbriteyellow/resources/articles/x-batteria.htm x-640 batteria samsung batterie] [http://getraylo.freeweb7.com/img/styles/brighton-hotel.htm brighton hotel] [http://saline-joy.freehostia.com/web/erosu.htm erosu] [http://www.freewebtown.com/prncessprncipe/library/html/claude-pinoteau.htm claude pinoteau] [http://boreldar.t35.com/text/directory/schede-madri.htm schede madri asus sli] [http://zoelverd.freeweb7.com/description/lib/bridget-jones/ bridget jones 2] [http://gawelzba.t35.com/library/html/sesta-misura.htm sesta misura] [http://mcwardlo.t35.com/library/html/espansione-di/ espansione di memoria] [http://scaleslea.freewebpage.org/text/directory/mouse-sony/ mouse sony] [http://lorcaxon.homeblock.com/data/she-groove/ she groove coverage] [http://scaleslea.freewebpage.org/text/directory/biondini/ biondini] [http://scaleslea.freewebpage.org/text/directory/tra/ tra] [http://failtoexpress.freehostia.com/html/ramblers.htm ramblers] [http://getm0ney.freewebpage.org/lib/rp-/ rp 109 oregon] [http://getm0ney.freewebpage.org/lib/ricette-x/ ricette x gli sformati] [http://lorcaxon.homeblock.com/data/maiduguri/ maiduguri] [http://www.freewebtown.com/starbriteyellow/resources/articles/televisioni-plasma.htm televisioni plasma] [http://greensticky.freehostia.com/library/html/hp-tablet/ hp tablet pc tc4200] [http://flheddin.125mb.com/content/view/pc-h.htm pc h2210] [http://flheddin.125mb.com/content/view/pianto-antico.htm pianto antico] [http://selemku.t35.com/text/directory/digital-ixus.htm digital ixus 5] [http://getraylo.freeweb7.com/img/styles/figure-sul.htm figure sul natale] [http://greensticky.freehostia.com/library/html/musica-de/ musica de pereo] [http://benevolently.freehostia.com/content/view/dragonstea-din/ dragonstea din te] [http://grahrens.125mb.com/view/new/roma-iasi/ roma iasi biglietti aerei] [http://getraylo.freeweb7.com/img/styles/macchina-fotografica.htm macchina fotografica digitali] [http://selemku.t35.com/text/directory/w-lo.htm w lo spac] [http://getraylo.freeweb7.com/img/styles/calendario-emanuela.htm calendario emanuela arcuri] [http://www.freewebtown.com/starbriteyellow/resources/articles/golf-uno.htm golf. uno sport per la vita] [http://www.freewebtown.com/starbriteyellow/resources/articles/ha-elan.htm ha elan er] [http://selemku.t35.com/text/directory/mobile-hard.htm mobile hard drive] [http://lorcaxon.homeblock.com/data/sony-vaio/ sony vaio vgn b1vp] [http://www.freewebtown.com/prncessprncipe/library/html/schede-video.htm schede video pci express sata] [http://mauballe.125mb.com/web/imparare-l/ imparare l italiano] [http://licohwar.homeblock.com/library/html/blink-/ blink 182 nudi] [http://huruple.125mb.com/text/directory/jvc-grd/ jvc gr-d290] [http://wainfan.t35.com/view/new/raab-fiume.htm raab (fiume)] [http://beshennayabelka.freehostia.com/content/view/chieftains.htm chieftains] [http://coarmago.t35.com/content/view/cavolata/ cavolata] [http://www.freewebtown.com/prncessprncipe/library/html/visitors.htm visitors] [http://grahrens.125mb.com/view/new/di-que/ di que no] [http://www.freewebtown.com/prncessprncipe/library/html/francobolli-aerei.htm francobolli aerei] [http://getm0ney.freewebpage.org/lib/european-securities/ european securities sim spa] [http://www.freewebtown.com/prncessprncipe/library/html/www-porno.htm www porno com ar] [http://selemku.t35.com/text/directory/panasonic-lumix.htm panasonic lumix fz20] [http://licohwar.homeblock.com/library/html/delia-caltanissetta/ delia caltanissetta] [http://flheddin.125mb.com/content/view/mp-the.htm mp3 the ramus] [http://getraylo.freeweb7.com/img/styles/jean-butler.htm jean butler  - lin dunne. dancing on dangerous ground] [http://wainfan.t35.com/view/new/not-now.htm not now darling] [http://wainfan.t35.com/view/new/in-to.htm in to deep] [http://kopapguw.homeblock.com/topic/spider-man/ spider man due] [http://www.freewebtown.com/boogiejames/topic/hotel-nantes.htm hotel nantes] [http://scaleslea.freewebpage.org/text/directory/onda-rock/ onda rock] [http://grahrens.125mb.com/view/new/superstitious/ superstitious] [http://boreldar.t35.com/text/directory/ozaki.htm ozaki 5 1] [http://licohwar.homeblock.com/library/html/marco-milano/ marco milano] [http://gawelzba.t35.com/library/html/convertitore-.htm convertitore 3 gp] [http://saline-joy.freehostia.com/web/la-marchesa.htm la marchesa di o] [http://oedi.freehostia.com/text/directory/www-filcams/ www filcams it] [http://www.freewebtown.com/prncessprncipe/library/html/dibujitos-de.htm dibujitos de amor] [http://mauballe.125mb.com/web/vff/ vf750f] [http://kopapguw.homeblock.com/topic/da-liceale/ da liceale a popstar] [http://www.freewebtown.com/boogiejames/topic/sessofree.htm sessofree] [http://selemku.t35.com/text/directory/florida-cose.htm florida cose fare] [http://boreldar.t35.com/text/directory/la-oreja.htm la oreja] [http://coarmago.t35.com/content/view/giens/ giens] [http://flheddin.125mb.com/content/view/ministro-delle.htm ministro delle politiche agricole umbria] [http://saline-joy.freehostia.com/web/corse-sui.htm corse sui camion] [http://flheddin.125mb.com/content/view/cuneyt-ozgur.htm cuneyt ozgur] [http://kopapguw.homeblock.com/topic/www-lnd/ www lnd it] [http://saline-joy.freehostia.com/web/graffiti-bridge.htm graffiti bridge] [http://getm0ney.freewebpage.org/lib/finepix-f/ finepix f455 silver fujifilm] [http://benevolently.freehostia.com/content/view/uomini-catapulta/ uomini catapulta] [http://gawelzba.t35.com/library/html/troppo-tardi.htm troppo tardi per vivere] [http://getm0ney.freewebpage.org/lib/work-it/ work it out] [http://flheddin.125mb.com/content/view/loba.htm loba] [http://mauballe.125mb.com/web/karata/ karata] [http://saline-joy.freehostia.com/web/la-mano.htm la mano sinistra della violenza dvd] [http://lorcaxon.homeblock.com/data/cresh-bandicoot/ cresh bandicoot] [http://scaleslea.freewebpage.org/text/directory/friulcassa-it/ friulcassa it] [http://lorcaxon.homeblock.com/data/lauraxit/ laurax.it] [http://huruple.125mb.com/text/directory/toyota-rav/ toyota rav 4 usato] [http://saline-joy.freehostia.com/web/tawnee-stonee.htm tawnee stonee] [http://oedi.freehostia.com/text/directory/carmel-ristorante/ carmel ristorante] [http://kopapguw.homeblock.com/topic/www-amerika/ www amerika com] [http://benevolently.freehostia.com/content/view/linksys-wireless/ linksys wireless printserver] [http://coarmago.t35.com/content/view/lampada-nero/ lampada nero] [http://gawelzba.t35.com/library/html/passport-renewal.htm passport renewal] [http://greensticky.freehostia.com/library/html/acer-lmi/ acer 3002lmi] [http://beshennayabelka.freehostia.com/content/view/amstrad-home.htm amstrad home teatre] [http://licohwar.homeblock.com/library/html/hbh/ hbh - 300] [http://beshennayabelka.freehostia.com/content/view/sant-orsola.htm sant orsola bologna] [http://getm0ney.freewebpage.org/lib/equalizzatore-dts/ equalizzatore dts] [http://selemku.t35.com/text/directory/software-copia.htm software copia dvd] [http://gawelzba.t35.com/library/html/cristina-aguilera.htm cristina aguilera immagini] [http://zoelverd.freeweb7.com/description/lib/mustek-video/ mustek video camera] [http://www.freewebtown.com/starbriteyellow/resources/articles/cardiofrequenzimetro-oregon.htm cardiofrequenzimetro oregon scientific] [http://boreldar.t35.com/text/directory/bmx-videos.htm bmx videos com] [http://getm0ney.freewebpage.org/lib/villachiara/ villachiara] [http://grahrens.125mb.com/view/new/gry/ gry] [http://coarmago.t35.com/content/view/paolo-favati/ paolo favati] [http://lorcaxon.homeblock.com/data/capa/ capa] [http://getraylo.freeweb7.com/img/styles/port-arthur.htm port arthur] [http://lorcaxon.homeblock.com/data/video-di/ video di rey mysterio 619] [http://www.freewebtown.com/prncessprncipe/library/html/movie-selen.htm movie selen] [http://beshennayabelka.freehostia.com/content/view/heaven.htm heaven 17] [http://zoelverd.freeweb7.com/description/lib/dragonsta-tei/ dragonsta tei din] [http://saline-joy.freehostia.com/web/frustate.htm frustate] [http://selemku.t35.com/text/directory/ozone-mai.htm ozone mai] [http://scaleslea.freewebpage.org/text/directory/thesis/ thesis 2002] [http://gawelzba.t35.com/library/html/tom-chaplin.htm tom chaplin vocals dei keane] [http://grahrens.125mb.com/view/new/mappa-postazioni/ mappa postazioni fisse autovelox] [http://zoelverd.freeweb7.com/description/lib/peplab/ peplab] {{formats}}
+
{{formats}}
  
  
Line 21: Line 21:
 
   <component><field ref="abstract"/></component>
 
   <component><field ref="abstract"/></component>
 
  </stage>
 
  </stage>
   
+
 
 +
=== Buttons ===
 +
 
 +
By default the "save" and "cancel" buttons appear at the top and bottom of each stage, but you can change this using the "action_buttons" attribute. Values are "top", "bottom" or "both".
 +
 
 +
  <stage name="core" action_buttons="bottom" >
 +
 
 
== Components ==
 
== Components ==
  
Line 32: Line 38:
 
The majority of field-related components in EPrints 3 make use of the field element in their configuration. This provides a reference to a metafield and any attributes which may be relevant to rendering or operation. Several attributes are available to the element:
 
The majority of field-related components in EPrints 3 make use of the field element in their configuration. This provides a reference to a metafield and any attributes which may be relevant to rendering or operation. Several attributes are available to the element:
  
<table border="1">
+
<table border="1" cellspacing='0'>
 
<tr><th>Attribute</th><th>Values</th><th>Description</th></tr>  
 
<tr><th>Attribute</th><th>Values</th><th>Description</th></tr>  
 
<tr><td>ref</td><td>A string</td><td>(required) Refers to the name of the metafield this field represents</td></tr>
 
<tr><td>ref</td><td>A string</td><td>(required) Refers to the name of the metafield this field represents</td></tr>
 
<tr><td>required</td><td>yes/no</td><td>(optional) Whether a value is required in this field before the workflow may complete</td></tr>
 
<tr><td>required</td><td>yes/no</td><td>(optional) Whether a value is required in this field before the workflow may complete</td></tr>
<tr><td>help</td><td>An XHTML block</td><td>(optional) A block of XHTML to be rendered as help for the field</td></tr>
+
<tr><td>&lt;help&gt; (child-node)</td><td>An XHTML block</td><td>(optional) A block of XHTML to be rendered as help for the field</td></tr>
 +
<tr><td>&lt;title&gt; (child-node)</td><td>An XHTML block</td><td>(optional) A block of XHTML to be rendered as the title for the field</td></tr>
 
<tr><td>input_lookup_url</td><td>A URL</td><td>(optional) The location of an auto-lookup URL for the field</td></tr>
 
<tr><td>input_lookup_url</td><td>A URL</td><td>(optional) The location of an auto-lookup URL for the field</td></tr>
<tr><td>input_lookup_params</td><td>A string</td><td>(optional) An
+
<tr><td>input_lookup_params</td><td>A string</td><td>(optional) An &-separated list of parameters (e.g. sort=descending&number=3</td></tr>
 +
<tr><td>top</td><td>A string</td><td>(optional) Only useful on "subject" fields, this overrides the top node of the available subject tree. Useful to force certain records to only select from a sub tree.</td></tr>
 +
<tr><td>options</td><td>A string (comma separated values)</td><td>(optional) On a set (or named set) field this overrides the default options. Useful if you want a certain option to appear or disappear based on other metadata)</td></tr>
 +
<tr><td>input_boxes</td><td>An integer</td><td>(optional) Default number of rows to show by default in a multiple field. Overrides the field property.</td></tr>
 +
<tr><td>input_add_boxes</td><td>An integer</td><td>(optional) Number of rows to add to a multiple field if the "more rows" button is pressed. Zero disables the option to add more rows. Overrides the field setting.</td></tr>
 +
<tr><td>input_ordered</td><td>Boolean</td><td>(optional) 1 or 0. Overrides the field setting. If zero then a multiple field won't have the 1,2,3 on the left and reordering arrows on the right of the input, as ordering is considered irrelevant.</td></tr>
 +
 
 +
</table>
 +
 
 +
==== Examples ====
 +
 
 +
===== Conditional Overriding of Field Name and Help =====
 +
 
 +
Example showing how to override the default 'keywords' field title with the string "Descriptive Labels" and the default help text for the keywords field with an entry from a [[Phrase_Format|phrase]] file for a specific item type.
 +
 
 +
'''N.B.''' the phrase ref can be any text but must match the entry in the phrase file.
 +
 
 +
<field ref="keywords">
 +
    <epc:if test="type='article'">
 +
    <title>Descriptive Labels</title>
 +
    <help><epc:phrase ref="eprint_fieldname_keywords.labels" /></help>
 +
    </epc:if>
 +
</field>
 +
 
 +
=== Field Component ===
 +
 
 +
The default component, this renders the field title, an input box suitable for the field, a star if the field is required, and any help information. A single field element is required:
 +
 
 +
<component><field ref="title" required="yes" /></component>
 +
 
 +
=== Multiple Field Component ===
 +
 
 +
The multiple field component is able to render several fields in a group, such as all fields related to a publication or an event. A title element and a help element may be provided that describe the group itself. One or many field elements are also required.
 +
 
 +
<component type="Field::Multi">
 +
  <title>Event Details</title>
 +
  <help>Enter information about your event here.</help>
 +
  <field ref="event_title"/>
 +
  <field ref="event_type" required="yes" />
 +
  <field ref="event_location"/>
 +
  <field ref="event_dates"/>
 +
</component>
 +
 
 +
=== Subject Component ===
 +
 
 +
The subject component allows for the selection of one or more subjects from a subject tree. In this instance, the field element specifies the subject metafield.
 +
 
 +
<component type="Field::Subject">
 +
  <field ref="subjects" required="yes" />
 +
</component>
 +
 
 +
== Other Components ==
 +
 
 +
=== Upload Component ===
 +
 
 +
The upload component provides an interface for files to be uploaded to EPrints documents, and for new documents to be created/edited. It does not require any elements other than the component tag, but field elements to be rendered for each document may be added as in the example.
 +
 
 +
<component type="Upload">
 +
  <field ref="format" />
 +
  <field ref="formatdesc" />
 +
  <field ref="security" />
 +
  <field ref="license" />
 +
  <field ref="date_embargo" />
 +
</component>
 +
 
 +
=== XHTML Component ===
 +
 
 +
This component inserts any contained nodes into the rendered document. As EPrints Control elements may be used, it is possible to insert phrases into the screen.
 +
 
 +
<component type="XHTML">
 +
  <epc:phrase ref="Plugin/InputForm/Component/Upload:help" />
 +
</component>
 +
 
 +
NOTE: EPrints version up to 3.3.12 produce a <component> element in the html when using this. Please see https://github.com/eprints/eprints/issues/148
 +
 
 +
== Other Component Options ==
 +
 
 +
A component normally is enclosed in a "default" surround, with a pop-up help
 +
icon, and a title bar with the contents in a tinted box. The behaviour of the page around the component can be tweaked in a few ways.
 +
 
 +
=== collapse ===
 +
 
 +
The collapse option to the component defaults to "no" but may be set to "yes. If yes, the entire component is shown, by default, as "rolled up" so it must be clicked to unroll it. This is a good way to indicate that the fields, are not something for most users to worry about. It allows you to make the form less intimidating, while still having many options available for advanced users.
 +
 
 +
<component collapse="yes">
 +
  ...
 +
</component>
 +
 
 +
=== show_help ===
 +
 
 +
The default value is "toggle" but it can be set to "always" or "never".
 +
 
 +
"always" will remove the option to show help, and just always show it. "never" removes the toggle but does not show the help.
 +
 
 +
<component show_help="always">
 +
  ...
 +
</component>
 +
 
 +
=== surround ===
 +
 
 +
This controls the InputForm::Surround plugin used to render the component. The default option paints the standard box. Other options are "None" and "Light".
 +
 
 +
None renders just the contents, and can be useful to combine with type="XHTML" to embed HTML directly into the page.
 +
 
 +
You may add your own Surround plugins if you wish.
 +
 
 +
<component surround="None" type="XHTML">
 +
  ...
 +
</component>

Latest revision as of 11:48, 23 January 2015

EPrints 3 Reference: Directory Structure - Metadata Fields - Repository Configuration - XML Config Files - XML Export Format - EPrints data structure - Core API - Data Objects


XML Configuration: EPScript - Control Format (EPC) - Citation - Workflow - Phrase - Template - XPAGE (static pages)


The EPrints 3 workflow configuration files are stored in the repository's workflows directory, within folders identifying the Data Objects to which they apply (e.g. eprint or user). Multiple workflows may be defined in each folder, although typically only the default.xml file will be necessary.

Structure

At the centre of a workflow is a 'flow' description. This denotes the path through the workflow process from stage to stage. This may contain EPrints Control tags, allowing for the flow to vary depending on parameters of the data object (or other objects). For example, the flow may be different for users with certain roles. The flow is structured like so:

<flow>
  <stage ref="type"/>
  <stage ref="files"/>
  <stage ref="core"/>
  <stage ref="subjects"/>
</flow>

The 'ref' attribute of the stage element refers to the individual stages. The stage elements describe the components within each screen of the process and, like flow, may contain EPrints Control tags. The 'name' attribute of the stage element is identical to that of the stage element in the 'flow' section.

<stage name="core">
  <component><field ref="title" required="yes" /></component>
  <component><field ref="abstract"/></component>
</stage>

Buttons

By default the "save" and "cancel" buttons appear at the top and bottom of each stage, but you can change this using the "action_buttons" attribute. Values are "top", "bottom" or "both".

<stage name="core" action_buttons="bottom" >

Components

An EPrints component is responsible for the rendering of a graphical element in a workflow. This may be a text-box for title entry, a collection of fields in an appropriate grouping, or just a piece of XHTML. Six components are provided by default and, as they are plugins, it is straightforward to drop in new components when necessary. The type attribute of the component element corresponds to the plugin to be used.

Field-Related Components

Field Element

The majority of field-related components in EPrints 3 make use of the field element in their configuration. This provides a reference to a metafield and any attributes which may be relevant to rendering or operation. Several attributes are available to the element:

AttributeValuesDescription
refA string(required) Refers to the name of the metafield this field represents
requiredyes/no(optional) Whether a value is required in this field before the workflow may complete
<help> (child-node)An XHTML block(optional) A block of XHTML to be rendered as help for the field
<title> (child-node)An XHTML block(optional) A block of XHTML to be rendered as the title for the field
input_lookup_urlA URL(optional) The location of an auto-lookup URL for the field
input_lookup_paramsA string(optional) An &-separated list of parameters (e.g. sort=descending&number=3
topA string(optional) Only useful on "subject" fields, this overrides the top node of the available subject tree. Useful to force certain records to only select from a sub tree.
optionsA string (comma separated values)(optional) On a set (or named set) field this overrides the default options. Useful if you want a certain option to appear or disappear based on other metadata)
input_boxesAn integer(optional) Default number of rows to show by default in a multiple field. Overrides the field property.
input_add_boxesAn integer(optional) Number of rows to add to a multiple field if the "more rows" button is pressed. Zero disables the option to add more rows. Overrides the field setting.
input_orderedBoolean(optional) 1 or 0. Overrides the field setting. If zero then a multiple field won't have the 1,2,3 on the left and reordering arrows on the right of the input, as ordering is considered irrelevant.

Examples

Conditional Overriding of Field Name and Help

Example showing how to override the default 'keywords' field title with the string "Descriptive Labels" and the default help text for the keywords field with an entry from a phrase file for a specific item type.

N.B. the phrase ref can be any text but must match the entry in the phrase file.

<field ref="keywords">
   <epc:if test="type='article'">
    <title>Descriptive Labels</title>
    <help><epc:phrase ref="eprint_fieldname_keywords.labels" /></help>
   </epc:if>
</field>

Field Component

The default component, this renders the field title, an input box suitable for the field, a star if the field is required, and any help information. A single field element is required:

<component><field ref="title" required="yes" /></component>

Multiple Field Component

The multiple field component is able to render several fields in a group, such as all fields related to a publication or an event. A title element and a help element may be provided that describe the group itself. One or many field elements are also required.

<component type="Field::Multi">
  <title>Event Details</title>
  <help>Enter information about your event here.</help>
  <field ref="event_title"/>
  <field ref="event_type" required="yes" />
  <field ref="event_location"/>
  <field ref="event_dates"/>
</component>

Subject Component

The subject component allows for the selection of one or more subjects from a subject tree. In this instance, the field element specifies the subject metafield.

<component type="Field::Subject">
  <field ref="subjects" required="yes" />
</component>

Other Components

Upload Component

The upload component provides an interface for files to be uploaded to EPrints documents, and for new documents to be created/edited. It does not require any elements other than the component tag, but field elements to be rendered for each document may be added as in the example.

<component type="Upload">
  <field ref="format" />
  <field ref="formatdesc" />
  <field ref="security" />
  <field ref="license" />
  <field ref="date_embargo" />
</component>

XHTML Component

This component inserts any contained nodes into the rendered document. As EPrints Control elements may be used, it is possible to insert phrases into the screen.

<component type="XHTML">
  <epc:phrase ref="Plugin/InputForm/Component/Upload:help" />
</component>

NOTE: EPrints version up to 3.3.12 produce a <component> element in the html when using this. Please see https://github.com/eprints/eprints/issues/148

Other Component Options

A component normally is enclosed in a "default" surround, with a pop-up help icon, and a title bar with the contents in a tinted box. The behaviour of the page around the component can be tweaked in a few ways.

collapse

The collapse option to the component defaults to "no" but may be set to "yes. If yes, the entire component is shown, by default, as "rolled up" so it must be clicked to unroll it. This is a good way to indicate that the fields, are not something for most users to worry about. It allows you to make the form less intimidating, while still having many options available for advanced users.

<component collapse="yes">
  ...
</component>

show_help

The default value is "toggle" but it can be set to "always" or "never".

"always" will remove the option to show help, and just always show it. "never" removes the toggle but does not show the help.

<component show_help="always">
  ...
</component>

surround

This controls the InputForm::Surround plugin used to render the component. The default option paints the standard box. Other options are "None" and "Light".

None renders just the contents, and can be useful to combine with type="XHTML" to embed HTML directly into the page.

You may add your own Surround plugins if you wish.

<component surround="None" type="XHTML">
  ...
</component>