Package org.exoplatform.container.xml

Examples of org.exoplatform.container.xml.PropertiesParam


   {
      this.repositoryService = repoService;
      this.backupManager = backupManager;
      this.sessionProviderService = sessionProviderService;

      PropertiesParam pps = params.getPropertiesParam("remote-initializer-properties");

      if (pps == null)
         throw new RuntimeException("remote-initializer-properties not specified");

      if (pps.getProperty("remote-source-url") == null)
         throw new RuntimeException("remote-source-url not specified");
      dataSourceUrl = pps.getProperty("remote-source-url");

      if (pps.getProperty("bind-ip-address") == null)
         throw new RuntimeException("bind-ip-address not specified");
      bindIpAddress = pps.getProperty("bind-ip-address");

      if (pps.getProperty("channel-config") == null)
         throw new RuntimeException("channel-config not specified");
      channelConfig = pps.getProperty("channel-config");

      if (pps.getProperty("channel-name") == null)
         throw new RuntimeException("channel-name not specified");
      channelName = pps.getProperty("channel-name");

      if (pps.getProperty("temp-dir") == null)
         throw new RuntimeException("temp-dir not specified");
      String tempD = pps.getProperty("temp-dir");

      tempDir = new File(tempD);
      if (!PrivilegedFileHelper.exists(tempDir))
      {
         PrivilegedFileHelper.mkdirs(tempDir);
View Full Code Here


   private final Map<String, String> optionMap;

   public ChromatticLifeCycle(InitParams params)
   {
      Map<String, String> options = new HashMap<String, String>();
      PropertiesParam pp = params.getPropertiesParam("options");
      if (pp != null)
      {
         options.putAll(pp.getProperties());
      }

      this.domainName = params.getValueParam("domain-name").getValue();
      this.workspaceName = params.getValueParam("workspace-name").getValue();
      this.entityClassNames = params.getValuesParam("entities").getValues();
View Full Code Here

   {
      this.repositoryService = repoService;
      this.backupManager = backupManager;
      this.sessionProviderService = sessionProviderService;

      PropertiesParam pps = params.getPropertiesParam("remote-initializer-properties");

      if (pps == null)
         throw new RuntimeException("remote-initializer-properties not specified");

      if (pps.getProperty("remote-source-url") == null)
         throw new RuntimeException("remote-source-url not specified");
      dataSourceUrl = pps.getProperty("remote-source-url");

      if (pps.getProperty("bind-ip-address") == null)
         throw new RuntimeException("bind-ip-address not specified");
      bindIpAddress = pps.getProperty("bind-ip-address");

      if (pps.getProperty("channel-config") == null)
         throw new RuntimeException("channel-config not specified");
      channelConfig = pps.getProperty("channel-config");

      if (pps.getProperty("channel-name") == null)
         throw new RuntimeException("channel-name not specified");
      channelName = pps.getProperty("channel-name");

      if (pps.getProperty("temp-dir") == null)
         throw new RuntimeException("temp-dir not specified");
      String tempD = pps.getProperty("temp-dir");

      tempDir = new File(tempD);
      if (!tempDir.exists())
         tempDir.mkdirs();
View Full Code Here

      Set<URL> repos = new HashSet<URL>();
      Iterator<PropertiesParam> iterator = params.getPropertiesParamIterator();
      while (iterator.hasNext())
      {
         PropertiesParam p = iterator.next();
         String repository = p.getProperty("repository");
         String workspace = p.getProperty("workspace");
         String path = p.getProperty("path");
         try
         {
            repos.add(new UnifiedNodeReference(repository, workspace, path).getURL());
         }
         catch (MalformedURLException e)
View Full Code Here

      workspace = params.getValueParam("workspace").getValue();
      node = params.getValueParam("node").getValue();
      Iterator<PropertiesParam> iterator = params.getPropertiesParamIterator();
      while (iterator.hasNext())
      {
         PropertiesParam p = iterator.next();
         String name = p.getName();
         boolean autoload = Boolean.valueOf(p.getProperty("autoload"));
         String path = p.getProperty("path");
         if (LOG.isDebugEnabled())
            LOG.debug("Read new script configuration " + name);
         l.add(new XMLGroovyScript2Rest(name, path, autoload));
      }
   }
View Full Code Here

      datasources_ = new HashMap<String, ExoDatasource>(5);
      txService_ = txService;
      Iterator<?> i = params.getPropertiesParamIterator();
      while (i.hasNext())
      {
         PropertiesParam param = (PropertiesParam)i.next();
         String name = param.getName();
         ExoDatasource ds = new ExoDatasource(createDatasource(param.getProperties()));
         datasources_.put(name, ds);
         if (defaultDS_ == null)
            defaultDS_ = ds;
      }
   }
View Full Code Here

      if (params == null)
      {
         throw new ConfigurationException("Initializations parameters expected");
      }

      PropertiesParam prop = params.getPropertiesParam(CONNECTION_PROPERTIES);

      if (prop != null)
      {
         if (prop.getProperty(DRIVER_NAME) == null)
         {
            throw new ConfigurationException("driverClassName expected in db-connection properties section");
         }

         serverUrl = prop.getProperty(SERVER_URL);
         if (serverUrl == null)
         {
            throw new ConfigurationException("url expected in db-connection properties section");
         }

         if (prop.getProperty(USERNAME) == null)
         {
            throw new ConfigurationException("username expected in db-connection properties section");
         }

         if (prop.getProperty(PASSWORD) == null)
         {
            throw new ConfigurationException("password expected in db-connection properties section");
         }

         // Store all connection properties into single map         
         Iterator<Property> pit = prop.getPropertyIterator();
         connectionProperties = new HashMap<String, String>();
         while (pit.hasNext())
         {
            Property p = pit.next();
            if (!p.getName().equalsIgnoreCase(SERVER_URL))
            {
               connectionProperties.put(p.getName(), p.getValue());
            }
         }
      }
      else
      {
         throw new ConfigurationException("db-connection properties expected in initializations parameters");
      }

      prop = params.getPropertiesParam(DB_CREATION_PROPERTIES);
      if (prop != null)
      {
         String scriptPath = prop.getProperty(DB_SCRIPT_PATH);
         if (scriptPath != null)
         {
            this.dbScript = readScript(scriptPath, cm);
         }
         else
         {
            throw new ConfigurationException("scriptPath expected in db-creation properties section");
         }

         this.dbUserName = prop.getProperty(DB_USERNAME);
         if (dbUserName == null)
         {
            throw new ConfigurationException("username expected in db-creation properties section");
         }

         this.dbPassword = prop.getProperty(DB_PASSWORD);
         if (dbPassword == null)
         {
            throw new ConfigurationException("password expected in db-creation properties section");
         }
      }
View Full Code Here

         assertTrue(valuesParam.getValues().contains("component-lifecycle-plugin-values-param-value1"));
         assertTrue(valuesParam.getValues().contains("component-lifecycle-plugin-values-param-value2"));
         Component c = conf.getComponent("component-key1");
         assertNotNull(c);
         assertEquals("component-type1", c.getType());
         PropertiesParam propertiesParam = c.getInitParams().getPropertiesParam("component-key1-properties-param-name");
         assertNotNull(propertiesParam);
         assertEquals("component-key1-properties-param-prop-value", propertiesParam.getProperty("component-key1-properties-param-prop-name"));
         c = conf.getComponent("component-type2");
         assertNotNull(c);
         ObjectParameter objectParameter = c.getInitParams().getObjectParam("component-key2-object-param-name");
         assertNotNull(objectParameter);
         MyObject o = (MyObject)objectParameter.getObject();
View Full Code Here

   private void assertPropertyParam(String expectedValue, Component component, String paramName, String propertyName)
   {
      InitParams initParams = component.getInitParams();
      assertNotNull(initParams);
      PropertiesParam propertiesParam = initParams.getPropertiesParam(paramName);
      assertNotNull(paramName);
      assertEquals(expectedValue, propertiesParam.getProperty(propertyName));
   }
View Full Code Here

   private SessionFactory sessionFactory_;

   public HibernateServiceImpl(InitParams initParams, CacheService cacheService)
   {
      threadLocal_ = new ThreadLocal<Session>();
      PropertiesParam param = initParams.getPropertiesParam("hibernate.properties");
      conf_ = SecurityHelper.doPrivilegedAction(new PrivilegedAction<HibernateConfigurationImpl>()
      {
         public HibernateConfigurationImpl run()
         {
            return new HibernateConfigurationImpl();
         }
      });
      Iterator<?> properties = param.getPropertyIterator();
      while (properties.hasNext())
      {
         Property p = (Property)properties.next();
         conf_.setProperty(p.getName(), p.getValue());
      }
View Full Code Here

TOP

Related Classes of org.exoplatform.container.xml.PropertiesParam

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.