cancel
Showing results for 
Search instead for 
Did you mean: 

web forms editing and creation

robain
Champ in-the-making
Champ in-the-making
I was trying to figure out web forms and created two XSD files. when i am creating/editing files everything seems to be fine till i have only one xsd or web form. But when I have two web forms I always get an error when trying to create or edit forms of one type. The error I get is  java.lang.IllegalArgumentException: instance document root tag name invalid. expected SOMETHING, got SOMETHING_ELSE. where SOMETHING and SOMETHING_ELSE are the two different web forms. Am i missing some configuration here ? Appreciate if anyone has any idea.

Thanks
9 REPLIES 9

robain
Champ in-the-making
Champ in-the-making
further details:
seems like while editing, the last schema added during the project settings is used to generate the web form no matter which schema was utilized to create the document in the beginning. is this a bug ?

Thanks

pmonks
Star Contributor
Star Contributor
This is the as-designed behaviour, since it's a fairly common requirement to have to add, modify or remove fields in a Web Form after the Web Form has been in use for some time.  If a user edits an instance of that Web Form that has the old structure, we present the old data in the new Web Form, so that the item will be upgraded upon save.

That said, if you're seeing exceptions when loading up an old instance of a modified Web Form then that would be a bug - the Web Form functionality is supposed to load the old data in a "best effort" fashion, ignoring any fields that no longer exist, have changed data type in an incompatible way etc. etc.

Cheers,
Peter

robain
Champ in-the-making
Champ in-the-making
sorry seems like i didnt communicate the problem well. I am not talking about two versions of the same form. I am talking about two different forms altogether. if I have two web forms in a project. Whenever i edit a document which i created using any one of those two forms, the one that was created using the first form added during the setting of web application will fail. seems like it utilizes the second added to the webapp configurations all the time nomatter which web form was utilized to generate the file while creating it.

eg.
i configure a web project and add you schema definitions schema1 and schema2. now i create two files with those two forms form1.xml and form2.xml respectively. now  when i go ahead and try to edit them, one will work fine while the other will say something like "instance document root tag name invalid. expected schema1, got schema2" when i am actually trying to edit a file created with schema1. not sure about which will work and which one wont but thats the general scenario. is this as designed? so how do i edit the file created with schema1 ??

Thanks

pmonks
Star Contributor
Star Contributor
Ah ok that is odd!  Which version of Alfresco are you using?

Cheers,
Peter

robain
Champ in-the-making
Champ in-the-making
the labs version.

pmonks
Star Contributor
Star Contributor
Which version of Labs though - 2.1, 2.9, 3.0, an earlier version?

robain
Champ in-the-making
Champ in-the-making
3.0.0

gbarala
Champ in-the-making
Champ in-the-making
how to create folder structure in web projects for eg:-

when we create web project "Marketing" in this we will create so many web forms(Templates) like About us, accessibility, customers etc…. means when we create template reg About us the template should go to About us.

So how in alfresco we will create folders in web projects……. Smiley Very Happy

vijay_alfresco
Champ in-the-making
Champ in-the-making
You can define the output paths for your xsd and template or just for template as follows


/${webapp}/AboutUs/${name}.xml – for AboutUs webform
/${webapp}/accessibility/${name}.xml – accessibility

…………

Hope this helps, please let me know if this is not you have asked for.

Thanks,
Vijay