Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jwt-dev] Importing to JWT Custom Aspect Properties

Hi Eric

Congrats, and thanks for the feedback, we'll try to use it to improve JWT.

A question : when you say "tried loading resources", you mean using the EMF editor for _conf files ? (it could indeed be improved)

Regards,
Marc


Le 04/05/2011 03:24, Eric Phetteplace a écrit :
I'm in better shape, now. 

jwt-we-sample-staticaspect has exactly what I want, so I tried using that.  I ran into a few challenges, but got past them.
  1. Generating the model code from the ecore - a few import statements needed to be fixed, from org.eclipse.jwt.we.conf.AspectInstance to org.eclipse.jwt.we.conf.model.AspectInstance.
  2. In my project conf, I tried loading resources.  I couldn't get the appropriate resources showing, so I edited the xml, and manually added in the Aspect Instance Type and Target Model Element.
For what it's worth, I'm using Helios SR1, and I am using the "version 1.0" jwt projects.

After that, it was easy to code the properties:

            List<Aspect> aspects = AspectManager.INSTANCE.getAspects(node);
            Aspect myCustomPropertyAspect = null;
            String myCustomPropertyAspectId = "jwt.sample.staticaspect.sampleactionaspect"; //"com.gotarca.jwt.we.view.callflow.actionaspect";
            for (Aspect aspect : aspects) {
                if (myCustomPropertyAspectId.equals(aspect.getId())) {
                    myCustomPropertyAspect = aspect;
                }
            }
            if (myCustomPropertyAspect!=null) {
                SampleStaticAspect myCustomPropertyInstance = (SampleStaticAspect) AspectManager.INSTANCE.createAndAddAspectInstance(myCustomPropertyAspect, node);
                myCustomPropertyInstance.setSamplestringprop("sample");
               
            }
               
Thanks again for your help,

Eric


Back to the top