I'm assuming you are looking to display some data from a db backend
that's not a part of the repository.  That's easy enough.  Just create a
paragraph that fetches the data and display's it.  You could then add
fields to the paragraph's dialog defining different aspects of the data
to be displayed.  The standard sql taglib could handle the query work
and then just display it using standard jstl tags.  The following is
adapted from the jsr-52 spec (JSTL 1.1) document:

<jsp:root version="2.0" xmlns:jsp="http://java.sun.com/JSP/Page";
xmlns:sql="http://java.sun.com/jsp/jstl/sql";
xmlns:c="http://java.sun.com/jsp/jstl/core";
xmlns:cms="urn:jsptld:cms-taglib">

<cms:setNode var="pageProps" />
<sql:query  var="hotels"
dataSource="jdbc/myDatabase">${pageProps.query}</sql:query>
<c:if test="${not empty hotels}">
  <table>
    <c:forEach var="hotel" items="${hotels}">
      <tr>
        <td><c:out value="${hotel.name}"/></td>
        <td><c:out value="${hotel.hotelStarRating}" /></td>
      </tr>
    </c:forEach>
  </table>
</c:if>
</jsp:root>

I suspect in the message your cited below, the c:forEach tag couldn't
find your collection and the block was skipped.

--David

Conor wrote:
> Hi Simon,
>             Any chance you show me the link to where you posted some sample
> code? I am in a similiar situation to Dieter, in that I need to request some
> information in my backend, and want to use magnolia as a pure cms frontend
> solution. Here's my previous post on the issues I'm having:
>
> http://www.nabble.com/Cannot-view-session-information-using-JSTL--tf3290921.html
>
> Have a sample solution from magnolia, but it isn't working for me, and it
> isn't producing any exception to prompt me where I'm going wrong!? Stuck
> between a rock and a hard place. Seeing I'm not the only person who wants to
> interact with a different backend to Jackrabbit/JCR, would appreciate it if
> you could point me in the right way, if you can?
> Thanks Simon,
> Conor
>
> p.s. Dieter, if you have solved the issue on showing your mysql data using
> magnolia, can you please explain how you did it? Am sure you're solution
> would work for me too...thanks in advance.
>
> Best,
> Conor
>
>
> Magnolia - User mailing list wrote:
>   
>> Hi Dieter,
>>
>> I've just posted some code in response to a similar request which may
>> help. My recommendation would be to use the Magnolia APIs for all
>> content creation and manipulation, rather than messing with the
>> underlying data layer. This way your code should be more insulated for
>> changes to Magnolia, Jackrabbit, JCR, etc.
>>
>> However, Magnolia doesn't currently have a very clean API for external
>> integration, so it may be tricky to get everything working. I know
>> there has been talk of a proper CMS API layer, and also a WebServices
>> layer that would be even better for what you want to do. I don't know
>> what the status is on either of these though. It would be good to hear
>> from anyone that's involved in that work actually, as I have need of
>> these features myself and would happily contribute to the development.
>>
>> Simon
>>
>> On 02/03/07, dieter <[email protected]> wrote:
>>     
>>> Hi,
>>>
>>> I have been browsing through the tables on my Magnolia repository and
>>> have
>>> been wondering in which tables the actual data is stored.
>>>
>>> My reason for asking is i would like to eventually be able to automate
>>> creating new content externally from Magnolia. Is this possible?
>>>
>>> Dieter
>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Viewing-MySql-tables-tf3334323.html#a9271918
>>> Sent from the Magnolia - User mailing list archive at Nabble.com.
>>>
>>>
>>>
>>>       


----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/developer.html
----------------------------------------------------------------

Reply via email to