问题描述
我正在为共享层开发 AMP 文件,我想覆盖搜索顺序.目前,排序由fullName
执行.就我而言,我需要按 lastName
排序.
I'm developing AMP file for the Share tier and I want to override the search order. Currently, the sorting performed by fullName
. In my case I need sorting by lastName
.
在 people-finder.js
中,我发现了这一行:
In people-finder.js
I found this line:
...
/**
* Build URI parameter string for People Finder JSON data webscript
*
* @method _buildSearchParams
* @param searchTerm {string} Search terms to query
*/
_buildSearchParams: function PeopleFinder__buildSearchParams(searchTerm)
{
return "sortBy=fullName&dir=asc&filter=" + encodeURIComponent(searchTerm) + "&maxResults=" + this.options.maxSearchResults;
}
...
我认为,我应该将 sortBy
参数从 fullName
覆盖到 lastName
.我在本地做了一些实验,发现这些值的变化会对排序产生影响.
I think, that I should override sortBy
parameter from fullName
to lastName
. I have done some experiments locally and saw that changes in those values make affect to the sorting.
我该怎么做?
正如 Sanjay Patel 所指出的,我创建了以下路径并将相关的 JavaScript 文件放在那里:
As Sanjay Patel noted, I created the following path and place relevant JavaScript files there:
sharesrcmainamp
escomponentspeople-finder
我也试过这种方式 - sharesrcmainampwebcomponentspeople-finder
I tried this way too - sharesrcmainampwebcomponentspeople-finder
但现在在嵌入式本地 Tomcat 上一切正常,我可以看到 JavaScript 文件被覆盖:
But now on the embedded local Tomcat all works fine and I can see that JavaScript file was overridden:
但在生产服务器上我得到以下信息:
But on the production server I get the following:
我试图做的事情:
- 从
webapps
中删除alfresco
和share
目录; - 清除浏览器缓存;
- 从 Share 中卸载 AMP 并重新安装.检查它是否存在于 Share 中;
- 使用 Solr 执行完整的重新索引
- delete
alfresco
andshare
directories fromwebapps
; - clear the browser's cache;
- uninstall AMP from Share and install again. Check, that it present in Share;
- perform a full reindex with Solr
没有任何帮助.. 所有这些都无助于覆盖 people-finder.js
Nothing helps.. All of that not helped to override the people-finder.js
可能是什么原因?
推荐答案
在 eclips 中创建与 people-finder.js 文件相同的路径,例如 sharesrcmainampwebcomponentspeople-finder 并放置你修改的文件.
Create same path as people-finder.js file in eclips like sharesrcmainampwebcomponentspeople-finder and place your modified file.
这篇关于有没有办法控制用户搜索界面中的排序顺序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!