Creating UI functionality for import page error handling.

This commit is contained in:
ruidajo 2022-10-07 17:34:04 -05:00
parent 9b65bac64e
commit 75e73933d9

View File

@ -61,6 +61,12 @@ LeDatabase >> docTreeForLink: aString [
^ (XMLHTMLParser on: aString asUrl retrieveContents) parseDocument ^ (XMLHTMLParser on: aString asUrl retrieveContents) parseDocument
] ]
{ #category : #'*MiniDocs' }
LeDatabase >> errors [
^ self optionAt: 'errors' ifAbsent: [ self optionAt: 'errors' put: Dictionary new ]
]
{ #category : #'*MiniDocs' } { #category : #'*MiniDocs' }
LeDatabase >> gtViewErrorDetailsOn: aView [ LeDatabase >> gtViewErrorDetailsOn: aView [
<gtView> <gtView>
@ -76,19 +82,21 @@ LeDatabase >> gtViewErrorDetailsOn: aView [
c horizontal matchParent ]; c horizontal matchParent ];
padding: (BlInsets all: 10). padding: (BlInsets all: 10).
container container
addChildren: (self errorCardFor: String loremIpsum) addChildren: (self errorCardFor: self errors associations first value)
"container addChild: self asCardElement "]. "container addChild: self asCardElement "].
] ]
{ #category : #'*MiniDocs' } { #category : #'*MiniDocs' }
LeDatabase >> importErrorMessage: page [ LeDatabase >> importErrorMessage: page [
^ String streamContents: [ :stream | | message id |
id := page uidString.
message := String streamContents: [ :stream |
stream stream
nextPutAll: 'IMPORTATION ERROR: a page with'; nextPutAll: 'IMPORTATION ERROR: a page with';
nextPut: Character lf; nextPut: Character lf;
nextPut: Character lf; nextPut: Character lf;
nextPutAll: ' id: ' , page uidString; nextPutAll: ' id: ' , id;
nextPut: Character lf; nextPut: Character lf;
nextPutAll: ' title: ' , page contentAsString; nextPutAll: ' title: ' , page contentAsString;
nextPut: Character lf; nextPut: Character lf;
@ -100,5 +108,12 @@ LeDatabase >> importErrorMessage: page [
'Please do one of those before retrying this procedure: 'Please do one of those before retrying this procedure:
1) Move the existing page files (.lepiter and .bak) to another (sub)folder. 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
] ]