Exemplo n.º 1
0
 /** {@inheritDoc} */
 public void removeObject(ObjectData object) {
   storage.children.get(getObjectId()).remove(object.getObjectId());
   storage.parents.get(object.getObjectId()).remove(getObjectId());
   if (storage.parents.get(object.getObjectId()).size() == 0) {
     storage.unfiled.add(object.getObjectId());
   }
   storage.indexListener.updated(object);
 }
Exemplo n.º 2
0
  /** {@inheritDoc} */
  public ItemsIterator<ObjectData> getChildren(String orderBy) {

    Set<String> childrenIds = storage.children.get(getObjectId());
    List<ObjectData> children = new ArrayList<ObjectData>(childrenIds.size());
    for (String ch : childrenIds) {
      ObjectData object = null;
      try {
        object = storage.getObjectById(ch);
      } catch (ObjectNotFoundException e) {
        LOG.warn("Object " + ch + " not found in storage.");
        continue;
      }
      if (object.getBaseType() == BaseType.DOCUMENT && !((DocumentData) object).isLatestVersion()) {
        continue;
      }
      children.add(object);
    }

    return new BaseItemsIterator<ObjectData>(children);
  }
Exemplo n.º 3
0
 /** {@inheritDoc} */
 public void addObject(ObjectData object) throws ConstraintException {
   storage.children.get(getObjectId()).add(object.getObjectId());
   storage.parents.get(object.getObjectId()).add(getObjectId());
   storage.unfiled.remove(object.getObjectId());
   storage.indexListener.updated(object);
 }