Message Boards

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

Problem in Master - detail Relationship at MultiLevel.

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Hi everyone,
Please help me out to write XML for the Attached UML diagram (product specification.JPG).

At first level of one to many master detail relationship is working,
But if i drill down to further level to accomplish one to many relationship i get below errors: (i.e when ant is executes)

characteristicId is already defined in reciveEvent.
Attachment

Attachments: product specification.JPG (78.9k)

RE: Problem in Master - detail Relationship at MultiLevel.
Answer
11/30/11 12:16 PM as a reply to chethan dhananjaya.
chethan dhananjaya:
Hi everyone,
At first level of one to many master detail relationship is working,
But if i drill down to further level to accomplish one to many relationship i get below errors: (i.e when ant is executes).


Could you attach your XML?.

It will be helpful if you paste the error too.


Saludos,

David.

RE: Problem in Master - detail Relationship at MultiLevel.
Answer
11/30/11 1:40 PM as a reply to David Navarro.
Hi David Navarro,

Thanks for reply
Below are the errors what im getting: Also I've attached productSpec.xml file for your referenece.

compile-java:
Compiling 42 source files to F:\Code Home\plugins\liferay-plugins-sdk-6.0.2\portlets\productSpec-portlet\docroot\WEB-INF\classes
F:\Code Home\plugins\liferay-plugins-sdk-6.0.2\portlets\productSpec-portlet\docroot\WEB-INF\src\org\xmlportletfactory\portal\example01\ProductSpecCharacteristicPortlet.
java:449: qNameProductSpecCharacteristic is already defined in reciveEvent(javax.portlet.EventRequest,javax.portlet.EventResponse)
QName qNameProductSpecCharacteristic = new QName("http://liferay.com/events", "ProductSpecCharacteristic.characteristicId");
^
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error

BUILD FAILED
F:\Code Home\plugins\liferay-plugins-sdk-6.0.2\XMLPortletFactory\productSpec-xmlportletfactory\build.xml:26: The following error occurred while executing this line:
F:\Code Home\plugins\liferay-plugins-sdk-6.0.2\build-common-plugin.xml:480: The following error occurred while executing this line:
F:\Code Home\plugins\liferay-plugins-sdk-6.0.2\build-common.xml:90: Compile failed; see the compiler error output for details.

Total time: 28 seconds

F:\Code Home\plugins\liferay-plugins-sdk-6.0.2\XMLPortletFactory\productSpec-xmlportletfactory>
Attachments: productSpec.xml (10.1k)

RE: Problem in Master - detail Relationship at MultiLevel.
Answer
12/1/11 12:18 PM as a reply to David Navarro.
Hi David,

Do u need some more details on this particular problem?

Thanks in advance,
Chethan

RE: Problem in Master - detail Relationship at MultiLevel.
Answer
12/1/11 3:22 PM as a reply to chethan dhananjaya.
Sorry Chethan. I can't help you.

I expected to see some kind of error in your XML, but I think it's correct.


Best regards,

David,

RE: Problem in Master - detail Relationship at MultiLevel.
Answer
12/1/11 9:16 PM as a reply to chethan dhananjaya.
Hello Chethan,

Is very nice to have you here, feel welcome.

I have seen the problem you are having, and is a very ease thing, just remove the empty <detailFiles>, the thing is that the program does not check if they are empty, and tries to generate code for detail files and .....plaf..error.

I removed the lines, and attached result xml definition file. (also the generated war).

While I was looking for the problem I have found a bug, where a detail file of a detail file with two detail files (your corresponding "ProductSpectCharacteristic"), will have a duplicate variable name. I have corrected the velocity template, and I will upload a new version this weekend. mean while if you want to patch your xmlportletfactory, go to Portlet_XXXXXXPortlet_java.vm file and coment (put ### in front) line 867 and 870 like this:

1### #foreach($detailfile2 in $application.getDetailFiles().getDetailFileArray())
2        QName qName${application.getClassDef().getName()} = new QName("http://liferay.com/events", "${application.getClassDef().getName()}.${detailfile2.getConnectionFieldName()}");
3        response.setEvent(qName${application.getClassDef().getName()}, "0");
4### #end


Now you can generate with our errors.


Saludos, Jack.emoticon
Attachments: productSpec-portlet-6.0.6.1.war (1,080.8k), productSpec.xml (8.9k)

RE: Problem in Master - detail Relationship at MultiLevel.
Answer
12/2/11 11:04 AM as a reply to Jack A. Rider.
Thanks a lot Jack. emoticon

Its working great !!!

Regards,
Chethan