Package edu.hawaii.ics.csdl.jupiter.file.property

Examples of edu.hawaii.ics.csdl.jupiter.file.property.Phase


    for (Entry<String, FilterPhase> mapEntry : phaseNameFilterPhaseMap.entrySet()) {
      String phaseName = mapEntry.getKey();
      String phaseNameKey = ReviewI18n.getKey(phaseName);
      FilterPhase filterPhase = mapEntry.getValue();
     
      Phase jaxbPhase = getJAXBPhase(phaseNameKey);
      jaxbPhase.setEnabled(filterPhase.isEnabled());
     
      List<Filter> filterList = jaxbPhase.getFilter();
      // clear out any existing filters
      filterList.clear();
     
      for (Iterator<FilterEntry> j = filterPhase.iterator(); j.hasNext();) {
        FilterEntry filterEntry = j.next();
View Full Code Here


   *
   * @param phaseNameKey the phase name key.
   * @return the <code>FilterPhase</code> instance.
   */
  public FilterPhase getFilterPhase(String phaseNameKey) {
    Phase jaxbPhase = getJAXBPhase(phaseNameKey);

    List<FilterEntry> filterEntryList = new ArrayList<FilterEntry>();
    if (jaxbPhase != null) {
      List<Filter> filterList = jaxbPhase.getFilter();
      for (Filter filter : filterList) {
        String filterName = filter.getName();
        String valueKey = filter.getValue();
        Boolean enabled = filter.isEnabled();

        FilterEntry entry = new FilterEntry(filterName, valueKey, enabled);
        filterEntryList.add(entry);
      }
    }

    return new FilterPhase(phaseNameKey, jaxbPhase.isEnabled(), filterEntryList);
  }
View Full Code Here

   * @param phaseNameKey The key of the phase to use when searching for the JAXB <code>Phase</code>.
   * @return Returns the JAXB phase associated with the given phase name key.
   */
  private Phase getJAXBPhase(String phaseNameKey) {
    List<Phase> phaseList = this.review.getFilters().getPhase();
    Phase jaxbPhase = null;
    // find phase matching the phase name key
    for (Phase phase : phaseList) {
      if (phase.getName().equals(phaseNameKey)) {
        jaxbPhase = phase;
        break;
View Full Code Here

    }
   
    String name = reader.getAttributeValue(null, PropertyConstraints.ATTRIBUTE_NAME);
    String enabled = reader.getAttributeValue(null, PropertyConstraints.ATTRIBUTE_ENABLED);

    Phase phase = new Phase();
    phase.setName(name);
    phase.setEnabled(Boolean.valueOf(enabled));

    boolean endFound = false;

    // parse out all the Filter elements under the Phase
    while (!endFound) {
      if (reader.hasNext()) {
        int eventType = reader.next();

        if (eventType == XMLStreamConstants.START_ELEMENT) {
          QName elementQName = reader.getName();
          String elementName = elementQName.toString();

          if (PropertyConstraints.ELEMENT_FILTER.equals(elementName)) {
            name = reader.getAttributeValue(null, PropertyConstraints.ATTRIBUTE_NAME);
            String value = reader.getAttributeValue(null, PropertyConstraints.ATTRIBUTE_VALUE);
            enabled = reader.getAttributeValue(null, PropertyConstraints.ATTRIBUTE_ENABLED);

            Filter filter = new Filter();
            filter.setName(name);
            filter.setValue(value);
            filter.setEnabled(Boolean.valueOf(enabled));

            phase.getFilter().add(filter);
          }
        }
        else if (eventType == XMLStreamConstants.END_ELEMENT) {
          QName elementQName = reader.getName();
View Full Code Here

    if (filters != null) {
      Filters copiedFilters = new Filters();

      List<Phase> phaseList = filters.getPhase();
      for (Phase phase : phaseList) {
        Phase copiedPhase = new Phase();
        copiedPhase.setName(phase.getName());
        copiedPhase.setEnabled(phase.isEnabled());

        // filter objects
        List<Filter> filterList = phase.getFilter();
        for (Filter filter : filterList) {
          Filter copiedFilter = new Filter();
          copiedFilter.setName(filter.getName());
          copiedFilter.setValue(filter.getValue());
          copiedFilter.setEnabled(filter.isEnabled());
          copiedPhase.getFilter().add(copiedFilter);
        }
        copiedFilters.getPhase().add(copiedPhase);
      }
      copiedReview.setFilters(copiedFilters);
    }
View Full Code Here

TOP

Related Classes of edu.hawaii.ics.csdl.jupiter.file.property.Phase

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.