cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to edit / validate our .xsd for WebForm???

xexiz
Champ in-the-making
Champ in-the-making
Hello, i'm trying to make a WebForm but I didnt find a validator anywhere and I can't make it work and since I dont know if there is a way to edit our xsd after we created the webform, I am doing it over and over, then add it to a web project then try to "create content" and then there is always an error so I guess my form isnt well formed yet Smiley Sad

The form is to make an xml file with approximately this structure:

– title
– location
_________
|—-title
|—-language='EN'
|—-body
___________
|—-title
|—-language='FR'
|—-body
¯¯¯¯¯¯¯¯¯¯¯
– expiration_date
‍‍‍‍‍‍‍‍‍‍‍‍‍‍

I want to be able to do like the body of the press-release (there is an + button adding another textarea, but well I want this + to add a title, body and language input.)


<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:simpleType name="language">
    <xs:restriction base="xs:normalizedString">
      <xs:enumeration value="French"/>
      <xs:enumeration value="English"/>
    </xs:restriction>
  </xs:simpleType>

  <!– defines the form for creating a press release –>
  <xs:element name="web_page">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="title" type="xs:normalizedString"/>
        <xs:element name="location" type="xs:normalizedString"/>
        <xs:sequence minOccurs="1" maxOccurs="unbounded">
           <xs:element name="title" type="xs:normalizedString"/>
           <xs:element name="language" type="language/> <!– My personal type define on top –>
           <xs:element name="body" type="xs:string"/>
        </xs:sequence>
   <xs:element name="expiration_date" type="xs:date"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
having this error code for now..
org.alfresco.service.cmr.repository.InvalidNodeRefException: Node does not exist: workspace://SpacesStore/acf950ab-aa83-11dc-a736-d7f2cb8da3db

By the way… is there a way to avoid creating over and over the WebForm and adding it to the WebProject, because it will take me a week to made it if there is no other way to refresh a form and make sure the modification are taken in the WebProject..


THANKS!!
10 REPLIES 10

xexiz
Champ in-the-making
Champ in-the-making
Another thing.. is there a way to EDIT a WebForm because when i'm editing it.. droping the .xsd with the Garbage icon, then i'm re-uploading it and Next, Next, Finish: i'm always having this stupid error!

Please correct the errors below then click Finish.

    * A system error happened during the operation: Existing file or folder webPage.xsd already exists

I know it's existing, i just dropped it to re-upload it with my changes.. it's annoying! always having to delete the complete WebForm, and start back Eveytime i wanna change something to the xsd!!!! Smiley Sad  Smiley Surprisedops:

xexiz
Champ in-the-making
Champ in-the-making
oh well, it's still a pain in the ass to update a WebForm, actually.. Impossible to update! always have to delete and start back. but well Finally got some results.. this is my actual XML result (without the red text): I would like to remove the green lines and replace it by the red one.. so I need to know if we can set an attribute based on an enumeration.

<?xml version="1.0" encoding="UTF-8" ?>
- <web_page xmlns:alf="http://www.alfresco.org" xmlns:chiba="http://chiba.sourceforge.net/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <title>Test Page 55</title>
  <location>tests</location>
- <contentBody lang="en">
  <title>English title</title>
  <language>English</language>
  <body>English body test page<br /></body>
  </contentBody>
- <contentBody lang="fr">
  <title>Titre Francais</title>
  <language>French</language>
  <body>Corps Francais page de test<br /></body>
  </contentBody>
  <expiration_date>2007-12-25</expiration_date>
  </web_page>

I've tried something like that.. which is not actually working having this error:

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

<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns:alf="http://www.alfresco.org"
      elementFormDefault="qualified">

  <xs:simpleType name="language">
    <xs:restriction base="xs:normalizedString">
      <xs:enumeration value="French"/>
      <xs:enumeration value="English"/>
    </xs:restriction>
  </xs:simpleType>

  <!– defines the form for creating a press release –>
  <xs:element name="web_page">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="title" type="xs:normalizedString"/>
        <xs:element name="location" type="xs:normalizedString"/>
        <xs:element name="contentBody" minOccurs="1" maxOccurs="unbounded">
           <xs:attribute name="lang" type="language">
         <xs:annotation>
              <xs:appinfo>
            <alf:label>French or English</alf:label>
            <alf:appearance>full</alf:appearance>
              </xs:appinfo>
         </xs:annotation>
      </xs:attribute>
           <xs:complexType>
              <xs:sequence>
            <xs:element name="title" type="xs:normalizedString"/>
            <xs:element name="body" type="xs:string"/>
         </xs:sequence>
           </xs:complexType>
        </xs:element>
   <xs:element name="expiration_date" type="xs:date"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

xexiz
Champ in-the-making
Champ in-the-making
Ohhh god! finally got it worked!! but I would really appreciate if someone tell me how we can edit inline a WebForm without deleting it all and creating it back! Then go into the webProject and remove it from Web project settings and put it back to make sure he's referencing to the new version… because it's really useless if there's no way to edit a webForm…

Thx

xexiz
Champ in-the-making
Champ in-the-making
no one ever succeed to modify a WebForm schema??? without having to delete the complete WebForm space and creating it back and then go to the webProject and add it back to our webproject which will then, crash there when you will try to Create content, if your schema is invalid. So you would have to do all those step again making all the content already existing from this webform, Invalid..

help please!

janv
Employee
Employee
This is a known issue http://issues.alfresco.com/browse/WCM-807

Until resolved, a simple workaround is to drill down into the actual form's (definition) space and update the XSD from there. You can also change the XSD properties to "Allow Inline Editing", if needed.

Thanks,
Jan

xexiz
Champ in-the-making
Champ in-the-making
thx.. and where can I enable this "feature" (Allow Inline Editing for XSD) ?

janv
Employee
Employee
This is a standard feature for supported document types. You can select "View Details" action (on <your>.xsd file). In the document "Properties" section you can simply click on the "Allow Inline Editing" link, and then select the "Edit" action.

Regards,
Jan

xexiz
Champ in-the-making
Champ in-the-making
This is a standard feature for supported document types. You can select "View Details" action (on <your>.xsd file). In the document "Properties" section you can simply click on the "Allow Inline Editing" link, and then select the "Edit" action.

Regards,
Jan

Oh well! that was a hidden option!! But anyways still cant edit it inline! I got the TinyMCE editor then I paste my XSD and when Im getting back to my WebProject, im having this error

org.alfresco.web.forms.FormProcessor$ProcessingException: org.alfresco.web.forms.xforms.FormBuilderException: org.xml.sax.SAXParseException: Reference is not allowed in prolog.‍

I've try to paste my XSD code into the HTML editor of tinyMCE too but it didint seem he liked it! hehe


I guess ill have to wait for v2.2, and i'm hoping to find some improve feature soon! (supposed to be release in december!)

Thx

janv
Employee
Employee
I ran a quick test, and inline editing seems to work fine for a newly created XSD. However, if you also try to upload XSD updates then this seems to cause the content type to change from 'XML' to 'Octet Stream' which in turn causes TinyMCE to appear next time you try to inline edit ?

If this is the case, then a quick fix is change the content type back to 'XML' (by using the "Modify" icon to the far right of the Properties section).

Hope this helps.

Thanks,
Jan