Class CMSDataContext


Object that gives some context for cms data manipulation
  • Constructor Details

  • Method Details

    • newInstance

      public static CMSDataContext newInstance()
      Creates a new instance of a CMSDataContext
      Returns:
      the created instance
    • newInstance

      public static CMSDataContext newInstance(DataContext context)
      Creates a new instance of a CMSDataContext from another DataContext. It can be the same implementation or another one, but it will be casted to the current implementation.
      Parameters:
      context - the data context to copy
      Returns:
      the created instance
    • cloneContext

      Creates a new instance of a CMSDataContext, with the current context values
      Overrides:
      cloneContext in class RepositoryDataContext
      Returns:
      the created instance
    • getRichTextMaxLength

      public int getRichTextMaxLength()
      Retrieves the rich text max length. If the max length is 0, the whole rich text content is kept
      Returns:
      the rich text max length
    • withRichTextMaxLength

      public <T extends CMSDataContext> T withRichTextMaxLength(int richTextMaxLength)
      Sets the rich text max length Set to 0 to keep the whole rich text content (default)
      Type Parameters:
      T - the type of the retrieved DataContext
      Parameters:
      richTextMaxLength - the rich text max length to set
      Returns:
      the current CMSDataContext
    • indexForFullTextField

      public boolean indexForFullTextField()
      Determines if the value should be indexed for a fulltext field. The fulltext field is given by this CMSDataContext
      Returns:
      true to index value for a fulltext field, false otherwise.
    • withIndexForFullTextField

      public <T extends CMSDataContext> T withIndexForFullTextField(boolean indexForFullTextField)
      Set to true to index the value for a fulltext field. The fulltext field is given by this CMSDataContext
      Type Parameters:
      T - the type of the retrieved DataContext
      Parameters:
      indexForFullTextField - true to index the value for a fulltext field, false otherwise
      Returns:
      the current CMSDataContext
    • getFullTextFieldName

      Get the field name of full-text field. Use if this CMSDataContext is instanciated for full-text field
      Returns:
      the field name of full-text field. Default to SolrFieldNames.SYSTEM_FULL
    • withFullTextFieldName

      public <T extends CMSDataContext> T withFullTextFieldName(String fulltextFieldName)
      Set the field name of full-text field. Use if this CMSDataContext is instanciated for full-text field
      Type Parameters:
      T - the type of the retrieved DataContext
      Parameters:
      fulltextFieldName - the full-text field name
      Returns:
      the current CMSDataContext
    • isSearchedValueEscaped

      public boolean isSearchedValueEscaped()
      Determines if the searched value is escaped
      Returns:
      true if the searched value is escaped, false otherwise.
    • withSearchedValueEscaped

      public <T extends CMSDataContext> T withSearchedValueEscaped(boolean isSearchedValueEscaped)
      Set to true if the searched value is escaped (default to false)
      Type Parameters:
      T - the type of the retrieved DataContext
      Parameters:
      isSearchedValueEscaped - true if the searched value is escaped, false otherwise
      Returns:
      the current CMSDataContext
    • isSearchMultilingual

      public boolean isSearchMultilingual()
      Determines if the search is multilingual
      Returns:
      true if the search is multilingual, false otherwise.
    • withMultilingualSearch

      public <T extends CMSDataContext> T withMultilingualSearch(boolean isSearchMultilingual)
      Set to true if the search is multilingual (default to false)
      Type Parameters:
      T - the type of the retrieved DataContext
      Parameters:
      isSearchMultilingual - true if the search is multilingual, false otherwise
      Returns:
      the current CMSDataContext