Project

General

Profile

feature request #9065

Add derived unit media to DerivedUnitFacade details view

Added by Andreas Müller 5 months ago. Updated 2 months ago.

Status:
Closed
Priority:
Highest
Assignee:
Category:
taxeditor
Target version:
Start date:
06/12/2020
Due date:
% Done:

100%

Severity:
critical

Description

For the workflow of adding typification or any other specimen data to a taxon/name it is often necessary to add also media data. This is currently not yet possible with the details view for derived units. However, the method to add DerivedUnit media exists in the DerivedUnitFacade so probably it is simple to add a new section "DerivedUnitMedia" to the details view.

This workflow is urgently needed.

picture039-1.png View (13.5 KB) Andreas Müller, 08/13/2020 03:30 PM

picture930-1.png View (149 KB) Andreas Müller, 08/19/2020 12:16 PM


Related issues

Related to Edit - feature request #9064: Add ExternalLinks to IdentifiableEntities Closed 06/12/2020
Related to Edit - bug #8691: Remaining issues for asynchronous image loading New 11/18/2019

Associated revisions

Revision 90f25990 (diff)
Added by Katja Luther 3 months ago

ref #9065: add media section to derived unit details view

Revision 06830031 (diff)
Added by Katja Luther 3 months ago

ref #9065: do not show media in tree view details and disable media view for bulkeditor

Revision e3895566 (diff)
Added by Katja Luther 2 months ago

ref #9065: derivedUnit wizard should contain media section but without loading the image

Revision f6218ddf (diff)
Added by Katja Luther 2 months ago

ref #9065: add a button to load the image in derived unit facade wizard

Revision 170e8ea2 (diff)
Added by Katja Luther 2 months ago

ref #9065: switch button text after click

Revision 35bb83fe (diff)
Added by Katja Luther 2 months ago

ref #9065: avoid NPE

Revision 6bbe08fd (diff)
Added by Katja Luther 2 months ago

ref #9065: fix loading of image

History

#1 Updated by Andreas Müller 5 months ago

#2 Updated by Andreas Müller 4 months ago

  • Target version changed from Release 5.15 to Release 5.18

#3 Updated by Andreas Müller 3 months ago

  • Priority changed from New to Highest

#4 Updated by Katja Luther 3 months ago

  • Status changed from New to In Progress

#5 Updated by Katja Luther 3 months ago

  • Status changed from In Progress to Resolved
  • Assignee changed from Katja Luther to Andreas Müller

#6 Updated by Andreas Müller 3 months ago

  • % Done changed from 0 to 40

Generally this seems to work. However, there is an issue:

The new media section is also shown in the specimen tree editor where it is not needed and not wanted as we can and should use the media gallery view here. This is because the specimen tree editor for some reason also uses the DerivedUnitFacade although this does not really make sense (I think there is a ticket for changing this or at least there was discussion on it).

Best would be to adapt the specimen tree editor to not use the DerivedUnitFacade. As this probably is not that easy we need a workaround to hide the media part in this special case.

#7 Updated by Andreas Müller 3 months ago

  • Status changed from Resolved to Feedback
  • Assignee changed from Andreas Müller to Katja Luther

In the specimen list editor it is now possible to also edit media in the media gallery view. This should not be possible as the semantics of "media gallery" for a derived unit facade is unclear. It should be grayed out same as the factual data view. (Also when editing data there I got a multiple representations exception)

#8 Updated by Katja Luther 3 months ago

Andreas Müller wrote:

In the specimen list editor it is now possible to also edit media in the media gallery view. This should not be possible as the semantics of "media gallery" for a derived unit facade is unclear. It should be grayed out same as the factual data view. (Also when editing data there I got a multiple representations exception)

I did not changed anything and there were no changes the last 2 or 3 years. But I can deactivate the media view for the specimen bulk editor.

#9 Updated by Katja Luther 3 months ago

  • Status changed from Feedback to Resolved
  • Assignee changed from Katja Luther to Andreas Müller

now the media view for list viewer is disabled and the media section in details view for the tree view as well.

#10 Updated by Andreas Müller 3 months ago

If the derived unit facade is used in a specimen dialogue (e.g. when editing a type specimen) the media section is still missing. However, as far as I understand it, this is the main reason why we added the media section to fasten type editing workflows with specimen images.

#11 Updated by Andreas Müller 3 months ago

  • Status changed from Resolved to Feedback
  • Assignee changed from Andreas Müller to Katja Luther

#12 Updated by Katja Luther 3 months ago

  • Assignee changed from Katja Luther to Andreas Müller

For this wizard, maybe the image should not be loaded otherwise the time for creating the wizard for editing and after adding the url could be very long. What do you think?

#13 Updated by Andreas Müller 2 months ago

Katja Luther wrote:

For this wizard, maybe the image should not be loaded otherwise the time for creating the wizard for editing and after adding the url could be very long. What do you think?

I (partly) agree. Definitely we should not load the media at the beginning. However, showing the image is sometimes crucial to know if the correct image was loaded, so an asynchronous mechanism is needed. This in theory has been implemented in #8129 already but unfortunately it does not fully work yet #8691. Maybe you can have a look and find out why it does not work and how it can be improved. Asynchronous loading is an important feature when working with images, otherwise it gets annoying (from my own experience).
If fixing the bug is not easy we could alternatively add a button to actively start the image loading, but this is only a workaround that needs to be removed again, later when asynchronous loading works.

#14 Updated by Andreas Müller 2 months ago

  • Related to bug #8691: Remaining issues for asynchronous image loading added

#15 Updated by Andreas Müller 2 months ago

  • Assignee changed from Andreas Müller to Katja Luther

#16 Updated by Katja Luther 2 months ago

Andreas Müller wrote:

Katja Luther wrote:

For this wizard, maybe the image should not be loaded otherwise the time for creating the wizard for editing and after adding the url could be very long. What do you think?

I (partly) agree. Definitely we should not load the media at the beginning. However, showing the image is sometimes crucial to know if the correct image was loaded, so an asynchronous mechanism is needed. This in theory has been implemented in #8129 already but unfortunately it does not fully work yet #8691. Maybe you can have a look and find out why it does not work and how it can be improved. Asynchronous loading is an important feature when working with images, otherwise it gets annoying (from my own experience).
If fixing the bug is not easy we could alternatively add a button to actively start the image loading, but this is only a workaround that needs to be removed again, later when asynchronous loading works.

For this release I will add a button, I already had a look at this issue and at a first look the code seems to be correct.

#17 Updated by Katja Luther 2 months ago

  • Assignee changed from Katja Luther to Andreas Müller

Katja Luther wrote:

Andreas Müller wrote:

Katja Luther wrote:

For this wizard, maybe the image should not be loaded otherwise the time for creating the wizard for editing and after adding the url could be very long. What do you think?

I (partly) agree. Definitely we should not load the media at the beginning. However, showing the image is sometimes crucial to know if the correct image was loaded, so an asynchronous mechanism is needed. This in theory has been implemented in #8129 already but unfortunately it does not fully work yet #8691. Maybe you can have a look and find out why it does not work and how it can be improved. Asynchronous loading is an important feature when working with images, otherwise it gets annoying (from my own experience).
If fixing the bug is not easy we could alternatively add a button to actively start the image loading, but this is only a workaround that needs to be removed again, later when asynchronous loading works.

For this release I will add a button, I already had a look at this issue and at a first look the code seems to be correct.

I added now a button for loading the image, please have a look whether it is ok or we should think about another solution.

#18 Updated by Andreas Müller 2 months ago

  • Status changed from Feedback to Resolved

#19 Updated by Andreas Müller 2 months ago

  • Status changed from Resolved to Feedback
  • Assignee changed from Andreas Müller to Katja Luther

Reloading did not work for me after changing a URI. The Image was empty then.

#20 Updated by Andreas Müller 2 months ago

The scrolling does not work after loading the image. The scrollbar is on the deepest position but still the image is shown only partly:

Only resizing the dialog solves this.

#21 Updated by Andreas Müller 2 months ago

It is not possbile to switch between simple mode and advanced mode. So entering the advanced mode is not possible but is sometimes necessary.

#22 Updated by Andreas Müller 2 months ago

When checking the image that I added via dialogue in the specimen tree editor or in the media bulk editor I get an NPE

last remote method : http://test.e-taxonomy.eu:80/cdmserver/rem_conf_am/remoting/common.service
last remote request client time : 2020-08-19T12:23:56.487
last remote request response header time : Wed, 19 Aug 2020 12:23:56 GMT
client error time : 2020-08-19T12:23:56.565
login : admin
editor version : 5.17.0.202008190755
server : test.e-taxonomy.eu (edit-test) / rem_conf_am
schema version : 5.15.2.0.20200611
os : Windows Server 2012 R2 6.3 amd64
java : 1.8.0_121
org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NullPointerException)
    at org.eclipse.swt.SWT.error(SWT.java:4533)
    at org.eclipse.swt.SWT.error(SWT.java:4448)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185)
    at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4211)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3827)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1121)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1022)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:150)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:693)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:610)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
    at eu.etaxonomy.taxeditor.Application.start(Application.java:20)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
Caused by: java.lang.NullPointerException
    at eu.etaxonomy.taxeditor.ui.section.media.MediaMetaElement.createControls(MediaMetaElement.java:87)
    at eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement.<init>(AbstractEntityCollectionElement.java:111)
    at eu.etaxonomy.taxeditor.ui.section.media.MediaMetaElement.<init>(MediaMetaElement.java:49)
    at eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.createEntityCollectionElement(CdmFormFactory.java:2833)
    at eu.etaxonomy.taxeditor.ui.section.description.MediaDetailsSection.setEntity(MediaDetailsSection.java:49)
    at eu.etaxonomy.taxeditor.ui.section.description.MediaDetailsSection.setEntity(MediaDetailsSection.java:1)
    at eu.etaxonomy.taxeditor.view.detail.CdmSectionPart.setFormInput(CdmSectionPart.java:172)
    at org.eclipse.ui.forms.ManagedForm.setInput(ManagedForm.java:210)
    at eu.etaxonomy.taxeditor.view.e4.AbstractCdmDataViewerE4.refresh(AbstractCdmDataViewerE4.java:162)
    at eu.etaxonomy.taxeditor.view.e4.AbstractCdmDataViewerE4.setInput(AbstractCdmDataViewerE4.java:143)
    at eu.etaxonomy.taxeditor.view.e4.details.DetailsViewerE4.setInput(DetailsViewerE4.java:202)
    at eu.etaxonomy.taxeditor.view.e4.details.DetailsViewerE4.setInput(DetailsViewerE4.java:173)
    at eu.etaxonomy.taxeditor.view.e4.AbstractCdmEditorPartE4.showViewer(AbstractCdmEditorPartE4.java:281)
    at eu.etaxonomy.taxeditor.view.e4.details.DetailsPartE4.selectionChanged_internal(DetailsPartE4.java:107)
    at eu.etaxonomy.taxeditor.view.e4.AbstractCdmEditorPartE4$DelaySelection.run(AbstractCdmEditorPartE4.java:93)
    at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:182)
    ... 23 more

I don't know if this is related to the earlier adding but it urgently needs to be fixed/checked why it happens.

#23 Updated by Katja Luther 2 months ago

Andreas Müller wrote:

When checking the image that I added via dialogue in the specimen tree editor or in the media bulk editor I get an NPE

last remote method : http://test.e-taxonomy.eu:80/cdmserver/rem_conf_am/remoting/common.service
last remote request client time : 2020-08-19T12:23:56.487
last remote request response header time : Wed, 19 Aug 2020 12:23:56 GMT
client error time : 2020-08-19T12:23:56.565
login : admin
editor version : 5.17.0.202008190755
server : test.e-taxonomy.eu (edit-test) / rem_conf_am
schema version : 5.15.2.0.20200611
os : Windows Server 2012 R2 6.3 amd64
java : 1.8.0_121
org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NullPointerException)
  at org.eclipse.swt.SWT.error(SWT.java:4533)
  at org.eclipse.swt.SWT.error(SWT.java:4448)
  at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185)
  at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4211)
  at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3827)
  at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1121)
  at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
  at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1022)
  at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:150)
  at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:693)
  at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
  at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:610)
  at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
  at eu.etaxonomy.taxeditor.Application.start(Application.java:20)
  at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
  at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
  at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
  at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
  at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:498)
  at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673)
  at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
  at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
Caused by: java.lang.NullPointerException
  at eu.etaxonomy.taxeditor.ui.section.media.MediaMetaElement.createControls(MediaMetaElement.java:87)
  at eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement.<init>(AbstractEntityCollectionElement.java:111)
  at eu.etaxonomy.taxeditor.ui.section.media.MediaMetaElement.<init>(MediaMetaElement.java:49)
  at eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.createEntityCollectionElement(CdmFormFactory.java:2833)
  at eu.etaxonomy.taxeditor.ui.section.description.MediaDetailsSection.setEntity(MediaDetailsSection.java:49)
  at eu.etaxonomy.taxeditor.ui.section.description.MediaDetailsSection.setEntity(MediaDetailsSection.java:1)
  at eu.etaxonomy.taxeditor.view.detail.CdmSectionPart.setFormInput(CdmSectionPart.java:172)
  at org.eclipse.ui.forms.ManagedForm.setInput(ManagedForm.java:210)
  at eu.etaxonomy.taxeditor.view.e4.AbstractCdmDataViewerE4.refresh(AbstractCdmDataViewerE4.java:162)
  at eu.etaxonomy.taxeditor.view.e4.AbstractCdmDataViewerE4.setInput(AbstractCdmDataViewerE4.java:143)
  at eu.etaxonomy.taxeditor.view.e4.details.DetailsViewerE4.setInput(DetailsViewerE4.java:202)
  at eu.etaxonomy.taxeditor.view.e4.details.DetailsViewerE4.setInput(DetailsViewerE4.java:173)
  at eu.etaxonomy.taxeditor.view.e4.AbstractCdmEditorPartE4.showViewer(AbstractCdmEditorPartE4.java:281)
  at eu.etaxonomy.taxeditor.view.e4.details.DetailsPartE4.selectionChanged_internal(DetailsPartE4.java:107)
  at eu.etaxonomy.taxeditor.view.e4.AbstractCdmEditorPartE4$DelaySelection.run(AbstractCdmEditorPartE4.java:93)
  at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
  at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:182)
  ... 23 more

I don't know if this is related to the earlier adding but it urgently needs to be fixed/checked why it happens.

this should be fixed.

#24 Updated by Katja Luther 2 months ago

Andreas Müller wrote:

The scrolling does not work after loading the image. The scrollbar is on the deepest position but still the image is shown only partly:

Only resizing the dialog solves this.

this problem also appears when the image is loaded at the beginning... without the button

#25 Updated by Andreas Müller 2 months ago

Hmm, strange. So should we keep the button solution then? Just decide yourself. We need to improve this during next release anyway.

Maybe it also depends on the question if the "Reload" works or not.

#26 Updated by Katja Luther 2 months ago

  • Status changed from Feedback to Resolved
  • Assignee changed from Katja Luther to Andreas Müller

this is fixed now. Depending on the size of the image, sometimes it take some time and it looks like the load or reload does not work, but it works now.

#27 Updated by Andreas Müller 2 months ago

  • Status changed from Resolved to Closed
  • Assignee changed from Andreas Müller to Katja Luther
  • % Done changed from 40 to 100

The button solution only works for simple view. If an image exists already and has >1 representations the advanced view is shown which has not button.
But as #8691 hopefully will be solved soon this is not an blocking issue.

I think we can close this ticket.

I will open a new ticket for the remaining issue "It is not possbile to switch between simple mode and advanced mode. So entering the advanced mode is not possible but is sometimes necessary."

#28 Updated by Andreas Müller 2 months ago

Andreas Müller wrote:

It is not possbile to switch between simple mode and advanced mode. So entering the advanced mode is not possible but is sometimes necessary.

There is already a ticket for this #8367

#29 Updated by Andreas Müller 2 months ago

  • Target version changed from Release 5.18 to Release 5.17

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)