cancel
Showing results for 
Search instead for 
Did you mean: 

Troubles with web forms in 2.9B

stevo
Champ in-the-making
Champ in-the-making
Hi,
after a few days of working with the latest Beta I must admit that this is another great piece of software.

However, there are some issues when using the new ecm forms feature. When you create a new form using a xsd containing complexTypes the form generator does not display the form correctly. The schema I have used contains a record in the first hierarchy and possibly several sub information in a lower level of the hierarchy.
When the form is generated everything looks fine, but if you try to hit the green plus and add another element, Alfresco shows a red loading bar in the upper right corner and stalls (for hours).

The xsd I am using looks like this:
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
   <xs:simpleType name="staticInfo">
      <xs:restriction base="xs:string">
         <xs:enumeration value="one"/>
         <xs:enumeration value="two"/>
         <xs:enumeration value="three"/>
         <xs:enumeration value="four"/>
         <xs:enumeration value="five"/>
         <xs:enumeration value="six"/>
      </xs:restriction>
   </xs:simpleType>
   <xs:element name="Record" id="Record">
      <xs:complexType id="inRecord">
         <xs:sequence id="inRecordSeqeunce" maxOccurs="1" minOccurs="1">
            <xs:element name="proInfo"  minOccurs="1" maxOccurs="unbounded" id="proInfo">
               <xs:complexType id="otherInfo">
                  <xs:attribute name="title" type="xs:string"/>
                  <xs:attribute name="length" type="xs:integer"/>
               </xs:complexType>
            </xs:element>
         </xs:sequence>
         <xs:attribute name="description" type="xs:string"/>
         <xs:attribute name="name" type="xs:string"/>
         <xs:attribute name="staticInfo" type="xs:string" default="one"/>
         <xs:attribute name="year" type="xs:gYear"/>
      </xs:complexType>
   </xs:element>
</xs:schema>

Any hint what went wrong?
21 REPLIES 21

janv
Employee
Employee
This looks OK. I tried it (with Firefox 2.0.0.11) and can create a new DM form (XML) instance with repeated elements. Can you please provide more details about your environment and test data ?

Thanks,
Jan

padukka
Champ in-the-making
Champ in-the-making
I got the same problem. When I used new ECM forms for XML creation, I was able to create XML content correctly.But when I want to edit created file, I could not retrieve date field that is there in the XML. Is this a bug..? hope someone will help. My XSD is as follows..

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
   xmlns:pr="http://www.icta.lk/Individual_Business"
   xmlns:alf="http://www.alfresco.org"
   targetNamespace="http://www.icta.lk/Individual_Business"
   elementFormDefault="qualified">


    <xs:element name="Individual" type="pr:Business"><xs:annotation><xs:appinfo><alf:label>${individual}</alf:label></xs:appinfo></xs:annotation></xs:element>

    <xs:complexType name="Business">
       <xs:sequence>
          <xs:element name="Business_Name" type="xs:normalizedString"><xs:annotation><xs:appinfo><alf:label>${business_name}</alf:label></xs:appinfo></xs:annotation></xs:element>
          <xs:element name="Nature_of_the_Business" type="xs:normalizedString"><xs:annotation><xs:appinfo><alf:label>${nature_of_business}</alf:label></xs:appinfo></xs:annotation></xs:element>
          <xs:element name="The_Place_of_the_Business" type="xs:string"><xs:annotation><xs:appinfo><alf:label>${business_address}</alf:label></xs:appinfo></xs:annotation></xs:element>
          <xs:element name="The_Date_of_Commencement_of_the_Business" type="xs:date"><xs:annotation><xs:appinfo><alf:label>${started_date}</alf:label></xs:appinfo></xs:annotation></xs:element>         
          <xs:element name="Aliases_for_Business" type="xs:normalizedString"><xs:annotation><xs:appinfo><alf:label>${business_alias}</alf:label></xs:appinfo></xs:annotation></xs:element>
          <xs:element name="Full_Name_of_Owner" type="xs:normalizedString"><xs:annotation><xs:appinfo><alf:label>${full_name_of_owner}</alf:label></xs:appinfo></xs:annotation></xs:element>
          <xs:element name="Aliases_for_Owner" type="xs:normalizedString"><xs:annotation><xs:appinfo><alf:label>${aliases_for_owner}</alf:label></xs:appinfo></xs:annotation></xs:element>
          <xs:element name="Nationality_of_the_owner" type="xs:normalizedString"><xs:annotation><xs:appinfo><alf:label>${nationality}</alf:label></xs:appinfo></xs:annotation></xs:element>
          <xs:element name="Residence_of_the_Owner" type="xs:string"><xs:annotation><xs:appinfo><alf:label>${residence_address}</alf:label></xs:appinfo></xs:annotation></xs:element>          
          <xs:element name="Other_Businesses_of_the_Owner" type="xs:normalizedString"><xs:annotation><xs:appinfo><alf:label>${other_businesses}</alf:label></xs:appinfo></xs:annotation></xs:element>
       </xs:sequence>
    </xs:complexType>

</xs:schema>


Janaka

stevo
Champ in-the-making
Champ in-the-making
This looks OK. I tried it (with Firefox 2.0.0.11) and can create a new DM form (XML) instance with repeated elements. Can you please provide more details about your environment and test data ?

Thanks,
Jan

My environment is as follows:
* Virtualised on qemu
* GNU/Linux, Kernel 2.6.23
* Java "1.5.0_06-b05"
* Firefox 2.0.0.11

Test data were some simple words like "one", "two" etc. Nothing too complicated.

kvc
Champ in-the-making
Champ in-the-making
Hmmm …

One simple thing to test first is to put your type definitions at the top of your schema prior to your root element.  There may be a sensitivity to referencing a type that is defined later in the schema document.

Kevin

samuel_penn
Champ in-the-making
Champ in-the-making
Has any solution/reason been discovered for this? I'm using Firefox 2.0.0.13 on Linux, and when I try to add an element to a web form (by clicking one of the green 'add' buttons) all I get is the 'Loading (2)' message at the top right of the page, and no visible change. If I save the form, and reload it, then the element has been added as many times as I clicked the button. If I click multiple times, then the number after the 'Loading' increments by 2 each time.

Presumably, whatever is modifying the DOM on the page is failing. I see the same issue with Seamonkey on the same client. There are no browser plugins enabled/installed which should affect things (e.g., I don't have NoScript).

Alfresco server is 2.9B, running on Gentoo Linux.

EDIT: Just noticed that if I click 'Back' (on the form, not the browser back button) after trying to add an element, then 'Next' to force a redraw of the web form, then the new elements are there. The backend data is being created, but the front end is not being updated.

EDIT AGAIN: Though that trick only works the first time content is created. When editing existing content, there isn't a 'Back' option available.

Sam.

kvc
Champ in-the-making
Champ in-the-making
Do you see the same issue when using the same form within a WCM Web Project?

Kevin

samuel_penn
Champ in-the-making
Champ in-the-making
Do you see the same issue when using the same form within a WCM Web Project?

Kevin

This is all within a WCM Web Project, from the 'Create Web Content' wizard. Now I'm at work, I've tried connecting to my server from an MS Windows client, and I see the same problem when using Mozilla. However, IE does appear to work. The version of Mozilla I'm using works correctly against Alfresco 2.1, and doesn't display any errors in the javascript console when running against the 2.9B server.

Sam.

kvc
Champ in-the-making
Champ in-the-making
OK … can you attach your XSD?

Kevin

samuel_penn
Champ in-the-making
Champ in-the-making
Just to double check, I created a web form with this on Alfresco 2.1, and it works fine (i.e., when entering data into the form, clicking on the green '+' icons properly adds new elements onto the form). Also note, I've got several different forms, and they all fail to add elements in 2.9B.


<?xml version="1.0"?>
<!–

This is a form for a page item.
–>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:p="http://glendale.org.uk/alfresco/page"
           targetNamespace="http://glendale.org.uk/alfresco/page"
           elementFormDefault="qualified">

    <xs:element name="page">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="header" type="p:headerType"/>
                <xs:element name="sidebar" type="p:sidebarType" minOccurs="0" maxOccurs="5"/>
                <xs:element name="body" type="p:bodyType" minOccurs="1" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:complexType name="headerType">
        <xs:sequence>
            <xs:element name="title" type="xs:normalizedString"/>
            <xs:element name="abstract" type="xs:string" minOccurs="0"/>
            <xs:element name="style" type="xs:normalizedString" default="default.css"/>

            <xs:element name="logo" type="xs:normalizedString" minOccurs="1" default="images/yags.png"/>
            <xs:element name="subject" type="xs:normalizedString" minOccurs="0"/>

            <xs:element name="category" minOccurs="1" maxOccurs="1">
                <xs:simpleType>
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="Character"/>
                        <xs:enumeration value="Notes"/>
                        <xs:enumeration value="Rules"/>
                        <xs:enumeration value="Setting"/>
                    </xs:restriction>
                 </xs:simpleType>
            </xs:element>

            <xs:element name="keyword" type="xs:normalizedString" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="sidebarType">
        <xs:sequence>
            <xs:element name="url" type="xs:normalizedString"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="bodyType">
        <xs:sequence>
            <xs:element name="heading" type="xs:normalizedString" minOccurs="0"/>
            <xs:element name="image" type="xs:normalizedString" minOccurs="0"/>
            <xs:element name="text" type="xs:string" minOccurs="1" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>
</xs:schema>