Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Oomph » Content in ResourceCreationTask getting mangled on save(Content in ResourceCreationTask getting mangled on save)
Content in ResourceCreationTask getting mangled on save [message #1829799] Fri, 10 July 2020 17:40 Go to next message
Michael Thompson is currently offline Michael ThompsonFriend
Messages: 12
Registered: July 2020
Location: NC
Junior Member
I've started having a problem within the last month anytime I save an Oomph configuration with a resource creation task that the content field is moved from an attribute to it's own tag. That gets formatting applied which creates a broken XML file when the installer actually creates the file.

For example this task:
<setupTask
xsi:type="setup:ResourceCreationTask"
excludedTriggers="STARTUP MANUAL"
content="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>&#xA;&lt;state reopen=&quot;false&quot;/>"
targetURL="${dir.git|uri}/.metadata/.plugins/org.eclipse.ui.intro/introstate"
encoding="UTF-8"/>


Turns into this:
<setupTask
xsi:type="setup:ResourceCreationTask"
excludedTriggers="STARTUP MANUAL"
targetURL="${dir.git|uri}/.metadata/.plugins/org.eclipse.ui.intro/introstate"
encoding="UTF-8">
<content>
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>
&lt;state reopen=&quot;false&quot;/>
</content>
</setupTask>

I have tried to see if I accidentally set a generic XML format configuration change somewhere but nothing seems to retain the older behavior. I did a quick search on the forum and didn't see anything similar happening to anyone else.

This is on Eclipse 2019-09 with
Eclipse IDE for Enterprise Java Developers 4.13.0.20190917-0000 epp.package.jee Eclipse Packaging Project
EPP Common Package Feature 4.13.0.20190917-0000 org.eclipse.epp.package.common.feature.feature.group Eclipse Packaging Project
Oomph Setup 1.18.0.v20200701-0751 org.eclipse.oomph.setup.feature.group Eclipse Oomph Project
Oomph OS Tools 1.13.0.v20200624-1156 org.eclipse.oomph.ostools.feature.group Eclipse Oomph Project
Oomph Preferences Management 1.13.0.v20200624-1156 org.eclipse.oomph.preferences.feature.group Eclipse Oomph Project
Oomph P2 Management 1.17.0.v20200701-0751 org.eclipse.oomph.p2.feature.group Eclipse Oomph Project
Oomph Setup Core 1.18.0.v20200624-1156 org.eclipse.oomph.setup.core.feature.group Eclipse Oomph Project
Oomph Setup JDT 1.16.0.v20200624-1156 org.eclipse.oomph.setup.jdt.feature.group Eclipse Oomph Project
Oomph Setup Mylyn 1.15.0.v20200624-1156 org.eclipse.oomph.setup.mylyn.feature.group Eclipse Oomph Project
Oomph Setup Projects 1.14.0.v20200624-1156 org.eclipse.oomph.setup.projects.feature.group Eclipse Oomph Project
Oomph Setup Workbench 1.13.0.v20200624-1156 org.eclipse.oomph.setup.workbench.feature.group Eclipse Oomph Project
Oomph Setup Working Sets 1.14.0.v20200624-1156 org.eclipse.oomph.setup.workingsets.feature.group Eclipse Oomph Project
Re: Content in ResourceCreationTask getting mangled on save [message #1829814 is a reply to message #1829799] Sat, 11 July 2020 04:55 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 32111
Registered: July 2009
Senior Member
This was intentionally changed:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=564016

Is this causing a problem?


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Content in ResourceCreationTask getting mangled on save [message #1829907 is a reply to message #1829814] Mon, 13 July 2020 17:46 Go to previous messageGo to next message
Michael Thompson is currently offline Michael ThompsonFriend
Messages: 12
Registered: July 2020
Location: NC
Junior Member
Unfortunately it is. When it converts the contents down to the tag it also tries to format the contents (sorry I didn't use code tag on the first post). I'll fire up my test box again and do a clean install so I can figure out exactly what was breaking and report back.

    <setupTask
        xsi:type="setup:ResourceCreationTask"
        excludedTriggers="BOOTSTRAP"
        force="true"
        targetURL="${USERPROFILE|uri}/.eclipse/org.eclipse.oomph.setup.sync/sync.properties"
        encoding="UTF-8">
      <content>
        connection.offered=Thu Jan 23 17\:41\:37 EST 2020
        sync.enabled=false
      </content>
    </setupTask>

Re: Content in ResourceCreationTask getting mangled on save [message #1829915 is a reply to message #1829907] Mon, 13 July 2020 22:26 Go to previous messageGo to next message
Michael Thompson is currently offline Michael ThompsonFriend
Messages: 12
Registered: July 2020
Location: NC
Junior Member
Ok, I found a good example. This is where I am defaulting some dialog options and it works fine until I let the newer Oomph editor redo the content data. In the new version the file gets generated with an extra blank line and everything is offset:


        <?xml version="1.0" encoding="UTF-8"?>
        <section name="Workbench">
        	<section name="org.eclipse.ui.internal.QuickAccess">
        		<item value="755" key="dialogHeight"/>
        		<item value="1440" key="dialogWidth"/>

...

The attached image shows the file a little more clearly.
Re: Content in ResourceCreationTask getting mangled on save [message #1829921 is a reply to message #1829915] Tue, 14 July 2020 05:53 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 32111
Registered: July 2009
Senior Member
In Oomph we have a task to create the create JDT's dialog_settings.xml as well:

https://git.eclipse.org/c/oomph/org.eclipse.oomph.git/tree/setups/Oomph.setup#n195

And it creates proper results when I test it again just now.

I can also see that the value is correctly deserialized in the Properties view:

index.php/fa/38581/0/

The deserialization is done here:

https://git.eclipse.org/c/oomph/org.eclipse.oomph.git/tree/plugins/org.eclipse.oomph.base/src/org/eclipse/oomph/base/util/BaseResourceImpl.java#n146

You can see it computes indentation and strips it. Can I see how your serialized task looks in the *.setup? Perhaps just the trailing line break is missing on the last line of the resource's text and this breaks the indentation computation. In any case, something is not quite right with the serialization of your original value because of course serialization and subsequent deserialization should preserve the text value.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Content in ResourceCreationTask getting mangled on save [message #1830142 is a reply to message #1829921] Fri, 17 July 2020 19:29 Go to previous messageGo to next message
Michael Thompson is currently offline Michael ThompsonFriend
Messages: 12
Registered: July 2020
Location: NC
Junior Member
Did you want the content from the older version or newer version?
This is the newer version after it converted and the dialog from the Setup editor for the same content.

    <setupTask
        xsi:type="setup:ResourceCreationTask"
        excludedTriggers="STARTUP MANUAL"
        targetURL="${dir.bsh|uri}/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml"
        encoding="UTF-8">
      <content>
        &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>
        &lt;section name=&quot;Workbench&quot;>
        	&lt;section name=&quot;org.eclipse.ui.internal.QuickAccess&quot;>
        		&lt;item value=&quot;755&quot; key=&quot;dialogHeight&quot;/>
        		&lt;item value=&quot;1440&quot; key=&quot;dialogWidth&quot;/>
        		&lt;list key=&quot;textEntries&quot;>
        		&lt;/list>
        		&lt;list key=&quot;orderedElements&quot;>
        		&lt;/list>
        		&lt;list key=&quot;orderedProviders&quot;>
        		&lt;/list>
        		&lt;list key=&quot;textArray&quot;>
        		&lt;/list>
        	&lt;/section>
        	&lt;section name=&quot;PreferencesImportWizard&quot;>
        		&lt;item value=&quot;C:\PCI_Dev\source\SVN\ProjectEngineering\StandardTools\eclipse\config-gsms\eclipse_perspective_PCI_Resource.epf&quot; key=&quot;&quot;/>
        		&lt;list key=&quot;WizardPreferencesExportPage1.STORE_DESTINATION_NAMES_ID&quot;>
        			&lt;item value=&quot;C:\PCI_Dev\source\SVN\ProjectEngineering\StandardTools\eclipse\config-gsms\eclipse_perspective_PCI_Resource.epf&quot;/>
        		&lt;/list>
        	&lt;/section>
        	&lt;section name=&quot;ImportExportAction&quot;>
        		&lt;item value=&quot;org.eclipse.ui.wizards.export.Preferences&quot; key=&quot;ImportExportPage.STORE_SELECTED_EXPORT_WIZARD_ID&quot;/>
        		&lt;item value=&quot;org.eclipse.ui.wizards.import.Preferences&quot; key=&quot;ImportExportPage.STORE_SELECTED_IMPORT_WIZARD_ID&quot;/>
        		&lt;list key=&quot;ImportExportPage.STORE_EXPANDED_IMPORT_CATEGORIES&quot;>
        			&lt;item value=&quot;org.eclipse.ui.Basic&quot;/>
        			&lt;item value=&quot;org.eclipse.team.cvs.ui.importWizards&quot;/>
        			&lt;item value=&quot;org.eclipse.egit.ui.internal.clone.gitclonecategory&quot;/>
        			&lt;item value=&quot;org.eclipse.team.svn.ui.repository&quot;/>
        			&lt;item value=&quot;org.eclipse.team.ui.importWizards&quot;/>
        		&lt;/list>
        		&lt;list key=&quot;ImportExportPage.STORE_EXPANDED_EXPORT_CATEGORIES&quot;>
        			&lt;item value=&quot;org.eclipse.ui.Basic&quot;/>
        		&lt;/list>
        	&lt;/section>
        	&lt;section name=&quot;PreferencesExportWizard&quot;>
        		&lt;item value=&quot;C:\PCI_Dev\eclipse_user.epf&quot; key=&quot;&quot;/>
        		&lt;item value=&quot;true&quot; key=&quot;WizardPreferencesExportPage1.STORE_OVERWRITE_EXISTING_FILES_ID&quot;/>
        		&lt;item value=&quot;true&quot; key=&quot;WizardPreferencesExportPage1.EXPORT_ALL_PREFERENCES_ID&quot;/>
        		&lt;list key=&quot;WizardPreferencesExportPage1.STORE_DESTINATION_NAMES_ID&quot;>
        			&lt;item value=&quot;C:\PCI_Dev\eclipse_user.epf&quot;/>
        		&lt;/list>
        	&lt;/section>
        &lt;/section>

      </content>
    </setupTask>
    <setupTask
        xsi:type="setup:ResourceCreationTask"
        excludedTriggers="STARTUP MANUAL"
        targetURL="${dir.bsh|uri}/.metadata/.plugins/org.eclipse.jdt.ui/dialog_settings.xml"
        encoding="UTF-8">
      <content>
        &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>
        &lt;section name=&quot;Workbench&quot;>
        	&lt;item value=&quot;true&quot; key=&quot;TypeHierarchyViewPart.linkeditors&quot;/>
        	&lt;section name=&quot;org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart&quot;>
        		&lt;item value=&quot;2&quot; key=&quot;layout&quot;/>
        		&lt;item value=&quot;true&quot; key=&quot;group_libraries&quot;/>
        		&lt;item value=&quot;true&quot; key=&quot;linkWithEditor&quot;/>
        		&lt;item value=&quot;2&quot; key=&quot;rootMode&quot;/>
        	&lt;/section>
        &lt;/section>

      </content>
    </setupTask>


index.php/fa/38602/0/


This was the content before conversion.
    <setupTask
        xsi:type="setup:ResourceCreationTask"
        excludedTriggers="STARTUP MANUAL"
        content="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>&#xA;&lt;section name=&quot;Workbench&quot;>&#xA;&#x9;&lt;section name=&quot;ExternalProjectImportWizard&quot;>&#xA;&#x9;&#x9;&lt;item value=&quot;true&quot; key=&quot;WizardProjectsImportPage.STORE_NESTED_PROJECTS&quot;/>&#xA;&#x9;&#x9;&lt;item value=&quot;false&quot; key=&quot;WizardProjectsImportPage.STORE_COPY_PROJECT_ID&quot;/>&#xA;&#x9;&#x9;&lt;item value=&quot;false&quot; key=&quot;WizardProjectsImportPage.STORE_ARCHIVE_SELECTED&quot;/>&#xA;&#x9;&#x9;&lt;list key=&quot;WizardProjectsImportPage.STORE_DIRECTORIES&quot;>&#xA;&#x9;&#x9;&#x9;&lt;item value=&quot;C:\PCI_Dev\source\SVN\CustomerName&quot;/>&#xA;&#x9;&#x9;&#x9;&lt;item value=&quot;C:\PCI_Dev\source\SVN\ProjectEngineering\StandardTools\jars&quot;/>&#xA;&#x9;&#x9;&#x9;&lt;item value=&quot;C:\PCI_Dev\source\SVN\ProjectEngineering\StandardTools\projects\example_refsys&quot;/>&#xA;&#x9;&#x9;&#x9;&lt;item value=&quot;C:\PCI_Dev\source\SVN\ProjectEngineering\StandardTools\javadocs&quot;/>&#xA;&#x9;&#x9;&#x9;&lt;item value=&quot;C:\PCI_Dev\source\SVN\ProjectEngineering\StandardTools\projects\common&quot;/>&#xA;&#x9;&#x9;&lt;/list>&#xA;&#x9;&#x9;&lt;list key=&quot;WizardProjectsImportPage.STORE_ARCHIVES&quot;>&#xA;&#x9;&#x9;&#x9;&lt;item value=&quot;&quot;/>&#xA;&#x9;&#x9;&lt;/list>&#xA;&#x9;&lt;/section>&#xA;&#x9;&lt;section name=&quot;org.eclipse.ui.internal.views.markers.FiltersConfigurationDialog&quot;>&#xA;&#x9;&#x9;&lt;item value=&quot;Errors/Warnings on Selection&quot; key=&quot;SELECTED_FILTER_GROUP&quot;/>&#xA;&#x9;&#x9;&lt;list key=&quot;PREV_SELECTED_ELEMENTS&quot;>&#xA;&#x9;&#x9;&lt;/list>&#xA;&#x9;&lt;/section>&#xA;&lt;/section>&#xA;"
        targetURL="${dir.bsh|uri}/.metadata/.plugins/org.eclipse.ui.ide/dialog_settings.xml"
        encoding="UTF-8"/>

Re: Content in ResourceCreationTask getting mangled on save [message #1830152 is a reply to message #1830142] Sat, 18 July 2020 06:09 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 32111
Registered: July 2009
Senior Member
That all looks correct to me, and in fact your properties editing dialog shows the value is correct. If I copy the text of both tasks to my workspace.setup, and change them so I can perform them (to not perform only for BOOTSTRAP and the URI to somewhere on my local drive), both produce the expected correct results.

So I'm at a loss to reproduce the problem and for coming up with a theory for why you should see such a problem. Perhaps I'm missing something important between you copying and pasting text to the forum and me copying and pasting them into my setup.

Is it possible to attach a complete *.setup that reproduces the problem?

One way that I often test things is to do Navigate -> Open Setup -> Workspace. Any task one creates here will be performed, and that setup reproducing the problem you could attach...


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Content in ResourceCreationTask getting mangled on save [message #1830206 is a reply to message #1830152] Mon, 20 July 2020 17:37 Go to previous messageGo to next message
Michael Thompson is currently offline Michael ThompsonFriend
Messages: 12
Registered: July 2020
Location: NC
Junior Member
I'm trying to get a reproducible example. However I think is that this is only happening from the Eclipse Installer, not when Oomph is run from inside the IDE. My suspicion now is that maybe it's because I'm using an older installer executable (from last year, 1.14.0).

Maybe I'm going about this the wrong way (or there is a easier way since I did it initially). Currently I'll download the eclipse-inst-win64.exe and extract the product zip from it. Then I use the product zip with a custom batch file to inject all my ini/setup files at runtime.

I suspect maybe I need to update my product.zip more frequently? Is there a way now to pickup all the customization without using extracted installer components?

Also, thank you for your help and all the work on Ooomph. It is amazing and has made my life so much simpler for keeping a consistent IDE for all our internal and external developers! :)


Batch file excerpt:
echo.
echo Unzip Installer and Copy Setup Files
mkdir product
cd product
7za.exe x ..\product.zip
mkdir setups
copy ..\eclipse\*.ini  .
copy ..\eclipse\*.html readme\
type ..\eclipse\org.eclipse.conf.setup     | sed "s/{version}/%ECLIPSE_WS%%ECLIPSE_DE%/" > %TEMP%\org.eclipse.config.setup

start /wait /max eclipse-inst %TEMP%\org.eclipse.config.setup


eclipse-inst.ini
-startup
plugins/org.eclipse.equinox.launcher_1.5.500.v20190715-1310.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.1100.v20190715-0945
--launcher.appendVmargs
--launcher.XXMaxPermSize
256M
-name
PCI Eclipse Standard Tools Installer
-eclipse.password
C:\PCI_Dev\source\SVN\ProjectEngineering\StandardTools\eclipse\config-gsms\master.key
-data
@noDefault
-vmargs
-Xms256M
-Xmx1024M
-Doomph.installer.update.url=http://download.eclipse.org/oomph/products/latest/repository
-Doomph.update.url=http://download.eclipse.org/oomph/updates/latest
-Doomph.setup.installer.mode=advanced
-Declipse.p2.unsignedPolicy=true
-Declipse.p2.mirrors=false
-Doomph.redirection.setups=index:/->../eclipse/

Re: Content in ResourceCreationTask getting mangled on save [message #1830223 is a reply to message #1830206] Tue, 21 July 2020 07:02 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 32111
Registered: July 2009
Senior Member
The self-extracting eclipse-inst-win64.exe itself handles command line arguments so likely you can launch it and specify what you need on the command line without a more complicated procedure.

The arguments may start with --debug; this is stripped off and produces trace information about how the extractor is extracting the components. The first argument can be -vm <location> ; this too is stripped off and that location is then used as the JVM. After that, all the arguments are passed to the product/application and all of the following applies:

https://help.eclipse.org/2020-06/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fruntime-options.html

So you should, for example, be able to run eclipse-inst-win64.exe -name "PCI Eclipse Standard Tools Installer-eclipse.password" C:\PCI_Dev\source\SVN\ProjectEngineering\StandardTools\eclipse\config-gsms\master.key -vmargs -Dfoo=bar

Of course if you're repackaging this and wanting to redistribute a modified installer, that doesn't help so much...

It's still strange though because I don't see any significant changes in how the value is deserialized in BaseResourceImpl. But now that I say that, if the resource is loaded by an older version of the Setup model, one where the type of ResourceCreationTask.content is still EString and not Text, then the special handling doesn't kick in and the value, including the initial blank line and indentation, will be loaded. That must be what's happening...

Note that in advanced mode on the Configuration page, you can review the details of each and every task. So you can inspect the contents of the creation task to see if that already looks wrong; double click an attribute value to see the value in a dialog.


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Configuration with User Project?
Next Topic:Citrix for Eclipse for multiple user's
Goto Forum:
  


Current Time: Tue Dec 07 01:07:36 GMT 2021

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

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

Back to the top