mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-12 17:04:46 +00:00
parent
ab68f4f07e
commit
6670f9c75d
@ -704,198 +704,9 @@ Having ids allows external plugins to extend the current setting.
|
||||
## Search
|
||||
|
||||
The search configurations are needed by the [Search Filter Component](https://www.alfresco.com/abn/adf/docs/content-services/components/search-filter.component/) to render the filters.
|
||||
This is can be configured either in `app.config.json` or `app.extensions.json`.
|
||||
|
||||
Configuring search from `app.extensions.json` will overwrite/update the application search.
|
||||
|
||||
Settings them from custom plugins allows user to disable, update or extend.
|
||||
|
||||
```json
|
||||
{
|
||||
"search": {
|
||||
"id": "app.search-extension",
|
||||
"order": 100,
|
||||
"name": "APP.BROWSE.SEARCH.DEFAULT_SEARCH",
|
||||
"default": true,
|
||||
"filterWithContains": true,
|
||||
"aca:fields": ["cm:name", "cm:title", "cm:description", "TEXT", "TAG"],
|
||||
"include": ["path", "allowableOperations", "properties"],
|
||||
"sorting": {
|
||||
"options": [
|
||||
{
|
||||
"key": "score",
|
||||
"label": "SEARCH.SORT.RELEVANCE",
|
||||
"type": "SCORE",
|
||||
"field": "score",
|
||||
"ascending": false
|
||||
},
|
||||
{
|
||||
"key": "name",
|
||||
"label": "SEARCH.SORT.FILENAME",
|
||||
"type": "FIELD",
|
||||
"field": "cm:name",
|
||||
"ascending": true
|
||||
},
|
||||
{
|
||||
"key": "title",
|
||||
"label": "SEARCH.SORT.TITLE",
|
||||
"type": "FIELD",
|
||||
"field": "cm:title",
|
||||
"ascending": true
|
||||
},
|
||||
{
|
||||
"key": "modified",
|
||||
"label": "SEARCH.SORT.MODIFIED_DATE",
|
||||
"type": "FIELD",
|
||||
"field": "cm:modified",
|
||||
"ascending": true
|
||||
},
|
||||
{
|
||||
"key": "modifier",
|
||||
"label": "SEARCH.SORT.MODIFIER",
|
||||
"type": "FIELD",
|
||||
"field": "cm:modifier",
|
||||
"ascending": true
|
||||
},
|
||||
{
|
||||
"key": "created",
|
||||
"label": "SEARCH.SORT.CREATE_DATE",
|
||||
"type": "FIELD",
|
||||
"field": "cm:created",
|
||||
"ascending": true
|
||||
},
|
||||
{
|
||||
"key": "content.sizeInBytes",
|
||||
"label": "SEARCH.SORT.SIZE",
|
||||
"type": "FIELD",
|
||||
"field": "content.size",
|
||||
"ascending": true
|
||||
},
|
||||
{
|
||||
"key": "content.mimetype",
|
||||
"label": "SEARCH.SORT.TYPE",
|
||||
"type": "FIELD",
|
||||
"field": "content.mimetype",
|
||||
"ascending": true
|
||||
}
|
||||
],
|
||||
"defaults": [
|
||||
{
|
||||
"key": "score",
|
||||
"type": "SCORE",
|
||||
"field": "score",
|
||||
"ascending": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"aca:triggeredOnChange": false,
|
||||
"resetButton": true,
|
||||
"filterQueries": [
|
||||
{ "query": "+TYPE:'cm:folder' OR +TYPE:'cm:content'" },
|
||||
{
|
||||
"query": "-TYPE:'cm:thumbnail' AND -TYPE:'cm:failedThumbnail' AND -TYPE:'cm:rating'"
|
||||
},
|
||||
{ "query": "-cm:creator:System AND -QNAME:comment" },
|
||||
{
|
||||
"query": "-TYPE:'st:site' AND -ASPECT:'st:siteContainer' AND -ASPECT:'sys:hidden'"
|
||||
},
|
||||
{
|
||||
"query": "-TYPE:'dl:dataList' AND -TYPE:'dl:todoList' AND -TYPE:'dl:issue'"
|
||||
},
|
||||
{ "query": "-TYPE:'fm:topic' AND -TYPE:'fm:post'" },
|
||||
{ "query": "-TYPE:'lnk:link'" },
|
||||
{ "query": "-PNAME:'0/wiki'" }
|
||||
],
|
||||
"facetFields": {
|
||||
"expanded": true,
|
||||
"fields": [
|
||||
{
|
||||
"mincount": 1,
|
||||
"field": "content.mimetype",
|
||||
"label": "SEARCH.FACET_FIELDS.FILE_TYPE",
|
||||
"settings": {
|
||||
"allowUpdateOnChange": false,
|
||||
"hideDefaultAction": true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"facetQueries": {
|
||||
"label": "SEARCH.CATEGORIES.MODIFIED_DATE",
|
||||
"expanded": true,
|
||||
"queries": [
|
||||
{
|
||||
"label": "SEARCH.FACET_QUERIES.TODAY",
|
||||
"query": "cm:modified:[TODAY to TODAY]"
|
||||
},
|
||||
{
|
||||
"label": "SEARCH.FACET_QUERIES.THIS_WEEK",
|
||||
"query": "cm:modified:[NOW/DAY-7DAYS TO NOW/DAY+1DAY]"
|
||||
},
|
||||
{
|
||||
"label": "SEARCH.FACET_QUERIES.THIS_MONTH",
|
||||
"query": "cm:modified:[NOW/DAY-1MONTH TO NOW/DAY+1DAY]"
|
||||
},
|
||||
{
|
||||
"label": "SEARCH.FACET_QUERIES.LAST_6_MONTHS",
|
||||
"query": "cm:modified:[NOW/DAY-6MONTHS TO NOW/DAY+1DAY]"
|
||||
},
|
||||
{
|
||||
"label": "SEARCH.FACET_QUERIES.THIS_YEAR",
|
||||
"query": "cm:modified:[NOW/DAY-1YEAR TO NOW/DAY+1DAY]"
|
||||
}
|
||||
],
|
||||
"settings": {
|
||||
"allowUpdateOnChange": false,
|
||||
"hideDefaultAction": true
|
||||
}
|
||||
},
|
||||
"categories": [
|
||||
{
|
||||
"id": "size",
|
||||
"name": "SEARCH.CATEGORIES.SIZE",
|
||||
"enabled": true,
|
||||
"component": {
|
||||
"selector": "check-list",
|
||||
"settings": {
|
||||
"allowUpdateOnChange": false,
|
||||
"hideDefaultAction": true,
|
||||
"options": [
|
||||
{
|
||||
"name": "SEARCH.CATEGORIES.SIZE_OPTIONS.SMALL",
|
||||
"value": "content.size:[0 TO 1048576>"
|
||||
},
|
||||
{
|
||||
"name": "SEARCH.CATEGORIES.SIZE_OPTIONS.MEDIUM",
|
||||
"value": "content.size:[1048576 TO 52428800]"
|
||||
},
|
||||
{
|
||||
"name": "SEARCH.CATEGORIES.SIZE_OPTIONS.LARGE",
|
||||
"value": "content.size:<52428800 TO 524288000]"
|
||||
},
|
||||
{
|
||||
"name": "SEARCH.CATEGORIES.SIZE_OPTIONS.HUGE",
|
||||
"value": "content.size:<524288000 TO MAX]"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "createdDateRange",
|
||||
"name": "SEARCH.CATEGORIES.CREATED_DATE",
|
||||
"enabled": true,
|
||||
"component": {
|
||||
"selector": "date-range",
|
||||
"settings": {
|
||||
"allowUpdateOnChange": false,
|
||||
"hideDefaultAction": true,
|
||||
"field": "cm:created",
|
||||
"dateFormat": "DD-MMM-YY",
|
||||
"maxDate": "today"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
Here is the example [extension configuration](https://github.com/Alfresco/alfresco-content-app/blob/develop/src/assets/plugins/app.search.json)
|
||||
|
@ -25,6 +25,7 @@ You can create plugins that change, toggle, or extend the following areas:
|
||||
- buttons
|
||||
- "More actions" buttons
|
||||
- Content metadata presets (used on `Properties` tab)
|
||||
- Search
|
||||
- Custom icons
|
||||
|
||||
Extensions can also:
|
||||
|
@ -665,6 +665,37 @@
|
||||
}
|
||||
},
|
||||
"required": ["name", "key", "type"]
|
||||
},
|
||||
"searchRef": {
|
||||
"type": "object",
|
||||
"allOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "Unique identifier.",
|
||||
"type": "string"
|
||||
},
|
||||
"order": {
|
||||
"description": "Element order",
|
||||
"type": "number"
|
||||
},
|
||||
"rules": {
|
||||
"description": "Element rules",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"disabled": {
|
||||
"description": "Rule to evaluate the visibility state",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"$ref": "node_modules/@alfresco/adf-core/app.config.schema.json#/definitions/search-configuration"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
@ -914,6 +945,13 @@
|
||||
"minItems": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"search": {
|
||||
"description": "aca search extension",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/searchRef"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -295,10 +295,7 @@ export class AppExtensionService implements RuleContext {
|
||||
return null;
|
||||
}
|
||||
|
||||
let search = [];
|
||||
search = mergeArrays(search, elements)
|
||||
.filter((entry) => !entry.disabled)
|
||||
.sort(sortByOrder);
|
||||
const search = mergeArrays([], elements).filter((entry) => !entry.disabled);
|
||||
|
||||
try {
|
||||
this.appConfig.config['search'] = search;
|
||||
|
@ -1182,6 +1182,8 @@
|
||||
{
|
||||
"id": "app.search.default",
|
||||
"order": 100,
|
||||
"name": "APP.BROWSE.SEARCH.DEFAULT_SEARCH",
|
||||
"default": true,
|
||||
"filterWithContains": true,
|
||||
"aca:fields": ["cm:name", "cm:title", "cm:description", "TEXT", "TAG"],
|
||||
"include": ["path", "allowableOperations", "properties"],
|
||||
@ -1388,9 +1390,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"name": "APP.BROWSE.SEARCH.DEFAULT_SEARCH",
|
||||
"default": true
|
||||
]
|
||||
}
|
||||
],
|
||||
"content-metadata-presets": [
|
||||
|
157
src/assets/plugins/app.search.json
Normal file
157
src/assets/plugins/app.search.json
Normal file
@ -0,0 +1,157 @@
|
||||
{
|
||||
"$schema": "../../../extension.schema.json",
|
||||
"$id": "app.debug-search.plugin",
|
||||
"$version": "1.0.0",
|
||||
"$name": "app.debug-search.plugin",
|
||||
"$vendor": "Alfresco Software, Ltd.",
|
||||
"$license": "LGPL-3.0",
|
||||
"$runtime": "1.5.0",
|
||||
"$description": "Plugin for debugging and testing purposes",
|
||||
|
||||
"features": {
|
||||
"search": [
|
||||
{
|
||||
"id": "app.search.example",
|
||||
"order": 200,
|
||||
"name": "Extension search (folder)",
|
||||
"default": true,
|
||||
"filterWithContains": true,
|
||||
"aca:fields": ["cm:name", "cm:title", "cm:description", "TEXT", "TAG"],
|
||||
"include": ["path", "allowableOperations", "properties"],
|
||||
"sorting": {
|
||||
"options": [
|
||||
{
|
||||
"key": "score",
|
||||
"label": "SEARCH.SORT.RELEVANCE",
|
||||
"type": "SCORE",
|
||||
"field": "score",
|
||||
"ascending": false
|
||||
},
|
||||
{
|
||||
"key": "name",
|
||||
"label": "SEARCH.SORT.FILENAME",
|
||||
"type": "FIELD",
|
||||
"field": "cm:name",
|
||||
"ascending": true
|
||||
},
|
||||
{
|
||||
"key": "title",
|
||||
"label": "SEARCH.SORT.TITLE",
|
||||
"type": "FIELD",
|
||||
"field": "cm:title",
|
||||
"ascending": true
|
||||
},
|
||||
{
|
||||
"key": "modified",
|
||||
"label": "SEARCH.SORT.MODIFIED_DATE",
|
||||
"type": "FIELD",
|
||||
"field": "cm:modified",
|
||||
"ascending": true
|
||||
},
|
||||
{
|
||||
"key": "modifier",
|
||||
"label": "SEARCH.SORT.MODIFIER",
|
||||
"type": "FIELD",
|
||||
"field": "cm:modifier",
|
||||
"ascending": true
|
||||
},
|
||||
{
|
||||
"key": "created",
|
||||
"label": "SEARCH.SORT.CREATE_DATE",
|
||||
"type": "FIELD",
|
||||
"field": "cm:created",
|
||||
"ascending": true
|
||||
},
|
||||
{
|
||||
"key": "content.sizeInBytes",
|
||||
"label": "SEARCH.SORT.SIZE",
|
||||
"type": "FIELD",
|
||||
"field": "content.size",
|
||||
"ascending": true
|
||||
},
|
||||
{
|
||||
"key": "content.mimetype",
|
||||
"label": "SEARCH.SORT.TYPE",
|
||||
"type": "FIELD",
|
||||
"field": "content.mimetype",
|
||||
"ascending": true
|
||||
}
|
||||
],
|
||||
"defaults": [
|
||||
{
|
||||
"key": "score",
|
||||
"type": "SCORE",
|
||||
"field": "score",
|
||||
"ascending": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"aca:triggeredOnChange": false,
|
||||
"resetButton": true,
|
||||
"filterQueries": [
|
||||
{ "query": "+TYPE:'cm:folder'" },
|
||||
{
|
||||
"query": "-TYPE:'cm:thumbnail' AND -TYPE:'cm:failedThumbnail' AND -TYPE:'cm:rating'"
|
||||
},
|
||||
{ "query": "-cm:creator:System AND -QNAME:comment" },
|
||||
{
|
||||
"query": "-TYPE:'st:site' AND -ASPECT:'st:siteContainer' AND -ASPECT:'sys:hidden'"
|
||||
},
|
||||
{
|
||||
"query": "-TYPE:'dl:dataList' AND -TYPE:'dl:todoList' AND -TYPE:'dl:issue'"
|
||||
},
|
||||
{ "query": "-TYPE:'fm:topic' AND -TYPE:'fm:post'" },
|
||||
{ "query": "-TYPE:'lnk:link'" },
|
||||
{ "query": "-PNAME:'0/wiki'" }
|
||||
],
|
||||
"facetQueries": {
|
||||
"label": "SEARCH.CATEGORIES.MODIFIED_DATE",
|
||||
"expanded": true,
|
||||
"queries": [
|
||||
{
|
||||
"label": "SEARCH.FACET_QUERIES.TODAY",
|
||||
"query": "cm:modified:[TODAY to TODAY]"
|
||||
},
|
||||
{
|
||||
"label": "SEARCH.FACET_QUERIES.THIS_WEEK",
|
||||
"query": "cm:modified:[NOW/DAY-7DAYS TO NOW/DAY+1DAY]"
|
||||
},
|
||||
{
|
||||
"label": "SEARCH.FACET_QUERIES.THIS_MONTH",
|
||||
"query": "cm:modified:[NOW/DAY-1MONTH TO NOW/DAY+1DAY]"
|
||||
},
|
||||
{
|
||||
"label": "SEARCH.FACET_QUERIES.LAST_6_MONTHS",
|
||||
"query": "cm:modified:[NOW/DAY-6MONTHS TO NOW/DAY+1DAY]"
|
||||
},
|
||||
{
|
||||
"label": "SEARCH.FACET_QUERIES.THIS_YEAR",
|
||||
"query": "cm:modified:[NOW/DAY-1YEAR TO NOW/DAY+1DAY]"
|
||||
}
|
||||
],
|
||||
"settings": {
|
||||
"allowUpdateOnChange": false,
|
||||
"hideDefaultAction": true
|
||||
}
|
||||
},
|
||||
"categories": [
|
||||
{
|
||||
"id": "createdDateRange",
|
||||
"name": "SEARCH.CATEGORIES.CREATED_DATE",
|
||||
"enabled": true,
|
||||
"component": {
|
||||
"selector": "date-range",
|
||||
"settings": {
|
||||
"allowUpdateOnChange": false,
|
||||
"hideDefaultAction": true,
|
||||
"field": "cm:created",
|
||||
"dateFormat": "DD-MMM-YY",
|
||||
"maxDate": "today"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user