Package org.exoplatform.services.jcr.config

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


                  HTTPBackupAgent.Constants.OperationType.RESTORE +
                  "/" + repositoryName +
                  "/" + backupId;

   
    WorkspaceEntry wEntry = null;
    try {
      wEntry = getWorkspaceEntry(config, repositoryName, workspaceName);
    } catch (Throwable e) {
     throw new BackupExecuteException("Can not get WorkspaceEntry for workspace '" + workspaceName + "' from config.", e);
    }
   
    JsonGeneratorImpl generatorImpl = new JsonGeneratorImpl();
    JsonValue json;
   
    try {
      json = generatorImpl.createJsonObject(wEntry);
    } catch (JsonException e) {
      throw new BackupExecuteException("Can not get json from  : " + wEntry.getClass().toString(), e);
    }
       
    BackupAgentResponse response  = transport.executePOST(sURL, json.toString());
   
    if (response.getStatus() == Response.Status.OK.getStatusCode()) {
View Full Code Here


   *           will be generated the RepositoryConfigurationException
   */
  private WorkspaceEntry getWorkspaceEntry(InputStream wEntryStream, String repositoryName, String workspaceName) throws FileNotFoundException,
                                                                                          JiBXException,
                                                                                          RepositoryConfigurationException {
    WorkspaceEntry wsEntry = null;

    IBindingFactory factory = BindingDirectory.getFactory(RepositoryServiceConfiguration.class);
    IUnmarshallingContext uctx = factory.createUnmarshallingContext();
    RepositoryServiceConfiguration conf = (RepositoryServiceConfiguration) uctx.unmarshalDocument(wEntryStream,
                                                                                                  null);
View Full Code Here

                     ReplicationChannelManager channelManager =
                        new ReplicationChannelManager(props, channelName + (channelName.equals("") ? "" : "_")
                           + uniqueNoame);

                     WorkspaceContainerFacade wsFacade = jcrRepository.getWorkspaceContainer(workspaces[wIndex]);
                     WorkspaceEntry wconf = (WorkspaceEntry)wsFacade.getComponent(WorkspaceEntry.class);

                     int maxBufferSize =
                        wconf.getContainer().getParameterInteger(WorkspaceDataContainer.MAXBUFFERSIZE_PROP,
                           WorkspaceDataContainer.DEF_MAXBUFFERSIZE);

                     WorkspaceFileCleanerHolder wfcleaner =
                        (WorkspaceFileCleanerHolder)wsFacade.getComponent(WorkspaceFileCleanerHolder.class);
                     FileCleaner fileCleaner = wfcleaner.getFileCleaner();
View Full Code Here

    */
   public static void cleanRepositoryData(RepositoryEntry rEntry) throws DBCleanException
   {
      SecurityHelper.validateSecurityPermission(JCRRuntimePermissions.MANAGE_REPOSITORY_PERMISSION);

      WorkspaceEntry wsEntry = rEntry.getWorkspaceEntries().get(0);

      boolean multiDB = getMultiDbParameter(wsEntry);
      if (multiDB)
      {
         for (WorkspaceEntry entry : rEntry.getWorkspaceEntries())
View Full Code Here

   public static DBCleanerTool getRepositoryDBCleaner(Connection jdbcConn, RepositoryEntry rEntry)
      throws DBCleanException
   {
      SecurityHelper.validateSecurityPermission(JCRRuntimePermissions.MANAGE_REPOSITORY_PERMISSION);

      WorkspaceEntry wsEntry = rEntry.getWorkspaceEntries().get(0);

      boolean multiDb = getMultiDbParameter(wsEntry);
      if (multiDb)
      {
         throw new DBCleanException(
View Full Code Here

      catch (RepositoryConfigurationException e)
      {
         throw new BackupOperationException("Can not get repository \"" + config.getRepository() + "\"", e);
      }

      WorkspaceEntry wEntry = null;

      for (WorkspaceEntry entry : repository.getWorkspaceEntries())
      {
         if (entry.getName().equals(config.getWorkspace()))
         {
View Full Code Here

                     ReplicationChannelManager channelManager =
                        new ReplicationChannelManager(props, channelName + (channelName.equals("") ? "" : "_")
                           + uniqueNoame);

                     WorkspaceContainerFacade wsFacade = jcrRepository.getWorkspaceContainer(workspaces[wIndex]);
                     WorkspaceEntry wconf = (WorkspaceEntry)wsFacade.getComponent(WorkspaceEntry.class);

                     int maxBufferSize =
                        wconf.getContainer().getParameterInteger(WorkspaceDataContainer.MAXBUFFERSIZE_PROP,
                           WorkspaceDataContainer.DEF_MAXBUFFERSIZE);

                     FileCleanerHolder wfcleaner = (FileCleanerHolder)wsFacade.getComponent(FileCleanerHolder.class);
                     FileCleaner fileCleaner = wfcleaner.getFileCleaner();
View Full Code Here

      defRep.configWorkspace(workspaceEntry);
      defRep.createWorkspace(workspaceEntry.getName());

      //set original workspace initializer
      WorkspaceContainerFacade wcf = defRep.getWorkspaceContainer(workspaceEntry.getName());
      WorkspaceEntry createdWorkspaceEntry = (WorkspaceEntry)wcf.getComponent(WorkspaceEntry.class);
      createdWorkspaceEntry.setInitializer(wieOriginal);
   }
View Full Code Here

            ClassNotFoundException
   {
      List<WorkspaceEntry> originalWorkspaceEntrys = repositoryEntry.getWorkspaceEntries();

      //Getting system workspace entry
      WorkspaceEntry systemWorkspaceEntry = null;

      for (WorkspaceEntry wsEntry : originalWorkspaceEntrys)
      {
         if (wsEntry.getName().equals(repositoryEntry.getSystemWorkspaceName()))
         {
            systemWorkspaceEntry = wsEntry;
            break;
         }
      }

      WorkspaceInitializerEntry wieOriginal = systemWorkspaceEntry.getInitializer();

      //getting backup chail log to system workspace.
      BackupChainLog systemBackupChainLog = workspacesMapping.get(systemWorkspaceEntry.getName());
     
      WorkspaceInitializerEntry wiEntry = getWorkspaceInitializerEntry(systemBackupChainLog);

      // set initializer
      systemWorkspaceEntry.setInitializer(wiEntry);

      ArrayList<WorkspaceEntry> newEntries = new ArrayList<WorkspaceEntry>();
      newEntries.add(systemWorkspaceEntry);

      repositoryEntry.setWorkspaceEntries(newEntries);

      String currennWorkspaceName = repositoryEntry.getSystemWorkspaceName();

      boolean restored = true;
      try
      {
         repositoryService.createRepository(repositoryEntry);

         //set original initializer to created workspace.
         RepositoryImpl defRep = (RepositoryImpl)repositoryService.getRepository(repositoryEntry.getName());
         WorkspaceContainerFacade wcf = defRep.getWorkspaceContainer(systemWorkspaceEntry.getName());
         WorkspaceEntry createdWorkspaceEntry = (WorkspaceEntry)wcf.getComponent(WorkspaceEntry.class);
         createdWorkspaceEntry.setInitializer(wieOriginal);

         // save configuration to persistence (file or persister)
         repositoryService.getConfig().retain();

         for (WorkspaceEntry wsEntry : originalWorkspaceEntrys)
View Full Code Here

      registerComponentImplementation(DefaultAccessManagerImpl.class);

      registerComponentImplementation(SessionRegistry.class);

      String systemWsname = config.getSystemWorkspaceName();
      WorkspaceEntry systemWsEntry = getWorkspaceEntry(systemWsname);

      if (systemWsEntry != null && systemWsEntry.getQueryHandler() != null)
      {
         SystemSearchManager systemSearchManager =
            (SystemSearchManager)getWorkspaceContainer(systemWsname).getComponentInstanceOfType(
               SystemSearchManager.class);
         registerComponentInstance(new SystemSearchManagerHolder(systemSearchManager));
View Full Code Here

TOP

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

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.