Package com.esri.gpt.server.assertion.components

Examples of com.esri.gpt.server.assertion.components.AsnValue


     
      // determine the handler
      AsnOperationHandler handler = factory.makeOperationHandler(context);
     
      // ensure a valid value if required
      AsnValue asnValue = context.getOperation().getValue();
      if (asnValue != null) {
        AsnValueType asnValueType = asnValue.getValueType();
        if (asnValueType != null) {
          String val = Val.chkStr(rOptions.getValue());
          int maxChars = asnValueType.getMaxCharacters();
          if (asnValueType.getRequired() && (val.length() == 0) && (request != null)) {
            val = Val.chkStr(this.readInputCharacters(request,maxChars));
            if (val.length() == 0) val = null;
            rOptions.setValue(val);
          }
          if ((maxChars >= 0) && (val != null) && (val.length() > maxChars)) {
            val = Val.chkStr(val.substring(0,maxChars));
          }
          if ((val != null) && (val.length() > 0)) {
            AsnValueFilter vFilter = asnValueType.makeValueFilter(context);
            if (vFilter != null) {
              val = Val.chkStr(vFilter.filter(val));
            }
          }
          AsnSupportedValues supported = asnValueType.getSupportedValues();
          if (supported != null) {
            val = supported.getSupportedValue(val);
            if (val != null) {
              asnValue.setTextValue(val);
            } else {
              String msg = "The supplied value is not supported - "+val;
              throw new AsnInvalidOperationException(msg);
            }
          } else {
            if ((val != null) && (val.length() == 0)) val = null;
            asnValue.setTextValue(val);
            if (asnValueType.getRequired() && (val == null)) {
              String msg = "A value is required.";
              throw new AsnInvalidOperationException(msg);
            }
          }
View Full Code Here


      asnSet.getValueType().setRequired(true);
      asnSet.getValueType().setValueFilterClass(valueFilterClass);
      asnSet.getValueType().setValueTypeName(AsnValueType.VALUE_TYPENAME_FREE);
     
      // value
      AsnValue asnValue = new AsnValue();
      asnValue.setValueType(asnSet.getValueType().duplicate());
                 
      // query a comment by assertion id
      op = new AsnOperation(asnSet);
      op.setHandlerClass("com.esri.gpt.server.assertion.handler.AsnCommentHandler");
      op.setSubject(new AsnSubject(asnSet.getAssertionIdPrefix()));
      op.setPredicate(new AsnPredicate(actionPfx+":query"));
      op.setAuthPolicy(authForRead.duplicate());
      ops.add(op);
     
      // query comments associated with a resource
      op = new AsnOperation(asnSet);
      op.setHandlerClass("com.esri.gpt.server.assertion.handler.AsnCommentHandler");
      op.setSubject(new AsnSubject(AsnConstants.SUBJECT_PREFIX_RESOURCEID));
      op.setPredicate(new AsnPredicate(actionPfx+":query"));
      op.setAuthPolicy(authForRead.duplicate());
      ops.add(op);
     
      // create     
      op = new AsnOperation(asnSet);
      op.setHandlerClass("com.esri.gpt.server.assertion.handler.AsnCreateHandler");
      op.setSubject(new AsnSubject(AsnConstants.SUBJECT_PREFIX_RESOURCEID));
      op.setPredicate(new AsnPredicate(actionPfx+":create"));
      op.getAuthPolicy().setMultiplePerUserSubjectPredicate(true);
      op.setValue(asnValue.duplicate());
      ops.add(op);

      // update
      op = new AsnOperation(asnSet);
      op.setHandlerClass("com.esri.gpt.server.assertion.handler.AsnUpdateHandler");
      op.setSubject(new AsnSubject(asnSet.getAssertionIdPrefix()));
      op.setPredicate(new AsnPredicate(actionPfx+":update"));
      op.setValue(asnValue.duplicate());
      ops.add(op);
     
      // delete
      op = new AsnOperation(asnSet);
      op.setHandlerClass("com.esri.gpt.server.assertion.handler.AsnDeleteHandler");
View Full Code Here

      supported.add("urn:esri:geoportal:rating:value:up");
      supported.add("urn:esri:geoportal:rating:value:down");
      asnSet.getValueType().setSupportedValues(supported);
     
      // value
      AsnValue asnValue = new AsnValue();
      asnValue.setValueType(asnSet.getValueType().duplicate());
           
      // query ratings associated with a resource
      op = new AsnOperation(asnSet);
      op.setHandlerClass("com.esri.gpt.server.assertion.handler.AsnRatingHandler");
      op.setSubject(new AsnSubject(AsnConstants.SUBJECT_PREFIX_RESOURCEID));
      op.setPredicate(new AsnPredicate(actionPfx+":query"));
      op.setAuthPolicy(authForRead.duplicate());
      ops.add(op);
     
      // create
      op = new AsnOperation(asnSet);
      op.setHandlerClass("com.esri.gpt.server.assertion.handler.AsnCreateHandler");
      op.setSubject(new AsnSubject(AsnConstants.SUBJECT_PREFIX_RESOURCEID));
      op.setPredicate(new AsnPredicate(actionPfx+":create"));
      op.setValue(asnValue.duplicate());
      ops.add(op);
     
      // update
      op = new AsnOperation(asnSet);
      op.setHandlerClass("com.esri.gpt.server.assertion.handler.AsnUpdateHandler");
      op.setSubject(new AsnSubject(asnSet.getAssertionIdPrefix()));
      op.setPredicate(new AsnPredicate(actionPfx+":update"));
      op.setValue(asnValue.duplicate());
      ops.add(op);
     
      // delete
      op = new AsnOperation(asnSet);
      op.setHandlerClass("com.esri.gpt.server.assertion.handler.AsnDeleteHandler");
View Full Code Here

TOP

Related Classes of com.esri.gpt.server.assertion.components.AsnValue

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.