Project

General

Profile

feature request #5969

feature request #3958: Handle CDMPreference table

Implement CdmPreference reading for database preferences

Added by Andreas Müller almost 3 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Highest
Assignee:
Category:
taxeditor
Target version:
Start date:
07/08/2016
Due date:
% Done:

100%

Severity:
normal

Description

Start with NomenclaturalCode. The values are available through IPreferenceService.

See also #3958, #5971


Related issues

Related to Edit - feature request #5971: Implement database wide CdmPreference writing Closed 07/08/2016
Related to Edit - bug #3658: Update Nomenclatural code for datasources Closed 08/23/2013
Related to Edit - feature request #5970: Implement allowOverride in CdmPreference Closed 07/08/2016
Related to Edit - bug #6215: NPE when opening preferences with no DB connection Closed 11/23/2016
Precedes Edit - bug #6105: Make CdmPreferences editable in separate view Resolved 07/08/2016
Precedes Edit - bug #6106: [Discuss] Handle rights and roles for CdmPreferences New 07/11/2016 07/11/2016

Associated revisions

Revision 92e52208 (diff)
Added by Katja Luther over 2 years ago

ref #5969: add PreferenceService to applicationController

Revision b9801dc0 (diff)
Added by Katja Luther over 2 years ago

ref #5969: get the preference NC from db when initialize preference store and save the changes in db

Revision 4625a011 (diff)
Added by Katja Luther over 2 years ago

ref #5969: check if there is a NC preference in db if not use the local NC preference

Revision 2a7c9630 (diff)
Added by Katja Luther over 2 years ago

ref #5969: check for db connection before ty to read the preferred nomenclatural code

Revision 68f310fd (diff)
Added by Katja Luther over 2 years ago

ref #5969: add remark that the nomenclatural code preference is stored in db

Revision 1990fe50 (diff)
Added by Katja Luther over 2 years ago

ref #5969: add PreferenceService to applicationController

History

#1 Updated by Katja Luther over 2 years ago

  • Description updated (diff)
  • Status changed from New to Resolved
  • Assignee changed from Katja Luther to Andreas Müller
  • % Done changed from 0 to 50

first implementation added.

#2 Updated by Andreas Müller over 2 years ago

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

When trying to open Preferences-Taxonomic-NomenclaturalCode I got an NPE:

login : admin
editor version : 4.3.0.201609141050
server : test.e-taxonomy.eu / edit-test
schema version : 4.0.0.0.201604200000
os : Windows Server 2012 6.2 amd64
java : 1.7.0_65
java.lang.NullPointerException
    at eu.etaxonomy.taxeditor.preference.PreferencesUtil.setPreferredNomenclaturalCode(PreferencesUtil.java:119)
    at eu.etaxonomy.taxeditor.preference.NomenclaturalCodePreferences.init(NomenclaturalCodePreferences.java:86)
    at org.eclipse.ui.internal.dialogs.WorkbenchPreferenceNode.createPage(WorkbenchPreferenceNode.java:57)
    at org.eclipse.jface.preference.PreferenceDialog.createPage(PreferenceDialog.java:1339)
    at org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.createPage(FilteredPreferenceDialog.java:376)
    at org.eclipse.jface.preference.PreferenceDialog.showPage(PreferenceDialog.java:1230)
    at org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.showPage(FilteredPreferenceDialog.java:674)
    at org.eclipse.jface.preference.PreferenceDialog$10.run(PreferenceDialog.java:708)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.jface.preference.PreferenceDialog$9.selectionChanged(PreferenceDialog.java:704)
    at org.eclipse.jface.viewers.StructuredViewer$3.run(StructuredViewer.java:888)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
    at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
    at org.eclipse.jface.viewers.StructuredViewer.firePostSelectionChanged(StructuredViewer.java:886)
    at org.eclipse.jface.viewers.StructuredViewer.handlePostSelect(StructuredViewer.java:1226)
    at org.eclipse.jface.viewers.StructuredViewer$5.widgetSelected(StructuredViewer.java:1251)
    at org.eclipse.jface.util.OpenStrategy.firePostSelectionEvent(OpenStrategy.java:262)
    at org.eclipse.jface.util.OpenStrategy.access$5(OpenStrategy.java:256)
    at org.eclipse.jface.util.OpenStrategy$3.run(OpenStrategy.java:433)
    at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
    at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4140)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3757)
    at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
    at org.eclipse.jface.window.Window.open(Window.java:801)
    at org.eclipse.ui.internal.dialogs.WorkbenchPreferenceDialog.open(WorkbenchPreferenceDialog.java:215)
    at org.eclipse.ui.internal.handlers.ShowPreferencePageHandler.execute(ShowPreferencePageHandler.java:54)
    at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293)
    at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
    at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
    at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
    at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
    at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSelection(CommandContributionItem.java:829)
    at org.eclipse.ui.menus.CommandContributionItem.access$19(CommandContributionItem.java:815)
    at org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(CommandContributionItem.java:805)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
    at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at eu.etaxonomy.taxeditor.Application.start(Application.java:24)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1410)

#3 Updated by Katja Luther over 2 years ago

there was no check whether the preference is already in DB, now if the preference could not find in DB the local one is used.

#4 Updated by Katja Luther over 2 years ago

  • Assignee changed from Katja Luther to Andreas Müller

#5 Updated by Andreas Müller over 2 years ago

#6 Updated by Andreas Müller over 2 years ago

#7 Updated by Andreas Müller over 2 years ago

  • Precedes bug #6105: Make CdmPreferences editable in separate view added

#8 Updated by Andreas Müller over 2 years ago

The implementation in the local preferences UI works well now and I think we can close the ticket.

But maybe we can leave a remark in the UI that this value is stored in the database, not in the local preferences, to warn users.

Implementation in a separate UI is handled in a follow up ticket: #6105

Another issue is rights management which is handled by #6106

#9 Updated by Andreas Müller over 2 years ago

  • Assignee changed from Andreas Müller to Katja Luther

#10 Updated by Andreas Müller over 2 years ago

  • Precedes bug #6106: [Discuss] Handle rights and roles for CdmPreferences added

#11 Updated by Andreas Müller over 2 years ago

If no datasource is selected an NPE occurs:

login : 
editor version : 4.3.0.201609201350
server :  / 
schema version : 
os : Windows Server 2012 6.2 amd64
java : 1.7.0_65
java.lang.NullPointerException
    at eu.etaxonomy.taxeditor.preference.PreferencesUtil.setPreferredNomenclaturalCode(PreferencesUtil.java:118)
    at eu.etaxonomy.taxeditor.preference.NomenclaturalCodePreferences.init(NomenclaturalCodePreferences.java:86)
    at org.eclipse.ui.internal.dialogs.WorkbenchPreferenceNode.createPage(WorkbenchPreferenceNode.java:57)
    at org.eclipse.jface.preference.PreferenceDialog.createPage(PreferenceDialog.java:1339)
    at org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.createPage(FilteredPreferenceDialog.java:376)
    at org.eclipse.jface.preference.PreferenceDialog.showPage(PreferenceDialog.java:1230)
    at org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.showPage(FilteredPreferenceDialog.java:674)
    at org.eclipse.jface.preference.PreferenceDialog$10.run(PreferenceDialog.java:708)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.jface.preference.PreferenceDialog$9.selectionChanged(PreferenceDialog.java:704)
    at org.eclipse.jface.viewers.StructuredViewer$3.run(StructuredViewer.java:888)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)

This is kind of important because it is currently the only possibility to set the local preference (in case a database preference is not yet set)

#12 Updated by Katja Luther over 2 years ago

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

In Revision 4625a011 a check for the existence of the preference in DB is added.

#13 Updated by Andreas Müller over 2 years ago

  • Status changed from Resolved to Feedback
  • Assignee changed from Andreas Müller to Katja Luther
  • % Done changed from 50 to 80

Katja Luther wrote:

In Revision 4625a011 a check for the existence of the preference in DB is added.

This does not seem to fix the problem. I checked with the latest nightly (Sep. 30th)

Please also add the remark on the UI as mentioned in #note-8 before closing the ticket fully.

#14 Updated by Katja Luther over 2 years ago

I added a remark that that the preference is stored in db and a check whether the editor is already connected to a datasource.

#15 Updated by Katja Luther over 2 years ago

  • Assignee changed from Katja Luther to Andreas Müller

#16 Updated by Andreas Müller over 2 years ago

  • Related to bug #3658: Update Nomenclatural code for datasources added

#17 Updated by Andreas Müller over 2 years ago

#18 Updated by Andreas Müller over 2 years ago

  • Status changed from Feedback to Closed

I think we can close this ticket now. Open issues will be checked in #5971 and are more related to writing then reading

#19 Updated by Andreas Müller over 2 years ago

  • Assignee changed from Andreas Müller to Katja Luther
  • % Done changed from 80 to 100

#20 Updated by Andreas Müller over 2 years ago

  • Related to bug #6215: NPE when opening preferences with no DB connection added

#21 Updated by Andreas Müller over 2 years ago

  • Parent task set to #3958

#22 Updated by Andreas Müller over 1 year ago

  • Private changed from Yes to No

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)