[ 
http://jira.magnolia-cms.com/browse/BLOSSOM-1?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=28993#action_28993
 ] 

Thomas Duffey edited comment on BLOSSOM-1 at 7/9/10 6:26 AM:
-------------------------------------------------------------

The attached patch against trunk allows you to specify a method in your 
controller like:

@IsAvailable
public static boolean isAvailable(Content node) {
    ...
}

When available, this method will be used instead of the default Magnolia 
isAvailable() method.  I have two gripes:

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.

2) There is no way to fall back to the default isAvailable() method within your 
@IsAvailable annotated method.

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.

      was (Author: tduffey):
    The attached patch against trunk allows you to specify a method in your 
controller like:

@IsAvailable
public static boolean isAvailable(Content node) {
    ...
}

When available, this method will be used instead of the default Magnolia 
isAvailable() method.

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.

2) There is no way to fall back to the default isAvailable() method within your 
@IsAvailable annotated method.

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.
  
> Template annotation should allow specifying "class"
> ---------------------------------------------------
>
>                 Key: BLOSSOM-1
>                 URL: http://jira.magnolia-cms.com/browse/BLOSSOM-1
>             Project: Magnolia Blossom Module
>          Issue Type: New Feature
>            Reporter: Tobias Mattsson
>            Assignee: Tobias Mattsson
>            Priority: Minor
>         Attachments: blossom-template-class-patch.txt, 
> is-available-annotation-patch.txt
>
>
> Transferred from Sourceforge
> Original description:
> Magnolia templates support a node named "class" 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.
> The Blossom @Template annotation should allow specifying this value and 
> subsequently configuring it on the blossom generated template.
> Followup comments:
> Good suggestion, though even cooler would be to have isAvailable() directly
> on the controller.
> For now you can subclass DefaultBlossomTemplateRegistry and overload
> writeTemplateDefinition() to add the custom properties that you need.
> Replace <blossom:configuration /> with
> <bean class="se.issi.magnolia.module.blossom.BlossomConfiguration">
> <property name="templateRegistry">
> <bean class="some.package.MyCustomTemplateRegistry" />
> </property>
> </bean>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.magnolia-cms.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to