Examples of findByPath()


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

      private SessionContext context;

      protected final GadgetTokenContainer getGadgetTokenContainer()
      {
         ChromatticSession session = context.getSession();
         GadgetTokenContainer container = session.findByPath(GadgetTokenContainer.class, "gadgettokens");
         if (container == null)
         {
            container = session.insert(GadgetTokenContainer.class, "gadgettokens");
         }
         return container;
View Full Code Here

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

    @Override
    public void start() {
        try {
            chromatticLifeCycle.getManager().beginRequest();
            ChromatticSession session = chromatticLifeCycle.openContext().getSession();
            GadgetTokenContainer tkContainer = session.findByPath(GadgetTokenContainer.class, "gadgettokens");
            if (tkContainer == null) {
                session.insert(GadgetTokenContainer.class, "gadgettokens");
            }

        } finally {
View Full Code Here

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

        private SessionContext context;

        protected final GadgetTokenContainer getGadgetTokenContainer() {

            ChromatticSession session = context.getSession();
            return session.findByPath(GadgetTokenContainer.class, "gadgettokens");
        }

        @Override
        protected V execute(SessionContext context) {
            this.context = context;
View Full Code Here

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

        new TokenTask<Void>() {
            @Override
            protected Void execute(SessionContext context) {
                SessionContext ctx = chromatticLifeCycle.getContext();
                ChromatticSession session = ctx.getSession();
                TokenContainer container = session.findByPath(TokenContainer.class, lifecycleName);
                if (container != null) {
                    /* if the container does not exist, it makes no sense to clean the legacy tokens */
                    container.cleanLegacyTokens();
                }
                return null;
View Full Code Here

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

    private abstract class TokenTask<V> extends ContextualTask<V> {

        protected final TokenContainer getTokenContainer() {
            SessionContext ctx = chromatticLifeCycle.getContext();
            ChromatticSession session = ctx.getSession();
            TokenContainer container = session.findByPath(TokenContainer.class, lifecycleName);
            if (container == null) {
                container = session.insert(TokenContainer.class, lifecycleName);
            }
            return container;
        }
View Full Code Here

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

        /* clean the legacy tokens */
        new TokenTask<Void>() {
            @Override
            protected Void execute(SessionContext context) {
                ChromatticSession session = context.getSession();
                TokenContainer container = session.findByPath(TokenContainer.class, lifecycleName);
                if (container != null) {
                    /* if the container does not exist, it makes no sense to clean the legacy tokens */
                    container.cleanLegacyTokens();
                } else {
                    session.insert(TokenContainer.class, lifecycleName);
View Full Code Here

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

    private abstract class TokenTask<V> extends ContextualTask<V> {

        protected final TokenContainer getTokenContainer() {
            SessionContext ctx = chromatticLifeCycle.getContext();
            ChromatticSession session = ctx.getSession();
            return session.findByPath(TokenContainer.class, lifecycleName);
        }

        protected final <A> A getMixin(Object o, Class<A> type) {
            SessionContext ctx = chromatticLifeCycle.getContext();
            ChromatticSession session = ctx.getSession();
View Full Code Here

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

        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

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

    }

    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

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

      {
         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
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.