Project

General

Profile

« Previous | Next » 

Revision 853dcb0b

Added by Patrick Plitzner over 7 years ago

i18n for SearchManager

View differences:

eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages.properties
108 108
PasswordWizardPage_PASSWORD_MIN_CHARACTER=Password has to have at least %s characters
109 109
PasswordWizardPage_PASSWORDS_DO_NOT_MATCH=The passwords do not match
110 110
PasswordWizardPage_REPEAT_PASSWORD=Repeat Password
111

  
112
SearchManager_LARGE_RESULT_EXPECTED=Large result expected
113
SearchManager_LONG_SEARCH_WARNING=The current search will return %s objects. This will take a long time and/or might render the editor unusable. Please consider refining your search.\nSearch anyway?
eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages_de.properties
108 108
PasswordWizardPage_PASSWORD_MIN_CHARACTER=Kennwort muss mindesten %s Zeichen enthalten
109 109
PasswordWizardPage_PASSWORDS_DO_NOT_MATCH=Die Kennw?rter stimmen nicht ?berein
110 110
PasswordWizardPage_REPEAT_PASSWORD=Kennwort wiederholen
111

  
112
SearchManager_LARGE_RESULT_EXPECTED=Gro?e Anzahl an Suchergebnissen
113
SearchManager_LONG_SEARCH_WARNING=Die aktuelle Suche wird %s Objekte laden. Dies kann einige Zeit dauern und den Editor w?hrenddessen unbedienbar machen. Bitte erstellen sie eine detailliertere Suche.\nTrotzdem suchen?
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/Messages.java
122 122
	public static String RemotingLoginDialog_JOB_SERVER_LAUNCH;
123 123
	public static String RemotingLoginDialog_STARTING_MGD_SERVER;
124 124
	public static String RemotingLoginDialog_TASK_LAUNCHING_SERVER;
125
    public static String SearchManager_LARGE_RESULT_EXPECTED;
126
    public static String SearchManager_LONG_SEARCH_WARNING;
125 127
	static {
126 128
        // initialize resource bundle
127 129
        NLS.initializeMessages(BUNDLE_NAME, Messages.class);
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/SearchManager.java
44 44
import eu.etaxonomy.cdm.model.reference.Reference;
45 45
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
46 46
import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
47
import eu.etaxonomy.taxeditor.Messages;
47 48
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
48 49
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
49 50

  
......
56 57

  
57 58
	public static final List NO_RESULTS = Arrays.asList(new Object[]{});
58 59

  
59
	public static final String WILDCARD = "*";
60
	public static final String WILDCARD = "*"; //$NON-NLS-1$
60 61

  
61 62
	public static int NO_COUNT = -1;
62
	
63

  
63 64

  
64 65
	// TODO make this configurable via preferences
65 66
	private static final int MAX_RESULTS_BEFORE_WARNING = 500;
66 67

  
67 68
	public List<TaxonNameBase> findNames(IIdentifiableEntityServiceConfigurator configurator, ConversationHolder conversation){
68
			
69

  
69 70
		if(checkLargeResult(CdmStore.getService(INameService.class).countByTitle(configurator))){
70 71
			List<TaxonNameBase> records = CdmStore.getService(INameService.class).findByTitle(configurator).getRecords();
71 72
			addUuidSearchResults(records, configurator, INameService.class);
......
166 167
	public List<SpecimenOrObservationBase> findOccurrences(IIdentifiableEntityServiceConfigurator<SpecimenOrObservationBase> configurator, boolean showFieldUnits){
167 168
	    List<SpecimenOrObservationBase> records = new ArrayList<SpecimenOrObservationBase>();
168 169
		final List<String> BASE_OCCURRENCE_INIT_STRATEGY = Arrays.asList(new String[] {
169
		        "collection",
170
		        "descriptions",
171
		        "identifiers",
172
		        "derivationEvents.originals",
173
		        "derivedFrom.originals",
174
		        "gatheringEvent.country.representations",
175
		        "gatheringEvent.collector",
176
		        "gatheringEvent.locality",
177
		        "descriptions.descriptionElements",
178
		        "kindOfUnit",
179
		        "amplificationResults",
180
		        "sequences.singleReadAlignments",
181
		        "mediaSpecimen"
170
		        "collection", //$NON-NLS-1$
171
		        "descriptions", //$NON-NLS-1$
172
		        "identifiers", //$NON-NLS-1$
173
		        "derivationEvents.originals", //$NON-NLS-1$
174
		        "derivedFrom.originals", //$NON-NLS-1$
175
		        "gatheringEvent.country.representations", //$NON-NLS-1$
176
		        "gatheringEvent.collector", //$NON-NLS-1$
177
		        "gatheringEvent.locality", //$NON-NLS-1$
178
		        "descriptions.descriptionElements", //$NON-NLS-1$
179
		        "kindOfUnit", //$NON-NLS-1$
180
		        "amplificationResults", //$NON-NLS-1$
181
		        "sequences.singleReadAlignments", //$NON-NLS-1$
182
		        "mediaSpecimen" //$NON-NLS-1$
182 183
		});
183 184

  
184 185
		List<String> occurrencePropertyPaths = new ArrayList<String>();
185 186
		occurrencePropertyPaths.addAll(BASE_OCCURRENCE_INIT_STRATEGY);
186 187
		for(String propertyPath:BASE_OCCURRENCE_INIT_STRATEGY) {
187
		    occurrencePropertyPaths.add("derivationEvents.derivatives." + propertyPath);
188
		    occurrencePropertyPaths.add("derivationEvents.derivatives." + propertyPath); //$NON-NLS-1$
188 189
		}
189 190
		configurator.setPropertyPaths(occurrencePropertyPaths);
190 191

  
......
219 220

  
220 221
	private boolean checkLargeResult(int count, int maxBeforWarning) {
221 222
		if(count > maxBeforWarning){
222
			return MessageDialog.openConfirm(Display.getDefault().getActiveShell(), "Large result expected",
223
					String.format("The current search will return %s objects. This will " +
224
							"take a long time and/or might render the editor unusable. Please consider refining your search.", count));
223
			return MessageDialog.openConfirm(Display.getDefault().getActiveShell(), Messages.SearchManager_LARGE_RESULT_EXPECTED,
224
					String.format(Messages.SearchManager_LONG_SEARCH_WARNING, count));
225 225
		}else{
226 226
			return true;
227 227
		}
228 228
	}
229 229

  
230 230
	private String sqlizeTitleSearchString(IIdentifiableEntityServiceConfigurator configurator){
231
		return configurator.getTitleSearchString().replace(WILDCARD, "%");
231
		return configurator.getTitleSearchString().replace(WILDCARD, "%"); //$NON-NLS-1$
232 232
	}
233 233

  
234 234
	public List findTaxa(IIdentifiableEntityServiceConfigurator configurator) {

Also available in: Unified diff