Tuesday, November 22, 2011

Blossom 1.2.3 & Blossom Data Extension 1.0 Released

Today I have released version 1.2.3 of Blossom and Blossom Data Extension 1.0, an extension for using Blossom style dialogs with the Magnolia Data Module. It introduces a new annotation @DataTypeDialogFactory which is used for creating dialogs for data module types. It has the same feature set as @DialogFactory and is used in the same way.

In this release the feature set TabBuilder is expanded adding support for the multi select control, the include control and for adding any control by type. It's now also possible to get the dialog and the DialogCreationContext from the TabBuilder.

This is an example of how a dialog used for the type 'category':
@DataTypeDialogFactory("category")
public class CategoryDialog {

    @TabFactory("Settings")
    public void settingsTab(TabBuilder tab) {
        tab.addEdit("name", "Name", "");
        tab.addEdit("maxResults", "Max results", "");
    }
}

To use the Data Extension you need to add it to your pom.xml
<dependency>
  <groupId>info.magnolia</groupId>
  <artifactId>magnolia-module-blossom-extension-data</artifactId>
  <version>1.0</version>
</dependency>

Add this line to your blossom-servlet.xml or equivalent.

<bean class="info.magnolia.module.blossom.extension.data.DataDialogExporter" />

And if you're using classpath scanning you'll also want to add an include-filter for the new annotation.

<context:component-scan base-package="package-containing-dialogs" use-default-filters="false">
  ...
  <context:include-filter type="annotation" expression="info.magnolia.module.blossom.extension.data.DataTypeDialogFactory"/>
</context:component-scan>

For more details see the Blossom Data Extension wiki page.

2 comments:

  1. I see this error when trying out magnolia(4.4.6) and blossom (1.2.3)
    2012-01-27 11:05:56,733 INFO info.magnolia.cms.beans.config.MIMEMapping : Registering event listener for MIMEMapping
    2012-01-27 11:05:56,735 INFO info.magnolia.cms.beans.config.ConfigLoader : Configuration loaded (took 7 seconds)
    2012-01-27 11:05:56,926 WARN gnolia.content2bean.impl.Content2BeanProcessorImpl: can't resolve class for node /server/filters/cms/blossom
    java.lang.NoClassDefFoundError: org/springframework/core/NestedIOException
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:169)
    at info.magnolia.objectfactory.DefaultClassFactory.forName(DefaultClassFactory.java:52)
    at info.magnolia.content2bean.impl.Content2BeanTransformerImpl.resolveType(Content2BeanTransformerImpl.java:110)
    at info.magnolia.content2bean.impl.Content2BeanProcessorImpl.toBean(Content2BeanProcessorImpl.java:77)
    at info.magnolia.content2bean.impl.Content2BeanProcessorImpl.toMap(Content2BeanProcessorImpl.java:178)
    at info.magnolia.content2bean.impl.Content2BeanProcessorImpl.toBean(Content2BeanProcessorImpl.java:94)
    at info.magnolia.content2bean.impl.Content2BeanProcessorImpl.toMap(Content2BeanProcessorImpl.java:178)
    at info.magnolia.content2bean.impl.Content2BeanProcessorImpl.toBean(Content2BeanProcessorImpl.java:94)
    at info.magnolia.content2bean.impl.Content2BeanProcessorImpl.toBean(Content2BeanProcessorImpl.java:68)
    at info.magnolia.content2bean.Content2BeanUtil.toBean(Content2BeanUtil.java:149)
    at info.magnolia.content2bean.Content2BeanUtil.toBean(Content2BeanUtil.java:135)
    at info.magnolia.cms.filters.MgnlMainFilter.createRootFilter(MgnlMainFilter.java:151)

    Any idea how to fix this?

    ReplyDelete
  2. You need spring-core on your classpath. By far the easiest way to get your dependencies right is using maven, add a dependency on spring-webmvc and you'll get all the required libraries pulled in.

    ReplyDelete