Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Oomph » Manipulating Oomph setup models programatically
Manipulating Oomph setup models programatically [message #1716134] Tue, 01 December 2015 15:52 Go to next message
Patrik Nandorf is currently offline Patrik NandorfFriend
Messages: 195
Registered: January 2013
Location: Sweden
Senior Member
Hi,

I'd like to manipulate Oomph setup models programmatically and it being an EMF model I'd like to use EMF of course.

I'm able to read a model and traverse it but I'm not able to change property values e.g the VersionRange of a P2Director Requirement element since there is no setters.

Any suggestions?

Regards
Patrik
Re: Manipulating Oomph setup models programatically [message #1716138 is a reply to message #1716134] Tue, 01 December 2015 15:59 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Patrick,

There's org.eclipse.oomph.p2.Requirement.setVersionRange(VersionRange).

On 01/12/2015 4:52 PM, Patrik Nandorf wrote:
> Hi,
>
> I'd like to manipulate Oomph setup models programmatically and it
> being an EMF model I'd like to use EMF of course.
>
> I'm able to read a model and traverse it but I'm not able to change
> property values e.g the VersionRange of a P2Director Requirement
> element since there is no setters.
>
> Any suggestions?
>
> Regards
> Patrik


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Manipulating Oomph setup models programatically [message #1716147 is a reply to message #1716138] Tue, 01 December 2015 16:56 Go to previous messageGo to next message
Patrik Nandorf is currently offline Patrik NandorfFriend
Messages: 195
Registered: January 2013
Location: Sweden
Senior Member
Thanks Ed,

Ok, there is obvioulsy a setVersionRange(), sorry missed that.

Also I wasn't clear on what I'm trying to do which is to change the max version of the range of a requirement.

My assumed approach to this was to get the range, get the max version, increment it and set the new value to the range.

This I can't do since I can't set the Versions in a VersionRange object due to lack of setters.

Then I tried to create a new VersionRange to set. However createVersionRange takes a Version and VersionSegment which I haven't figured out how to use to set specific min and max versions.

Hope this explains my problem better.

Regards
Patrik
Re: Manipulating Oomph setup models programatically [message #1716149 is a reply to message #1716147] Tue, 01 December 2015 17:12 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Hi Patrik,

P2Factory.createVersionRange(Version, VersionSegment) is a convenience factory method to create version ranges that
include a given version and versions up to the next specified version segment. For example, if you have an installable
unit iu with the version 1.0.0 the call P2Factory.eINSTANCE.createVersionRange(iu.getVersion(), VersionSegment.MICRO)
returns the version range [1.0.0,1.0.1), i.e. all version qualifiers in that range.

Note that VersionRange is really a p2 class. You can create instances directly by calling one of the constructors.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



Am 01.12.2015 um 17:56 schrieb Patrik Nandorf:
> Thanks Ed,
>
> Ok, there is obvioulsy a setVersionRange(), sorry missed that.
> Also I wasn't clear on what I'm trying to do which is to change the max version of the range of a requirement.
>
> My assumed approach to this was to get the range, get the max version, increment it and set the new value to the range.
>
> This I can't do since I can't set the Versions in a VersionRange object due to lack of setters.
>
> Then I tried to create a new VersionRange to set. However createVersionRange takes a Version and VersionSegment which
> I haven't figured out how to use to set specific min and max versions.
>
> Hope this explains my problem better.
> Regards
> Patrik
>


Re: Manipulating Oomph setup models programatically [message #1716215 is a reply to message #1716149] Wed, 02 December 2015 09:25 Go to previous message
Patrik Nandorf is currently offline Patrik NandorfFriend
Messages: 195
Registered: January 2013
Location: Sweden
Senior Member
Thanks Eike, works like a charm.
Previous Topic:Search Dialog Setting "Search page selection" for my User Scope
Next Topic:Bundle Pool Management Dialog - greyed out elements
Goto Forum:
  


Current Time: Fri Apr 19 21:03:32 GMT 2024

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

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

Back to the top