You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Jacques Le Roux (JIRA)" <ji...@apache.org> on 2015/04/18 15:43:59 UTC

[jira] [Comment Edited] (OFBIZ-5441) URLs in PDF files are not handled correctly

    [ https://issues.apache.org/jira/browse/OFBIZ-5441?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13853735#comment-13853735 ] 

Jacques Le Roux edited comment on OFBIZ-5441 at 4/18/15 1:43 PM:
-----------------------------------------------------------------

The problem is more than that, we actually have to handle InvoiceItem.descriptions like

description="Spend more than $100 on your favorite widgets and gizmos and get a free &lt;a href=&quot;/ecommerce/control/product?category_id=20111&amp;amp;product_id=WG-1111&quot;&gt;Micro Chrome Widget&lt;/a&gt;!"

See for instane this one
 <InvoiceItem amount="-59.990" createdStamp="2013-12-19 22:31:11.578" createdTxStamp="2013-12-19 22:31:07.921" description="Spend more than $100 on your favorite widgets and gizmos and get a free &lt;a href=&quot;/ecommerce/control/product?category_id=20111&amp;amp;product_id=WG-1111&quot;&gt;Micro Chrome Widget&lt;/a&gt;!" invoiceId="CI3" invoiceItemSeqId="00006" invoiceItemTypeId="ITM_PROMOTION_ADJ" lastUpdatedStamp="2013-12-19 22:31:11.578" lastUpdatedTxStamp="2013-12-19 22:31:07.921" parentInvoiceId="CI3" parentInvoiceItemSeqId="00005" productId="WG-1111" quantity="1.000000"/>

So, to generate the url inside the generated PDF file, we need to parse the InvoiceItem.description inside invoiceReportItems.fo.ftl.

Also in ProductionRun.fo.ftl (the only place where we currently have a <fo:basic-link external-destination=...>) the external-destinationattribute is wrongly completed. It misses the url('...') part in external-destination=url('...'). And, as you mentionned, the generated url is incomplete. I believe we will need a new transform for URLs in *fo.ftl files.


was (Author: jacques.le.roux):
The problem is more than we actually have to handle InvoiceItem.descriptions like

description="Spend more than $100 on your favorite widgets and gizmos and get a free &lt;a href=&quot;/ecommerce/control/product?category_id=20111&amp;amp;product_id=WG-1111&quot;&gt;Micro Chrome Widget&lt;/a&gt;!"

See for instane this one
 <InvoiceItem amount="-59.990" createdStamp="2013-12-19 22:31:11.578" createdTxStamp="2013-12-19 22:31:07.921" description="Spend more than $100 on your favorite widgets and gizmos and get a free &lt;a href=&quot;/ecommerce/control/product?category_id=20111&amp;amp;product_id=WG-1111&quot;&gt;Micro Chrome Widget&lt;/a&gt;!" invoiceId="CI3" invoiceItemSeqId="00006" invoiceItemTypeId="ITM_PROMOTION_ADJ" lastUpdatedStamp="2013-12-19 22:31:11.578" lastUpdatedTxStamp="2013-12-19 22:31:07.921" parentInvoiceId="CI3" parentInvoiceItemSeqId="00005" productId="WG-1111" quantity="1.000000"/> 
 
So, to generate the url inside the generated PDF file, we need to parse the InvoiceItem.description inside invoiceReportItems.fo.ftl. 
 
Also in ProductionRun.fo.ftl (the only place where we currently have a <fo:basic-link external-destination=...>) the external-destinationattribute is wrongly completed. It misses the url('...') part in external-destination=url('...'). And, as you mentionned, the generated url is incomplete. I believe we will need a new transform for URLs in *fo.ftl files.

> URLs in PDF files are not handled correctly
> -------------------------------------------
>
>                 Key: OFBIZ-5441
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-5441
>             Project: OFBiz
>          Issue Type: Bug
>          Components: accounting
>    Affects Versions: Trunk
>            Reporter: Jacques Le Roux
>            Priority: Minor
>
> When a PDF file contains a reference to a promotion like when you buy a WG-5569 (Tiny Chrome Widget) and get a free WG-1111 (Micro Chrome Widget). You end with a corresponding invoice containing <<Spend more than $100 on your favorite widgets and gizmos and get a free <a href="/ecommerce/control/product?category_id=20111&amp;product_id=WG-1111">Micro Chrome Widget</a>!>> instead of a real link. 
> It's possible to generare a link in a PDF with FOP, we need to
> # dynamically define a fop.base using a ftl transform refs: http://xmlgraphics.apache.org/fop/0.95/configuration.html#general-elements http://xmlgraphics.apache.org/fop/faq.html#MalformedURL
> # here is an example from ProductionRun.fo.ftl
> {code}
> <fo:table-cell padding="2pt">
>     <fo:block><fo:basic-link background-color="lightblue" external-destination="<@o...@ofbizContentUrl>">${uiLabelMap.CommonView}</fo:basic-link></fo:block>
> </fo:table-cell>
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)