cancel
Showing results for 
Search instead for 
Did you mean: 

FreeMarker creating empty renditions

jarrett
Champ in-the-making
Champ in-the-making
Created a web form using the following schema and freemarker template. The form runs without displaying an errors and creates the XML and HTML files. However any variables from the form never are rendered in the html. All I get is the one line '<p>tired of making empty files</p>'. Any ideas?

XSD

<xs:schema elementFormDefault="qualified" targetNamespace="http://www.yankeegroup.com/about_us/xb" xmlns:alf="http://www.alfresco.org" xmlns:xb="http://www.yankeegroup.com/about_us/xb" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!– defines the form for creating a user profile –>
   <xs:element name="exec_bio">
      <xs:complexType>
         <xs:sequence>
            <xs:element maxOccurs="unbounded" minOccurs="1" name="bio" nillable="false">
               <xs:annotation>
                  <xs:appinfo>
                     <alf:label>Bio</alf:label>
                     <alf:appearance>default</alf:appearance>
                  </xs:appinfo>
               </xs:annotation>
               <xs:complexType>
                  <xs:sequence>
                     <xs:element name="first_name" type="xs:normalizedString" nillable="false">
                        <xs:annotation>
                           <xs:appinfo>
                              <alf:label>First Name</alf:label>
                           </xs:appinfo>
                        </xs:annotation>
                     </xs:element>
                     <xs:element name="last_name" type="xs:normalizedString" nillable="false">
                        <xs:annotation>
                           <xs:appinfo>
                              <alf:label>Last Name</alf:label>
                           </xs:appinfo>
                        </xs:annotation>
                     </xs:element>
                     <xs:element name="title" type="xs:normalizedString" nillable="false">
                        <xs:annotation>
                           <xs:appinfo>
                              <alf:label>Title</alf:label>
                           </xs:appinfo>
                        </xs:annotation>
                     </xs:element>
                     <xs:element default="/analyst/bios/photos/" maxOccurs="1" minOccurs="0" name="picture" nillable="false" type="xs:anyURI">
                        <xs:annotation>
                           <xs:appinfo>
                              <alf:label>Picture</alf:label>
                              <alf:appearance>image_file_picker</alf:appearance>
                           </xs:appinfo>
                        </xs:annotation>
                     </xs:element>
                     <xs:element name="bio" type="xs:string" nillable="false">
                        <xs:annotation>
                           <xs:appinfo>
                              <alf:label>Bio Text</alf:label>
                              <alf:appearance>wcm_content</alf:appearance>
                           </xs:appinfo>
                        </xs:annotation>
                     </xs:element>
                  </xs:sequence>
               </xs:complexType>
            </xs:element>
         </xs:sequence>
      </xs:complexType>
   </xs:element>
</xs:schema>

FTL

<#ftl ns_prefixes={"D":"http://www.yankeegroup.com/about_us/xb"}>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<#assign exec_bio = .vars["xb:exec_bio"]>

<p>tired of making empty files</p>

<#list exec_bio["xb:exec_bio"]["xb:bio"] as bio>
   <p>${bio.first_name}</p>
</#list>   

1 REPLY 1

jarrett
Champ in-the-making
Champ in-the-making
Still figuring out FreeMarker one template at a time….

For unknown reasons using variable assignments wouldn't work but this would.

Notice that I removed the variable assignment


<#assign exec_bio = .vars["xb:exec_bio"]>


<#ftl ns_prefixes={"D":"http://www.yankeegroup.com/about_us/xb", "xb":"http://www.yankeegroup.com/about_us/xb"}>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<p>tired of making empty files</p>

   <ul>
      <#list .vars["xb:exec_bio/xb:bio"] as b>
         <li>${b.first_name}</li>
      </#list>
   </ul>