private AssessmentData doCreateAssessmentForBatch(
      String user, AssessmentFilter filter, boolean useTemplate, TaxonNode taxon) {
    AssessmentFilter draftFilter = filter.deepCopy();
    draftFilter.setDraft(false);
    draftFilter.setRecentPublished(true);
    draftFilter.setAllPublished(false);

    AssessmentFilterHelper helper = new AssessmentFilterHelper(draftFilter);

    AssessmentData curAss = null;

    if (useTemplate) {
      List<AssessmentData> assessments = helper.getAssessments(taxon.getId() + "", vfs);
      if (assessments.size() == 0) {
        draftFilter.getRegions().clear();
        draftFilter.getRegions().add(AssessmentData.GLOBAL_ID);
        assessments = helper.getAssessments(taxon.getId() + "", vfs);
      }

      if (assessments.size() == 0) {
        System.out.println("No template exists for species " + taxon.getFullName());
        curAss = new AssessmentData(); // No template exists...
      } else {
        curAss = assessments.get(0).deepCopy();
      }
    } else curAss = new AssessmentData();

    curAss.setRegionIDs(filter.getRegions());
    if (!filter.getRegions().contains("-1")) curAss.setEndemic(false);
    curAss.setType(AssessmentData.DRAFT_ASSESSMENT_STATUS);
    curAss.setAssessmentID("new");
    curAss.setSpeciesID(taxon.getId() + "");
    curAss.setSpeciesName(taxon.getFullName());
    return curAss;
  }
Exemplo n.º 2
0
  public void load() {

    currentNode = TaxonomyCache.impl.getCurrentNode();

    BorderLayout layout = new BorderLayout();
    // layout.setMargin(5);
    // layout.setSpacing(5);

    LayoutContainer full = new LayoutContainer();
    full.setLayout(layout);
    full.setLayoutOnChange(true);

    TaxonomyBrowserPanel tp = getTaxonomyBrowserPanel();

    if (currentNode != null) {
      tp.update(currentNode.getId() + "");
    } else {
      tp.update();
    }

    int size = PANEL_WIDTH / 2;

    LayoutContainer left = new LayoutContainer();
    left.setLayout(new FillLayout());
    left.setSize(size, PANEL_HEIGHT);
    left.add(tp);

    full.add(
        new HTML("<b> Instructions:</b> " + getDescription()),
        new BorderLayoutData(LayoutRegion.NORTH, HEADER_HEIGHT));
    full.add(left, new BorderLayoutData(LayoutRegion.WEST, size));
    full.add(getRightSide(), new BorderLayoutData(LayoutRegion.CENTER, size));

    full.setSize(PANEL_WIDTH, PANEL_HEIGHT);

    add(full);
  }
Exemplo n.º 3
0
 public void addItem(String[] footPrint, TaxonNode node) {
   if (validate(footPrint, node)) {
     DataListItem li = new DataListItem(node.getFullName());
     selected.add(li);
   }
 }