Bug 196687 - teneo should support commenting the output hbm
Summary: teneo should support commenting the output hbm
Status: VERIFIED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: Teneo (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Martin Taal CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2007-07-16 13:29 EDT by jason henriksen CLA
Modified: 2008-05-27 19:19 EDT (History)
0 users

See Also:


Attachments
patch to support commenting the hbm file (7.66 KB, patch)
2007-07-16 13:33 EDT, jason henriksen CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description jason henriksen CLA 2007-07-16 13:29:22 EDT
I would be cool if Teneo could look at the documentation tags from the XSD/ECore and put those comments in the output hbm file.  I'll submit a fix that does this.
Comment 1 jason henriksen CLA 2007-07-16 13:33:11 EDT
Created attachment 73870 [details]
patch to support commenting the hbm file 

cheers
Comment 2 Martin Taal CLA 2007-07-17 09:02:22 EDT
Hi Jason,
Thanks, do you have an xsd with a documentation example?

Btw, I changed your code here and there and moved it to a separate method:
	/** Add a comment element, if the eModelElement has documentation */
	protected void addCommentElement(EModelElement eModelElement, Element hbmElement) {
		final String commentData = EcoreUtil.getDocumentation(eModelElement);
		if (commentData != null) {
			final Element comment = hbmElement.addElement("comment");
			comment.addText(commentData.replace('\'', ' ').replace('"', ' '));
		}
	}

I got rid of the npe by changing the code in other locations. I saw that also in case there was no comment you still placed a 'no comment present' comment. To me it feels that this less usefull for most people.

Comment 3 Martin Taal CLA 2007-07-17 09:03:02 EDT
Sorry forget my request for the documentation example, I found the xsd's you sent me earlier.

gr. Martin
Comment 4 Martin Taal CLA 2007-07-17 10:28:05 EDT
This has been committed to cvs.
Comment 5 Martin Taal CLA 2007-07-18 17:38:14 EDT
Solved in build  I200707181657

Thanks for your contribution.

gr. Martin
Comment 6 Nick Boldt CLA 2008-01-28 16:57:04 EST
Move to verified as per bug 206558.