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

sirclueless
Champ in-the-making
Champ in-the-making
Yes thank you ! That was the mistake. Now it works !!!

tonizz
Champ in-the-making
Champ in-the-making
This option is good. But it would be much better if we could use TinyMCE as editor. Is it possible?

Why if you try to create content without webform you can use TinyMCE and if you start the edition from a webform you have to use this limited editor?

Thanks.

kvc
Champ in-the-making
Champ in-the-making
In 2.1.0, we now support different appearance for the xf:textarea control that we generated from an xs:string defined in your XSD.

By default, xs:string uses the general xf:textarea UI control which implements a limited set of controls in a TinyMCE instance.  You can specify a MINIMAL appearance, which will produce a Plain Text Editor (no TinyMCE), a FULL appearance or define any custom appearance type you want (including defining whatever TinyMCE plug-ins you want to enable as well).

You can see the different options you have or the different options you can create in web-client-config-wcm.xml:


           <widget xforms-type="xf:textarea"
                   appearance="minimal"
                   javascript-class-name="alfresco.xforms.PlainTextEditor"/>
           <widget xforms-type="xf:textarea"
                   javascript-class-name="alfresco.xforms.RichTextEditor">
             <param name="theme_advanced_buttons1">bold,italic,underline,separator,forecolor,backcolor,separator,link,unlink,image</param>
           </widget>
           <widget xforms-type="xf:textarea"
                   appearance="full"
                   javascript-class-name="alfresco.xforms.RichTextEditor">
             <param name="theme_advanced_buttons1">bold,italic,underline,strikethrough,separator,fontselect,fontsizeselect</param>
             <param name="theme_advanced_buttons2">link,unlink,image,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,separator,undo,redo,separator,forecolor,backcolor</param>
             <param name="height">400</param>
           </widget>
           <!–
               NOTE: only the table tinymce plugin is part of the default alfresco distribution. 
               to enable other tinymce plugins, the plugin code must first be copied into the
               tinymce distribution within the webapp.
             –>
           <widget xforms-type="xf:textarea"
                   appearance="custom"
                   javascript-class-name="alfresco.xforms.RichTextEditor">
             <param name="theme_advanced_buttons1">bold,italic,underline,strikethrough,separator,fontselect,fontsizeselect</param>
             <param name="theme_advanced_buttons2">link,unlink,image,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,separator,undo,redo,separator,forecolor,backcolor</param>
             <param name="height">600</param>
             <param name="mode">exact</param>
             <param name="force_p_newlines">true</param>
             <param name="apply_source_formatting">true</param>
             <param name="plugins">table</param>
             <param name="theme_advanced_buttons3">tablecontrols</param>
           </widget>
           <!–
           <widget xforms-type="xf:textarea"
                   appearance="fullscreen"
                   javascript-class-name="alfresco.xforms.RichTextEditor">
             <param name="theme_advanced_buttons1">bold,italic,underline,strikethrough,separator,fontselect,fontsizeselect</param>
             <param name="theme_advanced_buttons2">link,unlink,image,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,separator,undo,redo,separator,forecolor,backcolor</param>
             <param name="height">600</param>
             <param name="plugins">fullscreen</param>
             <param name="theme_advanced_buttons3">fullscreen</param>
           </widget>
           –>


Also, for more info on how various XSD types are mapped to XForms controls, you can take a look at the following wiki page:

http://wiki.alfresco.com/wiki/Forms_Developer_Guide#Supported_XML_Schema_structures_and_data_types


Kevin