Class AbstractArrayPane
- java.lang.Object
-
- org.silverpeas.core.web.util.viewgenerator.html.arraypanes.AbstractArrayPane
-
- All Implemented Interfaces:
ArrayPane
,SimpleGraphicElement
- Direct Known Subclasses:
ArrayPaneSilverpeasV5
,ArrayPaneWithDataSource
public class AbstractArrayPane extends Object implements ArrayPane
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
EXPORT_URL_SERVLET_MAPPING
-
Fields inherited from interface org.silverpeas.core.web.util.viewgenerator.html.arraypanes.ArrayPane
ACTION_PARAMETER_NAME, CACHE_COLUMNS_KEY_SUFFIX, CACHE_LINES_KEY_SUFFIX, COLUMN_PARAMETER_NAME, TARGET_PARAMETER_NAME
-
-
Constructor Summary
Constructors Constructor Description AbstractArrayPane()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ArrayColumn
addArrayColumn(String title)
Add a new column to the table.ArrayLine
addArrayLine()
Add a line to the table.int
getCellPadding()
int
getCellSpacing()
List<ArrayColumn>
getColumns()
int
getColumnToSort()
Get the column to be sortedString
getExportDataURL()
protected String
getExportUrl()
String
getIconsPath()
List<ArrayLine>
getLines()
String
getName()
Get the unique nameprotected int
getNbItems()
Gets the number of items the list can provides.javax.servlet.ServletRequest
getRequest()
Get the request that can contains some parameters for the ArrayPane (sort action...)javax.servlet.http.HttpSession
getSession()
Get the session in which the ArrayPane will keep its state.boolean
getSortable()
Get global array columns behaviour for sort.ArrayPaneStatusBean
getState()
String
getSummary()
Gets a summary about the content of the array pane.String
getTitle()
Get the titleString
getUrl()
void
init(String name, String url, javax.servlet.ServletRequest request, javax.servlet.http.HttpSession session)
void
init(String name, javax.servlet.jsp.PageContext pageContext)
Generic class to display a typical WA array table pane.void
init(String name, javax.servlet.ServletRequest request, javax.servlet.http.HttpSession session)
boolean
isExportData()
boolean
isMovableLines()
protected boolean
isPaginationOptimized()
Indicates if the pagination is optimized, the is to say if the array contains only the lines which will be printed to the user whereas the array could provides many other pages.String
print()
Print the array line in an html format.protected String
printSortJavascriptFunction()
void
setColumnToSort(int columnNumber)
Modify the column number the sort will be based on.void
setExportData(boolean exportData)
void
setExportDataURL(String exportDataURL)
void
setLineMoveCallback(String callback)
Sets a Javascript function to call when one or more lines of the array are moved between them.void
setMovableLines(boolean movableLines)
Indicates if the lines of the array can be moved, reordered by hand by the user.void
setRoutingAddress(String address)
Sets the routing address.void
setSortable(boolean sortable)
Set all array columns to be sortable or not.void
setSummary(String summary)
Sets the array pane summary.void
setTitle(String title)
Set the array title, to be displayed on the first html table.void
setVisibleLineNumber(int maximum)
Set the maximum line number visible in the table.
-
-
-
Field Detail
-
EXPORT_URL_SERVLET_MAPPING
protected static final String EXPORT_URL_SERVLET_MAPPING
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public void init(String name, javax.servlet.jsp.PageContext pageContext)
Description copied from interface:ArrayPane
Generic class to display a typical WA array table pane. A unique name identifier is to be used in html pages for this array specific actions (exemple : sort on a specific column)
-
init
public void init(String name, javax.servlet.ServletRequest request, javax.servlet.http.HttpSession session)
-
init
public void init(String name, String url, javax.servlet.ServletRequest request, javax.servlet.http.HttpSession session)
-
getState
public ArrayPaneStatusBean getState()
-
addArrayColumn
public ArrayColumn addArrayColumn(String title)
Add a new column to the table.- Specified by:
addArrayColumn
in interfaceArrayPane
- Parameters:
title
- The column title to display- Returns:
- The new column header. You can use this object to modify the default display options.
-
addArrayLine
public ArrayLine addArrayLine()
Description copied from interface:ArrayPane
Add a line to the table. Be carefull : each line form the array has to contain the same cell number. If not, the array will contain some empty cells, and won't be sortable.- Specified by:
addArrayLine
in interfaceArrayPane
- Returns:
- an ArrayLine, to be used to add cells and to modify default display options.
-
setTitle
public void setTitle(String title)
Description copied from interface:ArrayPane
Set the array title, to be displayed on the first html table.
-
setVisibleLineNumber
public void setVisibleLineNumber(int maximum)
Description copied from interface:ArrayPane
Set the maximum line number visible in the table. If the number of line is greater than this maximum, only the first lines will be visible, and some buttons to view next and previous lines will be added.- Specified by:
setVisibleLineNumber
in interfaceArrayPane
- Parameters:
maximum
- The maximum number of visible lines
-
getColumnToSort
public int getColumnToSort()
Description copied from interface:ArrayPane
Get the column to be sorted- Specified by:
getColumnToSort
in interfaceArrayPane
- Returns:
- The column number.
-
setColumnToSort
public void setColumnToSort(int columnNumber)
Description copied from interface:ArrayPane
Modify the column number the sort will be based on.- Specified by:
setColumnToSort
in interfaceArrayPane
- Parameters:
columnNumber
- The column to be sorted
-
print
public String print()
Description copied from interface:ArrayPane
Print the array line in an html format.- Specified by:
print
in interfaceArrayPane
- Specified by:
print
in interfaceSimpleGraphicElement
- Returns:
- The html code, representing the array pane
-
getSession
public javax.servlet.http.HttpSession getSession()
Description copied from interface:ArrayPane
Get the session in which the ArrayPane will keep its state.- Specified by:
getSession
in interfaceArrayPane
- Returns:
- The session
-
getRequest
public javax.servlet.ServletRequest getRequest()
Description copied from interface:ArrayPane
Get the request that can contains some parameters for the ArrayPane (sort action...)- Specified by:
getRequest
in interfaceArrayPane
- Returns:
- The entering request
-
setRoutingAddress
public void setRoutingAddress(String address)
Sets the routing address. This is actually the URL of the page to which requests will be routed when the user clicks on a column header link.- Specified by:
setRoutingAddress
in interfaceArrayPane
- Parameters:
address
- the URI to which routing any requests from this pane.
-
getSortable
public boolean getSortable()
Description copied from interface:ArrayPane
Get global array columns behaviour for sort. By default, all columns are sortable.- Specified by:
getSortable
in interfaceArrayPane
- Returns:
- True, if the array is sortable, false if not.
-
setSortable
public void setSortable(boolean sortable)
Set all array columns to be sortable or not. By default, all columns are sortable.- Specified by:
setSortable
in interfaceArrayPane
- Parameters:
sortable
- Set sortable to false if you want all the table to be non sortable.
-
setLineMoveCallback
public void setLineMoveCallback(String callback)
Description copied from interface:ArrayPane
Sets a Javascript function to call when one or more lines of the array are moved between them.- Specified by:
setLineMoveCallback
in interfaceArrayPane
- Parameters:
callback
- a function to invoke.
-
getCellSpacing
public int getCellSpacing()
-
getCellPadding
public int getCellPadding()
-
getSummary
public String getSummary()
Description copied from interface:ArrayPane
Gets a summary about the content of the array pane.- Specified by:
getSummary
in interfaceArrayPane
- Returns:
- the summary.
-
setSummary
public void setSummary(String summary)
Description copied from interface:ArrayPane
Sets the array pane summary.- Specified by:
setSummary
in interfaceArrayPane
- Parameters:
summary
- a summary.
-
isExportData
public boolean isExportData()
- Specified by:
isExportData
in interfaceArrayPane
- Returns:
- true if the current array pane can be exported, false else if
-
setExportData
public void setExportData(boolean exportData)
- Specified by:
setExportData
in interfaceArrayPane
- Parameters:
exportData
- enable/disable export data from array pane
-
getExportDataURL
public String getExportDataURL()
- Specified by:
getExportDataURL
in interfaceArrayPane
- Returns:
- export data URL used to export current ArrayPane data
-
setExportDataURL
public void setExportDataURL(String exportDataURL)
- Specified by:
setExportDataURL
in interfaceArrayPane
- Parameters:
exportDataURL
- the URL to set used to export array pane data
-
getExportUrl
protected String getExportUrl()
- Returns:
- the export array pane URL
-
isMovableLines
public boolean isMovableLines()
-
setMovableLines
public void setMovableLines(boolean movableLines)
Description copied from interface:ArrayPane
Indicates if the lines of the array can be moved, reordered by hand by the user.- Specified by:
setMovableLines
in interfaceArrayPane
- Parameters:
movableLines
- true if the lines can be moved.
-
getUrl
public String getUrl()
-
getIconsPath
public String getIconsPath()
-
getColumns
public List<ArrayColumn> getColumns()
-
printSortJavascriptFunction
protected String printSortJavascriptFunction()
-
isPaginationOptimized
protected boolean isPaginationOptimized()
Indicates if the pagination is optimized, the is to say if the array contains only the lines which will be printed to the user whereas the array could provides many other pages.- Returns:
- true if the pagination is optimized.
-
getNbItems
protected int getNbItems()
Gets the number of items the list can provides.- Returns:
- the total number of items.
-
-