[opencms-dev] How to retrieve the properties of file?

Francis ffraikin at met.wallonie.be
Wed May 17 12:52:55 CEST 2006


I'm trying to retrieve the property "Title" of a file.

c:forEach items="${docIt}" var="aFile">
       <tr><td class='consul' colspan=2>
       <a class='lu' target=_blank 
href='http://d420x1/opencms/opencms<c:out 
value="${aFile.file.absolutePath}" />' >
       <c:out value="${aFile.file.name}" />
<!--   Test  -->
<!--   file : <c:out value="${aFile.file}" /> -->
<!--   absolutePath : <c:out value="${aFile.file.absolutePath}" /> -->
<!--   resourceName : <c:out value="${aFile.file.resourceName}" /> -->
<!--   cms:property  : <cms:property name="Title" /> -->
<!--   cms:property + file : <cms:property name="Title" file="<c:out 
value="${aFile.file.absolutePath}"/>/<c:out 
value="${aFile.file.name}"/>" /> -->
<!--   cms.property : <%=cms.property("Title", 
"/system/galleries/download/Documentsqualite/mq4206r01.pdf")%> -->
       </a>
       </td></tr>
</c:forEach>

<cms:property name="Title" /> OK for the page including the code
<%=cms.property("Title", 
"/system/galleries/download/Documentsqualite/mq4206r01.pdf")%>  OK
<cms:property name="Title" file='<c:out 
value="${aFile.file.absolutePath}"/>' /> --> Error

Root cause:
org.apache.jasper.JasperException: com.opencms.core.CmsException: 
[com.opencms.file.oraclesql.CmsDbAccess] 
/default/vfs/ig42.intranet/applications/pageDistribution/gestionDistribution/Gestion/${afile.file.absolutepath}

OpenCms try to find the file in the directory of the page including the 
code.

Is there  a solution?

Francis




More information about the opencms-dev mailing list