Package org.chromattic.api

Examples of org.chromattic.api.ChromatticSession


            return session.getEmbedded(o, type);
        }

        protected final QueryResult<TokenEntry> findTokensOfUser(String user) {
            SessionContext ctx = chromatticLifeCycle.getContext();
            ChromatticSession session = ctx.getSession();
            TokenContainer tokenContainer = getTokenContainer();

            String statement = new StringBuilder(128).append("jcr:path LIKE '").append(session.getPath(tokenContainer))
                    .append("/%'").append(" AND username='").append(Utils.queryEscape(user)).append("'").toString();
            return session.createQueryBuilder(TokenEntry.class).where(statement).get().objects();
        }
View Full Code Here


        this.lifeCycle = lifeCycle;
        this.mopManager = mopManager;
    }

    public ContentRegistry getContentRegistry() {
        ChromatticSession session = lifeCycle.getChromattic().openSession();
        ContentRegistry registry = session.findByPath(ContentRegistry.class, "app:applications");
        if (registry == null) {
            registry = session.insert(ContentRegistry.class, "app:applications");
        }
        return registry;
    }
View Full Code Here

        this.chromatticLifeCycle = lifeCycle;
    }

    public GadgetRegistry getRegistry() {
        Chromattic chromattic = chromatticLifeCycle.getChromattic();
        ChromatticSession session = chromattic.openSession();
        GadgetRegistry registry = session.findByPath(GadgetRegistry.class, "app:gadgets");
        if (registry == null) {
            registry = session.insert(GadgetRegistry.class, "app:gadgets");
        }
        return registry;
    }
View Full Code Here

   }

   public ModelImpl getModel()
   {
      Chromattic chromattic = getChromattic();
      ChromatticSession chromeSession = chromattic.openSession();
      return new ModelImpl(
         this, chromeSession
      );
   }
View Full Code Here

      // more optimized version of updateState
      ParameterValidation.throwIllegalArgExceptionIfNull(propertyMap, "property map");

      try
      {
         ChromatticSession session = persister.getSession();

         PortletStateContextMapping pscm = getPortletStateContextMapping(session, stateId);
         PortletStateMapping psm = pscm.getState();
         psm.setProperties(propertyMap);
View Full Code Here

   @Override
   protected PortletStateContext getStateContext(String stateId)
   {
      try
      {
         ChromatticSession session = persister.getSession();

         PortletStateContextMapping pscm = getPortletStateContextMapping(session, stateId);
         PortletStateContext context;
         if (pscm == null)
         {
View Full Code Here

   @Override
   protected String createStateContext(String portletId, PropertyMap propertyMap)
   {
      try
      {
         ChromatticSession session = persister.getSession();

         String encodedForPath = ChromatticPersister.PortletNameFormatter.encode(portletId);

         PortletStateContextMapping pscm = session.findByPath(PortletStateContextMapping.class, PATH + encodedForPath);
         if (pscm == null)
         {
            PortletStateContextsMapping portletStateContexts = getContexts(session);
            pscm = portletStateContexts.createPortletStateContext(portletId);
            portletStateContexts.getPortletStateContexts().add(pscm);
View Full Code Here

   @Override
   protected PortletStateContext destroyStateContext(String stateId)
   {
      try
      {
         ChromatticSession session = persister.getSession();

         PortletStateContextMapping pscm = getPortletStateContextMapping(session, stateId);
         PortletStateContext result;
         if (pscm == null)
         {
View Full Code Here

   }

   public ModelImpl getModel()
   {
      Chromattic chromattic = getChromattic();
      ChromatticSession chromeSession = chromattic.openSession();
      return new ModelImpl(
         this, chromeSession
      );
   }
View Full Code Here

      }
   }

   private <A> A getMixin(Class<A> type, boolean create)
   {
      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

TOP

Related Classes of org.chromattic.api.ChromatticSession

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.