03-09-2011 05:39 AM
05-09-2011 03:53 AM
var connector = remote.connect("alfresco");
var data = connector.call("/url/to/webscript");
But it seems that no data is returned. If I access the Alfresco webscript directly using a browser I get the JSON response.05-09-2011 10:07 AM
05-10-2011 03:23 AM
05-10-2011 04:29 AM
05-10-2011 04:54 AM
var nodes = search.luceneSearch("TEXT:alfresco");
var results = search.query({query: "TEXT:alfresco"});
ERROR: org.springframework.extensions.webscripts.AbstractRuntime - Exception from executeScript - redirecting to status template error: 04100005 Failed to load script 'org.springframework.extensions.webscripts.ResourceStore$WebApplicationStoreScriptContent@ad643f': 04100004 ReferenceError: "search" is not defined. (/WEB-INF/webscripts/semicalpicat/csearch.get.js#3)
org.springframework.extensions.webscripts.WebScriptException: 04100005 Failed to load script 'org.springframework.extensions.webscripts.ResourceStore$WebApplicationStoreScriptContent@ad643f': 04100004 ReferenceError: "search" is not defined. (/WEB-INF/webscripts/semicalpicat/csearch.get.js#3)
at org.springframework.extensions.webscripts.processor.JSScriptProcessor.executeScript(JSScriptProcessor.java:195)
at org.springframework.extensions.webscripts.AbstractWebScript.executeScript(AbstractWebScript.java:982)
at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:86)
at org.springframework.extensions.webscripts.PresentationContainer.executeScript(PresentationContainer.java:69)
at org.springframework.extensions.webscripts.LocalWebScriptRuntimeContainer.executeScript(LocalWebScriptRuntimeContainer.java:203)
at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:333)
at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:189)
at org.springframework.extensions.webscripts.WebScriptProcessor.executeBody(WebScriptProcessor.java:296)
at org.springframework.extensions.surf.render.AbstractProcessor.execute(AbstractProcessor.java:79)
at org.springframework.extensions.surf.render.RenderService.processComponent(RenderService.java:467)
at org.springframework.extensions.surf.render.RenderService.renderRawComponent(RenderService.java:939)
at org.springframework.extensions.surf.render.RenderService.renderRawComponent(RenderService.java:926)
at org.springframework.extensions.surf.taglib.IncludeTag.doStartTag(IncludeTag.java:64)
at org.springframework.extensions.surf.render.TagService.execute(TagService.java:213)
at org.springframework.extensions.surf.render.TagService.execute(TagService.java:148)
at org.springframework.extensions.webscripts.FreemarkerTagSupportDirective.executeTag(FreemarkerTagSupportDirective.java:92)
at org.springframework.extensions.webscripts.GenericFreemarkerTagDirective.execute(GenericFreemarkerTagDirective.java:121)
at freemarker.core.Environment.visit(Environment.java:263)
at freemarker.core.UnifiedCall.accept(UnifiedCall.java:126)
at freemarker.core.Environment.visit(Environment.java:210)
at freemarker.core.Environment.process(Environment.java:190)
at freemarker.template.Template.process(Template.java:237)
at org.springframework.extensions.webscripts.processor.FTLTemplateProcessor.process(FTLTemplateProcessor.java:156)
at org.springframework.extensions.webscripts.WebTemplateProcessor.executeBody(WebTemplateProcessor.java:338)
at org.springframework.extensions.surf.render.AbstractProcessor.execute(AbstractProcessor.java:79)
at org.springframework.extensions.surf.render.RenderService.processRenderable(RenderService.java:389)
at org.springframework.extensions.surf.render.bean.ChromeRenderer.body(ChromeRenderer.java:96)
at org.springframework.extensions.surf.render.AbstractRenderer.render(AbstractRenderer.java:135)
at org.springframework.extensions.surf.render.bean.ChromeRenderer.render(ChromeRenderer.java:79)
at org.springframework.extensions.surf.render.bean.ComponentRenderer.body(ComponentRenderer.java:107)
at org.springframework.extensions.surf.render.AbstractRenderer.render(AbstractRenderer.java:135)
at org.springframework.extensions.surf.render.RenderService.renderRegionComponents(RenderService.java:796)
at org.springframework.extensions.surf.render.bean.RegionRenderer.body(RegionRenderer.java:120)
at org.springframework.extensions.surf.render.AbstractRenderer.render(AbstractRenderer.java:135)
at org.springframework.extensions.surf.render.RenderService.startRegionRenderer(RenderService.java:748)
at org.springframework.extensions.surf.render.RenderService.renderRegion(RenderService.java:692)
at org.springframework.extensions.surf.render.PresentationUtil.renderRegion(PresentationUtil.java:113)
at org.springframework.extensions.surf.taglib.RegionTag.doStartTag(RegionTag.java:102)
at org.springframework.extensions.surf.render.TagService.execute(TagService.java:213)
at org.springframework.extensions.surf.render.TagService.execute(TagService.java:148)
at org.springframework.extensions.webscripts.FreemarkerTagSupportDirective.executeTag(FreemarkerTagSupportDirective.java:92)
at org.springframework.extensions.webscripts.RegionFreemarkerTagDirective.execute(RegionFreemarkerTagDirective.java:122)
at freemarker.core.Environment.visit(Environment.java:263)
at freemarker.core.UnifiedCall.accept(UnifiedCall.java:126)
at freemarker.core.Environment.visit(Environment.java:210)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:210)
at freemarker.core.Environment.visit(Environment.java:395)
at freemarker.core.BodyInstruction.accept(BodyInstruction.java:93)
at freemarker.core.Environment.visit(Environment.java:210)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:210)
at freemarker.core.Macro$Context.runMacro(Macro.java:172)
at freemarker.core.Environment.visit(Environment.java:603)
at freemarker.core.UnifiedCall.accept(UnifiedCall.java:106)
at freemarker.core.Environment.visit(Environment.java:210)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:210)
at freemarker.core.Environment.process(Environment.java:190)
at freemarker.template.Template.process(Template.java:237)
at org.springframework.extensions.webscripts.processor.FTLTemplateProcessor.process(FTLTemplateProcessor.java:156)
at org.springframework.extensions.webscripts.WebTemplateProcessor.executeBody(WebTemplateProcessor.java:338)
at org.springframework.extensions.surf.render.AbstractProcessor.execute(AbstractProcessor.java:79)
at org.springframework.extensions.surf.render.RenderService.processTemplate(RenderService.java:581)
at org.springframework.extensions.surf.render.bean.TemplateInstanceRenderer.body(TemplateInstanceRenderer.java:134)
at org.springframework.extensions.surf.render.AbstractRenderer.render(AbstractRenderer.java:135)
at org.springframework.extensions.surf.render.bean.PageRenderer.body(PageRenderer.java:70)
at org.springframework.extensions.surf.render.AbstractRenderer.render(AbstractRenderer.java:135)
at org.springframework.extensions.surf.render.RenderService.startPageRenderer(RenderService.java:633)
at org.springframework.extensions.surf.render.RenderService.renderPage(RenderService.java:610)
at org.springframework.extensions.surf.render.PresentationUtil.renderPage(PresentationUtil.java:74)
at org.springframework.extensions.surf.mvc.PageView.dispatchPage(PageView.java:358)
at org.springframework.extensions.surf.mvc.PageView.renderView(PageView.java:299)
at org.springframework.extensions.surf.mvc.AbstractWebFrameworkView.renderMergedOutputModel(AbstractWebFrameworkView.java:167)
at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1060)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:798)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:647)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:552)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
at org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:213)
at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:171)
at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:381)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.springframework.extensions.webscripts.WebScriptException: 04100004 ReferenceError: "search" is not defined. (/WEB-INF/webscripts/semicalpicat/csearch.get.js#3)
at org.springframework.extensions.webscripts.processor.JSScriptProcessor.executeScriptImpl(JSScriptProcessor.java:323)
at org.springframework.extensions.webscripts.processor.JSScriptProcessor.executeScript(JSScriptProcessor.java:191)
… 104 more
Caused by: org.mozilla.javascript.EcmaError: ReferenceError: "search" is not defined. (/WEB-INF/webscripts/semicalpicat/csearch.get.js#3)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3350)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3340)
at org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3413)
at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1612)
at org.mozilla.javascript.gen.c9._c0(/WEB-INF/webscripts/semicalpicat/csearch.get.js:3)
at org.mozilla.javascript.gen.c9.call(/WEB-INF/webscripts/semicalpicat/csearch.get.js)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:393)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2834)
at org.mozilla.javascript.gen.c9.call(/WEB-INF/webscripts/semicalpicat/csearch.get.js)
at org.mozilla.javascript.gen.c9.exec(/WEB-INF/webscripts/semicalpicat/csearch.get.js)
at org.springframework.extensions.webscripts.processor.JSScriptProcessor.executeScriptImpl(JSScriptProcessor.java:313)
… 105 more
12:51:19,449 User:admin DEBUG [repo.jscript.RhinoScriptProcessor] Time to execute script: 1.1336ms
ERROR: org.springframework.extensions.webscripts.AbstractRuntime - Exception from executeScript - redirecting to status template error: 04100007 Failed to load script 'org.springframework.extensions.webscripts.ResourceStore$WebApplicationStoreScriptContent@ad643f': 04100006 ReferenceError: "search" is not defined. (/WEB-INF/webscripts/semicalpicat/csearch.get.js#3)
org.springframework.extensions.webscripts.WebScriptException: 04100007 Failed to load script 'org.springframework.extensions.webscripts.ResourceStore$WebApplicationStoreScriptContent@ad643f': 04100006 ReferenceError: "search" is not defined. (/WEB-INF/webscripts/semicalpicat/csearch.get.js#3)
at org.springframework.extensions.webscripts.processor.JSScriptProcessor.executeScript(JSScriptProcessor.java:195)
at org.springframework.extensions.webscripts.AbstractWebScript.executeScript(AbstractWebScript.java:982)
at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:86)
at org.springframework.extensions.webscripts.PresentationContainer.executeScript(PresentationContainer.java:69)
at org.springframework.extensions.webscripts.LocalWebScriptRuntimeContainer.executeScript(LocalWebScriptRuntimeContainer.java:203)
at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:333)
at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:189)
at org.springframework.extensions.webscripts.WebScriptProcessor.executeBody(WebScriptProcessor.java:296)
at org.springframework.extensions.surf.render.AbstractProcessor.execute(AbstractProcessor.java:79)
at org.springframework.extensions.surf.render.RenderService.processComponent(RenderService.java:467)
at org.springframework.extensions.surf.render.RenderService.renderRawComponent(RenderService.java:939)
at org.springframework.extensions.surf.render.RenderService.renderRawComponent(RenderService.java:926)
at org.springframework.extensions.surf.taglib.IncludeTag.doStartTag(IncludeTag.java:64)
at org.springframework.extensions.surf.render.TagService.execute(TagService.java:213)
at org.springframework.extensions.surf.render.TagService.execute(TagService.java:148)
at org.springframework.extensions.webscripts.FreemarkerTagSupportDirective.executeTag(FreemarkerTagSupportDirective.java:92)
at org.springframework.extensions.webscripts.GenericFreemarkerTagDirective.execute(GenericFreemarkerTagDirective.java:121)
at freemarker.core.Environment.visit(Environment.java:263)
at freemarker.core.UnifiedCall.accept(UnifiedCall.java:126)
at freemarker.core.Environment.visit(Environment.java:210)
at freemarker.core.Environment.process(Environment.java:190)
at freemarker.template.Template.process(Template.java:237)
at org.springframework.extensions.webscripts.processor.FTLTemplateProcessor.process(FTLTemplateProcessor.java:156)
at org.springframework.extensions.webscripts.WebTemplateProcessor.executeBody(WebTemplateProcessor.java:338)
at org.springframework.extensions.surf.render.AbstractProcessor.execute(AbstractProcessor.java:79)
at org.springframework.extensions.surf.render.RenderService.processRenderable(RenderService.java:389)
at org.springframework.extensions.surf.render.bean.ChromeRenderer.body(ChromeRenderer.java:96)
at org.springframework.extensions.surf.render.AbstractRenderer.render(AbstractRenderer.java:135)
at org.springframework.extensions.surf.render.bean.ChromeRenderer.render(ChromeRenderer.java:79)
at org.springframework.extensions.surf.render.bean.ComponentRenderer.body(ComponentRenderer.java:107)
at org.springframework.extensions.surf.render.AbstractRenderer.render(AbstractRenderer.java:135)
at org.springframework.extensions.surf.render.RenderService.renderRegionComponents(RenderService.java:796)
at org.springframework.extensions.surf.render.bean.RegionRenderer.body(RegionRenderer.java:120)
at org.springframework.extensions.surf.render.AbstractRenderer.render(AbstractRenderer.java:135)
at org.springframework.extensions.surf.render.RenderService.startRegionRenderer(RenderService.java:748)
at org.springframework.extensions.surf.render.RenderService.renderRegion(RenderService.java:692)
at org.springframework.extensions.surf.render.PresentationUtil.renderRegion(PresentationUtil.java:113)
at org.springframework.extensions.surf.taglib.RegionTag.doStartTag(RegionTag.java:102)
at org.springframework.extensions.surf.render.TagService.execute(TagService.java:213)
at org.springframework.extensions.surf.render.TagService.execute(TagService.java:148)
at org.springframework.extensions.webscripts.FreemarkerTagSupportDirective.executeTag(FreemarkerTagSupportDirective.java:92)
at org.springframework.extensions.webscripts.RegionFreemarkerTagDirective.execute(RegionFreemarkerTagDirective.java:122)
at freemarker.core.Environment.visit(Environment.java:263)
at freemarker.core.UnifiedCall.accept(UnifiedCall.java:126)
at freemarker.core.Environment.visit(Environment.java:210)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:210)
at freemarker.core.Environment.visit(Environment.java:395)
at freemarker.core.BodyInstruction.accept(BodyInstruction.java:93)
at freemarker.core.Environment.visit(Environment.java:210)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:210)
at freemarker.core.Macro$Context.runMacro(Macro.java:172)
at freemarker.core.Environment.visit(Environment.java:603)
at freemarker.core.UnifiedCall.accept(UnifiedCall.java:106)
at freemarker.core.Environment.visit(Environment.java:210)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:210)
at freemarker.core.Environment.process(Environment.java:190)
at freemarker.template.Template.process(Template.java:237)
at org.springframework.extensions.webscripts.processor.FTLTemplateProcessor.process(FTLTemplateProcessor.java:156)
at org.springframework.extensions.webscripts.WebTemplateProcessor.executeBody(WebTemplateProcessor.java:338)
at org.springframework.extensions.surf.render.AbstractProcessor.execute(AbstractProcessor.java:79)
at org.springframework.extensions.surf.render.RenderService.processTemplate(RenderService.java:581)
at org.springframework.extensions.surf.render.bean.TemplateInstanceRenderer.body(TemplateInstanceRenderer.java:134)
at org.springframework.extensions.surf.render.AbstractRenderer.render(AbstractRenderer.java:135)
at org.springframework.extensions.surf.render.bean.PageRenderer.body(PageRenderer.java:70)
at org.springframework.extensions.surf.render.AbstractRenderer.render(AbstractRenderer.java:135)
at org.springframework.extensions.surf.render.RenderService.startPageRenderer(RenderService.java:633)
at org.springframework.extensions.surf.render.RenderService.renderPage(RenderService.java:610)
at org.springframework.extensions.surf.render.PresentationUtil.renderPage(PresentationUtil.java:74)
at org.springframework.extensions.surf.mvc.PageView.dispatchPage(PageView.java:358)
at org.springframework.extensions.surf.mvc.PageView.renderView(PageView.java:299)
at org.springframework.extensions.surf.mvc.AbstractWebFrameworkView.renderMergedOutputModel(AbstractWebFrameworkView.java:167)
at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1060)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:798)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:647)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:552)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
at org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:213)
at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:171)
at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:381)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.springframework.extensions.webscripts.WebScriptException: 04100006 ReferenceError: "search" is not defined. (/WEB-INF/webscripts/semicalpicat/csearch.get.js#3)
at org.springframework.extensions.webscripts.processor.JSScriptProcessor.executeScriptImpl(JSScriptProcessor.java:323)
at org.springframework.extensions.webscripts.processor.JSScriptProcessor.executeScript(JSScriptProcessor.java:191)
… 104 more
Caused by: org.mozilla.javascript.EcmaError: ReferenceError: "search" is not defined. (/WEB-INF/webscripts/semicalpicat/csearch.get.js#3)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3350)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3340)
at org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3413)
at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1612)
at org.mozilla.javascript.gen.c11._c0(/WEB-INF/webscripts/semicalpicat/csearch.get.js:3)
at org.mozilla.javascript.gen.c11.call(/WEB-INF/webscripts/semicalpicat/csearch.get.js)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:393)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2834)
at org.mozilla.javascript.gen.c11.call(/WEB-INF/webscripts/semicalpicat/csearch.get.js)
at org.mozilla.javascript.gen.c11.exec(/WEB-INF/webscripts/semicalpicat/csearch.get.js)
at org.springframework.extensions.webscripts.processor.JSScriptProcessor.executeScriptImpl(JSScriptProcessor.java:313)
… 105 more
05-10-2011 05:19 AM
05-10-2011 06:07 AM
05-10-2011 06:16 AM
05-10-2011 07:18 AM
<?xml version="1.0" encoding="UTF-8"?>
<page>
<id>csearchpage</id>
<description>page with 1 main configurable block</description>
<template-instance>one-block</template-instance>
<authentication>none</authentication>
<components>
<component>
<region-id>main1</region-id>
<url>/advsearch/csearch</url>
</component>
</components>
</page>
<webscript>
<shortname>Csearch</shortname>
<description>Custom Search</description>
<url>/advsearch/csearch</url>
</webscript>
if (url.args['phrase'] != null) {
var connector = remote.connect("alfresco");
var data = connector.call("/mysearch/advsearch?q=" + url.args['phrase']);
model.response = data;
model.phrase = url.args['phrase'];
}
else {
model.phrase = null;
}
<p>Custom Search</p>
<form action="${url.context}/csearch/csearch.html" method="get">
<fieldset>
<input type="hidden" value="${webSite.rootSection.id}" name="sectionId" />
<input type="text" value="${phrase!''}" name="phrase" id="search-phrase" maxlengt
h="100"/>
<input type="submit" value="Search" />
</fieldset>
</form>
<p>Response: ${response!'no response'}</p>
<webscript>
<shortname>Advanced Search</shortname>
<description>Cerca avancada</description>
<url>/mysearch/advsearch?q={searchTerm}</url>
<format default="json">extension</format>
<authentication>guest</authentication>
<transaction>required</transaction>
</webscript>
advsearch.get.json.ftl:
{
"results" : [
<#list nodes as child>
{
"name" : "${child.properties.name}" ,
"creator" : "${child.properties.creator}",
"CreatedDate" : "${child.properties.created?datetime}"
}
<#if child_has_next> , </#if>
</#list>
]
}
advsearch.get.js:
nodes = search.luceneSearch("TEXT:"+args['q']+"*");
var start = 0;
var limit = 100;
pagedResults = new Array();
for (i=0; i < nodes.length && i < limit; i++ ) {
var node = nodes[(+start + i)];
if (node != undefined) {
pagedResults.push(node);
}
}
model.nodes = pagedResults;
model.total = nodes.length;
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.