GridSettings

public class GridSettings

The grid settings coming from the jqgrid plugin.

Fields

DEFAULT_ROWS

public static final int DEFAULT_ROWS

The default number of rows displayed in the grid.

Methods

containsLanguage

public boolean containsLanguage(String language)

Checks whether the given language matches these grid settings and should be displayed.

Parameters:
  • language – the language to check
Returns:

true if it matches the settings, false otherwise

getLanguages

public String getLanguages()
Returns:the languages for which we should filter contents

getName

public String getName()
Returns:the name for which we should filter contents

getPage

public Integer getPage()
Returns:the page to display, starting from 1

getRows

public Integer getRows()
Returns:the number of rows to display per page

getSortColumn

public String getSortColumn()
Returns:the name of the field on which sorting should be performed

getSortDirection

public String getSortDirection()
Returns:the sorting direction for these settings, either asc or desc

isCorrect

public boolean isCorrect(String contentName, String contentLanguage, String contentType)

Checks whether given parameters from a content match these grid settings.

Parameters:
  • contentName – the name of the content
  • contentLanguage – the language of the content
  • contentType – the type of the content (stream or string)
Returns:

true if the content matches these grid settings, false otherwise

isDescending

public boolean isDescending()

Checks whether the sorting direction for these settings is descending (equal to “desc”).

Returns:true if ordering direction is descending, false otherwise

isStream

public Boolean isStream()
Returns:true if these settings accept (display) stream contents, false otherwise

isString

public Boolean isString()
Returns:true if these settings accept (display) string contents, false otherwise

setLanguages

public void setLanguages(String languages)

Sets the languages for which we should filter. Blank languages will be ignored.

Parameters:
  • languages – the languages for which we should filter contents

setName

public void setName(String name)

Sets the name for which we should filter contents. Blank name will be ignored.

Parameters:
  • name – the name for which we should filter contents

setPage

public void setPage(Integer page)

Sets the page to display. Null will be ignored.

Parameters:
  • page – the page to display, starting from 1

setRows

public void setRows(Integer rows)

Sets the number of rows to display per page. Null will be ignored.

Parameters:
  • rows – the number of rows to display per page

setSortColumn

public void setSortColumn(String sortColumn)

Sets the name of the field on which sorting should be performed. Blank column name will be ignored.

Parameters:
  • sortColumn – the name of the field on which sorting should be performed

setSortDirection

public void setSortDirection(String sortDirection)

Sets the sorting direction for these settings. Blank values will be ignored.

Parameters:
  • sortDirection – the sorting direction for these settings, either asc or desc

setStream

public void setStream(Boolean stream)

Set whether these settings should accept (display) stream contents. Null will be ignored.

Parameters:
  • stream – true if these settings accept (display) stream contents, false otherwise

setString

public void setString(Boolean string)

Set whether these settings should accept (display) string contents. Null will be ignored.

Parameters:
  • string – true if these settings accept (display) string contents, false otherwise