0

My question was started here: Is there a way to control the sorting order in the user's search interface?

I have found that I can to control the sort order by using people-finder.js

This script included in the FreeMarker template people-finder.get.html.ftl:

<@standalone>
   <@markup id="css" >
      <#-- CSS Dependencies -->
      <@link href="${url.context}/res/components/people-finder/people-finder.css" group="people-finder"/>
   </@>

   <@markup id="js">
      <#-- JavaScript Dependencies -->
      <@script src="${url.context}/res/components/people-finder/people-finder.js" group="people-finder"/>
   </@>

    <@markup id="new-js" action="replace" target="js">
      <#– JavaScript Dependencies –&gt;
      <@script src="${url.context}/res/components/people-finder/people-finder-ext.js" group="people-finder"/>
    </@>

   <@markup id="widgets">
      <@createWidgets group="people-finder"/>
   </@>

   <@markup id="html">
      <@uniqueIdDiv>
         <#assign el=args.htmlid?html>
         <div id="${el}-body" class="people-finder list theme-color-1">
            <div class="title theme-color-2"><label for="${el}-search-text">${msg("title")}</label></div>
            <div class="finder-wrapper">
               <@markup id="searchBar">
               <div class="search-bar theme-bg-color-3">
                  <div class="search-text"><input type="text" id="${el}-search-text" name="-" value="" maxlength="256" tabindex="0" placeholder="${msg('help.title')}"/></div>
                  <div class="search-button alf-colored-button">
                     <span id="${el}-search-button" class="yui-button yui-push-button"><span class="first-child"><button>${msg("button.search")}</button></span></span>
                  </div>
               </div>
               </@markup>

                <@markup id="searchHelp">
               <div id="${el}-help" class="yui-g theme-bg-color-2 help hidden">
                  <span>${msg("help.content")}</span>
               </div>
               </@markup>               

               <@markup id="searchResults">
               <div class="alf-results-wrapper">
                  <div id="${el}-results-info" class="yui-dt-liner theme-bg-color-2 result-info hidden"></div>
                  <div id="${el}-results" class="results hidden"></div>
               </div>
               </@markup>
            </div>
         </div>
      </@>
   </@>
</@>

To determine the required functionality I need to override this script and I "developed" my own - let's say, people-finder-ext.js

As I understand it, with this code I can achieve this:

<@markup id="new-js" action="replace" target="js">
  <#– JavaScript Dependencies –&gt;
  <@script src="${url.context}/res/components/people-finder/people-finder-ext.js" group="people-finder"/>
</@>

In my AMP- extension I placed people-finder-ext.js here:

/some-customization-share/src/main/amp/web/components/people-finder/people-finder-ext.js

And modified FreeMarker template people-finder.get.html.ftl I placed here:

/some-customization-share/src/main/amp/config/alfresco/web-extension/site-webscripts/org/alfresco/components/people-finder/people-finder.get.html.ftl

Then I run my project on the embedded Tomcat:

mvn integration-test -Pamp-to-war

So, I see that the sorting is not works the way I need.

I watched the network traffic between Share tier and the Alfresco/Repo tier and noticed, that my script people-finder-ext.js is not loaded.

After build I noticed, that my script is not present in \target\amp-war\ but only in \target\amp\.

What could be the reason?

4

1 回答 1

0

使用带有 maven sdk 的 Eclips 来定制 alfresco,这将非常适合开发和创建放大器。

使用 maven设置 Alfresco sdk:使用 maven 设置 Alfresco sdk

于 2017-02-03T10:05:23.363 回答