Page tree
Skip to end of metadata
Go to start of metadata
ComponentModelExample.java
// Basic Freemarker Compontent Model Example

package magnolia.model.component.freemarker;

import info.magnolia.rendering.model.RenderingModel;
import info.magnolia.rendering.model.RenderingModelImpl;
import info.magnolia.rendering.template.RenderableDefinition;
import info.magnolia.rendering.template.registry.TemplateDefinitionRegistry;

import javax.jcr.Node;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ComponentModel<RD extends RenderableDefinition> extends RenderingModelImpl<RD> {

    public static final Logger log = LoggerFactory.getLogger(ComponentModel.class);

    public ComponentModel(Node content, RD definition, RenderingModel<?> parent, TemplateDefinitionRegistry templateDefinitions) throws Exception {
 
        super(content, definition, parent);
    }
 
    @Override
    public String execute() {

        return super.execute();
    }

    public String helloCompontent() {

        return "helloCompontent 42";
    }

}