Alfresco webscript:未使用模型脚本

Alfresco webscript:未使用模型脚本,alfresco,Alfresco,因此,我有一个包含以下文件的webscript: xyz.post.desc.xml xyz.post.json.ftl xyz.post.json.js 描述如下: <webscript> <shortname>xxx</shortname> <description>xxx</description> <url>/my/url/xyz?uri={id}</url> <format d

因此,我有一个包含以下文件的webscript:

  • xyz.post.desc.xml
  • xyz.post.json.ftl
  • xyz.post.json.js
描述如下:

<webscript>
  <shortname>xxx</shortname>
  <description>xxx</description>
  <url>/my/url/xyz?uri={id}</url>
  <format default="json">argument</format>
  <lifecycle>draft_public_api</lifecycle>
  <authentication>user</authentication>
  <transaction>none</transaction>
  <family>my/family</family>
</webscript>
然后在我的ftl中

${foo}
我有一个ftl异常,它说foo是未定义的,现在我非常确定我不执行js文件本身

什么原因可以解释webscript在评估模板之前没有运行模型


注意:从url/alfresco/service/webscript列表中,如果我查看xyz.post的详细信息,我可以看到相关的.js内容

json.js不是您的模型,您的模型应该是xyz.post.js

所以有人说foo没有定义


查看以获取更多信息

因此,对于记录,我忘了将:
requestContentType:Alfresco.util.Ajax.JSON
传递给Ajax POST方法

您应该查看一下共享框架的所有repo webscript,其中有xyz.POST.JSON.js,可以正常工作。我还有其他类似的webscript。从你的问题来看,不清楚你是否在使用共享webscript:)它们是用于向共享webapp公开Alfresco repo数据的存储库webscript,确切地说,它不是共享webscript。对不起,我先前的答复有点混乱。
${foo}