Package org.exoplatform.services.jcr.config

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


               throw new RuntimeException(cause);
            }
         }

         IUnmarshallingContext uctx = factory.createUnmarshallingContext();
         RepositoryServiceConfiguration conf =
                  (RepositoryServiceConfiguration) uctx.unmarshalDocument(PrivilegedFileHelper
                           .fileInputStream(configFile), null);

         RepositoryEntry repositoryEntry = conf.getRepositoryConfiguration(getBackupConfig().getRepository());

         if (repositoryEntry.getWorkspaceEntries().size() != 1)
         {
            throw new WorkspaceRestoreExeption(
                     "The oririginal configuration should be contains only one workspace entry :"
View Full Code Here


         repositoryEntry.setSessionTimeOut(baseRepositoryEntry.getSessionTimeOut());

         ArrayList<RepositoryEntry> repositoryEntries = new ArrayList<RepositoryEntry>();
         repositoryEntries.add(repositoryEntry);

         RepositoryServiceConfiguration newRepositoryServiceConfiguration =
                  new RepositoryServiceConfiguration(serviceConfiguration.getDefaultRepositoryName(), repositoryEntries);

         IBindingFactory bfact;
         try
         {
            bfact = SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<IBindingFactory>()
View Full Code Here

   @Produces(MediaType.APPLICATION_JSON)
   @RolesAllowed("administrators")
   @Path("/repository-service-configuration")
   public Response getRepositoryServiceConfiguration()
   {
      RepositoryServiceConfiguration configuration = repositoryService.getConfig();
      RepositoryServiceConf conf =
         new RepositoryServiceConf(configuration.getRepositoryConfigurations(), configuration
            .getDefaultRepositoryName());
      return Response.ok(conf, MediaType.APPLICATION_JSON_TYPE).cacheControl(NO_CACHE).build();
   }
View Full Code Here

                                                                                          RepositoryConfigurationException {
    WorkspaceEntry wsEntry = null;

    IBindingFactory factory = BindingDirectory.getFactory(RepositoryServiceConfiguration.class);
    IUnmarshallingContext uctx = factory.createUnmarshallingContext();
    RepositoryServiceConfiguration conf = (RepositoryServiceConfiguration) uctx.unmarshalDocument(wEntryStream,
                                                                                                  null);
    RepositoryEntry rEntry = conf.getRepositoryConfiguration(repositoryName);
   
    for (WorkspaceEntry wEntry : rEntry.getWorkspaceEntries())
      if (wEntry.getName().equals(workspaceName))
        wsEntry = wEntry;
   
View Full Code Here

   @Produces(MediaType.APPLICATION_JSON)
   @RolesAllowed("administrators")
   @Path("/repository-service-configuration")
   public Response getRepositoryServiceConfiguration()
   {
      RepositoryServiceConfiguration configuration = repositoryService.getConfig();
      RepositoryServiceConf conf =
         new RepositoryServiceConf(configuration.getRepositoryConfigurations(), configuration
            .getDefaultRepositoryName());
      return Response.ok(conf, MediaType.APPLICATION_JSON_TYPE).cacheControl(NO_CACHE).build();
   }
View Full Code Here

                     + getBackupConfig().getBackupDir().getCanonicalPath());
         }

         IBindingFactory factory = BindingDirectory.getFactory(RepositoryServiceConfiguration.class);
         IUnmarshallingContext uctx = factory.createUnmarshallingContext();
         RepositoryServiceConfiguration conf =
                  (RepositoryServiceConfiguration) uctx.unmarshalDocument(new FileInputStream(configFile), null);

         RepositoryEntry repositoryEntry = conf.getRepositoryConfiguration(getBackupConfig().getRepository());

         if (repositoryEntry.getWorkspaceEntries().size() != 1)
         {
            throw new WorkspaceRestoreExeption(
                     "The oririginal configuration should be contains only one workspace entry :"
View Full Code Here

         repositoryEntry.setSessionTimeOut(baseRepositoryEntry.getSessionTimeOut());

         ArrayList<RepositoryEntry> repositoryEntries = new ArrayList<RepositoryEntry>();
         repositoryEntries.add(repositoryEntry);

         RepositoryServiceConfiguration newRepositoryServiceConfiguration =
                  new RepositoryServiceConfiguration(serviceConfiguration.getDefaultRepositoryName(), repositoryEntries);

         IBindingFactory bfact = BindingDirectory.getFactory(RepositoryServiceConfiguration.class);
         IMarshallingContext mctx = bfact.createMarshallingContext();

         mctx.marshalDocument(newRepositoryServiceConfiguration, "ISO-8859-1", null, saveStream);
View Full Code Here

   @Produces(MediaType.APPLICATION_JSON)
   @RolesAllowed("administrators")
   @Path("/repository-service-configuration")
   public Response getRepositoryServiceConfiguration()
   {
      RepositoryServiceConfiguration configuration = repositoryService.getConfig();
      RepositoryServiceConf conf =
         new RepositoryServiceConf(configuration.getRepositoryConfigurations(), configuration
            .getDefaultRepositoryName());
      return Response.ok(conf, MediaType.APPLICATION_JSON_TYPE).cacheControl(NO_CACHE).build();
   }
View Full Code Here

         OutputStream saveStream = new FileOutputStream(config);
     
         ArrayList<RepositoryEntry> repositoryEntries = new ArrayList<RepositoryEntry>();
         repositoryEntries.add(rEntry);
     
         RepositoryServiceConfiguration newRepositoryServiceConfiguration =
                  new RepositoryServiceConfiguration(serviceConfiguration.getDefaultRepositoryName(), repositoryEntries);
     
         IBindingFactory bfact = BindingDirectory.getFactory(RepositoryServiceConfiguration.class);
         IMarshallingContext mctx = bfact.createMarshallingContext();
     
         mctx.marshalDocument(newRepositoryServiceConfiguration, "ISO-8859-1", null, saveStream);
View Full Code Here

                     + getBackupConfig().getBackupDir().getCanonicalPath());
         }

         IBindingFactory factory = BindingDirectory.getFactory(RepositoryServiceConfiguration.class);
         IUnmarshallingContext uctx = factory.createUnmarshallingContext();
         RepositoryServiceConfiguration conf =
                  (RepositoryServiceConfiguration) uctx.unmarshalDocument(new FileInputStream(configFile), null);

         if (conf.getRepositoryConfigurations().size() != 1)
         {
            throw new RepositoryRestoreExeption(
                     "The oririginal configuration should be contains only one repository entry :"
                              + configFile.getCanonicalPath());
         }

         if (!conf.getRepositoryConfiguration(getBackupConfig().getRepository()).getName().equals(getBackupConfig().getRepository()))
         {
            throw new RepositoryRestoreExeption(
                     "The oririginal configuration should be contains only one repository entry with name \""
                              + getBackupConfig().getRepository() + "\" :"
                              + configFile.getCanonicalPath());
         }
        
        

         return conf.getRepositoryConfiguration(getBackupConfig().getRepository());
      }
View Full Code Here

TOP

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

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.