Examples of findByPath()


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

   public void saveConfiguration() throws Exception
   {
      ChromatticSession session = persister.getSession();

      ProducerConfigurationMapping pcm = session.findByPath(ProducerConfigurationMapping.class, PRODUCER_CONFIGURATION_PATH);
      if (pcm == null)
      {
         pcm = session.insert(ProducerConfigurationMapping.class, PRODUCER_CONFIGURATION_PATH);
      }
      pcm.initFrom(configuration);
View Full Code Here

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

   }

   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()

   {
      ChromatticSession session = persister.getSession();

      String encodedForPath = JCRPersister.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

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

   {

      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()

   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()

      persister.initializeBuilderFor(mappingClasses);

//      persister = NewJCRPersister.getInstance(container);

      ChromatticSession session = persister.getSession();
      mappings = session.findByPath(ConsumersAndGroupsMapping.class, ConsumersAndGroupsMapping.NODE_NAME);
      if (mappings == null)
      {
         mappings = session.insert(ConsumersAndGroupsMapping.class, ConsumersAndGroupsMapping.NODE_NAME);
      }
      persister.save(session); // needed right now as the session must still be open to iterate over nodes
View Full Code Here

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

   protected ConsumerSPI internalCreateConsumer(String consumerId, String consumerName)
   {
      ConsumerSPI consumer = super.internalCreateConsumer(consumerId, consumerName);

      ChromatticSession session = persister.getSession();
      mappings = session.findByPath(ConsumersAndGroupsMapping.class, ConsumersAndGroupsMapping.NODE_NAME); // todo: needed?
      try
      {
         ConsumerMapping cm = mappings.createConsumer(consumerId);
         mappings.getConsumers().add(cm);
         cm.initFrom(consumer);
View Full Code Here

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

   protected void loadConfiguration() throws Exception
   {
      // Try loading configuration from JCR first
      ChromatticSession session = persister.getSession();
      ProducerConfigurationMapping pcm = session.findByPath(ProducerConfigurationMapping.class, PRODUCER_CONFIGURATION_PATH);

      // if we don't have a configuration persisted in JCR already, force a reload from XML and save the resulting configuration
      if (pcm == null)
      {
         pcm = session.insert(ProducerConfigurationMapping.class, PRODUCER_CONFIGURATION_PATH);
View Full Code Here

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

         throw new IllegalArgumentException("Cannot find a mapping class for " + modelClass.getName());
      }

      ChromatticSession session = getSession();

      Object old = session.findByPath(baseMappingClass, manager.getChildPath(toDelete));

      if (old != null)
      {
         session.remove(old);
View Full Code Here

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

   {
      try
      {
         // Try loading configuration from JCR first
         ChromatticSession session = persister.getSession();
         ProducerConfigurationMapping pcm = session.findByPath(ProducerConfigurationMapping.class, PRODUCER_CONFIGURATION_PATH);

         // if we don't have a configuration persisted in JCR already, force a reload from XML and save the resulting configuration
         if (pcm == null)
         {
            pcm = session.insert(ProducerConfigurationMapping.class, PRODUCER_CONFIGURATION_PATH);
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.