Updating existing hippo document via REST API

903 views
Skip to first unread message

schi...@gmail.com

unread,
Jun 27, 2014, 3:35:58 PM6/27/14
to hippo-c...@googlegroups.com
Hi guys!
So i have a REST API that creates/updates a hippo document. The create part works fine, however i cannot update those doc via the API. They look fine in the CMS, all the ctreted by published by fields reference the sitewriter user. From the CMS these docs can be updated, but not from the API. It's like the API create + publish leaves some kind of lock or doesn't complete.

here's the code:
persistenceManager = (WorkflowPersistenceManager)
this.getPersistenceManager(hstContext);
           
                persistenceManager.setWorkflowCallbackHandler(
                        new BaseWorkflowCallbackHandler<DocumentWorkflow>() {
                            public void processWorkflow( DocumentWorkflow wf) throws Exception {
                                wf.publish();
                               
                            }
                });
           
            Article article = (Article) persistenceManager.getObject(fullPath + "/" + articleBinder.getUrlTitle());         
            if (article == null) {
                final String newNodePath = persistenceManager.createAndReturn(fullPath, "myhippoproject:article", articleBinder.getUrlTitle(), false);
                article = (Article) persistenceManager.getObject(newNodePath);           
            }
            persistenceManager.update(article.getCanonicalBean(),articleBinder);


An exception gets thrown from deep within the persistanceManager:

"org.hippoecm.hst.content.beans.manager.workflow.WorkflowPersistenceManagerImpl.update(WorkflowPersistenceManagerImpl.java:440)
<br/>sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
<br/>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
<br/>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
<br/>java.lang.reflect.Method.invoke(Method.java:601)
<br/>org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
<br/>org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
<br/>org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
<br/>org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:155)
<br/>org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
....


If i go into the cms, and edit/republish the article, The API can edit it successfully (for the first time) and then it locks itself out again

Help?
Thanks!

Martijn Hodenpijl

unread,
Jun 29, 2014, 1:40:39 AM6/29/14
to hippo-community


--
Hippo Community Group: The place for all discussions and announcements about Hippo CMS (and HST, repository etc. etc.)
 
To post to this group, send email to hippo-c...@googlegroups.com
RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
---
You received this message because you are subscribed to the Google Groups "Hippo Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hippo-communi...@googlegroups.com.
Visit this group at http://groups.google.com/group/hippo-community.
For more options, visit https://groups.google.com/d/optout.



--
Met vriendelijke groet,

Martijn Gijsberti Hodenpijl
Hippo Solution Architect

m.hod...@onehippo.com

--
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
Boston - 101 Main Street, Cambridge, MA 02142

US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466
www.onehippo.com

Jeroen Reijn

unread,
Jun 30, 2014, 5:00:17 AM6/30/14
to hippo-c...@googlegroups.com
Hi,

it would really help us if you post the actual exception itself as well. 
The piece of the stacktrace you posted only contains from which line it got thrown.

Oh and maybe the version number of the CMS (7.7/7.8/7.9)

Cheers,

Jeroen


--
Hippo Community Group: The place for all discussions and announcements about Hippo CMS (and HST, repository etc. etc.)
 
To post to this group, send email to hippo-c...@googlegroups.com
RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
---
You received this message because you are subscribed to the Google Groups "Hippo Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hippo-communi...@googlegroups.com.
Visit this group at http://groups.google.com/group/hippo-community.
For more options, visit https://groups.google.com/d/optout.



--
Jeroen Reijn
Hippo


Amsterdam - Oosteinde 11, 1017 WT Amsterdam
Boston - 101 Main Street, Cambridge, MA 02142

US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466
www.onehippo.com

schi...@gmail.com

unread,
Jun 30, 2014, 10:00:18 AM6/30/14
to hippo-c...@googlegroups.com, schi...@gmail.com
Hi, thank you for your replies.

Martijn - i have pemissons set up as per documentation. Sitewriters have edit on hippodoc, versioning, and hipporequests, and readwrite on form data and hippo folders.
The documents in question were oririginally created by the sitewriter user via the api. The create and return method makes the doc for which publishing succedes. The propblem is editing those doc via subsequent API calls.
My guess is that the code should obtain an editable instance somehow - rather than just calling 'get document' if the document exists already. Unfortunatelly all hippo examples only deal with creating a new doc, not editing an existing one, so i haven't found a way to do it.

Like i mentioned before - the funny thing is - if i 'touch' (edit,save,publish) the same doc form the CMS - the api can edit it fine. It's just that consequtive edits by the api leaves the doc in some kind of locked state - so the api can't edit it again, until a proper workflow go-around from via the CMS unlocks it.

Jeroen: please see the full stack trace and some encompassing logs bellow.

Thank you all for your help!

2014-06-30 09:41:35,171 [INFO] com.publishing.cms.spring.service.HippoPublicationEventListener - ########################### Got an Event ###########################
2014-06-30 09:41:35,172 [INFO] com.publishing.cms.spring.service.HippoPublicationEventListener - got event: workflow
2014-06-30 09:41:35,173 [INFO] com.publishing.cms.spring.service.HippoPublicationEventListener - Got workFlow method name of obtainEditableInstance
2014-06-30 09:41:35,173 [INFO] com.publishing.cms.spring.service.HippoPublicationEventListener - we got an unhandled method obtainEditableInstance
2014-06-30 09:41:35,173 [INFO] com.publishing.cms.spring.service.HippoPublicationEventListener - ####################################################################
2014-06-30 09:41:35,308 [ERROR] org.onehippo.repository.scxml.SCXMLWorkflowExecutor - Cannot invoke workflow documentworkflow action publish: action not allowed or undefined
org.hippoecm.repository.api.WorkflowException: Cannot invoke workflow documentworkflow action publish: action not allowed or undefined
    at org.onehippo.repository.scxml.SCXMLWorkflowExecutor.triggerAction(SCXMLWorkflowExecutor.java:199)
    at org.onehippo.repository.scxml.SCXMLWorkflowExecutor.triggerAction(SCXMLWorkflowExecutor.java:172)
    at org.onehippo.repository.documentworkflow.DocumentWorkflowImpl.publish(DocumentWorkflowImpl.java:228)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.hippoecm.repository.impl.WorkflowManagerImpl$WorkflowInvocationHandler.invoke(WorkflowManagerImpl.java:370)
    at $Proxy326.publish(Unknown Source)
    at com.publishing.service.hst.repositories.ArticleRepositoryImpl$1.processWorkflow(ArticleRepositoryImpl.java:69)
    at com.publishing.service.hst.repositories.ArticleRepositoryImpl$1.processWorkflow(ArticleRepositoryImpl.java:1)
    at org.hippoecm.hst.content.beans.manager.workflow.WorkflowPersistenceManagerImpl.update(WorkflowPersistenceManagerImpl.java:417)
    at com.condenast.style.service.hst.repositories.ArticleRepositoryImpl.save(ArticleRepositoryImpl.java:80)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
    at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:155)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    at $Proxy255.save(Unknown Source)
    at com.publishing.service.hst.services.CreationServiceImpl.saveArticle(CreationServiceImpl.java:55)
    at com.publishing.site.hst.endpoints.CreationControllerImpl.createArticle(CreationControllerImpl.java:41)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
    at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:55)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    at $Proxy257.createArticle(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180)
    at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)
    at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:165)
    at org.hippoecm.hst.jaxrs.cxf.AroundProcessableJAXRSInvoker.invoke(AroundProcessableJAXRSInvoker.java:94)
    at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:89)
    at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:57)
    at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:93)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
    at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
    at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:237)
    at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:239)
    at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:213)
    at org.hippoecm.hst.jaxrs.cxf.CXFJaxrsService.invoke(CXFJaxrsService.java:147)
    at org.hippoecm.hst.core.container.JaxrsRestServiceValve.invoke(JaxrsRestServiceValve.java:38)
    at org.hippoecm.hst.core.container.HstSitePipeline$Invocation.invokeNext(HstSitePipeline.java:271)
    at org.hippoecm.hst.core.container.GenericResponseHeadersValve.invoke(GenericResponseHeadersValve.java:83)
    at org.hippoecm.hst.core.container.HstSitePipeline$Invocation.invokeNext(HstSitePipeline.java:271)
    at org.hippoecm.hst.core.container.SubjectBasedSessionValve.invoke(SubjectBasedSessionValve.java:58)
    at org.hippoecm.hst.core.container.HstSitePipeline$Invocation.invokeNext(HstSitePipeline.java:271)
    at org.hippoecm.hst.core.container.SecurityValve.invoke(SecurityValve.java:158)
    at org.hippoecm.hst.core.container.HstSitePipeline$Invocation.invokeNext(HstSitePipeline.java:271)
    at org.hippoecm.hst.core.container.CmsSecurityValve.invoke(CmsSecurityValve.java:79)
    at org.hippoecm.hst.core.container.HstSitePipeline$Invocation.invokeNext(HstSitePipeline.java:271)
    at org.hippoecm.hst.core.container.InitializationValve.invoke(InitializationValve.java:72)
    at org.hippoecm.hst.core.container.HstSitePipeline$Invocation.invokeNext(HstSitePipeline.java:271)
    at org.hippoecm.hst.core.container.HstSitePipeline.invokeValves(HstSitePipeline.java:170)
    at org.hippoecm.hst.core.container.HstSitePipeline.invoke(HstSitePipeline.java:153)
    at org.hippoecm.hst.core.container.HstRequestProcessorImpl.processRequest(HstRequestProcessorImpl.java:79)
    at org.hippoecm.hst.container.HstFilter.processResolvedSiteMapItem(HstFilter.java:829)
    at org.hippoecm.hst.container.HstFilter.doFilter(HstFilter.java:464)
    at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:89)
    at org.hippoecm.hst.container.XSSUrlFilter.doFilter(XSSUrlFilter.java:49)
    at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:89)
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:89)
    at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:156)
    at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:289)
    at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:838)
    at com.caucho.network.listen.TcpSocketLink.dispatchRequest(TcpSocketLink.java:1346)
    at com.caucho.network.listen.TcpSocketLink.handleRequest(TcpSocketLink.java:1302)
    at com.caucho.network.listen.TcpSocketLink.handleRequestsImpl(TcpSocketLink.java:1286)
    at com.caucho.network.listen.TcpSocketLink.handleRequests(TcpSocketLink.java:1194)
    at com.caucho.network.listen.TcpSocketLink.handleAcceptTaskImpl(TcpSocketLink.java:993)
    at com.caucho.network.listen.ConnectionTask.runThread(ConnectionTask.java:117)
    at com.caucho.network.listen.ConnectionTask.run(ConnectionTask.java:93)
    at com.caucho.network.listen.SocketLinkThreadLauncher.handleTasks(SocketLinkThreadLauncher.java:169)
    at com.caucho.network.listen.TcpSocketAcceptThread.run(TcpSocketAcceptThread.java:61)
    at com.caucho.env.thread2.ResinThread2.runTasks(ResinThread2.java:173)
    at com.caucho.env.thread2.ResinThread2.run(ResinThread2.java:118)
2014-06-30 09:41:35,325 [INFO] com.condenast.style.cms.spring.service.HippoPublicationEventListener - ########################### Got an Event ###########################
2014-06-30 09:41:35,352 [INFO] com.publishing.cms.spring.service.HippoPublicationEventListener - got event: workflow
2014-06-30 09:41:35,353 [INFO] com.publishing.cms.spring.service.HippoPublicationEventListener - Got workFlow method name of commitEditableInstance
2014-06-30 09:41:35,354 [INFO] com.publishing.cms.spring.service.HippoPublicationEventListener - we got an unhandled method commitEditableInstance
2014-06-30 09:41:35,405 [INFO] com.publishing.cms.spring.service.HippoPublicationEventListener - ####################################################################
2014-06-30 09:41:35,354 [WARN] org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper - javax.ws.rs.WebApplicationException
    at com.condenast.style.site.utils.ExceptionAspect.convertHSTToWebApplicationException(ExceptionAspect.java:31)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
    at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:603)
    at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:59)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    at $Proxy257.createArticle(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180)
    at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)
    at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:165)
    at org.hippoecm.hst.jaxrs.cxf.AroundProcessableJAXRSInvoker.invoke(AroundProcessableJAXRSInvoker.java:94)
    at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:89)
    at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:57)
    at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:93)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
    at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
    at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:237)
    at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:239)
    at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:213)
    at org.hippoecm.hst.jaxrs.cxf.CXFJaxrsService.invoke(CXFJaxrsService.java:147)
    at org.hippoecm.hst.core.container.JaxrsRestServiceValve.invoke(JaxrsRestServiceValve.java:38)
    at org.hippoecm.hst.core.container.HstSitePipeline$Invocation.invokeNext(HstSitePipeline.java:271)
    at org.hippoecm.hst.core.container.GenericResponseHeadersValve.invoke(GenericResponseHeadersValve.java:83)
    at org.hippoecm.hst.core.container.HstSitePipeline$Invocation.invokeNext(HstSitePipeline.java:271)
    at org.hippoecm.hst.core.container.SubjectBasedSessionValve.invoke(SubjectBasedSessionValve.java:58)
    at org.hippoecm.hst.core.container.HstSitePipeline$Invocation.invokeNext(HstSitePipeline.java:271)
    at org.hippoecm.hst.core.container.SecurityValve.invoke(SecurityValve.java:158)
    at org.hippoecm.hst.core.container.HstSitePipeline$Invocation.invokeNext(HstSitePipeline.java:271)
    at org.hippoecm.hst.core.container.CmsSecurityValve.invoke(CmsSecurityValve.java:79)
    at org.hippoecm.hst.core.container.HstSitePipeline$Invocation.invokeNext(HstSitePipeline.java:271)
    at org.hippoecm.hst.core.container.InitializationValve.invoke(InitializationValve.java:72)
    at org.hippoecm.hst.core.container.HstSitePipeline$Invocation.invokeNext(HstSitePipeline.java:271)
    at org.hippoecm.hst.core.container.HstSitePipeline.invokeValves(HstSitePipeline.java:170)
    at org.hippoecm.hst.core.container.HstSitePipeline.invoke(HstSitePipeline.java:153)
    at org.hippoecm.hst.core.container.HstRequestProcessorImpl.processRequest(HstRequestProcessorImpl.java:79)
    at org.hippoecm.hst.container.HstFilter.processResolvedSiteMapItem(HstFilter.java:829)
    at org.hippoecm.hst.container.HstFilter.doFilter(HstFilter.java:464)
    at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:89)
    at org.hippoecm.hst.container.XSSUrlFilter.doFilter(XSSUrlFilter.java:49)
    at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:89)
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:89)
    at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:156)
    at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:289)
    at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:838)
    at com.caucho.network.listen.TcpSocketLink.dispatchRequest(TcpSocketLink.java:1346)
    at com.caucho.network.listen.TcpSocketLink.handleRequest(TcpSocketLink.java:1302)
    at com.caucho.network.listen.TcpSocketLink.handleRequestsImpl(TcpSocketLink.java:1286)
    at com.caucho.network.listen.TcpSocketLink.handleRequests(TcpSocketLink.java:1194)
    at com.caucho.network.listen.TcpSocketLink.handleAcceptTaskImpl(TcpSocketLink.java:993)
    at com.caucho.network.listen.ConnectionTask.runThread(ConnectionTask.java:117)
    at com.caucho.network.listen.ConnectionTask.run(ConnectionTask.java:93)
    at com.caucho.network.listen.SocketLinkThreadLauncher.handleTasks(SocketLinkThreadLauncher.java:169)
    at com.caucho.network.listen.TcpSocketAcceptThread.run(TcpSocketAcceptThread.java:61)
    at com.caucho.env.thread2.ResinThread2.runTasks(ResinThread2.java:173)
    at com.caucho.env.thread2.ResinThread2.run(ResinThread2.java:118)

2014-06-30 09:41:35,485 [INFO] com.condenast.style.cms.spring.service.HippoPublicationEventListener - ########################### Got an Event ###########################
2014-06-30 09:41:35,485 [INFO] com.publishing.cms.spring.service.HippoPublicationEventListener - got event: workflow
2014-06-30 09:41:35,485 [INFO] com.publishing.cms.spring.service.HippoPublicationEventListener - Got workFlow method name of publish
2014-06-30 09:41:35,486 [INFO] com.publishing.cms.spring.service.HippoPublicationEventListener - Handeling publish event
2014-06-30 09:41:35,486 [INFO] com.publishing.cms.spring.service.HippoPublicationEventListener - Document /content/documents/myhippoproject/main/articles/beauty/hair/summer-ponytail-ideas-tom was published
2014-06-30 09:41:43,204 [INFO] com.publishing.service.services.PostPublishServiceImpl - Persisting publish event: PostPublishQueue[id=<null>,publishStatus=RECEIVED,eventType=PUBLISH,canonicalURI=/content/documents/myhippoproject/main/articles/beauty/hair/summer-ponytail-ideas-tom,publishDate=Mon Jun 30 09:41:43 EDT 2014,documentType=article,eventDates=AuditInfoVO[modifiedDate=Mon Jun 30 09:41:43 EDT 2014,createdDate=Mon Jun 30 09:41:43 EDT 2014]]
2014-06-30 09:41:43,328 [INFO] com.publishing.cms.spring.service.HippoPublicationEventListener - ####################################################################
2014-06-30 09:41:58,525 [WARN] com.publishing.site.hst.endpoints.ArticleControllerV1Impl - beauty/hair/summer-ponytail-ideas-tom

2014-06-30 09:41:35,171 [INFO] com.publishing.cms.spring.service.HippoPublicationEventListener - ########################### Got an Event ###########################
2014-06-30 09:41:35,172 [INFO] com.publishing.cms.spring.service.HippoPublicationEventListener - got event: workflow
2014-06-30 09:41:35,173 [INFO] com.publishing.cms.spring.service.HippoPublicationEventListener - Got workFlow method name of obtainEditableInstance
2014-06-30 09:41:35,173 [INFO] com.publishing.cms.spring.service.HippoPublicationEventListener - we got an unhandled method obtainEditableInstance
2014-06-30 09:41:35,173 [INFO] com.publishing.cms.spring.service.HippoPublicationEventListener - ####################################################################
2014-06-30 09:41:35,308 [ERROR] org.onehippo.repository.scxml.SCXMLWorkflowExecutor - Cannot invoke workflow documentworkflow action publish: action not allowed or undefined
org.hippoecm.repository.api.WorkflowException: Cannot invoke workflow documentworkflow action publish: action not allowed or undefined
    at org.onehippo.repository.scxml.SCXMLWorkflowExecutor.triggerAction(SCXMLWorkflowExecutor.java:199)
    at org.onehippo.repository.scxml.SCXMLWorkflowExecutor.triggerAction(SCXMLWorkflowExecutor.java:172)
    at org.onehippo.repository.documentworkflow.DocumentWorkflowImpl.publish(DocumentWorkflowImpl.java:228)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.hippoecm.repository.impl.WorkflowManagerImpl$WorkflowInvocationHandler.invoke(WorkflowManagerImpl.java:370)
    at $Proxy326.publish(Unknown Source)
^[[B

schi...@gmail.com

unread,
Jul 1, 2014, 9:47:13 PM7/1/14
to hippo-c...@googlegroups.com, schi...@gmail.com
by the way  - this is on cms7

sorry nudge you again, but this is forum is my last hope - i've googled all i can on the issue. all examples out there are for creating nodes/doucuments not updating them

thanks!


On Friday, June 27, 2014 3:35:58 PM UTC-4, schi...@gmail.com wrote:

Martijn Hodenpijl

unread,
Jul 2, 2014, 2:39:47 AM7/2/14
to hippo-community, schi...@gmail.com
Hi,

What exact version you are using ? 7.7, 7.8 or 7.9 ?

> org.onehippo.repository.scxml.SCXMLWorkflowExecutor - Cannot invoke workflow documentworkflow action publish: action not allowed or undefined
I guess you are using 7.9 with the new workflow module...


Thanks,
Martijn


--
Hippo Community Group: The place for all discussions and announcements about Hippo CMS (and HST, repository etc. etc.)
 
To post to this group, send email to hippo-c...@googlegroups.com
RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
---
You received this message because you are subscribed to the Google Groups "Hippo Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hippo-communi...@googlegroups.com.
Visit this group at http://groups.google.com/group/hippo-community.
For more options, visit https://groups.google.com/d/optout.



--
Met vriendelijke groet,

Martijn Gijsberti Hodenpijl
Hippo Solution Architect

m.hod...@onehippo.com

--

Jeroen Reijn

unread,
Jul 2, 2014, 3:47:21 AM7/2/14
to hippo-c...@googlegroups.com
Hi,

and sorry for my late reply.

It seems you are using 7.9 if I look at the stacktrace. I don't see anything obvious from you code snippet so far.


What I kind figure out is if you call publish before for instance doing an update. In Hippo a document can only be published in case something has changed about the document (which sort of explains your problem I guess, but I'm not sure if that is actually the case.

Maybe the example gives you some more hints.
Jeroen Reijn
Hippo


Amsterdam - Oosteinde 11, 1017 WT Amsterdam
Boston - 101 Main Street, Cambridge, MA 02142

US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466
www.onehippo.com

schi...@gmail.com

unread,
Jul 3, 2014, 3:11:39 PM7/3/14
to hippo-c...@googlegroups.com, schi...@gmail.com
Hi guys, thank you both for your replies. I got it working:

Our cms in indeed 7.9, so i read further into the DocumentWorkflow which it now uses.

the hints() function as very helpful.

The exceptions were indeed only being thrown when the document data posted in doesn't change any values. But since it will be too costly/im to lazy to check whether each field is beeing changed in my ContentNodeBinder implementation, i changed my call back handler to this, and now it doesn't complain:


persistenceManager.setWorkflowCallbackHandler(
                        new BaseWorkflowCallbackHandler<DocumentWorkflow>() {
                            public void processWorkflow( DocumentWorkflow wf) throws Exception {
                                boolean publish = false;
                                 for (java.util.Map.Entry<String, Serializable> hint: wf.hints().entrySet()){
                                    if ("publish".equals(hint.getKey()) && Boolean.valueOf(hint.getValue().toString())){
                                        publish = true;
                                    }
                                }
                                if (publish) {
                                    wf.publish();
                                }
                            }
                });


thanks again for your help.

btw, it's weird that in the CMS web interface i can save and publish without changing any fields...


On Friday, June 27, 2014 3:35:58 PM UTC-4, schi...@gmail.com wrote:

Jeroen Reijn

unread,
Jul 3, 2014, 4:27:56 PM7/3/14
to hippo-c...@googlegroups.com, schi...@gmail.com


Op donderdag 3 juli 2014 heeft <schi...@gmail.com> het volgende geschreven:
Hi guys, thank you both for your replies. I got it working:

Our cms in indeed 7.9, so i read further into the DocumentWorkflow which it now uses.

the hints() function as very helpful.

The exceptions were indeed only being thrown when the document data posted in doesn't change any values. But since it will be too costly/im to lazy to check whether each field is beeing changed in my ContentNodeBinder implementation, i changed my call back handler to this, and now it doesn't complain:

persistenceManager.setWorkflowCallbackHandler(
                        new BaseWorkflowCallbackHandler<DocumentWorkflow>() {
                            public void processWorkflow( DocumentWorkflow wf) throws Exception {
                                boolean publish = false;
                                 for (java.util.Map.Entry<String, Serializable> hint: wf.hints().entrySet()){
                                    if ("publish".equals(hint.getKey()) && Boolean.valueOf(hint.getValue().toString())){
                                        publish = true;
                                    }
                                }
                                if (publish) {
                                    wf.publish();
                                }
                            }
                });


thanks again for your help.

btw, it's weird that in the CMS web interface i can save and publish without changing any fields...

I'm happy it works now and I can understand the confusion, but the underlying mechanism in this particular case is that if you edit a document in the CMS the state of the document will change. First it will create/update the draft version with things like last modified and when you save it, it will update the unpublished version of the document with that same information.

I still do wonder though if your bean implements the ContentNodeBinder interface or that you've created a custom ContentBinder. If you always return 'true' from the bind method an 'edit' & and 'save and close' action should happen in the background just as through the CMS interface.

--
Reply all
Reply to author
Forward
0 new messages