Examples of NodeTypeValue


Examples of org.exoplatform.services.jcr.core.nodetype.NodeTypeValue

   }

   public void testReregisterisAllowsSameNameSiblingsChangeChildNodeDefinition() throws Exception
   {
      // create new NodeType value
      NodeTypeValue testNValue = new NodeTypeValue();

      List<String> superType = new ArrayList<String>();
      superType.add("nt:base");
      testNValue.setName("exo:testReregisterisAllowsSameNameSiblingsChangeChildNodeDefinition");
      testNValue.setPrimaryItemName("");
      testNValue.setDeclaredSupertypeNames(superType);

      List<NodeDefinitionValue> nodes = new ArrayList<NodeDefinitionValue>();

      nodes.add(new NodeDefinitionValue("child", false, false, 1, false, "nt:unstructured", new ArrayList<String>(),
         true));
      testNValue.setDeclaredChildNodeDefinitionValues(nodes);

      nodeTypeManager.registerNodeType(testNValue, ExtendedNodeTypeManager.FAIL_IF_EXISTS);

      testNValue = nodeTypeManager.getNodeTypeValue(testNValue.getName());

      Node testNode = root.addNode("testNode", testNValue.getName());
      Node child = testNode.addNode("child");
      Node child1 = child.addNode("child");
      Node child2 = child.addNode("child");
      session.save();

      nodes = new ArrayList<NodeDefinitionValue>();
      nodes.add(new NodeDefinitionValue("child", false, false, 1, false, "nt:unstructured", new ArrayList<String>(),
         false));
      testNValue.setDeclaredChildNodeDefinitionValues(nodes);

      try
      {
         nodeTypeManager.registerNodeType(testNValue, ExtendedNodeTypeManager.REPLACE_IF_EXISTS);
         fail();
View Full Code Here

Examples of org.exoplatform.services.jcr.core.nodetype.NodeTypeValue

   }

   public void testReregisterisAllowsSameNameSiblingsChangeResidualChildNodeDefinition() throws Exception
   {
      // create new NodeType value
      NodeTypeValue testNValue = new NodeTypeValue();

      List<String> superType = new ArrayList<String>();
      superType.add("nt:base");
      testNValue.setName("exo:testReregisterisAllowsSameNameSiblingsChangeResidualChildNodeDefinition");
      testNValue.setPrimaryItemName("");
      testNValue.setDeclaredSupertypeNames(superType);

      List<NodeDefinitionValue> nodes = new ArrayList<NodeDefinitionValue>();

      nodes.add(new NodeDefinitionValue("*", false, false, 1, false, "nt:unstructured", new ArrayList<String>(), true));
      testNValue.setDeclaredChildNodeDefinitionValues(nodes);

      nodeTypeManager.registerNodeType(testNValue, ExtendedNodeTypeManager.FAIL_IF_EXISTS);

      testNValue = nodeTypeManager.getNodeTypeValue(testNValue.getName());

      Node testNode = root.addNode("testNode", testNValue.getName());
      Node child = testNode.addNode("child");
      Node child1 = child.addNode("child");
      Node child2 = child.addNode("child");
      session.save();

      nodes = new ArrayList<NodeDefinitionValue>();
      nodes
         .add(new NodeDefinitionValue("*", false, false, 1, false, "nt:unstructured", new ArrayList<String>(), false));
      testNValue.setDeclaredChildNodeDefinitionValues(nodes);

      try
      {
         nodeTypeManager.registerNodeType(testNValue, ExtendedNodeTypeManager.REPLACE_IF_EXISTS);
         fail();
View Full Code Here

Examples of org.exoplatform.services.jcr.core.nodetype.NodeTypeValue

   }

   public void testReregisterFromNameToResidualChangeRequiredNodeType() throws Exception
   {
      // create new NodeType value
      NodeTypeValue testNValue = new NodeTypeValue();

      List<String> superType = new ArrayList<String>();
      superType.add("nt:base");
      testNValue.setName("exo:testReregisterFromNameToResidualChechRequiredNodeType");
      testNValue.setPrimaryItemName("");
      testNValue.setDeclaredSupertypeNames(superType);

      List<NodeDefinitionValue> nodes = new ArrayList<NodeDefinitionValue>();

      nodes.add(new NodeDefinitionValue("child", false, false, 1, false, "nt:base", new ArrayList<String>(), true));
      testNValue.setDeclaredChildNodeDefinitionValues(nodes);

      nodeTypeManager.registerNodeType(testNValue, ExtendedNodeTypeManager.FAIL_IF_EXISTS);

      testNValue = nodeTypeManager.getNodeTypeValue(testNValue.getName());

      Node testNode = root.addNode("testNode", testNValue.getName());
      Node child = testNode.addNode("child", "nt:file");
      Node cont = child.addNode("jcr:content", "nt:resource");
      cont.setProperty("jcr:mimeType", "text");
      cont.setProperty("jcr:lastModified", new GregorianCalendar(2011, 3, 4));
      cont.setProperty("jcr:data", "test text");
      session.save();
      session.save();

      nodes = new ArrayList<NodeDefinitionValue>();
      List<String> requeredPrimaryType = new ArrayList<String>();
      requeredPrimaryType.add("nt:unstructured");
      nodes.add(new NodeDefinitionValue("*", false, false, 1, false, "nt:unstructured", requeredPrimaryType, true));
      testNValue.setDeclaredChildNodeDefinitionValues(nodes);

      try
      {
         nodeTypeManager.registerNodeType(testNValue, ExtendedNodeTypeManager.REPLACE_IF_EXISTS);
         fail();
View Full Code Here

Examples of org.exoplatform.services.jcr.core.nodetype.NodeTypeValue

   }

   public void testReregisterFromNameToResidualChangeSameNameSibling() throws Exception
   {
      // create new NodeType value
      NodeTypeValue testNValue = new NodeTypeValue();

      List<String> superType = new ArrayList<String>();
      superType.add("nt:base");
      testNValue.setName("exo:testReregister");
      testNValue.setPrimaryItemName("");
      testNValue.setDeclaredSupertypeNames(superType);

      List<NodeDefinitionValue> nodes = new ArrayList<NodeDefinitionValue>();

      nodes.add(new NodeDefinitionValue("child", false, false, 1, false, "nt:unstructured", new ArrayList<String>(),
         true));
      testNValue.setDeclaredChildNodeDefinitionValues(nodes);

      nodeTypeManager.registerNodeType(testNValue, ExtendedNodeTypeManager.FAIL_IF_EXISTS);

      testNValue = nodeTypeManager.getNodeTypeValue(testNValue.getName());

      Node testNode = root.addNode("testNode", testNValue.getName());
      Node child = testNode.addNode("child");
      child.addNode("subchild1");
      child.addNode("subchild1");
      session.save();

      nodes = new ArrayList<NodeDefinitionValue>();
      nodes
         .add(new NodeDefinitionValue("*", false, false, 1, false, "nt:unstructured", new ArrayList<String>(), false));
      testNValue.setDeclaredChildNodeDefinitionValues(nodes);

      try
      {
         nodeTypeManager.registerNodeType(testNValue, ExtendedNodeTypeManager.REPLACE_IF_EXISTS);
         fail();
View Full Code Here

Examples of org.exoplatform.services.jcr.core.nodetype.NodeTypeValue

      nodeTypeManager.registerNodeType(testNValue, ExtendedNodeTypeManager.REPLACE_IF_EXISTS);
   }

   public void testReregisterIsMixinChange1() throws Exception
   {
      NodeTypeValue testNValue = new NodeTypeValue();

      List<String> superType = new ArrayList<String>();
      superType.add("nt:base");
      testNValue.setName("exo:testReregisterIsMixinChange1");
      testNValue.setPrimaryItemName("");
      testNValue.setDeclaredSupertypeNames(superType);
      testNValue.setMixin(false);
      nodeTypeManager.registerNodeType(testNValue, ExtendedNodeTypeManager.FAIL_IF_EXISTS);
      testNValue = nodeTypeManager.getNodeTypeValue(testNValue.getName());

      Node testNode = root.addNode("testNode", testNValue.getName());
      session.save();
      testNValue.setMixin(true);
      try
      {
         nodeTypeManager.registerNodeType(testNValue, ExtendedNodeTypeManager.REPLACE_IF_EXISTS);
         fail();
      }
      catch (ConstraintViolationException e)
      {
         // ok
      }
      testNode.remove();
      session.save();

      nodeTypeManager.registerNodeType(testNValue, ExtendedNodeTypeManager.REPLACE_IF_EXISTS);

      testNode = root.addNode("testNode");
      testNode.addMixin(testNValue.getName());
      session.save();
   }
View Full Code Here

Examples of org.exoplatform.services.jcr.core.nodetype.NodeTypeValue

      session.save();
   }

   public void testReregisterIsMixinChange2() throws Exception
   {
      NodeTypeValue testNValue = new NodeTypeValue();

      List<String> superType = new ArrayList<String>();
      superType.add("nt:base");
      testNValue.setName("exo:testReregisterIsMixinChange2");
      testNValue.setPrimaryItemName("");
      testNValue.setDeclaredSupertypeNames(superType);
      testNValue.setMixin(true);
      nodeTypeManager.registerNodeType(testNValue, ExtendedNodeTypeManager.FAIL_IF_EXISTS);
      testNValue = nodeTypeManager.getNodeTypeValue(testNValue.getName());

      Node testNode = root.addNode("testNode");
      testNode.addMixin(testNValue.getName());
      session.save();

      testNValue.setMixin(false);
      try
      {
         nodeTypeManager.registerNodeType(testNValue, ExtendedNodeTypeManager.REPLACE_IF_EXISTS);
         fail();
      }
      catch (ConstraintViolationException e)
      {
         // ok
      }
      testNode.remove();
      session.save();

      nodeTypeManager.registerNodeType(testNValue, ExtendedNodeTypeManager.REPLACE_IF_EXISTS);

      testNode = root.addNode("testNode", testNValue.getName());
      session.save();
   }
View Full Code Here

Examples of org.exoplatform.services.jcr.core.nodetype.NodeTypeValue

   }

   public void testCyclicDependencies() throws Exception
   {
      List<NodeTypeValue> list = new ArrayList<NodeTypeValue>();
      NodeTypeValue testNValueA = new NodeTypeValue();
      testNValueA.setName("exo:testCyclicDependenciesA");
      NodeTypeValue testNValueB = new NodeTypeValue();
      testNValueB.setName("exo:testCyclicDependenciesB");

      List<String> superTypeA = new ArrayList<String>();
      superTypeA.add("nt:base");
      superTypeA.add(testNValueB.getName());

      testNValueA.setPrimaryItemName("");
      testNValueA.setDeclaredSupertypeNames(superTypeA);
      testNValueA.setMixin(false);

      List<String> superTypeB = new ArrayList<String>();
      superTypeB.add("nt:base");
      superTypeB.add(testNValueA.getName());

      testNValueB.setPrimaryItemName("");
      testNValueB.setDeclaredSupertypeNames(superTypeB);
      testNValueB.setMixin(false);

      list.add(testNValueA);
      list.add(testNValueB);

      nodeTypeManager.registerNodeTypes(list, ExtendedNodeTypeManager.FAIL_IF_EXISTS);
View Full Code Here

Examples of org.exoplatform.services.jcr.core.nodetype.NodeTypeValue

   }

   public void testRandomSequenceDependencies() throws Exception
   {
      List<NodeTypeValue> list = new ArrayList<NodeTypeValue>();
      NodeTypeValue testNValueA = new NodeTypeValue();
      testNValueA.setName("exo:testRandomSequenceDependenciesA");
      NodeTypeValue testNValueB = new NodeTypeValue();
      testNValueB.setName("exo:testRandomSequenceDependenciesB");

      List<String> superTypeA = new ArrayList<String>();
      superTypeA.add("nt:base");
      superTypeA.add(testNValueB.getName());

      testNValueA.setPrimaryItemName("");
      testNValueA.setDeclaredSupertypeNames(superTypeA);
      testNValueA.setMixin(false);

      List<String> superTypeB = new ArrayList<String>();
      superTypeB.add("nt:base");

      testNValueB.setPrimaryItemName("");
      testNValueB.setDeclaredSupertypeNames(superTypeB);
      testNValueB.setMixin(false);

      list.add(testNValueA);
      list.add(testNValueB);

      nodeTypeManager.registerNodeTypes(list, ExtendedNodeTypeManager.FAIL_IF_EXISTS);
View Full Code Here

Examples of org.exoplatform.services.jcr.core.nodetype.NodeTypeValue

   }

   public void testCyclicUnresolvedDependencies() throws Exception
   {
      List<NodeTypeValue> list = new ArrayList<NodeTypeValue>();
      NodeTypeValue testNValueA = new NodeTypeValue();
      testNValueA.setName("exo:testCyclicUnresolvedDependenciesA");
      NodeTypeValue testNValueB = new NodeTypeValue();
      testNValueB.setName("exo:testCyclicUnresolvedDependenciesB");

      List<String> superTypeA = new ArrayList<String>();
      superTypeA.add("nt:base");
      superTypeA.add(testNValueB.getName());

      testNValueA.setPrimaryItemName("");
      testNValueA.setDeclaredSupertypeNames(superTypeA);
      testNValueA.setMixin(false);

      List<String> superTypeB = new ArrayList<String>();
      superTypeB.add("nt:base");
      superTypeB.add("exo:testCyclicUnresolvedDependenciesC");

      testNValueB.setPrimaryItemName("");
      testNValueB.setDeclaredSupertypeNames(superTypeB);
      testNValueB.setMixin(false);

      list.add(testNValueA);
      list.add(testNValueB);

      try
View Full Code Here

Examples of org.exoplatform.services.jcr.core.nodetype.NodeTypeValue

      session.save();
   }

   public void testNodeTypePersistedUnregistration() throws Exception
   {
      NodeTypeValue testNtv = new NodeTypeValue();
      testNtv.setName("testingNodeType");

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

      InternalQName testingNodeTypeName = new InternalQName("", "testingNodeType");
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.