<!-- 
RSS generated by JIRA (9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b) at Sun Feb 11 23:29:08 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>[BLOSSOM-1] Template annotation should allow specifying &quot;class&quot;</title>
                <link>https://jira.magnolia-cms.com/browse/BLOSSOM-1</link>
                <project id="10430" key="BLOSSOM">Blossom</project>
                    <description>&lt;p&gt;Transferred from Sourceforge&lt;/p&gt;

&lt;p&gt;Original description:&lt;/p&gt;

&lt;p&gt;Magnolia templates support a node named &quot;class&quot; that contains the fully qualified class name to be instantiated for that particular template. This is useful, for example, if you want to override the default isAvailable() method.&lt;/p&gt;

&lt;p&gt;The Blossom @Template annotation should allow specifying this value and subsequently configuring it on the blossom generated template.&lt;/p&gt;

&lt;p&gt;Followup comments:&lt;/p&gt;

&lt;p&gt;Good suggestion, though even cooler would be to have isAvailable() directly&lt;br/&gt;
on the controller.&lt;/p&gt;

&lt;p&gt;For now you can subclass DefaultBlossomTemplateRegistry and overload&lt;br/&gt;
writeTemplateDefinition() to add the custom properties that you need.&lt;/p&gt;

&lt;p&gt;Replace &amp;lt;blossom:configuration /&amp;gt; with&lt;/p&gt;

&lt;p&gt;&amp;lt;bean class=&quot;se.issi.magnolia.module.blossom.BlossomConfiguration&quot;&amp;gt;&lt;br/&gt;
&amp;lt;property name=&quot;templateRegistry&quot;&amp;gt;&lt;br/&gt;
&amp;lt;bean class=&quot;some.package.MyCustomTemplateRegistry&quot; /&amp;gt;&lt;br/&gt;
&amp;lt;/property&amp;gt;&lt;br/&gt;
&amp;lt;/bean&amp;gt;&lt;/p&gt;</description>
                <environment></environment>
        <key id="18661">BLOSSOM-1</key>
            <summary>Template annotation should allow specifying &quot;class&quot;</summary>
                <type id="2" iconUrl="https://jira.magnolia-cms.com/secure/viewavatar?size=xsmall&amp;avatarId=10891&amp;avatarType=issuetype">New Feature</type>
                                            <priority id="4" iconUrl="https://jira.magnolia-cms.com/images/icons/priorities/minor.svg">Minor</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="1">Fixed</resolution>
                                        <assignee username="tmattsson">Tobias Mattsson</assignee>
                                    <reporter username="tmattsson">Tobias Mattsson</reporter>
                        <labels>
                    </labels>
                <created>Thu, 1 Jul 2010 17:51:33 +0200</created>
                <updated>Sat, 6 Dec 2014 12:44:42 +0100</updated>
                            <resolved>Tue, 24 Aug 2010 12:27:03 +0200</resolved>
                                                    <fixVersion>1.1.1</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="28971" author="tduffey" created="Thu, 8 Jul 2010 01:09:21 +0200"  >&lt;p&gt;Example usage for attached patch:&lt;/p&gt;

&lt;p&gt;@Template(value = &quot;My Template&quot;, clazz = &quot;com.foo.MyTemplate&quot;)&lt;/p&gt;</comment>
                            <comment id="28972" author="tduffey" created="Thu, 8 Jul 2010 01:10:39 +0200"  >&lt;p&gt;If I subclass DefaultBlossomTemplateRegistry I still need the attached patch applied so I can specify the &quot;clazz&quot; attribute with the @Template annotation.&lt;/p&gt;

&lt;p&gt;If you can provide some direction for having isAvailable() directly on the controller I would be happy to give it a whirl.&lt;/p&gt;</comment>
                            <comment id="28983" author="tmattsson" created="Thu, 8 Jul 2010 13:30:12 +0200"  >&lt;p&gt;My idea is to make DefaultBlossomTemplateRegistry always set the class in repository. The class should be a subclass of Template that when isAvailable() is called finds the BlossomTemplateDescription from the TemplateRegistry and invokes a method on the handler/controller. I&apos;m not sure yet what the best way of declaring that method is. Either using an annotation or implementing an interface.&lt;/p&gt;

&lt;p&gt;The solution with an interface would look something like:&lt;/p&gt;

&lt;p&gt;@Template&lt;br/&gt;
public class MyTemplate implements ConditionallyAvailableTemplate {&lt;br/&gt;
public boolean isAvailable(Content content) &lt;/p&gt;
{ /* something interesting */ }
&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;public class BlossomTemplate extends Template {&lt;br/&gt;
public boolean isAvailable(Content content) {&lt;br/&gt;
BlossomTemplateDescription description = BlossomModule.getTemplateRegistry().getTemplate(getName());&lt;br/&gt;
if (description.getHandler() instanceof ConditionallyAvailableTemplate)&lt;br/&gt;
return ((ConditionallyAvailableTemplate)description.getHandler()).isAvailable(content);&lt;br/&gt;
else&lt;br/&gt;
return super.isAvailable(content);&lt;br/&gt;
}&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;in DefaultTemplateRegistry the class that&apos;s written to repository is BlossomTemplate.class.getName()&lt;/p&gt;
</comment>
                            <comment id="28993" author="tduffey" created="Fri, 9 Jul 2010 06:25:41 +0200"  >&lt;p&gt;The attached patch against trunk allows you to specify a method in your controller like:&lt;/p&gt;

&lt;p&gt;@IsAvailable&lt;br/&gt;
public static boolean isAvailable(Content node) {&lt;br/&gt;
    ...&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;When available, this method will be used instead of the default Magnolia isAvailable() method.  I have two gripes:&lt;/p&gt;

&lt;p&gt;1) Without some Maven or other magic there is no way I know of to ensure that the @IsAvailable annotated method actually follows the required signature pattern.&lt;/p&gt;

&lt;p&gt;2) There is no way to fall back to the default isAvailable() method within your @IsAvailable annotated method.&lt;/p&gt;

&lt;p&gt;That said, it seems to work.  Please let me know what you think, I would like to get some version of this feature into the official module.&lt;/p&gt;</comment>
                            <comment id="28997" author="tmattsson" created="Fri, 9 Jul 2010 11:22:33 +0200"  >&lt;p&gt;I like it. It will get included in the next version.&lt;/p&gt;</comment>
                            <comment id="29005" author="tduffey" created="Fri, 9 Jul 2010 14:44:48 +0200"  >&lt;p&gt;OK, if you don&apos;t mind please give me the weekend to test and do some minor cleanup.  I&apos;ll submit a new patch following the same idea if anything comes up.&lt;/p&gt;</comment>
                            <comment id="29006" author="tduffey" created="Fri, 9 Jul 2010 15:58:49 +0200"  >&lt;p&gt;Please use this patch.  @IsAvailable method signatures are now a bit more flexible and can accept zero, one or two parameters in any order:&lt;/p&gt;

&lt;p&gt;info.magnolia.module.templating.Template (The template being checked)&lt;br/&gt;
info.magnolia.core.cms.Content (Content node for page in AdminCentral)&lt;/p&gt;

&lt;p&gt; Some examples:&lt;/p&gt;

&lt;p&gt;@IsAvailable&lt;br/&gt;
public boolean isAvailable() &lt;/p&gt;
{ return true; }

&lt;p&gt; @IsAvailable&lt;br/&gt;
 public boolean isAvailable(Content node) &lt;/p&gt;
{ ... }&lt;br/&gt;
&lt;br/&gt;
 @IsAvailable&lt;br/&gt;
 public boolean isAvailable(Template template, Content node) { ... }

&lt;p&gt;If an unknown parameter type is found on an @IsAvailable annotated method then an error is logged and the template will not be available.&lt;/p&gt;</comment>
                            <comment id="29385" author="tduffey" created="Thu, 12 Aug 2010 21:15:22 +0200"  >&lt;p&gt;Tobias, any update on this?  We have the V2 patch in production and working well...&lt;/p&gt;</comment>
                            <comment id="29549" author="tmattsson" created="Mon, 23 Aug 2010 19:23:32 +0200"  >&lt;p&gt;It&apos;s coming along now. Could you elaborate on why you want to have a reference to BlossomTemplate as a possible argument to the method? I don&apos;t see the point.&lt;/p&gt;</comment>
                            <comment id="29552" author="tmattsson" created="Tue, 24 Aug 2010 12:27:03 +0200"  >&lt;p&gt;Implemented with a new annotation called @Available. The annotated method must return boolean and can take an argument of type Content. An annotated method in a super class is detected and used.&lt;/p&gt;</comment>
                            <comment id="29557" author="tduffey" created="Tue, 24 Aug 2010 13:55:03 +0200"  >&lt;p&gt;In hindsight I don&apos;t think having access to the BlossomTemplate is very useful.  Thanks for integrating this.&lt;/p&gt;</comment>
                            <comment id="95914" author="had" created="Sat, 6 Dec 2014 12:44:42 +0100"  >&lt;p&gt;Bulk close of old resolved issues.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="13541" name="blossom-template-class-patch.txt" size="2954" author="tduffey" created="Thu, 8 Jul 2010 01:09:21 +0200"/>
                            <attachment id="13558" name="is-available-annotation-patch-v2.txt" size="12096" author="tduffey" created="Fri, 9 Jul 2010 15:58:49 +0200"/>
                            <attachment id="13552" name="is-available-annotation-patch.txt" size="9016" author="tduffey" created="Fri, 9 Jul 2010 06:25:41 +0200"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                            <customfield id="customfield_14166" key="com.okapya.jira.checklist:checklist">
                        <customfieldname>Acceptance criteria</customfieldname>
                        <customfieldvalues>
                            
        <checklist>
        <![CDATA[
                            




                
                                    <div class="o-completion" style="display: flex; flex-shrink: 0;"><span  class="aui-lozenge aui-lozenge-complete" style="font-size: 12px; font-weight: normal; display: flex; flex-direction: row; align-items: center;" ><span style="padding-right: 4px; vertical-align: middle;"><svg width="15" height="15" viewBox="0 0 15 15" xmlns="http://www.w3.org/2000/svg" fill="white"><path clip-rule="evenodd" d="m10.41037,3.42544l-7.86501,0c-0.72395,0 -1.31084,0.58688 -1.31084,1.31084l0,7.86508c0,0.7239 0.58689,1.3108 1.31084,1.3108l7.86501,0c0.724,0 1.3109,-0.5869 1.3109,-1.3108l0,-7.86508c0,-0.72396 -0.5869,-1.31084 -1.3109,-1.31084zm-7.86501,-0.65542c-1.08593,0 -1.96626,0.88032 -1.96626,1.96626l0,7.86508c0,1.0859 0.88033,1.9662 1.96626,1.9662l7.86501,0c1.086,0 1.9663,-0.8803 1.9663,-1.9662l0,-7.86508c0,-1.08594 -0.8803,-1.96626 -1.9663,-1.96626l-7.86501,0z" fill-rule="evenodd"/><path d="m5.09049,10.18526l-1.82767,-1.82766l-0.78479,0.78479l2.61246,2.61246l5.38758,-5.38754l-0.78483,-0.78479l-4.60275,4.60274z"/></svg></span><span>Empty</span></span></div>
                        ]]>
    </checklist>


                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10111" key="com.atlassian.jira.toolkit:reporterdomain">
                        <customfieldname>Company</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>gmail.com</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10031" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of First Response</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 8 Jul 2010 01:09:21 +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>
                            9 years, 11 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_10020" key="com.atlassian.jira.toolkit:attachments">
                        <customfieldname>Number of attachments</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10150" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname>Number of comments</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>12.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10011" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>had</customfieldvalue>
            <customfieldvalue>tduffey</customfieldvalue>
            <customfieldvalue>tmattsson</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10090" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Patch included</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10100"><![CDATA[Yes]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10833" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i043k7:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10244" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>24019</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>