Examples of NodeTypeDataPersister


Examples of org.exoplatform.services.jcr.impl.core.nodetype.registration.NodeTypeDataPersister

      final String contentType) throws RepositoryException
   {

      final NodeTypeConverter nodeTypeConverter = new NodeTypeConverter(this.locationFactory, this.accessControlPolicy);
      final NodeTypeDataValidator nodeTypeDataValidator = new NodeTypeDataValidator(this.nodeTypeRepository);
      NodeTypeDataPersister serializer = null;
      if (contentType.equalsIgnoreCase(TEXT_XML))
      {
         serializer = new XmlNodeTypeDataPersister(nodeTypeConverter, is);
      }
      else if (contentType.equalsIgnoreCase(TEXT_X_JCR_CND))
      {
         throw new RepositoryException("Unsupported content type:" + contentType);
      }
      else
      {
         throw new RepositoryException("Unsupported content type:" + contentType);
      }
      final List<NodeTypeData> nodeTypes = serializer.getAllNodeTypes();

      // validate
      nodeTypeDataValidator.validateNodeType(nodeTypes);

      nodeTypeRepository.registerNodeType(nodeTypes, this, accessControlPolicy, alreadyExistsBehaviour);
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.core.nodetype.registration.NodeTypeDataPersister

    * {@inheritDoc}
    */
   public List<NodeTypeData> registerNodeTypes(final InputStream is, final int alreadyExistsBehaviour,
      final String contentType) throws RepositoryException
   {
      NodeTypeDataPersister serializer = null;
      if (contentType.equalsIgnoreCase(TEXT_XML))
      {
         serializer = new XmlNodeTypeDataPersister(nodeTypeConverter, is);
      }
      else if (contentType.equalsIgnoreCase(TEXT_X_JCR_CND))
      {
         throw new RepositoryException("Unsupported content type:" + contentType);
      }
      else
      {
         throw new RepositoryException("Unsupported content type:" + contentType);
      }
      final List<NodeTypeData> nodeTypes = serializer.getAllNodeTypes();

      // validate
      nodeTypeDataValidator.validateNodeType(nodeTypes);

      nodeTypeRepository.registerNodeType(nodeTypes, this, accessControlPolicy, alreadyExistsBehaviour);
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.core.nodetype.registration.NodeTypeDataPersister

    * {@inheritDoc}
    */
   public List<NodeTypeData> registerNodeTypes(final InputStream is, final int alreadyExistsBehaviour,
      final String contentType) throws RepositoryException
   {
      NodeTypeDataPersister serializer = null;
      if (contentType.equalsIgnoreCase(TEXT_XML))
      {
         serializer = new XmlNodeTypeDataPersister(nodeTypeConverter, is);
      }
      else if (contentType.equalsIgnoreCase(TEXT_X_JCR_CND))
      {
         throw new RepositoryException("Unsupported content type:" + contentType);
      }
      else
      {
         throw new RepositoryException("Unsupported content type:" + contentType);
      }
      final List<NodeTypeData> nodeTypes = serializer.getAllNodeTypes();

      // validate
      nodeTypeDataValidator.validateNodeType(nodeTypes);

      nodeTypeRepository.registerNodeType(nodeTypes, this, accessControlPolicy, alreadyExistsBehaviour);
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.core.nodetype.registration.NodeTypeDataPersister

      List<NodeTypeValue> list = new ArrayList<NodeTypeValue>();
      list.add(testNtv);

      InternalQName testingNodeTypeName = new InternalQName("", "testingNodeType");

      NodeTypeDataPersister nodeTypeDataPersister =
         new JCRNodeTypeDataPersister((DataManager)session.getTransientNodesManager().getTransactManager(), true);
      nodeTypeDataPersister.start();


      nodeTypeManager.registerNodeTypes(list, ExtendedNodeTypeManager.FAIL_IF_EXISTS);
      assertNotNull(nodeTypeDataPersister.getNodeType(testingNodeTypeName));
      assertNotNull(nodeTypeManager.getNodeType("testingNodeType"));

      nodeTypeManager.unregisterNodeType("testingNodeType");
      try
      {
         nodeTypeManager.getNodeType("testingNodeType");
         fail();
      }
      catch (NoSuchNodeTypeException e)
      {
         // ok
      }
      try
      {
         nodeTypeDataPersister.getNodeType(testingNodeTypeName);
         fail();
      }
      catch (RepositoryException e)
      {
         // ok
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.core.nodetype.registration.NodeTypeDataPersister

    * {@inheritDoc}
    */
   public List<NodeTypeData> registerNodeTypes(final InputStream is, final int alreadyExistsBehaviour,
      final String contentType) throws RepositoryException
   {
      NodeTypeDataPersister serializer = null;
      if (contentType.equalsIgnoreCase(TEXT_XML))
      {
         serializer = new XmlNodeTypeDataPersister(nodeTypeConverter, is);
      }
      else if (contentType.equalsIgnoreCase(TEXT_X_JCR_CND))
      {
         throw new RepositoryException("Unsupported content type:" + contentType);
      }
      else
      {
         throw new RepositoryException("Unsupported content type:" + contentType);
      }
      final List<NodeTypeData> nodeTypes = serializer.getAllNodeTypes();

      // validate
      nodeTypeDataValidator.validateNodeType(nodeTypes);

      nodeTypeRepository.registerNodeType(nodeTypes, this, accessControlPolicy, alreadyExistsBehaviour);
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.core.nodetype.registration.NodeTypeDataPersister

      final String contentType) throws RepositoryException
   {

      final NodeTypeConverter nodeTypeConverter = new NodeTypeConverter(this.locationFactory, this.accessControlPolicy);
      final NodeTypeDataValidator nodeTypeDataValidator = new NodeTypeDataValidator(this.nodeTypeRepository);
      NodeTypeDataPersister serializer = null;
      if (contentType.equalsIgnoreCase(TEXT_XML))
      {
         serializer = new XmlNodeTypeDataPersister(nodeTypeConverter, is);
      }
      else if (contentType.equalsIgnoreCase(TEXT_X_JCR_CND))
      {
         throw new RepositoryException("Unsupported content type:" + contentType);
      }
      else
      {
         throw new RepositoryException("Unsupported content type:" + contentType);
      }
      final List<NodeTypeData> nodeTypes = serializer.getAllNodeTypes();

      // validate
      nodeTypeDataValidator.validateNodeType(nodeTypes);

      nodeTypeRepository.registerNodeType(nodeTypes, this, accessControlPolicy, alreadyExistsBehaviour);
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.core.nodetype.registration.NodeTypeDataPersister

    * {@inheritDoc}
    */
   public List<NodeTypeData> registerNodeTypes(final InputStream is, final int alreadyExistsBehaviour,
      final String contentType) throws RepositoryException
   {
      NodeTypeDataPersister serializer = null;
      if (contentType.equalsIgnoreCase(TEXT_XML))
      {
         serializer = new XmlNodeTypeDataPersister(nodeTypeConverter, is);
      }
      else if (contentType.equalsIgnoreCase(TEXT_X_JCR_CND))
      {
         serializer = new CNDNodeTypeDataPersister(is, (NamespaceRegistryImpl)namespaceRegistry);
      }
      else
      {
         throw new RepositoryException("Unsupported content type:" + contentType);
      }
      final List<NodeTypeData> nodeTypes = serializer.getAllNodeTypes();

      // validate
      nodeTypeDataValidator.validateNodeType(nodeTypes);

      nodeTypeRepository.registerNodeType(nodeTypes, this, accessControlPolicy, alreadyExistsBehaviour);
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.core.nodetype.registration.NodeTypeDataPersister

      final String contentType) throws RepositoryException
   {

      final NodeTypeConverter nodeTypeConverter = new NodeTypeConverter(this.locationFactory, this.accessControlPolicy);
      final NodeTypeDataValidator nodeTypeDataValidator = new NodeTypeDataValidator(this.nodeTypeRepository);
      NodeTypeDataPersister serializer = null;
      if (contentType.equalsIgnoreCase(TEXT_XML))
      {
         serializer = new XmlNodeTypeDataPersister(nodeTypeConverter, is);
      }
      else if (contentType.equalsIgnoreCase(TEXT_X_JCR_CND))
      {
         throw new RepositoryException("Unsupported content type:" + contentType);
      }
      else
      {
         throw new RepositoryException("Unsupported content type:" + contentType);
      }
      final List<NodeTypeData> nodeTypes = serializer.getAllNodeTypes();

      // validate
      nodeTypeDataValidator.validateNodeType(nodeTypes);

      nodeTypeRepository.registerNodeType(nodeTypes, this, accessControlPolicy, alreadyExistsBehaviour);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.