If I create a page via this method:
s.confluence2.storePage(token, apage)
...the page is created fine.
If I run the same method again, I get this error:
Traceback (most recent call last): File "pageinfo.py", line 51, in <module> s.confluence2.storePage(token, apage) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py", line 1224, in __call__ return self.__send(self.__name, args) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py", line 1575, in __request verbose=self.__verbose File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py", line 1264, in request return self.single_request(host, handler, request_body, verbose) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py", line 1297, in single_request return self.parse_response(response) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py", line 1473, in parse_response return u.close() File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py", line 793, in close raise Fault(**self._stack[0]) xmlrpclib.Fault: <Fault 0: 'java.lang.Exception: org.springframework.transaction.UnexpectedRollbackException: Transaction rolled back because it has been marked as rollback-only'>
If I do this method:
s.confluence2.updatePage(token, apage, {'versionComment': '', 'minorEdit': 1})
I get this error:
Traceback (most recent call last): File "pageinfo.py", line 52, in <module> s.confluence2.updatePage(token, apage, {'versionComment': '', 'minorEdit': 1}) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py", line 1224, in __call__ return self.__send(self.__name, args) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py", line 1575, in __request verbose=self.__verbose File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py", line 1264, in request return self.single_request(host, handler, request_body, verbose) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py", line 1297, in single_request return self.parse_response(response) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py", line 1473, in parse_response return u.close() File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xmlrpclib.py", line 793, in close raise Fault(**self._stack[0]) xmlrpclib.Fault: <Fault 0: "java.lang.Exception: com.atlassian.confluence.rpc.RemoteException: You're not allowed to view that page, or it does not exist.">
Community moderators have prevented the ability to post new answers.
It's difficult to know what's going wrong without seeing all your code. My first guess is that after you call "storePage" for the first time, the return value of this method is the updated page object. You need to call "updatePage" with that reference, otherwise the page ID of the page object is not set on the "apage" variable.
What I mean is, instead of writing this code:
apage = ##TODO: Set up the page you want to create here. s.confluence.storePage(token, apage) ## Now update the page s.confluence.updatePage(token, apage) ## WRONG. This will fail "apage" has no page ID.
Write this code:
apage = ##TODO: Set up the page you want to create here. apage = s.confluence.storePage(token, apage) ## RIGHT! Update the apage variable with the saved page. Now it has a page ID. ## Now update the page s.confluence.updatePage(token, apage) ## This will work
If I'm on the wrong track, please share your full code snippet so I can have a better understanding of your code.
apage = ##TODO: Set up the page you want to create here.
what value will be there. Please help
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Something like: apage = {"title":"New Page","content":"new content","space":"Space key"}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.