@@ -52,9 +52,20 @@ def get_page_child_by_type(self, page_id, type='page', start=None, limit=None):
52
52
return None
53
53
54
54
def get_page_id (self , space , title ):
55
+ """
56
+ Provide content id from search result by title and space
57
+ :param space: SPACE key
58
+ :param title: title
59
+ :return:
60
+ """
55
61
return self .get_page_by_title (space , title ).get ('id' )
56
62
57
63
def get_page_space (self , page_id ):
64
+ """
65
+ Provide space key from content id
66
+ :param page_id: content ID
67
+ :return:
68
+ """
58
69
return self .get_page_by_id (page_id , expand = 'space' )['space' ]['key' ]
59
70
60
71
def get_page_by_title (self , space , title , start = None , limit = None ):
@@ -86,6 +97,12 @@ def get_page_by_title(self, space, title, start=None, limit=None):
86
97
return None
87
98
88
99
def get_page_by_id (self , page_id , expand = None ):
100
+ """
101
+ Get page by ID
102
+ :param page_id: Content ID
103
+ :param expand: OPTIONAL: expand e.g. history
104
+ :return:
105
+ """
89
106
url = 'rest/api/content/{page_id}?expand={expand}' .format (page_id = page_id , expand = expand )
90
107
return self .get (url )
91
108
@@ -281,6 +298,12 @@ def history(self, page_id):
281
298
return self .get ('rest/api/content/{0}/history' .format (page_id ))
282
299
283
300
def is_page_content_is_already_updated (self , page_id , body ):
301
+ """
302
+ Compare content and check is already updated or not
303
+ :param page_id: Content ID for retrieve storage value
304
+ :param body: Body for compare it
305
+ :return: True if the same
306
+ """
284
307
confluence_content = self .get_page_by_id (page_id , expand = 'body.storage' )['body' ]['storage' ]['value' ]
285
308
confluence_content = confluence_content .replace ('ó' , u'ó' )
286
309
0 commit comments