Examples of CreateOntologyInfo


Examples of org.mmisw.orrclient.gwt.client.rpc.CreateOntologyInfo

        // Should not happen
        Window.alert(error);
        return;
      }

      CreateOntologyInfo createOntologyInfo = new CreateOntologyInfo();
      createOntologyInfo.setHostingType(HostingType.FULLY_HOSTED);

      createOntologyInfo.setMetadataValues(newValues);

      OtherDataCreationInfo dataCreationInfo = new OtherDataCreationInfo();
      dataCreationInfo.setTempOntologyInfo(getTempOntologyInfo());
      createOntologyInfo.setDataCreationInfo(dataCreationInfo);

      // set info of original ontology:
      createOntologyInfo.setBaseOntologyInfo(getTempOntologyInfo());

      // set the desired authority/shortName combination:
      createOntologyInfo.setAuthority(pageFullyHosted.getAuthority());
      createOntologyInfo.setShortName(pageFullyHosted.getShortName());

      RegisterNewExecute execute = new RegisterNewExecute(createOntologyInfo);

      execute.reviewAndRegisterNewOntology();
    }

    /////////////////////////////////////////////////////////////////////
    // Finish: re-hosted registration
    else if ( currentPage == pageReHostedConfirmation ) {

      // collect information and run the "review and register"
      String error;
      Map<String, String> newValues = new HashMap<String, String>();
      if ( (error = pageReHostedMetadataPage1.mdSection.putValuesInMap(newValues, true)) != null
      ||   (error = pageReHostedMetadataPage2.mdSection.putValuesInMap(newValues, true)) != null
      ||   (error = pageReHostedMetadataPage3.mdSection.putValuesInMap(newValues, true)) != null
      ) {
        // Should not happen
        Window.alert(error);
        return;
      }

      CreateOntologyInfo createOntologyInfo = new CreateOntologyInfo();
      createOntologyInfo.setHostingType(HostingType.RE_HOSTED);

      createOntologyInfo.setMetadataValues(newValues);

      OtherDataCreationInfo dataCreationInfo = new OtherDataCreationInfo();
      dataCreationInfo.setTempOntologyInfo(getTempOntologyInfo());
      createOntologyInfo.setDataCreationInfo(dataCreationInfo);

      // set info of original ontology:
      createOntologyInfo.setBaseOntologyInfo(getTempOntologyInfo());


      RegisterNewExecute execute = new RegisterNewExecute(createOntologyInfo);

      execute.reviewAndRegisterNewOntology();
View Full Code Here

Examples of org.mmisw.orrclient.gwt.client.rpc.CreateOntologyInfo

        Window.alert(error);
        return;
      }
     
     
      CreateOntologyInfo createOntologyInfo = new CreateOntologyInfo();
      createOntologyInfo.setHostingType(HostingType.FULLY_HOSTED);
     
      createOntologyInfo.setMetadataValues(newValues);
     
      OtherDataCreationInfo dataCreationInfo = new OtherDataCreationInfo();
      dataCreationInfo.setTempOntologyInfo(tempOntologyInfo);
      createOntologyInfo.setDataCreationInfo(dataCreationInfo);
     
      // set info of original ontology:
      createOntologyInfo.setBaseOntologyInfo(registeredOntologyInfo);
     
      createOntologyInfo.setPriorOntologyInfo(
          registeredOntologyInfo.getOntologyId(),
          registeredOntologyInfo.getOntologyUserId(),
          registeredOntologyInfo.getVersionNumber()
      );
     
      // set the desired authority/shortName combination:
      createOntologyInfo.setAuthority(registeredOntologyInfo.getAuthority());
      createOntologyInfo.setShortName(registeredOntologyInfo.getShortName());
     
      RegisterVersionExecute execute = new RegisterVersionExecute(createOntologyInfo);
     
      execute.reviewAndRegisterVersionOntology();
    }
   
    /////////////////////////////////////////////////////////////////////
    // Finish: re-hosted registration
    else if ( currentPage == pageReHostedConfirmation ) {
     
      // collect information and run the "review and register"
      String error;
      Map<String, String> newValues = new HashMap<String, String>();
      if ( (error = pageReHostedMetadataPage1.mdSection.putValuesInMap(newValues, true)) != null
      ||   (error = pageReHostedMetadataPage2.mdSection.putValuesInMap(newValues, true)) != null
      ||   (error = pageReHostedMetadataPage3.mdSection.putValuesInMap(newValues, true)) != null
      ) {
        // Should not happen
        Window.alert(error);
        return;
      }
     
      CreateOntologyInfo createOntologyInfo = new CreateOntologyInfo();
      createOntologyInfo.setHostingType(HostingType.RE_HOSTED);
     
      createOntologyInfo.setMetadataValues(newValues);
     
      OtherDataCreationInfo dataCreationInfo = new OtherDataCreationInfo();
      dataCreationInfo.setTempOntologyInfo(getTempOntologyInfo());
      createOntologyInfo.setDataCreationInfo(dataCreationInfo);
     
      // set info of original ontology:
      createOntologyInfo.setBaseOntologyInfo(registeredOntologyInfo);
     
      createOntologyInfo.setPriorOntologyInfo(
          registeredOntologyInfo.getOntologyId(),
          registeredOntologyInfo.getOntologyUserId(),
          registeredOntologyInfo.getVersionNumber()
      );
     
      // set the desired authority/shortName combination:
      createOntologyInfo.setAuthority(registeredOntologyInfo.getAuthority());
      createOntologyInfo.setShortName(registeredOntologyInfo.getShortName());
     
      RegisterVersionExecute execute = new RegisterVersionExecute(createOntologyInfo);
     
      execute.reviewAndRegisterVersionOntology();
    }
View Full Code Here

Examples of org.mmisw.orrclient.gwt.client.rpc.CreateOntologyInfo

//      String value = newValues.get(uri);
//      newValues.put(uri, value);
//    }
   
    // prepare info for creation of the ontology:
    CreateOntologyInfo createOntologyInfo = new CreateOntologyInfo();
   
    // transfer info about prior ontology, if any, for eventual creation of new version:
    if ( ontologyInfo instanceof RegisteredOntologyInfo ) {
      RegisteredOntologyInfo roi = (RegisteredOntologyInfo) ontologyInfo;
      createOntologyInfo.setPriorOntologyInfo(
          roi.getOntologyId(),
          roi.getOntologyUserId(),
          roi.getVersionNumber()
      );
    }
   
    createOntologyInfo.setUri(ontologyInfo.getUri());
   
    if ( ontologyInfo instanceof RegisteredOntologyInfo ) {
      RegisteredOntologyInfo roi = (RegisteredOntologyInfo) ontologyInfo;
      createOntologyInfo.setAuthority(roi.getAuthority());
      createOntologyInfo.setShortName(roi.getShortName());
    }
   
    createOntologyInfo.setMetadataValues(newValues);
   

    String authority = createOntologyInfo.getAuthority();
    String shortName = createOntologyInfo.getShortName();
   
    if ( authority == null || authority.trim().length() == 0 ) {
      // TODO improve this code:
      authority = newValues.get("http://mmisw.org/ont/mmi/20081020/ontologyMetadata/origMaintainerCode");
      if ( authority == null || authority.trim().length() == 0 ) {
        authority = "mmitest"// TODO
      }
      createOntologyInfo.setAuthority(authority);
    }
   
    if ( shortName == null || shortName.trim().length() == 0 ) {
      // TODO improve this code:
      shortName = newValues.get("http://omv.ontoware.org/2005/05/ontology#acronym");
      if ( shortName == null || shortName.trim().length() == 0 ) {
        shortName = "shorttest"// TODO
      }
      createOntologyInfo.setShortName(shortName);
    }
   
    createOntologyInfo.setDataCreationInfo(dataCreationInfo);
   
//    if ( dataCreationInfo instanceof VocabularyDataCreationInfo
//    ||   dataCreationInfo instanceof OtherDataCreationInfo
//    ) {
//      // OK: continue
//    }
//    else {
//      Window.alert("sorry, not implemented yet");
//      return;
//    }
   
   
    final MyDialog popup = aPopup == null ? new MyDialog(null): aPopup;
    if (aPopup == null) {
      popup.addTextArea(null).setSize("600", "150");
      popup.getTextArea().setText("please wait ...");
      PortalControl.getInstance().notifyActivity(true);
      popup.center();
      popup.show();
    }
    popup.setText("Creating ontology ...");

    AsyncCallback<CreateOntologyResult> callback = new AsyncCallback<CreateOntologyResult>() {
      public void onFailure(Throwable thr) {
        PortalControl.getInstance().notifyActivity(false);
        container.clear();       
        container.add(new HTML(thr.toString()));
      }

      public void onSuccess(CreateOntologyResult result) {
        log("CreateOntologyResult obtained." + result.getCreateOntologyInfo().getHostingType());
        PortalControl.getInstance().notifyActivity(false);
        reviewCompleted(popup, result);
      }
    };

    log("Calling service createOntology, hostingType=" +createOntologyInfo.getHostingType());
    Orr.service.createOntology(createOntologyInfo, callback);
  }
View Full Code Here

Examples of org.mmisw.orrclient.gwt.client.rpc.CreateOntologyInfo

    assert loginResult.getUserId() != null;
    assert loginResult.getSessionId() != null;
   
    log.info(": registering URI: " +uri+ " ...");

    CreateOntologyInfo createOntologyInfo = createOntologyResult.getCreateOntologyInfo();

    String ontologyId = createOntologyInfo.getPriorOntologyInfo().getOntologyId();
    String ontologyUserId = createOntologyInfo.getPriorOntologyInfo().getOntologyUserId();
   
    if ( ontologyId != null ) {
      log.info("Will create a new version for ontologyId = " +ontologyId+ ", userId=" +ontologyUserId);
    }
   
   
    Map<String, String> newValues = createOntologyInfo .getMetadataValues();
   

    try {
      // this is to get the filename for the registration
      String fileName = new URL(uri).getPath();
     
      //
      // make sure the fileName ends with ".owl" as the aquaportal back-end seems
      // to add that fixed extension in some operations (at least in the parse operation)
      //
      if ( ! fileName.toLowerCase().endsWith(".owl") ) {
        if ( log.isDebugEnabled() ) {
          log.debug("register: setting file extension to .owl per aquaportal requirement.");
        }
        fileName += ".owl";
      }
     
     
      if ( ontologyId == null ) {
        //
        // Submission of a new ontology (not version of a registered one)
        //
       
        // We are about to do the actual registration. But first, re-check that there is NO a preexisting
        // ontology that may conflict with this one.
        // NOTE: this check has been done already in the review operation; however, we repeat it here
        // in case there is a new registration done by other user in the meantime. Of course, we
        // are NOT completely solving the potential concurrency problem with this re-check; we are just
        // reducing the chances of that event.
       
       
        // TODO: the following can be simplified by obtaining the unversioned form of the URI and
        // calling Util2.checkNoPreexistingOntology(unversionedUri, registerOntologyResult)

        final String namespaceRoot = newValues.get("namespaceRoot") != null
            ? newValues.get("namespaceRoot")
            :  defaultNamespaceRoot;

        final String orgAbbreviation = createOntologyInfo.getAuthority();
        final String shortName = createOntologyInfo.getShortName();

        if ( ! Util2.checkNoPreexistingOntology(namespaceRoot, orgAbbreviation, shortName, registerOntologyResult) ) {
          return registerOntologyResult;
        }
View Full Code Here

Examples of org.mmisw.orrclient.gwt.client.rpc.CreateOntologyInfo

    assert loginResult.getUserId() != null;
    assert loginResult.getSessionId() != null;
   
    log.info(": registering ...");

    CreateOntologyInfo createOntologyInfo = createOntologyResult.getCreateOntologyInfo();

    String ontologyId = createOntologyInfo.getPriorOntologyInfo().getOntologyId();
    String ontologyUserId = createOntologyInfo.getPriorOntologyInfo().getOntologyUserId();
   
    if ( ontologyId != null ) {
      log.info("Will create a new version for ontologyId = " +ontologyId+ ", userId=" +ontologyUserId);
    }
   
   
    Map<String, String> newValues = createOntologyInfo .getMetadataValues();
   

    try {
     
      String fileName = new URL(uri).getPath();
View Full Code Here

Examples of org.mmisw.orrclient.gwt.client.rpc.CreateOntologyInfo

    assert loginResult.getUserId() != null;
    assert loginResult.getSessionId() != null;
   
    log.info(": registering ...");

    CreateOntologyInfo createOntologyInfo = createOntologyResult.getCreateOntologyInfo();

    String ontologyId = createOntologyInfo.getPriorOntologyInfo().getOntologyId();
    String ontologyUserId = createOntologyInfo.getPriorOntologyInfo().getOntologyUserId();
   
    if ( ontologyId != null ) {
      log.info("Will create a new version for ontologyId = " +ontologyId+ ", userId=" +ontologyUserId);
    }
   
   
    Map<String, String> newValues = createOntologyInfo .getMetadataValues();
   

    try {
     
      String fileName = new URL(uri).getPath();
View Full Code Here

Examples of org.mmisw.orrclient.gwt.client.rpc.CreateOntologyInfo

   
    if ( log.isDebugEnabled() ) {
      log.debug(getClass().getSimpleName()+ ".registerNewOntology: hostingType = " +hostingType);
    }
   
    CreateOntologyInfo createOntologyInfo = new CreateOntologyInfo();
    createOntologyInfo.setHostingType(hostingType);
    createOntologyInfo.setUri(ontologyUri);
   
    setSomeValues(loginResult, createOntologyInfo);
   
    OtherDataCreationInfo dataCreationInfo = new OtherDataCreationInfo();
    dataCreationInfo.setTempOntologyInfo(tempOntologyInfo);
    createOntologyInfo.setDataCreationInfo(dataCreationInfo);
   
    // set info of original ontology:
    createOntologyInfo.setBaseOntologyInfo(tempOntologyInfo);
   
    RegisterOntologyResult registerOntologyResult = orrClient.registerOntologyDirectly(loginResult, null, createOntologyInfo, graphId);
    if ( registerOntologyResult.getError() != null ) {
      throw new Exception("Error registering ontology: " +registerOntologyResult.getError());
    }
View Full Code Here

Examples of org.mmisw.orrclient.gwt.client.rpc.CreateOntologyInfo

      throw new Exception("User '" +loginResult.getUserName()+ "' is not allowed to " +
          "register new version for existing ontology with URI: " +ontologyUri);
    }
   
   
    CreateOntologyInfo createOntologyInfo = new CreateOntologyInfo();
    createOntologyInfo.setHostingType(hostingType);
    createOntologyInfo.setUri(ontologyUri);
   
    createOntologyInfo.setPriorOntologyInfo(
        registeredOntologyInfo.getOntologyId(),
        registeredOntologyInfo.getOntologyUserId(),
        registeredOntologyInfo.getVersionNumber()
    );
   
    setSomeValues(loginResult, createOntologyInfo);
   
    OtherDataCreationInfo dataCreationInfo = new OtherDataCreationInfo();
    dataCreationInfo.setTempOntologyInfo(tempOntologyInfo);
    createOntologyInfo.setDataCreationInfo(dataCreationInfo);
   
    // set info of original ontology:
    createOntologyInfo.setBaseOntologyInfo(tempOntologyInfo);
   
    RegisterOntologyResult registerOntologyResult = orrClient.registerOntologyDirectly(loginResult, registeredOntologyInfo, createOntologyInfo, graphId);
    if ( registerOntologyResult.getError() != null ) {
      throw new Exception("Error registering ontology: " +registerOntologyResult.getError());
    }
View Full Code Here

Examples of org.mmisw.orrclient.gwt.client.rpc.CreateOntologyInfo

    assert loginResult.getUserId() != null;
    assert loginResult.getSessionId() != null;
   
    log.info(": registering ...");

    CreateOntologyInfo createOntologyInfo = createOntologyResult.getCreateOntologyInfo();

    String ontologyId = createOntologyInfo.getPriorOntologyInfo().getOntologyId();
    String ontologyUserId = createOntologyInfo.getPriorOntologyInfo().getOntologyUserId();
   
    if ( ontologyId != null ) {
      log.info("Will create a new version for ontologyId = " +ontologyId+ ", userId=" +ontologyUserId);
    }
   
   
    Map<String, String> newValues = createOntologyInfo .getMetadataValues();
   

    try {
     
      String fileName = new URL(uri).getPath();
View Full Code Here

Examples of org.mmisw.orrclient.gwt.client.rpc.CreateOntologyInfo

    assert loginResult.getUserId() != null;
    assert loginResult.getSessionId() != null;
   
    log.info(": registering ...");

    CreateOntologyInfo createOntologyInfo = createOntologyResult.getCreateOntologyInfo();

    String ontologyId = createOntologyInfo.getPriorOntologyInfo().getOntologyId();
    String ontologyUserId = createOntologyInfo.getPriorOntologyInfo().getOntologyUserId();
   
    if ( ontologyId != null ) {
      log.info("Will create a new version for ontologyId = " +ontologyId+ ", userId=" +ontologyUserId);
    }
   
   
    Map<String, String> newValues = createOntologyInfo .getMetadataValues();
   

    try {
     
      String fileName = new URL(uri).getPath();
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.