AnsweredAssumed Answered

How to get a space's rules

Question asked by andreim on Aug 4, 2009
Latest reply on Sep 11, 2009 by rsulliv1
Hi ,

I have a space in Alfresco ( Company Home/aProject/Drafts ) which has a rule named Submit.
I need an api that gets the rules from an Alfresco space.
If I use "/alfresco/service/api/path/workspace/SpacesStore/Company Home/aProject/Drafts/rules", an empty array will be returned.
If I use "/alfresco/service/api/rules/appliedtonode/workspace/SpacesStore/Company Home/aProject/Drafts" , I will get an error :
{
    "status" :
  {
    "code" : 500,
    "name" : "Internal Error",
    "description" : "An error inside the HTTP server which prevented it from fulfilling the request.
"
  }, 
 
  "message" : "07040022 Wrapped Exception (with status template): nodeRef is a mandatory parameter",
 
  "exception" : "org.alfresco.web.scripts.WebScriptException - 07040022 Wrapped Exception (with status
template): nodeRef is a mandatory parameter",
 
  "callstack" :
  [
       ""      ,"java.lang.IllegalArgumentException: nodeRef is a mandatory parameter"
      ,"org.alfresco.util.ParameterCheck.mandatory(ParameterCheck.java:48)"
      ,"org.alfresco.repo.node.db.DbNodeServiceImpl.exists(DbNodeServiceImpl.java:170)"
      ,"sun.reflect.GeneratedMethodAccessor337.invoke(Unknown Source)"
      ,"sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)"
      ,"java.lang.reflect.Method.invoke(Method.java:597)"
      ,"org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)"
      ,"org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation
.java:182)"
      ,"org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation
.java:149)"
      ,"org.alfresco.repo.transaction.SingleEntryTransactionResourceInterceptor.invokeInternal(SingleEntryTransactionResourceInterceptor
.java:163)"
      ,"org.alfresco.repo.transaction.SingleEntryTransactionResourceInterceptor.invoke(SingleEntryTransactionResourceInterceptor
.java:138)"
      ,"org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation
.java:171)"
      ,"org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)"
      ,"$Proxy9.exists(Unknown Source)"
      ,"sun.reflect.GeneratedMethodAccessor337.invoke(Unknown Source)"
      ,"sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)"
      ,"java.lang.reflect.Method.invoke(Method.java:597)"
      ,"org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)"
      ,"org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation
.java:182)"
      ,"org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation
.java:149)"
      ,"org.alfresco.repo.tenant.MultiTNodeServiceInterceptor.invoke(MultiTNodeServiceInterceptor.java
:110)"
      ,"org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation
.java:171)"
      ,"org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)"
      ,"$Proxy9.exists(Unknown Source)"
      ,"sun.reflect.GeneratedMethodAccessor337.invoke(Unknown Source)"
      ,"sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)"
      ,"java.lang.reflect.Method.invoke(Method.java:597)"
      ,"org.alfresco.repo.service.StoreRedirectorProxyFactory$RedirectorInvocationHandler.invoke(StoreRedirectorProxyFactory
.java:221)"
      ,"$Proxy10.exists(Unknown Source)"
      ,"sun.reflect.GeneratedMethodAccessor337.invoke(Unknown Source)"
      ,"sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)"
      ,"java.lang.reflect.Method.invoke(Method.java:597)"
      ,"org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)"
      ,"org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation
.java:182)"
      ,"org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation
.java:149)"
      ,"org.alfresco.repo.node.MLPropertyInterceptor.invoke(MLPropertyInterceptor.java:306)"
      ,"org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation
.java:171)"
      ,"org.alfresco.repo.node.MLPropertyInterceptor.invoke(MLPropertyInterceptor.java:306)"
      ,"org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation
.java:171)"
      ,"org.alfresco.repo.node.NodeRefPropertyMethodInterceptor.invoke(NodeRefPropertyMethodInterceptor
.java:274)"
      ,"org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation
.java:171)"
      ,"org.alfresco.repo.node.NodeRefPropertyMethodInterceptor.invoke(NodeRefPropertyMethodInterceptor
.java:274)"
      ,"org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation
.java:171)"
      ,"org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)"
      ,"$Proxy9.exists(Unknown Source)"
      ,"org.alfresco.repo.rule.RuleServiceImpl.getRules(RuleServiceImpl.java:358)"
      ,"sun.reflect.GeneratedMethodAccessor1166.invoke(Unknown Source)"
      ,"sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)"
      ,"java.lang.reflect.Method.invoke(Method.java:597)"
      ,"org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)"
      ,"org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation
.java:182)"
      ,"org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation
.java:149)"
      ,"org.alfresco.repo.security.permissions.impl.AlwaysProceedMethodInterceptor.invoke(AlwaysProceedMethodInterceptor
.java:40)"
      ,"org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation
.java:171)"
      ,"org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor
.java:49)"
      ,"org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation
.java:171)"
      ,"org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:275)"
      ,"org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:69)"
      ,"org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation
.java:171)"
      ,"org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor
.java:106)"
      ,"org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation
.java:171)"
      ,"org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)"
      ,"$Proxy36.getRules(Unknown Source)"
      ,"org.alfresco.repo.web.scripts.rule.RulesGet.executeImpl(RulesGet.java:154)"
      ,"org.alfresco.web.scripts.DeclarativeWebScript.executeImpl(DeclarativeWebScript.java:223)"
      ,"org.alfresco.web.scripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:70)"
      ,"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.web.scripts.WebScriptException: 07040022 Wrapped Exception (with status template
): nodeRef is a mandatory parameter"
      ,"org.alfresco.web.scripts.AbstractWebScript.createStatusException(AbstractWebScript.java:613)
"

  ],
 
  "server" : "Alfresco Community v3.2.0 (2039) schema 2,019",
  "time" : "Aug 4, 2009 1:10:26 PM"
}


Could you please tell me what api should I use or change in order to get the rules from a space ?

Thanks in advance,
Andrei

Outcomes