@Override
 protected void onReset() {
   super.onReset();
   PlaceRequest currentPlace = placeManager.getCurrentPlaceRequest();
   if (phenotype != null) {
     getView().showPhenotypeInfo(phenotype);
     if (currentPlace.getParameterNames().size() == 1) {
       phenotypeOverviewPresenter.setData(phenotype, mRNAHistogramDataTable, bsHistogramDataTable);
       setInSlot(TYPE_SetMainContent, phenotypeOverviewPresenter);
       getView().setActiveLink(NAV_ITEMS.Overview, SUB_NAV_ITEMS.mRNA);
     } else {
       Dataset dataset =
           phenotype.getDatasetFromName(
               Dataset.TYPE.valueOf(currentPlace.getParameter("dataset", "")));
       String env = currentPlace.getParameter("env", "");
       if (env.equals("GxE")) {
         gxeDetailPresenter.setData(phenotype, dataset);
         setInSlot(TYPE_SetMainContent, gxeDetailPresenter);
       } else {
         phenotypeDetailPresenter.setData(
             phenotype,
             dataset.getEnvironmentFromName(env),
             getSingleHistogramDataTable(env, dataset.getType()));
         setInSlot(TYPE_SetMainContent, phenotypeDetailPresenter);
       }
       getView().setActiveLink(NAV_ITEMS.valueOf(env), SUB_NAV_ITEMS.mRNA);
     }
   }
 }
  @Override
  public void prepareFromRequest(PlaceRequest request) {
    super.prepareFromRequest(request);
    PlaceRequest currentPlace = placeManager.getCurrentPlaceRequest();
    String phenotype_id = currentPlace.getParameter("id", "");
    if (phenotype_id.equals("")) getProxy().manualReveal(PhenotypePresenter.this);
    else {
      dispatch.execute(
          new GetPhenotypeDataAction(phenotype_id, phenotypeReader),
          new CustomCallback<GetPhenotypeDataActionResult>(getEventBus()) {

            @Override
            public void onSuccess(GetPhenotypeDataActionResult result) {
              PhenotypePresenter.this.phenotype = result.getPhenotype();
              PhenotypePresenter.this.mRNAHistogramDataTable = result.getmRNAHistogramDataTable();
              PhenotypePresenter.this.bsHistogramDataTable = result.getBsHistogramDataTable();
              getProxy().manualReveal(PhenotypePresenter.this);
            }

            @Override
            public void onFailure(Throwable caught) {
              getProxy().manualReveal(PhenotypePresenter.this);
              super.onFailure(caught);
              // getProxy().manualRevealFailed();
            }
          });
    }
  }
Beispiel #3
0
  @Override
  public void prepareFromRequest(PlaceRequest request) {

    String dpl = request.getParameter("dpl", null);
    if (dpl != null) {
      this.selectedUnit = new String[] {dpl, request.getParameter("unit", null)};
    } else {
      this.selectedUnit = null;
    }
  }
Beispiel #4
0
  @Override
  public void prepareFromRequest(PlaceRequest request) {
    super.prepareFromRequest(request);
    chart.setParent(this);
    chartType = request.getParameter("chartType", "");
    storeId = request.getParameter("storeId", "");
    storeName = request.getParameter("storeName", "");
    timePeriod = request.getParameter("timePeriod", "");
    year = request.getParameter("year", "");
    month = request.getParameter("month", "");
    day = request.getParameter("day", "");
    category = request.getParameter("category", "");
    cdDvdName = request.getParameter("cdDvdName", "");

    setLabels();

    HashMap<String, String> options = new HashMap<String, String>();
    options.put("branchId", storeId);
    options.put("year", year);
    options.put("month", month);
    options.put("day", day);
    options.put("category", category);
    options.put("cdDvdName", cdDvdName);
    setData(options);
  }
 /**
  * @function onhideBtnClicked
  * @created_date : 11-Dec-2013
  * @description
  * @parm(s) : @param clickEvent
  * @return : void
  * @throws : <Mentioned if any exceptions>
  */
 @UiHandler("hideButton")
 public void onhideBtnClicked(ClickEvent clickEvent) {
   PlaceRequest collectionRequest = AppClientFactory.getPlaceManager().getCurrentPlaceRequest();
   String collectionId = collectionRequest.getParameter("id", null);
   String collectionItemId = collectionRequest.getParameter("rid", null);
   String chkViewParam = collectionRequest.getParameter("view", null);
   if (AppClientFactory.getCurrentPlaceToken().contains(PlaceTokens.RESOURCE_PLAY)) {
     PlaceRequest request = new PlaceRequest(PlaceTokens.RESOURCE_PLAY).with("id", collectionId);
     AppClientFactory.getPlaceManager().revealPlace(false, request, true);
   } else if (AppClientFactory.getCurrentPlaceToken().contains(PlaceTokens.COLLECTION_PLAY)
       && chkViewParam == null
       && collectionItemId != null) {
     PlaceRequest request =
         new PlaceRequest(PlaceTokens.COLLECTION_PLAY)
             .with("id", collectionId)
             .with("rid", collectionItemId);
     AppClientFactory.getPlaceManager().revealPlace(false, request, true);
   } else if (AppClientFactory.getCurrentPlaceToken().contains(PlaceTokens.PREVIEW_PLAY)
       && chkViewParam == null
       && collectionItemId != null) {
     PlaceRequest request =
         new PlaceRequest(PlaceTokens.PREVIEW_PLAY)
             .with("id", collectionId)
             .with("rid", collectionItemId);
     AppClientFactory.getPlaceManager().revealPlace(false, request, true);
   } else if (AppClientFactory.getCurrentPlaceToken().contains(PlaceTokens.COLLECTION_PLAY)
       && chkViewParam == null
       && collectionItemId == null) {
     PlaceRequest request = new PlaceRequest(PlaceTokens.COLLECTION_PLAY).with("id", collectionId);
     AppClientFactory.getPlaceManager().revealPlace(false, request, true);
   } else if (AppClientFactory.getCurrentPlaceToken().contains(PlaceTokens.PREVIEW_PLAY)
       && chkViewParam == null
       && collectionItemId == null) {
     PlaceRequest request = new PlaceRequest(PlaceTokens.PREVIEW_PLAY).with("id", collectionId);
     AppClientFactory.getPlaceManager().revealPlace(false, request, true);
   } else if (AppClientFactory.getCurrentPlaceToken().contains(PlaceTokens.COLLECTION_PLAY)
       && chkViewParam.equalsIgnoreCase("end")) {
     PlaceRequest request =
         new PlaceRequest(PlaceTokens.COLLECTION_PLAY)
             .with("id", collectionId)
             .with("view", "end");
     AppClientFactory.getPlaceManager().revealPlace(false, request, true);
   } else if (AppClientFactory.getCurrentPlaceToken().contains(PlaceTokens.PREVIEW_PLAY)
       && chkViewParam.equalsIgnoreCase("end")) {
     PlaceRequest request =
         new PlaceRequest(PlaceTokens.PREVIEW_PLAY).with("id", collectionId).with("view", "end");
     AppClientFactory.getPlaceManager().revealPlace(false, request, true);
   }
 }
  @Override
  public void prepareFromRequest(PlaceRequest request) {

    String action = request.getParameter("action", null);

    if ("new".equals(action)) {
      launchNewConfigDialoge();
    }
  }
  @Override
  public void execute() {
    String initialToken = History.getToken();
    if (!initialToken.isEmpty() && !isBlackListed(initialToken)) {
      List<PlaceRequest> hierarchy = formatter.toPlaceRequestHierarchy(initialToken);
      final PlaceRequest placeRequest = hierarchy.get(hierarchy.size() - 1);

      Scheduler.get()
          .scheduleDeferred(
              new Scheduler.ScheduledCommand() {
                @Override
                public void execute() {
                  placeManager.revealPlace(placeRequest, true);
                }
              });
      bootstrapContext.setInitialPlace(placeRequest.getNameToken());
    } else {
      placeManager.revealDefaultPlace();
    }
  }
  @Override
  protected void onReveal() {
    super.onReveal();

    PlaceRequest currentPlaceRequest = placeManager.getCurrentPlaceRequest();
    if (!hasBeenRevealed
        && NameTokens.ServerGroupMgmtPresenter.equals(currentPlaceRequest.getNameToken())) {
      hasBeenRevealed = true;

      // update LHS
      serverGroupStore.loadServerGroups(
          new SimpleCallback<List<ServerGroupRecord>>() {
            @Override
            public void onSuccess(List<ServerGroupRecord> result) {
              getView().updateServerGroups(result);
            }
          });

      // forward default to ServerGroupPresenter, this presenter doesn't have a default view
      placeManager.revealRelativePlace(new PlaceRequest(NameTokens.ServerGroupPresenter));
    }
  }
  @Override
  public void prepareFromRequest(PlaceRequest request) {
    String taskIdStr = request.getParameter("taskId", "0l");

    //		long taskId = new Long(taskIdStr);
    //		dispatcher.execute(new GetTask(AppContext.getUserId(), taskId), new
    // TaskServiceCallback<GetTaskResult>() {
    //			@Override
    //			public void processResult(GetTaskResult result) {
    //				setTask(result.getTask());
    //			}
    //		});

  }
 /** @param previousRequestUrl the previousRequestUrl to set */
 public void setPreviousRequestUrl(PlaceRequest previousRequestUrl) {
   String viewToken = previousRequestUrl.getNameToken();
   if (viewToken.equals(PlaceTokens.PREVIEW_PLAY)
       || viewToken.equals(PlaceTokens.COLLECTION_PLAY)
       || viewToken.equals(PlaceTokens.RESOURCE_PLAY)
       || viewToken.equals(PlaceTokens.COLLECTION)) {
     String previousViewToken =
         this.previousRequestUrl != null ? this.previousRequestUrl.getNameToken() : "";
     if (!previousViewToken.equals(PlaceTokens.PREVIEW_PLAY)
         && !previousViewToken.equals(PlaceTokens.COLLECTION_PLAY)
         && !previousViewToken.equals(PlaceTokens.RESOURCE_PLAY)) {
       setPreviousPlayerRequestUrl(getPreviousRequestUrl());
     }
     this.previousRequestUrl = previousRequestUrl;
   } else {
     this.previousRequestUrl = previousRequestUrl;
   }
 }
 @Override
 public void updateHistory(PlaceRequest request, boolean updateBrowserUrl) {
   try {
     // Make sure the request match
     assert request.hasSameNameToken(getCurrentPlaceRequest())
         : "Internal error, PlaceRequest passed to updateHistory doesn't match the tail of the place hierarchy.";
     placeHierarchy.set(placeHierarchy.size() - 1, request);
     if (updateBrowserUrl) {
       String historyToken = tokenFormatter.toHistoryToken(placeHierarchy);
       String browserHistoryToken = getBrowserHistoryToken();
       if (browserHistoryToken == null || !browserHistoryToken.equals(historyToken)) {
         setBrowserHistoryToken(historyToken, false);
       }
       saveHistoryToken(historyToken);
     }
   } catch (TokenFormatException e) {
     // Do nothing.
   }
 }
 */ @Override
 public void setBackToSearch() {
   boolean visible = false;
   searchRequest = AppClientFactory.getPlaceManager().getPreviousRequest();
   if (searchRequest != null) {
     String query = searchRequest.getParameter("query", null);
     visible = searchRequest != null && query != null;
     backToSearchFloPanel.getElement().getStyle().setDisplay(Display.BLOCK);
     if (visible) {
       if (query.length() > 50) {
         query = query.substring(0, 50) + "...";
         backToSearchHtml.setHTML(PRE_SEARCH_LINK + query + "\"");
       } else {
         backToSearchHtml.setHTML(PRE_SEARCH_LINK + query + "\"");
       }
     }
   }
   backToSearchPreHtml.setVisible(visible);
   backToSearchHtml.setVisible(visible);
 }
Beispiel #13
0
  private void initTree() {
    String section_key = "section";
    String subsection_key = "subsection";
    TreeItem root = new TreeItem("Help");
    PlaceRequest rootPlace = new PlaceRequest(NameTokens.helpPage);

    tree.addItem(
            new Hyperlink(
                "Introduction",
                placeManager.buildHistoryToken(rootPlace.with(section_key, "introduction"))))
        .setUserObject("introduction");

    // Phenotypes
    TreeItem phenotypes_item =
        new TreeItem(
            new Hyperlink(
                "Phenotypes",
                placeManager.buildHistoryToken(rootPlace.with(section_key, "phenotypes"))));
    phenotypes_item.setUserObject("phenotypes");
    phenotypes_item
        .addItem(
            new Hyperlink(
                "Uploading Phenotypes",
                placeManager.buildHistoryToken(
                    rootPlace.with(section_key, "phenotypes").with(subsection_key, "upload"))))
        .setUserObject("phenotypes_upload");
    phenotypes_item
        .addItem(
            new Hyperlink(
                "Phenotype Format",
                placeManager.buildHistoryToken(
                    rootPlace.with(section_key, "phenotypes").with(subsection_key, "format"))))
        .setUserObject("phenotypes_format");
    tree.addItem(phenotypes_item);

    // Accessions
    TreeItem accession_item =
        new TreeItem(
            new Hyperlink(
                "Accessions",
                placeManager.buildHistoryToken(rootPlace.with(section_key, "accessions"))));
    accession_item.setUserObject("accessions");
    tree.addItem(accession_item);

    // Analysis
    TreeItem analysis_item =
        new TreeItem(
            new Hyperlink(
                "Analysis",
                placeManager.buildHistoryToken(rootPlace.with(section_key, "analysis"))));
    analysis_item.setUserObject("analysis");
    analysis_item
        .addItem(
            new Hyperlink(
                "Navigation",
                placeManager.buildHistoryToken(
                    rootPlace.with(section_key, "analysis").with(subsection_key, "navigation"))))
        .setUserObject("analysis_navigation");
    analysis_item
        .addItem(
            new Hyperlink(
                "Phenotypes",
                placeManager.buildHistoryToken(
                    rootPlace.with(section_key, "analysis").with(subsection_key, "phenotypes"))))
        .setUserObject("analysis_phenotypes");
    analysis_item
        .addItem(
            new Hyperlink(
                "Datasets",
                placeManager.buildHistoryToken(
                    rootPlace.with(section_key, "analysis").with(subsection_key, "datasets"))))
        .setUserObject("analysis_datasets");
    analysis_item
        .addItem(
            new Hyperlink(
                "Transformations",
                placeManager.buildHistoryToken(
                    rootPlace
                        .with(section_key, "analysis")
                        .with(subsection_key, "transformations"))))
        .setUserObject("analysis_transformations");
    analysis_item
        .addItem(
            new Hyperlink(
                "Results",
                placeManager.buildHistoryToken(
                    rootPlace.with(section_key, "analysis").with(subsection_key, "results"))))
        .setUserObject("analysis_results");
    tree.addItem(analysis_item);

    // Tutorial
    /*TreeItem tutorial_item = new TreeItem(new Hyperlink("Tutorial",placeManager.buildHistoryToken(rootPlace.with(section_key, "tutorial"))));
    tutorial_item.setUserObject("tutorial");
    tutorial_item.addItem(new Hyperlink("1.) Uploading Phenotypes",placeManager.buildHistoryToken(rootPlace.with(section_key, "tutorial").with(subsection_key, "uploading")))).setUserObject("tutorial_uploading");
    tutorial_item.addItem(new Hyperlink("2.) Creating subset",placeManager.buildHistoryToken(rootPlace.with(section_key, "tutorial").with(subsection_key, "subset")))).setUserObject("tutorial_subset");
    tutorial_item.addItem(new Hyperlink("3.) Changing transformation",placeManager.buildHistoryToken(rootPlace.with(section_key, "tutorial").with(subsection_key, "transformation")))).setUserObject("tutorial_transformation");
    tutorial_item.addItem(new Hyperlink("4.) Running GWAS",placeManager.buildHistoryToken(rootPlace.with(section_key, "tutorial").with(subsection_key, "gwas")))).setUserObject("tutorial_gwas");
    tutorial_item.addItem(new Hyperlink("5.) Viewing Results",placeManager.buildHistoryToken(rootPlace.with(section_key, "tutorial").with(subsection_key, "results")))).setUserObject("tutorial_results");
    tutorial_item.addItem(new Hyperlink("6.) Running Step-Wise GWAS",placeManager.buildHistoryToken(rootPlace.with(section_key, "tutorial").with(subsection_key, "gwas_step")))).setUserObject("tutorial_gwas_step");
    tree.addItem(tutorial_item);*/
    Iterator<TreeItem> iterator = tree.treeItemIterator();
    while (iterator.hasNext()) {
      iterator.next().setState(true, false);
    }
  }
 @Override
 public void prepareFromRequest(final PlaceRequest request) {
   super.prepareFromRequest(request);
   fake = Boolean.valueOf(request.getParameter("fake", "false"));
   hostIndex = Integer.parseInt(request.getParameter("hostIndex", "0"));
 }