Package org.chromattic.api

Examples of org.chromattic.api.ChromatticSession.create()


      //
      SessionContext context = test1LF.openContext();
      try
      {
         ChromatticSession session = test1LF.getChromattic().openSession();
         FooEntity foo = session.create(FooEntity.class);
         assertEquals("portal-test", foo.getWorkspace());
         jcrSession = session.getJCRSession();
         assertTrue(jcrSession.isLive());
         Workspace workspace = jcrSession.getWorkspace();
         assertEquals("portal-test", workspace.getName());
View Full Code Here


         // Register synchronzation with event queue
         context.addSynchronizationListener(queue);

         // Check how chromattic see the session
         FooEntity foo = session.create(FooEntity.class);
         assertEquals("portal-test", foo.getWorkspace());

         // Check related JCR session
         jcrSession = session.getJCRSession();
         assertTrue(jcrSession.isLive());
View Full Code Here

   public void testPersistence() throws Exception {

      chromatticManager.beginRequest();
      ChromatticSession session = test1LF.getChromattic().openSession();
      FooEntity foo = session.create(FooEntity.class);
      String fooId = session.persist(foo, "testPersistence");
      session.save();
      chromatticManager.endRequest(true);

      chromatticManager.beginRequest();
View Full Code Here

            // Get the workspace object
            Object o = pomSession.findObjectById(modelData.getStorageId());

            A a = chromSession.getEmbedded(o, type);
            if (a == null && create) {
                a = chromSession.create(type);
                chromSession.setEmbedded(o, type, a);
            }

            return a;
        } catch (Exception ex) {
View Full Code Here

            // Get the workspace object
            Object o = pomSession.findObjectById(modelData.getStorageId());

            A a = chromSession.getEmbedded(o, type);
            if (a == null && create) {
                a = chromSession.create(type);
                chromSession.setEmbedded(o, type, a);
            }

            return a;
        } catch (Exception e) {
View Full Code Here

         Object o = pomSession.findObjectById(modelData.getStorageId());
        
         A a = chromSession.getEmbedded(o, type);
         if(a == null && create)
         {
            a = chromSession.create(type);
            chromSession.setEmbedded(o, type, a);
         }
        
         return a;
      }
View Full Code Here

   {
      ChromatticSession session = model.getSession();
      A a = session.getEmbedded(this, type);
      if (a == null && create)
      {
         a = session.create(type);
         session.setEmbedded(this, type, a);
      }
      return a;
   }
View Full Code Here

                // so, we remove the Visible and replace with a RestrictAccess
                ChromatticSession chromatticSession = session.getManager().getLifeCycle().getContext().getSession();
                if (sourceNav.isAdapted(Visible.class)) {
                    chromatticSession.remove(sourceNav.adapt(Visible.class));
                }
                RestrictAccess restrictAccess = chromatticSession.create(RestrictAccess.class);
                chromatticSession.setEmbedded(sourceNav, RestrictAccess.class, restrictAccess);
            }

            //
            RestrictAccess restrictAccess = sourceNav.adapt(RestrictAccess.class);
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.