[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [lyo-dev] Dynamic Resource Shape in Adaptor Generator

Hi Francisco,

>From my understanding, resource shapes are created dynamically based on the static annotations in the POJO classes that correspond to your resources.

You can start by observing how the POJO resource classes are added to the Map RESOURCE_SHAPE_PATH_TO_RESOURCE_CLASS_MAP in the class se.kth.md.it.bcm.servlet.Application.java - at the very start of the program execution.

If you trace the code from there, you will end up in the method "createResourceShape" in the ResourceShapeFactory class (org.eclipse.lyo.oslc4j.core project").

This method of course creates the resource shapes based on the annotations in the resource classes.
But, maybe you can add and/modify shapes in a similar way. That is, instead of reading the annotations, you create shape instances based on some other logic.

Note that the code generator (which I am involved in) simply uses the current static approach to resource shapes of the Lyo SDK. But I believe your current need can be solved directly with the SDK, and not necessary the generator?
I am happy to discuss further if you have suggestions on how the generator can help.

regards
______________________________
Jad El-khoury, PhD
KTH Royal Institute of Technology
School of Industrial Engineering and Management, Mechatronics Division
Brinellvägen 83, SE-100 44 Stockholm, Sweden
Phone: +46(0)8 790 6877 Mobile: +46(0)70 773 93 45
jad@xxxxxx, www.kth.se


-----Original Message-----
From: lyo-dev-bounces@xxxxxxxxxxx [mailto:lyo-dev-bounces@xxxxxxxxxxx] On Behalf Of Francisco Romero
Sent: 27 January 2016 19:46
To: lyo-dev@xxxxxxxxxxx
Subject: [lyo-dev] Dynamic Resource Shape in Adaptor Generator

Hi all:

I've been playing with the Adaptor Code Generator for a while and I have a question about Resource Shapes.
It seems they are generated automatically from Resource definitions. Is there any way to generate dynamically?
We need to generate different Resource Shapes for each project in our RM tool.

Thanks in advance.

 

_______________________________________________
lyo-dev mailing list
lyo-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit https://dev.eclipse.org/mailman/listinfo/lyo-dev