Creating documentation in XSD's

Jick - first feedback on 3.1…

The new VM files work rather well, I have added my alternate documentation code and it works with no problem (as long as I remember to replace $class with $attribute in the right place :wink:

xs:restriction@base must come before any restriction. there is an implicit sort order in the Tagged Values (the top one is processed first, then the 2nd etc)

The namespace “xs:” is automatically added to any value (in the early access I had to have a value of “xs:string” which now gives “xs:xs:string”. Whilst not a problem for the data types it means that any maxLength or other value for xs:restriction/xs:maxLength@value gives “xs:3” which is a big problem!

I have looked through the VM code and it is not being generated from XsdXmlNode.vm so it must be part of the $node library.

Hope this makes sense…

I will talk to our engineers about this. Thank you. :slight_smile: :slight_smile:

Hi Toby,

The problem of appending “xs” incorrectly has been fixed. Please download the patch at:
http://files3.visual-paradigm.com/200708/Patch/6-1-0_20070801u/VP_Suite_Windows_3_1_20070801u.exe

Enjoy!

Best regards,
Jick

Thanks Jick - can I have a patch for the Mac version please? I would like to try it on my production machine.

HI Toby,

Sure. Here is the download link of the Mac version:
http://files3.visual-paradigm.com/200708/Patch/6-1-0_20070801y/VP_Suite_MacOSX_3_1_20070801y.dmg

Best regards,
Jick

Hi Jick - installs and removes that issue…

One more for your engineers:

When I have a class with a one way association to another (only one Navigatable=true statement in the role) I cannot get any documentation. If I use the normal $attribute.t_getDocumentation($indenter.getIndentation()) statement then I can get it but with the CDATA section but if I use $utilities.getOriginalDocumentation($OBJECTNAME, $args.get(“property”)) then it does not return anything.

Having looked at the other examples for other languages I have tried association, assoicationEnd but there is a reference to $class.toAssociationIterator() which I am not sure how it works…

Am I sort of on the right track or have I just confused you? :wink:

First diagram is a simple class model, the second file is the VP xsd routine the third is mine using $utilities.

I will post up my vm file in the next post
normal.xsd

Class Diagram1.jpg
untitled.xsd

and finally, my vm file that creates my schema
XsdElementAttribute.vm

Hi Toby,

I will talk to our engineers about this problem. Thank you.

Best regards,
Jick

Hi Toby,

The problem has been fixed. Please try, and let me know if it works. Thank you. Here is the patch:
http://files3.visual-paradigm.com/200708/Patch/6-1-0_20070812a/VP_Suite_MacOSX_3_1_20070812a.dmg

Best regards,
Jick

Hi Jick - provisional inspection seems to show it working…have you also changed the documentation elements to be in line with my expectations or have I just used my vm’s to generate an output? Either way, it looks rather good!

The next topic to play with is packages so expect some feedback in the coming days.

Another good result. I’ll let you know if I run into any problems.

I am off to a new project in September and will try to persuade them to adopt my tool of choice rather than the normal Visio or Rose…

hi Toby,

I couldn’t find out our conversation that discusses the request of in line. Could you direct me to the appropriate post? Sorry for any inconveniences it may cause you.

Have you been sending us suggestion/feature request about handling package? As I remember, there isn’t any discussion related to package support. Perhaps I missed again?

Best regards,
Jick

No no, Jick; I have not mentioned packages yet as I currently have everything in one package so there is no issue. I’m going to break out data types from the main classes so that they can be reused in other projects and I will keep you posted as to my experiences.

The documentation thing was the Role description being used in the XSD generation; this seems to be implemented in the current VM set for XSD and from the look of it the files I am using are VP files rather than my own. Either way, it generates exactly what I would expect!

Currently I have nothing outstanding with you other than my gratitude for the work that you and your engineers have put in to solve my problems.

Thanks Toby. If you have any suggestions, please do not hesitate to contact me again. :smiley: :smiley: :smiley:

Hi, I think I have the same problem as Toby, but I can’t manage in fixing it. :frowning:

I need to extract the content of a documentation of a java class operation without CDATA too. I downloaded and installed the patch you provided (the 20070724c one, the last version for this problem) and I still can’t make it work.
Here the template for JavaOperation.vm (just added $utilities and $class prints and the access call to the documentation content)

  $operation.t_prepare($args.get("property"))#*
*### ===== Output =====
$utilities
$class
$utilities.getOriginalDocumentation($operation, $args.get("property")) 
$operation.t_getDocumentation("$baseIndentation$indentation")$baseIndentation$indentation$operation.t_getVisibility()
$operation.t_getNative()$operation.t_getSynchronized()$operation.t_getScope()$operation.t_getFinal()$operation.t_getAbstract()
$operation.t_getReturnTypeName($rootClass)$operation.t_getReturnTypeModifier()#**#$operation.getName()(#set( $parameterIndex = 0 )
#foreach($parameter in $operation.parameterIterator())#if ( $parameterIndex > 0 ), #end#parse("$template-dir/JavaParameter.vm")
#set( $parameterIndex = $parameterIndex + 1 )
#end
)#set( $exceptionIndex = 0 )
#foreach($exception in $operation.raisedExceptionIterator())#if ( $exceptionIndex == 0 ) throws #else, #end#parse("$template-dir/JavaException.vm")
#set( $exceptionIndex = $exceptionIndex + 1 )
#end
#if ( $operation.isAbstract() || $operation.t_isParentInterface() );#else {
#if( $operation.hasReference() == true )
#parse("$template-dir/$operation.getReference().getRefTemplate()")
#else
$baseIndentation$indentation$indentation#**#throw new RuntimeException("Not yet implemented");
#end
$baseIndentation$indentation}#end

generates the following code :

 com.vp.instantgenerator.java.JavaUtilities@1ccb1ae
com.vp.instantgenerator.java.JavaClass@1a5469e
$utilities.getOriginalDocumentation($operation, $args.get("property")) 
	/**
	 * test_comment
	 */
	public boolean test_operation(double a, short b) {
		throw new RuntimeException("Not yet implemented");
	}

I don’t understand why the call to $utilities.getOriginalDocumentation($operation, $args.get(“property”)) still doesn’t work ?

Regards

Hi jm_fra,

Your problem is different from Toby’s as getOriginalDocumentation was made only for XSD. But it is now ready for Java as well. Please download the patch at:
http://files3.visual-paradigm.com/200708/Patch/6-1-0_20070821q/VP_Suite_Windows_3_1_20070821q.exe

Please run it and overwrite the existing installation. Sample code:

$object = ... // retrieve something

$utilities.getOriginalDocumentation($object, $args.get("property"))
// Will return the documentation of the object without any modification

Best regards,
Jick