Hello Avijit,

There can be two options:

1) If you wish to save images/pdf in the database then please go with the
option which Nicola suggested in his email. Basically content related
entities will be involved in this operation: Content, DataResource and
ImageDataResource. Please review the references in the "content" component
present inside the applications folder.

2) If you wish to keep the images/pdf on the file system then again you can
review the upload related functionality in the "content" component.
There are many examples available in the code. In this case you need to
create a webapp reference in the ofbiz-component.xml file:

<webapp name="siteresources"
 title="Many Resources"
 server="default-server"
 location="webapp/siteresources"
 mount-point="/siteresources"
 app-bar-display="false"/>

Then inside webapp folder:
- webapp
-- siteresources
--- images
--- pdf

You can create your media contents inside the "siteresources" folder. In
the Form Widget you can use following code:

<field name="myImage"><image value="
http://localhost:8080/siteresources/images/ofbiz_logo.png";
style="cssImgXLarge"/></field>
<field name="myPdf">
 <hyperlink description="Default PDF" target-type="plain" target="
http://localhost:8080/siteresources/pdf/pdftest.pdf";
target-window="_BLANK"/>
</field>

You can dynamically prepare the data inside groovy files for image->value
attribute and for hyperlink->target attribute and use it in the form widget
field tag.

Hope this helps!

--
Kind Regards,
Ashish Vijaywargiya
Vice President of Operations
*HotWax Systems*
*Enterprise open source experts*
http://www.hotwaxsystems.com



On Mon, Jul 18, 2022 at 9:11 AM Avijit Bose <[email protected]> wrote:

> Dear Sir,
>
> I have a link in the form as shown below:
> --------------------------
> <field name="salaryCertificateUrl" use-when="${salaryCertificateUrl!='Not
> Applicable'}" title="${uiLabelMap.salaryCertificate}" widget-style="text">
>         <hyperlink target="salaryCertificateUrl"
> description="${salaryCertificateUrl}" also-hidden="false" size="25">
>                   <parameter param-name="salaryCertificateUrl"/>
>         </hyperlink>
> </field>
> --------------------------
>
> Note: "salaryCertificateUrl" is a path of a pdf file. I DON'T WANT TO
> GENERATE PDF FILE. JUST WANT TO VIEW PRE_GENERATED PDFs. I am uploading it
> and then wants to view it from the link in my form. Same this for images.
>
> Pls let me know how do I view this.
>
> regards
> Avijit
>

Reply via email to