<!-- 
RSS generated by JIRA (9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b) at Mon Feb 12 01:10:30 CET 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>Magnolia - Issue tracker</title>
    <link>https://jira.magnolia-cms.com</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-uk</language>    <build-info>
        <version>9.4.2</version>
        <build-number>940002</build-number>
        <build-date>19-01-2023</build-date>
    </build-info>


<item>
            <title>[DOCU-584] class vs modelClass</title>
                <link>https://jira.magnolia-cms.com/browse/DOCU-584</link>
                <project id="10190" key="DOCU">Documentation</project>
                    <description>&lt;p&gt;I have seen  both the class and modelClass attributes in configurations. &lt;br/&gt;
Could you explain:&lt;/p&gt;

&lt;p&gt;Difference between class vs modelClass attributes?&lt;br/&gt;
When do we use  the class attribute?&lt;br/&gt;
How do we accees it from ftl files?&lt;/p&gt;

&lt;p&gt;Regards&lt;br/&gt;
Asanka&lt;/p&gt;</description>
                <environment>Windows</environment>
        <key id="47980">DOCU-584</key>
            <summary>class vs modelClass</summary>
                <type id="6" iconUrl="https://jira.magnolia-cms.com/secure/viewavatar?size=xsmall&amp;avatarId=10880&amp;avatarType=issuetype">Support Request</type>
                                            <priority id="6" iconUrl="https://jira.magnolia-cms.com/images/icons/priorities/neutral.gif">Neutral</priority>
                        <status id="6" iconUrl="https://jira.magnolia-cms.com/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="7">Not an issue</resolution>
                                        <assignee username="ahietala">Antti Hietala</assignee>
                                    <reporter username="asankadp">asanka perera</reporter>
                        <labels>
                    </labels>
                <created>Tue, 22 Sep 2015 13:34:49 +0200</created>
                <updated>Thu, 24 Sep 2015 08:40:11 +0200</updated>
                            <resolved>Thu, 24 Sep 2015 08:40:11 +0200</resolved>
                                    <version>short term</version>
                                                    <component>documentation-examples</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="113118" author="ahietala" created="Tue, 22 Sep 2015 14:40:08 +0200"  >&lt;p&gt;Hi Asanka,&lt;/p&gt;

&lt;p&gt;The class and modelClass are documented in &lt;a href=&quot;https://documentation.magnolia-cms.com/display/DOCS/Template+definition&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Template definition&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;class&lt;/tt&gt; is the item&apos;s definition class. As the name suggests, it &lt;em&gt;defines&lt;/em&gt; the item. For example, the definition class of a template provides the template&apos;s title, template script and render type. Magnolia can read such details from configuration using the Node2Bean mechanism and set them in the definition class.&lt;/p&gt;

&lt;p&gt;Magnolia provides default definition classes for all template types (pages, areas and components) so typically you don&apos;t need to create your own definition class unless you want to do something special. For example, the travel demo provides its own &lt;a href=&quot;http://git.magnolia-cms.com/gitweb/?p=modules/demo-projects.git;a=blob;f=community/magnolia-travel-demo/src/main/java/info/magnolia/demo/travel/definition/PageTemplateDefinition.java;h=124420da303682af200e62b3ff593345bb87ab97;hb=HEAD&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;PageTemplateDefinition&lt;/a&gt; class although a generic one exists. The custom class has methods to get and set JavaScript files to be rendered at the bottom of the page. (&lt;a href=&quot;https://javadoc.magnolia-cms.com/info.magnolia.demo.travel.definition.PageTemplateDefinition&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Javadoc&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;The definition class is available to the template script via the &lt;tt&gt;def&lt;/tt&gt; &lt;a href=&quot;https://documentation.magnolia-cms.com/display/DOCS/Rendering+context+objects#Renderingcontextobjects-def&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;rendering context object&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;modelClass&lt;/tt&gt; is Java model that contains business logic for the template. In a model class you can perform calculations, get content from somewhere else, or connect to a remote service. For example, the latestCommments component in the Commenting module has its own model class &lt;a href=&quot;http://git.magnolia-cms.com/gitweb/?p=modules/commenting.git;a=blob;f=src/main/java/info/magnolia/module/commenting/frontend/action/LatestComments.java&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;LatestComments&lt;/a&gt; which retrieves a list of latest page comments.&lt;/p&gt;

&lt;p&gt;You should create a model class for item-specific logic. When you find yourself doing processing in a template script that is not reusable for other items such as other components, put the logic into a model class instead.&lt;/p&gt;

&lt;p&gt;The model class is available to the template script via the &lt;tt&gt;model&lt;/tt&gt; &lt;a href=&quot;https://documentation.magnolia-cms.com/display/DOCS/Rendering+context+objects#Renderingcontextobjects-model&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;rendering context object&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://documentation.magnolia-cms.com/display/DOCS/Template+definition&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://documentation.magnolia-cms.com/display/DOCS/Template+definition&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;https://documentation.magnolia-cms.com/display/DOCS/Model&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://documentation.magnolia-cms.com/display/DOCS/Model&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;https://documentation.magnolia-cms.com/display/DOCS/Rendering+context+objects&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://documentation.magnolia-cms.com/display/DOCS/Rendering+context+objects&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10111" key="com.atlassian.jira.toolkit:reporterdomain">
                        <customfieldname>Company</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>yahoo.com</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10031" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of First Response</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 22 Sep 2015 14:40:08 +0200</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_12730" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_14151" key="com.atlassian.jira.toolkit:message">
                        <customfieldname>Docu info</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10061" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comm is not jira-dev</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>false</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10071" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last participant</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>mmuehlebach</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_13136" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            8 years, 21 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10020" key="com.atlassian.jira.toolkit:attachments">
                        <customfieldname>Number of attachments</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10150" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname>Number of comments</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10011" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>ahietala</customfieldvalue>
            <customfieldvalue>asankadp</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10833" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i05bov:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10244" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_14145" key="com.intenso.jira.issue-templates:issue-templates-customfield">
                        <customfieldname>Template</customfieldname>
                        <customfieldvalues>
                            


                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_15131" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Time in Discovery</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10032" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time in Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>