Examples of AsnOperations


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

   */
  public void configure() {
   
    // initialize
    this.indexReferences = new AsnIndexReferences();
    this.operations = new AsnOperations();
    AsnIndexReferences indexRefs = this.indexReferences;
    ApplicationConfiguration appCfg = ApplicationContext.getInstance().getConfiguration();
    CatalogConfiguration catCfg = appCfg.getCatalogConfiguration();
    StringAttributeMap catParams = catCfg.getParameters();
    LuceneConfig luceneCfg = catCfg.getLuceneConfig();
View Full Code Here

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

   */
  private void configureComments(CatalogConfiguration catCfg,
                                 AsnIndexReference indexRef,
                                 String name) {
    StringAttributeMap catParams = catCfg.getParameters();
    AsnOperations ops =  this.operations;
    AsnOperation op;
   
    if (indexRef.getEnabled()) {
     
      int maxLength = Val.chkInt(catParams.getValue("assertion."+name+".maxLength"),4000);
      String valueFilterClass = Val.chkStr(catParams.getValue("assertion."+name+".valueFilterClass"));
      if (valueFilterClass.length() == 0) {
        valueFilterClass = null;
      }
     
      AsnAuthPolicy authForRead = new AsnAuthPolicy();
      authForRead.setAllowNonLocalResourceIds(this.allowNonLocalResourceIds);
      authForRead.setAuthenticationRequired(false);
      authForRead.setQueryPrincipals(new AsnPrincipals());
      authForRead.getQueryPrincipals().add(AsnConstants.PRINCIPAL_ANY);
     
      // create the assertion set
      AsnAssertionSet asnSet = new AsnAssertionSet(name);
      String actionPfx = asnSet.getURNPrefix();
     
      // set the index reference
      asnSet.setIndexReference(indexRef.duplicate());
    
      // set the default authentication/authorization policy
      asnSet.setAuthPolicy(new AsnAuthPolicy());
      asnSet.getAuthPolicy().setAllowNonLocalResourceIds(this.allowNonLocalResourceIds);
      asnSet.getAuthPolicy().setAuthenticationRequired(true);
      asnSet.getAuthPolicy().setCreatePrincipals(new AsnPrincipals());
      asnSet.getAuthPolicy().getCreatePrincipals().add(AsnConstants.PRINCIPAL_ANY);
      asnSet.getAuthPolicy().setDeletePrincipals(new AsnPrincipals());
      asnSet.getAuthPolicy().getDeletePrincipals().add(AsnConstants.PRINCIPAL_OWNER);
      asnSet.getAuthPolicy().getDeletePrincipals().add(AsnConstants.PRINCIPAL_ADMINISTRATOR);
      asnSet.getAuthPolicy().setEnableDisablePrincipals(new AsnPrincipals());
      asnSet.getAuthPolicy().getEnableDisablePrincipals().add(AsnConstants.PRINCIPAL_ADMINISTRATOR);
      asnSet.getAuthPolicy().setUpdatePrincipals(new AsnPrincipals());
      asnSet.getAuthPolicy().getUpdatePrincipals().add(AsnConstants.PRINCIPAL_OWNER);
      asnSet.getAuthPolicy().setQueryPrincipals(new AsnPrincipals());
      asnSet.getAuthPolicy().getQueryPrincipals().add(AsnConstants.PRINCIPAL_ANY);
      asnSet.getAuthPolicy().setMultiplePerUserSubjectPredicate(false);
     
      // value type
      asnSet.setValueType(new AsnValueType());
      asnSet.getValueType().setAnalyzePriorToIndexing(true);
      asnSet.getValueType().setMaxCharacters(maxLength);
      asnSet.getValueType().setRdfPredicate(asnSet.getURNPrefix());
      asnSet.getValueType().setRdfValueField("rdf.comment.value");
      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");
      op.setSubject(new AsnSubject(asnSet.getAssertionIdPrefix()));
      op.setPredicate(new AsnPredicate(actionPfx+":delete"));
      ops.add(op);
     
      // enable
      op = new AsnOperation(asnSet);
      op.setHandlerClass("com.esri.gpt.server.assertion.handler.AsnEnableHandler");
      op.setSubject(new AsnSubject(asnSet.getAssertionIdPrefix()));
      op.setPredicate(new AsnPredicate(actionPfx+":enable"));
      ops.add(op);
     
      // disable
      op = new AsnOperation(asnSet);
      op.setHandlerClass("com.esri.gpt.server.assertion.handler.AsnDisableHandler");
      op.setSubject(new AsnSubject(asnSet.getAssertionIdPrefix()));
      op.setPredicate(new AsnPredicate(actionPfx+":disable"));
      ops.add(op);
     
      // UI resources
      op = new AsnOperation(asnSet);
      op.setHandlerClass("com.esri.gpt.server.assertion.handler.AsnUIResourcesHandler");
      op.setSubject(new AsnSubject(asnSet.getURNPrefix()));
      op.getSubject().setRequiresValuePart(false);
      op.setPredicate(new AsnPredicate(actionPfx+":uiresources"));
      op.setAuthPolicy(authForRead.duplicate());
      ops.add(op);
      AsnProperty uiResources = new AsnProperty(
          asnSet.getURNPrefix(),asnSet.getURNPrefix()+":uiresources",null);
      op.setUIResources(uiResources);
     
      String pfx = asnSet.getURNPrefix()+":uiresource";
View Full Code Here

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

   * @param name the assertion set name
   */
  private void configureRatings(CatalogConfiguration catCfg,
                                AsnIndexReference indexRef,
                                String name) {
    AsnOperations ops =  this.operations;
    AsnOperation op;
   
    if (indexRef.getEnabled()) {
     
      AsnAuthPolicy authForRead = new AsnAuthPolicy();
      authForRead.setAllowNonLocalResourceIds(this.allowNonLocalResourceIds);
      authForRead.setAuthenticationRequired(false);
      authForRead.setQueryPrincipals(new AsnPrincipals());
      authForRead.getQueryPrincipals().add(AsnConstants.PRINCIPAL_ANY);
     
      // create the assertion set
      AsnAssertionSet asnSet = new AsnAssertionSet(name);
      String actionPfx = asnSet.getURNPrefix();
     
      // set the index reference
      asnSet.setIndexReference(indexRef.duplicate());
    
      // set the default authentication/authorization policy
      asnSet.setAuthPolicy(new AsnAuthPolicy());
      asnSet.getAuthPolicy().setAllowNonLocalResourceIds(this.allowNonLocalResourceIds);
      asnSet.getAuthPolicy().setAuthenticationRequired(true);
      asnSet.getAuthPolicy().setCreatePrincipals(new AsnPrincipals());
      asnSet.getAuthPolicy().getCreatePrincipals().add(AsnConstants.PRINCIPAL_ANY);
      asnSet.getAuthPolicy().setDeletePrincipals(new AsnPrincipals());
      asnSet.getAuthPolicy().getDeletePrincipals().add(AsnConstants.PRINCIPAL_OWNER);
      asnSet.getAuthPolicy().setEnableDisablePrincipals(null);
      asnSet.getAuthPolicy().setUpdatePrincipals(new AsnPrincipals());
      asnSet.getAuthPolicy().getUpdatePrincipals().add(AsnConstants.PRINCIPAL_OWNER);
      asnSet.getAuthPolicy().setQueryPrincipals(new AsnPrincipals());
      asnSet.getAuthPolicy().getQueryPrincipals().add(AsnConstants.PRINCIPAL_ANY);
      asnSet.getAuthPolicy().setMultiplePerUserSubjectPredicate(false);
     
      // value type
      asnSet.setValueType(new AsnValueType());
      asnSet.getValueType().setAnalyzePriorToIndexing(false);
      asnSet.getValueType().setRequired(true);
      asnSet.getValueType().setRdfPredicate(asnSet.getURNPrefix());
      asnSet.getValueType().setRdfValueField("rdf.rating.value");
      asnSet.getValueType().setValueTypeName(AsnValueType.VALUE_TYPENAME_CONSTRAINED);
      AsnSupportedValues supported = new AsnSupportedValues();
      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");
      op.setSubject(new AsnSubject(asnSet.getAssertionIdPrefix()));
      op.setPredicate(new AsnPredicate(actionPfx+":delete"));
      ops.add(op);
     
      // UI resources
      op = new AsnOperation(asnSet);
      op.setHandlerClass("com.esri.gpt.server.assertion.handler.AsnUIResourcesHandler");
      op.setSubject(new AsnSubject(asnSet.getURNPrefix()));
      op.getSubject().setRequiresValuePart(false);
      op.setPredicate(new AsnPredicate(actionPfx+":uiresources"));
      op.setAuthPolicy(authForRead.duplicate());
      ops.add(op);
      AsnProperty uiResources = new AsnProperty(
          asnSet.getURNPrefix(),asnSet.getURNPrefix()+":uiresources",null);
      op.setUIResources(uiResources);
     
      String pfx = asnSet.getURNPrefix()+":uiresource";
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.