Project

General

Profile

Revision 45112b6a

ID45112b6a5414a535ae87eab3065d721a01386ad9
Parent 6635b6cf
Child 03903893

Added by Cherian Mathew over 7 years ago

ManagementController : reverting back to default list when no class name is 'manually' specified
CdmMassIndexer : removed requirement for type array param to be always need as we have a default indexed classes list.

View differences:

cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/ManagementController.java
117 117
	@RequestMapping(value = { "reindex" }, method = RequestMethod.GET)
118 118
	public ModelAndView doReindex(
119 119
			@RequestParam(value = "frontendBaseUrl", required = false) String frontendBaseUrl,
120
			@RequestParam(value = "type", required = true) Class<? extends CdmBase>[] types,
120
			@RequestParam(value = "type", required = false) Class<? extends CdmBase>[] types,
121 121
			@RequestParam(value = "priority", required = false) Integer priority,
122 122
			HttpServletRequest request, HttpServletResponse response)
123 123
			throws Exception {
124 124
		
125 125
		indexer.clearIndexedClasses();
126
		for (Class<? extends CdmBase> type : types) {
127
			if(type != null) {
128
				indexer.addToIndexedClasses(type);
126
		if(types != null) {
127
			for (Class<? extends CdmBase> type : types) {
128
				if(type != null) {
129
					indexer.addToIndexedClasses(type);
130
				}
129 131
			}
130 132
		}
131 133
		
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/search/CdmMassIndexer.java
374 374
    @SuppressWarnings("unchecked")
375 375
    @Override
376 376
    public Set<Class<? extends CdmBase>> indexedClasses() {
377
//    	indexedClasses.clear();
378
//    	indexedClasses.add(DescriptionElementBase.class);
379
//    	indexedClasses.add(TaxonBase.class);
380
//    	indexedClasses.add(DescriptionElementBase.class);
381
//    	indexedClasses.add(Classification.class);
382
//    	indexedClasses.add(TaxonNameBase.class);
383
//    	indexedClasses.add(SpecimenOrObservationBase.class);
377
    	// if no indexed classes have been 'manually' set then
378
    	// the default is the full list
379
    	if(indexedClasses.size() == 0) {
380
    		indexedClasses.add(DescriptionElementBase.class);
381
    		indexedClasses.add(TaxonBase.class);    		
382
    		indexedClasses.add(Classification.class);
383
    		indexedClasses.add(TaxonNameBase.class);
384
    		indexedClasses.add(SpecimenOrObservationBase.class);
385
    	}
384 386
        return indexedClasses;
385 387
    }
386 388

  

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)