Message Boards

« Back to 2.- Usage ( From Xml file to CRUD Portlet)

Bug in XMLPF-6.x-v1.6-beta: application classDef name

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
If you create an application with <application> <classDef><name> as "CivilStatus" it will work fine,
but if you use it to create a relationship with other application it will not compile. Use "Civilstatus"


For example. "CivilStatus" works fine:

 1        <application>
 2            <classDef>
 3                <name>CivilStatus</name>
 4                <title>Estado Civil</title>
 5                <restrictBy>
 6                        <userId>false</userId>
 7                </restrictBy>
 8            </classDef>
 9            <fileDef>
10                <name>civilstatus</name>
11                <fields>
12                    <field>
13                        <name>civilStatusId</name>
14                        <title>CivilStatus PK Id</title>
15                        <type>
16                            <long>
17                                <length>5</length>
18                                <signed>false</signed>
19                                <nullable>false</nullable>
20                            </long>
21                        </type>
22                        <showFieldInView>false</showFieldInView>
23                    </field>                  
24                    <field>
25                        <name>cstDesc</name>
26                        <title>Description</title>
27                        <type>
28                            <varchar>
29                                <length>50</length>
30                                <order>true</order>
31                                <filter>true</filter>
32                            </varchar>
33                        </type>
34                        <showFieldInView>true</showFieldInView>
35                        <required>true</required>
36                    </field>
37                </fields>
38            </fileDef>
39        </application>



but, if you connect "CivilStatus" with other application XMLPortletFactory generates a code that doesn't compile:

 1
 2        <application>
 3            <classDef>
 4                <name>Person</name>
 5                <title>Person</title>
 6                <restrictBy>
 7                        <userId>false</userId>
 8                </restrictBy>
 9            </classDef>
10            <fileDef>
11                <name>person</name>
12                  <fields>
13                     [ .... ]
14
15                    <field>
16                        <name>civilStatusId</name>
17                        <title>Estado Civil</title>
18                        <type>
19                            <long>
20                                <length>5</length>
21                                <signed>false</signed>
22                                <nullable>true</nullable>
23                            </long>
24                        </type>
25                        <showFieldInView>true</showFieldInView>
26                        <required>false</required>
27                        <validation>
28                <className>[b]CivilStatus[/b]</className>
29                <fieldName>civilStatusIdId</fieldName>
30                <orderByField>cstDesc</orderByField>
31                        </validation>
32                    </field>
33                   
34                </fields>
35            </fileDef>
36        </application>



Remember:

wrong : CivilStatus
correct: Civilstatus


Plus:
You need a "double Id" here:
<validation>
<className>CivilStatus</className>
<fieldName>civilStatusIdId</fieldName>
<orderByField>cstDesc</orderByField>
</validation>
were the field name was civilStatusId

RE: Bug in XMLPF-6.x-v1.6-beta: application classDef name
Answer
12/1/11 8:29 PM as a reply to David Navarro.
Hola David,

Thank you for your participation. I have tested your xml, with "CivilStatus" camel case and is working fine for me, so I believe I didnot understand exactly what you mean. I am very interested in solving this letter case things, as you can see in Dieters post, I will work on it this weekend. Please see to ampliate information on the "double ID" a field, thats extra extrange. Should be some problem with hidden, or escape chars on the editor, I have not seen any reason for that behaviour.

Any way, find attached the xml definition file for your test case, as I have understand it. See to make any corrections and post it again.

Thanks. Jack.
Attachments: civilStatus.xml (3.7k)