org.alfresco.web.config
Class ViewsConfigElement

java.lang.Object
  extended by org.springframework.extensions.config.element.ConfigElementAdapter
      extended by org.alfresco.web.config.ViewsConfigElement
All Implemented Interfaces:
java.io.Serializable, org.springframework.extensions.config.ConfigElement

public class ViewsConfigElement
extends org.springframework.extensions.config.element.ConfigElementAdapter
implements java.io.Serializable

Custom config element that represents config values for views in the client

See Also:
Serialized Form

Field Summary
static java.lang.String CONFIG_ELEMENT_ID
           
static java.lang.String SORT_ASCENDING
           
static java.lang.String SORT_DESCENDING
           
static java.lang.String VIEW_BUBBLE
           
static java.lang.String VIEW_DETAILS
           
static java.lang.String VIEW_ICONS
           
static java.lang.String VIEW_LIST
           
 
Fields inherited from class org.springframework.extensions.config.element.ConfigElementAdapter
attributes, children, name, value
 
Constructor Summary
ViewsConfigElement()
          Default Constructor
ViewsConfigElement(java.lang.String name)
          Constructor
 
Method Summary
 org.springframework.extensions.config.ConfigElement combine(org.springframework.extensions.config.ConfigElement configElement)
           
 java.util.List getChildren()
           
 int getDefaultPageSize(java.lang.String page, java.lang.String view)
          Returns the page size for the given page and view combination
 java.lang.String getDefaultSortColumn(java.lang.String page)
          Returns the default sort column for the given page
 java.lang.String getDefaultView(java.lang.String page)
          Returns the default view for the given page
 java.util.List getViews()
          Returns a map of configured views for the client
 boolean hasDescendingSort(java.lang.String page)
          Determines whether the given page has been configured to use descending sorting by default
 
Methods inherited from class org.springframework.extensions.config.element.ConfigElementAdapter
getAttribute, getAttributeCount, getAttributes, getChild, getChildCount, getChildren, getChildrenMap, getChildValue, getName, getValue, hasAttribute, hasChildren, setValue, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CONFIG_ELEMENT_ID

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

VIEW_DETAILS

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

VIEW_ICONS

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

VIEW_LIST

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

VIEW_BUBBLE

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

SORT_ASCENDING

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

SORT_DESCENDING

public static final java.lang.String SORT_DESCENDING
See Also:
Constant Field Values
Constructor Detail

ViewsConfigElement

public ViewsConfigElement()
Default Constructor


ViewsConfigElement

public ViewsConfigElement(java.lang.String name)
Constructor

Parameters:
name - Name of the element this config element represents
Method Detail

getChildren

public java.util.List getChildren()
Specified by:
getChildren in interface org.springframework.extensions.config.ConfigElement
Overrides:
getChildren in class org.springframework.extensions.config.element.ConfigElementAdapter
See Also:
ConfigElementAdapter.getChildren()

combine

public org.springframework.extensions.config.ConfigElement combine(org.springframework.extensions.config.ConfigElement configElement)
Specified by:
combine in interface org.springframework.extensions.config.ConfigElement
Specified by:
combine in class org.springframework.extensions.config.element.ConfigElementAdapter
See Also:
org.springframework.extensions.config.element.ConfigElementAdapter#combine(org.alfresco.config.ConfigElement)

getViews

public java.util.List getViews()
Returns a map of configured views for the client

Returns:
List of the implementation classes for the configured views

getDefaultView

public java.lang.String getDefaultView(java.lang.String page)
Returns the default view for the given page

Parameters:
page - The page to get the default view for
Returns:
The defualt view, if there isn't a configured default for the given page 'details' will be returned

getDefaultPageSize

public int getDefaultPageSize(java.lang.String page,
                              java.lang.String view)
Returns the page size for the given page and view combination

Parameters:
page - The name of the page i.e. browse, forums etc.
view - The name of the view the size is for i.e. details, icons etc.
Returns:
The size of the requested page, if the combination doesn't exist the default for the view will be used, if the view doesn't exist either 10 will be returned.

getDefaultSortColumn

public java.lang.String getDefaultSortColumn(java.lang.String page)
Returns the default sort column for the given page

Parameters:
page - The name of the page i.e. browse, forums etc.
Returns:
The name of the column to sort by, name is returned if the page is not found

hasDescendingSort

public boolean hasDescendingSort(java.lang.String page)
Determines whether the given page has been configured to use descending sorting by default

Parameters:
page - The name of the page i.e. browse, forums etc.
Returns:
true if the page should use descending sorts


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