Project

General

Profile

Revision 8360c0ff

ID8360c0ff2bbc09ed93a487bd5e7451f197785edf
Parent dcf98348
Child 9d6458e9

Added by Katja Luther over 2 years ago

fix #4101: getValue() was missing

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/PublishFlagPreference.java
37 37
   boolean setNotPublish;
38 38
   boolean inheritFromParent;
39 39

  
40
   String do_not_publish = "DO NOT PUBLISH";
41
   String inherit_from_parent = "PARENT";
42
   String publish = "PUBLISH";
43

  
40 44
   @Override
41 45
   public void init() {
42 46
       super.init();
43 47
       CdmPreference pref = PreferencesUtil.getPreferenceFromDB(PreferencePredicate.DefaultBehaviourForPublishFlag);
44 48
       if (pref != null){
45
           if (pref.getValue().equals(Messages.PublishFlagPreference_do_not_set)){
49
           if (pref.getValue().equals(do_not_publish)){
46 50
               setNotPublish = true;
47 51
               setPublish = false;
48 52
               inheritFromParent = false;
49 53
           }
50 54

  
51
           if (pref.getValue().equals(Messages.PublishFlagPreference_inherit)){
55
           if (pref.getValue().equals(inherit_from_parent)){
52 56
               setNotPublish = false;
53 57
               setPublish = false;
54 58
               inheritFromParent = true;
55 59
           }
56 60

  
57
           if (pref.getValue().equals(Messages.PublishFlagPreference_set)){
61
           if (pref.getValue().equals(publish)){
58 62
               setNotPublish = false;
59 63
               setPublish = true;
60 64
               inheritFromParent = false;
......
119 123
    public boolean performOk() {
120 124
        String preferenceValue = null;
121 125
        if (setPublish){
122
            preferenceValue = Messages.PublishFlagPreference_set;
126
            preferenceValue = publish;
123 127
        }else if (setNotPublish){
124
            preferenceValue = Messages.PublishFlagPreference_do_not_set;
128
            preferenceValue = do_not_publish;
125 129
        } else{
126
            preferenceValue = Messages.PublishFlagPreference_inherit;
130
            preferenceValue = inherit_from_parent;
127 131
        }
128 132
        CdmPreference pref = CdmPreference.NewDatabaseInstance( PreferencePredicate.DefaultBehaviourForPublishFlag, preferenceValue);
129 133
        pref.setAllowOverride(true);
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/IPreferenceKeys.java
227 227

  
228 228
    public static final String LAST_SELECTED_REFERENCES = "eu.etaxonomy.taxeditor.references.selection.lastSelected";
229 229

  
230
    public static final String DO_NOT_PUBLISH = "DO NOT PUBLISH";
231
    public static final String INHERIT_FROM_PARENT = "PARENT";
232
    public static final String PUBLISH = "PUBLISH";
233

  
230 234

  
231 235

  
232 236

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeWizardPage.java
23 23
import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
24 24
import eu.etaxonomy.cdm.model.taxon.Taxon;
25 25
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
26
import eu.etaxonomy.taxeditor.l10n.Messages;
27 26
import eu.etaxonomy.taxeditor.newWizard.IWizardPageListener;
28 27
import eu.etaxonomy.taxeditor.parser.ParseHandler;
28
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
29 29
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
30 30
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
31 31
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
......
144 144
			INonViralName parseReferencedName = ParseHandler.parseReferencedName(taxonName, null);
145 145
			Taxon taxon = Taxon.NewInstance(parseReferencedName, reference);
146 146
			CdmPreference defaultPublish = PreferencesUtil.getPreferenceFromDB(PreferencePredicate.DefaultBehaviourForPublishFlag);
147

  
148
			if (defaultPublish != null && defaultPublish.getValue().equals(Messages.PublishFlagPreference_set)){
147
			if (defaultPublish != null && defaultPublish.getValue().equals(IPreferenceKeys.PUBLISH)){
149 148
			    taxon.setPublish(true);
150
			} else if (defaultPublish != null && defaultPublish.equals(Messages.PublishFlagPreference_do_not_set)){
149
			} else if (defaultPublish != null && defaultPublish.getValue().equals(IPreferenceKeys.DO_NOT_PUBLISH)){
151 150
			    taxon.setPublish(false);
152 151
			}else{
153 152
			    if((this.getParentTreeNode()).isInstanceOf(TaxonNode.class)){

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)