From 75e73933d98dcfe7b3eefc01b72f9946194ede01 Mon Sep 17 00:00:00 2001 From: ruidajo Date: Fri, 7 Oct 2022 17:34:04 -0500 Subject: [PATCH] Creating UI functionality for import page error handling. --- src/MiniDocs/LeDatabase.extension.st | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/MiniDocs/LeDatabase.extension.st b/src/MiniDocs/LeDatabase.extension.st index e76e193..8d2d78b 100644 --- a/src/MiniDocs/LeDatabase.extension.st +++ b/src/MiniDocs/LeDatabase.extension.st @@ -61,6 +61,12 @@ LeDatabase >> docTreeForLink: aString [ ^ (XMLHTMLParser on: aString asUrl retrieveContents) parseDocument ] +{ #category : #'*MiniDocs' } +LeDatabase >> errors [ + + ^ self optionAt: 'errors' ifAbsent: [ self optionAt: 'errors' put: Dictionary new ] +] + { #category : #'*MiniDocs' } LeDatabase >> gtViewErrorDetailsOn: aView [ @@ -76,19 +82,21 @@ LeDatabase >> gtViewErrorDetailsOn: aView [ c horizontal matchParent ]; padding: (BlInsets all: 10). container - addChildren: (self errorCardFor: String loremIpsum) + addChildren: (self errorCardFor: self errors associations first value) "container addChild: self asCardElement "]. ] { #category : #'*MiniDocs' } LeDatabase >> importErrorMessage: page [ - ^ String streamContents: [ :stream | + | message id | + id := page uidString. + message := String streamContents: [ :stream | stream nextPutAll: 'IMPORTATION ERROR: a page with'; nextPut: Character lf; nextPut: Character lf; - nextPutAll: ' id: ' , page uidString; + nextPutAll: ' id: ' , id; nextPut: Character lf; nextPutAll: ' title: ' , page contentAsString; nextPut: Character lf; @@ -100,5 +108,12 @@ LeDatabase >> importErrorMessage: page [ 'Please do one of those before retrying this procedure: 1) Move the existing page files (.lepiter and .bak) to another (sub)folder. - 2) Import the page url to another database.' ] + 2) Import the page url to another database.' ]. + self errors at: id put: message +] + +{ #category : #'*MiniDocs' } +LeDatabase >> options [ + + ^ options ]