修改Alfresco社区5.0.d中的实时搜索

编程入门 行业动态 更新时间:2024-10-09 17:23:07
本文介绍了修改Alfresco社区5.0.d中的实时搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在使用Alfresco Community 5.0.d并尝试查找与实时搜索相关的文件。

I am using Alfresco Community 5.0.d and trying to find the files related to live search.

我想在实时搜索中删除或修改人员查找器。请让我知道文件或实现该文件的方法。

I would like to remove or modify the people finder in live search. Please let me know the files or way to achieve it.

Share-header.get.js信息如下:

Share-header.get.js info is below:

if (!user.isAdmin) { widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER_MY_FILES"); widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER_SHARED_FILES"); widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER_SITES_MENU"); widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER_PEOPLE"); widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER_REPOSITORY"); widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER_BECPG"); } //Disable people search var headerSearch = widgetUtils.findObject(model.jsonModel, "id", "HEADER_SEARCH"); if (headerSearch) { headerSearch.config.showPeopleResults = false; headerSearch.config.placeholder="Search files, sites"; }

下面是extensions.xml

Below is extensions.xml

<extension> <modules> <module> <id>Update Site Header</id> <version>1.0</version>

真正的 org.alfresco。 share.header com.site-header share-header

true org.alfresco.share.header com.site-header share-header

当我在下面的行中添加内容时,现在我可以看到我的文件,共享文件和其他菜单项已为用户(非管理员)删除,但搜索框未更改。

As I added below lines, now I could see that my file, shared file and other menu items being removed for user(non admin) but no changes in search box.

信用:Muralidharan

<auto-deploy>true</auto-deploy> <evaluator type="default.extensibility.evaluator"/>

搜索框的html结构的屏幕截图。

Screenshot of html structure for search box.

下面是模块/部署的屏幕截图:

Below is screenshot of modules/deploy:

调试模式的屏幕截图:

预先感谢

推荐答案

我点击了下面的链接,它的工作就像一种魅力。

I followed below link and it worked like a charm.

community.alfresco/message / 806438-re-not-able- to-disable-suggestion-in-aluggesco?commentID = 806438& et = watches.email.thread#comment-806438

摘要:覆盖live-search-people.get.json.ftl文件以使实时搜索没有结果。

Summary: Override the live-search-people.get.json.ftl file to produce no result for live search.

步骤:

  • 提取alfresco-remote-api-5.0.d(/Applications/alfresco-5.0.d/tomcat/webapps/alfresco/WEB-INF/lib)
  • 转到/Applications/alfresco-5.0.d/tomcat/webapps/alfresco/WEB-INF/lib/alfresco-remote-api-5.0.d/alfresco/templates/webscripts/org/alfresco/slingshot/search和复制live-search-people.get.json.ftl
  • 然后转到应用程序/alfresco-5.0.d/tomcat/shared/classes/alfresco/extension/templates/webscripts/org/alfresco / slingshot / search(如果不存在,则创建新目录)并粘贴先前复制的文件
  • 在编辑器中打开该文件,如sublime text,并替换为以下代码。

  • Extract alfresco-remote-api-5.0.d (/Applications/alfresco-5.0.d/tomcat/webapps/alfresco/WEB-INF/lib)
  • Goto /Applications/alfresco-5.0.d/tomcat/webapps/alfresco/WEB-INF/lib/alfresco-remote-api-5.0.d/alfresco/templates/webscripts/org/alfresco/slingshot/search and copy live-search-people.get.json.ftl
  • Then goto Applications/alfresco-5.0.d/tomcat/shared/classes/alfresco/extension/templates/webscripts/org/alfresco/slingshot/search (create new directory if not exist) and paste the file copied earlier
  • Open that file in editor like sublime text and replace with following code.

    < #import ../../repository/person/person.lib.ftl as personLib />

    <#import "../../repository/person/person.lib.ftl" as personLib/>

    &#;将x逸出为jsonUtils.encodeJSONString(x)> { totalRecords:0, startIndex:0, items: [] }

    <#escape x as jsonUtils.encodeJSONString(x)> { "totalRecords": 0, "startIndex": 0, "items": [ ] }

    重新启动tomcat并测试实时搜索。

    Restart the tomcat and test live search.

    感谢Angel和Alex的回答,并进行了澄清。

    Thanks to Angel and Alex for answer followed with clarification.

    有趣的发现是我在使用Aikau 1.0。 8由于Muralidharan建议的更改不起作用(旧版本),所以现在我移至较新版本的Aikau(1.0.101)时,这些更改就可以了。

    Interesting finding that I was using Aikau 1.0.8 Because of that the changes recommended by Muralidharan was not working (older version) so now as I move to newer version of Aikau (1.0.101) then those changes are good to go.

    谢谢Muralidharan!

    Thank you Muralidharan!

    / ****注意**** /

    /****NOTE****/

    如果您使用的Aikau较旧版本(如1.0.8)比您必须覆盖扩展名或如果您使用的Aikau较新版本(如1.0.101)则可以直接进行更改。

    If your using older version of Aikau (like 1.0.8) than you have to override the extension Or If your using newer version of Aikau (like 1.0.101) than you can directly make changes.

  • 更多推荐

    修改Alfresco社区5.0.d中的实时搜索

    本文发布于:2023-11-28 11:29:18,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1642216.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:实时   社区   Alfresco

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!