org.alfresco.web.bean
Class BrowseBean

java.lang.Object
  extended by org.alfresco.web.bean.BrowseBean
All Implemented Interfaces:
java.io.Serializable, IContextListener

public class BrowseBean
extends java.lang.Object
implements IContextListener, java.io.Serializable

Bean providing properties and behaviour for the main folder/document browse screen and search results screens.

See Also:
Serialized Form

Field Summary
protected  Node actionSpace
          The current space and it's properties - if any
static java.lang.String BEAN_NAME
          Public JSF Bean name
static java.lang.String BROWSE_VIEW_ID
          Browse screen view ID
static java.lang.String CATEGORY_VIEW_ID
           
protected  java.util.List containerNodes
          Transient lists of container and content nodes for display
protected  java.util.List contentNodes
           
protected  UIRichList contentRichList
           
protected  Node document
          The current document
static java.lang.String MSG_SEARCH_MINIMUM
           
protected  NavigationBean navigator
          The NavigationBean bean reference
protected  java.util.Set nodeEventListeners
          Listeners for Node events
protected  java.util.List parentContainerNodes
           
 NodePropertyResolver resolverCifsPath
           
 NodePropertyResolver resolverDisplayPath
           
 NodePropertyResolver resolverDownload
           
 NodePropertyResolver resolverEncoding
           
 NodePropertyResolver resolverFileType16
           
 NodePropertyResolver resolverFileType32
           
 NodePropertyResolver resolverLang
           
 NodePropertyResolver resolverLinkCifsPath
           
 NodePropertyResolver resolverLinkDownload
           
 NodePropertyResolver resolverLinkUrl
           
 NodePropertyResolver resolverLinkWebdavUrl
           
 NodePropertyResolver resolverMimetype
           
 NodePropertyResolver resolverPath
           
 NodePropertyResolver resolverSize
           
 NodePropertyResolver resolverSmallIcon
           
 NodePropertyResolver resolverSpaceIcon
           
 NodePropertyResolver resolverUrl
           
 NodePropertyResolver resolverWebdavUrl
           
static java.lang.String SPACE_SMALL_DEFAULT
          Small icon default name
protected  UIRichList spacesRichList
          Component references
protected  UserPreferencesBean userPreferencesBean
          The UserPreferencesBean to be used by the bean
protected  ViewsConfigElement viewsConfig
          Views configuration object
 
Constructor Summary
BrowseBean()
          Default Constructor
 
Method Summary
 void addNodeEventListener(NodeEventListener listener)
          Add a listener to those called by the BrowseBean when nodes are created
 void areaChanged()
          Method called by UIContextService.areaChanged() to inform all registered beans that the user has changed area i.e.
 void clickDescendantSpace(javax.faces.event.ActionEvent event)
          Action called when a folders direct descendant (in the 'list' browse mode) is clicked.
 void clickSpace(javax.faces.event.ActionEvent event)
          Action called when a folder space is clicked.
 void clickSpace(org.alfresco.service.cmr.repository.NodeRef nodeRef)
          Action called when a folder space is clicked.
 void clickSpacePath(javax.faces.event.ActionEvent event)
          Handler called when a path element is clicked - navigate to the appropriate Space
 void closeSearch(javax.faces.event.ActionEvent event)
          Action called to Close the search dialog by returning to the last view node Id
 void contextUpdated()
          Method called by UIContextService.notifyBeans() to inform all registered beans that all UI Beans should refresh dump all cached data and settings.
 void deleteFile(javax.faces.event.ActionEvent event)
          Event handler used when a file is being deleted, checks that the node does not have an associated working copy.
 void deleteSpace(javax.faces.event.ActionEvent event)
          Handles the deleteSpace action by deciding which delete dialog to display
 void expandPanel(javax.faces.event.ActionEvent event)
          Save the state of the panel that was expanded/collapsed
 void externalAccessRefresh()
          Support for refresh of lists via special case for an External Access URL.
 Node getActionSpace()
           
 java.lang.String getBrowseViewMode()
           
protected  org.alfresco.service.cmr.coci.CheckOutCheckInService getCheckOutCheckInService()
           
 java.util.List getContent()
          Page accessed bean method to get the content nodes currently being browsed
 UIRichList getContentRichList()
           
 java.lang.String getDeleteMessage()
           
protected  org.alfresco.service.cmr.dictionary.DictionaryService getDictionaryService()
           
 Node getDocument()
           
protected  org.alfresco.service.cmr.model.FileFolderService getFileFolderService()
           
protected  org.alfresco.service.cmr.lock.LockService getLockService()
           
static int getMinimumSearchLength()
           
protected  org.alfresco.service.cmr.ml.MultilingualContentService getMultilingualContentService()
           
 java.util.List getNodes()
          Page accessed bean method to get the container nodes currently being browsed
protected  org.alfresco.service.cmr.repository.NodeService getNodeService()
           
 int getPageSizeContent()
           
 java.lang.String getPageSizeContentStr()
           
 int getPageSizeSpaces()
           
 java.lang.String getPageSizeSpacesStr()
           
 java.util.Map getPanels()
           
 java.util.List getParentNodes(org.alfresco.service.cmr.repository.NodeRef currNodeRef)
          Page accessed bean method to get the parent container nodes currently being browsed
protected  org.alfresco.service.cmr.search.SearchService getSearchService()
           
 java.lang.String getSitesSpaceWarningHTML()
          Returns the HTML to display if a space is a 'Sites' space
 UIRichList getSpacesRichList()
           
 UIStatusMessage getStatusMessage()
           
 boolean isDashboardView()
           
 boolean isSitesSpace()
          Determines whether the current space is a 'Sites' space
 void removeNodeEventListener(NodeEventListener listener)
          Remove a listener from the list of those called by BrowseBean
 void removeSpaceFromBreadcrumb(Node node)
          Removes the given node from the breadcrumb i.e.
 void search(javax.faces.event.ActionEvent event)
          Action called from the Simple Search component.
 void setActionSpace(Node actionSpace)
           
 void setBrowseViewMode(java.lang.String browseViewMode)
           
 void setCheckOutCheckInService(org.alfresco.service.cmr.coci.CheckOutCheckInService checkOutCheckInService)
           
 void setContentRichList(UIRichList contentRichList)
           
 void setDashboardView(boolean dashboardView)
           
 void setDeleteMessage(java.lang.String deleteMessage)
           
 void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
           
 void setDocument(Node document)
           
 void setFileFolderService(org.alfresco.service.cmr.model.FileFolderService fileFolderService)
           
 void setLockService(org.alfresco.service.cmr.lock.LockService lockService)
           
 void setMultilingualContentService(org.alfresco.service.cmr.ml.MultilingualContentService multilingualContentService)
           
 void setNavigator(NavigationBean navigator)
           
 void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
           
 void setPageSizeContent(int pageSizeContent)
           
 void setPageSizeContentStr(java.lang.String pageSizeContentStr)
           
 void setPageSizeSpaces(int pageSizeSpaces)
           
 void setPageSizeSpacesStr(java.lang.String pageSizeSpacesStr)
           
 void setPanels(java.util.Map panels)
           
 void setSearchService(org.alfresco.service.cmr.search.SearchService searchService)
           
 void setSpacesRichList(UIRichList spacesRichList)
           
 void setStatusMessage(UIStatusMessage statusMessage)
           
 void setupCommonBindingProperties(Node node)
          Setup the common properties required at data-binding time.
 void setupContentAction(javax.faces.event.ActionEvent event)
          Action event called by all actions that need to setup a Content Document context on the BrowseBean before an action page/wizard is called.
 void setupContentAction(java.lang.String id, boolean invalidate)
          Public helper to setup action pages with content context
 void setupDeleteAction(javax.faces.event.ActionEvent event)
          Acrtion event called by Delete Space actions.
 void setupMLContainerContentAction(javax.faces.event.ActionEvent event)
          Action event called by all actions that need to setup a Multilingual Content Document context on the BrowseBean before an action page/wizard is called.
 void setupSpaceAction(javax.faces.event.ActionEvent event)
          Action event called by all Browse actions that need to setup a Space context before an action page/wizard is called.
 void setupSpaceAction(java.lang.String id, boolean invalidate)
          Public helper to setup action pages with Space context
 void setUserPreferencesBean(UserPreferencesBean userPreferencesBean)
           
 void spaceChanged()
          Method called by UIContextService.spaceChanged() to inform all registered beans that the current space has changed.
 void updateContentPageSize(javax.faces.event.ActionEvent event)
          Update page size based on user selection
 void updateSpacesPageSize(javax.faces.event.ActionEvent event)
          Update page size based on user selection
 void updateUILocation(org.alfresco.service.cmr.repository.NodeRef ref)
          Refresh the UI after a Space selection change.
 void viewModeChanged(javax.faces.event.ActionEvent event)
          Change the current view mode based on user selection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BEAN_NAME

public static final java.lang.String BEAN_NAME
Public JSF Bean name

See Also:
Constant Field Values

resolverDownload

public NodePropertyResolver resolverDownload

resolverUrl

public NodePropertyResolver resolverUrl

resolverWebdavUrl

public NodePropertyResolver resolverWebdavUrl

resolverCifsPath

public NodePropertyResolver resolverCifsPath

resolverLinkDownload

public NodePropertyResolver resolverLinkDownload

resolverLinkUrl

public NodePropertyResolver resolverLinkUrl

resolverLinkWebdavUrl

public NodePropertyResolver resolverLinkWebdavUrl

resolverLinkCifsPath

public NodePropertyResolver resolverLinkCifsPath

resolverFileType16

public NodePropertyResolver resolverFileType16

resolverFileType32

public NodePropertyResolver resolverFileType32

resolverPath

public NodePropertyResolver resolverPath

resolverDisplayPath

public NodePropertyResolver resolverDisplayPath

resolverSpaceIcon

public NodePropertyResolver resolverSpaceIcon

resolverSmallIcon

public NodePropertyResolver resolverSmallIcon

resolverMimetype

public NodePropertyResolver resolverMimetype

resolverEncoding

public NodePropertyResolver resolverEncoding

resolverSize

public NodePropertyResolver resolverSize

resolverLang

public NodePropertyResolver resolverLang

BROWSE_VIEW_ID

public static final java.lang.String BROWSE_VIEW_ID
Browse screen view ID

See Also:
Constant Field Values

CATEGORY_VIEW_ID

public static final java.lang.String CATEGORY_VIEW_ID
See Also:
Constant Field Values

SPACE_SMALL_DEFAULT

public static final java.lang.String SPACE_SMALL_DEFAULT
Small icon default name

See Also:
Constant Field Values

MSG_SEARCH_MINIMUM

public static final java.lang.String MSG_SEARCH_MINIMUM
See Also:
Constant Field Values

navigator

protected NavigationBean navigator
The NavigationBean bean reference


userPreferencesBean

protected UserPreferencesBean userPreferencesBean
The UserPreferencesBean to be used by the bean


viewsConfig

protected ViewsConfigElement viewsConfig
Views configuration object


nodeEventListeners

protected java.util.Set nodeEventListeners
Listeners for Node events


spacesRichList

protected UIRichList spacesRichList
Component references


contentRichList

protected UIRichList contentRichList

containerNodes

protected java.util.List containerNodes
Transient lists of container and content nodes for display


contentNodes

protected java.util.List contentNodes

parentContainerNodes

protected java.util.List parentContainerNodes

actionSpace

protected Node actionSpace
The current space and it's properties - if any


document

protected Node document
The current document

Constructor Detail

BrowseBean

public BrowseBean()
Default Constructor

Method Detail

setNodeService

public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
Parameters:
nodeService - The NodeService to set.

getNodeService

protected org.alfresco.service.cmr.repository.NodeService getNodeService()

setCheckOutCheckInService

public void setCheckOutCheckInService(org.alfresco.service.cmr.coci.CheckOutCheckInService checkOutCheckInService)
Parameters:
checkOutCheckInService - The service for check-in and check-out.

getCheckOutCheckInService

protected org.alfresco.service.cmr.coci.CheckOutCheckInService getCheckOutCheckInService()

setSearchService

public void setSearchService(org.alfresco.service.cmr.search.SearchService searchService)
Parameters:
searchService - The Searcher to set.

getSearchService

protected org.alfresco.service.cmr.search.SearchService getSearchService()

setUserPreferencesBean

public void setUserPreferencesBean(UserPreferencesBean userPreferencesBean)
Parameters:
userPreferencesBean - The UserPreferencesBean to set.

setLockService

public void setLockService(org.alfresco.service.cmr.lock.LockService lockService)
Parameters:
lockService - The Lock Service to set.

getLockService

protected org.alfresco.service.cmr.lock.LockService getLockService()

setNavigator

public void setNavigator(NavigationBean navigator)
Parameters:
navigator - The NavigationBean to set.

setDictionaryService

public void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
Parameters:
dictionaryService - The DictionaryService to set.

getDictionaryService

protected org.alfresco.service.cmr.dictionary.DictionaryService getDictionaryService()

setMultilingualContentService

public void setMultilingualContentService(org.alfresco.service.cmr.ml.MultilingualContentService multilingualContentService)
Parameters:
multilingualContentService - The Multilingual Content Service to set.

getMultilingualContentService

protected org.alfresco.service.cmr.ml.MultilingualContentService getMultilingualContentService()

setFileFolderService

public void setFileFolderService(org.alfresco.service.cmr.model.FileFolderService fileFolderService)
Parameters:
fileFolderService - The FileFolderService to set.

getFileFolderService

protected org.alfresco.service.cmr.model.FileFolderService getFileFolderService()

getBrowseViewMode

public java.lang.String getBrowseViewMode()
Returns:
Returns the browse View mode. See UIRichList

setBrowseViewMode

public void setBrowseViewMode(java.lang.String browseViewMode)
Parameters:
browseViewMode - The browse View mode to set. See UIRichList.

isDashboardView

public boolean isDashboardView()
Returns:
Returns true if dashboard view is available for the current node.

setDashboardView

public void setDashboardView(boolean dashboardView)
Parameters:
dashboardView - The dashboard view mode to set.

getPageSizeContent

public int getPageSizeContent()

setPageSizeContent

public void setPageSizeContent(int pageSizeContent)

getPageSizeSpaces

public int getPageSizeSpaces()

setPageSizeSpaces

public void setPageSizeSpaces(int pageSizeSpaces)

getPageSizeContentStr

public java.lang.String getPageSizeContentStr()

setPageSizeContentStr

public void setPageSizeContentStr(java.lang.String pageSizeContentStr)

getPageSizeSpacesStr

public java.lang.String getPageSizeSpacesStr()

setPageSizeSpacesStr

public void setPageSizeSpacesStr(java.lang.String pageSizeSpacesStr)

getMinimumSearchLength

public static int getMinimumSearchLength()
Returns:
Returns the minimum length of a valid search string.

getPanels

public java.util.Map getPanels()
Returns:
Returns the panels expanded state map.

setPanels

public void setPanels(java.util.Map panels)
Parameters:
panels - The panels expanded state map.

getActionSpace

public Node getActionSpace()
Returns:
Returns the Space Node being used for the current browse screen action.

setActionSpace

public void setActionSpace(Node actionSpace)
Parameters:
actionSpace - Set the Space Node to be used for the current browse screen action.

getDocument

public Node getDocument()
Returns:
The document node being used for the current operation

setDocument

public void setDocument(Node document)
Parameters:
document - The document node to be used for the current operation

setContentRichList

public void setContentRichList(UIRichList contentRichList)
Parameters:
contentRichList - The contentRichList to set.

getContentRichList

public UIRichList getContentRichList()
Returns:
Returns the contentRichList.

setSpacesRichList

public void setSpacesRichList(UIRichList spacesRichList)
Parameters:
spacesRichList - The spacesRichList to set.

getSpacesRichList

public UIRichList getSpacesRichList()
Returns:
Returns the spacesRichList.

getStatusMessage

public UIStatusMessage getStatusMessage()
Returns:
Returns the statusMessage component.

setStatusMessage

public void setStatusMessage(UIStatusMessage statusMessage)
Parameters:
statusMessage - The statusMessage component to set.

getDeleteMessage

public java.lang.String getDeleteMessage()
Returns:
Returns the deleteMessage.

setDeleteMessage

public void setDeleteMessage(java.lang.String deleteMessage)
Parameters:
deleteMessage - The deleteMessage to set.

getNodes

public java.util.List getNodes()
Page accessed bean method to get the container nodes currently being browsed

Returns:
List of container Node objects for the current browse location

getContent

public java.util.List getContent()
Page accessed bean method to get the content nodes currently being browsed

Returns:
List of content Node objects for the current browse location

getParentNodes

public java.util.List getParentNodes(org.alfresco.service.cmr.repository.NodeRef currNodeRef)
Page accessed bean method to get the parent container nodes currently being browsed

Returns:
List of parent container Node objects for the current browse location

isSitesSpace

public boolean isSitesSpace()
Determines whether the current space is a 'Sites' space

Returns:
true if the current space is a 'Sites' space

getSitesSpaceWarningHTML

public java.lang.String getSitesSpaceWarningHTML()
Returns the HTML to display if a space is a 'Sites' space

Returns:
The HTML to display

setupCommonBindingProperties

public void setupCommonBindingProperties(Node node)
Setup the common properties required at data-binding time.

These are properties used by components on the page when iterating over the nodes. The properties are available as the Node is a Map so they can be accessed directly by name. Information such as download URL, size and filetype are provided etc.

We use a set of anonymous inner classes to provide the implemention for the property getters. The interfaces are only called when the properties are first requested.

Parameters:
node - Node to add the properties too

contextUpdated

public void contextUpdated()
Description copied from interface: IContextListener
Method called by UIContextService.notifyBeans() to inform all registered beans that all UI Beans should refresh dump all cached data and settings.

Specified by:
contextUpdated in interface IContextListener
See Also:
IContextListener.contextUpdated()

areaChanged

public void areaChanged()
Description copied from interface: IContextListener
Method called by UIContextService.areaChanged() to inform all registered beans that the user has changed area i.e. from company home to my home.

Specified by:
areaChanged in interface IContextListener
See Also:
IContextListener.areaChanged()

spaceChanged

public void spaceChanged()
Description copied from interface: IContextListener
Method called by UIContextService.spaceChanged() to inform all registered beans that the current space has changed.

Specified by:
spaceChanged in interface IContextListener
See Also:
IContextListener.spaceChanged()

addNodeEventListener

public void addNodeEventListener(NodeEventListener listener)
Add a listener to those called by the BrowseBean when nodes are created


removeNodeEventListener

public void removeNodeEventListener(NodeEventListener listener)
Remove a listener from the list of those called by BrowseBean


viewModeChanged

public void viewModeChanged(javax.faces.event.ActionEvent event)
Change the current view mode based on user selection

Parameters:
event - ActionEvent

search

public void search(javax.faces.event.ActionEvent event)
Action called from the Simple Search component. Sets up the SearchContext object with the values from the simple search menu.


closeSearch

public void closeSearch(javax.faces.event.ActionEvent event)
Action called to Close the search dialog by returning to the last view node Id


updateSpacesPageSize

public void updateSpacesPageSize(javax.faces.event.ActionEvent event)
Update page size based on user selection


updateContentPageSize

public void updateContentPageSize(javax.faces.event.ActionEvent event)
Update page size based on user selection


clickSpace

public void clickSpace(javax.faces.event.ActionEvent event)
Action called when a folder space is clicked. Navigate into the space.


clickSpace

public void clickSpace(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Action called when a folder space is clicked.

Parameters:
nodeRef - The node being clicked

clickSpacePath

public void clickSpacePath(javax.faces.event.ActionEvent event)
Handler called when a path element is clicked - navigate to the appropriate Space


clickDescendantSpace

public void clickDescendantSpace(javax.faces.event.ActionEvent event)
Action called when a folders direct descendant (in the 'list' browse mode) is clicked. Navigate into the the descendant space.


setupSpaceAction

public void setupSpaceAction(javax.faces.event.ActionEvent event)
Action event called by all Browse actions that need to setup a Space context before an action page/wizard is called. The context will be a Node in setActionSpace() which can be retrieved on the action page from BrowseBean.getActionSpace().

Parameters:
event - ActionEvent

setupSpaceAction

public void setupSpaceAction(java.lang.String id,
                             boolean invalidate)
Public helper to setup action pages with Space context

Parameters:
id - of the Space node to setup context for

setupDeleteAction

public void setupDeleteAction(javax.faces.event.ActionEvent event)
Acrtion event called by Delete Space actions. We setup the action space as normal, then prepare any special case message string to be shown to the user if they are trying to delete specific spaces.


setupContentAction

public void setupContentAction(javax.faces.event.ActionEvent event)
Action event called by all actions that need to setup a Content Document context on the BrowseBean before an action page/wizard is called. The context will be a Node in setDocument() which can be retrieved on the action page from BrowseBean.getDocument().


setupMLContainerContentAction

public void setupMLContainerContentAction(javax.faces.event.ActionEvent event)
Action event called by all actions that need to setup a Multilingual Content Document context on the BrowseBean before an action page/wizard is called. The context will be a Node in setDocument() which can be retrieved on the action page from BrowseBean.getDocument().


setupContentAction

public void setupContentAction(java.lang.String id,
                               boolean invalidate)
Public helper to setup action pages with content context

Parameters:
id - of the content node to setup context for

removeSpaceFromBreadcrumb

public void removeSpaceFromBreadcrumb(Node node)
Removes the given node from the breadcrumb i.e. following a delete

Parameters:
node - The space to remove from the breadcrumb

externalAccessRefresh

public void externalAccessRefresh()
Support for refresh of lists via special case for an External Access URL. these URLs restart the JSF lifecycle but an old UIRichList is restored from the component tree - which needs clearing "late" in the lifecycle process.


expandPanel

public void expandPanel(javax.faces.event.ActionEvent event)
Save the state of the panel that was expanded/collapsed


updateUILocation

public void updateUILocation(org.alfresco.service.cmr.repository.NodeRef ref)
Refresh the UI after a Space selection change. Adds the selected space to the breadcrumb location path and also updates the list components in the UI.

Parameters:
ref - NodeRef of the selected space

deleteFile

public void deleteFile(javax.faces.event.ActionEvent event)
Event handler used when a file is being deleted, checks that the node does not have an associated working copy.

Parameters:
event - The event

deleteSpace

public void deleteSpace(javax.faces.event.ActionEvent event)
Handles the deleteSpace action by deciding which delete dialog to display



Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.