Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The flickr-simple-browser module is an example of how to build a custom content app. The module installs an app that allows you to browse photos on Flickr. We use a String as ItemId, which is easy to implement but has the disadvantage that we cannot tell the difference between photos and albums. This example also shows how to use an external Web service as the data source. The list view and the thumbnail view use the same Container coupled to a 

Javadoc resource link
rangeHigherVersion5.65
classNameinfo.magnolia.ui.vaadin.integration.contentconnector.ContentConnector
renderTypeasynchronous
. See also Content app with an Object ItemId and different containers for an example of a hierarchical container.

...

flickr-simple-browser

required

App

subapps

required


browser

required

Subapp

class

required

Javadoc resource link
0info.magnolia.ui.contentapp.browser.BrowserSubAppDescriptor
rangeHigherVersion5.65
classNameinfo.magnolia.ui.contentapp.browser.BrowserSubAppDescriptor
renderTypeasynchronous

subAppClass

required

Javadoc resource link
0info.magnolia.ui.contentapp.browser.BrowserSubApp
rangeHigherVersion5.65
classNameinfo.magnolia.ui.contentapp.browser.BrowserSubApp
renderTypeasynchronous

appClass

required

Must be 

Javadoc resource link
0info.magnolia.ui.contentapp.ContentApp
rangeHigherVersion5.65
classNameinfo.magnolia.ui.contentapp.ContentApp
renderTypeasynchronous
 or a subclass.

...

An Item has properties and every property is identified by its property ID. Define the properties in an interface. In this module we define the interface 

Javadoc resource link
0info.magnolia.flickr.simplebrowser.app.item.SimpleFlickrItem
rangeHigherVersion51.61
classNameinfo.magnolia.flickr.simplebrowser.app.item.SimpleFlickrItem
renderTypeasynchronous
.

...

Every subapp must configure its own content connector. The 

Javadoc resource link
0info.magnolia.flickr.simplebrowser.app.contentconnector.ConfiguredSimpleFlickrBrowserContentConnectorDefinition
rangeHigherVersion1.1
classNameinfo.magnolia.flickr.simplebrowser.app.contentconnector.ConfiguredSimpleFlickrBrowserContentConnectorDefinition
renderTypeasynchronous
 class extends 
Javadoc resource link
0info.magnolia.ui.vaadin.integration.contentconnector.ConfiguredContentConnectorDefinition
rangeHigherVersion5.65
classNameinfo.magnolia.ui.vaadin.integration.contentconnector.ConfiguredContentConnectorDefinition
renderTypeasynchronous
 and
 sets the implementation class 
Javadoc
0info.magnolia.flickr.simplebrowser.app.contentconnector.SimpleFlickrBrowserContentConnectorImpl
.

...

Javadoc resource link
0info.magnolia.ui.contentapp.contentconnector.ContentConnectorProvider
rangeHigherVersion5.65
classNameinfo.magnolia.ui.contentapp.contentconnector.ContentConnectorProvider
renderTypeasynchronous
 creates and provides only one instance of  SimpleFlickrBrowserContentConnector  in our subapp. The content connector can be injected into any class used within the subapp. You can cast it to your own type if required.

...

We use the same container for the tree view and the thumbnail view. In this case it would be sufficient to implement just the base interface Container. However, we also implement 

Javadoc resource link
0info.magnolia.ui.workbench.container.Refreshable
rangeHigherVersion5.65
classNameinfo.magnolia.ui.workbench.container.Refreshable
renderTypeasynchronous
 so we can use the refresh mechanism in the Magnolia workbench. We also need the Container.Indexed subinterface for lazy loading.

...

In the presenter class, extend 

Javadoc resource link
0info.magnolia.ui.workbench.thumbnail.ThumbnailPresenter
rangeHigherVersion5.65
classNameinfo.magnolia.ui.workbench.thumbnail.ThumbnailPresenter
renderTypeasynchronous
 and initialize the container:

...