2022-04-11 19:18:52 +00:00
|
|
|
accessing
|
2022-04-12 21:05:59 +00:00
|
|
|
getPagesContentsUpto: anInteger
|
2022-04-12 17:03:48 +00:00
|
|
|
"I retroactively get all pages contents until a specified page number.
|
|
|
|
|
|
|
|
TO DO: should this be splitted back to two methods, one getting the page urls and other its content?
|
|
|
|
or do we always be getting the cursor urls and its contents all the time.
|
|
|
|
[ ] Benchmark alternative approaches."
|
|
|
|
| response nextPageLink previousPageLink |
|
2022-04-11 19:18:52 +00:00
|
|
|
|
|
|
|
response := OrderedDictionary new.
|
|
|
|
response at: self userNameLink put: self documentTree.
|
|
|
|
previousPageLink := self userNameLink.
|
2022-04-12 21:05:59 +00:00
|
|
|
anInteger - 1 timesRepeat: [ | pageCursor |
|
|
|
|
pageCursor := self pageCursorFor:previousPageLink.
|
|
|
|
nextPageLink := self userNameLink, pageCursor keys first.
|
|
|
|
response at: nextPageLink put: pageCursor values first.
|
2022-04-11 19:18:52 +00:00
|
|
|
previousPageLink := nextPageLink
|
|
|
|
].
|
|
|
|
^ response
|