2017-01-16 133 views
0

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

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

enter image description here

股份header.get.js信息低于:

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

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

真正 org.alfresco.share。 header com.site-header 份额头

正如我在下面的线条,现在我可以看到,对于用户(非管理员),但在搜索框中没有改变被打消了我的文件,共享文件和其他菜单项。

信用:Muralidharan

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

HTML结构的截图搜索框。 screenshot of html structure

下面是模块的截图/部署:调试模式

modules/deploy

截图:

enter image description here

在此先感谢

回答

0

我跟着下面的链接,它的工作就像一个魅力。

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

摘要: 覆盖的实时搜索people.get.json.ftl文件,以生产用于实时搜索没有结果。

步骤:

  1. 提取露天-远程API-5.0.d(/Applications/alfresco-5.0.d/tomcat/webapps/alfresco/WEB-INF/lib)
  2. 转到/应用/alfresco-5.0.d/tomcat/webapps/alfresco/WEB-INF/lib/alfresco-remote-api-5.0.d/alfresco/templates/webscripts/org/alfresco/slingshot/search和复制实时搜索人员。 get.json.ftl
  3. 然后转到Applications/alfresco-5.0.d/tomcat/shared/classes/alfresco/extension/templates/webscripts/org/alfresco/slingshot/search(如果不存在则新建目录)文件早先被复制
  4. 在编辑器中打开该文件,如崇高文本,并用以下代码替换。

    <#进口 “../../repository/person/person.lib.ftl” 作为personLib />

    < #escape x作为jsonUtils.encodeJSONString(X)> { “总记录” :0, “的startIndex”:0, “项目”: [ ] }

  5. 重新启动Tomcat和测试实时搜索。

感谢天使和亚历克斯的回答后,澄清。

有趣的发现,我正在使用Aikau 1.0.8因此,由Muralidharan推荐的更改不工作(旧版本),所以现在当我移动到较新版本的Aikau(1.0.101),那些更改是好的走。

谢谢Muralidharan!

/****如果您使用Aikau(如1.0.8)比你如果使用Aikau的新版本覆盖扩展 或者 (旧版本的注意****/

像1.0.101)比你可以直接进行更改。

1

我们排除了人们搜索使用以下脚本。

//Disable people search 
var headerSearch = widgetUtils.findObject(model.jsonModel, "id", "HEADER_SEARCH"); 
if (headerSearch) 
{ 
    headerSearch.config.showPeopleResults = false;  
    headerSearch.config.placeholder="Search files, sites";  
} 

然后我们把这个文件放在下面的路径中。 C:\ Alfresco5 \ tomcat \ webapps \ share \ WEB-INF \ classes \ alfresco \ web-extension \ site-webscripts \ com \ quanticate \ header \ share-header.get.js

使用模块扩展名适用于您的自定义的共享和存储文件到露天\ WEB-扩展\站点数据\分机\ extensions.xml

<extension> 
    <modules> 
    <module> 
     <id>Menu customisation</id> 
     <auto-deploy>true</auto-deploy> 
     <evaluator type="default.extensibility.evaluator"/> 
     <!-- default.extensibility.evaluator is applied to determine if the module should be executed --> 
     <customizations>   
     <customization> 
      <targetPackageRoot>org.alfresco</targetPackageRoot> 
      <sourcePackageRoot>com.quanticate.header</sourcePackageRoot> <!-- Your package path should go here --> 
      <alwaysApply> 
       <webscript>share-header</webscript> 
      </alwaysApply> 
     </customization> 
     </customizations> 
    </module> 
    </modules> 
</extension> 
+0

我已经添加了脚本并重新启动了tomcat,但没有任何变化反映出来。此外,我用我的share-header.get.js文件信息更新了我的帖子。任何想法? – nikhil84

+0

你放置share-header.get.js文件的地方? –

+0

我添加了模块扩展的详细信息,现在应该适用于您。 –

0

你必须重载含webscript响应文件。搜索具有渲染输出并覆盖它的Freemarker模板文件。

+0

找到正确的文件本身就很困难,我是Alfresco的新手..如果你能分辨哪些文件需要更改? – nikhil84

+0

在Aikau实施Alfresco的实时搜索。相关的web脚本打包在share.war中。您必须创建自己的扩展来根据需要覆盖所需的文件。 – user6784900

+0

在Debug Menu下拉菜单中点击“Toggle Developer View”。这使您可以查看Aikau窗口小部件信息。您正在寻找的Widget类型是alfresco/header/SearchBox。 – user6784900