Package com.esri.gpt.catalog.context

Examples of com.esri.gpt.catalog.context.CatalogIndexAdapter


      con.setAutoCommit(autoCommit);
    }
  }
 
  // delete the indexed record
  CatalogIndexAdapter indexAdapter = getCatalogIndexAdapter();
  if (indexAdapter != null) {
    indexAdapter.deleteDocument(uuid);
   
    if (cswRemoteRepository.isActive()) {
      if (fids.size() > 0) cswRemoteRepository.onRecordsDeleted(fids);
    }
  }
View Full Code Here


      con.setAutoCommit(autoCommit);
    }
  }

  // delete the indexed record
  CatalogIndexAdapter indexAdapter = getCatalogIndexAdapter();
  if (indexAdapter != null) {
    indexAdapter.deleteDocument(uuid);

    if (cswRemoteRepository.isActive()) {
      if (fids.size() > 0) cswRemoteRepository.onRecordsDeleted(fids);
    }
  }
View Full Code Here

    closeStatement(st);
  }
 
  // delete unreferenced records from the index
  if (uuids.size() > 0) {
    CatalogIndexAdapter indexAdapter = getCatalogIndexAdapter();
    if (indexAdapter != null) {
      String sMsg = "Deleting "+uuids.size()+" unreferenced documents from the catalog index.";
      LogUtil.getLogger().info(sMsg);
      indexAdapter.deleteDocuments(uuids.toArray(new String[0]));
     
      if (cswRemoteRepository.isActive()) {
        if (fids.size() > 0) cswRemoteRepository.onRecordsDeleted(fids);
      }
    }
View Full Code Here

  } finally {
    closeStatement(st);
  }
 
  // publish the record to the index if approved
  CatalogIndexAdapter indexAdapter = getCatalogIndexAdapter();
  if (indexAdapter != null) {
    StringAttributeMap params = this.getRequestContext().getCatalogConfiguration().getParameters();
    String param = Val.chkStr(params.getValue("lucene.useRemoteWriter"));
    boolean bUseRemoteWriter = param.equalsIgnoreCase("true");
    param = Val.chkStr(params.getValue("lucene.useLocalWriter"));
    boolean bUseLocalWriter = !param.equalsIgnoreCase("false");
    if (bUseRemoteWriter) {
      RemoteIndexer remoteIndexer = new RemoteIndexer();
      remoteIndexer.send(this.getRequestContext(),"publish",
          uuids.toArray(new String[0]));
    }
    if (bUseLocalWriter) {
      for (String uuid: uuids) {
        String sStatus = queryApprovalStatus(uuid);
        if (MmdEnums.ApprovalStatus.isPubliclyVisible(sStatus)) {
          String xml = indexAdapter.publishDocument(uuid,publisher);
          //if (cswRemoteRepository.isActive()) {
          //  cswRemoteRepository.onRecordUpdated(xml);
          //}
        }
      }
View Full Code Here

  } finally {
    closeStatement(st);
  }
 
  // publish to or remove from the index
  CatalogIndexAdapter indexAdapter = getCatalogIndexAdapter();
  if ((indexAdapter != null) && (uuids.size() > 0)) {
    if (MmdEnums.ApprovalStatus.isPubliclyVisible(approvalStatus.toString())) {
     
      StringAttributeMap params = this.getRequestContext().getCatalogConfiguration().getParameters();
      String param = Val.chkStr(params.getValue("lucene.useRemoteWriter"));
      boolean bUseRemoteWriter = param.equalsIgnoreCase("true");
      param = Val.chkStr(params.getValue("lucene.useLocalWriter"));
      boolean bUseLocalWriter = !param.equalsIgnoreCase("false");
      if (bUseRemoteWriter) {
        RemoteIndexer remoteIndexer = new RemoteIndexer();
        remoteIndexer.send(this.getRequestContext(),"publish",
            uuids.toArray(new String[0]));
      }
      if (bUseLocalWriter) {
        boolean bHadException = false;
        for (String uuid: uuids) {
          try {
            boolean indexAllowed = queryIndexEnabled(uuid);
            if (indexAllowed) {
              String xml = indexAdapter.publishDocument(uuid,publisher);
 
              if (cswRemoteRepository.isActive()) {
                cswRemoteRepository.onRecordUpdated(xml);
              }
            }
          } catch (CatalogIndexException e) {
            bHadException = true;
            LogUtil.getLogger().log(Level.SEVERE,"Error publishing document to index.",e);
          }
        }
        if (bHadException) {
          throw new CatalogIndexException("Error publishing document to index.");
        }
      }
     
    } else {
      indexAdapter.deleteDocuments(uuids.toArray(new String[0]));
     
      if (cswRemoteRepository.isActive()) {
        StringSet fids = queryFileIdentifiers(uuids);
        if (fids.size() > 0) cswRemoteRepository.onRecordsDeleted(fids);
      }
View Full Code Here

* @throws CatalogIndexException if accessing index file fails
*/
public void createIndex(Schema schema, PublicationRecord record)
  throws SQLException, CatalogIndexException {

  CatalogIndexAdapter indexAdapter = getCatalogIndexAdapter();
  if (indexAdapter!=null) {
    Timestamp tsUpdate = queryUpdateDate(record.getUuid());
    String acl = queryAclByUUID(record.getUuid());
    indexAdapter.publishDocument(record.getUuid(),tsUpdate,schema,acl);

    if (cswRemoteRepository.isActive()) {
      cswRemoteRepository.onRecordUpdated(schema,record);
    }
  }
View Full Code Here

* @throws CatalogIndexException if accessing index file fails
*/
public void deleteIndex(PublicationRecord record)
  throws CatalogIndexException, SQLException {

  CatalogIndexAdapter indexAdapter = getCatalogIndexAdapter();
  if (indexAdapter!=null) {
    StringSet uuids = new StringSet();
    uuids.add(record.getUuid());
    indexAdapter.deleteDocuments(uuids.toArray(new String[0]));
    if (cswRemoteRepository.isActive()) {
      StringSet fids = queryFileIdentifiers(uuids);
      if (fids.size() > 0) cswRemoteRepository.onRecordsDeleted(fids);
    }
  }
View Full Code Here

      RemoteIndexer remoteIndexer = new RemoteIndexer();
      remoteIndexer.send(this.getRequestContext(),"publish",
          uuids.toArray(new String[0]));
    }
    if (bUseLocalWriter) {
      CatalogIndexAdapter indexAdapter = getCatalogIndexAdapter();
      for (String uuid: uuids) {
        indexAdapter.publishDocument(uuid,publisher);
      }
    }
   
  }
View Full Code Here

TOP

Related Classes of com.esri.gpt.catalog.context.CatalogIndexAdapter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.