You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Chris Snow <sn...@snowconsulting.co.uk> on 2009/10/19 01:03:13 UTC

content component question - how to setup download link?

I'm just working my way through the content component and I would like 
to display a link to download a PDF file.  If I setup the DataResource 
and Content as follows, how can I display the content?

      <DataResource
          dataResourceId="DR1105b"
          dataResourceTypeId="OFBIZ_FILE_BIN"
          objectInfo="/applications/content/data/pdftest2.pdf"
          mimeTypeId="application/pdf"
          /> 
 
      <Content
          contentId="CDI1105"
          dataResourceId="DR1105b"
          contentTypeId="DOCUMENT"
          /> 

If the DataResource was ELECTRONIC_TEXT, I could display it in a screen 
like so:

               <widgets>
                   <content content-id="CDI1105" />
               </widgets>

How can I adapt this to work for the PDF download link?

Many thanks in advance,

Chris

Re: content component question - how to setup download link?

Posted by Ruth Hoffman <rh...@aesolves.com>.
Hi Chris:
I'm really curious because I have been writing my own Java events to do 
this for sometime now. The reason I have had to use my own events is 
that the existing services (and there are some that help with this) 
require the user requesting the download have a partyId in the context. 
(Ok, I haven't looked in the last 6 months or so, but last time I did, 
there wasn't anything that supported anonymous downloads). I have cases 
where I want users to download anonymously.

Also, I've never used screen widgets to display or provide download 
content links like you suggest. Maybe its time I updated my 
understanding of screen widgets as this may be a better way to build web 
pages going forward.

Anyhow, I'd be curious to see what you discover.

Regards,
Ruth



Chris Snow wrote:
> Hi Ruth,
>
> I didn't get a chance to look at the download link last night...
>
> However, I'm slowly getting to grips with content management.  I 
> intend to write a howto when I fully understand it.  Alternatively, I 
> could break the howto into smaller chunks as I am learning it?
>
> Cheers,
>
> Chris
>
> Ruth Hoffman wrote:
>> Hi Chris:
>> Have you a satisfactory answer to your question?
>> If so, could you share with us?
>> TIA
>> Ruth
>>
>> Chris Snow wrote:
>>> Thanks Erwan, will take a look tonight...
>>>
>>> Erwan de FERRIERES wrote:
>>>> Hi Chris,
>>>>
>>>> take a look to the ListTaskContent form, in the
>>>> /ofbiz/specialpurpose/projectmgr/widget/forms/TaskForms.xml file. 
>>>> I'm sure you will find what you need in it !
>>>>
>>>> Regards,
>>>>
>>>> Le 19/10/2009 01:03, Chris Snow a écrit :
>>>>> I'm just working my way through the content component and I would 
>>>>> like
>>>>> to display a link to download a PDF file. If I setup the DataResource
>>>>> and Content as follows, how can I display the content?
>>>>>
>>>>> <DataResource
>>>>> dataResourceId="DR1105b"
>>>>> dataResourceTypeId="OFBIZ_FILE_BIN"
>>>>> objectInfo="/applications/content/data/pdftest2.pdf"
>>>>> mimeTypeId="application/pdf"
>>>>> />
>>>>> <Content
>>>>> contentId="CDI1105"
>>>>> dataResourceId="DR1105b"
>>>>> contentTypeId="DOCUMENT"
>>>>> />
>>>>> If the DataResource was ELECTRONIC_TEXT, I could display it in a 
>>>>> screen
>>>>> like so:
>>>>>
>>>>> <widgets>
>>>>> <content content-id="CDI1105" />
>>>>> </widgets>
>>>>>
>>>>> How can I adapt this to work for the PDF download link?
>>>>>
>>>>> Many thanks in advance,
>>>>>
>>>>> Chris
>>>>>
>>>>
>>>
>>>
>>
>
>

Re: content component question - how to setup download link?

Posted by Chris Snow <sn...@snowconsulting.co.uk>.
Hi Ruth,

I didn't get a chance to look at the download link last night...

However, I'm slowly getting to grips with content management.  I intend 
to write a howto when I fully understand it.  Alternatively, I could 
break the howto into smaller chunks as I am learning it?

Cheers,

Chris

Ruth Hoffman wrote:
> Hi Chris:
> Have you a satisfactory answer to your question?
> If so, could you share with us?
> TIA
> Ruth
>
> Chris Snow wrote:
>> Thanks Erwan, will take a look tonight...
>>
>> Erwan de FERRIERES wrote:
>>> Hi Chris,
>>>
>>> take a look to the ListTaskContent form, in the
>>> /ofbiz/specialpurpose/projectmgr/widget/forms/TaskForms.xml file. 
>>> I'm sure you will find what you need in it !
>>>
>>> Regards,
>>>
>>> Le 19/10/2009 01:03, Chris Snow a écrit :
>>>> I'm just working my way through the content component and I would like
>>>> to display a link to download a PDF file. If I setup the DataResource
>>>> and Content as follows, how can I display the content?
>>>>
>>>> <DataResource
>>>> dataResourceId="DR1105b"
>>>> dataResourceTypeId="OFBIZ_FILE_BIN"
>>>> objectInfo="/applications/content/data/pdftest2.pdf"
>>>> mimeTypeId="application/pdf"
>>>> />
>>>> <Content
>>>> contentId="CDI1105"
>>>> dataResourceId="DR1105b"
>>>> contentTypeId="DOCUMENT"
>>>> />
>>>> If the DataResource was ELECTRONIC_TEXT, I could display it in a 
>>>> screen
>>>> like so:
>>>>
>>>> <widgets>
>>>> <content content-id="CDI1105" />
>>>> </widgets>
>>>>
>>>> How can I adapt this to work for the PDF download link?
>>>>
>>>> Many thanks in advance,
>>>>
>>>> Chris
>>>>
>>>
>>
>>
>


-- 
Chris Snow - CEng MBCS CITP MBA (Tech Mgmt) (Open) CISSP

Tel: 01453 890660
Mob: 07944 880950
Www: www.snowconsulting.co.uk


Re: content component question - how to setup download link?

Posted by Ruth Hoffman <rh...@aesolves.com>.
Hi Chris:
Have you a satisfactory answer to your question?
If so, could you share with us?
TIA
Ruth

Chris Snow wrote:
> Thanks Erwan, will take a look tonight...
>
> Erwan de FERRIERES wrote:
>> Hi Chris,
>>
>> take a look to the ListTaskContent form, in the
>> /ofbiz/specialpurpose/projectmgr/widget/forms/TaskForms.xml file. I'm 
>> sure you will find what you need in it !
>>
>> Regards,
>>
>> Le 19/10/2009 01:03, Chris Snow a écrit :
>>> I'm just working my way through the content component and I would like
>>> to display a link to download a PDF file. If I setup the DataResource
>>> and Content as follows, how can I display the content?
>>>
>>> <DataResource
>>> dataResourceId="DR1105b"
>>> dataResourceTypeId="OFBIZ_FILE_BIN"
>>> objectInfo="/applications/content/data/pdftest2.pdf"
>>> mimeTypeId="application/pdf"
>>> />
>>> <Content
>>> contentId="CDI1105"
>>> dataResourceId="DR1105b"
>>> contentTypeId="DOCUMENT"
>>> />
>>> If the DataResource was ELECTRONIC_TEXT, I could display it in a screen
>>> like so:
>>>
>>> <widgets>
>>> <content content-id="CDI1105" />
>>> </widgets>
>>>
>>> How can I adapt this to work for the PDF download link?
>>>
>>> Many thanks in advance,
>>>
>>> Chris
>>>
>>
>
>

Re: special character's like apostrophe, ampersand converted into ' &

Posted by Jacques Le Roux <ja...@les7arts.com>.
In FTL, put a StringUtil.wrapString(around_your_string)

Jacques

From: "Kishore Pagadala" <Ki...@mindtree.com>
>I have a groovy code which reads DB and insert's a string into context, this string can contain special characters like apostrophe,
>ampersand; which are converted by ftl engine into &#39;  &amp;
>
> Ex:-
> Wendy's & Fitch
>
> Converted into
>
> Wendy&#39;s  &amp; Fitch
>
> How can I stop this auto conversation into &#39; &amp;  ?
>
> Regards,
> Kishore
>
> http://www.mindtree.com/email/disclaimer.html
>



special character's like apostrophe, ampersand converted into ' &

Posted by Kishore Pagadala <Ki...@mindtree.com>.
I have a groovy code which reads DB and insert's a string into context, this string can contain special characters like apostrophe, ampersand; which are converted by ftl engine into &#39;  &amp;

Ex:-
Wendy's & Fitch

Converted into

Wendy&#39;s  &amp; Fitch

How can I stop this auto conversation into &#39; &amp;  ?

Regards,
Kishore

http://www.mindtree.com/email/disclaimer.html

Re: content component question - how to setup download link?

Posted by Chris Snow <sn...@snowconsulting.co.uk>.
Thanks Erwan, will take a look tonight...

Erwan de FERRIERES wrote:
> Hi Chris,
>
> take a look to the ListTaskContent form, in the
> /ofbiz/specialpurpose/projectmgr/widget/forms/TaskForms.xml file. I'm 
> sure you will find what you need in it !
>
> Regards,
>
> Le 19/10/2009 01:03, Chris Snow a écrit :
>> I'm just working my way through the content component and I would like
>> to display a link to download a PDF file. If I setup the DataResource
>> and Content as follows, how can I display the content?
>>
>> <DataResource
>> dataResourceId="DR1105b"
>> dataResourceTypeId="OFBIZ_FILE_BIN"
>> objectInfo="/applications/content/data/pdftest2.pdf"
>> mimeTypeId="application/pdf"
>> />
>> <Content
>> contentId="CDI1105"
>> dataResourceId="DR1105b"
>> contentTypeId="DOCUMENT"
>> />
>> If the DataResource was ELECTRONIC_TEXT, I could display it in a screen
>> like so:
>>
>> <widgets>
>> <content content-id="CDI1105" />
>> </widgets>
>>
>> How can I adapt this to work for the PDF download link?
>>
>> Many thanks in advance,
>>
>> Chris
>>
>


-- 
Chris Snow - CEng MBCS CITP MBA (Tech Mgmt) (Open) CISSP

Tel: 01453 890660
Mob: 07944 880950
Www: www.snowconsulting.co.uk


Re: content component question - how to setup download link?

Posted by Erwan de FERRIERES <er...@nereide.biz>.
Hi Chris,

take a look to the ListTaskContent form, in the
/ofbiz/specialpurpose/projectmgr/widget/forms/TaskForms.xml file. I'm 
sure you will find what you need in it !

Regards,

Le 19/10/2009 01:03, Chris Snow a écrit :
> I'm just working my way through the content component and I would like
> to display a link to download a PDF file. If I setup the DataResource
> and Content as follows, how can I display the content?
>
> <DataResource
> dataResourceId="DR1105b"
> dataResourceTypeId="OFBIZ_FILE_BIN"
> objectInfo="/applications/content/data/pdftest2.pdf"
> mimeTypeId="application/pdf"
> />
> <Content
> contentId="CDI1105"
> dataResourceId="DR1105b"
> contentTypeId="DOCUMENT"
> />
> If the DataResource was ELECTRONIC_TEXT, I could display it in a screen
> like so:
>
> <widgets>
> <content content-id="CDI1105" />
> </widgets>
>
> How can I adapt this to work for the PDF download link?
>
> Many thanks in advance,
>
> Chris
>

-- 
Erwan