Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Oomph » How to set Workspce as default Oopmh Preference Recorder location from product catalog
How to set Workspce as default Oopmh Preference Recorder location from product catalog [message #1782393] Thu, 22 February 2018 16:14 Go to next message
Ge Strait is currently offline Ge StraitFriend
Messages: 28
Registered: September 2017
Junior Member
I want to add a setup task to my product catalog such that the Eclipse Installer will set the Oomph Recorder default location to Workspace rather than User as it is by default.

Is this possible?
Can someone provide a sample setupTask?
<setupTask
xsi:type="setup:PreferenceTask"
key="???"
value="???"/>
Re: How to set Workspce as default Oopmh Preference Recorder location from product catalog [message #1782427 is a reply to message #1782393] Fri, 23 February 2018 08:20 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6407
Registered: July 2009
Senior Member
You can achieve that with the following task:

<?xml version="1.0" encoding="UTF-8"?>
<setup:PreferenceTask
    xmi:version="2.0"
    xmlns:xmi="http://www.omg.org/XMI"
    xmlns:setup="http://www.eclipse.org/oomph/setup/1.0"
    key="/instance/org.eclipse.oomph.setup.ui/preference.recorder.target"
    value="${workspace.location|uri}/.metadata/.plugins/org.eclipse.oomph.setup/workspace.setup#/"/>
Re: How to set Workspce as default Oopmh Preference Recorder location from product catalog [message #1782457 is a reply to message #1782427] Fri, 23 February 2018 16:23 Go to previous messageGo to next message
Ge Strait is currently offline Ge StraitFriend
Messages: 28
Registered: September 2017
Junior Member
Thanks, but I'm not sure how to apply your example to my product catalog .setup file. What I did is add compound task in my product setup file as follows:
...
<setupTask
xsi:type="setup:CompoundTask"
name="org.eclipse.oomph.setup.ui">
<setupTask
xsi:type="setup:PreferenceTask"
key="/instance/org.eclipse.oomph.setup.ui/preference.recorder.target"
value="${workspace.location|uri}/.metadata/.plugins/org.eclipse.oomph.setup/workspace.setup#/"/>
<setupTask
xsi:type="setup:PreferenceTask"
key="/instance/org.eclipse.oomph.setup.ui/p2.startup.tasks"
value="ALWAYS"/>
</setupTask>
...

After adding the setupTask as shown above, when I run the Eclipse Installer I see:
1. A message that the varaible worspace.location is undefined. With a question if I want to switch to advanced mode. If I answer yes then Eclipse Installer contiues in advanced mode and installs the product.
2. When I launch the product it eventually prompts me to enter a value for the workspace.location variable. After I enter the location of the workspace (which is not known until the end user specifies the location at product startup), the Window>Preferences>Oomph>Setup Tasks>Preference Recorder Record Into is set Workspace as I wanted.

Is this the behavior you expect?
Did I update my product catalog properly?



So I then tried adding a workspace.location Variable with no value (because the workspace location is not known) to my product catalog in attempt to get the Eclipse Installer to run in Simple Mode. Which it will. But afterward when I Launch the product and try to open then Preference Recorder preference page I see an error...
An internal error occurred during: "Open recorder transaction".
org.eclipse.core.internal.resources.ResourceException: Resource '/.metadata/.plugins/org.eclipse.oomph.setup/workspace.setup' does not exist.

But the file does exist in the workspace. Maybe this is due to my workspace.location Variable with no value.

Thanks!!!!!

For reference here is my full product catalog (minus the workspace.location I tried)...
<?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"
xmlns:setup.p2="http://www.eclipse.org/oomph/setup/p2/1.0"
name="tpf.toolkit.products"
label="TPF Toolkit Products (Lab)">
<annotation
source="http://www.eclipse.org/oomph/setup/BrandingInfo">
<detail
key="folderName">
<value>eclipse</value>
</detail>
</annotation>
<setupTask
xsi:type="setup:InstallationTask"
id="installation"/>
<product name="tpftoolkit"
label="TPF Toolkit (Lab)">
<setupTask
xsi:type="setup:CompoundTask"
name="User Preferences">
<annotation
source="http://www.eclipse.org/oomph/setup/UserPreferences">
<detail
key="/instance/org.eclipse.oomph.setup.ui/p2.startup.tasks">
<value>record</value>
</detail>
<detail
key="/instance/org.eclipse.remote.core/connections/org.eclipse.remote.JSch/Remote+Host/JSCH_ADDRESS_ATTR">
<value>record</value>
</detail>
<detail
key="/instance/org.eclipse.remote.core/connections/org.eclipse.remote.JSch/Remote+Host/JSCH_USE_LOGIN_SHELL_ATTR">
<value>record</value>
</detail>
<detail
key="/instance/org.eclipse.remote.core/connections/org.eclipse.remote.JSch/Remote+Host/JSCH_TIMEOUT_ATTR">
<value>record</value>
</detail>
<detail
key="/instance/org.eclipse.remote.core/connections/org.eclipse.remote.JSch/Remote+Host/JSCH_LOGIN_SHELL_COMMAND_ATTR">
<value>record</value>
</detail>
<detail
key="/instance/org.eclipse.remote.core/connections/org.eclipse.remote.JSch/Remote+Host/JSCH_IS_PASSWORD_ATTR">
<value>record</value>
</detail>
<detail
key="/instance/org.eclipse.remote.core/connections/org.eclipse.remote.JSch/Remote+Host/JSCH_PORT_ATTR">
<value>record</value>
</detail>
<detail
key="/instance/org.eclipse.remote.core/connections/org.eclipse.remote.JSch/Remote+Host/JSCH_USERNAME_ATTR">
<value>record</value>
</detail>
</annotation>
<setupTask
xsi:type="setup:CompoundTask"
name="org.eclipse.oomph.setup.ui">
<setupTask
xsi:type="setup:PreferenceTask"
key="/instance/org.eclipse.oomph.setup.ui/p2.startup.tasks"
value="ALWAYS"/>
<setupTask
xsi:type="setup:PreferenceTask"
key="/instance/org.eclipse.oomph.setup.ui/preference.recorder.target"
value="${workspace.location|uri}/.metadata/.plugins/org.eclipse.oomph.setup/workspace.setup#/"/>
</setupTask>
<setupTask
xsi:type="setup:CompoundTask"
name="org.eclipse.remote.core">
<setupTask
xsi:type="setup:PreferenceTask"
key="/instance/org.eclipse.remote.core/connections/org.eclipse.remote.JSch/Remote+Host/JSCH_ADDRESS_ATTR"
value="linuxtpf.pok.ibm.com"/>
<setupTask
xsi:type="setup:PreferenceTask"
key="/instance/org.eclipse.remote.core/connections/org.eclipse.remote.JSch/Remote+Host/JSCH_IS_PASSWORD_ATTR"
value="false"/>
<setupTask
xsi:type="setup:PreferenceTask"
key="/instance/org.eclipse.remote.core/connections/org.eclipse.remote.JSch/Remote+Host/JSCH_LOGIN_SHELL_COMMAND_ATTR"
value="/bin/bash -c '{0}'"/>
<setupTask
xsi:type="setup:PreferenceTask"
key="/instance/org.eclipse.remote.core/connections/org.eclipse.remote.JSch/Remote+Host/JSCH_PORT_ATTR"
value="22"/>
<setupTask
xsi:type="setup:PreferenceTask"
key="/instance/org.eclipse.remote.core/connections/org.eclipse.remote.JSch/Remote+Host/JSCH_TIMEOUT_ATTR"
value="0"/>
<setupTask
xsi:type="setup:PreferenceTask"
key="/instance/org.eclipse.remote.core/connections/org.eclipse.remote.JSch/Remote+Host/JSCH_USE_LOGIN_SHELL_ATTR"
value="true"/>
<setupTask
xsi:type="setup:PreferenceTask"
key="/instance/org.eclipse.remote.core/connections/org.eclipse.remote.JSch/Remote+Host/JSCH_USERNAME_ATTR"
value="yourid"/>
</setupTask>
</setupTask>
<setupTask
xsi:type="setup.p2:P2Task"
label="Oomph Setup UI">
<requirement
name="org.eclipse.oomph.setup.ui"/>
<repository
url="http://download.eclipse.org/oomph/updates"/>
<description>Added by IBM. P2 Director to install Oomph Updater.</description>
</setupTask>
<setupTask
xsi:type="setup:EclipseIniTask"
option="-Xms"
value="1G"
vm="true">
<description>-Xma</description>
</setupTask>
<setupTask
xsi:type="setup:EclipseIniTask"
option="-Xmx"
value="2G"
vm="true">
<description>-Xmx</description>
</setupTask>
<setupTask
xsi:type="setup:EclipseIniTask"
option="-XX:MaxPermSize"
value="1G"
vm="true">
<description>-XX:MaxPermSize</description>
</setupTask>
<version
name="46"
label="Toolkit 4.6 (Lab)"
requiredJavaVersion="1.8">
<setupTask
xsi:type="setup.p2:P2Task"
label="TPF Toolkit 4.6">
<requirement
name="com.ibm.tpf.toolkit.product"
filter=""/>
<repository
url="http://linuxtpf.pok.ibm.com/tpftoolkit/repos/TKComposite"/>
<description>Added by IBM. P2 Director to install/update TPF Toolkit Product.</description>
</setupTask>
<description>TPF Toolkit 4.6 Product</description>
</version>
<description>The IBM TPF Toolkit provides an IDE for z/TPF developers.</description>
</product>
<description>The catalog of TPF Toolkit product versions.</description>
</setup:ProductCatalog>

Re: How to set Workspce as default Oopmh Preference Recorder location from product catalog [message #1782487 is a reply to message #1782457] Sat, 24 February 2018 08:11 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6407
Registered: July 2009
Senior Member
Sorry, I forgot that the simple mode of the installer only installs products and no (Oomph) projects. Hence it has no WorkspaceTaskand, hence, no "workspace" variable. With the following modification it works in simple installer, too:

<?xml version="1.0" encoding="UTF-8"?>
<setup:PreferenceTask
    xmi:version="2.0"
    xmlns:xmi="http://www.omg.org/XMI"
    xmlns:setup="http://www.eclipse.org/oomph/setup/1.0"
    key="/instance/org.eclipse.oomph.setup.ui/preference.recorder.target"
    value="${osgi.instance.area}.metadata/.plugins/org.eclipse.oomph.setup/workspace.setup#/"/>


Note that the "|uri" filter must be omitted!

You can put that task in your catalog if you want to force all your products to execute it. Otherwise put it in selected products or product versions. There's no need to wrap it in a CompoundTask.
Re: How to set Workspce as default Oopmh Preference Recorder location from product catalog [message #1782573 is a reply to message #1782487] Mon, 26 February 2018 15:47 Go to previous messageGo to next message
Ge Strait is currently offline Ge StraitFriend
Messages: 28
Registered: September 2017
Junior Member
Thank you! My product now saves preferences in the workspace as we'd like. e.g. <installLocation>\eclipse\workspace\.metadata\.plugins\org.eclipse.core.runtime\.settings

One maybe odd thing is the Windows>Preferences>Oomph>Setup Tasks>Prefernce Recorder Record into field dropdown shows nothing (not User, nor Installation, nor Workspace). I expected it would show Workspace. I'm not suggesting this is a problem. Just pointing it out in case it's something you were not expecting.
Re: How to set Workspce as default Oopmh Preference Recorder location from product catalog [message #1782603 is a reply to message #1782573] Tue, 27 February 2018 05:14 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 29653
Registered: July 2009
Senior Member
Please open a Bugzilla with the steps to reproduce the problem, attach a screen capture, and we'll have a look.
Re: How to set Workspce as default Oopmh Preference Recorder location from product catalog [message #1782621 is a reply to message #1782603] Tue, 27 February 2018 08:53 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6407
Registered: July 2009
Senior Member
I'm a little confused. Eclipse stores most preferences in its workspace anyway, i.e., in <workspace>/.metadata/.plugins/org.eclipse.core.runtime/.settings . That has absolutely nothing to do with Oomph's preference recorder. Our recorder is normally used to _also_ store selected preferences somewhere outside of a specific workspace, such that you can apply them to other workspaces, as well. Even though I told you how to record the preferences into the workspace, i.e., into ${osgi.instance.area}.metadata/.plugins/org.eclipse.oomph.setup/workspace.setup , I struggle to see the big benefit of doing that. Are you sure that's what you want to do with Oomph?
Previous Topic:Can someone describle what these mean
Next Topic:Are reproducible installs possible?
Goto Forum:
  


Current Time: Sat Nov 17 00:14:54 GMT 2018

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

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

Back to the top