1 package org.collectionspace.services.nuxeo.client.java;
3 import java.io.Serializable;
4 import java.security.Principal;
5 import java.util.ArrayList;
9 import org.collectionspace.services.common.context.ServiceContext;
10 import org.collectionspace.services.common.document.DocumentHandler;
11 import org.collectionspace.services.nuxeo.util.ReindexFulltextRoot;
12 import org.collectionspace.services.nuxeo.util.ReindexFulltextRoot.ReindexInfo;
13 import org.nuxeo.ecm.core.api.IterableQueryResult;
14 import org.nuxeo.ecm.core.api.NuxeoException;
15 import org.nuxeo.ecm.core.api.NuxeoPrincipal;
16 import org.nuxeo.ecm.core.query.QueryFilter;
17 import org.nuxeo.ecm.core.query.sql.NXQL;
18 import org.nuxeo.ecm.core.storage.StorageException;
19 import org.nuxeo.runtime.transaction.TransactionHelper;
20 import org.slf4j.Logger;
21 import org.slf4j.LoggerFactory;
24 * Use the inherited reindexFulltext() method to reindex the Nuxeo full-text index.
26 public class CSReindexFulltextRoot extends ReindexFulltextRoot {
29 private final Logger logger = LoggerFactory.getLogger(CSReindexFulltextRoot.class);
30 protected String repoQuery;
32 public CSReindexFulltextRoot(CoreSessionInterface repoSession, String repoQuery) {
33 this.coreSession = repoSession.getCoreSession();
34 this.repoQuery = repoQuery;
39 protected List<ReindexInfo> getInfos() throws StorageException {
41 List<ReindexInfo> infos = new ArrayList<ReindexInfo>();
42 // String query = "SELECT ecm:uuid, ecm:primaryType FROM Document"
43 // + " WHERE ecm:isProxy = 0"
44 // + " AND ecm:currentLifeCycleState <> 'deleted'"
45 // + " ORDER BY ecm:uuid";
46 IterableQueryResult it = session.queryAndFetch(this.repoQuery, NXQL.NXQL,
49 for (Map<String, Serializable> map : it) {
50 Serializable id = map.get(NXQL.ECM_UUID);
51 String type = (String) map.get(NXQL.ECM_PRIMARYTYPE);
52 infos.add(new ReindexInfo(id, type));