From 25575d5d647c3dbc65a0e0b02462e84ec6b30c5a Mon Sep 17 00:00:00 2001 From: Offray Date: Wed, 21 Sep 2022 13:58:31 -0500 Subject: [PATCH] Moving out to MiniDocs. --- .../Grafoscopio-Utils/LeDatabase.extension.st | 43 ------------------- 1 file changed, 43 deletions(-) delete mode 100644 repository/Grafoscopio-Utils/LeDatabase.extension.st diff --git a/repository/Grafoscopio-Utils/LeDatabase.extension.st b/repository/Grafoscopio-Utils/LeDatabase.extension.st deleted file mode 100644 index 0e6998a..0000000 --- a/repository/Grafoscopio-Utils/LeDatabase.extension.st +++ /dev/null @@ -1,43 +0,0 @@ -Extension { #name : #LeDatabase } - -{ #category : #'*Grafoscopio-Utils-Core' } -LeDatabase >> addPageFromMarkdeepUrl: aString [ - - | page | - page := self detectLocalPageForRemote: aString. - page ifNotNil: [ :arg | ^ self importErrorMessage: page ]. - self addPage: page. -] - -{ #category : #'*Grafoscopio-Utils-Core' } -LeDatabase >> detectLocalPageForRemote: markdeepDocUrl [ - | markdeepHelper id remoteMetadata docTree | - markdeepHelper := Markdeep new. - docTree := (XMLHTMLParser on: markdeepDocUrl asUrl retrieveContents) parseDocument. - remoteMetadata := markdeepHelper metadataFromXML: docTree. - id := remoteMetadata at: 'id' ifAbsent: [ ^ false ]. - ^ self pageWithID: id ifAbsent: [ nil ]. -] - -{ #category : #'*Grafoscopio-Utils-Core' } -LeDatabase >> importErrorMessage: page [ - - ^ String streamContents: [ :stream | - stream - nextPutAll: 'IMPORTATION ERROR: a page with'; - nextPut: Character lf; - nextPut: Character lf; - nextPutAll: ' id: ' , page uidString; - nextPut: Character lf; - nextPutAll: ' title: ' , page contentAsString; - nextPut: Character lf; - nextPut: Character lf; - nextPutAll: 'already exists in this database.'; - nextPut: Character lf; - nextPut: Character lf; - nextPutAll: - '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.' ] -]