You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Jorge Flórez (Jira)" <ji...@apache.org> on 2020/06/19 12:02:00 UTC
[jira] [Commented] (OAK-8961) Insertion of property definitions
with the same name
[ https://issues.apache.org/jira/browse/OAK-8961?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17140480#comment-17140480 ]
Jorge Flórez commented on OAK-8961:
-----------------------------------
Issue still present in 1.30.0
> 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, 1.30.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:
> !multiple nodes.png!
--
This message was sent by Atlassian Jira
(v8.3.4#803005)