cancel
Showing results for 
Search instead for 
Did you mean: 

Can't find searc

gotfredsen
Champ in-the-making
Champ in-the-making
I want to do a Lucene search from a Share Dashlet. The .get.js file has this code:
var nodes = search.luceneSearch("TEXT:dot");
model.resultset = nodes;
which is hardcoded to find "dot" - just to get going Smiley Tongue

When I include my dashlet in my Share dashboard I get this error:
An error has occured in the Share component: /share/service/components/dashlets/sgnaexlo.
It responded with a status of 500 - Internal Error.
Error Code Information: 500 - An error inside the HTTP server which prevented it from fulfilling the request.
Error Message: 08300029 Failed to load script '/org/alfresco/components/custom-dashlets/sgnaexlo.get.js (in classpath store file:/opt/Alfresco/tomcat/webapps/share/WEB-INF/classes/alfresco/site-webscripts)': 08300028 ReferenceError: "search" is not defined. (file:/opt/Alfresco/tomcat/webapps/share/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/components/custom-dashlets/sgnaexlo.get.js#1)
Server: Alfresco Community v3.2.0 (2039) schema 2,019
Time: Sep 30, 2009 4:53:26 PM
Click here to view full technical information on the error.
It can't find "search"

I must be overlooking something, but I can't figure out what. Anybody that can point me in the right direction?
1 REPLY 1

gronfelt
Champ in-the-making
Champ in-the-making
"Search" is not a root-scoped object in Share, it's not defined in the Surf API:

http://wiki.alfresco.com/wiki/Surf_Platform_-_Freemarker_Template_and_JavaScript_API#Root-scoped_Obj...

You would have to create and register a webscript in Alfresco and then access that from your Share dashlet.