Examples of GptResource


Examples of gc.gpt.db.GptResource

      //deleteDocs();
      //if (true) return;
     
      //okIds = null;
      con = gptdb2SolrInstance.makeSqlConnection();
      GptResource r = new GptResource();
      SqlQuery q = new SqlQuery();
      q.query(context,con,r.getSqlQInfo(),this);
      this.walkSolrDocs();
     
    } finally {
      try {if (con != null) con.close();}
      catch (Exception ef) {ef.printStackTrace();}
View Full Code Here

Examples of gc.gpt.db.GptResource

 
  private void _handleSqlRow(TaskContext context, Connection con,
      ResultSet rs, long rowNum) throws Exception {
    TaskStats stats = context.getStats();
    String tn = context.getTaskName()+".sync";
    GptResource resource = new GptResource();
    resource.readFields(rs);

    String[] result = queryDoc(resource);
    String id = result[0];
    String fsMatched = result[1];
   
    if (this.approvedOnly) {
      String s = resource.approvalstatus;
      // handles an earlier problem with publishing "posted" docs
      if ((s != null) && s.equals("posted")) {
        fsMatched = null;
      }
    }
   
    if (fsMatched != null) {
      if ((okIds != null) && (okIds.size() <= this.maxIdsInMap)) {
        okIds.put(id,"");
      } else if (okIds != null) {
        okIds = null;
      }
      stats.incrementCount(tn+".noChange");
    } else {
     
      String s;
      boolean bContinue = true;
      if (bContinue && this.approvedOnly) {
        s = resource.approvalstatus;
        if (s == null) s = "";
        if (!s.equals("approved") && !s.equals("reviewed")) {
          stats.incrementCount(tn+".ignore.notApproved");
          bContinue = false;
        }
      }
      if (bContinue && this.emptyAclOnly) {
        s = resource.acl;
        if (s == null) s = "";
        if (s.trim().length() > 0) {
          stats.incrementCount(tn+".ignore.nonEmptyAcl");
          bContinue = false;
        }
      }
      if (bContinue && this.docsOnly) {
        if (resource.isHarvestingSite) {
          stats.incrementCount(tn+".ignore.harvestingSite");
          bContinue = false;
        }
      }
     
      GptResourceXml resourceXml = new GptResourceXml();
      if (bContinue) {
        resourceXml.querySqlDB(context,con,resource.docuuid);
        s = resourceXml.xml;
        if ((s == null) || (s.length() == 0)) {
          stats.incrementCount(tn+".ignore.noResourceXml");
          bContinue = false;
        }
      }
     
      if (bContinue) {
        if (id == null) {
          stats.incrementCount(tn+".insertRequired");
        } else {
          stats.incrementCount(tn+".updateRequired");
        }
       
        GptUser user = new GptUser();
        user.querySqlDB(context,con,resource.owner);
       
        GptResource parentSite = null;
        if (resource.isHarvestedDocument) {
          parentSite = new GptResource();
          parentSite.querySqlDB(context,con,resource.siteuuid);
        }
               
                GptCollections gptCollections = null;
                if (gptdb2SolrInstance.isGptIncludeCollections()) {
                  gptCollections = new GptCollections();
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.