cancel
Showing results for 
Search instead for 
Did you mean: 

Having trouble understanding some stuff from the WSF

benjim
Champ in-the-making
Champ in-the-making
<c:set var="query" value="/canteen_menu:canteen_menu[canteen_menu:channel='${channel}']"/>
         
     <c:if test="${empty postfix}">
        <c:set var="postfix" value=".html"/>
     </c:if>

   <div>
     <c:forEach items="${cl:getContentList(pageContext,'canteen_menu','/content/Megabytes/Day',postfix,query)}" var="item"  varStatus="status">
      <jsp:include page="${item}"/>
     </c:forEach>

I have added my own page to the WSF framework initally to get to grips with writing my own content.  I have created the XSD and XSLT to transform the input into /content/Megabytes/Day/ as *.HTML files.

If someone could help me understand what does the below code do:

<c:set var="query" value="/canteen_menu:canteen_menu[canteen_menu:channel='${channel}']"/>

Im hackign like hell but i cant pull in the HTML from that folder into a simple div on my index page.

Any help any explanation any pointers in the right direction would be gratefully appreciated.

Thanks
Ben
2 REPLIES 2

benjim
Champ in-the-making
Champ in-the-making
So everyone either knows how this works or no one does, anyone help me out here?

benjim
Champ in-the-making
Champ in-the-making
After busting open the jar decompiling the class and finding the source i have made some progress:

Here is my code:

<jsp:root version="1.2"
          xmlns:jsp="http://java.sun.com/JSP/Page"
     xmlns:c="http://java.sun.com/jsp/jstl/core"
     xmlns:cl="http://www.alfresco.org/alfresco/cl"
          xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
          xmlns:fn="http://java.sun.com/jsp/jstl/functions">

  <jsp:output doctype-root-element="html"
         doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
         doctype-system="http://www.w3c.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'/>

  <jsp:directive.page language="java" contentType="text/html; charset=UTF-8"/>
  <jsp:directive.page isELIgnored="false"/>
 
    
     <c:set var="query" value="/cdl:canteen_menu_day_only"/>
         
   <div>
     <c:forEach items="${cl:getContentList(pageContext,'cdl','/content/megabytes/day','.html',query)}" var="item"  varStatus="status">
      <jsp:include page="${item}"/>
      <h2>BEN</h2>
     </c:forEach>
   </div>
</jsp:root>

My generated xml in /content/megabytes/day is:

Monday.xml
  <?xml version="1.0" encoding="UTF-8" ?> 
- <cdl:canteen_menu_day_only xmlns:cdl="http://www.cdl.co.uk/cdl" xmlns:alf="http://www.alfresco.org" xmlns:chiba="http://chiba.sourceforge.net/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <cdl:soup>Pea and Ham</cdl:soup>
  <cdl:main>Tuna Steaks</cdl:main>
  </cdl:canteen_menu_day_only>

My generated html in /content/megabytes/day is:

Monday.html
<div xmlns:fn="http://www.w3.org/2005/02/xpath-functions" xmlns:cdl="http://www.cdl.co.uk/cdl" xmlns:canteen_menu_day="http://www.alfresco.org/alfresco/motd" class="md">
            Soup - Pea and Ham<br>
            Main - Tuna Steaks</div>


But when i view the page in the browse website i see a blank page with the following source:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<div></div>


If any alfresco engineer is about or anyone who knows the answer to this is about i really need an answer today if possible, as my time is running out on using alfresco fro a CMS

Thanks
Ben