info.magnolia.ui.contentapp.browser
Class BrowserSubApp

java.lang.Object
  extended by info.magnolia.ui.framework.app.BaseSubApp
      extended by info.magnolia.ui.contentapp.browser.BrowserSubApp
All Implemented Interfaces:
SubApp

public class BrowserSubApp
extends BaseSubApp

Base implementation of a content subApp. A content subApp displays a collection of data represented inside a ContentView created by the WorkbenchPresenter.

  

This class Provides sensible implementation for services shared by all content subApps. Out-of-the-box it will handle the following:

In order to perform those tasks this class registers non-overridable handlers for the following events: Subclasses can augment the default behavior and perform additional tasks by overriding the following methods:

See Also:
BrowserPresenter, ContentSubAppView, ContentApp, BrowserLocation

Constructor Summary
BrowserSubApp(ActionExecutor actionExecutor, SubAppContext subAppContext, ContentSubAppView view, BrowserPresenter browser, info.magnolia.event.EventBus subAppEventBus, info.magnolia.objectfactory.ComponentProvider componentProvider)
           
 
Method Summary
protected  BrowserPresenter getBrowser()
           
 BrowserLocation getCurrentLocation()
          Wraps the current DefaultLocation in a BrowserLocation.
static List<javax.jcr.Item> getJcrItemsExceptOne(String workspaceName, List<String> ids, String itemIdToExclude)
           
 ContentSubAppView getView()
           
 void locationChanged(Location location)
          The default implementation selects the path in the current workspace and updates the available actions in the actionbar.
protected  void restoreBrowser(BrowserLocation location)
          Restores the browser status based on the information available in the location object.
 void showActionPopup(String absItemPath, int x, int y)
          Show the actionPopup for the specified item at the specified coordinates.
 View start(Location location)
          Performs some routine tasks needed by all content subapps before the view is displayed.
 void updateActionbar(ActionbarPresenter actionbar)
          Update the items in the actionbar based on the selected item and the action availability configuration.
 
Methods inherited from class info.magnolia.ui.framework.app.BaseSubApp
getAppContext, getCaption, getSubAppContext, getSubAppId, isCloseable, onSubAppStart, onSubAppStop, stop, supportsLocation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BrowserSubApp

@Inject
public BrowserSubApp(ActionExecutor actionExecutor,
                            SubAppContext subAppContext,
                            ContentSubAppView view,
                            BrowserPresenter browser,
                            @Named(value="subapp")
                            info.magnolia.event.EventBus subAppEventBus,
                            info.magnolia.objectfactory.ComponentProvider componentProvider)
Method Detail

start

public final View start(Location location)
Performs some routine tasks needed by all content subapps before the view is displayed. The tasks are:

Specified by:
start in interface SubApp
Overrides:
start in class BaseSubApp

restoreBrowser

protected final void restoreBrowser(BrowserLocation location)
Restores the browser status based on the information available in the location object. This is used e.g. when starting a subapp based on a bookmark. I.e. given a bookmark containing the following URI fragment

#app:myapp:browser;/foo/bar:list

this method will select the path /foo/bar in the workspace used by the app, set the view type as list and finally update the available actions.

In case of a search view the URI fragment will look similar to the following one #app:myapp:browser;/:search:qux

then this method will select the root path, set the view type as search, perform a search for "qux" in the workspace used by the app and finally update the available actions.

See Also:
updateActionbar(ActionbarPresenter), start(Location), Location

showActionPopup

public void showActionPopup(String absItemPath,
                            int x,
                            int y)
Show the actionPopup for the specified item at the specified coordinates.


updateActionbar

public void updateActionbar(ActionbarPresenter actionbar)
Update the items in the actionbar based on the selected item and the action availability configuration. This method can be overriden to implement custom conditions diverging from updateActionPopup(info.magnolia.ui.vaadin.actionbar.ActionPopup).

See Also:
restoreBrowser(BrowserLocation), locationChanged(Location), ActionbarPresenter

getBrowser

protected final BrowserPresenter getBrowser()

getView

public final ContentSubAppView getView()
Specified by:
getView in interface SubApp
Overrides:
getView in class BaseSubApp

locationChanged

public void locationChanged(Location location)
The default implementation selects the path in the current workspace and updates the available actions in the actionbar.

Specified by:
locationChanged in interface SubApp
Overrides:
locationChanged in class BaseSubApp

getCurrentLocation

public BrowserLocation getCurrentLocation()
Wraps the current DefaultLocation in a BrowserLocation. Providing getter and setters for used parameters.

Overrides:
getCurrentLocation in class BaseSubApp

getJcrItemsExceptOne

public static List<javax.jcr.Item> getJcrItemsExceptOne(String workspaceName,
                                                        List<String> ids,
                                                        String itemIdToExclude)


Copyright © 2013 Magnolia International Ltd.. All Rights Reserved.