Package org.exoplatform.services.jcr.ext.registry

Examples of org.exoplatform.services.jcr.ext.registry.RegistryEntry


      }

      observationListenerConfiguration = new ObservationListenerConfiguration();

      String entryPath = RegistryService.EXO_SERVICES + "/" + SERVICE_NAME + "/" + "nodeType";
      RegistryEntry registryEntry = registryService.getEntry(sessionProvider, entryPath);
      Document doc = registryEntry.getDocument();
      Element element = doc.getDocumentElement();
      nodeType = getAttributeSmart(element, "value");

      entryPath = RegistryService.EXO_SERVICES + "/" + SERVICE_NAME + "/" + "repository";
      registryEntry = registryService.getEntry(sessionProvider, entryPath);
      doc = registryEntry.getDocument();
      element = doc.getDocumentElement();
      observationListenerConfiguration.setRepository(getAttributeSmart(element, "value"));

      entryPath = RegistryService.EXO_SERVICES + "/" + SERVICE_NAME + "/" + "workspaces";
      registryEntry = registryService.getEntry(sessionProvider, entryPath);
      doc = registryEntry.getDocument();
      element = doc.getDocumentElement();
      String workspaces = getAttributeSmart(element, "value");

      String ws[] = workspaces.split(";");
      List<String> wsList = new ArrayList<String>();
View Full Code Here


      element = doc.createElement("repository");
      setAttributeSmart(element, "value", observationListenerConfiguration.getRepository());
      root.appendChild(element);

      RegistryEntry serviceEntry = new RegistryEntry(doc);
      registryService.createEntry(sessionProvider, RegistryService.EXO_SERVICES, serviceEntry);
   }
View Full Code Here

    */
   private void readParamsFromRegistryService(SessionProvider sessionProvider) throws PathNotFoundException,
            RepositoryException
   {
      String entryPath = RegistryService.EXO_SERVICES + "/" + SERVICE_NAME + "/" + "workspace";
      RegistryEntry registryEntry = registryService.getEntry(sessionProvider, entryPath);
      Document doc = registryEntry.getDocument();
      Element element = doc.getDocumentElement();
      repoWorkspaceName = getAttributeSmart(element, "value");

      entryPath = RegistryService.EXO_SERVICES + "/" + SERVICE_NAME + "/" + "rootNode";
      registryEntry = registryService.getEntry(sessionProvider, entryPath);
      doc = registryEntry.getDocument();
      element = doc.getDocumentElement();
      rootNodePath = getAttributeSmart(element, "value");

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

      element = doc.createElement("rootNode");
      setAttributeSmart(element, "value", rootNodePath);
      root.appendChild(element);

      RegistryEntry serviceEntry = new RegistryEntry(doc);
      registryService.createEntry(sessionProvider, RegistryService.EXO_SERVICES, serviceEntry);
   }
View Full Code Here

     String pathDefault = RegistryService.EXO_SERVICES + "/Audit/defaultIdentity";
     String pathAdmin = RegistryService.EXO_SERVICES + "/Audit/adminIdentity";
     SessionProvider sessionProvider = SessionProvider.createSystemProvider();
     try {
        // A value is expected for the default identity
        RegistryEntry registryEntry = registry.getEntry(sessionProvider, pathDefault);
        Document doc = registryEntry.getDocument();
        Element element = doc.getDocumentElement();
        String defaultIdentity;
        assertNotNull(defaultIdentity = element.getAttribute( "value"));
       
        // A value is expected for the admin identity
        registryEntry = registry.getEntry(sessionProvider, pathAdmin);
        doc = registryEntry.getDocument();
        element = doc.getDocumentElement();
        String adminIdentity;
        assertNotNull(adminIdentity = element.getAttribute( "value"));
       
        // We remove the new entry to simulate old data structure
        registry.removeEntry(sessionProvider, pathDefault);
       
        AuditServiceImpl as = (AuditServiceImpl) service;
        // We restart the service to make sure that it doesn't fail at startup
        as.stop();
        as.start();
       
        // The same value is expected for the default identity
        registryEntry = registry.getEntry(sessionProvider, pathDefault);
        doc = registryEntry.getDocument();
        element = doc.getDocumentElement();
        assertEquals(defaultIdentity, element.getAttribute( "value"));

        // The same value is expected for the admin identity
        registryEntry = registry.getEntry(sessionProvider, pathAdmin);
        doc = registryEntry.getDocument();
        element = doc.getDocumentElement();
        assertEquals(adminIdentity, element.getAttribute( "value"));
     }
     finally {
        sessionProvider.close();  
View Full Code Here

      element = doc.createElement(DEFAULT_INDENTITY);
      setAttributeSmart(element, "value", defaultIdentity);
      root.appendChild(element);

      RegistryEntry serviceEntry = new RegistryEntry(doc);
      registryService.createEntry(sessionProvider, RegistryService.EXO_SERVICES, serviceEntry);
   }
View Full Code Here

   private void readParamsFromRegistryService(SessionProvider sessionProvider) throws PathNotFoundException,
      RepositoryException, RepositoryConfigurationException
   {

      String entryPath = RegistryService.EXO_SERVICES + "/" + SERVICE_NAME + "/" + ADMIN_INDENTITY;
      RegistryEntry registryEntry = registryService.getEntry(sessionProvider, entryPath);
      Document doc = registryEntry.getDocument();
      Element element = doc.getDocumentElement();
      adminIdentity = getAttributeSmart(element, "value");

      LOG.info("Admin identity is read from RegistryService");

      try
      {
         entryPath = RegistryService.EXO_SERVICES + "/" + SERVICE_NAME + "/" + DEFAULT_INDENTITY;
         registryEntry = registryService.getEntry(sessionProvider, entryPath);
         doc = registryEntry.getDocument();
         element = doc.getDocumentElement();
         defaultIdentity= getAttributeSmart(element, "value");

         LOG.info("Default identity is read from RegistryService");
      }
View Full Code Here

      setAttributeSmart(element, DEFAULT_INCREMENTAL_JOB_PERIOD, defIncrPeriod);
      setAttributeSmart(element, FULL_BACKUP_TYPE, fullBackupType);
      setAttributeSmart(element, INCREMENTAL_BACKUP_TYPE, incrementalBackupType);
      root.appendChild(element);

      RegistryEntry serviceEntry = new RegistryEntry(doc);
      registryService.createEntry(sessionProvider, RegistryService.EXO_SERVICES, serviceEntry);
   }
View Full Code Here

    */
   private void readParamsFromRegistryService(SessionProvider sessionProvider) throws PathNotFoundException,
      RepositoryException
   {
      String entryPath = RegistryService.EXO_SERVICES + "/" + SERVICE_NAME + "/" + BACKUP_PROPERTIES;
      RegistryEntry registryEntry = registryService.getEntry(sessionProvider, entryPath);
      Document doc = registryEntry.getDocument();
      Element element = doc.getDocumentElement();

      backupDir = getAttributeSmart(element, BACKUP_DIR);
      defIncrPeriod = getAttributeSmart(element, DEFAULT_INCREMENTAL_JOB_PERIOD);
      fullBackupType = getAttributeSmart(element, FULL_BACKUP_TYPE);
View Full Code Here

      }

      observationListenerConfiguration = new ObservationListenerConfiguration();

      String entryPath = RegistryService.EXO_SERVICES + "/" + SERVICE_NAME + "/" + "nodeType";
      RegistryEntry registryEntry = registryService.getEntry(sessionProvider, entryPath);
      Document doc = registryEntry.getDocument();
      Element element = doc.getDocumentElement();
      nodeType = getAttributeSmart(element, "value");

      entryPath = RegistryService.EXO_SERVICES + "/" + SERVICE_NAME + "/" + "repository";
      registryEntry = registryService.getEntry(sessionProvider, entryPath);
      doc = registryEntry.getDocument();
      element = doc.getDocumentElement();
      observationListenerConfiguration.setRepository(getAttributeSmart(element, "value"));

      entryPath = RegistryService.EXO_SERVICES + "/" + SERVICE_NAME + "/" + "workspaces";
      registryEntry = registryService.getEntry(sessionProvider, entryPath);
      doc = registryEntry.getDocument();
      element = doc.getDocumentElement();
      String workspaces = getAttributeSmart(element, "value");

      String ws[] = workspaces.split(";");
      List<String> wsList = new ArrayList<String>();
View Full Code Here

TOP

Related Classes of org.exoplatform.services.jcr.ext.registry.RegistryEntry

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.