cancel
Showing results for 
Search instead for 
Did you mean: 

XSD schemas and UI Control

tonizz
Champ in-the-making
Champ in-the-making
When you want to create a general web content from "Create Web Content" afresco provides you an UI that offers you a rich text editor whith a lot of options: text format, alignment, colors, images, links, tables, styles….

Otherwise if you begin the process of creating a content from a web form, here I have my schema:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <!– defines the form for creating a news –>
  <xs:element name="content">
    <xs:complexType>
      <xs:sequence>
      <xs:element name="title" type="xs:normalizedString"/>
        <xs:element name="body" type="xs:anyType"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

The documentation explains that the type xs:anyType leads you to a rich text editor, but the editor I get is the minimun one.

Do you know what is the correct type or if the matter is that what I want to do is not possible???

Thanks in advance.
12 REPLIES 12

mark_smithson
Champ in-the-making
Champ in-the-making
Hi

Try using xs:string rather than xs:anyType

Mark

tonizz
Champ in-the-making
Champ in-the-making
Yes, you are right but in this way you only can use the WCM editor, I would like to use TinyMCE Editor, this is much more complete.

Thanks for your reply.

arielb
Champ in-the-making
Champ in-the-making
they are all tinymce editors other than minimal appearance for xs:string which produces a plaintexteditor.  the preferred type to use is xs:string as opposed to xs:anyType.  as of 2.1 there is a full appearance defined for this type which will result in more buttons.

<?xml version="1.0" encoding="ISO-8859-1"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:alf="http://www.alfresco.org">
<!– defines the form for creating a news –>
<xs:element name="content">
<xs:complexType>
<xs:sequence>
<xs:element name="title" type="xs:normalizedString"/>
<xs:element name="body" type="xs:string">
  <xs:appinfo><xs:annotation><alf:appearance>full</alf:appearance></xs:annotation></xs:appinfo>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

sirclueless
Champ in-the-making
Champ in-the-making
I get the following error if I try to use the webform above :

org.alfresco.web.forms.FormProcessor$ProcessingException: org.alfresco.web.forms.xforms.FormBuilderException: error parsing schema: at line 9 column 18: s4s-elt-must-match.1: The content of 'content' must match (annotation?, (simpleType | complexType)?, (unique | key | keyref)*)). A problem was found starting at: appinfo.

What do I wrong or what is my mistake ??

mark_smithson
Champ in-the-making
Champ in-the-making
sounds like a spelling error on the xs:annotation element - did you copy/paste or type it?

sirclueless
Champ in-the-making
Champ in-the-making
I copy-paste it. Here is my complete webform:

<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:alf="http://www.alfresco.org" elementFormDefault="qualified" attributeFormDefault="unqualified">
   <!– defines the form for creating a company home –>
   <xs:element name="infeurope">
      <xs:complexType>
         <xs:sequence>
            <xs:element name="header" type="xs:normalizedString"/>
            <xs:element name="content" type="xs:string">
               <xs:appinfo><xs:annotation><alf:appearance>full</alf:appearance></xs:annotation></xs:appinfo>
            </xs:element>
         </xs:sequence>
      </xs:complexType>
   </xs:element>
</xs:schema>

I thought that is correct ,or?

tonizz
Champ in-the-making
Champ in-the-making
could be that the xs:string line is not close by "/>"???

sirclueless
Champ in-the-making
Champ in-the-making
I think that`s correct, cause that is in the element-tag and this tag will close later. It`s in the example above the same.

mark_smithson
Champ in-the-making
Champ in-the-making
Ah - should be this

<xs:annotation><xs:appinfo><alf:appearance>full</alf:appearance></xs:appinfo></xs:annotation>