Package org.exoplatform.container.xml

Examples of org.exoplatform.container.xml.PropertiesParam


   {
      objectsToCreate = new HashMap<String, Attributes>();
      Iterator<?> i = params.getPropertiesParamIterator();
      while (i.hasNext())
      {
         PropertiesParam param = (PropertiesParam)i.next();
         Map<String, String> prop = param.getProperties();
         BasicAttributes attrs = new BasicAttributes();
         Iterator<?> entries = prop.entrySet().iterator();
         while (entries.hasNext())
         {
            Map.Entry entry = (Map.Entry)entries.next();
            String key = (String)entry.getKey();
            String value = (String)entry.getValue();
            Attribute attr = attrs.get(key);
            if (attr == null)
               attrs.put(new BasicAttribute(key, value));
            else
               attr.add(value);
         }
         objectsToCreate.put(param.getName(), attrs);
      }
   }
View Full Code Here


    *
    * @throws RepositoryConfigurationException
    */
   private void readParamsFromFile()
   {
      PropertiesParam pps = initParams.getPropertiesParam(BACKUP_PROPERTIES);

      backupDir = pps.getProperty(BACKUP_DIR);
      defIncrPeriod = pps.getProperty(DEFAULT_INCREMENTAL_JOB_PERIOD);
      fullBackupType = pps.getProperty(FULL_BACKUP_TYPE);
      incrementalBackupType = pps.getProperty(INCREMENTAL_BACKUP_TYPE);

      log.info("Backup dir from configuration file: " + backupDir);
      log.info("Default incremental job period from configuration file: " + defIncrPeriod);
      log.info("Full backup type from configuration file: " + fullBackupType);
      log.info("Incremental backup type from configuration file: " + incrementalBackupType);
View Full Code Here

   }

   protected ExtendedBackupManager getBackupManager()
   {
      InitParams initParams = new InitParams();
      PropertiesParam pps = new PropertiesParam();

      pps.setProperty(BackupManagerImpl.FULL_BACKUP_TYPE,
         "org.exoplatform.services.jcr.ext.backup.impl.rdbms.FullBackupJob");
      pps.setProperty(BackupManagerImpl.BACKUP_DIR, "target/backup");
      initParams.put(BackupManagerImpl.BACKUP_PROPERTIES, pps);

      return new BackupManagerImpl(initParams, repositoryService);
   }
View Full Code Here

   }

   protected ExtendedBackupManager getBackupManager()
   {
      InitParams initParams = new InitParams();
      PropertiesParam pps = new PropertiesParam();

      pps.setProperty(BackupManagerImpl.FULL_BACKUP_TYPE,
         "org.exoplatform.services.jcr.ext.backup.impl.rdbms.FullBackupJob");
      pps.setProperty(BackupManagerImpl.BACKUP_DIR, "target/backup");
      initParams.put(BackupManagerImpl.BACKUP_PROPERTIES, pps);

      return new BackupManagerImpl(initParams, repositoryService);
   }
View Full Code Here

    *
    * @throws RepositoryConfigurationException
    */
   private void readParamsFromFile()
   {
      PropertiesParam props = initParams.getPropertiesParam("artifact.workspace");

      if (props == null)
      {
         throw new IllegalArgumentException("Property parameters 'locations' expected");
      }

      repoWorkspaceName = props.getProperty("workspace");
      rootNodePath = props.getProperty("rootNode");

      LOG.info("Workspace from configuration file: " + repoWorkspaceName);
      LOG.info("RootNode from configuration file: " + rootNodePath);
   }
View Full Code Here

    if (initParams == null) {
      throw new RepositoryConfigurationException("Init parameters expected !!!");
    }

    PropertiesParam props = initParams.getPropertiesParam("artifact.workspace");

    if (props == null) {
      throw new RepositoryConfigurationException("Property parameters 'locations' expected");
    }

    repoWorkspaceName = props.getProperty("workspace");
    rootNodePath = props.getProperty("rootNode");
    String username = props.getProperty("username");
    String password = props.getProperty("password");
    String userId = authenticator.validateUser(new Credential[] { new UsernameCredential(username),
        new PasswordCredential(password) });

    sessionProvider = new SessionProvider(new ConversationState(authenticator.createIdentity(userId)));
View Full Code Here

   public RESTArtifactLoaderService(InitParams initParams, ThreadLocalSessionProviderService sessionProviderService,
      RepositoryService repositoryService, NodeRepresentationService nodeRepresentationService,
      ExoContainerContext context) throws Exception
   {

      PropertiesParam props = initParams.getPropertiesParam("artifact.workspace");

      if (props == null)
         throw new IllegalArgumentException("Properties-param 'artifact.workspace' expected.");

      this.nodeRepresentationService = nodeRepresentationService;
      this.repositoryService = repositoryService;
      this.sessionProviderService = sessionProviderService;

      this.repository = props.getProperty("repository");
      this.workspace = props.getProperty("workspace");

      this.mavenRoot = props.getProperty("mavenRoot");
      if (mavenRoot.startsWith("/"))
         mavenRoot = mavenRoot.substring(1);
      if (!mavenRoot.endsWith("/"))
         mavenRoot += "/";
      this.realmName = context.getRealmName();
View Full Code Here

    *
    * @throws RepositoryConfigurationException
    */
   private void readParamsFromFile()
   {
      PropertiesParam pps = initParams.getPropertiesParam(BACKUP_PROPERTIES);

      backupDir = pps.getProperty(BACKUP_DIR);
      // full backup type can be not defined. Using default.
      fullBackupType =
         pps.getProperty(FULL_BACKUP_TYPE) == null ? DEFAULT_VALUE_FULL_BACKUP_TYPE : pps.getProperty(FULL_BACKUP_TYPE);
      // incremental backup can be not configured. Using default values.
      defIncrPeriod =
         pps.getProperty(DEFAULT_INCREMENTAL_JOB_PERIOD) == null ? DEFAULT_VALUE_INCREMENTAL_JOB_PERIOD : pps
            .getProperty(DEFAULT_INCREMENTAL_JOB_PERIOD);
      incrementalBackupType =
         pps.getProperty(INCREMENTAL_BACKUP_TYPE) == null ? DEFAULT_VALUE_INCREMENTAL_BACKUP_TYPE : pps
            .getProperty(INCREMENTAL_BACKUP_TYPE);

      log.info("Backup dir from configuration file: " + backupDir);
      log.info("Full backup type from configuration file: " + fullBackupType);
      log.info("(Experimental) Incremental backup type from configuration file: " + incrementalBackupType);
View Full Code Here

      final Set<URL> repos = new HashSet<URL>();
      Iterator<PropertiesParam> iterator = params.getPropertiesParamIterator();
      while (iterator.hasNext())
      {
         PropertiesParam p = iterator.next();
         final String repository = p.getProperty("repository");
         final String workspace = p.getProperty("workspace");
         final String path = p.getProperty("path");
         try
         {
            SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<Void>()
            {
               public Void run() throws MalformedURLException
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 = findScriptResource(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

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.