[ 
https://issues.apache.org/jira/browse/OAK-8961?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jorge Flórez updated OAK-8961:
------------------------------
    Attachment: multiple nodes.png

> Insertion of property definitions with the same name
> ----------------------------------------------------
>
>                 Key: OAK-8961
>                 URL: https://issues.apache.org/jira/browse/OAK-8961
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>    Affects Versions: 1.12.0
>            Reporter: Jorge Flórez
>            Priority: Major
>         Attachments: multiple nodes.png
>
>
> Tested on version 1.12.0.
> Invoking the following code multiple times (it inserts a new property into an 
> existing node type) 
> NodeTypeManager nodeTypeManager =
>  session.getWorkspace().getNodeTypeManager();
>  
>  NodeType repositoryType = nodeTypeManager.getNodeType("testType");
>  NodeTypeTemplate repositoryTypeTemplate =
>  nodeTypeManager.createNodeTypeTemplate(repositoryType);
>  PropertyDefinitionTemplate testProperty =
>  nodeTypeManager.createPropertyDefinitionTemplate();
>  testProperty.setName("testProperty");
>  testProperty.setRequiredType(PropertyType.STRING);
>  testProperty.setMandatory(false);
>  testProperty.setMultiple(false);
>  testProperty.setDefaultValues(new Value[0]);
>  testProperty.setValueConstraints(new String[0]);
>  repositoryTypeTemplate.getPropertyDefinitionTemplates().add(testProperty);
>  
>  nodeTypeManager.registerNodeType(repositoryTypeTemplate, true);
>  session.save();
> results in the node type having multiple jcr:propertyDefinition nodes with 
> the same name in the node type. For example:
> {
>      "node": "testType",
>      "path": "/jcr:system/jcr:nodeTypes/testType",
>      "children": [
>          {
>              "node": "jcr:propertyDefinition",
>              "path": 
> "/jcr:system/jcr:nodeTypes/testType/jcr:propertyDefinition",
>              "properties": [
>                  "jcr:name = testProperty"
>              ]
>          },
>          {
>              "node": "jcr:propertyDefinition[2]",
>              "path": 
> "/jcr:system/jcr:nodeTypes/testType/jcr:propertyDefinition[2]",
>             "properties": [
>                  "jcr:name = testProperty"
>              ]
>          },
>          {
>              "node": "jcr:propertyDefinition[3]",
>              "path": 
> "/jcr:system/jcr:nodeTypes/testType/jcr:propertyDefinition[3]",
>             "properties": [
>                  "jcr:name = testProperty"
>              ]
>          }
>     ]
> }
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to