Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Oomph » Put product versions in separate files
Put product versions in separate files [message #1778037] Fri, 08 December 2017 12:49 Go to next message
Vincent Zurczak is currently offline Vincent ZurczakFriend
Messages: 149
Registered: July 2009
Senior Member

Hi,

We have a custom catalog and we would like to manage several product versions.
Since each one is quite big, we would like to put them in separate files. Unfortunately, I keep on having errors. This is more an EMF problem I guess, but anyway.

Here is the content of the product catalog.

<?xml version="1.0" encoding="UTF-8"?>
<setup:ProductCatalog
    xmi:version="2.0"
    xmlns:xmi="http://www.omg.org/XMI"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:setup="http://www.eclipse.org/oomph/setup/1.0"
    name="my.product"
    label="some label">
    
  <!-- ... -->

  <product name="myproduct" label="Custom Eclipse">
    <annotation
        source="http://www.eclipse.org/oomph/setup/BrandingInfo">
      <detail
          key="folderName">
        <value>eclipse</value>
      </detail>
      <detail
          key="folderName.macosx">
        <value>Eclipse</value>
      </detail>
    </annotation>
    
    <version href="neon/my.products.neon.setup#/" />
    <description>...</description>
  </product>
</setup:ProductCatalog>


And here is the content of the referenced setup model.

<?xml version="1.0" encoding="UTF-8"?>
<setup:ProductVersion
    xmi:version="2.0"
    xmlns:xmi="http://www.omg.org/XMI"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:setup="http://www.eclipse.org/oomph/setup/1.0"
    name="neon"
    label="Latest Neon"
    requiredJavaVersion="1.8">

      <!-- ... -->
      <product href="../my-other-product.setup#//@product.0" />
      
</setup:ProductVersion>


The second setup model has no error when I directly open it in the setup editor.
But the other one indicates that « The opposite features 'versions' of 'Custom Eclipse' and 'product' of 'Latest Neon' do not refer to each other ».

« ../my-other-product.setup#//@product.0/@versions » does not work better. Besides, this element is supposed to be a product, not a list of product versions.

If I omit the product reference in the product version, there is no error in the catalog. But there is one in the product version since the reference is mandatory. I have searched examples on the web for such cases, but I did not find any. How can I make this work correctly without any error for both files?
Re: Put product versions in separate files [message #1778044 is a reply to message #1778037] Fri, 08 December 2017 14:31 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33264
Registered: July 2009
Senior Member
ProductVersion.product is a transient reference so I don't expect it to be serialized where you show <product href="../my-other-product.setup#//@product.0" /> in the example above. Unfortunately the setup editor is not very helpful for factoring out a separate resource with Control... on the context menu because it only saves the first resource when you save. We really out to fix that. We don't generally save container references anywhere ever; even for a project setup there is a separate logical project container reference rather a serialized non-transient parent reference. And the serialization of the models (e.g., the non-containment reference to the product version from the installation.setup) is designed to always serialize via a reference to the root resource and an EMF fragment path traversal down from that root so that the containment/container reference is established when the reference to the contained object is resolved starting at the root index. Try it without the container reference.

Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Put product versions in separate files [message #1778048 is a reply to message #1778044] Fri, 08 December 2017 15:22 Go to previous messageGo to next message
Vincent Zurczak is currently offline Vincent ZurczakFriend
Messages: 149
Registered: July 2009
Senior Member

If I remove the "product" mark-up, everything works fine when I browse the catalog. But when reading the product version alone (in the setup editor), there is an error. This is probably not a big thing, but I will have to put something in the readme so that other developers do not panic when they see this error.

Anyway, thanks for the answer. :)
Re: Put product versions in separate files [message #1778053 is a reply to message #1778048] Fri, 08 December 2017 16:10 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33264
Registered: July 2009
Senior Member
What's the error?

Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Put product versions in separate files [message #1778054 is a reply to message #1778053] Fri, 08 December 2017 16:13 Go to previous messageGo to next message
Vincent Zurczak is currently offline Vincent ZurczakFriend
Messages: 149
Registered: July 2009
Senior Member

Sorry, I should have mentioned it.

The required feature 'product' of 'Custom Eclipse' must be set.


Which is normal.
When I read the catalog, the product is read before the version. But when I read the version first, it has no reference to its container.
Re: Put product versions in separate files [message #1778073 is a reply to message #1778054] Sat, 09 December 2017 06:55 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33264
Registered: July 2009
Senior Member
I see, yes, that makes sense, though not very nice. One way I that might address this is to add an Annotation and, in the Properties view, add to the References a reference to the containing Product; you'll probably need to Load... of the product the first time. I expect this will force the Product to load in the Setup editor because all the proxies are aggressively resolved and that means the Product to Product Version reference will also resolve. Please let me know if this works or not.

Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Put product versions in separate files [message #1778256 is a reply to message #1778073] Tue, 12 December 2017 11:34 Go to previous message
Vincent Zurczak is currently offline Vincent ZurczakFriend
Messages: 149
Registered: July 2009
Senior Member

Indeed, an annotation solved the problem.
For those who would wonder, here is what I added to my sub-model.

<!-- Force the loading of the parent when we open this file directly. -->
<annotation source="ProductReference">
    <reference href="../my-other-product.setup#/" />
</annotation>


The reference is only used to force EMF to read the container model.
The source name does not matter.

Thanks Ed. :)
Previous Topic:Conditional project catalog?
Next Topic:Workspace disconnected from Oomph
Goto Forum:
  


Current Time: Sat Dec 14 16:48:08 GMT 2024

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

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

Back to the top