| Author |
Message |
|
2007/07/19 20:56
|
|
|
TobyAnscombe
Joined: 2007/01/10
Messages: 43
Offline
|
|
|
|
Jick,
I am trying to put an if/then switch in for a document block. I currently have some code:
$indenter.getIndentation()<xs:annotation>
$indenter.getIndentation()<xs:documentation>
$class.t_getDocumentation($indenter.getIndentation())</xs:documentation>
$indenter.getIndentation()</xs:annotation>
which generates a nice documentation block in one of my schema.
What I would like to know is the following:
1) How can I test for the presence of documentation?
If documentation <>""
....write document block...
end
2) In the $class.t_getDocumentation($indenter.getIndentation()) call is it ossible to remove the CDATA code that is automatically added?
|
|
|
|
 |
| |
|
2007/07/20 11:59
|
|
|
Jick
Joined: 2005/04/29
Messages: 2880
Offline
|
|
|
|
Hi Toby,
I will consult our engineers and then come back to you. By the way, have you tried the early access I sent you with regards to the modeling and generation of XSD?
Best regards,
Jick
|
Visual Paradigm International Ltd.
http://www.visual-paradigm.com
Build Quality Applications Faster, Better and Cheaper |
|
|
|
 |
| |
|
2007/07/20 16:25
|
|
|
TobyAnscombe
Joined: 2007/01/10
Messages: 43
Offline
|
|
|
|
Hi Jick - sorry, I meant to get back to you...
Its working perfectly! because of how your engineers have implemented it as a feature I can add any restriction I like from strings to integers.
I have added a couple of default params to make it a bit easier so anything that is stereotyped as xsdSimpleType automatically has a base and restriction added. The only thing missing (and no, I dont expect you to add it) would be to allow inheritance - a superclass with string and a subclass with length=10 or something similar.....
The reason for the code request above is so that I can publish the modified instant generator code for others to use in the future.
Please pass on my thanks to your dev's for a fine piece of work!
|
|
|
|
 |
| |
|
2007/07/21 18:43
|
|
|
Jick
Joined: 2005/04/29
Messages: 2880
Offline
|
|
|
|
Hi Toby,
With regard to your two questions...
1) We have made a fix (See below for the URL of fix). You can check $utilities.getOriginalDocumentation($THE_OBJECT, $args.get("property"))
For example:
#set( $originalDocumentation = $utilities.getOriginalDocumentation($THE_OBJECT, $args.get("property")) )
#if ( $originalDocumentation && $originalDocumentation != "" )
...
#end
2) It is not possible to remove CDATA from t_getDocumentation()
but you can get the original documentation by $utilities.getOriginalDocumentation($THE_OBJECT, $args.get("property"))
Here is the URL for the fix of the first template problem:
http://files3.visual-paradigm.com/200707/Patch/sp2_20070712u/VP_Suite_Windows_3_0_sp2_20070712u.exe
Please download this and install by overwriting the current installation. Notice that this is a patch for the current release. If you want a patch for the early access release I sent you earlier, please let me know and we will arrange it for you.
Best regards,
Jick
|
Visual Paradigm International Ltd.
http://www.visual-paradigm.com
Build Quality Applications Faster, Better and Cheaper |
|
|
|
 |
| |
|
2007/07/21 19:00
|
|
|
TobyAnscombe
Joined: 2007/01/10
Messages: 43
Offline
|
|
|
|
Cheers Jick, could you make it avalible for the OSX version of the early access version please?
BTW - you do realize that its Saturday!
|
|
|
|
 |
| |
|
2007/07/21 19:04
|
|
|
Jick
Joined: 2005/04/29
Messages: 2880
Offline
|
|
|
|
Hi Toby,
Yes, I do aware
Oh, I just didn't aware that you use the Mac version. Please wait...
Best regards,
Jick
|
Visual Paradigm International Ltd.
http://www.visual-paradigm.com
Build Quality Applications Faster, Better and Cheaper |
|
|
|
 |
| |
|
2007/07/21 19:21
|
|
|
Jick
Joined: 2005/04/29
Messages: 2880
Offline
|
|
|
|
|
 |
| |
|
2007/07/23 09:49
|
|
|
Jick
Joined: 2005/04/29
Messages: 2880
Offline
|
|
|
|
Hi Toby,
With regard to the comment you posted earlier:
The only thing missing (and no, I dont expect you to add it) would be to allow inheritance - a superclass with string and a subclass with length=10 or something similar.....
|
Do you mean the ability to model the following in class diagram?
<xsd:simpleType name="foo">
<xsd:restriction base="xsd:string">
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="bar">
<xsd:restriction base="foo">
<xsd:length value="2"/>
</xsd:restriction>
</xsd:simpleType> |
Best regards,
Jick
|
Visual Paradigm International Ltd.
http://www.visual-paradigm.com
Build Quality Applications Faster, Better and Cheaper |
|
|
|
 |
| |
|
2007/07/23 18:31
|
|
|
TobyAnscombe
Joined: 2007/01/10
Messages: 43
Offline
|
|
|
|
Hi Jick - thats the sort of thing; no doubt it works and I have just not tried it...
I do have a problem with the other fix for documentation. I have the following as code:
$indenter.getIndentation()<xs:element name="$class.getName()">
$indenter.push($indentation)##
$indenter.getIndentation()<xs:annotation>
$indenter.getIndentation()<xs:documentation>
$utilities.getOriginalDocumentation($class, $args.get("property")) </xs:documentation>
$indenter.getIndentation()</xs:annotation>
$indenter.getIndentation()<xs:complexType>
$indenter.push($indentation)##
and I get an output which looks like:
<xs:annotation>
<xs:documentation>
$utilities.getOriginalDocumentation($class, $args.get("property")) </xs:documentation>
</xs:annotation>
Can you highlight what I am doing wrong please?
|
|
|
|
 |
| |
|
2007/07/23 21:22
|
|
|
Jick
Joined: 2005/04/29
Messages: 2880
Offline
|
|
|
|
Hi Toby,
The information is not enough for us to identify the problem. Could you send us your log file? You can find it under the bin folder of VP Suite. I would be grateful if you can send me your project as well. If you can't post here, you can send to my Email address directly:
jick@visual-paradigm.com
Best regards,
Jick
|
Visual Paradigm International Ltd.
http://www.visual-paradigm.com
Build Quality Applications Faster, Better and Cheaper |
|
|
|
 |
| |
|
2007/07/23 22:18
|
|
|
TobyAnscombe
Joined: 2007/01/10
Messages: 43
Offline
|
|
|
|
Hi Jick,
I have included a zip file with the vp.log, the project and the modified XSD
generator files.
Sorry for the basic mail but my email server is under a bit of water at the
moment; for some reason the British summer seems to be a little on the wet
side so I am having to send this via my mobile phone.
One thing that I have noticed is there are two versions of VP - 20070716a (to
allow for schema types and restrictions) and 20070712u (to fix the
documentation). Not sure if it makes a difference....
Thanks again for such fantastic support over this; trust me when I say that I
have never had this level of support from a commercial company in 15 years of
IT!
Regards
T
| Description |
|
Download
|
| Filesize |
204 kb
|
| Downloaded: |
165 time(s) |
|
|
|
|
 |
| |
|
2007/07/23 22:26
|
|
|
TobyAnscombe
Joined: 2007/01/10
Messages: 43
Offline
|
|
|
|
...as you can see, it never made it by phone so cut 'n' paste works as well
|
|
|
|
 |
| |
|
2007/07/24 16:33
|
|
|
Jick
Joined: 2005/04/29
Messages: 2880
Offline
|
|
|
|
Hi Toby,
Have you run in both 20070716a and 20070712u? Both failed?
Best regards,
Jick
|
Visual Paradigm International Ltd.
http://www.visual-paradigm.com
Build Quality Applications Faster, Better and Cheaper |
|
|
|
 |
| |
|
2007/07/24 17:07
|
|
|
TobyAnscombe
Joined: 2007/01/10
Messages: 43
Offline
|
|
|
|
Hi Jick - just tried both versions (assuming that you can have them installed in separate directories with no problem) and they both fail....
Let me know if you want me to run any more tests
|
|
|
|
 |
| |
|
2007/07/25 20:23
|
|
|
Jick
Joined: 2005/04/29
Messages: 2880
Offline
|
|
|
|
Hi Toby,
20070712u should include the bug fix required for making it works. We suspect that you have overwritten $utilities, $class or $args.
To test if $utilities is overwritten or not, print $utilities in the .vm to see the result. It should display something like vp.com.instantgenerator.xsd.XsdUtilities@...
Best regards,
Jick
|
Visual Paradigm International Ltd.
http://www.visual-paradigm.com
Build Quality Applications Faster, Better and Cheaper |
|
|
|
 |
| |