web Script for Advance search (Alfresco)

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2008 01:53 AM
hi!!!
I am working on web Script can u tell me, is there any web script for advance search. Actually i want search in form of Title and description. so please help me i am in great need of this web Script.
if possible then please send me reply on my email:- mgovind@iitk.ac.in
I am working on web Script can u tell me, is there any web script for advance search. Actually i want search in form of Title and description. so please help me i am in great need of this web Script.
if possible then please send me reply on my email:- mgovind@iitk.ac.in
Labels:
- Labels:
-
Archive
7 REPLIES 7

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2008 03:54 AM
Hi,
you'll find a sample search web script here (with result set paging): http://forge.alfresco.com/plugins/scmsvn/viewcvs.php/opsoro/trunk/source/web/webScripts/opsoro/searc...
Just replace the lucene query with your query, e.g.:
Jan
you'll find a sample search web script here (with result set paging): http://forge.alfresco.com/plugins/scmsvn/viewcvs.php/opsoro/trunk/source/web/webScripts/opsoro/searc...
Just replace the lucene query with your query, e.g.:
nodes = search.luceneSearch("@cm\\:title:\""+args['query']+"\" OR @cm\\:description:\""+args['query']+"\"");
Cheers, Jan

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2008 06:22 AM
hi
thanks for this reply, but problem is that when i try to execute the web script: /alfresco/service/opsoro/search?query={query}&start={start?}&limit={limit?}&l={language?}
it gives following errors
Message: Failed to execute script 'workspace://SpacesStore//Company Home/Data Dictionary/Web Scripts/org/alfresco/sample/opsoro/search.get.js': Failed to execute script 'workspace://SpacesStore//Company Home/Data Dictionary/Web Scripts/org/alfresco/sample/opsoro/search.get.js': unterminated string literal (AlfrescoScript#21)
Exception: org.mozilla.javascript.EvaluatorException - unterminated string literal (AlfrescoScript#21)
org.mozilla.javascript.DefaultErrorReporter.runtimeError(DefaultErrorReporter.java:109)
org.mozilla.javascript.DefaultErrorReporter.error(DefaultErrorReporter.java:96)
org.mozilla.javascript.Parser.addError(Parser.java:140)
org.mozilla.javascript.TokenStream.getToken(TokenStream.java:518)
Exception: org.alfresco.error.AlfrescoRuntimeException - unterminated string literal (AlfrescoScript#21)
org.alfresco.repo.jscript.RhinoScriptProcessor.executeScriptImpl(RhinoScriptProcessor.java:519)
Exception: org.alfresco.service.cmr.repository.ScriptException - Failed to execute script 'workspace://SpacesStore//Company Home/Data Dictionary/Web Scripts/org/alfresco/sample/opsoro/search.get.js': unterminated string literal (AlfrescoScript#21)
org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:115)
Exception: org.alfresco.service.cmr.repository.ScriptException - Failed to execute script 'workspace://SpacesStore//Company Home/Data Dictionary/Web Scripts/org/alfresco/sample/opsoro/search.get.js': Failed to execute script 'workspace://SpacesStore//Company Home/Data Dictionary/Web Scripts/org/alfresco/sample/opsoro/search.get.js': unterminated string literal (AlfrescoScript#21)
org.alfresco.repo.processor.ScriptServiceImpl.executeScript(ScriptServiceImpl.java:247)
please help me
thanks for this reply, but problem is that when i try to execute the web script: /alfresco/service/opsoro/search?query={query}&start={start?}&limit={limit?}&l={language?}
it gives following errors
Message: Failed to execute script 'workspace://SpacesStore//Company Home/Data Dictionary/Web Scripts/org/alfresco/sample/opsoro/search.get.js': Failed to execute script 'workspace://SpacesStore//Company Home/Data Dictionary/Web Scripts/org/alfresco/sample/opsoro/search.get.js': unterminated string literal (AlfrescoScript#21)
Exception: org.mozilla.javascript.EvaluatorException - unterminated string literal (AlfrescoScript#21)
org.mozilla.javascript.DefaultErrorReporter.runtimeError(DefaultErrorReporter.java:109)
org.mozilla.javascript.DefaultErrorReporter.error(DefaultErrorReporter.java:96)
org.mozilla.javascript.Parser.addError(Parser.java:140)
org.mozilla.javascript.TokenStream.getToken(TokenStream.java:518)
Exception: org.alfresco.error.AlfrescoRuntimeException - unterminated string literal (AlfrescoScript#21)
org.alfresco.repo.jscript.RhinoScriptProcessor.executeScriptImpl(RhinoScriptProcessor.java:519)
Exception: org.alfresco.service.cmr.repository.ScriptException - Failed to execute script 'workspace://SpacesStore//Company Home/Data Dictionary/Web Scripts/org/alfresco/sample/opsoro/search.get.js': unterminated string literal (AlfrescoScript#21)
org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:115)
Exception: org.alfresco.service.cmr.repository.ScriptException - Failed to execute script 'workspace://SpacesStore//Company Home/Data Dictionary/Web Scripts/org/alfresco/sample/opsoro/search.get.js': Failed to execute script 'workspace://SpacesStore//Company Home/Data Dictionary/Web Scripts/org/alfresco/sample/opsoro/search.get.js': unterminated string literal (AlfrescoScript#21)
org.alfresco.repo.processor.ScriptServiceImpl.executeScript(ScriptServiceImpl.java:247)
please help me

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2008 06:47 AM
Hi,
I missed the *:
Cheers, Jan
I missed the *:
nodes = search.luceneSearch("@cm\\:title:\""+args['query']+"*\" OR @cm\\:description:\""+args['query']+"*\"");
did you call the webScript like this (will fail):/alfresco/service/opsoro/search?query={query}&start={start?}&limit={limit?}&l={language?}
or like this (should work):/alfresco/service/opsoro/search?query=Tutorial&start=0&limit=10
I want to clarify that you have to call the webScript with valid params and not with the url placeholders! Cheers, Jan

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2008 07:37 AM
thanks again for the reply
now i am facing a new problem in this script when i execute this script it is not directly open its give the option for save.
how can i correct it…
please help me……..
now i am facing a new problem in this script when i execute this script it is not directly open its give the option for save.
how can i correct it…
please help me……..

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2008 08:03 AM
Hi,
ok, if you use the opsoro search webscript, you'll get a json-response. If you would like to have a html response you should add a new freemarker template search.get.html.ftl:
then call the webscript in this way: /alfresco/service/opsoro/search.html?query=Tutorial&start=0&limit=10 or turn the defualt response format in the desc.xml-File to html.
You should take a deeper look here: http://wiki.alfresco.com/wiki/Web_Scripts
Cheers, Jan
ok, if you use the opsoro search webscript, you'll get a json-response. If you would like to have a html response you should add a new freemarker template search.get.html.ftl:
<html> <body> <table> <p>total count: ${total}</p> <th> <td>Name</td> <td>Title</td> <td>Description</td> </th> <#list nodes as document> <tr> <td>${document.name}</td> <td>${document.properties.title}</td> <td>${document.properties.description}</td> </tr> </#list> </table> </body></html>
then call the webscript in this way: /alfresco/service/opsoro/search.html?query=Tutorial&start=0&limit=10 or turn the defualt response format in the desc.xml-File to html.
You should take a deeper look here: http://wiki.alfresco.com/wiki/Web_Scripts
Cheers, Jan
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-24-2010 03:50 PM
Hi Jan,
This is netra i really appreciate your Job that u posted here!
it works great!!!
"getting knowledge is to share!!"
regards
netra
This is netra i really appreciate your Job that u posted here!
it works great!!!
"getting knowledge is to share!!"
regards
netra

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2013 07:19 AM
Hi Jan Pfitzner
Can you please provide me the web-script that you use, as web-script has been removed from the link that you provided in your previous posts.
Thanks
Nancy
Can you please provide me the web-script that you use, as web-script has been removed from the link that you provided in your previous posts.
Thanks
Nancy
