如果apache Jackrabbit 2.17.5中具有任何强制性的nodetype属性更新(删除),则无法重新注册自定义NodeTypes

时间:2018-10-30 20:23:30

标签: java apache jcr jackrabbit

开始:可以说我有一些自定义节点类型,如下所示。

    <test = 'http://abcd.com/test'>
    <nt='http://www.jcp.org/jcr/nt/1.0'>
    <mix='http://www.jcp.org/jcr/mix/1.0'>

    [test:base] > nt:base
    - name (string) mandatory version
    - data (long) mandatory version
    - category (string) version multiple
    - version (string) version

    [test:file] > nt:file
    - filename (string) mandatory

    [test:template] > test:base
    + * (test:file) version

After that I changed the above custom properties as :

    <test = 'http://abcd.com/test'>
    <nt='http://www.jcp.org/jcr/nt/1.0'>
    <mix='http://www.jcp.org/jcr/mix/1.0'>

    [test:base] > nt:base
    - name (string) mandatory version
    - category (string) version multiple
    - version (string) version

    [test:file] > nt:file
    - filename (string) mandatory

    [test:template] > test:base
    + * (test:file) version

在这里,我删除了属性“ data”,并尝试使用重新注册        CndImporter.registerNodeTypes(...);

现在,当我尝试再次注册节点类型时,我得到的错误是休假:

Caused by: javax.jcr.RepositoryException: The following node type change contains non-trivial changes.Up until now only trivial changes are supported. (see javadoc for org.apache.jackrabbit.spi.commons.nodetype.NodeTypeDefDiff):
org.apache.jackrabbit.spi.commons.nodetype.NodeTypeDefDiff[
    nodeTypeName={http://abcd.com/test}base,
    mixinFlagDiff=NONE,
    supertypesDiff=NONE,
    propertyDifferences=[
        org.apache.jackrabbit.spi.commons.nodetype.NodeTypeDefDiff$PropDefDiff[itemName={}version, type=TRIVIAL, operation=MODIFIED],
        org.apache.jackrabbit.spi.commons.nodetype.NodeTypeDefDiff$PropDefDiff[itemName={}data, type=MAJOR, operation=REMOVED],
        org.apache.jackrabbit.spi.commons.nodetype.NodeTypeDefDiff$PropDefDiff[itemName={}name, type=TRIVIAL, operation=MODIFIED],
        org.apache.jackrabbit.spi.commons.nodetype.NodeTypeDefDiff$PropDefDiff[itemName={}category, type=TRIVIAL, operation=MODIFIED]
    ],
    childNodeDifferences=[
    ]
]

    at org.apache.jackrabbit.core.nodetype.NodeTypeRegistry.checkForConflictingContent(NodeTypeRegistry.java:947)
    at org.apache.jackrabbit.core.nodetype.NodeTypeRegistry.reregisterNodeType(NodeTypeRegistry.java:435)
    at org.apache.jackrabbit.core.nodetype.NodeTypeRegistry.reregisterNodeType(NodeTypeRegistry.java:384)
    at org.apache.jackrabbit.core.nodetype.NodeTypeManagerImpl.registerNodeTypes(NodeTypeManagerImpl.java:596)
    at org.apache.jackrabbit.commons.cnd.CndImporter.registerNodeTypes(CndImporter.java:162)
    at org.apache.jackrabbit.commons.cnd.CndImporter.registerNodeTypes(CndImporter.java:110)

1 个答案:

答案 0 :(得分:0)

是的,这是设计使然。删除属性定义可能会导致您的回购内容无效。

可能的工作是将属性定义更改为可选。