#
# Browse configuration
#

# number of seconds to keep cached browses around
# set to 0 to disable caching
cache_timeout = 0

# Configuration for object browse
ca_objects = {
	name = _(Objects),
	facets = {
		year_facet = {
			type = normalizedDates,
			element_code = parsed_date,
			normalization = decades,
			
			group_mode = none,
			
			facet_groups = [frontpage],
			
			label_singular = _(decade),
			label_plural = _(decades)
		},
#		collection_facet = {
#			type = authority,
#			table = ca_collections,
#			relationship_table = ca_object_lots_x_collections,
#			restrict_to_types = [],
#			
#			group_mode = alphabetical,
#			
#			label_singular = _(collection),
#			label_plural = _(collections)
#		},
		classification_facet = {
			type = attribute,
			element_code = classification,

			group_mode = hierarchical,
			
			# Set to non-zero value to display hierarchy on items in this facet
			show_hierarchy = 1,
			
			facet_groups = [frontpage],
			
			label_singular = _(classification),
			label_plural = _(classifications)
		},
		materials_facet = {
			type = authority,
			table = ca_list_items,
			relationship_table = ca_objects_x_vocabulary_terms,
			restrict_to_types = [],
			
			group_mode = hierarchical,
			
			# Set to non-zero value to display hierarchy on items in this facet
			show_hierarchy = 1,
			
			# Character(s) to place between elements of the hierarchy
			hierarchical_delimiter = &nbsp;⬅&nbsp;,
			
			# Number of items to trim off the top (leave blank or set to 0 to trim nothing)
			remove_first_items = ,
			
			# Maximum length of hierarchy to display (leave blank to return hierarchy unabridged)
			hierarchy_limit = ,
			
			# can be ASC or DESC (default is DESC)
			hierarchy_order  = DESC,
			
			facet_groups = [frontpage],
			
			indefinite_article = a,
			label_singular = _(material),
			label_plural = _(materials)
		},
		occurrence_facet = {
			type = authority,
			table = ca_occurrences,
			generate_facets_for_types = 1,
			relationship_table = ca_entities_x_occurrences,
			restrict_to_types = [],
			
			group_mode = alphabetical,
			
			indefinite_article = an,
			label_singular = _(occurrence),
			label_plural = _(occurrences)
		},
		status_facet = {
			type = fieldList,
			field = status,
			
			group_mode = none,
			
			facet_groups = [frontpage],
			
			indefinite_article = an,
			label_singular = _(research status),
			label_plural = _(research status)
		}
	}
}
# --------------------------------------------------------------------
# Configuration for object lot browse
ca_object_lots = {
	name = _(Lots),
	facets = {
		entity_facet = {
			# 'type' can equal authority, attribute, fieldList, normalizedDates
			type = authority,		
			table = ca_entities,
			relationship_table = ca_object_lots_x_entities,
			restrict_to_types = [],
			
			group_mode = alphabetical,
			
			order_by_label_fields = [surname, forename, middlename],
			
			indefinite_article = an,
			label_singular = _(entity),
			label_plural = _(entities)
		},
		place_facet = {
			type = authority,
			table = ca_places,
			relationship_table = ca_object_lots_x_places,
			restrict_to_types = [],
			
			group_mode = alphabetical,
			
			label_singular = _(place),
			label_plural = _(places)
		},
		collection_facet = {
			type = authority,
			table = ca_collections,
			relationship_table = ca_object_lots_x_collections,
			restrict_to_types = [],
			
			group_mode = alphabetical,
			
			label_singular = _(collection),
			label_plural = _(collections)
		},
		occurrence_facet = {
			type = authority,
			table = ca_occurrences,
			generate_facets_for_types = 1,
			relationship_table = ca_object_lots_x_occurrences,
			restrict_to_types = [],
			
			group_mode = alphabetical,
			
			indefinite_article = an,
			label_singular = _(occurrence),
			label_plural = _(occurrences)
		},
		term_facet = {
			type = authority,
			table = ca_list_items,
			relationship_table = ca_object_lots_x_vocabulary_terms,
			restrict_to_types = [],
			
			group_mode = alphabetical,
			
			label_singular = _(term),
			label_plural = _(terms)
		},
		type_facet = {
			type = fieldList,
			field = type_id,
			
			group_mode = alphabetical,
			
			label_singular = _(type),
			label_plural = _(types)
		},
		status_facet = {
			type = fieldList,
			field = status,
			
			group_mode = alphabetical,
			
			label_singular = _(research status),
			label_plural = _(research statuses)
		},
		access_facet = {
			type = fieldList,
			field = access,
			
			group_mode = alphabetical,
			
			indefinite_article = an,
			label_singular = _(access status),
			label_plural = _(access statuses)
		}
	}
}
# --------------------------------------------------------------------
# Configuration for entity browse
ca_entities = {
	name = _(Entities),
	facets = {
		place_facet = {
			type = authority,
			table = ca_places,
			relationship_table = ca_entities_x_places,
			restrict_to_types = [],
			
			group_mode = alphabetical,
			
			label_singular = _(place),
			label_plural = _(places)
		},
		occurrence_facet = {
			type = authority,
			table = ca_occurrences,
			generate_facets_for_types = 1,
			relationship_table = ca_entities_x_occurrences,
			restrict_to_types = [],
			
			group_mode = alphabetical,
			
			indefinite_article = an,
			label_singular = _(occurrence),
			label_plural = _(occurrences)
		},
		collection_facet = {
			type = authority,
			table = ca_collections,
			relationship_table = ca_entities_x_collections,
			restrict_to_types = [],
			
			group_mode = alphabetical,
			
			label_singular = _(collection),
			label_plural = _(collections)
		},
		term_facet = {
			type = authority,
			table = ca_list_items,
			relationship_table = ca_entities_x_vocabulary_terms,
			restrict_to_types = [],
			
			group_mode = alphabetical,
			
			label_singular = _(term),
			label_plural = _(terms)
		},
		type_facet = {
			type = fieldList,
			field = type_id,
			
			group_mode = alphabetical,
			
			label_singular = _(type),
			label_plural = _(types)
		},
		status_facet = {
			type = fieldList,
			field = status,
			
			group_mode = alphabetical,
			
			label_singular = _(status),
			label_plural = _(statuses)
		},
		access_facet = {
			type = fieldList,
			field = access,
			
			group_mode = alphabetical,
			
			indefinite_article = an,
			label_singular = _(access status),
			label_plural = _(access statuses)
		}
	}
}
# --------------------------------------------------------------------
# Configuration for collection browse
ca_collections = {
	name = _(Collections),
	facets = {
		entity_facet = {
			# 'type' can equal authority, attribute, fieldList, normalizedDates
			type = authority,		
			table = ca_entities,
			relationship_table = ca_entities_x_collections,
			restrict_to_types = [],
			
			group_mode = alphabetical,
			
			order_by_label_fields = [surname, forename, middlename],
			
			indefinite_article = an,
			label_singular = _(entity),
			label_plural = _(entities)
		},
		place_facet = {
			type = authority,
			table = ca_places,
			relationship_table = ca_places_x_collections,
			restrict_to_types = [],
			
			group_mode = alphabetical,
			
			label_singular = _(place),
			label_plural = _(places)
		},
		occurrence_facet = {
			type = authority,
			table = ca_occurrences,
			generate_facets_for_types = 1,
			relationship_table = ca_occurrences_x_collections,
			restrict_to_types = [],
			
			group_mode = alphabetical,
			
			indefinite_article = an,
			label_singular = _(occurrence),
			label_plural = _(occurrences)
		},
		term_facet = {
			type = authority,
			table = ca_list_items,
			relationship_table = ca_collections_x_vocabulary_terms,
			restrict_to_types = [],
			
			group_mode = alphabetical,
			
			label_singular = _(term),
			label_plural = _(terms)
		},
		type_facet = {
			type = fieldList,
			field = type_id,
			
			group_mode = alphabetical,
			
			label_singular = _(type),
			label_plural = _(types)
		},
		status_facet = {
			type = fieldList,
			field = status,
			
			group_mode = alphabetical,
			
			label_singular = _(status),
			label_plural = _(statuses)
		},
		access_facet = {
			type = fieldList,
			field = access,
			
			group_mode = alphabetical,
			
			indefinite_article = an,
			label_singular = _(access status),
			label_plural = _(access statuses)
		}
	}
}

# --------------------------------------------------------------------
# Configuration for place browse
ca_places = {
	name = _(Places),
	facets = {
		entity_facet = {
			# 'type' can equal authority, attribute, fieldList, normalizedDates
			type = authority,		
			table = ca_entities,
			relationship_table = ca_entities_x_places,
			restrict_to_types = [],
			
			group_mode = alphabetical,
			
			order_by_label_fields = [surname, forename, middlename],
			
			indefinite_article = an,
			label_singular = _(entity),
			label_plural = _(entities)
		},
		object_facet = {
			type = authority,
			table = ca_objects,
			relationship_table = ca_objects_x_places,
			restrict_to_types = [],
			
			group_mode = alphabetical,
			
			label_singular = _(object),
			label_plural = _(objects)
		},
		occurrence_facet = {
			type = authority,
			table = ca_occurrences,
			generate_facets_for_types = 1,
			relationship_table = ca_places_x_occurrences,
			restrict_to_types = [],
			
			group_mode = alphabetical,
			
			indefinite_article = an,
			label_singular = _(occurrence),
			label_plural = _(occurrences)
		},
		term_facet = {
			type = authority,
			table = ca_list_items,
			relationship_table = ca_places_x_vocabulary_terms,
			restrict_to_types = [],
			
			group_mode = alphabetical,
			
			label_singular = _(term),
			label_plural = _(terms)
		},
		type_facet = {
			type = fieldList,
			field = type_id,
			
			group_mode = alphabetical,
			
			label_singular = _(type),
			label_plural = _(types)
		},
		status_facet = {
			type = fieldList,
			field = status,
			
			group_mode = alphabetical,
			
			label_singular = _(status),
			label_plural = _(statuses)
		},
		access_facet = {
			type = fieldList,
			field = access,
			
			group_mode = alphabetical,
			
			indefinite_article = an,
			label_singular = _(access status),
			label_plural = _(access statuses)
		}
	}
}
# --------------------------------------------------------------------
# Configuration for occurrence browse
ca_occurrences = {
	name = _(Other authorities),
	facets = {
		curator_facet = {
			# 'type' can equal authority, attribute, fieldList, normalizedDates
			type = authority,	
			table = ca_entities,
			type_restrictions = [exhibition],
			
			relationship_table = ca_entities_x_occurrences,
			restrict_to_types = [],
			restrict_to_relationship_types = [curator],
			
			group_mode = alphabetical,
			
			order_by_label_fields = [surname, forename, middlename],
			
			indefinite_article = a,
			label_singular = _(curator),
			label_plural = _(curators)
		},
		year_facet = {
			type = normalizedDates,
			element_code = parsed_date,
			type_restrictions = [exhibition],
			
			normalization = decades,
			
			group_mode = none,
			
			label_singular = _(decade),
			label_plural = _(decades)
		},
		exhibition_cat_published = {
			type = attribute,
			element_code = has_exhibition_catalogue,
			type_restrictions = [exhibition],
			
			group_mode = none,
			single_value = yes,

			label_singular = _(catalogue published),
			label_plural = _(catalogue published)
		},
		exhibition_cat_facet = {
			type = attribute,
			element_code = exhibition_category,
			type_restrictions = [exhibition],
			
			group_mode = none,

			label_singular = _(type),
			label_plural = _(types)
		},
		venue_facet = {
			# 'type' can equal authority, attribute, fieldList, normalizedDates
			type = authority,		
			table = ca_entities,
			type_restrictions = [exhibition],
			
			relationship_table = ca_entities_x_occurrences,
			restrict_to_types = [],
			restrict_to_relationship_types = ["primary_venue"],
			
			group_mode = alphabetical,
			
			order_by_label_fields = [surname, forename],
			
			indefinite_article = a,
			label_singular = _(venue),
			label_plural = _(venues)
		},
		venue_location_facet = {
			# 'type' can equal authority, attribute, fieldList, normalizedDates
			type = authority,		
			table = ca_places,
			type_restrictions = [exhibition],
			
			relationship_table = ca_places_x_occurrences,
			restrict_to_types = [],
			restrict_to_relationship_types = ["location"],
			
			group_mode = hierarchical,
			
			# Set to non-zero value to display hierarchy on items in this facet
			show_hierarchy = 1,
			
			# Character(s) to place between elements of the hierarchy
			hierarchical_delimiter = &nbsp;⬅&nbsp;,
			
			# Number of items to trim off the top (leave blank or set to 0 to trim nothing)
			remove_first_items = 1,
			
			# Maximum length of hierarchy to display (leave blank to return hierarchy unabridged)
			hierarchy_limit = ,
			
			# can be ASC or DESC (default is DESC)
			hierarchy_order  = DESC,
			
			
			indefinite_article = a,
			label_singular = _(location),
			label_plural = _(location)
		},
		author_facet = {
			# 'type' can equal authority, attribute, fieldList, normalizedDates
			type = authority,	
			table = ca_entities,
			type_restrictions = [bibliography],
			
			relationship_table = ca_entities_x_occurrences,
			restrict_to_types = [],
			restrict_to_relationship_types = [author, contributing_author],
			
			group_mode = alphabetical,
			
			order_by_label_fields = [surname, forename],
			
			indefinite_article = a,
			label_singular = _(author),
			label_plural = _(authors)
		},
		bib_decade_facet = {
			type = normalizedDates,
			element_code = bib_year_published,
			type_restrictions = [bibliography],
			
			normalization = decades,
			
			group_mode = none,
			
			label_singular = _(decade),
			label_plural = _(decades)
		},
		bib_year_facet = {
			type = normalizedDates,
			element_code = bib_year_published,
			type_restrictions = [bibliography],
			
			normalization = year,
			
			group_mode = none,
			
			label_singular = _(year),
			label_plural = _(years)
		},
		bib_publication_type_facet = {
			type = attribute,
			element_code = citation_format,
			type_restrictions = [bibliography],
			
			group_mode = none,

			label_singular = _(format),
			label_plural = _(format)
		},
		bib_language_facet = {
			type = attribute,
			element_code = bib_language,
			type_restrictions = [bibliography],
			
			group_mode = none,

			label_singular = _(language),
			label_plural = _(language)
		},
		bib_by_noguchi = {
			type = attribute,
			element_code = is_by_noguchi,
			type_restrictions = [bibliography],
			
			group_mode = none,
			single_value = yes,

			label_singular = _(by Noguchi),
			label_plural = _(by Noguchi)
		},
		status_facet = {
			type = fieldList,
			field = status,
			
			group_mode = none,
			type_restrictions = [bibliography, exhibition],
			
			indefinite_article = an,
			label_singular = _(research status),
			label_plural = _(research status)
		}
	}
}

# --------------------------------------------------------------------
# Configuration for storage location browse
ca_storage_locations = {
	name = _(Storage locations),
	facets = {
		type_facet = {
			type = fieldList,
			field = type_id,
			
			group_mode = alphabetical,
			
			label_singular = _(type),
			label_plural = _(types)
		},
		status_facet = {
			type = fieldList,
			field = status,
			
			group_mode = alphabetical,
			
			label_singular = _(status),
			label_plural = _(statuses)
		}
	}
}
# --------------------------------------------------------------------
