Commit 24ce79d8 authored by Ate Douma's avatar Ate Douma

CMS7-7024: exposing EffectiveNodeTypeItem type info in json output

parent 1ca9d71a
......@@ -34,7 +34,7 @@ public class EffectiveNodeTypeChildImpl extends EffectiveNodeTypeItemImpl implem
}
public EffectiveNodeTypeChildImpl(String name, String definingType) {
super(name, definingType);
super(name, definingType, true);
}
@Override
......
......@@ -16,9 +16,12 @@
package org.onehippo.cms7.services.contenttype;
import org.codehaus.jackson.annotate.JsonProperty;
public abstract class EffectiveNodeTypeItemImpl extends Sealable implements EffectiveNodeTypeItem {
private final String name;
private final String definingType;
private final boolean nodeType;
private final boolean residual;
private boolean multiple;
private boolean mandatory;
......@@ -28,10 +31,16 @@ public abstract class EffectiveNodeTypeItemImpl extends Sealable implements Effe
protected void doSeal() {
}
protected EffectiveNodeTypeItemImpl(String name, String definingType) {
protected EffectiveNodeTypeItemImpl(String name, String definingType, boolean nodeType) {
this.name = name;
this.definingType = definingType;
this.residual = "*".equals(name);
this.nodeType = nodeType;
}
@JsonProperty
public boolean isNodeType() {
return nodeType;
}
@Override
......
......@@ -35,7 +35,7 @@ public class EffectiveNodeTypePropertyImpl extends EffectiveNodeTypeItemImpl imp
}
public EffectiveNodeTypePropertyImpl(String name, String definingType, int requiredType) {
super(name, definingType);
super(name, definingType, false);
this.requiredType = requiredType;
}
......
......@@ -11,6 +11,7 @@
"jcr:content" : [ {
"name" : "jcr:content",
"definingType" : "nt:file",
"nodeType" : true,
"residual" : false,
"multiple" : false,
"mandatory" : true,
......@@ -25,6 +26,7 @@
"jcr:created" : [ {
"name" : "jcr:created",
"definingType" : "mix:created",
"nodeType" : false,
"residual" : false,
"multiple" : false,
"mandatory" : false,
......@@ -38,6 +40,7 @@
"jcr:createdBy" : [ {
"name" : "jcr:createdBy",
"definingType" : "mix:created",
"nodeType" : false,
"residual" : false,
"multiple" : false,
"mandatory" : false,
......@@ -51,6 +54,7 @@
"jcr:mixinTypes" : [ {
"name" : "jcr:mixinTypes",
"definingType" : "nt:base",
"nodeType" : false,
"residual" : false,
"multiple" : true,
"mandatory" : false,
......@@ -64,6 +68,7 @@
"jcr:primaryType" : [ {
"name" : "jcr:primaryType",
"definingType" : "nt:base",
"nodeType" : false,
"residual" : false,
"multiple" : false,
"mandatory" : true,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment