Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » P2 UI menu contributions in E4 application
P2 UI menu contributions in E4 application [message #580088] Thu, 05 August 2010 14:53 Go to next message
Chris  is currently offline Chris Friend
Messages: 16
Registered: July 2010
Junior Member
Hello,

In a 3.6 application, adding p2 feature UI was sufficient to have "Install new Software..." and "Check Update..." in "Help" menu.

Now, my application is E4. It doesn't work anymore. Even if I have a menu with id=help in Application.e4xmi and a separator with id=additions.

My question is : does old 3.6 contributions system work with E4 application ?

Thanks.



For information, the contribution of P2 UI DK is :

<extension
point="org.eclipse.ui.menus">
<menuContribution
locationURI="menu:help?after=additions">
<command
commandId="org.eclipse.equinox.p2.ui.sdk.update"
mnemonic="%Update.command.mnemonic"
id="org.eclipse.equinox.p2.ui.sdk.update">
</command>

</menuContribution>
<menuContribution
locationURI="menu:help?after=org.eclipse.equinox.p2.ui.sdk.update ">
<command
commandId="org.eclipse.equinox.p2.ui.sdk.install"
mnemonic="%Install.command.mnemonic"
id="org.eclipse.equinox.p2.ui.sdk.install">
</command>

</menuContribution>
</extension>
Re: P2 UI menu contributions in E4 application [message #580109 is a reply to message #580088] Thu, 05 August 2010 19:47 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi,

Well those things only work if you have the compat-layer with you.

An application built with the pure Eclipse 4.0 Application Platform does
not understand any extension points beside:
* org.eclipse.e4.workbench.model: for model contributions
* org.eclipse.e4.ui.css.swt.theme: to contribute themes and styles

That's all extension points you need to make up complete applications -
we don't need more than those because the
org.eclipse.e4.workbench.model-extension points allows to contribute
model fragments and the model itself knows about, commands, handlers, ... .

Tom

Am 05.08.10 16:53, schrieb Chris:
> Hello,
>
> In a 3.6 application, adding p2 feature UI was sufficient to have
> "Install new Software..." and "Check Update..." in "Help" menu.
>
> Now, my application is E4. It doesn't work anymore. Even if I have a
> menu with id=help in Application.e4xmi and a separator with id=additions.
>
> My question is : does old 3.6 contributions system work with E4
> application ?
>
> Thanks.
>
>
>
> For information, the contribution of P2 UI DK is :
> <extension
> point="org.eclipse.ui.menus">
> <menuContribution
> locationURI="menu:help?after=additions">
> <command
> commandId="org.eclipse.equinox.p2.ui.sdk.update"
> mnemonic="%Update.command.mnemonic"
> id="org.eclipse.equinox.p2.ui.sdk.update">
> </command>
> </menuContribution>
> <menuContribution
>
> locationURI="menu:help?after=org.eclipse.equinox.p2.ui.sdk.update ">
> <command
> commandId="org.eclipse.equinox.p2.ui.sdk.install"
> mnemonic="%Install.command.mnemonic"
> id="org.eclipse.equinox.p2.ui.sdk.install">
> </command>
> </menuContribution>
> </extension>
>
>
Re: P2 UI menu contributions in E4 application [message #702481 is a reply to message #580109] Tue, 26 July 2011 12:31 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

I does not find any example to implement P2 in a pure E4 application. Have you got any documentation?
Re: P2 UI menu contributions in E4 application [message #703600 is a reply to message #702481] Wed, 27 July 2011 18:34 Go to previous messageGo to next message
Brian de Alwis is currently offline Brian de AlwisFriend
Messages: 242
Registered: July 2009
Senior Member
The p2 UI currently require the 3.6 UI code which isn't available for pure Eclipse 4 applications. It's likely that most of the code really only relies on JFace, but somebody needs to do that work. If it's important to you, please feel free to contribute!

In the meantime, you can use the lower-level p2 APIs and implement your own UI.
Re: P2 UI menu contributions in E4 application [message #1002291 is a reply to message #580088] Fri, 18 January 2013 10:33 Go to previous messageGo to next message
Laura V is currently offline Laura VFriend
Messages: 32
Registered: March 2012
Member
Hi guys, your post is from 2011. Is there any update on this issue?
Actually for our E4 application we don't need Menu Contributions for updates, we just want the application to look for updates automatically (in background) when it starts.
We just need a "wait panel" (like "Please wait until this n features are installed")


What do you exactly mean with "lower-level p2 APIs"? It's also written in Lars Vogel Tutorial http://www.vogella.com/articles/EclipseP2Update/article.html but it's not clear to me.
As far as I understood from that tutorial, I need to put a p2.inf file in my feature and configure the p2 repo there. Am I on the right track?
If yes, I'm not sure why it doesn't work by me - I followed the tutorial (created a plugin, a feature and a local repo with the feature in it) and configured the p2.inf with the following line

instructions.configure=\
addRepository(type:0,location:D:\devsbb\eclipse-export\repository);
but nothing happens on start of my plugin.
Thank you very much for your feedback!
Re: P2 UI menu contributions in E4 application [message #1002299 is a reply to message #1002291] Fri, 18 January 2013 10:50 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Yes - you are on the right track but to start the auto check IIRC you
need to preconfigure p2. I'll try to dig up the informations inside one
of our RCP apps.

We are planing to add an e4 core solution to e(fx)clipse (it won't
depend on JavaFX but is part of the core) which people can make use of
in any e4 rcp.

Tom

Am 18.01.13 11:33, schrieb Laura V:
> Hi guys, your post is from 2011. Is there any update on this issue?
> Actually for our E4 application we don't need Menu Contributions for
> updates, we just want the application to look for updates automatically
> (in background) when it starts.
> We just need a "wait panel" (like "Please wait until this n features are
> installed")
>
>
> What do you exactly mean with "lower-level p2 APIs"? It's also written
> in Lars Vogel Tutorial
> http://www.vogella.com/articles/EclipseP2Update/article.html but it's
> not clear to me.
> As far as I understood from that tutorial, I need to put a p2.inf file
> in my feature and configure the p2 repo there. Am I on the right track?
> If yes, I'm not sure why it doesn't work by me - I followed the tutorial
> (created a plugin, a feature and a local repo with the feature in it)
> and configured the p2.inf with the following line
>
> instructions.configure=\
> addRepository(type:0,location:D:\devsbb\eclipse-export\repository);
> but nothing happens on start of my plugin.
> Thank you very much for your feedback!
Re: P2 UI menu contributions in E4 application [message #1002303 is a reply to message #1002299] Fri, 18 January 2013 11:05 Go to previous messageGo to next message
Laura V is currently offline Laura VFriend
Messages: 32
Registered: March 2012
Member
Hi Tom
thanks for your prompt answer. If you would find a sample project it would be perfect.
I couldn't find much documentation about configuring p2.inf with repos or how preconfigure p2.
And nothing about using this low level apis. I need to show the user some message after the update - in case he's updating in the train and the connection gets interrupted he needs to be notified that the feature has to be reinstalled, or the whole platform got corrupted, and so on.
I think having a standard solution for this in E4 is pretty important in order to have a "complete / mature" product.

[Updated on: Fri, 18 January 2013 11:08]

Report message to a moderator

Re: P2 UI menu contributions in E4 application [message #1003427 is a reply to message #580088] Mon, 21 January 2013 08:11 Go to previous messageGo to next message
Laura V is currently offline Laura VFriend
Messages: 32
Registered: March 2012
Member
Hi Tom, any update on this issue? Did u manage to dig up what you were looking for? Thanks Laura
Re: P2 UI menu contributions in E4 application [message #1003547 is a reply to message #1002303] Mon, 21 January 2013 13:41 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi,

It's not ready nor is it tested but I've extracted our source code to
check for updates so that it can be called fairly easy.

You can see the source at
https://github.com/tomsontom/e-fx-clipse/tree/master/at.bestsolution.efxclipse.runtime.p2
maybe this helps you already.

Tom

Am 18.01.13 12:05, schrieb Laura V:
> Hi Tom
> thanks for your prompt answer. If you would find a sample project it
> would be perfect.
> I couldn't find much documentation about configuring p2.inf with repos
> or how preconfigure p2.
> And nothing about using this low level apis.
> I think having a standard solution for this in E4 is pretty important in
> order to have a "complete / mature" product.
Re: P2 UI menu contributions in E4 application [message #1004077 is a reply to message #1003547] Tue, 22 January 2013 14:39 Go to previous messageGo to next message
Laura V is currently offline Laura VFriend
Messages: 32
Registered: March 2012
Member
Hi Tom
Thanks a lot for your support. I'm trying it out, but it doesn't seem to work for me.
I created a local repo and exported a feature with some dummy plugin in it (following Lars Vogel's simple tutorial http://www.vogella.com/articles/EclipseP2Update/article.html)

But in your project in the update service implementation
IMetadataRepository metadataRepo = metadataManager.loadRepository(uri, monitor);
is giving an error because the repo isn't found.
Which is weird. If I "manually" install it through the p2 console (command provaddrepo <repository URI> ) it is there.


Re: P2 UI menu contributions in E4 application [message #1004506 is a reply to message #580088] Wed, 23 January 2013 11:12 Go to previous messageGo to next message
Laura V is currently offline Laura VFriend
Messages: 32
Registered: March 2012
Member
Tom: I finally got the example up and running.
What is not correct is, there updates available, which shouldn't be the case (the bundle I'm updating from is exactly what I exported on the repo).
Looking at the code I realized that in the UpdateServiceImpl the method collectUpdateableUnits just takes all the installable units in the repo and gives them back, while it should check on the IU version instead.
This brings up 2 questions (which I think is of general interest because equinox apis are not exactly well documented):

1) WHAT is exactly the version of an installable unit? Is it the version of the feature or the version of the plugin in the feature? I tried debugging equinox code, turns out InstallableUnit.setVersion is used by InstallableUnitDescription.setVersion, which has no reference anywhere. When / by what does the version of the IU get set?

2) is it absolutely necessary to have features in order to use p2?

Quoting Lars Vogel's simple tutorial:
"The update and installation of functionalities with p2 is based on Features projects. In the terminology of p2 these features are installable Units"
That means IU version = feature version
But according to equinox wiki:
"As the name implies,IUs describe things that can be installed, updated or uninstalled. They do not contain the actual artifacts but rather essential information about such artifacts (e.g., names, ids, version numbers, dependencies, etc) and are not aware about what they deliver. They describe things. They are NOT the things. So for example an IU for a bundle is NOT the bundle. The bundle is an "artifact". "
Now that's pretty abstract and confusing.

Thanks a lot for your answer


Laura

Re: P2 UI menu contributions in E4 application [message #1004529 is a reply to message #1004506] Wed, 23 January 2013 12:02 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Am 23.01.13 12:12, schrieb Laura V:
> Tom: I finally got the example up and running.
> What is not correct is, there updates available, which shouldn't be the
> case (the bundle I'm updating from is exactly what I exported on the repo).
> Looking at the code I realized that in the UpdateServiceImpl the method
> collectUpdateableUnits just takes all the installable units in the repo
> and gives them back, while it should check on the IU version instead.
> This brings up 2 questions (which I think is of general interest because
> equinox apis are not exactly well documented):

Makes sense, maybe I missed something when extracting the code from our
product. Like I said, I haven't yet tested it ;-)

>
> 1) WHAT is exactly the version of an installable unit? Is it the version
> of the feature or the version of the plugin in the feature? I tried
> debugging equinox code, turns out InstallableUnit.setVersion is used by
> InstallableUnitDescription.setVersion, which has no reference anywhere.
> When / by what does the version of the IU get set?
>
> 2) is it absolutely necessary to have features in order to use p2?
>
> Quoting Lars Vogel's simple tutorial:
> "The update and installation of functionalities with p2 is based on
> Features projects. In the terminology of p2 these features are
> installable Units"
> That means IU version = feature version
> But according to equinox wiki:
> "As the name implies,IUs describe things that can be installed, updated
> or uninstalled. They do not contain the actual artifacts but rather
> essential information about such artifacts (e.g., names, ids, version
> numbers, dependencies, etc) and are not aware about what they deliver.
> They describe things. They are NOT the things. So for example an IU for
> a bundle is NOT the bundle. The bundle is an "artifact". "
> Now that's pretty abstract and confusing.
>

Both of them are good questions you'd better asked that the equinox
newsgroup ;-)

We are always working with features and feature based products so I
didn't digged into this ;-)

Tom
Re: P2 UI menu contributions in E4 application [message #1004559 is a reply to message #1004529] Wed, 23 January 2013 13:02 Go to previous messageGo to next message
Laura V is currently offline Laura VFriend
Messages: 32
Registered: March 2012
Member
Hi Tom
you are right it belongs to Equinox Forum, I'll post it there.
I found the problem in your code.
You don't need to use p2ql (QueryUtil.createIUGroupQuery for example) because there are two native classes from org.eclipse.equinox.p2.operations
UpdateOperation and InstallOperation
which do already the whole job of checking for the latest features / plugins or missing feature.
Thx

Laura

Re: P2 UI menu contributions in E4 application [message #1004571 is a reply to message #1004559] Wed, 23 January 2013 13:30 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi Laura,

Thanks for your follow up! Will take a look later.

Tom

Am 23.01.13 14:02, schrieb Laura V:
> Hi Tom
> you are right it belongs to Equinox Forum, I'll post it there.
> I found the problem in your code.
> You don't need to use p2ql (QueryUtil.createIUGroupQuery for example)
> because there are two native classes from org.eclipse.equinox.p2.operations
> UpdateOperation and InstallOperation
> which do already the whole job of checking for the latest features /
> plugins or missing feature.
> Thx
> Laura
>
>
Re: P2 UI menu contributions in E4 application [message #1004614 is a reply to message #1004571] Wed, 23 January 2013 14:47 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi Laura,

Ok - now I remember the reason we used the Query API in our product. The
reason is that we have 2 types of updates:
a) mandatory updates (=> the user has no choice but must update)
b) unmandatory updates (user can decide on his own to update or not)

The UpdateOperation simply consults all update-sites configured so we
couldn't use it but had to build up the site-list ourself (the original
code is different than the one I posted).

I've for now switched the code now to UpdateOperation but would like to
add this feature back later on because I think it is a very useful one
so i only commented the code.

Tom

Am 23.01.13 14:30, schrieb Tom Schindl:
> Hi Laura,
>
> Thanks for your follow up! Will take a look later.
>
> Tom
>
> Am 23.01.13 14:02, schrieb Laura V:
>> Hi Tom
>> you are right it belongs to Equinox Forum, I'll post it there.
>> I found the problem in your code.
>> You don't need to use p2ql (QueryUtil.createIUGroupQuery for example)
>> because there are two native classes from org.eclipse.equinox.p2.operations
>> UpdateOperation and InstallOperation
>> which do already the whole job of checking for the latest features /
>> plugins or missing feature.
>> Thx
>> Laura
>>
>>
>
Re: P2 UI menu contributions in E4 application [message #1004669 is a reply to message #1004614] Wed, 23 January 2013 16:24 Go to previous messageGo to next message
Laura V is currently offline Laura VFriend
Messages: 32
Registered: March 2012
Member
Hi Tom
ok clear this makes sense then.
We don't need unmandatory (user-driven) updates so for us it's not important.
About versioning, it's more or less clear now, if you are interested to the subject you can read the thread here
http://www.eclipse.org/forums/index.php/m/1004666/#msg_1004666

Thanks

Laura
Re: P2 UI menu contributions in E4 application [message #1006641 is a reply to message #1004669] Fri, 01 February 2013 10:02 Go to previous message
Ludovic L. is currently offline Ludovic L.Friend
Messages: 1
Registered: February 2013
Junior Member
Hello Laura V

he seems like you are now ready to use p2 with pure e4 application, if i am right please can you give me an example. I am new in rcp (e4), I try a lot of thing to manage the integration of p2 in pure e4. but nothing work.
thank you in advance
Previous Topic:Help System
Next Topic:styling the selected item of a list or tree
Goto Forum:
  


Current Time: Fri Apr 19 14:15:23 GMT 2024

Powered by FUDForum. Page generated in 0.04047 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top