| Author |
Message |
|
2007/08/25 07:04
|
|
|
jm_fra
Joined: 2007/08/25
Messages: 4
Offline
|
|
|
|
Hi,
I am currently working on a project where I have to customize the Java code generation of Visual Paradigm.
I am confronted to this problem :
I am very interested in loading and parsing some Reference files in Java class operations. I don't know if it is possible, but the following part of code in JavaOperation.vm makes me think it is :
#if( $operation.hasReference() == true )
#parse("$template-dir/$operation.getReference().getRefTemplate()") |
By the way, I don't understand this code. I put a referenced file to an operation but the following test fails :
#if( $operation.hasReference() == true ) |
So, Is it possible to parse a referenced file added in an operation ? If yes, how ?
Best regards
|
|
|
|
 |
| |
|
2007/08/27 11:17
|
|
|
Jick
Joined: 2005/04/29
Messages: 2881
Offline
|
|
|
|
Dear jm_fra,
Thank you for your post. The "reference" is created during code generation for generating operation body. It is not the referenced file.
We suppose code generation does not require the knowledge of referenced files. May I know why you have this need?
Best regards,
Jick
|
Visual Paradigm International Ltd.
http://www.visual-paradigm.com
Build Quality Applications Faster, Better and Cheaper |
|
|
|
 |
| |
|
2007/08/28 09:34
|
|
|
jm_fra
Joined: 2007/08/25
Messages: 4
Offline
|
|
|
|
Hi Jick, thanks for the answer
Ok, so I misunderstood it.
Actually, we want to generate some specific Java code for operations, and then inject it in the operation bodies during the VP code generation. However, we are obliged to use class diagrams only. We thought we could generate oursleves this code in files which would be parsed during generation.
Anyway, as it seems we may have to look for another way, is there a possibility to access to fields of forms specificiations, such as "Comments" (not "Documentation") or the tagged values ?
Regards
|
|
|
|
 |
| |
|
2007/08/30 18:38
|
|
|
Jick
Joined: 2005/04/29
Messages: 2881
Offline
|
|
|
|
Hi jm_fra,
We've enhanced our template supported to allow you retrieve tagged value and comments. First, download the patch at:
http://files3.visual-paradigm.com/200708/Patch/6-1-0_20070830a/VP_Suite_Windows_3_1_20070830a.exe
Then, run it by overwriting the current installation. You will be able to access the following calls:
${object}.commentIterator() : Iterator
${object}.commentCount() : int
${object}.commentArray() : TemplateComment[]
${object}.commentAt(int) : TemplateComment
Here is the operations supported by TemplateComment:
getSummary() : String // Same as getName()
getAuthor() : String
getDateTime() : String
getContent() : String // Same as getDocumentation()
Tagged Value can be access by:
${object}.taggedValueIterator() : Iterator
${object}.taggedValueCount() : int
${object}.taggedValueArray() : TemplateTaggedValue[]
${object}.taggedValueAt(int) : TemplateTaggedValue
${object}.getTaggedValue(String) : TemplateTaggedValue
${object}.getTaggedValueIgnoreCase(String) : TemplateTaggedValue
${object}.hasTaggedValue(String) : boolean
${object}.hasTaggedValueIgnoreCase(String) : boolean
For IG-Java, those operation body is generated as below ===
[Normal operation]
JavaOperation.vm // This may forward the body generation to other .vm
[Association many side (Setter)]
JavaAssociation_Add.vm
JavaAssociation_Remove.vm
[Association many side (Getter)]
JavaAssociation_To.vm
[Association one side (Setter)]
JavaAssociation_Set.vm
[Association one side (Getter)]
JavaAssociation_Get.vm
[Association class (Setter)]
JavaAssociationClass_Set.vm
[Association class (Getter)]
JavaAssociationClass_Get.vm
[Attribute (Setter)]
JavaAttribute_Set.vm
[Attribute (Getter)]
JavaAttribute_Get.vm
Hope this helps. Feel free to contact us if there are any questions.
Best regards,
Jick
|
Visual Paradigm International Ltd.
http://www.visual-paradigm.com
Build Quality Applications Faster, Better and Cheaper |
|
|
|
 |
| |
|
2007/08/31 09:06
|
|
|
jm_fra
Joined: 2007/08/25
Messages: 4
Offline
|
|
|
|
Jick,
Thanks a lot for this patch, this is exactly what we needed !
Speaking of which, the access to original documentation is ok too (see this topic).
Double thanks!
Best regards
|
|
|
|
 |
| |
|
2007/08/31 09:09
|
|
|
Jick
Joined: 2005/04/29
Messages: 2881
Offline
|
|
|
|
|
 |
| |