Customizing advanced search in Alfresco 5.2

cancel
Showing results for 
Search instead for 
Did you mean: 
os_cerna
Active Member

Customizing advanced search in Alfresco 5.2

Hello,

i´m currently migrating a share and repo project from version 4.2.0 to 5.2 and i´m facing some issues.

One of those is that i´ve extended org/alfresco/slingshot/search/search.get.js (i needed to customize advanced search, since i wanted to search documents with the effectivity aspect within a date range which  was between cm:from and cm:to)

What i did was that i created a new search.get.js with the custom query i wanted and placed it on my alfresco installation in this directory (because it couldnt be extended via amp): 

tomcat\shared\classes\alfresco\extension\templates\webscripts\org\alfresco\slingshot\search 

i also created a .xml file which called this file and placed it on :tomcat\shared\classes\alfresco\extension

this solved the issue then.

But now, doing that doesnt work on v5.2 investigating a bit i found that  the search.get.js file is on the share-services.amp, which it didnt exist back in version 4.2, and my question is, how do i do it now? 

Thanks a lot in advance

7 Replies
afaust
Master

Re: Customizing advanced search in Alfresco 5.2

The approach to overriding web scripts via the shared/classes/alfresco/extension/templates/webscripts path has not changed in 5.2 and is still viable. The fact that share-services is a separate project / AMP also should not have any impact on this, since only a small portion of Share-specific web scripts / APIs have actually been extracted to that project (in an ideal world, everything about sites would be in that project, but those are too entwined in the core to extract).

I currently see no reason your approach should not work in 5.2 from what you have provided. Either some of the information is not correct or some other addon that you have installed may already be overriding that web script (only one can do that and the shared/classes is basically one of the last places to be checked).

os_cerna
Active Member

Re: Customizing advanced search in Alfresco 5.2

Thanks for the quick reply,

I have checked the webscript path and i realized i wrote a folder incorrectly, having corrected my mistake i restarted my alfresco server and the advanced search does not search anything (even when i do not search for effectivity) when i inspect the page i found this error

"04250009 Wrapped Exception (with status template): 04250040 Failed to execute script 'classpath*:alfresco/extension/templates/webscripts/org/alfresco/slingshot/search/search.get.js': 04250039 Invalid node ref - does not contain forward slash: true"

At least i know that it has found the script but i do not know why its giving me this error.

Could you please help me again? thanks

EDIT: i´ve attached my custom search file

douglascrp
Advanced II

Re: Customizing advanced search in Alfresco 5.2

Hello.

I can not see the file you said you have attached.

os_cerna
Active Member

Re: Customizing advanced search in Alfresco 5.2

Really?, i´ve attached it again as a downloadable file, thanks

douglascrp
Advanced II

Re: Customizing advanced search in Alfresco 5.2

Nothing again.

kgastaldo
Senior Member

Re: Customizing advanced search in Alfresco 5.2

Hey Douglas - Do you not even see the attachment option? Or there's nothing when you download? See below:

douglascrp
Advanced II

Re: Customizing advanced search in Alfresco 5.2

Weird, I do not see the link at all.

Usually I can see them without any problem.