Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Oomph » Creating linked projects/products (href) using the setup model editor
Creating linked projects/products (href) using the setup model editor [message #1830962] Fri, 07 August 2020 12:05 Go to next message
Joe Shannon is currently offline Joe ShannonFriend
Messages: 9
Registered: February 2020
Junior Member
There are many examples of using href for linking to projects located elsewhere for example in org.eclipse.projects.setup:

<project href="https://git.eclipse.org/c/justj/justj.tools.git/plain/releng/org.eclipse.justj.tools.releng/JustJ.setup#/"/>


I was wondering how to create these using the editor within Eclipse. I have tried copying and pasting projects (after e.g. importing a resource and enabling "Show all resources") however this appears to always copy the entire model rather than create a link to it.

I can only achieve this by manually editing the setup file, am I missing something?

A follow on question specifically about linking of products (rather than projects) using href which seems to exhibit a different behaviour:

I have had success by manually editing the product catalogue to include products from elsewhere (using href). However, after making an unrelated edit to the product catalog using the Setup editor, the href is removed and replaced with a copy of the previously linked model upon saving the file.

Does this indicate that href is not supported to the same extent for products compared with projects? Also I noted that the little green arrow in the top left of the project icon to denote linked projects is not present for linked products (even before the link is replaced by saving the file).
Re: Creating linked projects/products (href) using the setup model editor [message #1830980 is a reply to message #1830962] Fri, 07 August 2020 16:21 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33252
Registered: July 2009
Senior Member
You can use Control... from the context menu of an object in a cross resource containment reference (an EReference that is a containment and has resolveProxies true) to move that object to a separate resource.

Also note that things like Ctrl, and Alt affect the behavior of drag and drop, so you can use that to affect whether a copy is made at the drop location (the default) or a reference to the original object.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Creating linked projects/products (href) using the setup model editor [message #1831491 is a reply to message #1830980] Thu, 20 August 2020 17:20 Go to previous messageGo to next message
Joe Shannon is currently offline Joe ShannonFriend
Messages: 9
Registered: February 2020
Junior Member
Thanks Ed that's very useful, sorry for the slow reply.

Did you have any insights into the observed behaviour with the product hrefs, possibly it's unsupported?
Re: Creating linked projects/products (href) using the setup model editor [message #1831493 is a reply to message #1831491] Thu, 20 August 2020 18:23 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33252
Registered: July 2009
Senior Member
The org.eclipse.oomph.setup.ProductCatalog.getProducts() is a proxy resolving containment reference so does support proxies. We have /setups/org.eclipse.applications.setup which uses that:
<?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="org.eclipse.applications"
    label="Eclipse.org Applications">
  <annotation
      source="http://www.eclipse.org/oomph/setup/BrandingInfo">
    <detail
        key="siteURI">
      <value>https://projects.eclipse.org/</value>
    </detail>
  </annotation>
  <setupTask
      xsi:type="setup:InstallationTask"
      id="installation"/>
  <product href="org.eclipse.all.product.setup#/"/>
  <product href="org.eclipse.platform.sdk.product.setup#/"/>
  <product href="http://git.eclipse.org/c/cdo/cdo.git/plain/plugins/org.eclipse.emf.cdo.server.product/CDOServer.setup#/"/>
  <product href="http://git.eclipse.org/c/cdo/cdo.git/plain/plugins/org.eclipse.emf.cdo.explorer.ui/CDOExplorer.setup#/"/>
  <product href="https://git.eclipse.org/c/epsilon/org.eclipse.epsilon.git/plain/releng/org.eclipse.epsilon.releng/epsilonUse.setup#/"/>
  <product href="interim/products/PapyrusWithCDO.setup#/"/>
  <description>The catalog of applications provided by projects at Eclipse.org.</description>
</setup:ProductCatalog>
I can edit and save it and the hrefs are preserved.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Creating linked projects/products (href) using the setup model editor [message #1831497 is a reply to message #1831493] Thu, 20 August 2020 23:12 Go to previous messageGo to next message
Joe Shannon is currently offline Joe ShannonFriend
Messages: 9
Registered: February 2020
Junior Member
How about if you were to add something like:
<product href="index:/org.eclipse.setup#//@productCatalogs[name='org.eclipse.products']/@products[name='epp.package.rcp']" />


This was what I was playing around with and it seemed to work well but on save would be replaced with the resolved model.

I've just tried including the above line to org.eclipse.applications.setup in my workspace for Oomph itself (before I was using a personal project workspace) - I did see an error though "The opposite features 'products' of ' Eclipse.org Applications' and 'productCatalog' of ' Eclipse IDE for RCP and RAP Developers' do not refer to each other" but this went away after saving and reloading.
Re: Creating linked projects/products (href) using the setup model editor [message #1831499 is a reply to message #1831497] Fri, 21 August 2020 05:13 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33252
Registered: July 2009
Senior Member
These are EMF containment references so you cannot share the referenced object among multiple containers. That is indeed likely to move the object from one container to another during proxy resolution. Don't do that.

Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Creating linked projects/products (href) using the setup model editor [message #1832137 is a reply to message #1831499] Wed, 09 September 2020 22:00 Go to previous message
Joe Shannon is currently offline Joe ShannonFriend
Messages: 9
Registered: February 2020
Junior Member
Thanks - I shall avoid doing this.

Just to give some context behind this:
The goal is to create a custom product catalog and include a subset of a particular flavour of the standard Eclipse products (e.g. RCP/RAP) in the catalog without duplicating the relevant part of the model from org.eclipse.products.setup.

The alternative is to just copy (drag and drop) the desired product versions into the custom catalog. This would be a bit of a pain to maintain by hand but the setup editor makes it relatively simple.
Previous Topic:Installer opens website to install Java
Next Topic:Error at installation
Goto Forum:
  


Current Time: Thu Nov 07 04:33:44 GMT 2024

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

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

Back to the top