Class TabularSource<F extends ITabularSourceField>

    • Constructor Detail

      • TabularSource

        public TabularSource​(org.w3c.dom.Node sourceDefinitionNode,
                             ISourceContext sourceContext)
                      throws PortalException
        Creates a tabular source.
        Parameters:
        sourceDefinitionNode - the source definition node.
        sourceContext - the source context.
        Throws:
        PortalException
        Since:
        4.0.4
    • Method Detail

      • createSourceField

        protected F createSourceField​(org.w3c.dom.Node fieldNode)
                               throws PortalException
        Description copied from class: Source
        Factory method for creating a source field instance that corresponds to the field node given. This method instantiate and returns the source field, without initializing it.
        Overrides:
        createSourceField in class Source<F extends ITabularSourceField>
        Parameters:
        fieldNode - the field node.
        Returns:
        the ISourceField created, or null if no field should be created for this node.
        Throws:
        PortalException
        See Also:
        Source.createCustomSourceField(Node)
      • getPrimaryKeyField

        public F getPrimaryKeyField()
        Returns the field id of the primary key field.
        Returns:
        Since:
        4.0.11
      • getPositionField

        public F getPositionField()
        Returns the position field of this source.
        Returns:
        the position field or null if this source does not have a position field.
        Since:
        10.3.0
      • getIndexerEngineId

        @Deprecated
        public java.lang.String getIndexerEngineId()
                                            throws PortalException
        Deprecated.
        Since 8.1.0, lumis.search is deprecated and this method is no longer used.
        Returns the identifier of the indexing engine for this source
        Returns:
        Throws:
        PortalException
        Since:
        4.0.11
      • getSearcherEngineId

        @Deprecated
        public java.lang.String getSearcherEngineId()
                                             throws PortalException
        Deprecated.
        Since 8.1.0, lumis.search is deprecated and this method is no longer used.
        Returns the searcher engine for this source
        Returns:
        Throws:
        PortalException
        Since:
        4.0.11
      • getIndexerId

        @Deprecated
        public java.lang.String getIndexerId()
                                      throws PortalException
        Deprecated.
        Since 8.1.0, lumis.search is deprecated and this method is no longer used.
        Returns the identifier of the indexer for this source.
        Returns:
        Throws:
        PortalException
        Since:
        4.0.11
      • getSearcherId

        @Deprecated
        public java.lang.String getSearcherId()
                                       throws PortalException
        Deprecated.
        Since 8.1.0, lumis.search is deprecated and this method is no longer used.
        Returns the identifier of the searcher for this source.
        Returns:
        Throws:
        PortalException
        Since:
        4.0.11
      • isSearchEnabled

        @Deprecated
        public boolean isSearchEnabled()
        Deprecated.
        Since 8.1.0, lumis.search is deprecated and this method is no longer used.
        Returns whether search is enabled for this source or not.
        Returns:
        Since:
        4.0.11
      • getSearchableFields

        @Deprecated
        public java.util.List<F> getSearchableFields()
        Deprecated.
        Since 8.1.0, lumis.search is deprecated and this method is no longer used.
        Returns a collection of fields that are searchable
        Returns:
        Since:
        4.0.11
      • getHyperlinkDefaultParameters

        public java.util.Collection<java.lang.String> getHyperlinkDefaultParameters()
        Description copied from class: Source
        Returns the default parameters that should be used when creating a hyperlink url from this source.
        Overrides:
        getHyperlinkDefaultParameters in class Source<F extends ITabularSourceField>
        Returns:
        a collection with the default parameter names.
      • getFieldsDefinitionNode

        public org.w3c.dom.Node getFieldsDefinitionNode()
                                                 throws PortalException
        Returs the fields node of the source.
        Returns:
        Throws:
        PortalException
        Since:
        4.0.11
      • getFieldClass

        public java.lang.Class getFieldClass​(java.lang.String fieldId)
                                      throws PortalException
        Returns the class object of the field. This implementation always returns the String.class object.
        Parameters:
        fieldId -
        Returns:
        Throws:
        PortalException
        Since:
        4.0.11
      • convertDataToDefinedDataTypes

        protected TabularData convertDataToDefinedDataTypes​(TabularData originalData)
                                                     throws PortalException
        Converts the given data to another data with the values that should be used according to this source's fields definitions.
        Parameters:
        originalData - the data to be converted.
        Returns:
        the converted data.
        Throws:
        PortalException
        Since:
        4.1.1
      • setData

        public void setData​(TabularData tabularData)
                     throws PortalException
        Sets the data in this source.
        Parameters:
        tabularData - the data to set in this source.
        Throws:
        PortalException
        Since:
        4.0.4
      • compareField

        protected int compareField​(ISourceData row1,
                                   ISourceData row2,
                                   java.lang.String fieldId,
                                   java.lang.String direction)
        Returns an integer that represents the comparason between the same field value of two different rows. This method is used for sorting results after the tabular data is filled.

        0 signifies equality 1 signifies the first row is greater -1 signifies the second row is greater

        If the direction is QuerySortOrder.DESCENDING, the results are inverted.

        Parameters:
        row1 -
        row2 -
        fieldId -
        direction - QuerySortOrder.ASCENDING or QuerySortOrder.DESCENDING
        Returns:
        Since:
        4.0.11
      • getFieldName

        public java.lang.String getFieldName​(java.lang.String fieldId)
                                      throws PortalException
        Returns the field name given a field id.
        Parameters:
        fieldId -
        Returns:
        Throws:
        PortalException
        Since:
        4.0.11
      • getSortedFieldIds

        @Deprecated
        public java.util.SortedSet<java.lang.String> getSortedFieldIds​(java.lang.String fieldCriteria)
                                                                throws PortalException
        Deprecated.
        This method may be removed in the future, because it is public and references field xml definition.
        Get this source's set of field ids having definition node matching the specified criteria, sorted
        Parameters:
        fieldCriteria -
        Returns:
        Throws:
        PortalException
      • getFieldIds

        @Deprecated
        public java.util.Set<java.lang.String> getFieldIds​(java.lang.String fieldCriteria)
                                                    throws PortalException
        Deprecated.
        This method may be removed in the future, because it is public and references field xml definition.
        Get this source's set of field ids having definition node matching the specified criteria
        Parameters:
        fieldCriteria -
        Returns:
        Throws:
        PortalException
      • getFieldId

        @Deprecated
        public java.lang.String getFieldId​(java.lang.String fieldCriteria)
                                    throws PortalException
        Deprecated.
        This method may be removed in the future, because it is public and references field xml definition.
        Get this source's field id having definition node matching the specified criteria
        Parameters:
        fieldCriteria -
        Returns:
        Throws:
        PortalException
      • hasField

        @Deprecated
        public boolean hasField​(java.lang.String fieldCriteria)
                         throws PortalException
        Deprecated.
        This method may be removed in the future, because it is public and references field xml definition.
        Check if this source have a field with definition node matching the specified criteria
        Parameters:
        fieldCriteria -
        Returns:
        Throws:
        PortalException
      • applyPostLoadFilters

        public void applyPostLoadFilters()
                                  throws PortalException
        Apply the filters specified in this source to its data. This is an utility method for data providers that does not support filtering during the source load operation. After loading the source's data without filtering it, the data provider may call this method for the source to remove data that does not attend to the filters specified.

        Data providers that may provide significant quantity of data should implement its own filtering during load instead of using this method, to prevent unnecessary use of server's memory and cpu.

        Currently this implementation supports only simple filters, without grouping and of operator 'like'.

        Overrides:
        applyPostLoadFilters in class Source<F extends ITabularSourceField>
        Throws:
        PortalException
        See Also:
        IDataProvider.loadData(lumis.portal.SessionConfig, Source, lumis.util.ITransaction)
      • applyPostLoadPagination

        public void applyPostLoadPagination()
        Adjusts the data of this source for pagination.

        The total rows of this data is set to its size, and then its rows are trimmed, according to the getStartAt() and getMaxRows() values.

        For correct behavior, the rows presence or ordering may not be changed after this processing.

        Since:
        4.0.9
      • setStartAt

        public void setStartAt​(int startAt)
        Sets the row start position the data of this source shold be read from. Used for pagination funcionalities. The row number is 1-based.
        Parameters:
        startAt -
        Since:
        4.0.11
      • getStartAt

        public int getStartAt()
        Returns the row start position the data of this source shold be read from. Used for pagination funcionalities. The row number is 1-based.
        Returns:
        the row start position the data of this source shold be read from.
        Since:
        4.0.5
      • setMaxRows

        public void setMaxRows​(int maxRows)
        Sets the maximum rows that data of this source shold contain. Used for pagination funcionalities. The row number is 1-based.
        Parameters:
        maxRows -
        Since:
        4.0.11
      • getMaxRows

        public int getMaxRows()
        Returns the maximum rows that data of this source shold contain. Used for pagination funcionalities. The row number is 1-based.
        Returns:
        Since:
        4.0.11
      • evaluateMaxRows

        public int evaluateMaxRows​(int maxRows)
        Helper Method for evaluating which will be the value returned by getMaxRows() after calling setMaxRows(int) with this parameter.
        Parameters:
        maxRows - The value to be used in the evaluation.
        Returns:
        The value that will be returned by getMaxRows().
        Since:
        12.0.0
      • getDefaultSourceSearchContentFillerClassName

        @Deprecated
        protected java.lang.String getDefaultSourceSearchContentFillerClassName()
        Deprecated.
        Since 8.1.0 this method is no longer used and remains only for binary compatibility, due to lumis.search being replaced by lumis.portal.bigdata. Consider using getDefaultBigDataPersister() instead.
        Returns the default source search content search filler class name.

        The default value defined in this class is lumis.doui.search.DouiTabularSourceSearchContentFiller.

        Returns:
        Since:
        4.0.11
      • getSourceSearchContentFillerClassName

        @Deprecated
        public java.lang.String getSourceSearchContentFillerClassName()
        Deprecated.
        Since 8.1.0 this method is no longer used and remains only for binary compatibility, due to lumis.search being replaced by lumis.portal.bigdata. Consider using Source.getBigDataPersister() instead.
        Returns the defined search filler class name
        Returns:
        Since:
        4.0.11
      • getReindexerTabularDataProcessorClassName

        @Deprecated
        public java.lang.String getReindexerTabularDataProcessorClassName()
        Deprecated.
        Since 8.1.0 this method is no longer used and remains only for binary compatibility, due to lumis.search being replaced by lumis.portal.bigdata. Current implementation of this method throws UnsupportedOperationException.
        Returns the class name of the reindexer for this source
        Returns:
        Since:
        4.0.11
      • getDefaultBigDataPersister

        protected <S extends Source<?>> ISourceBigDataPersister<S> getDefaultBigDataPersister()
        Description copied from class: Source
        Returns the default ISourceBigDataPersister implementation to be used for this source if the big data persisting is not disabled and no specific persister class is configured for this source.

        This method is called by Source.getBigDataPersister() when the default is to be used.

        Overrides:
        getDefaultBigDataPersister in class Source<F extends ITabularSourceField>
        Returns:
        the default ISourceBigDataPersister implementation.