Examples of HrRecord


Examples of com.esri.gpt.catalog.harvest.repository.HrRecord

* @throws SearchException
*/

private void init(boolean calledByFactory) throws SearchException {
 
  HrRecord record = this.getHrRecord();
  if(record != null && calledByFactory == true) {
    if(record.getProtocol() instanceof HarvestProtocolCsw) {
      HarvestProtocolCsw hpCsw = (HarvestProtocolCsw) record.getProtocol();
      this.setProfileId(hpCsw.getProfile());
    }
   
    return;
  }
 
  boolean doCapabilities = false;
 
  // get uuid for this search
  String uuid = "";
  Map<String, String> map = super.getFactoryAttributes();
  if(map != null) {
    uuid = Val.chkStr(super.getFactoryAttributes().get("uuid"));
  }
  if("".equals(uuid)) {
    uuid = this.getKey();
  }
 
  try {

    // Extracting getRecordByID and GetRecordsUrl associated with uuid in
    // session
    RequestContext reqContext = this.getRequestContext();
    if(reqContext == null) {
      throw new NullPointerException("RequestContext in search engine is null")
    }
    String sessionKeyPrfx = this.getClass().getCanonicalName() + ":uuid:"
        + uuid;
    String sessionGetMetadataKey = sessionKeyPrfx + ":GetMetadataRecord:url";
    String sessionGetRecordsKey = sessionKeyPrfx + ":GetRecords:url";
    String sessionProfileId = sessionKeyPrfx + ":profileId";
    String sessionCapabUrl = sessionKeyPrfx + ":capabilities:url";
    String sessionCapObject = sessionKeyPrfx + ":capabilities:object";
   
    Object objCapObject = reqContext.extractFromSession(sessionCapObject);
    if(objCapObject instanceof CswCatalogCapabilities) {
      this.setCapabilities((CswCatalogCapabilities)objCapObject);
    }
    Object objGetMetadataUrl = reqContext.extractFromSession(
        sessionGetMetadataKey);
    Object objGetRecordsUrl = reqContext.extractFromSession(
        sessionGetRecordsKey);
    Object objProfileId = reqContext.extractFromSession(
        sessionProfileId);
    Object objGetCapabUrl = reqContext.extractFromSession(
        sessionCapabUrl);
   
    if (objGetMetadataUrl == null
        || "".equals(objGetMetadataUrl.toString().trim())
        || objGetRecordsUrl == null
        || "".equals(objGetRecordsUrl.toString().trim())
        || objProfileId == null
        || "".equals(objProfileId.toString().trim())
        || objGetCapabUrl == null
        || "".equals(objGetCapabUrl.toString().trim())) {
      doCapabilities = true;
    } else {
      this.setGetRecordsUrl(objGetRecordsUrl.toString());
      this.setGetMetadataRecordUrl(objGetMetadataUrl.toString());
      this.setProfileId(objProfileId.toString());
      this.setGetCapabiltiesUrl(objGetCapabUrl.toString());
    }
   
    // Checking the db to check if profile and url are still the same
    GptRepository repos = new GptRepository();
   
    try {
      if (record == null) {

        record = repos.readHarvestRecord(uuid, this.getRequestContext());

      }
      Protocol harvestProtocol = record.getProtocol();
      if (harvestProtocol instanceof HarvestProtocolCsw) {
        HarvestProtocolCsw harvestProtocolCsw = (HarvestProtocolCsw) harvestProtocol;
        if (!this.getProfileId().equals(harvestProtocolCsw.getProfile())
            || !this.getGetCapabiltiesUrl().equals(record.getHostUrl())) {
          doCapabilities = true;
          this.setProfileId(harvestProtocolCsw.getProfile());
          this.setGetCapabiltiesUrl(record.getHostUrl());
        }

      } else {
        throw new SearchException("repository id " + uuid + " is not expected"
            + " CSW protocol");
View Full Code Here

Examples of com.esri.gpt.catalog.harvest.repository.HrRecord

  }
  String abs = null;
  String uuid = this.getKey();
  try {
    GptRepository repos = new GptRepository();
    HrRecord record = this.getHrRecord();
    if(record == null) {
      record = repos.readHarvestRecord(uuid, this.getRequestContext());
    }
    String url = record.getHostUrl();
    CswRepository csw = new CswRepository();

    if (url.length() > 0) {
      abs = csw.transformToHtml(url);
    }
View Full Code Here

Examples of com.esri.gpt.catalog.harvest.repository.HrRecord

  // Create search engines for existing rids
  Iterator<Entry<String, HrRecord>> iter = repositoryRecord.entrySet().iterator();
  while(iter.hasNext()) {
    Entry<String, HrRecord> entry = iter.next();
    String rid = entry.getKey();
    HrRecord hrRecord = entry.getValue();
    SearchEngineExternalCsw sEngine = new SearchEngineExternalCsw();
    sEngine.setKey(rid);
    sEngine.setHrRecord(hrRecord);
    mRidEngine.put(rid, sEngine);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.