Package com.esri.gpt.framework.collection

Examples of com.esri.gpt.framework.collection.StringSet


    throws SQLException, CatalogIndexException {
    PreparedStatement st1 = null;
    PreparedStatement st2 = null;
    PreparedStatement stR = null;
    int nBatch = 0;
    StringSet indexableUuids = new StringSet();
    try {
      String table = this.getCollectionMemberTableName();
      String tableR = this.getResourceTableName();
      String sql1 = "SELECT DOCUUID FROM "+table+" WHERE DOCUUID=? AND COLUUID=?";
      String sql2 = "INSERT INTO "+table+" (DOCUUID,COLUUID) VALUES (?,?)";
      String sqlR = "SELECT APPROVALSTATUS FROM "+tableR+" WHERE DOCUUID=?";
     
      Connection con = this.returnConnection().getJdbcConnection();
      st1 = con.prepareStatement(sql1);
      st2 = con.prepareStatement(sql2);
      stR = con.prepareStatement(sqlR);
      for (String docUuid: docUuids) {
        boolean bInsert = true;
        st1.clearParameters();
        st1.setString(1,docUuid);
        st1.setString(2,colUuid);
        ResultSet rs1 = st1.executeQuery();
        if (rs1.next()) bInsert = false;
        rs1.close();
       
        if (bInsert) {
          stR.clearParameters();
          stR.setString(1,docUuid);
          ResultSet rsR = stR.executeQuery();
          if (rsR.next()) {
            String status = Val.chkStr(rsR.getString(1));
            if (MmdEnums.ApprovalStatus.isPubliclyVisible(status)) {
              indexableUuids.add(docUuid);
            }
          }
          rsR.close();
         
          st2.setString(1,docUuid);
          st2.setString(2,colUuid);
          st2.addBatch();
          nBatch++;
        }
      }
      st1.close();
      st1 = null;
     
      if (nBatch > 0) {
        st2.executeBatch();
      }
    } finally {
      CollectionDao.closeStatement(st1);
      CollectionDao.closeStatement(st2);
      CollectionDao.closeStatement(stR);
    }
   
    if (indexableUuids.size() > 0) {
      this.reindex(publisher,indexableUuids);
    }
   
    return nBatch;
  }
View Full Code Here


    throws SQLException, CatalogIndexException {
    PreparedStatement st1 = null;
    PreparedStatement st2 = null;
    PreparedStatement stR = null;
    int nBatch = 0;
    StringSet indexableUuids = new StringSet();
    try {
      String table = this.getCollectionMemberTableName();
      String tableR = this.getResourceTableName();
      String sql1 = "SELECT DOCUUID FROM "+table+" WHERE DOCUUID=? AND COLUUID=?";
      String sql2 = "DELETE FROM "+table+" WHERE DOCUUID=? AND COLUUID=?";
      String sqlR = "SELECT APPROVALSTATUS FROM "+tableR+" WHERE DOCUUID=?";
     
      Connection con = this.returnConnection().getJdbcConnection();
      st1 = con.prepareStatement(sql1);
      st2 = con.prepareStatement(sql2);
      stR = con.prepareStatement(sqlR);
      for (String docUuid: docUuids) {
        boolean bRemove = false;
        st1.clearParameters();
        st1.setString(1,docUuid);
        st1.setString(2,colUuid);
        ResultSet rs1 = st1.executeQuery();
        if (rs1.next()) bRemove = true;
        rs1.close();
       
        if (bRemove) {
          stR.clearParameters();
          stR.setString(1,docUuid);
          ResultSet rsR = stR.executeQuery();
          if (rsR.next()) {
            String status = Val.chkStr(rsR.getString(1));
            if (MmdEnums.ApprovalStatus.isPubliclyVisible(status)) {
              indexableUuids.add(docUuid);
            }
          }
          rsR.close();
         
          st2.setString(1,docUuid);
          st2.setString(2,colUuid);
          st2.addBatch();
          nBatch++;
        }
      }
      st1.close();
      st1 = null;
     
      if (nBatch > 0) {
        st2.executeBatch();
      }
    } finally {
      CollectionDao.closeStatement(st1);
      CollectionDao.closeStatement(st2);
      CollectionDao.closeStatement(stR);
    }
   
    if (indexableUuids.size() > 0) {
      this.reindex(publisher,indexableUuids);
    }
    return nBatch;
  }
View Full Code Here

      // get action
      HrActionCriteria.RepositoryAction action =
              getCriteria().getActionCriteria().getAction();

      StringSet uuids =
              getCriteria().getActionCriteria().getSelectedRecordIdSet();

      String[] aUuids = uuids.toArray(new String[uuids.size()]);

      switch (action) {
        case Create:
          getCriteria().getActionCriteria().setUuid("");
          return "catalog.harvest.manage.create";
View Full Code Here

   
    // sections (an empty sections parameter should return all non-optional sections)
    locator = "sections";
    parsed = pHelper.getParameterValues(request,locator,",");
    if ((parsed != null) && (parsed.length == 0)) {
      cOptions.setSections(new StringSet());
      cOptions.getSections().add("Filter_Capabilities");
    } else {
      supported = new SupportedValues(
          "ServiceIdentification,ServiceProvider,OperationsMetadata,Filter_Capabilities",",");
      cOptions.setSections(vHelper.validateValues(supported,locator,parsed,false));
View Full Code Here

    supported = new SupportedValues(
        "ServiceIdentification,ServiceProvider,OperationsMetadata,Filter_Capabilities",",");
    if (parsed == null) {
      parsed = pHelper.getParameterValues(root,xpath,"ows:Sections");
      if (parsed != null) {
        cOptions.setSections(new StringSet());
        cOptions.getSections().add("Filter_Capabilities");
      } else {
        cOptions.setSections(vHelper.validateValues(supported,locator,parsed,false));
      }
    } else {
View Full Code Here

                                       String schemaLocator)
    throws OwsException {
    QueryOptions qOptions = context.getRequestOptions().getQueryOptions();
    String outputSchema = qOptions.getOutputSchema();
    if ((outputSchema != null) && outputSchema.equalsIgnoreCase("original")) {
      StringSet ids = qOptions.getIDs();
      if ((ids == null) || (ids.size() != 1)) {
        String msg = "Only one Id can be requested when "+schemaLocator+"=original";
        throw new OwsException(OwsException.OWSCODE_InvalidParameterValue,idLocator,msg);
      }
    }
  }
View Full Code Here

    DiscoveryQuery query = this.getDiscoveryContext().getDiscoveryQuery();
    boolean isDublinCore = qOptions.isDublinCoreResponse();
   
    String elementSetType = Val.chkStr(qOptions.getElementSetType());
    String outputSchema = Val.chkStr(qOptions.getOutputSchema());
    StringSet elementSetTypeNames = qOptions.getElementSetTypeNames();
    boolean isBrief = elementSetType.equalsIgnoreCase(CswConstants.ElementSetType_Brief);
    boolean isSummary = elementSetType.equalsIgnoreCase(CswConstants.ElementSetType_Summary);
    boolean isFull = elementSetType.equalsIgnoreCase(CswConstants.ElementSetType_Full);
   
    // Dublin Core based responses
    if (isDublinCore) {
      OperationResponse opResponse = context.getOperationResponse();
      Document responseDom = opResponse.getResponseDom();
      String recNamespacePfx = "csw";
      String recNamespaceUri = CswNamespaces.URI_CSW;
      String recLocalName = "Record";
      StringSet elementNames = qOptions.getElementNames();
      boolean hasElementNames = (elementNames != null) && (elementNames.size() > 0);
      if (!hasElementNames) {
        if (isBrief) {
          recLocalName = "BriefRecord";
        } else if (isSummary) {
          recLocalName = "SummaryRecord";
View Full Code Here

    elResults.setAttribute("numberOfRecordsMatched",""+numberOfRecordsMatched);
    elResults.setAttribute("numberOfRecordsReturned",""+numberOfRecordsReturned);
    if (nextRecord >= 0) {
      elResults.setAttribute("nextRecord",""+nextRecord);
    }
    StringSet elementNames = qOptions.getElementNames();
    boolean hasElementNames = (elementNames != null) && (elementNames.size() > 0);
    if (!hasElementNames) {
      String type = qOptions.getElementSetType();
      elResults.setAttribute("elementSet",type);
    }
    if (qOptions.isDublinCoreResponse()) {
View Full Code Here

    HttpServletResponse response,
    RequestContext context, MessageBroker msgBroker, RestQuery query)
    throws SearchException {

  // determine the rids
  StringSet rids = this.getRids(request);

  // Get the criteria
  SearchCriteria criteria = this.toSearchCriteria(request, context, query);

  SearchResultRecords searchResultRecords = new SearchResultRecords();
View Full Code Here

*          the HTTP request
* @return the RIDs
*/
@SuppressWarnings("unchecked")
private StringSet getRids(HttpServletRequest request) {
  StringSet rids = new StringSet();
  Map<String, String[]> requestParameterMap = request.getParameterMap();
  for (Map.Entry<String, String[]> e : requestParameterMap.entrySet()) {
    if (e.getKey().equalsIgnoreCase("rids")) {
      String[] values = e.getValue();
      if (values != null) {
        for (String tokens : values) {
          StringTokenizer st = new StringTokenizer(tokens, ",");
          while (st.hasMoreElements()) {
            String value = Val.chkStr((String) st.nextElement());
            if (value.length() > 0) {
              try {
                rids.add(URLDecoder.decode(value, "UTF-8"));
              } catch (UnsupportedEncodingException e1) {
                // Should never happen
                LOG.log(Level.WARNING, "Could not decde uuid", e1);
              }
            }
          }
        }
      }
    }
  }
 
  String arrRids[] = request.getParameterValues("rid");
  for(int i = 0; arrRids != null && i < arrRids.length; i++) {
    rids.add(arrRids[i]);
  }
  return rids;
}
View Full Code Here

TOP

Related Classes of com.esri.gpt.framework.collection.StringSet

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.