[gme-users] JavaBON fixes

Peter Volgyesi peter.volgyesi at vanderbilt.edu
Tue Mar 14 09:00:42 CST 2006


Alex,

Thank you for your patches. I've applied them on the GME CVS repository, our
upcoming release will include them all (though your problem with
JBuilderModelReference.getReferred() remained unresolved).
Thanks again,

--
Peter Volgyesi
Vanderbilt University, ISIS  

> -----Original Message-----
> From: gme-users-bounces at list.isis.vanderbilt.edu 
> [mailto:gme-users-bounces at list.isis.vanderbilt.edu] On Behalf 
> Of Alex Goos
> Sent: Saturday, February 18, 2006 9:09 AM
> To: gme-users at list.isis.vanderbilt.edu
> Subject: [gme-users] JavaBON fixes
> 
> Hello
> 
> Find here some Fixes to JavaBON as provided with GME 5.9.21. 
> Most errors occur when you use JavaBON for updating/creating 
> new Objects.
> In the mentioned methods replace the lines commented-out with 
> a // by the following one(s).
> 
> There remain some caveats in JavaBON, I just fixed the errors 
> my program encountered.
> Attached is a copy of gme.jar with the patches applied.
> 
> Alex
> 
> -------------------------------
> 
> CreateNewModel problem:
>  
> org.isis.mga.meta.MgaMetaModel:
> 
>    public MgaMetaRole getRoleByName( String name )
>    {
> //    return new MgaMetaRole( (Dispatch)call( "RoleByName", name ) );
>      return new MgaMetaRole( (Dispatch)get( "RoleByName", name ) );
>    }
> 
> 
> org.isis.mga.meta.MgaMetaFolder:
> 
>     public MgaMetaFCO getLegalRootObjectByName( String name )
>     {
>    //    return new MgaMetaFCO( (Dispatch)call( 
> "LegalRootObjectByName", 
> name ) );
>        return new MgaMetaFCO( (Dispatch)get( 
> "LegalRootObjectByName", name ) );
>     }
> 
>  
> SetAttribute problem:
> 
> org.isis.jaut.Dispatch:
> 
>    public void put(String dispName, Object arg0, Object value)
>    {
>        //invokeSub(dispName, DISPATCH_PROPERTYPUT, new 
> Object[] { value, arg0 }, DISPID_PROPERTYPUT_ARG);
>        invokeSub(dispName, DISPATCH_PROPERTYPUT, new Object[] 
> { arg0, value }, DISPID_PROPERTYPUT_ARG);
>    }
> 
> Create RootFolder Models Problem:
> 
> org.isis.gme.bon.JBuilderFolder
> 
>     public JBuilderModel createNewModel(String kindName)
>     {
>     ...
>         //return o;
>         rootModels.add(o);
>         return o;
>     }
> 
> CreateNewConnection Problem:
> 
> org.isis.gme.bon.JBuilderModel (line 733)
> 
>     public JBuilderConnection createNewConnection(String 
> connName, JBuilderObject source, JBuilderObject destination)
>     {
>     ...
>         //MgaSimpleConnection sconn = (MgaSimpleConnection)iconn;
>         MgaSimpleConnection sconn = new MgaSimpleConnection(iconn);
>     ...
>     }
> 
> CreateNewReference Problem
> 
> org.isis.gme.bon.JBuilderModel: (line 638)
>     public JBuilderModelReference 
> createNewModelReference(String refPartName, JBuilderObject refTo)
>     {   
>      ...
>         //MgaMetaRole role = metaModel.getRoleByName(partName);
>         MgaMetaRole role = metaModel.getRoleByName(refPartName);
>      ...
>     }
> 
> org.isis.gme.mga.MgaModel: (line 590)
>     public MgaFCO createReference( MgaMetaRole meta, MgaFCO target )
>     {
>     ...
>   
>         //Variant arguments[] = new Variant[2];
>         Variant arguments[] = new Variant[3];
>         arguments[0]        = new Variant(meta);
>         //arguments[1]        = new Variant(returned_fco_variant);
>         arguments[1]        = new Variant(target);
>         arguments[2]        = new Variant(returned_fco_variant);
>     ...
>     }
> 
> Other Problems:
> 
> Problem: Path of an Object cannot be read by getNamePath()
> Reason: parameters are passed "copy by value" in Java, so 
> getNamePath() fails.
> Note: The function's siganture changed! And I deliberatly 
> replaced the "_" separator by "#" as its much less frequent 
> in my object's names
> 
> org.isis.gme.bon.JBuilderObject
> public String getNamePath()
>     {    return this.getExtendedName("","#",true);
>     }
>    
>     public String getExtendedName(String extName, String 
> seperator, boolean startWithRoot)
>     {   
>         if(!startWithRoot)
>             extName += getName();
>         JBuilderObject parent = this.getParent();
>         if(parent!=null)
>         {    if(!startWithRoot)
>                 extName += seperator;
>             parent.getExtendedName(extName,seperator,startWithRoot);
>             if(startWithRoot)
>                 extName += seperator;
>         }
>         if(startWithRoot)
>             extName += getName();
>         return extName;
>     }
> 
> 
> 
> Another problem persits for MgaReference, but I couldnt 
> figure out the 
> exact reason. Sometimes, a newly created JBuilderModelReference's 
> getReferred() is Null. I help myself a with workaround, calling 
> .resolve() before accessing .getReferred() the first time...
> 
> ------------------------------------
> 



More information about the gme-users mailing list