Skip to content
This repository has been archived by the owner on Oct 22, 2020. It is now read-only.

Virtual Folders

Faber Andrés Vergara Holguín edited this page Aug 15, 2017 · 6 revisions

Virtual Folders

Contents:

Introduction

Virtual folders are nodes in the Casebox UI tree whose chidlren are determined and categorized using dynamic filters/facets on values of specific fields.

For example, if you have template person with a gender field. You can create a virtual folder called Person Gender based on that template and field. This virtual folder will automatically be populated with subfolders Male and Female (depending on the values of the field) and different objects of that template will go in either subfolder depending on whether their gender.

Usage

  • Add solr_column_name value to field ie. gender_i
  • Run update SOLR fields script
    $ php bin/update_solr_prepared_data.php -c corename -at
  • Add or edit facet configs as Config json option variable in System/Config/facet_configs
{
  "gender": {
    "title": "Gender",
    "field": "gender_i",
    "type": "objects"
  }
}
  • Add Virtual Folder in System/Config/treeNodes as Config json option
{
  "class": "CB\\TreeNode\\FacetNav",
  "pid": 1,
  "title_en": "Gender",
  "fq": ["template_id:000"],
  "level_fields": "gender",
  "DC": {
    "name": {},
    "country": {},
    "age": {},
    "gender": {},
    "cid": {}
  },
  "facets": ["country", "age"],
  "show_count": true
}
  • Run SOLR reindex core script again and reload browser
    $ php bin/solr_reindex_core.php -c corename -al