 
					
				
		
08-25-2009 07:30 AM
/alfresco/service/slingshot/doclib/action/move-to/node/{store_type}/{store_id}/{id}/{path}{
    "status" : 
  {
    "code" : 500,
    "name" : "Internal Error",
    "description" : "An error inside the HTTP server which prevented it from fulfilling the request.
"
  },  
  
  "message" : "07250010 Wrapped Exception (with status template): 07250009 Error during processing of
 the template 'Error executing macro: resultsJSON\nrequired parameter: results is not specified.'. Please
 contact your system administrator.",  
  "exception" : "org.alfresco.web.scripts.WebScriptException - 07250010 Wrapped Exception (with status
 template): 07250009 Error during processing of the template 'Error executing macro: resultsJSON\nrequired
 parameter: results is not specified.'. Please contact your system administrator.",
  
  "callstack" : 
  [ 
       ""      ,"freemarker.template.TemplateException: Error executing macro: resultsJSON\nrequired parameter
: results is not specified."
      ,"freemarker.core.Macro$Context.sanityCheck(Macro.java:181)"
      ,"freemarker.core.Macro$Context.runMacro(Macro.java:161)"
      ,"freemarker.core.Environment.visit(Environment.java:601)"
      ,"freemarker.core.UnifiedCall.accept(UnifiedCall.java:106)"
      ,"freemarker.core.Environment.visit(Environment.java:208)"
      ,"freemarker.core.MixedContent.accept(MixedContent.java:92)"
      ,"freemarker.core.Environment.visit(Environment.java:208)"
      ,"freemarker.core.Environment.process(Environment.java:188)"
      ,"freemarker.template.Template.process(Template.java:237)"
      ,"org.alfresco.repo.template.FreeMarkerProcessor.process(FreeMarkerProcessor.java:202)"
      ,"org.alfresco.web.scripts.AbstractWebScript.renderTemplate(AbstractWebScript.java:523)"
      ,"org.alfresco.web.scripts.DeclarativeWebScript.renderFormatTemplate(DeclarativeWebScript.java
:241)"
      ,"org.alfresco.web.scripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:147)"
      ,"org.alfresco.repo.web.scripts.RepositoryContainer$2.execute(RepositoryContainer.java:357)"
      ,"org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper
.java:326)"
      ,"org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java
:407)"
      ,"org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer
.java:424)"
      ,"org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:288
)"
      ,"org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:262)"
      ,"org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:139)"
      ,"org.alfresco.web.scripts.servlet.WebScriptServlet.service(WebScriptServlet.java:122)"
      ,"javax.servlet.http.HttpServlet.service(HttpServlet.java:717)"
      ,"org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java
:290)"
      ,"org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)"
      ,"org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)"
      ,"org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)"
      ,"org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)"
      ,"org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)"
      ,"org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)"
      ,"org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)"
      ,"org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)"
      ,"org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583
)"
      ,"org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)"
      ,"java.lang.Thread.run(Thread.java:619)"
      ,"org.alfresco.service.cmr.repository.TemplateException: 07250009 Error during processing of the
 template 'Error executing macro: resultsJSON\nrequired parameter: results is not specified.'. Please
 contact your system administrator."
      ,"org.alfresco.repo.template.FreeMarkerProcessor.process(FreeMarkerProcessor.java:206)"
      ,"org.alfresco.web.scripts.WebScriptException: 07250010 Wrapped Exception (with status template
): 07250009 Error during processing of the template 'Error executing macro: resultsJSON\nrequired parameter
: results is not specified.'. Please contact your system administrator."
      ,"org.alfresco.web.scripts.AbstractWebScript.createStatusException(AbstractWebScript.java:613)
"
 
  ],
  
  "server" : "Alfresco Community v3.2.0 (2039) schema 2,019",
  "time" : "Aug 25, 2009 2:24:28 PM"
}
08-25-2009 08:13 AM
store_type = workspaceBecause those parameters aren't correct. The nodeRef (or Share site/container/path) in the URL specifies the destination node (path is optional and probably not required for nodeRef URL formats).
store_id = SpacesStore
id = the id of the file I want to move
path = the path of the space where I want to move the file
Could someone please explain why the script returns an error ?
POST http://localhost:8080/alfresco/service/slingshot/doclib/action/move-to/node/workspace/SpacesStore/12....
Content-Type: application/json;charset=UTF-8
{"nodeRefs":["workspace://SpacesStore/6425469d-8b02-4850-806b-28a538def0e6","workspace://SpacesStore/a9c7fcb8-8827-42fb-a61d-cccf98f93d95","workspace://SpacesStore/38451091-ac67-42d6-9ad5-cabb2f5ef722"]} 
					
				
		
08-25-2009 09:44 AM
store_type = workspaceBecause those parameters aren't correct. The nodeRef (or Share site/container/path) in the URL specifies the destination node (path is optional and probably not required for nodeRef URL formats).
store_id = SpacesStore
id = the id of the file I want to move
path = the path of the space where I want to move the file
Could someone please explain why the script returns an error ?
You then need to post a JSON body to the web script with a "nodeRefs" variable containing an array of nodeRefs that you want to move to the destination.
e.g.POST http://localhost:8080/alfresco/service/slingshot/doclib/action/move-to/node/workspace/SpacesStore/12....
Content-Type: application/json;charset=UTF-8
{"nodeRefs":["workspace://SpacesStore/6425469d-8b02-4850-806b-28a538def0e6","workspace://SpacesStore/a9c7fcb8-8827-42fb-a61d-cccf98f93d95","workspace://SpacesStore/38451091-ac67-42d6-9ad5-cabb2f5ef722"]}
Thanks,
Mike
'/alfresco/service/slingshot/doclib/action/move-to/node/workspace/SpacesStore/destination_folder_id{"nodeRefs":["workspace://SpacesStore/file_I_want_to_move_id"]}''/alfresco/service/slingshot/doclib/action/move-to/node/workspace/SpacesStore/destination_folder_id/{"nodeRefs":["workspace://SpacesStore/file_I_want_to_move_id"]}'{
    "status" : 
  {
    "code" : 500,
    "name" : "Internal Error",
    "description" : "An error inside the HTTP server which prevented it from fulfilling the request.
"
  },  
  
  "message" : "07250037 Wrapped Exception (with status template): 07250036 Error during processing of
 the template 'Error executing macro: resultsJSON\nrequired parameter: results is not specified.'. Please
 contact your system administrator.",  
  "exception" : "org.alfresco.web.scripts.WebScriptException - 07250037 Wrapped Exception (with status
 template): 07250036 Error during processing of the template 'Error executing macro: resultsJSON\nrequired
 parameter: results is not specified.'. Please contact your system administrator.",
  
  "callstack" : 
  [ 
       ""      ,"freemarker.template.TemplateException: Error executing macro: resultsJSON\nrequired parameter
: results is not specified."
      ,"freemarker.core.Macro$Context.sanityCheck(Macro.java:181)"
      ,"freemarker.core.Macro$Context.runMacro(Macro.java:161)"
      ,"freemarker.core.Environment.visit(Environment.java:601)"
      ,"freemarker.core.UnifiedCall.accept(UnifiedCall.java:106)"
      ,"freemarker.core.Environment.visit(Environment.java:208)"
      ,"freemarker.core.MixedContent.accept(MixedContent.java:92)"
      ,"freemarker.core.Environment.visit(Environment.java:208)"
      ,"freemarker.core.Environment.process(Environment.java:188)"
      ,"freemarker.template.Template.process(Template.java:237)"
      ,"org.alfresco.repo.template.FreeMarkerProcessor.process(FreeMarkerProcessor.java:202)"
      ,"org.alfresco.web.scripts.AbstractWebScript.renderTemplate(AbstractWebScript.java:523)"
      ,"org.alfresco.web.scripts.DeclarativeWebScript.renderFormatTemplate(DeclarativeWebScript.java
:241)"
      ,"org.alfresco.web.scripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:147)"
      ,"org.alfresco.repo.web.scripts.RepositoryContainer$2.execute(RepositoryContainer.java:357)"
      ,"org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper
.java:326)"
      ,"org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java
:407)"
      ,"org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer
.java:424)"
      ,"org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:288
)"
      ,"org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:262)"
      ,"org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:139)"
      ,"org.alfresco.web.scripts.servlet.WebScriptServlet.service(WebScriptServlet.java:122)"
      ,"javax.servlet.http.HttpServlet.service(HttpServlet.java:717)"
      ,"org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java
:290)"
      ,"org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)"
      ,"org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)"
      ,"org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)"
      ,"org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)"
      ,"org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)"
      ,"org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)"
      ,"org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)"
      ,"org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)"
      ,"org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583
)"
      ,"org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)"
      ,"java.lang.Thread.run(Thread.java:619)"
      ,"org.alfresco.service.cmr.repository.TemplateException: 07250036 Error during processing of the
 template 'Error executing macro: resultsJSON\nrequired parameter: results is not specified.'. Please
 contact your system administrator."
      ,"org.alfresco.repo.template.FreeMarkerProcessor.process(FreeMarkerProcessor.java:206)"
      ,"org.alfresco.web.scripts.WebScriptException: 07250037 Wrapped Exception (with status template
): 07250036 Error during processing of the template 'Error executing macro: resultsJSON\nrequired parameter
: results is not specified.'. Please contact your system administrator."
      ,"org.alfresco.web.scripts.AbstractWebScript.createStatusException(AbstractWebScript.java:613)
"
 
  ],
  
  "server" : "Alfresco Community v3.2.0 (2039) schema 2,019",
  "time" : "Aug 25, 2009 4:31:25 PM"
}
08-25-2009 10:04 AM
Is the url correct or should I pass the json body to the webscript in a different way ?The JSON needs to be in the request body, not on the URL.
Could you please tell me where is the mistake ?
Thanks,
Andrei
 
					
				
		
08-26-2009 04:58 AM
Is the url correct or should I pass the json body to the webscript in a different way ?The JSON needs to be in the request body, not on the URL.
Could you please tell me where is the mistake ?
Thanks,
Andrei
Mike
08-26-2009 05:58 AM
YAHOO.util.Connect.asyncRequest(method, url, callback, dataStr);dataStr = YAHOO.lang.JSON.stringify(nodeRefsArray); 
					
				
		
08-26-2009 09:08 AM
Easiest way is with a JavaScript framework like YUI:Where dataStr would be the JSON body, e.g.YAHOO.util.Connect.asyncRequest(method, url, callback, dataStr);dataStr = YAHOO.lang.JSON.stringify(nodeRefsArray);
Mike
 
					
				
				
			
		
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.