boolean isItemVisible(ItemWrapper item) {
    ItemDefinition def = item.getItemDefinition();
    if (def.isIgnored() || def.isOperational()) {
      return false;
    }

    if (def instanceof PrismPropertyDefinition && skipProperty((PrismPropertyDefinition) def)) {
      return false;
    }

    // we decide not according to status of this container, but according to
    // the status of the whole object
    if (objectWrapper.getStatus() == ContainerStatus.ADDING) {
      return def.canAdd();
    }

    // otherwise, object.getStatus() is MODIFYING

    if (def.canModify()) {
      return showEmpty(item);
    } else {
      if (def.canRead()) {
        return showEmpty(item);
      }
      return false;
    }
  }
Esempio n. 2
0
  private boolean hasEmptyPlaceholder(ItemWrapper property) {
    for (ValueWrapper value : property.getValues()) {
      value.normalize(property.getItemDefinition().getPrismContext());
      if (ValueStatus.ADDED.equals(value.getStatus()) && !value.hasValueChanged()) {
        return true;
      }
    }

    return false;
  }
Esempio n. 3
0
 private int countNonDeletedValues(ItemWrapper property) {
   int count = 0;
   for (ValueWrapper value : property.getValues()) {
     value.normalize(property.getItemDefinition().getPrismContext());
     if (ValueStatus.DELETED.equals(value.getStatus())) {
       continue;
     }
     count++;
   }
   return count;
 }
Esempio n. 4
0
  private List<ValueWrapper> getUsableValues(ItemWrapper property) {
    List<ValueWrapper> values = new ArrayList<>();
    for (ValueWrapper value : property.getValues()) {
      value.normalize(property.getItemDefinition().getPrismContext());
      if (ValueStatus.DELETED.equals(value.getStatus())) {
        continue;
      }
      values.add(value);
    }

    return values;
  }
Esempio n. 5
0
  private int countUsableValues(ItemWrapper property) {
    int count = 0;
    for (ValueWrapper value : property.getValues()) {
      value.normalize(property.getItemDefinition().getPrismContext());

      if (ValueStatus.DELETED.equals(value.getStatus())) {
        continue;
      }

      if (ValueStatus.ADDED.equals(value.getStatus()) && !value.hasValueChanged()) {
        continue;
      }

      count++;
    }
    return count;
  }