[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[EP-tech] Alternative text in phrase file



Hi,

I?ll dive into this in 2 days; I will contact you directly (Adam). I should create some help text in the workflow and put my comments in <epc:comment> (good catch, I have some retrospective work to do?).

Regards,

Pierre Nault


De : eprints-tech-bounces at ecs.soton.ac.uk [mailto:eprints-tech-bounces at ecs.soton.ac.uk] De la part de John Salter
Envoy? : 27 f?vrier 2017 05:32
? : eprints-tech at ecs.soton.ac.uk
Objet : Re: [EP-tech] Alternative text in phrase file

This might also be worthwhile noting:
https://wiki.eprints.org/w/EPrints_Control_Format#epc:comment

Normal xml comments in e.g. citation files will end up in the rendered html.
Using an epc:comment block prevents this - so you might want to change this:
<!-- .20170224.pn ->
To
<epc:comment> .20170224.pn </epc:comment>
or
<epc:comment><!-- .20170224.pn --></epc:comment>
-I prefer the latter. If you're using an editor that colours the source code, the comment appears in the same colour as other XML comments (as it is one, as well an an epc:comment!)

Cheers,
John

From: eprints-tech-bounces at ecs.soton.ac.uk<mailto:eprints-tech-bounces at ecs.soton.ac.uk> [mailto:eprints-tech-bounces at ecs.soton.ac.uk] On Behalf Of Adam Field
Sent: 27 February 2017 09:54
To: eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>
Subject: Re: [EP-tech] Alternative text in phrase file

Nice!  So, how about updating the wiki with your newly acquired expertise?  One of these seem like candidates for a section on conditional fieldname rendering:

http://wiki.eprints.org/w/Phrase_Format
https://wiki.eprints.org/w/Citation_Format

?also, I would suggest that you create two phrases for the helptext for this field in the workflow and do the same there so that your data input is covered (that?s the use-case that I remember this technique from).

Feel free to email me directly if you want me to proof-read your documentation.


[isc]<http://www.jisc.ac.uk/>

Adam Field
SHERPA services analyst developer



From: <eprints-tech-bounces at ecs.soton.ac.uk<mailto:eprints-tech-bounces at ecs.soton.ac.uk>> on behalf of "Nault, Pierre" <nault.pierre at uqam.ca<mailto:nault.pierre at uqam.ca>>
Reply-To: "eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>" <eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>>
Date: Friday, 24 February 2017 16:33
To: "'eprints-tech at ecs.soton.ac.uk'" <eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>>
Subject: Re: [EP-tech] Alternative text in phrase file

Find it!

I thought it was possible to use epc in phrase files because of this https://wiki.eprints.org/w/Phrase_Format and the namespace :
?EPrints Control Format<https://wiki.eprints.org/w/EPrints_Control_Format> elements may be used inside the phrase file - in this example a pin is used within the phrase, which is supplied when the phrase is rendered?

But Adam give me the idea of:

In zzzzz.xml:

<epp:phrase id="eprint_fieldname_official_url.masterthesis">Document d'accompagnement</epp:phrase>
<epp:phrase id="eprint_fieldname_official_url.other">Adresse URL</epp:phrase>

And in summary.xml:

  <epc:if test="official_url">
    <div style="margin-bottom: 1em">
                               <!-- .20170224.pn -> <epc:phrase ref="eprint_fieldname_official_url"/>: <epc:print expr="official_url" /> -->
                               <epc:choose>
                                                 <epc:when test="type.one_of( 'master','thesis')">
                                                               <epc:phrase ref="eprint_fieldname_official_url.masterthesis"/>: <epc:print expr="official_url" />
                                                 </epc:when>
                                                 <epc:otherwise>
                                                               <epc:phrase ref="eprint_fieldname_official_url.other"/>: <epc:print expr="official_url" />
                                                 </epc:otherwise>
                               </epc:choose>
    </div>
  </epc:if>


And it works.

Thanks a lot,

Pierre Nault



De : eprints-tech-bounces at ecs.soton.ac.uk<mailto:eprints-tech-bounces at ecs.soton.ac.uk> [mailto:eprints-tech-bounces at ecs.soton.ac.uk] De la part de John Salter
Envoy? : 24 f?vrier 2017 09:38
? : eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>
Objet : Re: [EP-tech] Alternative text in phrase file

I was just pondering whether this would actually work?

<epc: > is a declared namespace in phrase files - but by inspection, this is used for pins, values and other phrases, not the logical tests.
I'm not sure you'd get the eprint passed to the phrase to be able to test anything on it.

Cheers,
John

PS and I didn't read the stipulation about eprint types - you know what you're doing there it seems! Sorry!

From: eprints-tech-bounces at ecs.soton.ac.uk<mailto:eprints-tech-bounces at ecs.soton.ac.uk> [mailto:eprints-tech-bounces at ecs.soton.ac.uk] On Behalf Of Adam Field
Sent: 24 February 2017 14:26
To: eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>
Subject: Re: [EP-tech] Alternative text in phrase file

I didn?t know you could use conditionals inside phrases.  You can in templates.  That might be the way to go.  I have a memory of setting up phrases like this:

<epp:phrase_id=?eprint_fieldname_official_url.masters?>sdfsdf</epp:phrase>

and then selecting it with a conditional in the appropriate template.


[sc]<http://www.jisc.ac.uk/>

Adam Field
SHERPA services analyst developer



From: <eprints-tech-bounces at ecs.soton.ac.uk<mailto:eprints-tech-bounces at ecs.soton.ac.uk>> on behalf of John Salter <J.Salter at leeds.ac.uk<mailto:J.Salter at leeds.ac.uk>>
Reply-To: "eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>" <eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>>
Date: Friday, 24 February 2017 14:04
To: "eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>" <eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>>
Subject: Re: [EP-tech] Alternative text in phrase file

Hi,
I think you need to have the phrase defined, and the logic inside that:
You're also testing 'type' - which is normally 'article', 'thesis', 'book_chapter'? The field you might want to test it 'thesis_type'?

[This is untested!]
<epp:phrase id="eprint_fieldname_official_url">
  <epc:choose>
    <epc:when test="thesis_type='master'">Adresse master</epc:when>
    <epc:when test="thesis_type='thesis'">Adresse these</epc:when>
    <epc:otherwise>Adresse URL</epc:otherwise>
  </epc:choose>
</epp:phrase>

Cheers,
John

From: eprints-tech-bounces at ecs.soton.ac.uk<mailto:eprints-tech-bounces at ecs.soton.ac.uk> [mailto:eprints-tech-bounces at ecs.soton.ac.uk] On Behalf Of Nault, Pierre
Sent: 24 February 2017 13:52
To: 'eprints-tech at ecs.soton.ac.uk' <eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>>
Subject: [EP-tech] Alternative text in phrase file

Hi,

                We want to display a different label in the eprint rendering page for the field <epp:phrase id="eprint_fieldname_official_url">Adresse URL</epp:phrase> if the eprint type is ?master? or ?thesis?. In zzzzz.xml we have tried with

                <epc:choose>
                               <epc:when test="type='master'">
                                               <epp:phrase id="eprint_fieldname_official_url">Adresse master</epp:phrase>
                               </epc:when>
                               <epc:when test="type='thesis'">
                                               <epp:phrase id="eprint_fieldname_official_url">Adresse these</epp:phrase>
                               </epc:when>
                               <epc:otherwise>
                                               <epp:phrase id="eprint_fieldname_official_url">Adresse URL</epp:phrase>
                               </epc:otherwise>
                </epc:choose>

But this is not working. Any idea why ?

Regards,

Pierre

----------------------------------------
Pierre Nault
Biblioth?caire syst?mes - Direction du d?veloppement technologique
Service des biblioth?ques
Universit? du Qu?bec ? Montr?al
T?l : 514-987-3000 #4554


Jisc is a registered charity (number 1149740) and a company limited by guarantee which is registered in England under Company No. 5747339, VAT No. GB 197 0632 86. Jisc?s registered office is: One Castlepark, Tower Hill, Bristol, BS2 0JA. T 0203 697 5800.

Jisc Services Limited is a wholly owned Jisc subsidiary and a company limited by guarantee which is registered in England under company number 2881024, VAT number GB 197 0632 86. The registered office is: One Castle Park, Tower Hill, Bristol BS2 0JA. T 0203 697 5800.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20170228/b9e7db58/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 1264 bytes
Desc: image001.png
Url : http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20170228/b9e7db58/attachment-0002.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 1265 bytes
Desc: image002.png
Url : http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20170228/b9e7db58/attachment-0003.png