Examples of EntityCollection


Examples of org.exoplatform.services.jcr.impl.util.EntityCollection

   {
      checkValid();

      List<NodeData> versionsDataList = getData().getAllVersionsData();

      EntityCollection versions = new EntityCollection();

      for (NodeData vd : versionsDataList)
      {
         versions.add(new VersionImpl(vd, session));
      }

      return versions;

   }
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.util.EntityCollection

      {

         EventListener listener = eventListeners.nextEventListener();
         ListenerCriteria criteria = observationRegistry.getListenerFilter(listener);

         EntityCollection events = new EntityCollection();

         ChangesLogIterator logIterator = ((CompositeChangesLog)changesLog).getLogIterator();
         while (logIterator.hasNextLog())
         {

            PlainChangesLog subLog = logIterator.nextLog();
            String sessionId = subLog.getSessionId();

            SessionImpl userSession = sessionRegistry.getSession(sessionId);

            if (userSession != null)
               for (ItemState itemState : subLog.getAllStates())
               {
                  if (itemState.isEventFire())
                  {

                     ItemData item = itemState.getData();
                     try
                     {
                        int eventType = eventType(itemState);
                        if (eventType != SKIP_EVENT && isTypeMatch(criteria, eventType)
                           && isPathMatch(criteria, item, userSession) && isIdentifierMatch(criteria, item)
                           && isNodeTypeMatch(criteria, item, userSession, subLog)
                           && isSessionMatch(criteria, sessionId))
                        {

                           String path =
                              userSession.getLocationFactory().createJCRPath(item.getQPath()).getAsString(false);

                           events.add(new EventImpl(eventType, path, userSession.getUserID()));
                        }
                     }
                     catch (RepositoryException e)
                     {
                        log.error("Can not fire ActionLauncher.onSaveItems() for " + item.getQPath().getAsString()
                           + " reason: " + e);
                     }
                  }
               }
         }
         if (events.getSize() > 0)
         {
            // TCK says, no events - no onEvent() action
            listener.onEvent(events);
         }
      }
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.util.EntityCollection

                  NodeImpl item = (NodeImpl)dataManager.readItem(child, nodeData(), true, false);
                  session.getActionHandler().postRead(item);
                  nodes.add(item);
               }
            }
            return new EntityCollection(nodes);
         }
         else
         {
            // lazy iterator
            return new LazyNodeIterator(childs);
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.util.EntityCollection

                  NodeImpl item = (NodeImpl)dataManager.readItem(child, nodeData(), true, false);
                  session.getActionHandler().postRead(item);
                  nodes.add(item);
               }
            }
            return new EntityCollection(nodes);
         }
         else
         {
            // lazy iterator
            return new LazyNodeIterator(childs, filter);
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.util.EntityCollection

                  PropertyImpl item = (PropertyImpl)dataManager.readItem(child, nodeData(), true, false);
                  session.getActionHandler().postRead(item);
                  props.add(item);

               }
               return new EntityCollection(props);
            }
            else
            {
               // lazy iterator
               return new LazyPropertyIterator(childs);
            }
         }
         else
         {
            // return empty
            return new EntityCollection();
         }
      }
      finally
      {
         if (LOG.isDebugEnabled())
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.util.EntityCollection

                     session.getActionHandler().postRead(item);
                     props.add(item);
                  }

               }
               return new EntityCollection(props);
            }
            else
            {
               // lazy iterator
               return new LazyPropertyIterator(childs, filter);
            }
         }
         else
         {
            // return empty
            return new EntityCollection();
         }
      }
      finally
      {
         if (LOG.isDebugEnabled())
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.util.EntityCollection

   public PropertyIterator getReferences() throws RepositoryException
   {

      checkValid();

      return new EntityCollection(dataManager.getReferences(getInternalIdentifier()));
   }
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.util.EntityCollection

      ItemDataMergeVisitor visitor = new ItemDataMergeVisitor(this.session, corrSession, failed, bestEffort);
      this.nodeData().accept(visitor);

      SessionChangesLog changes = visitor.getMergeChanges();

      EntityCollection failedIter = createMergeFailed(failed, changes);

      if (changes.getSize() > 0)
      {
         dataManager.getTransactManager().save(changes);
      }
View Full Code Here

Examples of org.geomajas.layer.entity.EntityCollection

          }
          return manyToOne;
        case ONE_TO_MANY:
          OneToManyAttribute oneToMany = new OneToManyAttribute();
          if (entity != null) {
            EntityCollection children = entity.getChildCollection(associationAttributeInfo.getName());
            List<AssociationValue> values = new ArrayList<AssociationValue>();
            for (Entity manyEntity : children) {
              values.add(getAssociationValue(manyEntity, associationAttributeInfo));
            }
            oneToMany.setValue(values);
View Full Code Here

Examples of org.geomajas.layer.entity.EntityCollection

      children.add(child);
    }

    public void addOneToMany(String name, AssociationAttributeInfo attributeInfo, OneToManyAttribute association)
        throws LayerException {
      EntityCollection collection = entity.getChildCollection(name);
      if (association.getValue() == null) {
        addChild(new DeleteOneToManyOperation(getMapper(), getEntity(), attributeInfo));
      } else {
        // sort on create, update, delete
        Map<Object, Entity> existingMap = new HashMap<Object, Entity>();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.