+/**\r
+* Copyright (C) 2009 EDIT\r
+* European Distributed Institute of Taxonomy\r
+* http://www.e-taxonomy.eu\r
+*\r
+* The contents of this file are subject to the Mozilla Public License Version 1.1\r
+* See LICENSE.TXT at the top of this package for the full license terms.\r
+*/ \r
+\r
package eu.etaxonomy.cdm.api.service;\r
\r
-import java.util.ArrayList;\r
import java.util.List;\r
\r
import org.apache.log4j.Logger;\r
import org.springframework.stereotype.Service;\r
import org.springframework.transaction.annotation.Transactional;\r
\r
-import eu.etaxonomy.cdm.api.service.pager.Pager;\r
-import eu.etaxonomy.cdm.api.service.pager.impl.DefaultPagerImpl;\r
+import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;\r
import eu.etaxonomy.cdm.model.occurrence.Collection;\r
import eu.etaxonomy.cdm.persistence.dao.occurrence.ICollectionDao;\r
-import eu.etaxonomy.cdm.persistence.query.OrderHint;\r
+import eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy;\r
\r
@Service\r
@Transactional(readOnly = true)\r
public class CollectionServiceImpl extends IdentifiableServiceBase<Collection, ICollectionDao> implements ICollectionService {\r
\r
+ @SuppressWarnings("unused")\r
static private final Logger logger = Logger.getLogger(CollectionServiceImpl.class);\r
\r
@Autowired\r
this.dao = dao;\r
}\r
\r
- public void generateTitleCache() {\r
- logger.warn("Not yet implemented");\r
- }\r
\r
- public Pager<Collection> search(Class<? extends Collection> clazz, String query, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {\r
- Integer numberOfResults = dao.count(clazz,query);\r
- \r
- List<Collection> results = new ArrayList<Collection>();\r
- if(numberOfResults > 0) { // no point checking again\r
- results = dao.search(clazz,query, pageSize, pageNumber, orderHints, propertyPaths); \r
+ @Override\r
+ @Transactional(readOnly = false)\r
+ public void updateTitleCache(Class<? extends Collection> clazz, Integer stepSize, IIdentifiableEntityCacheStrategy<Collection> cacheStrategy, IProgressMonitor monitor) {\r
+ if (clazz == null){\r
+ clazz = Collection.class;\r
}\r
- \r
- return new DefaultPagerImpl<Collection>(pageNumber, numberOfResults, pageSize, results);\r
+ super.updateTitleCacheImpl(clazz, stepSize, cacheStrategy, monitor);\r
}\r
+ \r
+\r
\r
public List<Collection> searchByCode(String code) {\r
return this.dao.getCollectionByCode(code);\r