Yes, you can do a quick workaround while waiting for the fix.
In your web project, go to the file:
src/main/resources/workflow-gui.oaw

And enable the the advice execution by just remove the comments that per
default are there. So, it should look like:
<workflow>
    <cartridge file="sculptorguidslworkflow.oaw">
        <modelFile value="model.guidesign"/>
        <appProject value="foobarbaz-web"/>
    </cartridge>

    <component adviceTarget="generator" id="reflectionAdvice"
            class="oaw.xpand2.GeneratorAdvice">
        <advices value="templates::WebSpecialCases" />
        <fileEncoding value="iso-8859-1" />
    </component>
</workflow>

Of course, replace foobarbaz-web with the name of your project.

Then, override the code generation for the shallowClone-method by adding the
following to the file src/main/resources/templates/WebSpecialCases.xpt:

«IMPORT sculptormetamodel»
«IMPORT sculptorguimetamodel»
«EXTENSION extensions::helper»
«EXTENSION extensions::properties»
«EXTENSION extensions::guihelper»

«AROUND templates::web::JSFCrudGuiJavaForm::shallowClone FOR DomainObject»
private «getDomainPackage()».«name» shallowClone(«getDomainPackage()».«name»
original) {

    if (original != null) {
    «IF getAllSubclasses().size > 0-»
        «FOREACH getAllSubclasses() AS sub-»
        if (original instanceof «sub.getDomainPackage()».«sub.name») {
            return shallowClone((«sub.getDomainPackage()».«sub.name»)
original);
        }
        «ENDFOREACH»
        throw new RuntimeException("Unsupported type");
    «ELSE-»
        «getDomainPackage()».«name» shallowClone = new
«getDomainPackage()».«name»(«FOREACH getConstructorParameters() AS p
SEPARATOR ","»original.get«p.name.toFirstUpper()»()«ENDFOREACH»);
        «FOREACH getAllAttributes() AS att-»
            «IF att.changeable && att.name != "uuid" && att.name != "id"-»

shallowClone.set«att.name.toFirstUpper()»(original.get«att.name.toFirstUpper()»());
            «ENDIF-»

        «ENDFOREACH»
        return shallowClone;
    «ENDIF-»
    }

    return null;
}
«ENDAROUND»

We are going to release version 1.7 pretty soon, so the fix will be in
there.
Thx for finding and reporting it!

.../Andreas


On Thu, Jan 28, 2010 at 4:04 PM, alevine <adam.l.lev...@gmail.com> wrote:

>
> Thank you for the quick response and assurance.
>
> Is this a case in which using the template overrides or property file could
> provide a quick and easy workaround to change the setId generator to
> public?
>
> ie:
>
> notChangeablePropertySetter.visibility=private
>  to
> notChangeablePropertySetter.visibility=public
>
> --  does this even get applied to id/key fields?
>
> or
>
> «AROUND templates::DomainObject ..... I don't know what goes here.....
>
>
>
> thank you again!
>
> -- adam
>
>
>
>
> Hi,
> It is most definitely a bug.
> I'll have a look at it.
>
> .../Andreas
>
> On Thu, Jan 28, 2010 at 2:27 PM, Adam Levine <adam.l.lev...@gmail.com
> >wrote:
>
> > I'm trying to come up to speed with Sculptor, and I'm not sure if the
> > problem I'm finding is a bug or operator error:
>
> --
> View this message in context:
> http://old.nabble.com/ValueObject-%2B-mutable-%2B-shallowclone-%3D%3D-setid-problems-tp27355964s17564p27357398.html
> Sent from the Fornax-Platform mailing list archive at Nabble.com.
>
>
>
> ------------------------------------------------------------------------------
> The Planet: dedicated and managed hosting, cloud storage, colocation
> Stay online with enterprise data centers and the best network in the
> business
> Choose flexible plans and management services without long-term contracts
> Personal 24x7 support from experience hosting pros just a phone call away.
> http://p.sf.net/sfu/theplanet-com
> _______________________________________________
> Fornax-developer mailing list
> Fornax-developer@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fornax-developer
>
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Fornax-developer mailing list
Fornax-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fornax-developer

Reply via email to