<div dir="ltr">But is there a way to modify the content? I need to change a field from the resource type any time another field gets modified.<br>I have 2 fields: <b>folder</b>, and <b>listOfFiles</b> and I need to update the <b>listOfFiles</b> field any time the <b>folder</b> field gets modified. <br>I don't know how to do that in the formatter..or there is another place for putting my code?(I guess that regenerating the <b>listOfFiles</b> any time the page loads is not a good idea)</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 14, 2017 at 4:20 PM, Patric Dosch <span dir="ltr"><<a href="mailto:patric.dosch@virtual-identity.com" target="_blank">patric.dosch@virtual-identity.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="DE" link="blue" vlink="purple">
<div class="m_-3980392628900442612WordSection1">
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d">Hey Mihai,<u></u><u></u></span></p><span class="">
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d">>>
</span><span lang="EN-GB" style="font-size:9.5pt">I don't know how to read data from the resource type(xml), which I can access using el expression.<u></u><u></u></span></p>
</span><p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d">But ${value.YourFieldName} is an el expression.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d">Now you need the value in your java world? Correct?<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d">The best way should be to use a el-function. This
<a href="https://newfivefour.com/tomcat7-el-custom-function.html" target="_blank">https://newfivefour.com/<wbr>tomcat7-el-custom-function.<wbr>html</a> seems to be a nice example. As far as I know the web.xml stuff is not needed anymore.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d">A not so nice way:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d"><c:set var=”yourVar” value=”${value.YourFieldName}”<wbr>/><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d"><%<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d">String yourVar = (String) pageContext.getAttribute(“<wbr>yourVar”);<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d">%><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d">Hope to understand your problem correctly.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d">But that are java questions and not opencms questions
</span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Segoe UI Emoji",sans-serif;color:#1f497d">😊</span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d">Regards, Patric<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d"><br>
<br>
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Von:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> <a href="mailto:opencms-dev-bounces@opencms.org" target="_blank">opencms-dev-bounces@opencms.<wbr>org</a> [mailto:<a href="mailto:opencms-dev-bounces@opencms.org" target="_blank">opencms-dev-bounces@<wbr>opencms.org</a>]
<b>Im Auftrag von </b>mihai lacusteanu<br>
<b>Gesendet:</b> Mittwoch, 8. März 2017 15:09<br>
<b>An:</b> <a href="mailto:opencms-dev@opencms.org" target="_blank">opencms-dev@opencms.org</a><br>
<b>Betreff:</b> Re: [opencms-dev] How to list files from a folder in opencms?<u></u><u></u></span></p><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">I don't need the value to be rendered in the HTML, I need to process it in the formatter (in the Java code between <% %>. Any time the resource type is processed via formatter I need to get a url from a field and then process it, not just
 output it in the HTML using el expressions.<u></u><u></u></p>
<div>
<p class="MsoNormal">How can I do that?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Thanks!<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Mihai<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Pe 8 mar. 2017 4:01 p.m., "Patric Dosch" <<a href="mailto:patric.dosch@virtual-identity.com" target="_blank">patric.dosch@virtual-<wbr>identity.com</a>> a scris:<u></u><u></u></p>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:9.5pt">>> I don't know how to read data from the resource type(xml), which I can access using el expression.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d">This should help:
<a href="http://documentation.opencms.org/opencms-documentation/content-in-opencms/formatters-and-their-configuration/index.html#4.2" target="_blank">
http://documentation.opencms.<wbr>org/opencms-documentation/<wbr>content-in-opencms/formatters-<wbr>and-their-configuration/index.<wbr>html#4.2</a></span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d">So
</span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Courier New";color:#1f497d">${value.YourFieldName}</span><span lang="EN-GB" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d"> holds the information</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d">Regards, Patric</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Von:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">
<a href="mailto:opencms-dev-bounces@opencms.org" target="_blank">opencms-dev-bounces@opencms.<wbr>org</a> [mailto:<a href="mailto:opencms-dev-bounces@opencms.org" target="_blank">opencms-dev-bounces@<wbr>opencms.org</a>]
<b>Im Auftrag von </b>mihai lacusteanu<br>
<b>Gesendet:</b> Dienstag, 7. März 2017 16:49<br>
<b>An:</b> <a href="mailto:opencms-dev@opencms.org" target="_blank">opencms-dev@opencms.org</a><br>
<b>Betreff:</b> [opencms-dev] How to list files from a folder in opencms?</span><u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt">I need to create a new resource type in opencms which have 1 field. The field is for a target folder.</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt">Every time I select a folder from VFS and save the resource(xml) the formatter will render a the list of files from the specified folder.</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt"> </span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt">I managed to create a jsp file which will create the list of files needed, but only with the target folder hardcoded. I don't know how to read data
 from the resource type(xml), which I can access using el expression.</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:9.5pt">Can you help me?</span><u></u><u></u></p>
</div>
</div>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
______________________________<wbr>_________________<br>
This mail is sent to you from the opencms-dev mailing list<br>
To change your list options, or to unsubscribe from the list, please visit<br>
<a href="http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev" target="_blank">http://lists.opencms.org/cgi-<wbr>bin/mailman/listinfo/opencms-<wbr>dev</a><br>
<br>
<br>
<br>
<u></u><u></u></p>
</blockquote>
</div>
</div>
</div></div></div>
</div>

<br>______________________________<wbr>_________________<br>
This mail is sent to you from the opencms-dev mailing list<br>
To change your list options, or to unsubscribe from the list, please visit<br>
<a href="http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev" rel="noreferrer" target="_blank">http://lists.opencms.org/cgi-<wbr>bin/mailman/listinfo/opencms-<wbr>dev</a><br>
<br>
<br>
<br>
<br></blockquote></div><br></div>