Project

General

Profile

Revision a2a58fcc

IDa2a58fccfa11f60d05a06f1e91ca3f27442bcfad
Parent 388fc07c
Child efc5d1e3

Added by Andreas Müller almost 3 years ago

Add tax editor preferences utilities

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/metadata/PreferenceSubject.java
21 21
    public static final String ROOT = "/";
22 22
    public static final String SEP = "/";
23 23
    public static final String VAADIN = "vaadin";
24
    public static final String TAX_EDITOR = "taxeditor";
24 25

  
25 26
    private String subject;
26 27

  
......
41 42
        return new PreferenceSubject(ROOT +  VAADIN + SEP);
42 43
    }
43 44

  
45
    public static PreferenceSubject NewTaxEditorInstance(){
46
        return new PreferenceSubject(ROOT +  TAX_EDITOR + SEP);
47
    }
48

  
44 49

  
45 50
// *****************************************************/
46 51

  
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/IPreferenceService.java
82 82

  
83 83
     /**
84 84
      * Retrieve the database wide preference for the given predicate.
85
      * @param key
85
      * @param predicate
86 86
      * @return
87 87
      */
88 88
     public CdmPreference findDatabase(PreferencePredicate predicate);
89 89

  
90 90
     /**
91 91
      * Retrieve the vaadin wide preference for the given predicate.
92
      * @param key
92
      * @param predicate
93 93
      * @return
94 94
      */
95 95
     public CdmPreference findVaadin(PreferencePredicate predicate);
96 96

  
97

  
98
     /**
99
      * Retrieve the TaxEditor wide preference for the given predicate.
100
      * @param predicate
101
      * @return
102
      */
103
     public CdmPreference findTaxEditor(PreferencePredicate predicate);
104

  
97 105
     /**
98 106
      * Returns the best matching preference that matches the given
99 107
      * predicate and the taxon node filter. Only DB preferences and
......
132 140
     public void set(CdmPreference preference);
133 141

  
134 142

  
143

  
135 144
     //we need to decide if we want to keep this method
136 145
//     //returns old value
137 146
//     String setCdmPrefs(CdmBase cdmBase, String predicate, String value );
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/PreferenceServiceImpl.java
66 66
        return find(key);
67 67
    }
68 68

  
69
    @Override
70
    public CdmPreference findTaxEditor(PreferencePredicate predicate){
71
        PrefKey key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), predicate);
72
        return find(key);
73
    }
74

  
69 75

  
70 76
	@Override
71 77
    @Transactional(readOnly = false)

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)