Skip to content

Portlet Configuration

anja edited this page Dec 15, 2016 · 1 revision

Filter Configuration

The filter can be configured in filterConfig.json. It is split up in several parts, each for one kind of a filter.

src/main/resources/filterConfig.json

{
    "facets": [...],
    "graph": {...},
    "dataRange": {...}
}

Facets Filter

The facets filter are displayed on the right in the form of a menu and are used to filter the results.

src/main/resources/filterConfig.json

"facets": [
        {
            "id": "string",
            "name": "string",
            "cssClass": "string",
            "subItemsFacet": "string",
            "collapsed": true or false,
            "scrollable": true or false,
            "subItems": [[
                {
                    "id": "string",
                    "name": "string",
                    "subItemsFacet": "string",
                    "cssClass": "string",
                    "collapsed": true or false,
                    "scrollable": true or false,
                    "children_filter": true or false
                },
            ...
            ]
        },
        ...
    ]
Explanation:
Key Description

id

Prefix for ids

name

Label in menu

cssClass

Css class for this filter

subItemsFacet

field name from in solr index

collapsed

Indicate if this filter-group is collapsed

scrollable

Indicate if this filter-group is scrollable

subitems

List of subitems

children_filter

Show subitems of group

Graph

The graph is used to display the factes and their relation to each other. A collapsed facet is not show in the graph.

src/main/resources/filterConfig.json

"graph": {
        "nodes" : {
            "maxNumber" : Integer
        },
        "hide" : true or false
    }
Explanation:
Key Description

maxNumber

the maximum number shown in the graph (the samller ones are hidden)

hide

indicates if on first load the graph should be collapsed or not

Date Range Filter

The date range filter can be used to filter for documents that for example wher create between to dates.

src/main/resources/filterConfig.json

"dateRange": {
        "field": "string",
        "title": "string",
        "format": {
            "utc": true or false,
            "day": true or false,
            "month": true or false,
            "year": true or false
        }
    }
Explanation:
Key Description

field

the solr field the filter should apply to

title

the heading for the range filter on the webpage

format

the date format

utc

use local time or utc time

day

indicates if to display the day

month

indicates if to display the month

year

indicates if to display the year

Result List Configuration

src/main/resources/resultListConfig.json  Expand source

{
  "title": {
    "field": "string",
    "highlight": true or false
  },
  "id": {
    "field": "string",
    "highlight": false
  },
  "body": [
    [
      {
        "field": "string",
        "title": "string",
        "highlight": true or false,
        "class": "string"
      },
        ...
    ]
  ],
  "pages" : {...},
  "sortOptions" : [...]
}
Explanation:
Key Subkey Description

title

 

what should be displayed in the header of a result entry

id

 

the id associated with the result entry

body

 

what should be displayed in the body of a result entry

 

field

the solr index field that provieds the content

 

highlight

if a free text search matches this or part of this field, highlight the match

 

title

heading associated with this content

 

class

css class

Sorting

For appending or removing options in the Sort dropdown you have to find the entry "sortOptions" and edit the corresponding values.The field value represents the Solr sort parameter (http://wiki.apache.org/solr/CommonQueryParameters#sort) and text the title in the dropdown.

src/main/resources/resultListConfig.json  Expand source

"sortOptions" : [
        {
            "value": "score desc",
            "text": "Relevance",
            "default": true
        },
        {
            "value": "title_sort asc",
            "text": "A-Z Title"
        },
        ...
    ]
Pagination

The pagination of the resultList is defined with two variables. The variable initial represents the intial index of the first document (by default 0) and rows the number of documents in a page.

src/main/resources/resultListConfig.json

"pages" : {
      "initial": 0,
      "rows": 10
  },

Detail View Configuration

Configure which Information should be displayed in which form in the Detail Modal.

src/main/resources/detailViewConfig.json

{
  "title": {
    "field": "title",
    "highlight": true
  },
  "id": {
    "field": "id",
    "highlight": false
  },
  "body": [
    [
      {
        "field": "string",
        "title": "string",
        "tooltip": "string",
        "highlight": true | false,
        "hideIfNotSet": true | false
      },
      ...
      ],
    [
      {
        "field": "string",
        ...
      },
      ...
    ]
  ]
}
Explanation:
Key Subkey Description

title

 

what should be displayed in the header of the detail view

id

 

the id associated with the detail view

body

 

what should be displayed in the body of the detail view

 

field

the solr index field that provieds the content

 

highlight

if a free text search matches this or part of this field, highlight the match

 

title

heading associated with this content

 

tooltip

the text that should be displayed when the mouse hovers over the title text

 

hideIfNotSet

hide the title if the field was not provieded by the solr responce (e.g. because of missing permissions, or because it was not set)

The body contains a two-dimensional array. The second dimension is used for grouping the fields together. A horizontal line is displayed btween these groups.

Export Configuration

Configuration for the different export options. Currently it is only possible to export Bibtex.

src/main/resources/exportConfig.json

{ "BibTeX": {
    "fields": [
       "fieldName1", "fieldName2", ...
    ]
  }
}

For the BibTeX export it is necessary to specify all the solr index fields that should be used to generate the BibTeX content, so the Portlet can build the export query correctly.