AnsweredAssumed Answered

Tagging API

Question asked by rascio on Apr 26, 2010
Hello,
i'm trying to create a Tag via webscript…i make the call using the apache httpclient…but the server goes on error…and i don't know the cause…
the client side code is:
HttpClient client = new DefaultHttpClient();
      
      HttpPost post = new HttpPost("http://localhost:8180/alfresco/s/api/tag/workspace/SpacesStore.json?alf_ticket=TICKET_bc7c4b0421572d99e5aacfd6333d1feb1e8a0a47");
      
      StringEntity params = new StringEntity("{\"name\":\"TAG-TEST\"}");
      
      post.setEntity(params);
      post.setHeader("Content-Type", "application/json");
      HttpResponse response = client.execute(post);
      
      System.out.println("Response Status: " + response.getStatusLine().getStatusCode());
      String entity = EntityUtils.toString(response.getEntity());
      System.out.println("Response:\n" + entity);


and the exception is:

12:11:49,947 User:admin ERROR [web.scripts.AbstractRuntime] Exception from executeScript - redirecting to status template error: 03260015 Wrapped Exception (with status template): 03260014 Failed to execute script '/org/alfresco/repository/tagging/tag.post.json.js (in classpath store file:/media/DATI/Alfresco3.2/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts)': 03260013 Missing classification: {http://www.alfresco.org/model/content/1.0}taggable
org.alfresco.web.scripts.WebScriptException: 03260015 Wrapped Exception (with status template): 03260014 Failed to execute script '/org/alfresco/repository/tagging/tag.post.json.js (in classpath store file:/media/DATI/Alfresco3.2/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts)': 03260013 Missing classification: {http://www.alfresco.org/model/content/1.0}taggable
   at org.alfresco.web.scripts.AbstractWebScript.createStatusException(AbstractWebScript.java:613)
   at org.alfresco.web.scripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:165)
   at org.alfresco.repo.web.scripts.RepositoryContainer$2.execute(RepositoryContainer.java:372)
   at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:327)
   at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:422)
   at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:439)
   at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:303)
   at org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:306)
   at org.alfresco.web.scripts.servlet.WebScriptServletRuntime.executeScript(WebScriptServletRuntime.java:178)
   at org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:183)
   at org.alfresco.web.scripts.servlet.WebScriptServlet.service(WebScriptServlet.java:122)
   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.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
   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:286)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
   at java.lang.Thread.run(Thread.java:619)
Caused by: org.alfresco.scripts.ScriptException: 03260014 Failed to execute script '/org/alfresco/repository/tagging/tag.post.json.js (in classpath store file:/media/DATI/Alfresco3.2/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts)': 03260013 Missing classification: {http://www.alfresco.org/model/content/1.0}taggable
   at org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:178)
   at org.alfresco.repo.processor.ScriptServiceImpl.executeScript(ScriptServiceImpl.java:274)
   at org.alfresco.repo.web.scripts.RepositoryScriptProcessor.executeScript(RepositoryScriptProcessor.java:108)
   at org.alfresco.web.scripts.AbstractWebScript.executeScript(AbstractWebScript.java:819)
   at org.alfresco.web.scripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:90)
   … 22 more
Caused by: org.alfresco.error.AlfrescoRuntimeException: 03260013 Missing classification: {http://www.alfresco.org/model/content/1.0}taggable
   at org.alfresco.repo.search.impl.lucene.LuceneCategoryServiceImpl.createRootCategory(LuceneCategoryServiceImpl.java:367)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.alfresco.repo.service.StoreRedirectorProxyFactory$RedirectorInvocationHandler.invoke(StoreRedirectorProxyFactory.java:221)
   at $Proxy46.createRootCategory(Unknown Source)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
   at net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:80)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:49)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:148)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
   at $Proxy67.createRootCategory(Unknown Source)
   at org.alfresco.repo.tagging.TaggingServiceImpl.createTag(TaggingServiceImpl.java:297)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
   at org.alfresco.repo.security.permissions.impl.AlwaysProceedMethodInterceptor.invoke(AlwaysProceedMethodInterceptor.java:40)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:49)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:148)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
   at $Proxy68.createTag(Unknown Source)
   at org.alfresco.repo.tagging.script.ScriptTaggingService.createTag(ScriptTaggingService.java:111)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:155)
   at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:243)
   at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:76)
   at org.mozilla.javascript.gen.c3._c1(file:/media/DATI/Alfresco3.2/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/repository/tagging/tag.post.json.js:22)
   at org.mozilla.javascript.gen.c3.call(file:/media/DATI/Alfresco3.2/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/repository/tagging/tag.post.json.js)
   at org.mozilla.javascript.optimizer.OptRuntime.callName0(OptRuntime.java:108)
   at org.mozilla.javascript.gen.c3._c0(file:/media/DATI/Alfresco3.2/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/repository/tagging/tag.post.json.js:35)
   at org.mozilla.javascript.gen.c3.call(file:/media/DATI/Alfresco3.2/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/repository/tagging/tag.post.json.js)
   at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:393)
   at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2834)
   at org.mozilla.javascript.gen.c3.call(file:/media/DATI/Alfresco3.2/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/repository/tagging/tag.post.json.js)
   at org.mozilla.javascript.gen.c3.exec(file:/media/DATI/Alfresco3.2/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/repository/tagging/tag.post.json.js)
   at org.alfresco.repo.jscript.RhinoScriptProcessor.executeScriptImpl(RhinoScriptProcessor.java:456)
   at org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:174)
   … 26 more

is this a bug? or i'm doing something wrong…

Outcomes