Package org.exoplatform.services.jcr.impl.ext.action

Examples of org.exoplatform.services.jcr.impl.ext.action.SessionActionCatalog


   }

   public void testReadAction() throws ItemExistsException, PathNotFoundException, VersionException,
      ConstraintViolationException, LockException, RepositoryException
   {
      SessionActionCatalog catalog =
         (SessionActionCatalog)container.getComponentInstanceOfType(SessionActionCatalog.class);
      catalog.clear();

      // test by path

      Node testNode = root.addNode("testNode");
      PropertyImpl prop = (PropertyImpl)testNode.setProperty("test", "test");
      root.save();

      SessionEventMatcher matcher =
         new SessionEventMatcher(ExtendedEvent.READ, new QPath[]{prop.getData().getQPath()}, true, null,
            new InternalQName[]{Constants.NT_UNSTRUCTURED}, ntHolder);
      DummyAction dAction = new DummyAction();

      catalog.addAction(matcher, dAction);

      assertEquals(0, dAction.getActionExecuterCount());
      String val = testNode.getProperty("test").getValue().getString();
      assertEquals(1, dAction.getActionExecuterCount());
View Full Code Here


   }

   public void testAddMixinAction() throws Exception
   {
      SessionActionCatalog catalog =
         (SessionActionCatalog)container.getComponentInstanceOfType(SessionActionCatalog.class);
      catalog.clear();

      // test by path
      SessionEventMatcher matcher =
         new SessionEventMatcher(ExtendedEvent.ADD_MIXIN, null, true, null, new InternalQName[]{
            Constants.MIX_REFERENCEABLE, Constants.EXO_OWNEABLE}, ntHolder);
      DummyAction dAction = new DummyAction();
      catalog.addAction(matcher, dAction);

      assertEquals(0, dAction.getActionExecuterCount());
      Node tnode = root.addNode("testnode");
      assertEquals(0, dAction.getActionExecuterCount());
      tnode.addMixin("exo:owneable");
View Full Code Here

      assertEquals(2, dAction.getActionExecuterCount());
   }

   public void testRemoveMixinAction() throws Exception
   {
      SessionActionCatalog catalog =
         (SessionActionCatalog)container.getComponentInstanceOfType(SessionActionCatalog.class);
      catalog.clear();

      // test by path
      SessionEventMatcher matcher =
         new SessionEventMatcher(ExtendedEvent.REMOVE_MIXIN, null, true, null,
            new InternalQName[]{Constants.EXO_OWNEABLE}, ntHolder);
      DummyAction dAction = new DummyAction();
      catalog.addAction(matcher, dAction);

      assertEquals(0, dAction.getActionExecuterCount());
      Node tnode = root.addNode("testnode");
      tnode.addMixin("exo:owneable");
      assertEquals(0, dAction.getActionExecuterCount());
View Full Code Here

      this.lifecycleListeners = new ArrayList<SessionLifecycleListener>();
      this.registerLifecycleListener((ObservationManagerImpl)observationManager);
      this.registerLifecycleListener(lockManager);

      SessionActionCatalog catalog =
         (SessionActionCatalog)container.getComponentInstanceOfType(SessionActionCatalog.class);
      actionHandler = new SessionActionInterceptor(catalog, container);

      sessionRegistry = (SessionRegistry)container.getComponentInstanceOfType(SessionRegistry.class);
View Full Code Here

      this.lifecycleListeners = new ArrayList<SessionLifecycleListener>();
      this.registerLifecycleListener((ObservationManagerImpl)observationManager);
      this.registerLifecycleListener(lockManager);

      SessionActionCatalog catalog =
         (SessionActionCatalog)container.getComponentInstanceOfType(SessionActionCatalog.class);
      actionHandler = new SessionActionInterceptor(catalog, container);

      sessionRegistry = (SessionRegistry)container.getComponentInstanceOfType(SessionRegistry.class);
View Full Code Here

      this.lifecycleListeners = new ArrayList<SessionLifecycleListener>();
      this.registerLifecycleListener((ObservationManagerImpl)observationManager);
      this.registerLifecycleListener(lockManager);

      SessionActionCatalog catalog =
         (SessionActionCatalog)container.getComponentInstanceOfType(SessionActionCatalog.class);
      actionHandler = new SessionActionInterceptor(catalog, container, workspaceName);

      sessionRegistry = (SessionRegistry)container.getComponentInstanceOfType(SessionRegistry.class);
View Full Code Here

      this.lifecycleListeners = new ArrayList<SessionLifecycleListener>();
      this.registerLifecycleListener((ObservationManagerImpl)observationManager);
      this.registerLifecycleListener(lockManager);

      SessionActionCatalog catalog =
         (SessionActionCatalog)container.getComponentInstanceOfType(SessionActionCatalog.class);
      actionHandler = new SessionActionInterceptor(catalog, container, workspaceName);

      sessionRegistry = (SessionRegistry)container.getComponentInstanceOfType(SessionRegistry.class);
View Full Code Here

      this.lifecycleListeners = new ArrayList<SessionLifecycleListener>();
      this.registerLifecycleListener((ObservationManagerImpl)observationManager);
      this.registerLifecycleListener(lockManager);

      SessionActionCatalog catalog =
         (SessionActionCatalog)container.getComponentInstanceOfType(SessionActionCatalog.class);
      actionHandler = new SessionActionInterceptor(catalog, container);

      sessionRegistry = (SessionRegistry)container.getComponentInstanceOfType(SessionRegistry.class);
View Full Code Here

      ntHolder = session.getWorkspace().getNodeTypesHolder();
   }

   public void testIfServicePresent() throws Exception
   {
      SessionActionCatalog catalog =
         (SessionActionCatalog)container.getComponentInstanceOfType(SessionActionCatalog.class);

      assertNotNull("No SessionActionCatalog configured!", catalog);
   }
View Full Code Here

      assertNotNull("No SessionActionCatalog configured!", catalog);
   }

   public void testLockActions() throws Exception
   {
      SessionActionCatalog catalog =
         (SessionActionCatalog)container.getComponentInstanceOfType(SessionActionCatalog.class);
      catalog.clear();

      // test by path
      SessionEventMatcher matcher =
         new SessionEventMatcher(ExtendedEvent.LOCK, null, true, null, new InternalQName[]{Constants.NT_UNSTRUCTURED},
            ntHolder);
      DummyAction dAction = new DummyAction();
      catalog.addAction(matcher, dAction);

      assertEquals(0, dAction.getActionExecuterCount());

      Node lockedNode = root.addNode("locked node");
      if (lockedNode.canAddMixin("mix:lockable"))
View Full Code Here

TOP

Related Classes of org.exoplatform.services.jcr.impl.ext.action.SessionActionCatalog

Copyright © 2018 www.massapicom. 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.