cancel
Showing results for 
Search instead for 
Did you mean: 

web forms image upload

weloo
Champ in-the-making
Champ in-the-making
Hello All,

i need to know how  to create a web form containing files like this including the (xsd, ftl):
product name :
product image : (upload image from the hard disk)
product description :

thanks everybody.
best regards ,
meka
3 REPLIES 3

kubens
Champ in-the-making
Champ in-the-making
I suggest to spent some time to this great tutorial:

  Learning Alfresco Web Forms by Examples

After you have read this you will be able to create easily your web forms Smiley Very Happy

Wolfgang

weloo
Champ in-the-making
Champ in-the-making
Hello kubens ,

my problem is in creating the ftl rendering for the image uploaded .
and this is the xsd file .
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:pr="http://www.someco.com/corp/pr"
xmlns:alf="http://www.alfresco.org"
targetNamespace="http://www.someco.com/corp/pr"
elementFormDefault="qualified">
  <!– defines the form for creating a press release –>
  <xs:element name="press_release">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="title" type="xs:normalizedString"/>
        <xs:element name="Image" type="xs:anyURI" minOccurs="0" maxOccurs="1"/>
        <xs:element name="location" type="xs:normalizedString" default="Austin, TX"/>
        <xs:element name="date" type="xs:date"/>
        <xs:element name="body" type="xs:normalizedString" minOccurs="1" maxOccurs="1">
          <xs:annotation>
            <xs:appinfo>
              <alf:appearance>custom</alf:appearance>
            </xs:appinfo>
          </xs:annotation>
        </xs:element>
        <xs:element name="company_footer" type="xs:normalizedString" minOccurs="0" maxOccurs="unbounded"/>
        <xs:element name="contact_info" type="xs:normalizedString" minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>


and this is not the problem i create the xsd file well.
the ftl file for rendering is :
<#ftl ns_prefixes={"pr":"http://www.someco.com/corp/pr"}>
<#assign press_release = .vars["pr:press_release"]>
<div class="node">
<h2>${press_release["pr:Image"]}</h2>
<p><p>${press_release["pr:location"]} - ${press_release["pr:date"]} - ${press_release["pr:body"]}
<#list press_release["pr:company_footer"] as cf>
<p>${cf}</p>
</#list>
<#list press_release["pr:contact_info"] as ci>
<p>${ci}</p>
</#list>
</p></p>
<div class="clearfix"></div>
</div>
<div class="clearfix"></div>
i try this but the path of the image only appear in the html file
i need only how to render the image in the ftl file to appear in the html file after uploaded.

thanks kubens and all ,

best regards.

meka

samuel_penn
Champ in-the-making
Champ in-the-making
Not sure if you've figured this out yet, but your HTML doesn't actually seem to display the image anywhere. Shouldn't:

<h2>${press_release["pr:Image"]}</h2>

be:

<img src="${press_release['pr:Image']}"/>

Sam.