Changeset 4849


Ignore:
Timestamp:
Mar 26, 2009, 10:50:52 AM (13 years ago)
Author:
Nicklas Nordborg
Message:

References #1240: Implement "lazy loading" in the generic "item overview"

Disable validation when lazy-loading nodes, since we are not interested in the result.

Location:
branches/2.11-stable
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2.11-stable/src/core/net/sf/basedb/util/overview/validator/BasicItemNodeValidatorFactory.java

    r4764 r4849  
    4848  private final Map<Object, Class<? extends NodeValidator<? extends BasicItem>>> validators;
    4949  private boolean useNullValidator;
     50  private boolean disabled;
    5051 
    5152  /**
     
    5657    validators = new HashMap<Object, Class<? extends NodeValidator<? extends BasicItem>>>();
    5758    this.useNullValidator = true;
     59    this.disabled = false;
    5860    registerDefaultNodeValidators();
    5961  }
     
    6365    ---------------------------------------
    6466  */
     67 
     68 
     69  @Override
     70  public boolean isDisabled()
     71  {
     72    return disabled;
     73  }
     74
     75  @Override
     76  public void setDisabled(boolean disabled)
     77  {
     78    this.disabled = disabled;
     79  }
     80
    6581  /**
    6682    Create a new node validator that can validate nodes with items of
     
    7894  {
    7995    NodeValidator<? extends BasicItem> validator = null;
    80     Class<? extends NodeValidator<? extends BasicItem>> validatorClass = validators.get(key);
     96    Class<? extends NodeValidator<? extends BasicItem>> validatorClass =
     97      disabled ? null : validators.get(key);
    8198    if (validatorClass == null)
    8299    {
    83       if (useNullValidator)
     100      if (useNullValidator || disabled)
    84101      {
    85102        validator = new NullNodeValidator<BasicItem>();
  • branches/2.11-stable/src/core/net/sf/basedb/util/overview/validator/NodeValidatorFactory.java

    r4768 r4849  
    3939
    4040  /**
     41    Disable/enabled node validation programmatically. When a
     42    node validator factory is disabled the {@link #createNodeValidator(Object)}
     43    should return null or a {@link NullNodeValidator} for all
     44    requests.
     45    @param disabled TRUE to disable node validation
     46    @since 2.11
     47  */
     48  public void setDisabled(boolean disabled);
     49 
     50  /**
     51    Check if node validation has been disabled.
     52    @return TRUE if validation has been disabled
     53    @since 2.11
     54  */
     55  public boolean isDisabled();
     56 
     57  /**
    4158    Create a node validator that knows how to validate nodes for items
    4259    that are specified by the given key. The key can be almost anything.
  • branches/2.11-stable/www/common/overview/index.jsp

    r4840 r4849  
    6565        null : Project.getById(dc, sc.getActiveProjectId());
    6666    GenericOverview overview = OverviewUtil.getNewOrCurrentOverview(dc, item, project);
     67    overview.getNodeValidatorFactory().setDisabled(true);
    6768    overview.expand(dc, overview.getRootNode(), false);
    68     overview.updateFailureCountOnNodes();
    6969    dc.close();
    7070    redirect = "frameset.jsp?ID="+ID+"&show_failures="+false;
Note: See TracChangeset for help on using the changeset viewer.