如何在Alfresco中使用TagQuery查询标签

时间:2012-12-04 17:09:13

标签: alfresco alfresco-share

我在浏览器上查询此网址http://your.host:8080/share/proxy/alfresco/collaboration/tagQuery,此结果

  {
   "countMin": 1,
   "countMax": 1,
   "tags": 
   [
      { "name": "folder", "count": 1 }
   ]
}

但是我在javascript中使用了相同的网址,但是无论如何都要在Alfresco中查询Tag吗?

和此消息::

Web Script Status 404 - Not Found

The Web Script /alfresco/s/collabQuery/tag has responded with a status of 404 - Not Found.

404 Description:     Requested resource is not available.

Message:    11040003 Script url /collabQuery/tag does not map to a Web Script.

Exception:  org.springframework.extensions.webscripts.WebScriptException - 11040003 Script url /collabQuery/tag does not map to a Web Script.

org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:173)
org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:118)
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.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:58)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
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.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:470)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
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:298)
org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:861)
org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1584)
java.lang.Thread.run(Thread.java:662)

这是我在Test.get.js中的代码

function main()
{
    var theUrl = "proxy/alfresco/collaboration/tagQuery";
    var data = remote.call(theUrl);

    var result = String(data);
    model.result = result; 

}
main();

1 个答案:

答案 0 :(得分:1)

如@Gagravarr所述,您使用的是错误的网址。要在共享网络脚本中访问该网址,您需要将Test.get.js中的第3行更改为var theUrl = "/collaboration/tagQuery"。只有在从Web浏览器调用URL时才需要proxy/alfresco部分。