AnsweredAssumed Answered

Including web script into web form

Question asked by anupam_sharma on Apr 2, 2013
Hi,

I'm trying to include web script into my web form but failing every time. I'm getting following error.

org.alfresco.web.forms.FormProcessor$ProcessingException: org.alfresco.web.forms.xforms.FormBuilderException: error parsing schema: at line 121 column 46: src-resolve: Cannot resolve the name 'localeType' to a(n) 'type definition' component.

My web script code as follows:

helloworld.get.xml.ftl

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:complexType name="localeType">
  <xs:attribute name="Language" fixed="${msg("person.properties.locale")}"/>
</xs:complexType>
</xs:schema>

helloworld.get.desc.xml

<webscript>
   <shortname>Hello</shortname>
   <description>Web scrip description file</description>
   <url format="xml" template="/schema/hello"/>
    <format default="xml">extension</format>
    <authentication>user</authentication>
    <transaction>required</transaction>
</webscript>

Test.xsd

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:alf="http://www.alfresco.org" elementFormDefault="qualified">
   
<xs:include schemaLocation="webscript://api/path/content/workspace/SpacesStore/Company%20Home/Data%20Dictionary/Web%20Scripts/org/Test/helloworld.get.html.ftl?ticket={ticket}"/>


    <xs:element name="deal" type="deal"></xs:element>
   <xs:complexType name="deal">
      <xs:sequence>
      <xs:element name="dealId" type="xs:integer">
         <xs:annotation>
            <xs:appinfo>
               <alf:label>${cms.categories.dealid.label}</alf:label>
               <alf:alert>${cms.categories.dealid.alert}</alf:alert>
            </xs:appinfo>
         </xs:annotation>
      </xs:element>
      <xs:element name="title">
         <xs:annotation>
            <xs:appinfo>
               <alf:label>${cms.categories.dealtitle.label}</alf:label>
               <alf:alert>${cms.categories.dealtitle.alert}</alf:alert>
            </xs:appinfo>
         </xs:annotation>
         <xs:simpleType>
            <xs:restriction base="xs:normalizedString">
               <xs:maxLength value="40" />
            </xs:restriction>
         </xs:simpleType>
      </xs:element>
      <xs:element name="shortTitle">
         <xs:annotation>
            <xs:appinfo>
               <alf:label>${cms.categories.dealshorttitle.label}</alf:label>
               <alf:alert>${cms.categories.dealshorttitle.alert}</alf:alert>
            </xs:appinfo>
         </xs:annotation>
         <xs:simpleType>
            <xs:restriction base="xs:normalizedString">
               <xs:maxLength value="40" />
            </xs:restriction>
         </xs:simpleType>
      </xs:element>
      <xs:element name="description" maxOccurs="1" minOccurs="0" nillable="true">
         <xs:annotation>
            <xs:appinfo>
               <alf:label>${cms.categories.dealdesc.label}</alf:label>
               <alf:alert>${cms.categories.dealdesc.alert}</alf:alert>
            </xs:appinfo>
         </xs:annotation>
         <xs:simpleType>
            <xs:restriction base="xs:normalizedString">
               <xs:maxLength value="110" />
            </xs:restriction>
         </xs:simpleType>
      </xs:element>
      <xs:element name="shortDescription">
         <xs:annotation>
            <xs:appinfo>
               <alf:label>${cms.categories.dealshortdesc.label}</alf:label>
               <alf:alert>${cms.categories.dealshortdesc.alert}</alf:alert>
            </xs:appinfo>
         </xs:annotation>
         <xs:simpleType>
            <xs:restriction base="xs:normalizedString">
               <xs:maxLength value="40" />
            </xs:restriction>
         </xs:simpleType>
      </xs:element>
      <xs:element name="standardImageUrl" type="xs:anyURI" maxOccurs="1" minOccurs="0" nillable="true">
         <xs:annotation>
            <xs:appinfo>
               <alf:label>${cms.categories.dealstdimage.label}</alf:label>
               <alf:alert>${cms.categories.dealstdimage.alert}</alf:alert>
            </xs:appinfo>
         </xs:annotation>
      </xs:element>
      <xs:element name="smallImageUrl" type="xs:anyURI" maxOccurs="1" minOccurs="0" nillable="true">
         <xs:annotation>
              <xs:appinfo>
            <alf:label>${cms.categories.dealsmallimg.label}</alf:label>
            <alf:alert>${cms.categories.dealsmallimg.alert}</alf:alert>
              </xs:appinfo>
         </xs:annotation>
      </xs:element>
      <xs:element name="sortOrder" type="xs:integer">
         <xs:annotation>
            <xs:appinfo>
               <alf:label>${cms.categories.sortorder.label}</alf:label>
               <alf:alert>${cms.categories.sortorder.alert}</alf:alert>
            </xs:appinfo>
         </xs:annotation>
      </xs:element>
                  <xs:element name="locale" type="localeType"/>      
      </xs:sequence>
   </xs:complexType>
</xs:schema>

Please let me know if I'm missing out anything.

Outcomes