08-18-2016 12:20 PM
// Build the searchDocLib model
// Docu: https://dev.alfresco.com/resource/docs/aikau-jsdoc/AlfSearchList_.html
var searchDocLib = {
id: "FCTSRCH_SEARCH_RESULTS_LIST",
name: "alfresco/search/AlfSearchList",
config: {
viewPreferenceProperty: "org.alfresco.share.searchList.viewRendererName",
view: viewRendererName,
waitForPageWidgets: true,
useHash: true,
useLocalStorageHashFallback: true,
hashVarsForUpdate: [
"searchTerm",
"facetFilters",
"sortField",
"sortAscending",
"query",
"scope"
],
selectedScope: "repo",
useInfiniteScroll: true,
siteId: null,
rootNode: repoRootNode,
repo: true,
additionalControlsTarget: "FCTSRCH_RESULTS_MENU_BAR",
additionalViewControlVisibilityConfig: hideOnZeroResultsConfig,
widgets: [
09-15-2016 05:07 AM
You have a number of options here... I think that your best bet is to actually create a custom service that extends the alfresco/services/SearchService. You should override the "onSearchRequest" function and update the "payload" argument that is provided in order to add additional search queries to either the "term" or add new attributes to be processed as query attributes.
For example:
define(["dojo/_base/declare",
"alfresco/services/SearchService"],
function(declare,SearchService) {
return declare([SearchService], {
onSearchRequest: function(payload) {
payload.term = payload.term + "" // <- Add more search terms
payload.datatype = "cm:content"; // Added as a query parameter
this.inherited(arguments); // This calls the superclass function
}
});
});
You can then use your custom service in place of the regular SearchService (remember to remove the original SearchService from the list of services!)
When the AlfSearchList publishes a request to search, your custom service will process the request - updating the published payload with additional data and then call the original service function to process the request as usual.
This blog post shows how to add a new package (that you'll want for your custom search service module) via an extension module.
09-15-2016 05:07 AM
You have a number of options here... I think that your best bet is to actually create a custom service that extends the alfresco/services/SearchService. You should override the "onSearchRequest" function and update the "payload" argument that is provided in order to add additional search queries to either the "term" or add new attributes to be processed as query attributes.
For example:
define(["dojo/_base/declare",
"alfresco/services/SearchService"],
function(declare,SearchService) {
return declare([SearchService], {
onSearchRequest: function(payload) {
payload.term = payload.term + "" // <- Add more search terms
payload.datatype = "cm:content"; // Added as a query parameter
this.inherited(arguments); // This calls the superclass function
}
});
});
You can then use your custom service in place of the regular SearchService (remember to remove the original SearchService from the list of services!)
When the AlfSearchList publishes a request to search, your custom service will process the request - updating the published payload with additional data and then call the original service function to process the request as usual.
This blog post shows how to add a new package (that you'll want for your custom search service module) via an extension module.
09-16-2016 05:09 AM
I've written up a solution in this blog post. It contains a link to a sample solution, although some further tweaking maybe required.
12-13-2016 05:42 AM
After writing up the blog post I subsequently fixed the issue. See AlfSearchList should be configurable to publish additional query parameters · Issue #1240 · Alfresco... / [AKU-1111] AlfSearchList should be configurable to publish additional query parameters - Alfresco JI...
So from Aikau 1.0.96 it is possible to configure the "additionalQueryParameters" attribute on the AlfSearchList widget to achieve this requirement.
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.