Moving methods to better owners for functionality encapsulation.
This commit is contained in:
parent
ce3b6a96a0
commit
576a408fb5
@ -160,3 +160,9 @@ GrafoscopioUtils class >> update [
|
|||||||
package: 'Grafoscopio-Utils';
|
package: 'Grafoscopio-Utils';
|
||||||
load.
|
load.
|
||||||
]
|
]
|
||||||
|
|
||||||
|
{ #category : #'*Grafoscopio-Utils-Core' }
|
||||||
|
GrafoscopioUtils class >> xmlFromUrl: aString [
|
||||||
|
|
||||||
|
^ (XMLHTMLParser on: aString asUrl retrieveContents) parseDocument
|
||||||
|
]
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
Extension { #name : #GrafoscopioUtils }
|
||||||
|
|
||||||
|
{ #category : #'*Grafoscopio-Utils-Core' }
|
||||||
|
GrafoscopioUtils class >> xmlFromUrl: aString [
|
||||||
|
|
||||||
|
^ (XMLHTMLParser on: aString asUrl retrieveContents) parseDocument
|
||||||
|
]
|
11
repository/Grafoscopio-Utils/LeDatabase.extension.st
Normal file
11
repository/Grafoscopio-Utils/LeDatabase.extension.st
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
Extension { #name : #LeDatabase }
|
||||||
|
|
||||||
|
{ #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 ].
|
||||||
|
]
|
@ -48,16 +48,6 @@ LePage >> fromMarkdeepUrl: aString [
|
|||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #'*Grafoscopio-Utils-Core' }
|
|
||||||
LePage >> isInDocumentsDatabase: markdeepDocUrl [
|
|
||||||
| markdeepHelper id remoteMetadata |
|
|
||||||
markdeepHelper := Markdeep new.
|
|
||||||
remoteMetadata := markdeepHelper metadataFromXML: (self xmlFromUrl: markdeepDocUrl).
|
|
||||||
id := remoteMetadata at: 'id' ifAbsent: [ ^ false ].
|
|
||||||
self database pagesByDateToShow
|
|
||||||
detect: [ :page | page uidString = id ] ifFound: [ ^ true ] ifNone: [ ^ false ].
|
|
||||||
]
|
|
||||||
|
|
||||||
{ #category : #'*Grafoscopio-Utils-Core' }
|
{ #category : #'*Grafoscopio-Utils-Core' }
|
||||||
LePage >> markdeepFileName [
|
LePage >> markdeepFileName [
|
||||||
| sanitized |
|
| sanitized |
|
||||||
@ -102,9 +92,3 @@ LePage >> preorderTraversal [
|
|||||||
self withDeepCollect: [:each | each allChildrenBreadthFirstDo: [:child | output add: child ] ].
|
self withDeepCollect: [:each | each allChildrenBreadthFirstDo: [:child | output add: child ] ].
|
||||||
^ output.
|
^ output.
|
||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #'*Grafoscopio-Utils-Core' }
|
|
||||||
LePage >> xmlFromUrl: aString [
|
|
||||||
|
|
||||||
^ (XMLHTMLParser on: aString asUrl retrieveContents) parseDocument
|
|
||||||
]
|
|
||||||
|
Loading…
Reference in New Issue
Block a user