arlas-web-contributors / Exports / ResultListContributor
Class: ResultListContributor
This contributor works with the Angular ResultListComponent of the Arlas-web-components project. This class make the brigde between the component which displays the data and the collaborativeSearchService of the Arlas-web-core which retrieve the data from the server.
Hierarchy
Contributor
↳ ResultListContributor
Table of contents
Constructors
Properties
- actionToTriggerOnClick
- cacheDuration
- collaborativeSearcheService
- collection
- collections
- configService
- data
- detailedDataRetriever
- dropDownMapValues
- endCollaborationEvent
- fetchState
- fieldsConfiguration
- fieldsList
- filter
- filtersMap
- geoOrderSort
- highlightItems
- identifier
- includeMetadata
- isDataUpdating
- maxPages
- pageSize
- sort
Accessors
Methods
- addAction
- computeData
- downloadItem
- fetchData
- geoSort
- getConfigValue
- getFilterDisplayName
- getMoreData
- getName
- getPackageName
- getPage
- removeAction
- resolveDropDownButNot
- setData
- setFilters
- setHighlightItems
- setName
- setSelection
- sortColumn
- updateFromCollaboration
- getJsonSchema
Constructors
constructor
• new ResultListContributor(identifier
, collaborativeSearcheService
, configService
, collection
)
Build a new contributor.
Parameters
Name | Type | Description |
---|---|---|
identifier |
string |
Identifier of contributor. |
collaborativeSearcheService |
CollaborativesearchService |
Instance of CollaborativesearchService from Arlas-web-core. |
configService |
ConfigService |
Instance of ConfigService from Arlas-web-core. |
collection |
string |
- |
Overrides
Contributor.constructor
Defined in
src/contributors/ResultListContributor.ts:276
Properties
actionToTriggerOnClick
• actionToTriggerOnClick: Action
[] = []
List of actions, from all the contributors of the app, which we could trigger on click in the ResultListComponent.
Defined in
src/contributors/ResultListContributor.ts:219
cacheDuration
• cacheDuration: any
Overrides
Contributor.cacheDuration
Defined in
src/contributors/ResultListContributor.ts:257
collaborativeSearcheService
• collaborativeSearcheService: CollaborativesearchService
Inherited from
Contributor.collaborativeSearcheService
Defined in
node_modules/arlas-web-core/models/contributor.d.ts:9
collection
• collection: string
Inherited from
Contributor.collection
Defined in
node_modules/arlas-web-core/models/contributor.d.ts:14
collections
• collections: CollectionAggField
[]
Inherited from
Contributor.collections
Defined in
node_modules/arlas-web-core/models/contributor.d.ts:15
configService
• configService: ConfigService
Inherited from
Contributor.configService
Defined in
node_modules/arlas-web-core/models/contributor.d.ts:8
data
• data: Map
<string
, string
| number
| Date
>[]
Data to populate result list, @Input() data of ResultListComponent.
Defined in
src/contributors/ResultListContributor.ts:203
detailedDataRetriever
• detailedDataRetriever: ResultListDetailedDataRetriever
Instance of DetailedDataRetriever class, @Input() detailedDataRetriever of ResultListComponent.
Defined in
src/contributors/ResultListContributor.ts:215
dropDownMapValues
• dropDownMapValues: Map
<string
, Observable
<string
[]>>
List of values to select mapped to each field represented on the resultList. The list of values to select is wrapped in an Observable.
Defined in
src/contributors/ResultListContributor.ts:211
endCollaborationEvent
• endCollaborationEvent: Subject
<unknown
>
Inherited from
Contributor.endCollaborationEvent
Defined in
node_modules/arlas-web-core/models/contributor.d.ts:16
fetchState
• fetchState: Object
Indicates whether the contributor reached the start/end page
Type declaration
Name | Type |
---|---|
endListDown |
boolean |
endListUp |
boolean |
Defined in
src/contributors/ResultListContributor.ts:243
fieldsConfiguration
• fieldsConfiguration: FieldsConfiguration
A configuration object that allows to set id field, title field, fields used in tooltip/icons and urls to images & thumbnails
Defined in
src/contributors/ResultListContributor.ts:226
fieldsList
• fieldsList: { columnName
: string
; dataType
: string
; fieldName
: string
; useColorService?
: boolean
}[] = []
List of columns of the table, @Input() fieldsList of ResultListComponent.
Defined in
src/contributors/ResultListContributor.ts:207
filter
• filter: Object
= {}
A filter that is taken into account when fetching list items and that is not included in the global collaboration.
Defined in
src/contributors/ResultListContributor.ts:247
filtersMap
• filtersMap: Map
<string
, string
| number
| Date
>
Defined in
src/contributors/ResultListContributor.ts:221
geoOrderSort
• geoOrderSort: string
= ''
geoSort parameter of the list.
Defined in
src/contributors/ResultListContributor.ts:255
highlightItems
• highlightItems: Set
<unknown
>
Defined in
src/contributors/ResultListContributor.ts:259
identifier
• identifier: string
Inherited from
Contributor.identifier
Defined in
node_modules/arlas-web-core/models/contributor.d.ts:7
includeMetadata
• includeMetadata: string
[]
List of metadata fields to include in the search query
Defined in
src/contributors/ResultListContributor.ts:231
isDataUpdating
• isDataUpdating: boolean
Inherited from
Contributor.isDataUpdating
Defined in
node_modules/arlas-web-core/models/contributor.d.ts:13
maxPages
• maxPages: any
Maximum number of pages that the contributor fetches. Default to 3.
Defined in
src/contributors/ResultListContributor.ts:239
pageSize
• pageSize: any
Number of items in a page of the list. Default to 100.
Defined in
src/contributors/ResultListContributor.ts:235
sort
• sort: string
= ''
comma seperated field names that sort the list. Order matters.
Defined in
src/contributors/ResultListContributor.ts:251
Accessors
updateData
• get
updateData(): boolean
Returns
boolean
whether the data of contributor should be updated.
Inherited from
Contributor.updateData
Defined in
node_modules/arlas-web-core/models/contributor.d.ts:43
• set
updateData(value
): void
Parameters
Name | Type | Description |
---|---|---|
value |
boolean |
set if the data of contributor should be updated or not. |
Returns
void
whether the data of contributor should be updated.
Inherited from
Contributor.updateData
Defined in
node_modules/arlas-web-core/models/contributor.d.ts:47
Methods
addAction
▸ addAction(action
): void
Method to add Action in actionToTrigger
Parameters
Name | Type | Description |
---|---|---|
action |
Action |
action to add |
Returns
void
Defined in
src/contributors/ResultListContributor.ts:395
computeData
▸ computeData(hits
): Map
<string
, string
| number
| Date
>[]
Parameters
Name | Type |
---|---|
hits |
Hits |
Returns
Map
<string
, string
| number
| Date
>[]
Overrides
Contributor.computeData
Defined in
src/contributors/ResultListContributor.ts:619
downloadItem
▸ downloadItem(elementidentifier
): void
Download item information as json
Parameters
Name | Type |
---|---|
elementidentifier |
ElementIdentifier |
Returns
void
Defined in
src/contributors/ResultListContributor.ts:354
fetchData
▸ fetchData(collaborationEvent
): Observable
<Hits
>
Parameters
Name | Type |
---|---|
collaborationEvent |
CollaborationEvent |
Returns
Observable
<Hits
>
Overrides
Contributor.fetchData
Defined in
src/contributors/ResultListContributor.ts:607
geoSort
▸ geoSort(lat
, lng
, sortById?
): void
Method sorts by geo-distance to a given geo-point
Parameters
Name | Type | Description |
---|---|---|
lat |
number |
latitude of the geo-point |
lng |
number |
longitude of the geo-point |
sortById? |
boolean |
whether to add a sort by id to the geosort or not |
Returns
void
Defined in
src/contributors/ResultListContributor.ts:455
getConfigValue
▸ getConfigValue(key
): any
Parameters
Name | Type | Description |
---|---|---|
key |
string |
a key defined in configuration. |
Returns
any
value of the key
in configuration.
Inherited from
Contributor.getConfigValue
Defined in
node_modules/arlas-web-core/models/contributor.d.ts:31
getFilterDisplayName
▸ getFilterDisplayName(): string
Returns
string
Pretty name of contribution.
Overrides
Contributor.getFilterDisplayName
Defined in
src/contributors/ResultListContributor.ts:382
getMoreData
▸ getMoreData(startFrom
, sortById?
): void
Method called to load more rows into the list.
deprecated
Use getPage
method instead
Parameters
Name | Type | Description |
---|---|---|
startFrom |
number |
It corresponds to the number of times this method is being called. It's used to calculate an offset to get the following items |
sortById? |
boolean |
Whether to add a sortById to the cuurent sort/geosort |
Returns
void
Defined in
src/contributors/ResultListContributor.ts:543
getName
▸ getName(): string
Returns
string
name of contributor set in configuration.
Inherited from
Contributor.getName
Defined in
node_modules/arlas-web-core/models/contributor.d.ts:35
getPackageName
▸ getPackageName(): string
Returns
string
Package name for the configuration service.
Overrides
Contributor.getPackageName
Defined in
src/contributors/ResultListContributor.ts:388
getPage
▸ getPage(reference
, whichPage
): void
Get the previous/following page.
Parameters
Name | Type | Description |
---|---|---|
reference |
Map <string , string | number | Date > |
the last/first hit returned in the list and from which next/previous data is fetched. |
whichPage |
PageEnum |
Whether to fetch next or previous page. |
Returns
void
Defined in
src/contributors/ResultListContributor.ts:563
removeAction
▸ removeAction(action
): void
Method to remove Action in actionToTrigger
Parameters
Name | Type | Description |
---|---|---|
action |
Action |
action to remove |
Returns
void
Defined in
src/contributors/ResultListContributor.ts:404
resolveDropDownButNot
▸ resolveDropDownButNot(column
): void
Parameters
Name | Type |
---|---|
column |
Column |
Returns
void
Defined in
src/contributors/ResultListContributor.ts:724
setData
▸ setData(listResult
): Map
<string
, string
| number
| Date
>[]
Parameters
Name | Type |
---|---|
listResult |
Map <string , string | number | Date >[] |
Returns
Map
<string
, string
| number
| Date
>[]
Overrides
Contributor.setData
Defined in
src/contributors/ResultListContributor.ts:696
setFilters
▸ setFilters(filterMap
): void
Method call when emit the output setFiltersEvent
Parameters
Name | Type | Description |
---|---|---|
filterMap |
Map <string , string | number | Date > |
filter params |
Returns
void
Defined in
src/contributors/ResultListContributor.ts:476
setHighlightItems
▸ setHighlightItems(items
): void
Parameters
Name | Type |
---|---|
items |
string [] |
Returns
void
Defined in
src/contributors/ResultListContributor.ts:347
setName
▸ setName(name
): void
Parameters
Name | Type |
---|---|
name |
string |
Returns
void
set the name of the contributor
Inherited from
Contributor.setName
Defined in
node_modules/arlas-web-core/models/contributor.d.ts:39
setSelection
▸ setSelection(listResult
, collaboration
): any
Parameters
Name | Type |
---|---|
listResult |
Map <string , string | number | Date >[] |
collaboration |
Collaboration |
Returns
any
Overrides
Contributor.setSelection
Defined in
src/contributors/ResultListContributor.ts:701
sortColumn
▸ sortColumn(sortParams
, sortById?
): void
Sorts the list according to the given sort parameters. If sortParams
is not defined, and sortById=true
then the list is sorted by
id (fieldsConfiguration.idFieldName
)
Parameters
Name | Type | Description |
---|---|---|
sortParams |
Object |
sort parameters. They include on which field (column) to sort and in which direction (ascending, descending) |
sortParams.fieldName |
string |
- |
sortParams.sortDirection |
SortEnum |
- |
sortById? |
boolean |
whether to add a sort by id (fieldsConfiguration.idFieldName ) to the sorted column |
Returns
void
Defined in
src/contributors/ResultListContributor.ts:416
updateFromCollaboration
▸ updateFromCollaboration(collaborationEvent
): void
Parameters
Name | Type |
---|---|
collaborationEvent |
CollaborationEvent |
Returns
void
Inherited from
Contributor.updateFromCollaboration
Defined in
node_modules/arlas-web-core/models/contributor.d.ts:56
getJsonSchema
▸ Static
getJsonSchema(): Object
Returns
Object
Defined in
src/contributors/ResultListContributor.ts:343