diff --git a/core/src/main/java/com/themecleanflex/models/ExternalModel.java b/core/src/main/java/com/themecleanflex/models/ExternalModel.java new file mode 100644 index 00000000..dc056b0b --- /dev/null +++ b/core/src/main/java/com/themecleanflex/models/ExternalModel.java @@ -0,0 +1,78 @@ +package com.themecleanflex.models; + +import com.peregrine.nodetypes.models.AbstractComponent; +import com.peregrine.nodetypes.models.IComponent; +import com.peregrine.nodetypes.models.Container; +import org.apache.sling.api.resource.Resource; +import org.apache.sling.models.annotations.Default; +import org.apache.sling.models.annotations.DefaultInjectionStrategy; +import org.apache.sling.models.annotations.Exporter; +import org.apache.sling.models.annotations.Model; +import java.util.List; + +import javax.inject.Inject; +import javax.inject.Named; + +/* + //GEN[:DATA + { + "definitions": { + "External": { + "type": "object", + "x-type": "component", + "properties": { + "text": { + "type": "string", + "x-source": "inject", + "x-form-type": "texteditor" + } + } + } + }, + "name": "External", + "componentPath": "themecleanflex/components/external", + "package": "com.themecleanflex.models", + "modelName": "External", + "classNameParent": "AbstractComponent" +} +//GEN] +*/ + +//GEN[:DEF +@Model( + adaptables = Resource.class, + resourceType = "themecleanflex/components/external", + defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL, + adapters = IComponent.class +) +@Exporter( + name = "jackson", + extensions = "json" +) + +//GEN] +public class ExternalModel extends AbstractComponent { + + public ExternalModel(Resource r) { super(r); } + + //GEN[:INJECT + /* {"type":"string","x-source":"inject","x-form-type":"texteditor"} */ + @Inject + private String text; + + +//GEN] + + //GEN[:GETTERS + /* {"type":"string","x-source":"inject","x-form-type":"texteditor"} */ + public String getText() { + return text; + } + + +//GEN] + + //GEN[:CUSTOMGETTERS + //GEN] + +} diff --git a/fragments/external/hatch.js b/fragments/external/hatch.js new file mode 100644 index 00000000..c478156d --- /dev/null +++ b/fragments/external/hatch.js @@ -0,0 +1,5 @@ +module.exports = { + convert: function($, f) { + f.bindPath($) + } +} \ No newline at end of file diff --git a/fragments/external/model.json b/fragments/external/model.json new file mode 100644 index 00000000..c80c4cc7 --- /dev/null +++ b/fragments/external/model.json @@ -0,0 +1,15 @@ +{ + "definitions": { + "External": { + "type": "object", + "x-type": "component", + "properties": { + "htmlCode": { + "type": "string", + "x-source": "inject", + "x-form-type": "textarea" + } + } + } + } +} \ No newline at end of file diff --git a/fragments/external/sample.json b/fragments/external/sample.json new file mode 100644 index 00000000..641e4369 --- /dev/null +++ b/fragments/external/sample.json @@ -0,0 +1,7 @@ +{ + "title": "External", + "group": "", + "model": { + "htmlCode": "