Package com.esri.gpt.server.csw.provider.components

Examples of com.esri.gpt.server.csw.provider.components.TransactionOptions


                              String xml)
    throws Exception {
   
    handle = Val.chkStr(handle);
    xml = Val.chkStr(Val.removeBOM(xml));
    TransactionOptions tOptions = context.getRequestOptions().getTransactionOptions();
    TransactionSummary tSummary = tOptions.getSummary();
    PublicationRequest pubRequest = new PublicationRequest(
        context.getRequestContext(),publisher,xml);
    PublicationRecord pubRecord = pubRequest.getPublicationRecord();
    pubRecord.setPublicationMethod(MmdEnums.PublicationMethod.upload.toString());
    if (tOptions.getAutoApprove()) {
      pubRecord.setAutoApprove(true);
    }
    if ((tOptions.getApprovalStatus() != null) && (tOptions.getApprovalStatus().length() > 0)) {
      pubRecord.setApprovalStatus(MmdEnums.ApprovalStatus.valueOf(tOptions.getApprovalStatus()).toString());
    }
    if ((tOptions.getPublicationMethod() != null) && (tOptions.getPublicationMethod().length() > 0)) {
      pubRecord.setPublicationMethod(MmdEnums.PublicationMethod.valueOf(tOptions.getPublicationMethod()).toString());
    }
   
    // TODO: need a sourceUri
    //this.determineSourceUri(request,context,pubRequest);
   
View Full Code Here


                               String handle,
                               String[] ids)
    throws Exception {
    if ((ids == null) || (ids.length == 0)) return;
   
    TransactionOptions tOptions = context.getRequestOptions().getTransactionOptions();
    TransactionSummary tSummary = tOptions.getSummary();
    ImsMetadataAdminDao dao = new ImsMetadataAdminDao(context.getRequestContext());
    MmdActionCriteria actionCriteria = new MmdActionCriteria();
    actionCriteria.setActionKey("delete");
    for (String id: ids) {
      String uuid = Val.chkStr(dao.findUuid(id));
View Full Code Here

  public void handleXML(OperationContext context, Node root, XPath xpath)
    throws Exception {
   
    // initialize
    LOGGER.finer("Handling csw:Transaction/csw:Delete request XML...");
    TransactionOptions tOptions = context.getRequestOptions().getTransactionOptions();
    Publisher publisher = new Publisher(context.getRequestContext());
   
    // find all the Delete nodes
    String locator = "csw:Delete";
    NodeList nlActions = (NodeList)xpath.evaluate(locator,root,XPathConstants.NODESET);
    if (nlActions != null) {
      for (int i=0;i<nlActions.getLength();i++) {
        Node ndAction = nlActions.item(i);
        String typeName = xpath.evaluate("@typeName",ndAction);
        String handle = xpath.evaluate("@handle",ndAction);
        StringSet ids = new StringSet();
        tOptions.setDeletionIDs(ids);
      
        // find the constraint node
        locator = "csw:Constraint";
        Node ndConstraint = (Node)xpath.evaluate(locator,ndAction,XPathConstants.NODE);
        if (ndConstraint == null) {
View Full Code Here

   
    // sdi.suite SmartEditor
    if ((nIds == 1) && !qOptions.isDublinCoreResponse()) {
      String schemaName = Val.chkStr(qOptions.getSchemaFilter());
      if (schemaName.equalsIgnoreCase("http://www.isotc211.org/2005/gmd")) {
        TransactionOptions tOptions = context.getRequestOptions().getTransactionOptions();
        if ((tOptions.getPublicationMethod() != null) && (tOptions.getPublicationMethod().length() > 0)) {
          if (tOptions.getPublicationMethod().equals("seditor")) {
            OriginalXmlProvider oxp = new OriginalXmlProvider();
            String origXml = oxp.provideOriginalXml(context,ids[0]);
            if ((origXml != null) && (origXml.length() > 0)) {
              DiscoveredRecord record = new DiscoveredRecord();
              record.setResponseXml(origXml);
View Full Code Here

  public void handleXML(OperationContext context, Node root, XPath xpath)
    throws Exception {
   
    // initialize
    LOGGER.finer("Handling csw:Transaction request XML...");
    TransactionOptions tOptions = context.getRequestOptions().getTransactionOptions();
    ServiceProperties svcProps = context.getServiceProperties();
    ParseHelper pHelper = new ParseHelper();
    ValidationHelper vHelper = new ValidationHelper();
    String locator;
    String[] parsed;
    ISupportedValues supported;
    NodeList nlActions;
    IOperationProvider opProvider = null;
   
    // service and version are parsed by the parent RequestHandler
   
    // output format
    locator = "@outputFormat";
    parsed = pHelper.getParameterValues(root,xpath,locator);
    supported = svcProps.getSupportedValues(CswConstants.Parameter_OutputFormat);
    context.getOperationResponse().setOutputFormat(
        vHelper.validateValue(supported,locator,parsed,false));
   
   
    // verbose response
    locator = "@verboseResponse";
    parsed = pHelper.getParameterValues(root,xpath,locator);
    supported = new SupportedValues("true,false",",");
    String verbose = Val.chkStr(vHelper.validateValue(supported,locator,parsed,false));
    tOptions.setVerboseResponse(verbose.equalsIgnoreCase("true"));
       
    // request ID
    locator = "@requestId";
    parsed = pHelper.getParameterValues(root,xpath,locator);
    tOptions.setRequestId(vHelper.validateValue(locator,parsed,false));
   
    // determine the sub-operation

    // Insert
    if (opProvider == null) {
      locator = "csw:Insert";
      nlActions = (NodeList)xpath.evaluate(locator,root,XPathConstants.NODESET);
      if ((nlActions != null) && (nlActions.getLength() > 0)) {
        tOptions.setTransactionType(CswConstants.TransactionType_Insert);
        opProvider = new InsertProvider();
      }
    }
   
    // Update
    if (opProvider == null) {
      locator = "csw:Update";
      nlActions = (NodeList)xpath.evaluate(locator,root,XPathConstants.NODESET);
      if ((nlActions != null) && (nlActions.getLength() > 0)) {
        tOptions.setTransactionType(CswConstants.TransactionType_Update);
        opProvider = new UpdateProvider();
      }
    }
   
    // Delete
    if (opProvider == null) {
      locator = "csw:Delete";
      nlActions = (NodeList)xpath.evaluate(locator,root,XPathConstants.NODESET);
      if ((nlActions != null) && (nlActions.getLength() > 0)) {
        tOptions.setTransactionType(CswConstants.TransactionType_Delete);
        opProvider = new DeleteProvider();
      }
    }
   
    // handle the sub-operation
View Full Code Here

TOP

Related Classes of com.esri.gpt.server.csw.provider.components.TransactionOptions

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.