cancel
Showing results for 
Search instead for 
Did you mean: 

Checking out via SlingShot REST API

n4zroth
Champ in-the-making
Champ in-the-making
Hi,
I'm trying to checkout a document via "alfresco/service/slingshot/doclib/action/checkout/node/workspace/SpacesStore/{id}" and get the following error:

{
    "status" :
  {
    "code" : 500,
    "name" : "Internal Error",
    "description" : "An error inside the HTTP server which prevented it from fulfilling the request."
  }, 
 
  "message" : "08200043 Wrapped Exception (with status template): 08200064 Error during processing of the template 'When calling macro \"resultsJSON\", required parameter \"results\" (parameter #1) was specified, but had null\/missing value.\n\nTip: If the parameter value expression on the caller side is known to be legally null\/missing, you may want to specify a default value for it with the \"!\" operator, like paramValue!defaultValue.\n\nThe failing instruction:\n==> @actionLib.resultsJSON results=results  [in template \"org\/alfresco\/slingshot\/documentlibrary\/action\/checkout.post.json.ftl\" at line 2, column 1]'. Please contact your system administrator.", 
  "exception" : "org.springframework.extensions.webscripts.WebScriptException - 08200043 Wrapped Exception (with status template): 08200064 Error during processing of the template 'When calling macro \"resultsJSON\", required parameter \"results\" (parameter #1) was specified, but had null\/missing value.\n\nTip: If the parameter value expression on the caller side is known to be legally null\/missing, you may want to specify a default value for it with the \"!\" operator, like paramValue!defaultValue.\n\nThe failing instruction:\n==> @actionLib.resultsJSON results=results  [in template \"org\/alfresco\/slingshot\/documentlibrary\/action\/checkout.post.json.ftl\" at line 2, column 1]'. Please contact your system administrator.",
 
  "callstack" :
  [
       ""      ,"freemarker.core._MiscTemplateException: When calling macro \"resultsJSON\", required parameter \"results\" (parameter #1) was specified, but had null\/missing value.\n\nTip: If the parameter value expression on the caller side is known to be legally null\/missing, you may want to specify a default value for it with the \"!\" operator, like paramValue!defaultValue.\n\nThe failing instruction:\n==> @actionLib.resultsJSON results=results  [in template \"org\/alfresco\/slingshot\/documentlibrary\/action\/checkout.post.json.ftl\" at line 2, column 1]"
      ,"freemarker.core.Macro$Context.sanityCheck(Macro.java:249)"
      ,"freemarker.core.Macro$Context.runMacro(Macro.java:206)"
      ,"freemarker.core.Environment.visit(Environment.java:694)"
      ,"freemarker.core.UnifiedCall.accept(UnifiedCall.java:116)"
      ,"freemarker.core.Environment.visit(Environment.java:265)"
      ,"freemarker.core.MixedContent.accept(MixedContent.java:93)"
      ,"freemarker.core.Environment.visit(Environment.java:265)"
      ,"freemarker.core.Environment.process(Environment.java:243)"
      ,"org.alfresco.repo.template.FreeMarkerProcessor.process(FreeMarkerProcessor.java:217)"
      ,"org.springframework.extensions.webscripts.AbstractWebScript.renderTemplate(AbstractWebScript.java:955)"
      ,"org.springframework.extensions.webscripts.DeclarativeWebScript.renderFormatTemplate(DeclarativeWebScript.java:267)"
      ,"org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:147)"
      ,"org.alfresco.repo.web.scripts.RepositoryContainer$3.execute(RepositoryContainer.java:489)"
      ,"org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:457)"
      ,"org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:551)"
      ,"org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:619)"
      ,"org.alfresco.repo.web.scripts.RepositoryContainer.executeScriptInternal(RepositoryContainer.java:399)"
      ,"org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:280)"
      ,"org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:378)"
      ,"org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:209)"
      ,"org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:132)"
      ,"javax.servlet.http.HttpServlet.service(HttpServlet.java:727)"
      ,"org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)"
      ,"org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)"
      ,"org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)"
      ,"org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)"
      ,"org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)"
      ,"org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:61)"
      ,"org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)"
      ,"org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)"
      ,"org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)"
      ,"org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)"
      ,"org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)"
      ,"org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)"
      ,"org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)"
      ,"org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)"
      ,"org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)"
      ,"org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)"
      ,"org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074)"
      ,"org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)"
      ,"org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2466)"
      ,"org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2455)"
      ,"java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)"
      ,"java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)"
      ,"org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)"
      ,"java.lang.Thread.run(Thread.java:745)"
      ,"org.alfresco.service.cmr.repository.TemplateException: 08200064 Error during processing of the template 'When calling macro \"resultsJSON\", required parameter \"results\" (parameter #1) was specified, but had null\/missing value.\n\nTip: If the parameter value expression on the caller side is known to be legally null\/missing, you may want to specify a default value for it with the \"!\" operator, like paramValue!defaultValue.\n\nThe failing instruction:\n==> @actionLib.resultsJSON results=results  [in template \"org\/alfresco\/slingshot\/documentlibrary\/action\/checkout.post.json.ftl\" at line 2, column 1]'. Please contact your system administrator."
      ,"org.alfresco.repo.template.FreeMarkerProcessor.process(FreeMarkerProcessor.java:221)"
      ,"org.springframework.extensions.webscripts.WebScriptException: 08200043 Wrapped Exception (with status template): 08200064 Error during processing of the template 'When calling macro \"resultsJSON\", required parameter \"results\" (parameter #1) was specified, but had null\/missing value.\n\nTip: If the parameter value expression on the caller side is known to be legally null\/missing, you may want to specify a default value for it with the \"!\" operator, like paramValue!defaultValue.\n\nThe failing instruction:\n==> @actionLib.resultsJSON results=results  [in template \"org\/alfresco\/slingshot\/documentlibrary\/action\/checkout.post.json.ftl\" at line 2, column 1]'. Please contact your system administrator."
      ,"org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript.java:1127)"

  ],
 
  "server" : "Community v5.0.0 (d r99759-b2) schema 8,022",
  "time" : "Sep 20, 2015 8:12:06 PM"
}

I'm posting an empty NameValuePair as I have no idea what to post/where to find what to post.
What am I doing wrong? I've spent two hours searching the API and googleing.
Thanks!
1 REPLY 1

jpotts
World-Class Innovator
World-Class Innovator

Any time you find yourself tempted to call a URL with "slingshot" in it, you should ask yourself, "Is there a way I can do this using public API instead of internal-only API?". And in this case there is and that's with CMIS.

This post on SO shows how to check out and check in a document using OpenCMIS.