cancel
Showing results for 
Search instead for 
Did you mean: 

SOLVED: Search customizing

shmoula
Champ in-the-making
Champ in-the-making
Hi!
  I would like to make some changes to searching process, but i don't want to make changes to core of Alfresco, I just need to do that via module.
I need to either do my own Advanced search page, or to send results of the original page to my own browse.jsp. I know that advSearch is defined via a navigation-rule in faces-navigation, but I can't edit this config. I tried to redirect this action in web-client-config-custom.xml, but this does not work. My next idea is to catch outcome from advanced-search.jsp and in this case redirect to my own browse.jsp. I'm going to try this now, but I'm afraid this will not work too. Is there any (simple) solution to do that?
Thanks in advance!
8 REPLIES 8

monitloth
Champ on-the-rise
Champ on-the-rise
I tried to edit the file with java, but it uses some protected function from another class. Because of this more work must be done.

I'm thinking to make a search tool from an empty dialog. The results should be printed with FreeMarker.

shmoula
Champ in-the-making
Champ in-the-making
the problem is not to print result via template or write my own dialog for searching, but to force navigation not to open browse.jsp after searching, but to open "my own browse.jsp", which I already have for some views and works correctly. and those navigation rules are written in faces-navigation.xml which I want not to edit, I'm looking for some another solution.

shmoula
Champ in-the-making
Champ in-the-making
okay, AdvancedSearchDialog.search returns OUTCOME_BROWSE, so i tried following override, which doesn't work:
is it posible to do that this way? does plain <config> works, or I need to always specify an evaluator and condition?

<config>
    <navigation>
        <override from-view-id="/jsp/search/advanced-search.jsp" to-view-id="/jsp/archivace/session.jsp" />
        <override from-outcome="browse" to-view-id="/jsp/archivace/session.jsp" />
    </navigation>
</config>

algoworks
Champ in-the-making
Champ in-the-making
If you have separate module then you can do the following : in WEB-INF folder create a new file like - my-faces-config-navigation.xml . After deployment make sure you have my-faces-config-navigation.xml and faces-config-navigation.xml files are in same folder i.e. WEB-INF folder.  You can define your own navigation here.



Hope this helps -

Regards,
Algoworks Alfresco Team,
http://www.algoworks.com

shmoula
Champ in-the-making
Champ in-the-making
Thanks for reply, i tried this too, but it doesn't work. I have my own config in faces-config-ext.xml, which is defined in javax.faces.CONFIG_FILES section in web.xml, I have also my beans defined in that file. So I tried to add a navigation rule, but still no working result 😞
(btw i tried to move that rule to my-faces-config-navigation.xml as you advise, but nothing happend)

  <navigation-rule>
      <from-view-id>/jsp/*</from-view-id>
      <navigation-case>
         <from-outcome>advSearch</from-outcome>
         <to-view-id>/jsp/archivace/session.jsp</to-view-id>
      </navigation-case>
   </navigation-rule>

algoworks
Champ in-the-making
Champ in-the-making
Looking into source . Actually search component is rendered by r:simpleSearch tag in title bar which renders advanced search link (html anchor tag with). it is not part of JSF cycle so i believe can't be overidden in navigation file. One thing i suggest is to remove r:simpleSearch tag and use your JSF component (text field with button ) and bind it to your Own bean.

Hope this might help.


Regards,
Algoworks Alfresco Team,
http://www.algoworks.com

shmoula
Champ in-the-making
Champ in-the-making
Yes, i know about this option, but I cant use this - title bar is included in many files from Alfresco core and I can't modify them :-(. If I could, I would like to write my own component. BUT try to open faces-config-navigation.xml and search for advSearch and there is that rule, so it must works this way I think, so it confuses me  Smiley Indifferent

shmoula
Champ in-the-making
Champ in-the-making
HEEY, I got it!!  Smiley Very Happy
there is some "priority" in CONFIG_FILE parameter in web.xml - FIFO  :lol: so I just put my own extended config file as the first config and then comes other and my previous construction works!!

<context-param>
  <param-name>javax.faces.CONFIG_FILES</param-name>
  <param-value>WEB-INF/faces-config-ext.xml, …………………………….</param-value>
</context-param>