Package org.exoplatform.services.jcr.config

Examples of org.exoplatform.services.jcr.config.SimpleParameterEntry


      String id = IdGenerator.generate();
      String wsName = "ws-" + id;

      // container entry
      List<SimpleParameterEntry> params = new ArrayList<SimpleParameterEntry>();
      params.add(new SimpleParameterEntry("source-name", dsName));
      params.add(new SimpleParameterEntry(JDBCWorkspaceDataContainer.DB_STRUCTURE_TYPE, dbStructureType.toString()));
      params.add(new SimpleParameterEntry("max-buffer-size", "204800"));
      params.add(new SimpleParameterEntry("dialect", "auto"));
      params.add(new SimpleParameterEntry("swap-directory", "target/temp/swap/" + wsName));

      ContainerEntry containerEntry =
         new ContainerEntry("org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer",
            params);
      containerEntry.setParameters(params);

      // value storage
      List<ValueStorageEntry> list = new ArrayList<ValueStorageEntry>();
      if (valueStorageIds != null)
      {
         for (String vsId : valueStorageIds)
         {
            List<ValueStorageFilterEntry> vsparams = new ArrayList<ValueStorageFilterEntry>();
            ValueStorageFilterEntry filterEntry = new ValueStorageFilterEntry();
            filterEntry.setPropertyType("Binary");
            vsparams.add(filterEntry);

            List<SimpleParameterEntry> spe = new ArrayList<SimpleParameterEntry>();
            spe.add(new SimpleParameterEntry("path", "target/temp/values/" + wsName + "-" + vsId));

            ValueStorageEntry valueStorageEntry =
                     new ValueStorageEntry("org.exoplatform.services.jcr.impl.storage.value.fs.SimpleFileValueStorage",
                        spe);

            valueStorageEntry.setId(vsId);
            valueStorageEntry.setFilters(vsparams);

            // containerEntry.setValueStorages();
            containerEntry.setParameters(params);
            list.add(valueStorageEntry);
         }
      }

      containerEntry.setValueStorages(list);

      // Indexer
      params = new ArrayList<SimpleParameterEntry>();
      params.add(new SimpleParameterEntry("index-dir", "target/temp/index/" + wsName));
      QueryHandlerEntry qEntry =
         new QueryHandlerEntry("org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex", params);

      // Cache
      CacheEntry cacheEntry = null;

      try
      {
         Class
            .forName("org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache");

         List<SimpleParameterEntry> cacheParams = new ArrayList<SimpleParameterEntry>();
         cacheParams.add(new SimpleParameterEntry("infinispan-configuration",
            "conf/standalone/test-infinispan-config.xml"));
         cacheEntry = new CacheEntry(cacheParams);
         cacheEntry.setEnabled(cacheEnabled);
         cacheEntry
            .setType("org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache");
View Full Code Here


      WorkspaceInitializerEntry wiEntry = new WorkspaceInitializerEntry();
      wiEntry.setType(SysViewWorkspaceInitializer.class.getCanonicalName());

      List<SimpleParameterEntry> wieParams = new ArrayList<SimpleParameterEntry>();
      wieParams
         .add(new SimpleParameterEntry(SysViewWorkspaceInitializer.RESTORE_PATH_PARAMETER, sysViewFile.getPath()));

      wiEntry.setParameters(wieParams);

      ws1back.setInitializer(wiEntry);

      // Indexer
      List<SimpleParameterEntry> qParams = new ArrayList<SimpleParameterEntry>();
      qParams.add(new SimpleParameterEntry(QueryHandlerParams.PARAM_INDEX_DIR, "target" + File.separator + name));
      QueryHandlerEntry qEntry =
         new QueryHandlerEntry("org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex", qParams);

      ws1back.setQueryHandler(qEntry);

      List<SimpleParameterEntry> params = new ArrayList<SimpleParameterEntry>();
      for (Iterator<SimpleParameterEntry> i = ws1back.getContainer().getParameterIterator(); i.hasNext();)
      {
         SimpleParameterEntry p = i.next();
         SimpleParameterEntry newp = new SimpleParameterEntry(p.getName(), p.getValue());

         if (isMultiDB(session) && newp.getName().equals("source-name"))
         {
            newp.setValue(sourceName);
         }
         else if (newp.getName().equals("swap-directory"))
         {
            newp.setValue("target/temp/swap/" + name);
         }
         else if (isMultiDB(session) && newp.getName().equals("dialect"))
         {
            newp.setValue("hsqldb");
         }

         params.add(newp);
      }
View Full Code Here

   assertNotNull(bchLog.getFinishedTime());
  
   // change  cofig
   WorkspaceEntry wsEntry = helper.copyWorkspaceEntry(repository.getConfiguration().getWorkspaceEntries().get(1));

   wsEntry.getContainer().addParameter(new SimpleParameterEntry("max-buffer-size", "307200"));

   backup.restoreExistingWorkspace(bchLog, repository.getConfiguration().getName(), wsEntry, false);
   checkConent(repository, repository.getConfiguration().getWorkspaceEntries().get(1).getName());
   checkConent(repository, repository.getConfiguration().getWorkspaceEntries().get(2).getName());
   }
View Full Code Here

      {
         // set the initializer SysViewWorkspaceInitializer
         wiEntry.setType(SysViewWorkspaceInitializer.class.getCanonicalName());

         List<SimpleParameterEntry> wieParams = new ArrayList<SimpleParameterEntry>();
         wieParams.add(new SimpleParameterEntry(SysViewWorkspaceInitializer.RESTORE_PATH_PARAMETER, pathBackupFile));

         wiEntry.setParameters(wieParams);
      }
      else if ((Class.forName(fBackupType)
               .equals(org.exoplatform.services.jcr.ext.backup.impl.rdbms.FullBackupJob.class)))
      {
         // set the initializer RdbmsWorkspaceInitializer
         wiEntry.setType(RdbmsWorkspaceInitializer.class.getCanonicalName());

         List<SimpleParameterEntry> wieParams = new ArrayList<SimpleParameterEntry>();
         wieParams.add(new SimpleParameterEntry(RdbmsWorkspaceInitializer.RESTORE_PATH_PARAMETER, new File(
                  pathBackupFile).getParent()));

         wiEntry.setParameters(wieParams);
      }
View Full Code Here

      WorkspaceInitializerEntry wiEntry = new WorkspaceInitializerEntry();
      wiEntry.setType(SysViewWorkspaceInitializer.class.getCanonicalName());

      List<SimpleParameterEntry> wieParams = new ArrayList<SimpleParameterEntry>();
      wieParams
         .add(new SimpleParameterEntry(SysViewWorkspaceInitializer.RESTORE_PATH_PARAMETER, sysViewFile.getPath()));

      wiEntry.setParameters(wieParams);

      ws1back.setInitializer(wiEntry);

      // Indexer
      List<SimpleParameterEntry> qParams = new ArrayList<SimpleParameterEntry>();
      qParams.add(new SimpleParameterEntry("indexDir", "target" + File.separator + name));
      QueryHandlerEntry qEntry =
         new QueryHandlerEntry("org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex", qParams);

      ws1back.setQueryHandler(qEntry);

      List<SimpleParameterEntry> params = new ArrayList<SimpleParameterEntry>();
      for (Iterator<SimpleParameterEntry> i = ws1back.getContainer().getParameterIterator(); i.hasNext();)
      {
         SimpleParameterEntry p = i.next();
         SimpleParameterEntry newp = new SimpleParameterEntry(p.getName(), p.getValue());

         if (isMultiDB(ses) && newp.getName().equals("source-name"))
         {
            newp.setValue(sourceName);
         }
         else if (newp.getName().equals("swap-directory"))
         {
            newp.setValue("target/temp/swap/" + name);
         }
         else if (isMultiDB(ses) && newp.getName().equals("dialect"))
         {
            newp.setValue("hsqldb");
         }

         params.add(newp);
      }
View Full Code Here

      RepositoryEntry repositoryEntry = new RepositoryEntry();
      config = new WorkspaceEntry();
      config.setName("test");
      ContainerEntry containerEntry = new ContainerEntry();
      List params = new ArrayList();
      params.add(new SimpleParameterEntry("sourceName", sourceName));
      params.add(new SimpleParameterEntry("db-structure-type", "multi"));
      containerEntry.setParameters(params);
      config.setContainer(containerEntry);

      // Construct BasicDataSource reference
      Reference ref = new Reference("javax.sql.DataSource", "org.apache.commons.dbcp.BasicDataSourceFactory", null);
View Full Code Here

         {
            Class
               .forName("org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache");

            List<SimpleParameterEntry> cacheParams = new ArrayList<SimpleParameterEntry>();
            cacheParams.add(new SimpleParameterEntry("infinispan-configuration",
               "conf/standalone/test-infinispan-config.xml"));
            CacheEntry cacheEntry = new CacheEntry(cacheParams);
            cacheEntry
               .setType("org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache");
            cacheEntry.setEnabled(true);

            List<WorkspaceEntry> wsList = repoEntry.getWorkspaceEntries();

            wsList.get(0).setCache(cacheEntry);
            repoEntry.setWorkspaceEntries(wsList);
         }
         catch (ClassNotFoundException e)
         {
         }

         service.createRepository(repoEntry);
         service.getConfig().retain();

         ManageableRepository repository = service.getRepository(repoEntry.getName());

         // add content
         Session session =
            repository.login(new CredentialsImpl("admin", "admin".toCharArray()), repository.getConfiguration()
               .getSystemWorkspaceName());
         session.getRootNode().addNode("test");
         session.save();
         session.logout();

         // copy repository configuration
         RepositoryEntry repositoryEntry = helper.copyRepositoryEntry(repository.getConfiguration());

         String newDatasourceName = helper.createDatasource();

         for (WorkspaceEntry ws : repositoryEntry.getWorkspaceEntries())
         {
            if (ws.getContainer().hasParameter("source-name"))
            {
               ws.getContainer().addParameter(new SimpleParameterEntry("source-name", newDatasourceName));
            }

            if (ws.getLockManager().hasParameter("infinispan-cl-cache.jdbc.datasource"))
            {
               ws.getLockManager().addParameter(new SimpleParameterEntry("infinispan-cl-cache.jdbc.datasource", newDatasourceName));
            }
         }

         service.removeRepository(repository.getConfiguration().getName());
View Full Code Here

      QueryHandlerEntry queryHandler = workspaceEntry.getQueryHandler();

      if (helper.ispnCacheEnabled())
      {
         // Use Infinispan components for core.ispn project
         queryHandler.addParameter(new SimpleParameterEntry("changesfilter-class",
            "org.exoplatform.services.jcr.impl.core.query.ispn.ISPNIndexChangesFilter"));
         queryHandler.addParameter(new SimpleParameterEntry("infinispan-configuration",
            "conf/standalone/cluster/test-infinispan-indexer.xml"));
         queryHandler.addParameter(new SimpleParameterEntry("jgroups-configuration",
            "jar:/conf/standalone/cluster/udp-mux.xml"));
         queryHandler.addParameter(new SimpleParameterEntry("infinispan-cluster-name", "JCR-cluster"));
      }

      return helper.createRepository(container, repoEntry);
   }
View Full Code Here

   public void testDataSizeMovedNodeNoDescendentEvents() throws Exception
   {
      TesterConfigurationHelper helper = TesterConfigurationHelper.getInstance();
      WorkspaceEntry wsEntry = helper.createWorkspaceEntry(DatabaseStructureType.ISOLATED, null);
      wsEntry.getContainer().addParameter(
         new SimpleParameterEntry(WorkspaceDataContainer.TRIGGER_EVENTS_FOR_DESCENDANTS_ON_RENAME, "false"));

      ManageableRepository repository = helper.createRepository(container, DatabaseStructureType.ISOLATED, null);
      helper.addWorkspace(repository, wsEntry);

      SessionImpl session = (SessionImpl)repository.login(credentials, wsEntry.getName());
View Full Code Here

   public void testMoveWithoutGenerationChangesForAllSubTree() throws Exception
   {
      TesterConfigurationHelper helper = TesterConfigurationHelper.getInstance();
      WorkspaceEntry wsEntry = helper.createWorkspaceEntry(DatabaseStructureType.MULTI, null);
      wsEntry.getContainer().addParameter(
         new SimpleParameterEntry(WorkspaceDataContainer.TRIGGER_EVENTS_FOR_DESCENDANTS_ON_RENAME, "false"));

      ManageableRepository repository = helper.createRepository(container, DatabaseStructureType.MULTI, null);
      helper.addWorkspace(repository, wsEntry);

      testMoveForAllSubTree(wsEntry, repository);
View Full Code Here

TOP

Related Classes of org.exoplatform.services.jcr.config.SimpleParameterEntry

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.