lock [Solved] Plugin Usage

8 years 1 week ago - 8 years 1 week ago #652 by mersa
Hi,

that was my assumption and after playing around with the simmpleconfigurator and different start level it appears to work to some degree..

to some degree means, that i can use my plugin's perspective and have access to window->preferences->plugin, but some functionalities are missing, e.g. the export via model->contextmenu->export.
Right now, I don't have a clue what causes this behavior.

I wonder how it could be possible to get access to the xmi- export funcionality in modelio. It doesn´t seem to be part of the api but works as a plugin.
Watching the modelio source didn´t help me either..
The topic has been locked.
8 years 1 week ago #681 by mersa
of course my menuentries do not appear because the ModelExploerView uses a different locationURI then used in my plugin..

Anyway, i'm still not able to save a modelio model in xmi and would be thankful for any advice.
The topic has been locked.
8 years 6 days ago #683 by mersa
Hey,

i'm really sorry to lavish you with questions, buut here is another one.

when i deploy my functionality via a module, i don't need to care about my session

no, a properly designed module can never fall in such a situation where its code is running without a valid session being available. See Modules core concepts to understand how this magic is possible.


But it becomes a problem when i deploy it as plugin. I get an nullPointer Exeption at

IModelingSession session = Modelio.getInstance().getModelingSession();


How can I fix this problem (aside from using the module concept)

Thank you in advance
The topic has been locked.
8 years 6 days ago #686 by chm
Hi mersa,

about XMI, as far as i know, it is not yet possible to trigger the import/export from the public API. Not sure if it is possible by using the xmi plugin itself...

About the session, your problem is related to Modelio's plugins lifecycle. I guess the "modelio" singleton is initialized after your plugin start. Adding dependencies from your plugin to api & api.impl might be enough to avoid the error.

By the way, do not forget that there is no modeling session available until a projet is opened.

Could you please give us a hint about what you are trying to do with this session, and when?
The topic has been locked.
8 years 6 days ago #688 by fpo
Some additional information if I may:
- First a fair warning: Modelio is NOT Eclipse, so a plugin for Eclipse may require quite extensive modification/rewriting in order to work with Modelio (for example regarding UI contributions: we are using specific URI, when using them at all). Though the fact that it runs on a RCP allows plugin extension, of course.
- As stated by chm, the Modelio class is not a true Singleton, despite what the #getInstance static method might suggest. It is meant to work almost like a Singleton though, but its initialization depends on the org.modelio.api.impl plugin being loaded first, so using a dependency on that plugin should allow the underliying RCP to load your plugin after this one.

Overall, the modules are the best way to extend Modelio (or at least the way I would strongly suggest) for 2 reasons:
- writing your "business" code into a module saves you the burden of writing this boilerplate code , while providing a runtime environment where you can make some assertions (there is an available modelling session, etc).
- modules have a project for scope, meaning that it won't "pollute" other projects. For example, let's say your code brings a view used to manipulate UML model while developing in C++. It is more than likely that you don't want that view to clutter UI once you've closed that project and opened another project where you'll only care about Analysis model.

Hope that helps.
The topic has been locked.
8 years 6 days ago #689 by mersa
hey,
thank you for your reply :)

i'm having some kind of a repository attached to modelio and i need to impelement both the checkin and checkout of a modelio model via the model's contextmenu

So, for the checkin direction i need access to the model and serialize it to xmi

For the checkout direction, i need to update the workspace to recognize the newly applied project

For both task i would expect to need a session..
The topic has been locked.
Moderators: tmachmaab
Time to create page: 0.067 seconds
^ Back to Top