Project

General

Profile

Revision c01a0dfe

IDc01a0dfe70bd7581d7a1203178bee0274e1de177
Parent 974d02d0
Child a2452e25

Added by Katja Luther over 1 year ago

ref #8096: restructure repair menu and use longrunningTaskService for repair functionality

View differences:

eu.etaxonomy.taxeditor.application/fragment.e4xmi
37 37
        <children xsi:type="menu:HandledMenuItem" xmi:id="_35iN8B7PEeeC-JvycL9ysA" elementId="org.eclipse.ui.main.menu.window.preferences" label="%command.label.12" command="_l9kXoB7PEeeC-JvycL9ysA"/>
38 38
      </children>
39 39
      <children xsi:type="menu:Menu" xmi:id="_KDFiMB6tEeePLJ5to5QrXQ" elementId="org.eclipse.ui.main.menu.admin" label="%menu.label.4">
40
        <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_QAx6wD8_EemTy7SLZkowuQ" coreExpressionId="hasROLE_PROJECT_MANAGER_AND_isCdmStoreConnected"/>
40 41
        <children xsi:type="menu:HandledMenuItem" xmi:id="_RsV7EB-IEeeIA_2gwq7JKg" elementId="org.eclipse.ui.main.menu.admin.dbpreferences" label="%command.label.23" command="_JXXNIB-IEeeIA_2gwq7JKg">
41 42
          <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_ckfJUB-IEeeIA_2gwq7JKg" coreExpressionId="hasROLE_PROJECT_MANAGER_AND_isCdmStoreConnected"/>
42 43
        </children>
43
        <children xsi:type="menu:HandledMenuItem" xmi:id="_VgPDcB-IEeeIA_2gwq7JKg" elementId="org.eclipse.ui.main.menu.admin.dbrepair" label="%command.label.24" command="_LuEl0B-IEeeIA_2gwq7JKg">
44
          <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_06_ZIB-TEeeIA_2gwq7JKg" coreExpressionId="hasROLE_PROJECT_MANAGER_AND_isCdmStoreConnected"/>
45
        </children>
46 44
        <children xsi:type="menu:HandledMenuItem" xmi:id="_E80JgCaQEeeO2YpaECSmsg" elementId="org.eclipse.ui.main.menu.admin.import_preferences" label="Import Preferences"/>
45
        <children xsi:type="menu:Menu" xmi:id="_ah5VoD8qEempU5gGjh-zOg" elementId="eu.etaxonomy.taxeditor.application.menu.RepairFunctionality" label="%command.label.24">
46
          <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_0iYE4D8-EemTy7SLZkowuQ" coreExpressionId="hasROLE_PROJECT_MANAGER_AND_isCdmStoreConnected"/>
47
        </children>
47 48
      </children>
48 49
      <children xsi:type="menu:Menu" xmi:id="_MG8QUB6tEeePLJ5to5QrXQ" elementId="org.eclipse.ui.main.menu.help" label="%menu.label.2">
49 50
        <children xsi:type="menu:HandledMenuItem" xmi:id="_6vgg4B6gEeePLJ5to5QrXQ" elementId="id.commandlabel16" label="%command.label.16" command="_ye6jsB6gEeePLJ5to5QrXQ"/>
......
54 55
  <fragments xsi:type="fragment:StringModelFragment" xmi:id="_vvQmIB4JEeehWtOSgLepjA" featurename="handlers" parentElementId="xpath:/">
55 56
    <elements xsi:type="commands:Handler" xmi:id="_haDmcB6eEeePLJ5to5QrXQ" elementId="eu.etaxonomy.taxeditor.OpenExternalAboutPlatformHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.application/eu.etaxonomy.taxeditor.OpenExternalAboutPlatformHandler" command="_V9LTcB6eEeePLJ5to5QrXQ"/>
56 57
    <elements xsi:type="commands:Handler" xmi:id="_3wxe4B6gEeePLJ5to5QrXQ" elementId="eu.etaxonomy.taxeditor.OpenExternalParserHelpHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.application/eu.etaxonomy.taxeditor.OpenExternalParserHelpHandler" command="_ye6jsB6gEeePLJ5to5QrXQ"/>
57
    <elements xsi:type="commands:Handler" xmi:id="_cwy_oB-LEeeIA_2gwq7JKg" elementId="eu.etaxonomy.taxeditor.handler.OpenDatabaseRepairWizardHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.handler.OpenDatabaseRepairWizardHandler" command="_LuEl0B-IEeeIA_2gwq7JKg"/>
58 58
    <elements xsi:type="commands:Handler" xmi:id="_pZ84gB-LEeeIA_2gwq7JKg" elementId="eu.etaxonomy.taxeditor.handler.OpenDatabasePreferencesWizardHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.handler.OpenDatabasePreferencesWizardHandler" command="_JXXNIB-IEeeIA_2gwq7JKg"/>
59 59
    <elements xsi:type="commands:Handler" xmi:id="_fAnCkCaQEeeO2YpaECSmsg" elementId="eu.etaxonomy.taxeditor.handler.OpenImportPreferenceHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/target.classes.eu.etaxonomy.taxeditor.handler.OpenImportPreferenceHandler" command="_q1JAkCaQEeeO2YpaECSmsg"/>
60 60
  </fragments>
......
77 77
    <elements xsi:type="commands:Command" xmi:id="_l9kXoB7PEeeC-JvycL9ysA" elementId="org.eclipse.ui.window.preferences" commandName="%command.label.12"/>
78 78
    <elements xsi:type="commands:Command" xmi:id="_hooiQB7QEeeC-JvycL9ysA" elementId="org.eclipse.ui.newWizard" commandName="%command.label.21"/>
79 79
    <elements xsi:type="commands:Command" xmi:id="_JXXNIB-IEeeIA_2gwq7JKg" elementId="eu.etaxonomy.taxeditor.application.DatabaseSettings" commandName="%command.label.23"/>
80
    <elements xsi:type="commands:Command" xmi:id="_LuEl0B-IEeeIA_2gwq7JKg" elementId="eu.etaxonomy.taxeditor.application.DatabaseRepairFunctionality" commandName="%command.label.24"/>
81 80
    <elements xsi:type="commands:Command" xmi:id="_q1JAkCaQEeeO2YpaECSmsg" elementId="eu.etaxonomy.taxeditor.application.ImportSettings" commandName="%command.label.25"/>
82 81
  </fragments>
83 82
  <fragments xsi:type="fragment:StringModelFragment" xmi:id="_nOhPoB9zEeeIA_2gwq7JKg" featurename="trimContributions" parentElementId="xpath:/">
eu.etaxonomy.taxeditor.store/fragment.e4xmi
150 150
    <elements xsi:type="commands:Command" xmi:id="_xDk5kNjyEeidDMMI9xTsbQ" elementId="eu.etaxonomy.taxeditor.store.command.featureTree.pasteFeature" commandName="%command.commandname.12"/>
151 151
    <elements xsi:type="commands:Command" xmi:id="_Za5DYO5vEeizn7bmbAeBkw" elementId="eu.etaxonomy.taxeditor.store.open.OpenDistributionStatusWizardHandler" commandName="%command.commandname.13"/>
152 152
    <elements xsi:type="commands:Command" xmi:id="_xyZ4oPhmEei8uPv-H2wqnw" elementId="eu.etaxonomy.taxeditor.store.command.featureTree.exportTreeOntology" commandName="%command.commandname.14"/>
153
    <elements xsi:type="commands:Command" xmi:id="_qYxw8D85EemTy7SLZkowuQ" elementId="eu.etaxonomy.taxeditor.store.command.OpenDatabaseRepairWizard" commandName="Open Cache Updater"/>
154
    <elements xsi:type="commands:Command" xmi:id="_VUQY0D86EemTy7SLZkowuQ" elementId="eu.etaxonomy.taxeditor.store.command.openSortIndexUpdaterWizard" commandName="Open Sort Index Updater"/>
153 155
  </fragments>
154 156
  <fragments xsi:type="fragment:StringModelFragment" xmi:id="_swGH0GhvEee3K4uKJljEYg" featurename="handlers" parentElementId="xpath:/">
155 157
    <elements xsi:type="commands:Handler" xmi:id="_rVEdIGcjEee0qLTtA2ZpVQ" elementId="eu.etaxonomy.taxeditor.featuretree.e4.handler.RemoveFeatureHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.featuretree.e4.handler.RemoveFeatureHandler" command="_fNBtQGcjEee0qLTtA2ZpVQ"/>
......
187 189
    <elements xsi:type="commands:Handler" xmi:id="_i-FlkNjyEeidDMMI9xTsbQ" elementId="eu.etaxonomy.taxeditor.featuretree.e4.handler.CopyFeatureHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.featuretree.e4.handler.CopyFeatureHandler" command="_cMyQ4NjyEeidDMMI9xTsbQ"/>
188 190
    <elements xsi:type="commands:Handler" xmi:id="_tzQ_YNjyEeidDMMI9xTsbQ" elementId="eu.etaxonomy.taxeditor.featuretree.e4.handler.PasteFeatureHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.featuretree.e4.handler.PasteFeatureHandler" command="_xDk5kNjyEeidDMMI9xTsbQ"/>
189 191
    <elements xsi:type="commands:Handler" xmi:id="_xWlngO5vEeizn7bmbAeBkw" elementId="eu.etaxonomy.taxeditor.handler.e4.OpenDistributionStausWizardHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.handler.e4.OpenDistributionStatusWizardHandler" command="_Za5DYO5vEeizn7bmbAeBkw"/>
192
    <elements xsi:type="commands:Handler" xmi:id="_i4yZAD8zEemTy7SLZkowuQ" elementId="eu.etaxonomy.taxeditor.store.handler.0" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.handler.OpenDatabaseRepairWizardHandler" command="_qYxw8D85EemTy7SLZkowuQ"/>
193
    <elements xsi:type="commands:Handler" xmi:id="_PugRQD86EemTy7SLZkowuQ" elementId="eu.etaxonomy.taxeditor.store.handler.1" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.handler.OpenUpdateSortIndicesHandler" command="_VUQY0D86EemTy7SLZkowuQ"/>
190 194
  </fragments>
191 195
  <fragments xsi:type="fragment:StringModelFragment" xmi:id="_qT4hgIfTEeecZ4F2Y9Z0Og" featurename="children" parentElementId="eu.etaxonomy.taxeditor.workbench.menu.window" positionInList="before:eu.etaxonomy.taxeditor.application.windowMenu.last">
192 196
    <elements xsi:type="menu:Menu" xmi:id="_LT3P8IfcEeecZ4F2Y9Z0Og" elementId="eu.etaxonomy.taxeditor.store.menu.termeditor" label="%menu.label.1">
......
264 268
  <fragments xsi:type="fragment:StringModelFragment" xmi:id="_lnmLABWNEeiazYUJirF0Pw" featurename="children" parentElementId="eu.etaxonomy.taxeditor.workbench.menu.help" positionInList="after:eu.etaxonomy.taxeditor.workbench.menuseparator.beforeHelp">
265 269
    <elements xsi:type="menu:HandledMenuItem" xmi:id="_uHiLwBWNEeiazYUJirF0Pw" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.handledmenuitemlabel6" label="%handledmenuitem.label.11" command="_jSJrsBWPEeiazYUJirF0Pw"/>
266 270
  </fragments>
271
  <fragments xsi:type="fragment:StringModelFragment" xmi:id="_S2CIED8oEempU5gGjh-zOg" featurename="children" parentElementId="eu.etaxonomy.taxeditor.workbench.menu.databaseRepair">
272
    <elements xsi:type="menu:HandledMenuItem" xmi:id="_67xR4D8oEempU5gGjh-zOg" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.UpdateCaches" label="Update Caches" command="_qYxw8D85EemTy7SLZkowuQ">
273
      <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_HcAdUD8_EemTy7SLZkowuQ" coreExpressionId="hasROLE_PROJECT_MANAGER_AND_isCdmStoreConnected"/>
274
    </elements>
275
    <elements xsi:type="menu:HandledMenuItem" xmi:id="_CSXsAD8pEempU5gGjh-zOg" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.UpdateSortindices" label="Update Sortindices" command="_VUQY0D86EemTy7SLZkowuQ">
276
      <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_JRRV0D8_EemTy7SLZkowuQ" coreExpressionId="hasROLE_PROJECT_MANAGER_AND_isCdmStoreConnected"/>
277
    </elements>
278
  </fragments>
267 279
</fragment:ModelFragments>
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/CacheUpdaterWizardPage.java
1
/**
2
* Copyright (C) 2016 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.taxeditor.databaseAdmin.wizard;
10

  
11
import org.eclipse.jface.wizard.WizardPage;
12
import org.eclipse.swt.SWT;
13
import org.eclipse.swt.events.SelectionAdapter;
14
import org.eclipse.swt.events.SelectionEvent;
15
import org.eclipse.swt.layout.GridLayout;
16
import org.eclipse.swt.widgets.Button;
17
import org.eclipse.swt.widgets.Composite;
18

  
19
import eu.etaxonomy.cdm.api.service.config.CacheUpdaterConfigurator;
20
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
21
import eu.etaxonomy.cdm.model.name.TaxonName;
22
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
23
import eu.etaxonomy.cdm.model.reference.Reference;
24
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
25
import eu.etaxonomy.taxeditor.l10n.Messages;
26

  
27
/**
28
 * @author k.luther
29
 * @date 14.12.2016
30
 *
31
 */
32
public class CacheUpdaterWizardPage extends WizardPage {
33

  
34
    CacheUpdaterConfigurator config;
35

  
36
    boolean updateAgentBase = false;
37
    boolean updateReference = false;
38
    boolean updateTaxonBase = false;
39
    boolean updateName = false;
40
    boolean updateSpecimen = false;
41

  
42
    public CacheUpdaterWizardPage(String pageName, CacheUpdaterConfigurator configTitleCache) {
43
        super(pageName);
44
        this.setDescription(Messages.DatabaseRepairPage_description);
45
        config = configTitleCache;
46

  
47
    }
48

  
49
    /**
50
     * {@inheritDoc}
51
     */
52
    @Override
53
    public void createControl(Composite parent) {
54

  
55

  
56
            Composite composite = new Composite(parent, SWT.NONE);
57

  
58
            composite.setLayout(new GridLayout(1, true));
59
            setControl(composite);
60
            Button checkBoxTeamOrPerson = new Button(composite, SWT.CHECK);
61
            checkBoxTeamOrPerson.setSelection(config.getClassList().contains(TeamOrPersonBase.class));
62
            checkBoxTeamOrPerson.setText(Messages.DatabaseRepairPage_TeamOrPerson);
63
            checkBoxTeamOrPerson
64
            .setToolTipText(Messages.DatabaseRepairPage_toolTip_teamOrPerson);
65
            checkBoxTeamOrPerson.addSelectionListener(new SelectionAdapter() {
66
                @Override
67
                public void widgetSelected(SelectionEvent e) {
68
                	Button b = (Button) e.widget;
69
                	updateAgentBase =  b.getSelection();
70

  
71
                }
72
            });
73

  
74
            Button checkBoxReference = new Button(composite, SWT.CHECK);
75
            checkBoxReference.setSelection(config.getClassList().contains(Reference.class));
76
            checkBoxReference.setText(Messages.DatabaseRepairPage_Reference);
77
            checkBoxReference
78
            .setToolTipText(Messages.DatabaseRepairPage_toolTip_reference);
79
            checkBoxReference.addSelectionListener(new SelectionAdapter() {
80
                @Override
81
                public void widgetSelected(SelectionEvent e) {
82
                	Button b = (Button) e.widget;
83
                	updateReference= b.getSelection();
84
                }
85
            });
86

  
87
            Button checkBoxTaxonName = new Button(composite, SWT.CHECK);
88
            checkBoxTaxonName.setSelection(config.getClassList().contains(TaxonName.class));
89
            checkBoxTaxonName.setText(Messages.DatabaseRepairPage_updateTaxonName);
90
            checkBoxTaxonName
91
                    .setToolTipText(Messages.DatabaseRepairPage_toolTip_TaxonName);
92
            checkBoxTaxonName.addSelectionListener(new SelectionAdapter() {
93
                @Override
94
                public void widgetSelected(SelectionEvent e) {
95
                	Button b = (Button) e.widget;
96
                	updateName = b.getSelection();
97

  
98
                }
99
            });
100

  
101
            Button checkBoxTaxonBase = new Button(composite, SWT.CHECK);
102
            checkBoxTaxonBase.setSelection(config.getClassList().contains(TaxonBase.class));
103
            checkBoxTaxonBase.setText(Messages.DatabaseRepairPage_TaxonBase);
104
            checkBoxTaxonBase
105
            .setToolTipText(Messages.DatabaseRepairPage_toolTip_taxonBase);
106
            checkBoxTaxonBase.addSelectionListener(new SelectionAdapter() {
107
                @Override
108
                public void widgetSelected(SelectionEvent e) {
109
                	Button b = (Button) e.widget;
110
                	updateTaxonBase = b.getSelection();
111

  
112
                }
113
            });
114

  
115

  
116
            Button checkBoxSpecimen = new Button(composite, SWT.CHECK);
117
            checkBoxSpecimen.setSelection(config.getClassList().contains(SpecimenOrObservationBase.class));
118
            checkBoxSpecimen.setText(Messages.DatabaseRepairPage_Specimen);
119
            checkBoxSpecimen
120
            .setToolTipText(Messages.DatabaseRepairPage_toolTip_specimen);
121
            checkBoxSpecimen.addSelectionListener(new SelectionAdapter() {
122
                @Override
123
                public void widgetSelected(SelectionEvent e) {
124
                	Button b = (Button) e.widget;
125
                	updateSpecimen = b.getSelection();
126

  
127
                }
128
            });
129

  
130

  
131
    }
132
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/DatabaseRepairSortIndexPage.java
1
/**
2
* Copyright (C) 2016 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.taxeditor.databaseAdmin.wizard;
10

  
11
import org.eclipse.jface.wizard.WizardPage;
12
import org.eclipse.swt.SWT;
13
import org.eclipse.swt.events.SelectionAdapter;
14
import org.eclipse.swt.events.SelectionEvent;
15
import org.eclipse.swt.layout.GridLayout;
16
import org.eclipse.swt.widgets.Button;
17
import org.eclipse.swt.widgets.Composite;
18

  
19
import eu.etaxonomy.cdm.io.operation.config.SortIndexUpdaterConfigurator;
20
import eu.etaxonomy.taxeditor.l10n.Messages;
21

  
22
/**
23
 * @author k.luther
24
 * @date 06.12.2016
25
 *
26
 */
27
public class DatabaseRepairSortIndexPage extends WizardPage {
28

  
29
    SortIndexUpdaterConfigurator config = null;
30
    /**
31
     * @param pageName
32
     */
33
    protected DatabaseRepairSortIndexPage(String pageName, SortIndexUpdaterConfigurator config){
34
        super(pageName);
35
        this.config = config;
36
        setMessage(Messages.DatabaseRepairPage_chooseParameter);
37
    }
38

  
39

  
40

  
41

  
42

  
43

  
44

  
45

  
46
    /**
47
     * {@inheritDoc}
48
     */
49
    @Override
50
    public void createControl(Composite parent) {
51
        final Composite composite = new Composite(parent, SWT.NULL);
52

  
53
        GridLayout gridLayout = new GridLayout();
54
        composite.setLayout(gridLayout);
55

  
56
        Button checkBoxTaxonNode = new Button(composite, SWT.CHECK);
57
        checkBoxTaxonNode.setSelection(config.isDoTaxonNode());
58
        checkBoxTaxonNode.setText(Messages.DatabaseRepairPage_updateTaxonNodes);
59
        checkBoxTaxonNode
60
                .setToolTipText(Messages.DatabaseRepairPage_toolTip_taxonNode);
61
        checkBoxTaxonNode.addSelectionListener(new SelectionAdapter() {
62
            @Override
63
            public void widgetSelected(SelectionEvent e) {
64
                config.setDoTaxonNode(!config.isDoTaxonNode());
65
            }
66
        });
67

  
68
        Button checkBoxPolytomousKeyNode = new Button(composite, SWT.CHECK);
69
        checkBoxPolytomousKeyNode.setSelection(config.isDoPolytomousKeyNode());
70
        checkBoxPolytomousKeyNode.setText(Messages.DatabaseRepairPage_PolytomousKeyNode);
71
        checkBoxPolytomousKeyNode
72
        .setToolTipText(Messages.DatabaseRepairPage_toolTip_polytomousKeyNode);
73
        checkBoxPolytomousKeyNode.addSelectionListener(new SelectionAdapter() {
74
            @Override
75
            public void widgetSelected(SelectionEvent e) {
76
                config.setDoPolytomousKeyNode(!config.isDoPolytomousKeyNode());
77
            }
78
        });
79

  
80
        Button checkBoxFeatureNode = new Button(composite, SWT.CHECK);
81
        checkBoxFeatureNode.setSelection(config.isDoFeatureNode());
82
        checkBoxFeatureNode.setText(Messages.DatabaseRepairPage_featureNodes);
83
        checkBoxFeatureNode
84
        .setToolTipText(Messages.DatabaseRepairPage_toolTipFeatureNodes);
85
        checkBoxFeatureNode.addSelectionListener(new SelectionAdapter() {
86
            @Override
87
            public void widgetSelected(SelectionEvent e) {
88
                config.setDoFeatureNode(!config.isDoFeatureNode());
89
            }
90
        });
91

  
92

  
93

  
94
        setControl(composite);
95

  
96
    }
97

  
98

  
99

  
100
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/DatabaseRepairTitleCacheUpdatePage.java
18 18
import org.eclipse.swt.widgets.Button;
19 19
import org.eclipse.swt.widgets.Composite;
20 20

  
21
import eu.etaxonomy.cdm.io.operation.config.CacheUpdaterConfigurator;
21
import eu.etaxonomy.cdm.api.service.config.CacheUpdaterConfigurator;
22 22
import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
23 23
import eu.etaxonomy.cdm.model.name.TaxonName;
24 24
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/DatabaseRepairUpdateCachesWizard.java
1
/**
2
* Copyright (C) 2019 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.taxeditor.databaseAdmin.wizard;
10

  
11
import java.util.UUID;
12

  
13
import org.eclipse.jface.wizard.Wizard;
14
import org.eclipse.swt.widgets.Display;
15

  
16
import eu.etaxonomy.cdm.api.application.CdmApplicationState;
17
import eu.etaxonomy.cdm.api.longrunningService.ILongRunningTasksService;
18
import eu.etaxonomy.cdm.api.service.config.CacheUpdaterConfigurator;
19
import eu.etaxonomy.cdm.common.monitor.IRemotingProgressMonitor;
20
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
21
import eu.etaxonomy.cdm.model.name.TaxonName;
22
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
23
import eu.etaxonomy.cdm.model.reference.Reference;
24
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
25
import eu.etaxonomy.taxeditor.model.AbstractUtility;
26
import eu.etaxonomy.taxeditor.operation.IPostMoniteredOperationEnabled;
27

  
28
/**
29
 * @author k.luther
30
 * @since 05.03.2019
31
 *
32
 */
33
public class DatabaseRepairUpdateCachesWizard extends Wizard implements IPostMoniteredOperationEnabled {
34

  
35
    CacheUpdaterConfigurator cacheUpdaterConfig;
36
    ILongRunningTasksService longRunningTaskService;
37
    CacheUpdaterWizardPage page;
38

  
39

  
40
    public DatabaseRepairUpdateCachesWizard() {
41
        setWindowTitle("Update Caches");
42
        cacheUpdaterConfig = CacheUpdaterConfigurator.NewInstance();
43
        longRunningTaskService = CdmApplicationState.getLongRunningTasksService();
44
        page = new CacheUpdaterWizardPage("Update Caches", cacheUpdaterConfig);
45
    }
46

  
47
    /**
48
     * {@inheritDoc}
49
     */
50
    @Override
51
    public void postOperation(IRemotingProgressMonitor monitor) {
52
        // TODO Auto-generated method stub
53

  
54
    }
55

  
56
    @Override
57
    public void addPages() {
58
        addPage(page);
59
    }
60

  
61
    /**
62
     * {@inheritDoc}
63
     */
64
    @Override
65
    public boolean performFinish() {
66
        if (page.updateAgentBase){
67
            cacheUpdaterConfig.getClassList().add(TeamOrPersonBase.class);
68
        }
69
        if (page.updateReference){
70
            cacheUpdaterConfig.getClassList().add(Reference.class);
71
        }
72
        if (page.updateName){
73
            cacheUpdaterConfig.getClassList().add(TaxonName.class);
74
        }
75
        if (page.updateTaxonBase){
76
            cacheUpdaterConfig.getClassList().add(TaxonBase.class);
77
        }
78
        if (page.updateSpecimen){
79
            cacheUpdaterConfig.getClassList().add(SpecimenOrObservationBase.class);
80
        }
81
        if (!cacheUpdaterConfig.getClassList().isEmpty()){
82

  
83

  
84
             final UUID uuid = longRunningTaskService.monitLongRunningTask(cacheUpdaterConfig);
85
             Display.getDefault().asyncExec(new Runnable() {
86
                 @Override
87
                 public void run() {
88
                     AbstractUtility.executeMoniteredOperation("Update Caches: ",
89
                             uuid,
90
                             1000,
91
                             false,
92
                             DatabaseRepairUpdateCachesWizard.this,
93
                             null,
94
                             true);
95

  
96
                 }
97

  
98
             });
99
        }
100

  
101

  
102

  
103
    return true;
104
    }
105

  
106
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/DatabaseRepairUpdateSortIndicesWizard.java
1
/**
2
* Copyright (C) 2016 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.taxeditor.databaseAdmin.wizard;
10

  
11
import java.util.UUID;
12

  
13
import org.eclipse.jface.wizard.Wizard;
14
import org.eclipse.swt.widgets.Display;
15

  
16
import eu.etaxonomy.cdm.api.application.CdmApplicationState;
17
import eu.etaxonomy.cdm.api.longrunningService.ILongRunningTasksService;
18
import eu.etaxonomy.cdm.api.service.config.SortIndexUpdaterConfigurator;
19
import eu.etaxonomy.cdm.common.monitor.IRemotingProgressMonitor;
20
import eu.etaxonomy.cdm.config.ICdmSource;
21
import eu.etaxonomy.taxeditor.model.AbstractUtility;
22
import eu.etaxonomy.taxeditor.operation.IPostMoniteredOperationEnabled;
23
import eu.etaxonomy.taxeditor.store.CdmStore;
24

  
25
/**
26
 * @author k.luther
27
 * @date 06.12.2016
28
 *
29
 */
30
public class DatabaseRepairUpdateSortIndicesWizard extends Wizard implements IPostMoniteredOperationEnabled{
31
   // private final DatabaseRepairSortIndexPage repairSortIndexPage;
32
    private final SortIndexUpdaterWizardPage page;
33
    SortIndexUpdaterConfigurator config;
34

  
35
    ILongRunningTasksService longRunningTaskService;
36

  
37

  
38
    public DatabaseRepairUpdateSortIndicesWizard() {
39
        setWindowTitle("Update Sort Indices");
40
        config = SortIndexUpdaterConfigurator.NewInstance();
41
        page = new SortIndexUpdaterWizardPage("Sort index update", config);
42
        longRunningTaskService = CdmApplicationState.getLongRunningTasksService();
43
    }
44

  
45
    /**
46
     * {@inheritDoc}
47
     */
48
    @Override
49
    public boolean performFinish() {
50

  
51
            if (config == null){
52
                ICdmSource source= CdmStore.getActiveCdmSource();
53
                config = SortIndexUpdaterConfigurator.NewInstance();
54
                config.setDoFeatureNode(false);
55
                config.setDoPolytomousKeyNode(false);
56

  
57

  
58
             }
59
            if (config.isDoFeatureNode() || config.isDoPolytomousKeyNode() || config.isDoTaxonNode()){
60

  
61
                final UUID uuid = longRunningTaskService.monitLongRunningTask(config);
62
                Display.getDefault().asyncExec(new Runnable() {
63
                    @Override
64
                    public void run() {
65
                        AbstractUtility.executeMoniteredOperation("Update SortIndices: ",
66
                                uuid,
67
                                1000,
68
                                false,
69
                                DatabaseRepairUpdateSortIndicesWizard.this,
70
                                null,
71
                                true);
72

  
73
                    }
74

  
75
                });
76

  
77

  
78
            }
79

  
80

  
81
        return true;
82
    }
83

  
84
    @Override
85
    public void addPages() {
86
        addPage(page);
87
    }
88

  
89
    /**
90
     * {@inheritDoc}
91
     */
92
    @Override
93
    public void postOperation(IRemotingProgressMonitor monitor) {
94
        // TODO Auto-generated method stub
95

  
96
    }
97

  
98

  
99
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/DatabaseRepairWizard.java
1
/**
2
* Copyright (C) 2016 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.taxeditor.databaseAdmin.wizard;
10

  
11
import org.eclipse.core.runtime.jobs.Job;
12
import org.eclipse.jface.wizard.Wizard;
13

  
14
import eu.etaxonomy.cdm.config.ICdmSource;
15
import eu.etaxonomy.cdm.io.common.IImportConfigurator.CHECK;
16
import eu.etaxonomy.cdm.io.operation.config.CacheUpdaterConfigurator;
17
import eu.etaxonomy.cdm.io.operation.config.SortIndexUpdaterConfigurator;
18
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
19
import eu.etaxonomy.cdm.model.name.TaxonName;
20
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
21
import eu.etaxonomy.cdm.model.reference.Reference;
22
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
23
import eu.etaxonomy.taxeditor.store.CdmStore;
24

  
25
/**
26
 * @author k.luther
27
 * @date 06.12.2016
28
 *
29
 */
30
public class DatabaseRepairWizard extends Wizard {
31
   // private final DatabaseRepairSortIndexPage repairSortIndexPage;
32
    private final Test test;
33
    SortIndexUpdaterConfigurator config;
34
    CacheUpdaterConfigurator cacheUpdaterConfig;
35

  
36

  
37

  
38
    public DatabaseRepairWizard() {
39
        setWindowTitle("Repair Wizard");
40
        config = SortIndexUpdaterConfigurator.NewInstance(null);
41
       // repairSortIndexPage = new DatabaseRepairSortIndexPage("SortIndex Repair",config);
42
        cacheUpdaterConfig = CacheUpdaterConfigurator.NewInstance(null);
43
        test = new Test("Test", cacheUpdaterConfig, config);
44

  
45
    }
46

  
47
    /**
48
     * {@inheritDoc}
49
     */
50
    @Override
51
    public boolean performFinish() {
52

  
53
            if (config == null){
54
                ICdmSource source= CdmStore.getActiveCdmSource();
55
                config = SortIndexUpdaterConfigurator.NewInstance(null);
56
                config.setDoFeatureNode(false);
57
                config.setDoPolytomousKeyNode(false);
58

  
59

  
60
             }
61
            if (config.isDoFeatureNode() || config.isDoPolytomousKeyNode() || config.isDoTaxonNode()){
62
            	config.setCheck(CHECK.IMPORT_WITHOUT_CHECK);
63
                Job updateJob = CdmStore.getImportManager().createIOServiceJob(config);
64
                CdmStore.getImportManager().run(updateJob);
65
            }
66
            if (test.updateAgentBase){
67
            	cacheUpdaterConfig.getClassList().add(TeamOrPersonBase.class);
68
            }
69
            if (test.updateReference){
70
            	cacheUpdaterConfig.getClassList().add(Reference.class);
71
            }
72
            if (test.updateName){
73
            	cacheUpdaterConfig.getClassList().add(TaxonName.class);
74
            }
75
            if (test.updateTaxonBase){
76
            	cacheUpdaterConfig.getClassList().add(TaxonBase.class);
77
            }
78
            if (test.updateSpecimen){
79
            	cacheUpdaterConfig.getClassList().add(SpecimenOrObservationBase.class);
80
            }
81
            if (!cacheUpdaterConfig.getClassList().isEmpty()){
82
            	cacheUpdaterConfig.setCheck(CHECK.IMPORT_WITHOUT_CHECK);
83
                Job updateJob2 = CdmStore.getImportManager().createIOServiceJob(cacheUpdaterConfig);
84
                CdmStore.getImportManager().run(updateJob2);
85
            }
86

  
87

  
88

  
89
        return true;
90
    }
91

  
92
    @Override
93
    public void addPages() {
94
       //addPage(repairSortIndexPage);
95
        addPage(test);
96
    }
97

  
98

  
99
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/SortIndexUpdaterWizardPage.java
1
/**
2
* Copyright (C) 2019 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.taxeditor.databaseAdmin.wizard;
10

  
11
import org.eclipse.jface.wizard.WizardPage;
12
import org.eclipse.swt.SWT;
13
import org.eclipse.swt.events.SelectionAdapter;
14
import org.eclipse.swt.events.SelectionEvent;
15
import org.eclipse.swt.layout.GridLayout;
16
import org.eclipse.swt.widgets.Button;
17
import org.eclipse.swt.widgets.Composite;
18

  
19
import eu.etaxonomy.cdm.api.service.config.SortIndexUpdaterConfigurator;
20
import eu.etaxonomy.taxeditor.l10n.Messages;
21

  
22
/**
23
 * @author k.luther
24
 * @since 05.03.2019
25
 *
26
 */
27
public class SortIndexUpdaterWizardPage extends WizardPage {
28

  
29
    SortIndexUpdaterConfigurator sortIndexConfig;
30

  
31
    public SortIndexUpdaterWizardPage(String pageName, SortIndexUpdaterConfigurator sortIndexConfig) {
32
        super(pageName);
33
        this.setDescription(Messages.DatabaseRepairPage_description_sortIndex);
34
        this.sortIndexConfig = sortIndexConfig;
35
    }
36

  
37
    /**
38
     * {@inheritDoc}
39
     */
40
    @Override
41
    public void createControl(Composite parent) {
42
        Composite composite = new Composite(parent, SWT.NONE);
43

  
44
        composite.setLayout(new GridLayout(1, true));
45
        setControl(composite);
46
        Button checkBoxTaxonNode = new Button(composite, SWT.CHECK);
47
        checkBoxTaxonNode.setSelection(sortIndexConfig.isDoTaxonNode());
48
        checkBoxTaxonNode.setText(Messages.DatabaseRepairPage_updateTaxonNodes);
49
        checkBoxTaxonNode
50
                .setToolTipText(Messages.DatabaseRepairPage_toolTip_taxonNode);
51
        checkBoxTaxonNode.addSelectionListener(new SelectionAdapter() {
52
            @Override
53
            public void widgetSelected(SelectionEvent e) {
54
                sortIndexConfig.setDoTaxonNode(!sortIndexConfig.isDoTaxonNode());
55
            }
56
        });
57

  
58
        Button checkBoxPolytomousKeyNode = new Button(composite, SWT.CHECK);
59
        checkBoxPolytomousKeyNode.setSelection(sortIndexConfig.isDoPolytomousKeyNode());
60
        checkBoxPolytomousKeyNode.setText(Messages.DatabaseRepairPage_PolytomousKeyNode);
61
        checkBoxPolytomousKeyNode
62
        .setToolTipText(Messages.DatabaseRepairPage_toolTip_polytomousKeyNode);
63
        checkBoxPolytomousKeyNode.addSelectionListener(new SelectionAdapter() {
64
            @Override
65
            public void widgetSelected(SelectionEvent e) {
66
                sortIndexConfig.setDoPolytomousKeyNode(!sortIndexConfig.isDoPolytomousKeyNode());
67
            }
68
        });
69

  
70
        Button checkBoxFeatureNode = new Button(composite, SWT.CHECK);
71
        checkBoxFeatureNode.setSelection(sortIndexConfig.isDoFeatureNode());
72
        checkBoxFeatureNode.setText(Messages.DatabaseRepairPage_featureNodes);
73
        checkBoxFeatureNode
74
        .setToolTipText(Messages.DatabaseRepairPage_toolTipFeatureNodes);
75
        checkBoxFeatureNode.addSelectionListener(new SelectionAdapter() {
76
            @Override
77
            public void widgetSelected(SelectionEvent e) {
78
                sortIndexConfig.setDoFeatureNode(!sortIndexConfig.isDoFeatureNode());
79
            }
80
        });
81

  
82
    }
83

  
84
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/Test.java
1
/**
2
* Copyright (C) 2016 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.taxeditor.databaseAdmin.wizard;
10

  
11
import org.eclipse.jface.wizard.WizardPage;
12
import org.eclipse.swt.SWT;
13
import org.eclipse.swt.events.SelectionAdapter;
14
import org.eclipse.swt.events.SelectionEvent;
15
import org.eclipse.swt.layout.FillLayout;
16
import org.eclipse.swt.layout.GridLayout;
17
import org.eclipse.swt.widgets.Button;
18
import org.eclipse.swt.widgets.Composite;
19
import org.eclipse.swt.widgets.TabFolder;
20
import org.eclipse.swt.widgets.TabItem;
21

  
22
import eu.etaxonomy.cdm.io.operation.config.CacheUpdaterConfigurator;
23
import eu.etaxonomy.cdm.io.operation.config.SortIndexUpdaterConfigurator;
24
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
25
import eu.etaxonomy.cdm.model.name.TaxonName;
26
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
27
import eu.etaxonomy.cdm.model.reference.Reference;
28
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
29
import eu.etaxonomy.taxeditor.l10n.Messages;
30

  
31
/**
32
 * @author k.luther
33
 * @date 14.12.2016
34
 *
35
 */
36
public class Test extends WizardPage {
37

  
38
    CacheUpdaterConfigurator config;
39
    SortIndexUpdaterConfigurator sortIndexConfig;
40
    boolean updateAgentBase = false;
41
    boolean updateReference = false;
42
    boolean updateTaxonBase = false;
43
    boolean updateName = false;
44
    boolean updateSpecimen = false;
45

  
46
    public Test(String pageName, CacheUpdaterConfigurator configTitleCache, SortIndexUpdaterConfigurator sortIndexConfig) {
47
        super(pageName);
48
        config = configTitleCache;
49
        this.sortIndexConfig = sortIndexConfig;
50
    }
51

  
52
    /**
53
     * {@inheritDoc}
54
     */
55
    @Override
56
    public void createControl(Composite parent) {
57

  
58

  
59
            Composite container = new Composite(parent, SWT.NULL);
60
            setControl(container);
61
            container.setLayout(new FillLayout(SWT.HORIZONTAL));
62

  
63
            TabFolder tabFolder = new TabFolder(container, SWT.NONE);
64

  
65
            TabItem tbtmSortIndex = new TabItem(tabFolder, SWT.NONE);
66
            tbtmSortIndex.setText("Sort Index");
67

  
68
            Composite composite = new Composite(tabFolder, SWT.NONE);
69
            tbtmSortIndex.setControl(composite);
70
            composite.setLayout(new GridLayout(1, true));
71

  
72

  
73
            Button checkBoxTaxonNode = new Button(composite, SWT.CHECK);
74
            checkBoxTaxonNode.setSelection(sortIndexConfig.isDoTaxonNode());
75
            checkBoxTaxonNode.setText(Messages.DatabaseRepairPage_updateTaxonNodes);
76
            checkBoxTaxonNode
77
                    .setToolTipText(Messages.DatabaseRepairPage_toolTip_taxonNode);
78
            checkBoxTaxonNode.addSelectionListener(new SelectionAdapter() {
79
                @Override
80
                public void widgetSelected(SelectionEvent e) {
81
                    sortIndexConfig.setDoTaxonNode(!sortIndexConfig.isDoTaxonNode());
82
                }
83
            });
84

  
85
            Button checkBoxPolytomousKeyNode = new Button(composite, SWT.CHECK);
86
            checkBoxPolytomousKeyNode.setSelection(sortIndexConfig.isDoPolytomousKeyNode());
87
            checkBoxPolytomousKeyNode.setText(Messages.DatabaseRepairPage_PolytomousKeyNode);
88
            checkBoxPolytomousKeyNode
89
            .setToolTipText(Messages.DatabaseRepairPage_toolTip_polytomousKeyNode);
90
            checkBoxPolytomousKeyNode.addSelectionListener(new SelectionAdapter() {
91
                @Override
92
                public void widgetSelected(SelectionEvent e) {
93
                    sortIndexConfig.setDoPolytomousKeyNode(!sortIndexConfig.isDoPolytomousKeyNode());
94
                }
95
            });
96

  
97
            Button checkBoxFeatureNode = new Button(composite, SWT.CHECK);
98
            checkBoxFeatureNode.setSelection(sortIndexConfig.isDoFeatureNode());
99
            checkBoxFeatureNode.setText(Messages.DatabaseRepairPage_featureNodes);
100
            checkBoxFeatureNode
101
            .setToolTipText(Messages.DatabaseRepairPage_toolTipFeatureNodes);
102
            checkBoxFeatureNode.addSelectionListener(new SelectionAdapter() {
103
                @Override
104
                public void widgetSelected(SelectionEvent e) {
105
                    sortIndexConfig.setDoFeatureNode(!sortIndexConfig.isDoFeatureNode());
106
                }
107
            });
108

  
109

  
110
            TabItem tbtmNewItem = new TabItem(tabFolder, SWT.NONE);
111
            tbtmNewItem.setText("Update Caches");
112

  
113
            Composite composite_1 = new Composite(tabFolder, SWT.NONE);
114
            tbtmNewItem.setControl(composite_1);
115
            composite_1.setLayout(new GridLayout(1, false));
116

  
117
            Button checkBoxTeamOrPerson = new Button(composite_1, SWT.CHECK);
118
            checkBoxTeamOrPerson.setSelection(config.getClassList().contains(TeamOrPersonBase.class));
119
            checkBoxTeamOrPerson.setText(Messages.DatabaseRepairPage_TeamOrPerson);
120
            checkBoxTeamOrPerson
121
            .setToolTipText(Messages.DatabaseRepairPage_toolTip_teamOrPerson);
122
            checkBoxTeamOrPerson.addSelectionListener(new SelectionAdapter() {
123
                @Override
124
                public void widgetSelected(SelectionEvent e) {
125
                	Button b = (Button) e.widget;
126
                	updateAgentBase =  b.getSelection();
127

  
128
                }
129
            });
130

  
131
            Button checkBoxReference = new Button(composite_1, SWT.CHECK);
132
            checkBoxReference.setSelection(config.getClassList().contains(Reference.class));
133
            checkBoxReference.setText(Messages.DatabaseRepairPage_Reference);
134
            checkBoxReference
135
            .setToolTipText(Messages.DatabaseRepairPage_toolTip_reference);
136
            checkBoxReference.addSelectionListener(new SelectionAdapter() {
137
                @Override
138
                public void widgetSelected(SelectionEvent e) {
139
                	Button b = (Button) e.widget;
140
                	updateReference= b.getSelection();
141
                }
142
            });
143

  
144
            Button checkBoxTaxonName = new Button(composite_1, SWT.CHECK);
145
            checkBoxTaxonName.setSelection(config.getClassList().contains(TaxonName.class));
146
            checkBoxTaxonName.setText(Messages.DatabaseRepairPage_updateTaxonName);
147
            checkBoxTaxonName
148
                    .setToolTipText(Messages.DatabaseRepairPage_toolTip_TaxonName);
149
            checkBoxTaxonName.addSelectionListener(new SelectionAdapter() {
150
                @Override
151
                public void widgetSelected(SelectionEvent e) {
152
                	Button b = (Button) e.widget;
153
                	updateName = b.getSelection();
154

  
155
                }
156
            });
157

  
158
            Button checkBoxTaxonBase = new Button(composite_1, SWT.CHECK);
159
            checkBoxTaxonBase.setSelection(config.getClassList().contains(TaxonBase.class));
160
            checkBoxTaxonBase.setText(Messages.DatabaseRepairPage_TaxonBase);
161
            checkBoxTaxonBase
162
            .setToolTipText(Messages.DatabaseRepairPage_toolTip_taxonBase);
163
            checkBoxTaxonBase.addSelectionListener(new SelectionAdapter() {
164
                @Override
165
                public void widgetSelected(SelectionEvent e) {
166
                	Button b = (Button) e.widget;
167
                	updateTaxonBase = b.getSelection();
168

  
169
                }
170
            });
171

  
172

  
173
            Button checkBoxSpecimen = new Button(composite_1, SWT.CHECK);
174
            checkBoxSpecimen.setSelection(config.getClassList().contains(SpecimenOrObservationBase.class));
175
            checkBoxSpecimen.setText(Messages.DatabaseRepairPage_Specimen);
176
            checkBoxSpecimen
177
            .setToolTipText(Messages.DatabaseRepairPage_toolTip_specimen);
178
            checkBoxSpecimen.addSelectionListener(new SelectionAdapter() {
179
                @Override
180
                public void widgetSelected(SelectionEvent e) {
181
                	Button b = (Button) e.widget;
182
                	updateSpecimen = b.getSelection();
183

  
184
                }
185
            });
186

  
187
            tabFolder.pack();
188
    }
189
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/OpenDatabaseRepairWizardHandler.java
11 11
import org.eclipse.e4.core.di.annotations.Execute;
12 12
import org.eclipse.jface.wizard.WizardDialog;
13 13

  
14
import eu.etaxonomy.taxeditor.databaseAdmin.wizard.DatabaseRepairWizard;
14
import eu.etaxonomy.taxeditor.databaseAdmin.wizard.DatabaseRepairUpdateCachesWizard;
15 15
import eu.etaxonomy.taxeditor.model.AbstractUtility;
16 16

  
17 17

  
......
28 28
     */
29 29
    @Execute
30 30
    public Object execute(){
31
        DatabaseRepairWizard databaseRepairWizard = new DatabaseRepairWizard();
31
        DatabaseRepairUpdateCachesWizard databaseRepairWizard = new DatabaseRepairUpdateCachesWizard();
32 32
        WizardDialog dialog = new WizardDialog(AbstractUtility.getShell(),
33 33
                databaseRepairWizard);
34 34

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/OpenUpdateSortIndicesHandler.java
1
/**
2
* Copyright (C) 2019 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.taxeditor.handler;
10

  
11
import org.eclipse.e4.core.di.annotations.Execute;
12
import org.eclipse.jface.wizard.WizardDialog;
13

  
14
import eu.etaxonomy.taxeditor.databaseAdmin.wizard.DatabaseRepairUpdateSortIndicesWizard;
15
import eu.etaxonomy.taxeditor.model.AbstractUtility;
16

  
17
/**
18
 * @author k.luther
19
 * @since 05.03.2019
20
 *
21
 */
22
public class OpenUpdateSortIndicesHandler {
23

  
24
    @Execute
25
    public Object execute(){
26
        DatabaseRepairUpdateSortIndicesWizard databaseRepairWizard = new DatabaseRepairUpdateSortIndicesWizard();
27
        WizardDialog dialog = new WizardDialog(AbstractUtility.getShell(),
28
                databaseRepairWizard);
29

  
30
        dialog.open();
31

  
32
        return null;
33
    }
34

  
35

  
36
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/Messages.java
61 61
    public static String DatabaseRepairPage_toolTip_specimen;
62 62
    public static String DatabaseRepairPage_TeamOrPerson;
63 63
    public static String DatabaseRepairPage_toolTip_teamOrPerson;
64
    public static String DatabaseRepairPage_description;
65
    public static String DatabaseRepairPage_description_sortIndex;
64 66

  
65 67
    public static String LoginDialog_CANCEL_MESSAGE;
66 68
    public static String LoginDialog_LOGIN;
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/messages.properties
44 44
DatabaseRepairPage_toolTip_specimen=Caches of all Derived Units und Field Units are recalculated.
45 45
DatabaseRepairPage_TeamOrPerson=Persons and Teams
46 46
DatabaseRepairPage_toolTip_teamOrPerson=Caches of all Persons and Teams are recalculated.
47

  
47
DatabaseRepairPage_description=Update caches of selected types
48
DatabaseRepairPage_description_sortIndex=Update sort indices of selected trees
48 49
UIPreferences_expand=Expand sections when data are available in Details View. This might make the Editor slow.
49 50
UpdateHandler_CHECK_UPDATE_JOB=Check Update Job
50 51
UpdateHandler_INSTALL_JOB=Install Update Job
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/messages_de.properties
44 44
DatabaseRepairPage_toolTip_specimen=Die Caches aller Derived Units und Field Units werden aktualisiert.
45 45
DatabaseRepairPage_TeamOrPerson=Personen und Teams
46 46
DatabaseRepairPage_toolTip_teamOrPerson=Die Caches aller Personen und Teams werden aktualisiert.
47
DatabaseRepairPage_description=Die Caches aller ausgew?hlten Datentypen werden aktualisiert
48
DatabaseRepairPage_description_sortIndex=Die Sortier Indizes aller ausgew?hlten B?ume werden aktualisiert.
47 49

  
48 50
UIPreferences_expand=Klappe Abschnitte im Details View auf, wenn Daten vorhanden sind
49 51
UpdateHandler_CHECK_UPDATE_JOB=Check Update Job
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AbstractUtility.java
672 672
            reportSb.append(((ExportResult)remotingMonitor.getResult()).createReport());
673 673
        }else if (remotingMonitor.getResult() instanceof UpdateResult){
674 674
            if (((UpdateResult)remotingMonitor.getResult()).isOk()){
675
                reportSb.append("Update successful. \n"+"Updated Objects: " + ((UpdateResult)remotingMonitor.getResult()).getUpdatedObjects().size());
675
                int count = ((UpdateResult)remotingMonitor.getResult()).getUpdatedObjects().size();
676
                if (count == 0){
677
                    count = ((UpdateResult)remotingMonitor.getResult()).getUpdatedCdmIds().size();
678
                }
679

  
680
                reportSb.append("Update successful. \n"+"Updated Objects: " +count);
676 681
            }
677 682
            if (!((UpdateResult)remotingMonitor.getResult()).getExceptions().isEmpty()){
678 683
                reportSb.append(((UpdateResult)remotingMonitor.getResult()).getExceptions().toString());
eu.etaxonomy.taxeditor.workbench/fragment.e4xmi
54 54
        <children xsi:type="menu:HandledMenuItem" xmi:id="_b4RFsCQsEeeq76l4saMAFQ" elementId="eu.etaxonomy.taxeditor.workbench.menu.admin.dbpreferences" label="%command.label.23" command="_VawPsCQsEeeq76l4saMAFQ">
55 55
          <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_b4RFsSQsEeeq76l4saMAFQ" coreExpressionId="hasROLE_PROJECT_MANAGER_AND_isCdmStoreConnected"/>
56 56
        </children>
57
        <children xsi:type="menu:HandledMenuItem" xmi:id="_cWhvACQsEeeq76l4saMAFQ" elementId="eu.etaxonomy.taxeditor.workbench.menu.admin.dbrepair" label="%command.label.24" command="_Va29YCQsEeeq76l4saMAFQ">
58
          <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_cWhvASQsEeeq76l4saMAFQ" coreExpressionId="hasROLE_PROJECT_MANAGER_AND_isCdmStoreConnected"/>
59
        </children>
57
        <children xsi:type="menu:Menu" xmi:id="_NS6cwD8zEemTy7SLZkowuQ" elementId="eu.etaxonomy.taxeditor.workbench.menu.databaseRepair" label="Database Repair Functionality"/>
60 58
      </children>
61 59
      <children xsi:type="menu:Menu" xmi:id="_FaGnvyQNEeen_7LZsZSNoA" elementId="eu.etaxonomy.taxeditor.workbench.menu.help" label="%menu.label.2" mnemonics="H">
62 60
        <children xsi:type="menu:HandledMenuItem" xmi:id="_3cDNACQ7EeeKsvEah5BAoQ" elementId="eu.etaxonomy.taxeditor.workbench.menu.help.help_contents" label="%command.label.13" mnemonics="H" command="_xOYw4CQ7EeeKsvEah5BAoQ"/>

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)