3 Replies Latest reply on Aug 13, 2015 1:10 AM by nsteinmetz

    Moving content with V3 Rest API / Jive 6.0.3.1 & 7.0.3.1

    nsteinmetz

      Hi,

       

      To permanently delete content from our Jive Instance, I try to identifiy content via the REST API and some DB Query.

       

      Idea is :

      1. Create "Trash community"

      2. Put Deletede content within

      3. Delete community

       

      So I"m running a python script to do this and when moving content, I got a 400 error but don't find why ; I read other topics about moving content but I didn't find the solution. I tried to change the value of what I put to the /contents/{contentID} endpoint but without success. The point is around the "doc_json" variable.

       

      Thanks

      Nicolas

       

      # -*- coding: utf-8 -*-
      from django.core.management.base import BaseCommand, CommandError
      from django.conf import settings
      from django.db import connections
      import requests, json, datetime
      
      class Command(BaseCommand):
      
          """
          Delete 'deleted' documents Permanently by :
              1. Creating a fake community
              2. Moving all deleted document in this community
              3. Dropping the community
          """
          help = "Permanently delete 'deleted' documents"
      
          def handle(self, **options):
      
      
              # Global bee API variables
      
              if settings.DEBUG == False:
      
                  proxies = {
                      "http": "http://***:8000",
                      "https": "http://***:8000" 
                  }
              else:
                  proxies = None
      
              auth=('admin', '***')
              headers = {'content-type': 'application/json'}
              content_endpoint = 'https://jive_url/api/core/v3/contents'
              community_endpoint = 'https://jive_url/api/core/v3/places'
      
              # Create target community
              community = {}
              community['type']="group"
              community["groupType"]="SECRET"
              community["name"]="trash-%s" % str(datetime.datetime.now()).replace(' ','-').replace(':','-').replace('.','-')
              community["displayName"]=community["name"]
      
              r = requests.post(community_endpoint, verify=False, data=json.dumps(community), headers=headers, auth= auth, proxies=proxies)
      
              if r.status_code == requests.codes.created:
      
                  resp = r.content.decode().replace('throw \'allowIllegalResourceCall is false.\';\n', '')
      
                  cty = json.loads(resp)
      
                  placeUrl = cty['resources']['self']['ref']
      
      
      
                  # Get deleted documents from database
      
                  cursor = connections['jive'].cursor()     
      
                  cursor.execute("select bodyid, TO_CHAR(TO_TIMESTAMP(creationdate / 1000), 'DD/MM/YYYY HH:MM:SS') \
      
                      from jivedocumentbody where bodyid in (select internaldocid from jivedocversion \
      
                      where state = 'deleted') and filesize is not null order by creationdate asc LIMIT 1;")
      
                  rows = cursor.fetchall()
      
      
      
                  for row in rows:
      
                      # 102 is content type descriptor for document
      
                      doc_uri = content_endpoint+"?filter=entityDescriptor(102,%d)" % (row[0])
      
      
      
                      r = requests.get(doc_uri, verify=False, auth=auth, proxies=proxies)
      
      
      
                      if r.status_code == requests.codes.ok:
      
                          # Remove the f*cking piece of data to get only JSON ; https://developers.jivesoftware.com/community/thread/2153
      
                          resp = r.content.decode().replace('throw \'allowIllegalResourceCall is false.\';\n', '')
      
                          doc_json = json.loads(resp)
      
      
      
                          # Check document has deleted status
      
                          if doc_json["list"][0]["status"] == "deleted":
      
                              self.stdout.write('Doc %d is to be deleted \n' % row[0])
      
                              doc_json['list'][0]['parent'] = placeUrl
      
                              doc_endpoint = doc_json['list'][0]['resources']['self']['ref']
      
                              r = requests.put(doc_endpoint, verify=False, data=json.dumps(doc_json), headers=headers, auth= auth, proxies=proxies)
      
                              if r.status_code == requests.codes.ok:
      
                                  self.stdout.write('Doc %d is moved to Trash community \n' % row[0])
      
                              else:
      
                                  self.stdout.write("Error when moving doc %d %d\n" % (row[0], r.status_code))
      
                          else:
      
                              self.stdout.write('%s - %s\n' % (doc_uri, doc_json["list"][0]["status"]))
      
                      else:
      
                          self.stdout.write('Error to retrive document to delete for doc %d with code %d' % (row[0], r.status_code))
      
              else:
      
                  self.stdout.write("Error when creating community %s %d\n" % (community["name"], r.status_code))
      
      
      
              self.stdout.write('End of deletion process\n')
      
      
        • Re: Moving content with V3 Rest API / Jive 6.0.3.1
          nsteinmetz

          Forgot to mention that my idea is just to update the "places" value to move the doc from one community or group to my "Trash" group.

          • Re: Moving content with V3 Rest API / Jive 6.0.3.1
            nsteinmetz

            Back on this :

             

            When I do a PUT request to : https://jive_url/api/core/v3/contents/15499

            with :

            {

                "parent": "https://jive_url/api/core/v3/places/47503",

                "content": {

                    "type": "text/html",

                    "text": "<body><!-- [DocumentBodyStart:7da9d4f9-ea45-4dd4-8d7e-47f260b5c89e] --><div class=\"jive-rendered-content\"><p>numbre</p></div><!-- [DocumentBodyEnd:7da9d4f9-ea45-4dd4-8d7e-47f260b5c89e] --></body>"

                },

                "author": {

                    "name": {

                        "givenName": "Nicolas",

                        "familyName": "Steinmetz",

                        "formatted": "Nicolas Steinmetz"

                    },

                    "type": "person",

                    "displayName": "Nicolas Steinmetz",

                    "jive": {

                        "level": {

                            "name": "Master",

                            "description": "Master",

                            "points": 5992

                        },

                        "username": "nicolas.steinmetz@mycompany.tld"

                    }

                },

                "subject": "we are counting"

            }

             

            I got a 503 System Error from Jive

             

            Looking at the logs, I have a duplicate key issue on the "version" - so why when doing it manually via the UI it remains to version 1 and can be move without any issue and when using the API it tries to update the version ?.

            10:51:26,245 [http-127.0.0.1-9001-1] ERROR org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/].[CXFServlet] - Servlet.service() for servlet CXFServlet threw exception

            java.lang.RuntimeException: org.apache.cxf.interceptor.Fault: Document 1071 could not be updated in the database.

                    at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:102)

                    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:294)

                    at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:111)

                    at org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:99)

                    at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:428)

                    at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:144)

                    at org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:148)

                    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:179)

                    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPut(AbstractHTTPServlet.java:120)

                    at javax.servlet.http.HttpServlet.service(HttpServlet.java:640)

                    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:159)

                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                    at com.jivesoftware.community.web.struts.JiveFilterDispatcher.doFilter(JiveFilterDispatcher.java:87)

                    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)

                    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)

                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                    at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:39)

                    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)

                    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)

                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                    at org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:99)

                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                    at com.jivesoftware.community.web.filter.ActivityRequestFilter.doFilter(ActivityRequestFilter.java:100)

                    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)

                    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)

                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                    at org.directwebremoting.servlet.DwrWebContextFilter.doFilter(DwrWebContextFilter.java:91)

                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                    at com.jivesoftware.base.plugin.PluginFilter.doFilter(PluginFilter.java:73)

                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                    at com.jivesoftware.community.robots.RobotDetectorFilter.doFilterInternal(RobotDetectorFilter.java:62)

                    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)

                    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)

                    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)

                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                    at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:83)

                    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)

                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                    at com.jivesoftware.community.aaa.UserResponseHeaderFilter.doFilter(UserResponseHeaderFilter.java:45)

                    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)

                    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)

                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:368)

                    at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:163)

                    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                    at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:169)

                    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)

                    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)

                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                    at com.jivesoftware.base.profiling.http.RequestProfilingFilter.doFilter(RequestProfilingFilter.java:47)

                    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)

                    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)

                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                    at com.jivesoftware.community.web.filter.P3PCompactPolicyFilter.doFilter(P3PCompactPolicyFilter.java:48)

                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                    at com.jivesoftware.community.web.filter.RemoveJsessionIdFilter.doFilter(RemoveJsessionIdFilter.java:40)

                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                    at com.jivesoftware.community.web.filter.ApplicationStateFilter.doFilter(ApplicationStateFilter.java:157)

                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:368)

                    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:368)

                    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:368)

                    at com.jivesoftware.mobile.filters.APIContentTypeFilter.doFilter(APIContentTypeFilter.java:48)

                    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                    at com.jivesoftware.mobile.filters.JCAPITokenFilter.doFilter(JCAPITokenFilter.java:50)

                    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                    at com.jivesoftware.mobile.redirector.RedirectFilter.doFilter(RedirectFilter.java:140)

                    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                    at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:169)

                    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                    at com.jivesoftware.api.core.v2.filters.AllowGuestAccessFilter.doFilter(AllowGuestAccessFilter.java:62)

                    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                    at com.jivesoftware.api.audit.RequestResponseAuditServletFilter.doFilter(RequestResponseAuditServletFilter.java:63)

                    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                    at com.jivesoftware.api.common.filters.ApiExceptionTranslatorFilter.doFilter(ApiExceptionTranslatorFilter.java:49)

                    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                    at com.jivesoftware.community.aaa.JiveRememberMeAuthenticationFilter.doFilter(JiveRememberMeAuthenticationFilter.java:79)

                    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                    at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:169)

                    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                    at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:187)

                    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:368)

                    at com.jivesoftware.community.aaa.JiveBasicAuthenticationFilter.doFilter(JiveBasicAuthenticationFilter.java:37)

                    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:368)

                    at com.jivesoftware.community.oauth.filter.OAuth2PasscodeRequiredFilter.doFilter(OAuth2PasscodeRequiredFilter.java:60)

                    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                    at com.jivesoftware.community.oauth.spring.JiveOAuth2ProtectedResourceFilter.doFilter(JiveOAuth2ProtectedResourceFilter.java:43)

                    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                    at org.springframework.security.oauth2.provider.OAuth2ExceptionHandlerFilter.doFilter(OAuth2ExceptionHandlerFilter.java:36)

                    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                    at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:169)

                    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                    at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:163)

                    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                    at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)

                    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                    at com.jivesoftware.api.core.filters.CoreApiContextFilter.doFilter(CoreApiContextFilter.java:54)

                    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                    at com.jivesoftware.community.webservices.server.RequireSSLFilter.doFilter(RequireSSLFilter.java:53)

                    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                    at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:163)

                    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                    at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:169)

                    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

                    at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:169)

                    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)

                    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)

                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                    at com.jivesoftware.community.web.filter.AbstractApplicationStateFilter.doFilter(AbstractApplicationStateFilter.java:61)

                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                    at com.jivesoftware.community.web.filter.XFrameOptionsFilter.doFilter(XFrameOptionsFilter.java:50)

                    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)

                    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)

                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                    at com.jivesoftware.community.web.filter.ResourceRoutingFilter.doFilter(ResourceRoutingFilter.java:44)

                    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)

                    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)

                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                    at com.jivesoftware.base.profiling.http.ServerLatencyFilter.doFilter(ServerLatencyFilter.java:62)

                    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)

                    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)

                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                    at com.jivesoftware.community.web.filter.SetRequestCharacterEncodingFilter.doFilter(SetRequestCharacterEncodingFilter.java:76)

                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

                    at com.jivesoftware.community.web.filter.DispatchContextResetFilter.doFilter(DispatchContextResetFilter.java:39)

                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

                    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.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:470)

                    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

                    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)

                    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

                    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)

                    at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:879)

                    at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:600)

                    at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1703)

                    at java.lang.Thread.run(Thread.java:662)

            Caused by: org.apache.cxf.interceptor.Fault: Document 1071 could not be updated in the database.

                    at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:155)

                    at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:121)

                    at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:133)

                    at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:82)

                    at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)

                    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)

                    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

                    at java.util.concurrent.FutureTask.run(FutureTask.java:138)

                    at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)

                    at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)

                    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)

                    ... 159 more

            Caused by: com.jivesoftware.base.database.dao.DAOException: Document 1071 could not be updated in the database.

                    at com.jivesoftware.community.impl.dao.DbDocumentDAO.update(DbDocumentDAO.java:575)

                    at com.jivesoftware.community.impl.DbDocument.save(DbDocument.java:537)

                    at com.jivesoftware.community.proxy.DocumentProxy.save(DocumentProxy.java:211)

                    at com.jivesoftware.api.core.v3.providers.content.AbstractDocumentProvider.save(AbstractDocumentProvider.java:172)

                    at com.jivesoftware.api.core.v3.providers.content.AbstractDocumentProvider.save(AbstractDocumentProvider.java:1)

                    at com.jivesoftware.api.core.v3.providers.content.AbstractContentProvider.updateContent(AbstractContentProvider.java:140)

                    at com.jivesoftware.api.core.v3.providers.content.CollaborativeContentProvider.updateContent(CollaborativeContentProvider.java:75)

                    at com.jivesoftware.api.core.v3.services.content.ContentService.updateContent(ContentService.java:769)

                    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.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:173)

                    at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:89)

                    ... 168 more

            Caused by: org.springframework.dao.DuplicateKeyException: PreparedStatementCallback; SQL [INSERT INTO jiveDocVersion (internalDocID, versionID, state, userID, creationDate, modificationDate, language, title, summary, minorVersion, status, recordID) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; ERROR: duplicate key value violates unique constraint "jivedocversion_pk"

              Detail: Key (versionid, internaldocid)=(1, 1071) already exists.; nested exception is org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "jivedocversion_pk"

              Detail: Key (versionid, internaldocid)=(1, 1071) already exists.

                    at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:241)

                    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)

                    at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:602)

                    at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:811)

                    at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:867)

                    at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:875)

                    at org.springframework.jdbc.core.simple.SimpleJdbcTemplate.update(SimpleJdbcTemplate.java:249)

                    at com.jivesoftware.base.database.dao.JiveJdbcOperationsTemplate.update(JiveJdbcOperationsTemplate.java:188)

                    at com.jivesoftware.community.impl.dao.DbDocumentDAO.insertDocumentVersion(DbDocumentDAO.java:1537)

                    at com.jivesoftware.community.impl.dao.DbDocumentDAO.update(DbDocumentDAO.java:555)

                    ... 181 more

            Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "jivedocversion_pk"

              Detail: Key (versionid, internaldocid)=(1, 1071) already exists.

                    at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2157)

                    at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1886)

                    at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)

                    at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:555)

                    at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:417)

                    at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:363)

                    at sun.reflect.GeneratedMethodAccessor669.invoke(Unknown Source)

                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                    at java.lang.reflect.Method.invoke(Method.java:597)

                    at org.logicalcobwebs.proxool.ProxyStatement.invoke(ProxyStatement.java:100)

                    at org.logicalcobwebs.proxool.ProxyStatement.intercept(ProxyStatement.java:57)

                    at $java.sql.Statement$$EnhancerByProxool$$c6190725.executeUpdate(<generated>)

                    at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:817)

                    at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:1)

                    at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:586)

                    ... 188 more

             

            Or shoud I use another way to move a content ? But I don't see which one yet