cancel
Showing results for 
Search instead for 
Did you mean: 

Using import statements in the WCM web form XSD

tamilraj2003
Champ in-the-making
Champ in-the-making
In the web form creation, if my XSD has to refer or import many other schemas from public locations, how it could be accomplished? Though my XSD refers such schemas with public domain URLs, alfresco throws “org.alfresco.web.forms.FormProcessor$ProcessingException: org.alfresco.web.forms.xforms.FormBuilderException: error parsing schema: at line 91 column 41: src-resolve: Cannot resolve the name 'georss:where' to a(n) 'element declaration' component.â€
5 REPLIES 5

pmonks
Star Contributor
Star Contributor
Are you able to post your XSD, or a small example that demonstrates the problem?

tamilraj2003
Champ in-the-making
Champ in-the-making
Here is the XSD I am trying to use.

I am using the Google Open Social schema, to generate a web form as my POC

<?xml version="1.0" encoding="UTF-8"?>
<!–
  RELAX NG Compact Syntax Grammar
  Description: People API: read-only feed of user profiles
–>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.w3.org/2005/Atom" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlnsSmiley SurprisedpenSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:gml="http://www.opengis.net/gml">
  <xs:import namespace="http://a9.com/-/spec/opensearchrss/1.0/" schemaLocation="openSearch.xsd"/>
  <xs:import namespace="http://schemas.google.com/g/2005" schemaLocation="gd.xsd"/>
  <xs:import namespace="http://www.georss.org/georss" schemaLocation="georss.xsd"/>
  <xs:import namespace="http://www.opengis.net/gml" schemaLocation="gml.xsd"/>
  <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>
  <!– Describes a People profile feed –>
  <xs:element name="feed">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="atom:author"/>
        <xs:element ref="atom:entry"/>
        <xs:element ref="atom:generator"/>
        <xs:element ref="atom:id"/>
        <xs:element ref="openSearch:itemsPerPage"/>
        <xs:element ref="atom:link"/>
        <xs:element ref="openSearch:startIndex"/>
        <xs:element ref="atom:title"/>
        <xs:element ref="openSearch:totalResults"/>
        <xs:element ref="atom:updated"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>
  <xs:element name="author" type="atomSmiley TongueersonConstruct"/>
  <xs:element name="title" type="atom:textConstruct"/>
  <!– Describes the generator –>
  <xs:element name="generator">
    <xs:complexType>
      <xs:simpleContent>
        <xs:extension base="xs:string">
          <xs:attribute name="uri" type="xs:string"/>
          <xs:attribute name="version" type="xs:string"/>
        </xs:extension>
      </xs:simpleContent>
    </xs:complexType>
  </xs:element>
  <!– Describes a unique identifier –>
  <xs:element name="id" type="xs:string"/>
  <!– Describes the number of items that will be returned per page for paged feeds –>
  <!– Describes a person construct used for authors and contributors –>
  <xs:complexType name="personConstruct">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element ref="atom:email"/>
      <xs:element ref="atom:name"/>
      <xs:element ref="atom:uri"/>
    </xs:choice>
    <xs:attribute ref="xml:lang"/>
  </xs:complexType>
  <!– Describes an author's email address –>
  <xs:element name="email" type="xs:string"/>
  <!– Describes an author's human-readable name –>
  <xs:element name="name" type="xs:string"/>
  <!– Describes the starting index of the contained entries for paged feeds –>
  <!– Describes a text construct containing either plain text, HTML, or XHTML –>
  <xs:complexType name="textConstruct">
    <xs:simpleContent>
      <xs:extension base="xs:string">
        <xs:attribute ref="xml:lang"/>
        <xs:attribute name="type" type="xs:string"/>
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>
  <!– Describes the total number of results associated with this feed –>
  <!– Describes a last updated timestamp –>
  <xs:element name="updated">
    <xs:simpleType>
      <xs:union memberTypes="xs:date xs:dateTime"/>
    </xs:simpleType>
  </xs:element>
  <!– Describes the URI associated with an author –>
  <xs:element name="uri" type="xs:string"/>
  <!– Extends the base Link class with People extensions –>
  <xs:element name="link">
    <xs:complexType>
      <xs:attribute name="href" use="required" type="xs:string"/>
      <xs:attribute name="rel" type="xs:string"/>
      <xs:attribute name="type" type="xs:string"/>
    </xs:complexType>
  </xs:element>
  <!– Describes an People profile entry –>
  <xs:element name="entry">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="gd:email"/>
        <xs:element ref="gd:extendedProperty"/>
        <xs:element ref="georss:where"/>
        <xs:element ref="atom:id"/>
        <xs:element ref="gd:im"/>
        <xs:element ref="atom:link"/>
        <xs:element ref="gdSmiley TonguehoneNumber"/>
        <xs:element ref="gdSmiley TongueostalAddress"/>
        <xs:element ref="atom:title"/>
        <xs:element ref="atom:updated"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>
  <!–
    Stores a limited amount of custom data as an auxiliary property of the
       enclosing entity
  –>
  <!– Describes an email address –>
  <!– Describes a geographical location or region –>
  <!– Describes a particular geographical point –>
  <!– Describes a latitude and longitude –>
  <!– Describes an instant messaging address –>
  <!– Describes a phone number –>
  <!– Describes a postal address –>
</xs:schema>

When I try to create content for this web form (after creating the form, I did add to a web project), I get  this error

“org.alfresco.web.forms.FormProcessor$ProcessingException: org.alfresco.web.forms.xforms.FormBuilderException: error parsing schema: at line 91 column 41: src-resolve: Cannot resolve the name 'georss:where' to a(n) 'element declaration' component.â€

pmonks
Star Contributor
Star Contributor
Are openSearch.xsd, gd.xsd, georss.xsd, gml.xsd and xml.xsd installed in the root directory of your Web Project, and have they been promoted to the staging sandbox?

As described at http://wiki.alfresco.com/wiki/Forms_Developer_Guide#Overview_of_supported_XML_Schema_structures_and_..., when you xs:include or xs:import an XML schema using a relative URL, that schema must be stored within the Web Project itself - only absolute URLs in schemaLocations are loaded from outside the Web Project.

ribz33
Champ on-the-rise
Champ on-the-rise
Hi,

is it possible to import a xsd added in data dictionnary/web forms ?

Thanks in advance.

pmonks
Star Contributor
Star Contributor
Not currently, no.  Imports / includes must be located in the Web Project to which the Web Form is associated (which may mean that the import / include files need to be stored multiple times if the Web Forms that import / include them are associated to multiple Web Projects).

There's an enhancement request in JIRA that's intended to allow importing / including of a Web Script (which could be used to include an XSD from anywhere in the repository via the built-in /api/content Web Script).  The issue is https://issues.alfresco.com/jira/browse/ETWOTWO-77 - I'd encourage you to vote and/or comment on it if you feel that this functionality is important.

Cheers,
Peter