atanasov_lyuben
I'm new here

FS-Integration: get picture path from FirstSpirit

Hello,

I am building a small JSP (see "get image.png") using FSI, which purpose is to display text data and an image file from FirstSpirit. There is no problem with the text data, as I use the text input field as explained in the documentation and it works perfectly:

<input type="text" class="textfield" name="<fsi:ref value='p.company.phone' />" value="<c:out value='${p.company.phone}'escapeXml='true' />" size="32" maxlength="32">

I couldn't find any information in the documentation about getting the path to blob files, though. What I try in the moment is:

<img src="${p.picture}" />

and I get the output:

<img src="<CMS_VALUE name="cs_picture" tag="FS_REFERENCE"><LANG id="§" set="1"><UID>preview</UID><UIDTYPE>MEDIASTORE_LEAF</UIDTYPE><REMOTE/></LANG></CMS_VALUE>" />

but it does not seem too work (picture field in the DB is defined as an XML type).

Thanks in advance.

Regards,

Lyuben Atanasov

0 Kudos
4 Replies
MarcusDau
Occasional Collector

Look here:

https://community.e-spirit.com/thread/1371

This should help!

0 Kudos

I solved the problem, but I invested a lot of time in this issue (which should be sth standard). I think it would be very helpful for the other developers in the comunity, if there is a blog with the complete solution of the problem.

0 Kudos
feddersen
Community Manager

Would you contribute your solution to the community? We could offer you a code review in exchange.
0 Kudos

we use the above described content projection

1. make a template with the row: $CMS_IF(!#row.picture.isEmpty)$<img src="$CMS_VALUE(pv_picture_url)$$CMS_REF(#row.picture)$" />$CMS_END_IF$

2. in the jsp: <c:import url = "http://my_fs_server/path/to/the/file/image_mapping_${myimage.fs_id}.jsp" />

similar is the solution for documents, etc.

I hope the very short description was useful for some. Unfortunately I cannot provide more details, as they whould be project specific and will require additional overhead. (It would be great if someone can give a more detailed howto)

0 Kudos