コード例 #1
0
  public String getLabel() {
    SecondaryFacet sf = (SecondaryFacet) getFacet();
    ArrayList<Facet> seconds = sf.getSeconds();
    String label = "";
    for (int i = 0; i < seconds.size(); i++) {
      Facet f = seconds.get(i);
      if (f.getType().getClass() == ProvenanceFacetType.class) {
        ProvenanceFacet pf = (ProvenanceFacet) f;
        if (pf.getValue() > 0 && pf.getCurrentCriterion() != null) {
          label = pf.getCurrentCriterion().getLabel();
        }
      } else if (f.getType().getClass() == PersonFacetType.class) {
        PersonFacet pf = (PersonFacet) f;

        if (pf.getValue() > 0) {
          label = pf.getCurrentCriterion().getLabel();
        }
      } else if (f.getType().getClass() == LanguageFacetType.class) {
        LanguageFacet pf = (LanguageFacet) f;

        if (pf.getValue() > 0) {
          label = pf.getCurrentCriterion().getLabel();
        }
      } else if (f.getType().getClass() == NotationFacetType.class) {
        NotationFacet pf = (NotationFacet) f;

        if (pf.getValue() > 0) {
          label = pf.getCurrentCriterion().getLabel();
        }
      } else if (f.getType().getClass() == SetFacetType.class) {
        SetFacet pf = (SetFacet) f;

        if (pf.getValue() > 0) {
          label = pf.getCurrentCriterion().getLabel();
        }
      } else if (f.getType().getClass() == ClefFacetType.class) {
        ClefFacet pf = (ClefFacet) f;
        if (pf.getValue() > 0) {
          label = pf.getCurrentCriterion().getLabel();
        }
      } else if (f.getType().getClass() == CenturyFacetType.class) {
        CenturyFacet pf = (CenturyFacet) f;
        if (pf.getValue() > 0) {
          label = pf.getValue() + "th";
          if (pf.getCentury2() > 0) {
            label += "-" + pf.getCentury2() + "th";
          }
        }
      }
    }

    return label; // To change body of implemented methods use File | Settings | File Templates.
  }
コード例 #2
0
 protected void addFacetData(HttpServletRequest request) {
   SecondaryFacet sf = (SecondaryFacet) getFacet();
   ArrayList<Facet> seconds = sf.getSeconds();
   if (getGUIstate() == GUIFacetState.OPEN) {
     for (int i = 0; i < seconds.size(); i++) {
       Facet f = seconds.get(i);
       if (f.getType().getClass() == ProvenanceFacetType.class) {
         ProvenanceFacet pf = (ProvenanceFacet) f;
         // request.setAttribute(Constants.provenanceAttrName,
         // getDynamicCriteria(pf.provenanceValues));
         if (pf.getValue() > 0) {
           request.setAttribute(Constants.provenanceAttrSelected, pf.getValue());
           request.setAttribute("alprovenance", pf.getCurrentCriterion().getLabel());
         }
       } else if (f.getType().getClass() == PersonFacetType.class) {
         PersonFacet pf = (PersonFacet) f;
         // request.setAttribute(Constants.personAttrName, getDynamicCriteria(pf.personValues));
         if (pf.getValue() > 0) {
           request.setAttribute(Constants.personAttrSelected, pf.getValue());
           request.setAttribute("person", pf.getCurrentCriterion().getLabel());
         }
       } else if (f.getType().getClass() == LanguageFacetType.class) {
         LanguageFacet pf = (LanguageFacet) f;
         // request.setAttribute(Constants.languageAttrName,
         // getDynamicCriteria(pf.languageValues));
         if (pf.getValue() > 0) {
           request.setAttribute(Constants.languageAttrSelected, pf.getValue());
           request.setAttribute("language", pf.getCurrentCriterion().getLabel());
         }
         /*} else if (f.getType().getClass() == NotationFacetType.class) {
             NotationFacet pf = (NotationFacet) f;
             //request.setAttribute(Constants.notationAttrName, getDynamicCriteria(pf.notationValues));
             if (pf.getValue() > 0) {
                 request.setAttribute(Constants.notationAttrSelected, pf.getValue());
             }
         } else if (f.getType().getClass() == SetFacetType.class) {
             SetFacet pf = (SetFacet) f;
             //request.setAttribute(Constants.setAttrName, getDynamicCriteria(pf.setValues));
             if (pf.getValue() > 0) {
                 request.setAttribute(Constants.setAttrSelected, pf.getValue());
             }*/
       } else if (f.getType().getClass() == ClefFacetType.class) {
         ClefFacet pf = (ClefFacet) f;
         // request.setAttribute(Constants.clefAttrName, getDynamicCriteria(pf.clefValues));
         if (pf.getValue() > 0) {
           request.setAttribute(Constants.clefAttrSelected, pf.getValue());
           request.setAttribute("clef", pf.getCurrentCriterion().getLabel());
         }
       } else if (f.getType().getClass() == CenturyFacetType.class) {
         CenturyFacet pf = (CenturyFacet) f;
         request.setAttribute("centuries", CenturyFacet.centuries);
         if (pf.getValue() > 0) {
           request.setAttribute(Constants.century1AttrSelected, pf.getValue());
           if (pf.getCentury2() > 0) {
             request.setAttribute(Constants.century2AttrSelected, pf.getCentury2());
           }
         }
       }
     }
   }
   // Label
   if (getLabel().length() > 0) {
     request.setAttribute("secondaryLabel", getLabel());
   }
 }