Page 1 of 1

Access to Document Custom Fields

Posted: Thu Jul 17, 2014 12:31 pm
by plonka
Hello,

Does anyone know if I have access to the 'Document Custom Fields'? I would like to read the content of the custom fields in a 'Wiki Content' inside the document or use them in the PDF export header and footer configuration.

Thank you,
Chris

Re: Access to Document Custom Fields

Posted: Fri Jul 18, 2014 8:25 am
by martins

Code: Select all

$document.getCustomField("myCustomField")

Kind regards

Martin

Re: Access to Document Custom Fields

Posted: Fri Jul 18, 2014 8:59 am
by plonka
Thanks, that works perfectly!

Chris

Re: Access to Document Custom Fields

Posted: Thu Feb 12, 2015 8:21 pm
by ffrumento
It works only for the wiki content inside the document, it does''t work inside PDF export template, any idea about how to get the document custom field value inside a PDF export template ?

Re: Access to Document Custom Fields

Posted: Fri Feb 13, 2015 8:31 am
by plonka
I use it also in the export template:

Code: Select all

<td width="40%" align="right" style=";font-size: 10pt !important;">$[documentName]<br/>$[documentCode]</td>


For comparison, in the Wiki:

Code: Select all

  <tr><td align="center" style="; font-size: 14pt;">$document.getCustomField("documentCode")</td></tr>


Christian

Re: Access to Document Custom Fields

Posted: Fri Feb 13, 2015 9:53 am
by ffrumento
I was missing the different syntax, thank you very much !

Re: Access to Document Custom Fields

Posted: Fri Feb 13, 2015 4:15 pm
by ffrumento
How if i need to have a empty footer for the first page ? I've tried the following script but it put the code in the PDF without running it, any advice where to look for documentation of the script language ?

#if($[page] > 1)
<html for normale page>
#else
<nothing>
#end

Re: Access to Document Custom Fields

Posted: Wed Feb 18, 2015 5:20 pm
by smarty
The vocabulary of the Polarion export templates (cf. /polarion/#/project/drivepilot/administration/workitems/exporttemplates)
for formatting the output to PDF is XSL-FO as in W3C's Extensible Stylesheet Language Formatting Objects,
not Velocity macro syntax.

FAQs or tutorials I know of:
XSL-FO FAQ by David Pawson
XSL-FO Usage Sams Teach Yourself XML in 21 Days | InformIT

In order to have a different footer on the first page you would need to create a seperate title page

Re: Access to Document Custom Fields

Posted: Wed Feb 18, 2015 6:34 pm
by ffrumento
Thank you very much for the reply, I'll study it, i thought the learning curve seems steep :(

Re: Access to Document Custom Fields

Posted: Thu Feb 19, 2015 9:47 pm
by pitzalis
In order to have a different PDF first page header and footer, I use these PD4ML tags in my wiki page:

Code: Select all

{show:pdf}
{pre}
<pd4ml:page.header scope='1'> First page HTML header </pd4ml:page.header>
<pd4ml:page.footer scope='1'> First page HTML footer </pd4ml:page.footer>
{/pre}
{show}

Hope this helps.

Bye,
GP

Re: Access to Document Custom Fields

Posted: Fri Feb 20, 2015 5:07 pm
by smarty
pitzalis wrote:In order to have a different PDF first page header and footer, I use these PD4ML tags in my wiki page...

That's interesting. Is it an extension for Polarion?

Regards, Martin

Re: Access to Document Custom Fields

Posted: Fri Feb 20, 2015 8:30 pm
by pitzalis
PD4ML (http://pd4ml.com/) is the engine that Polarion use for Wiki/Document PDF export.