Package buri.ddmsence.samples.util

Examples of buri.ddmsence.samples.util.Distribution.incrementCount()


    Distribution distribution = new Distribution();
    for (Resource resource : getResources()) {
      // Check any records that have a format (mimeType is required if format is present)
      if (resource.getFormat() != null) {
        String mimeType = resource.getFormat().getMimeType();
        distribution.incrementCount(mimeType);
      }
    }
    return (buildPieGraphURL("DDMS%20MimeType%20Distribution", distribution, PIE_GRAPH_3D));
  }
View Full Code Here


          // Record the counts for each keyword's usage
          for (Keyword keyword : keywords) {
            // Split multiword keywords.
            String[] splitValues = keyword.getValue().split(" ");
            for (int i = 0; i < splitValues.length; i++) {
              distribution.incrementCount(splitValues[i]);
            }
          }
        }
      }
    }
View Full Code Here

      // Examine the ddms:dates element (optional field with optional attributes)
      // Ignores ddms:DateHourMinType dates, which were introduced in DDMS 4.1, to simplify example
      Dates dates = resource.getDates();
      if (dates != null) {
        if (dates.getCreated() != null)
          distribution.incrementCount(String.valueOf(dates.getCreated().getYear()));
        if (dates.getPosted() != null)
          distribution.incrementCount(String.valueOf(dates.getPosted().getYear()));
        if (dates.getValidTil() != null)
          distribution.incrementCount(String.valueOf(dates.getValidTil().getYear()));
        if (dates.getInfoCutOff() != null)
View Full Code Here

      Dates dates = resource.getDates();
      if (dates != null) {
        if (dates.getCreated() != null)
          distribution.incrementCount(String.valueOf(dates.getCreated().getYear()));
        if (dates.getPosted() != null)
          distribution.incrementCount(String.valueOf(dates.getPosted().getYear()));
        if (dates.getValidTil() != null)
          distribution.incrementCount(String.valueOf(dates.getValidTil().getYear()));
        if (dates.getInfoCutOff() != null)
          distribution.incrementCount(String.valueOf(dates.getInfoCutOff().getYear()));
        if (dates.getApprovedOn() != null)
View Full Code Here

        if (dates.getCreated() != null)
          distribution.incrementCount(String.valueOf(dates.getCreated().getYear()));
        if (dates.getPosted() != null)
          distribution.incrementCount(String.valueOf(dates.getPosted().getYear()));
        if (dates.getValidTil() != null)
          distribution.incrementCount(String.valueOf(dates.getValidTil().getYear()));
        if (dates.getInfoCutOff() != null)
          distribution.incrementCount(String.valueOf(dates.getInfoCutOff().getYear()));
        if (dates.getApprovedOn() != null)
          distribution.incrementCount(String.valueOf(dates.getApprovedOn().getYear()));
        if (dates.getReceivedOn() != null)
View Full Code Here

        if (dates.getPosted() != null)
          distribution.incrementCount(String.valueOf(dates.getPosted().getYear()));
        if (dates.getValidTil() != null)
          distribution.incrementCount(String.valueOf(dates.getValidTil().getYear()));
        if (dates.getInfoCutOff() != null)
          distribution.incrementCount(String.valueOf(dates.getInfoCutOff().getYear()));
        if (dates.getApprovedOn() != null)
          distribution.incrementCount(String.valueOf(dates.getApprovedOn().getYear()));
        if (dates.getReceivedOn() != null)
          distribution.incrementCount(String.valueOf(dates.getReceivedOn().getYear()));
      }
View Full Code Here

        if (dates.getValidTil() != null)
          distribution.incrementCount(String.valueOf(dates.getValidTil().getYear()));
        if (dates.getInfoCutOff() != null)
          distribution.incrementCount(String.valueOf(dates.getInfoCutOff().getYear()));
        if (dates.getApprovedOn() != null)
          distribution.incrementCount(String.valueOf(dates.getApprovedOn().getYear()));
        if (dates.getReceivedOn() != null)
          distribution.incrementCount(String.valueOf(dates.getReceivedOn().getYear()));
      }

      // Resource createDate (required field in 3.0, 4.0.1, and 4.1, optional in 2.0)
View Full Code Here

        if (dates.getInfoCutOff() != null)
          distribution.incrementCount(String.valueOf(dates.getInfoCutOff().getYear()));
        if (dates.getApprovedOn() != null)
          distribution.incrementCount(String.valueOf(dates.getApprovedOn().getYear()));
        if (dates.getReceivedOn() != null)
          distribution.incrementCount(String.valueOf(dates.getReceivedOn().getYear()));
      }

      // Resource createDate (required field in 3.0, 4.0.1, and 4.1, optional in 2.0)
      if (resource.getCreateDate() != null)
        distribution.incrementCount(String.valueOf(resource.getCreateDate().getYear()));
View Full Code Here

          distribution.incrementCount(String.valueOf(dates.getReceivedOn().getYear()));
      }

      // Resource createDate (required field in 3.0, 4.0.1, and 4.1, optional in 2.0)
      if (resource.getCreateDate() != null)
        distribution.incrementCount(String.valueOf(resource.getCreateDate().getYear()));

      // ddms:temporalCoverage (optional field)
      // getStart() returns the date if present. getStartString() returns the XML format or
      // the two allowed strings, Not Applicable, and Unknown.
      List<TemporalCoverage> timePeriods = resource.getTemporalCoverages();
View Full Code Here

      // getStart() returns the date if present. getStartString() returns the XML format or
      // the two allowed strings, Not Applicable, and Unknown.
      List<TemporalCoverage> timePeriods = resource.getTemporalCoverages();
      for (TemporalCoverage timePeriod : timePeriods) {
        if (timePeriod.getStart() != null)
          distribution.incrementCount(String.valueOf(timePeriod.getStart().getYear()));
        if (timePeriod.getEnd() != null)
          distribution.incrementCount(String.valueOf(timePeriod.getEnd().getYear()));
      }
    }
    return (buildPieGraphURL("DDMS%20Date%20Distribution", distribution, PIE_GRAPH));
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.