Package org.mmisw.orrclient.gwt.client.rpc

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


   * Call this to review and register an new ontology (not a new version of an existing registered ontology).
   */
  void reviewAndRegisterNewOntology() {
    Map<String, String> newValues = createOntologyInfo.getMetadataValues();
   
    BaseOntologyInfo ontologyInfo = createOntologyInfo.getBaseOntologyInfo();
   
    assert ! ( ontologyInfo instanceof RegisteredOntologyInfo ) ;
   
   
    // Ok, put the new values in the ontologyInfo object:
    ontologyInfo.getOntologyMetadata().setNewValues(newValues);
   
   
    createOntologyInfo.setUri(ontologyInfo.getUri());

    Orr.log(CLASS_NAME+": reviewAndRegisterNewOntology starting.  HostingType: " +createOntologyInfo.getHostingType());
   
    final MyDialog popup = new MyDialog(null);
    popup.addTextArea(null).setSize("600", "150");
View Full Code Here


    }
 
    final String log_prefix = "_loadDataOfWorkingOntologiesForMapping(" +currentIdx+ "): ";
   
    String uri = uris.get(currentIdx);
    BaseOntologyInfo ontologyInfo = VineMain.getOntologyInfo(uri);
   
    if ( ontologyInfo == null ) {
      // Not a registered ontology; continue to next entry:
      Orr.log(log_prefix +"VineMain.getOntologyInfo returned null: " +uri);
      _loadDataOfWorkingOntologiesForMapping(pePopup, currentIdx + 1);
      return;
    }

    if ( ontologyInfo.getError() != null ) {
      // continue to next entry:
      _loadDataOfWorkingOntologiesForMapping(pePopup, currentIdx + 1);
      return;
    }

    OntologyData ontologyData = ontologyInfo.getOntologyData();
    if ( ontologyData != null ) {
      // this entry already has data; continue to next entry:
      Orr.log(log_prefix +"already with OntologyData: " +uri);
      _loadDataOfWorkingOntologiesForMapping(pePopup, currentIdx + 1);
      return;
    }
   
    // this entry needs data.
   
    if (! (ontologyInfo instanceof RegisteredOntologyInfo)) {
      Orr.log(log_prefix +"Ontology from VineMain is not a RegisteredOntologyInfo: " +uri);
      _loadDataOfWorkingOntologiesForMapping(pePopup, currentIdx + 1);
      return;
    }
   
    RegisteredOntologyInfo registeredOntologyInfo = (RegisteredOntologyInfo) ontologyInfo;
   
    AsyncCallback<RegisteredOntologyInfo> callback = new AsyncCallback<RegisteredOntologyInfo>() {

      public void onFailure(Throwable thr) {
        String error = thr.getClass().getName()+ ": " +thr.getMessage();
        while ( (thr = thr.getCause()) != null ) {
          error += "\ncaused by: " +thr.getClass().getName()+ ": " +thr.getMessage();
        }
        Orr.log(log_prefix + " ERROR: " +error);
        Window.alert(error);
      }

      public void onSuccess(RegisteredOntologyInfo ontologyInfo) {
        Orr.log(log_prefix +ontologyInfo.getUri()+ " completed.");
        pePopup.appendToTextArea("done\n");
       
        if ( ontologyInfo.getOntologyData() == null ) {
          Orr.log("  UNEXPECTED: data not retrieved");
        }
       
        VineMain.ontologySucessfullyLoaded(ontologyInfo);
        VineMain.addWorkingUri(ontologyInfo.getUri());
       
        if ( mapperPage != null ) {
          mapperPage.notifyWorkingOntologyAdded(ontologyInfo);
        }
       
        // continue with next entry:
        DeferredCommand.addCommand(new Command() {
          public void execute() {
            _loadDataOfWorkingOntologiesForMapping(pePopup, currentIdx + 1);
          }
        });

      }
     
    };
    String ontologyUri = ontologyInfo.getUri();
    pePopup.appendToTextArea("   Loading : " + ontologyUri + " ... ");
    Orr.log(log_prefix +ontologyUri+ " starting");
    Orr.service.getOntologyContents(registeredOntologyInfo, null, callback);
  }
View Full Code Here

   * Call this to review and register a new version of a registered ontology
   */
  void reviewAndRegisterVersionOntology() {
    Map<String, String> newValues = createOntologyInfo.getMetadataValues();
   
    BaseOntologyInfo ontologyInfo = createOntologyInfo.getBaseOntologyInfo();
   
    assert ontologyInfo instanceof RegisteredOntologyInfo ;
   
   
    // Ok, put the new values in the ontologyInfo object:
    ontologyInfo.getOntologyMetadata().setNewValues(newValues);
   
   
    createOntologyInfo.setUri(ontologyInfo.getUri());

    Orr.log(CLASS_NAME+": reviewAndRegisterVersionOntology starting.  HostingType: " +createOntologyInfo.getHostingType());
   
    final MyDialog popup = new MyDialog(null);
    popup.addTextArea(null).setSize("600", "150");
View Full Code Here

    Orr.log("refreshListWorkingUris: " + workingUris.size());
    workingUrisPanel.clear();
    int nn = 0;
    for ( String uri : workingUris ) {
      String code = VineMain.index2code(nn++);
      BaseOntologyInfo ontologyInfo = VineMain.getOntologyInfo(uri);

      String label = ontologyInfo != null ? ontologyInfo.getDisplayLabel() : uri;
      label = label.replaceAll("&", "&amp;").replaceAll("<", "&lt;");

      workingUrisPanel.add(new HTML("<b>" +code+ "</b>: "
          + "<a target=\"_blank\" href=\"" +uri+ "\">" +uri+ "</a>"
          + " -- <i>" +label+ "</i>"
View Full Code Here

    final Map<String,RegisteredOntologyInfo> suggestions = new HashMap<String,RegisteredOntologyInfo>();
   
    List<BaseOntologyInfo> allUris = VineMain.getAllUris();
   
    for ( int index = 0, count = allUris.size(); index < count; index++ ) {
      BaseOntologyInfo ontologyInfo = allUris.get(index);
      if ( VineMain.containsWorkingUri(ontologyInfo.getUri()) ) {
        // do not add any suggestion for an entry that is already in the workingUris
        continue;
      }
     
      if ( ! (ontologyInfo instanceof RegisteredOntologyInfo)) {
        // only add suggestions for registered ontologies
        continue;
      }
     
      RegisteredOntologyInfo registeredOntologyInfo = (RegisteredOntologyInfo) ontologyInfo;
     
      String lab = ontologyInfo.getDisplayLabel();
      String uri = ontologyInfo.getUri();
     
//      // include a star as a convenience to see the whole list if the user types in a star:
//      String suggestion = "* " +uri+ " : " +lab;
      String suggestion = uri;
     
View Full Code Here

    if (enteredText.length() > 0) {
      if ( VineMain.containsWorkingUri(enteredText) ) {
        // ignore the Enter
        return;
      }
      BaseOntologyInfo ontologyInfo = VineMain.getOntologyInfo(enteredText);
      if (ontologyInfo instanceof RegisteredOntologyInfo) {
        // It is a registered ontology -- load it as a working one:
        RegisteredOntologyInfo roi = (RegisteredOntologyInfo) ontologyInfo;
        mainPanel.notifyWorkingOntologyAdded(OntologySelection.this, roi, popup);
      }
View Full Code Here

   
    for ( int i = 0; i < count; i++ ) {
      if ( ((ToggleButton) buttons.getWidget(i)).isDown() ) {
       
        String uri = VineMain.getWorkingUris().get(i);
        BaseOntologyInfo roi = VineMain.getOntologyInfo(uri);
        if ( roi != null ) {
          selectedUris.add(roi);
        }
        else {
          String code = VineMain.index2code(i);
View Full Code Here

      String id = VineMain.index2code(idx);
      final ToggleButton sel = new ToggleButton("" +id);
      DOM.setElementAttribute(sel.getElement(), "id", "my-button-id");
      buttons.add(sel);
     
      BaseOntologyInfo s = VineMain.getOntologyInfo(uri);
      if ( s != null ) {
        sel.setTitle(s.getDisplayLabel());
        sel.addClickListener(new ClickListener() {
          public void onClick(Widget sender) {
            // TODO update some variable indicating the selected ontologies for search
          }
        });
View Full Code Here

  void createNewFromFile(CreateOntologyInfo createOntologyInfo) {
    createNewBase();
   
    OtherOntologyData otherOntologyData = null;
   
    BaseOntologyInfo baseOntologyInfo = createOntologyInfo != null ? createOntologyInfo.getBaseOntologyInfo() : null;
    if ( baseOntologyInfo instanceof TempOntologyInfo ) {
      // TODO check actual type of ontology data? It should be OtherOntologyData in this case.
      otherOntologyData = (OtherOntologyData) baseOntologyInfo.getOntologyData();
    }
    else {
      // create (empty) data for the ontologyInfo
      otherOntologyData = new OtherOntologyData();
    }
View Full Code Here


 
 
  public void editNewVersion(OntologyPanel ontologyPanel) {
    BaseOntologyInfo ontologyInfo = ontologyPanel.getOntologyInfo();
   
    if ( ontologyInfo instanceof RegisteredOntologyInfo ) {
      // this should be the normal case.
     
      RegisteredOntologyInfo roi = (RegisteredOntologyInfo) ontologyInfo;
View Full Code Here

TOP

Related Classes of org.mmisw.orrclient.gwt.client.rpc.BaseOntologyInfo

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.