Finishing Grafoscopio notebooks importation with fix for original creation/modification nil data in nodes.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2023-10-20 13:23:28 -05:00
parent a84ead51e1
commit 9361094bf6
3 changed files with 10 additions and 4 deletions

View File

@ -195,7 +195,7 @@ LeDatabase >> sanitizeMarkdeepSnippets: divSnippets withMetadata: remoteMetadata
snippetData := markdeepDiv asSnippetDictionary.
creationTime := snippetData at: 'created'.
modificationTime := snippetData at: 'modified'.
timestampWarning := [:timestamp | 'Modified timestamps: ', timestamp ,' date and time was replaced instead of nil value. See "origin" key for more traceability info.'].
timestampWarning := [:timestamp | 'Modified timestamps: ', timestamp ,' date and time was replaced instead of nil value. See "origin" metadata for more historical traceability information.'].
(creationTime = 'nil' and: [ modificationTime ~= 'nil' ])
ifTrue: [
snippetData redefineTimestampsBefore: modificationTime.

View File

@ -74,7 +74,11 @@ LeTextualSnippet >> metadataInit [
| surrogate |
self parent
ifNil: [ surrogate := nil]
ifNotNil: [ surrogate := self parent uidString ].
ifNotNil: [
self parent isString
ifTrue: [ surrogate := self parent]
ifFalse: [ surrogate := self parent uidString ]
].
^ OrderedDictionary new
at: 'id' put: self uidString;
at: 'parent' put: surrogate;

View File

@ -25,8 +25,10 @@ OrderedDictionary >> asLepiterSnippet [
createTime: (LeTime new time: ((self at: 'created')asDateAndTime));
editTime: (LeTime new time: ((self at: 'modified') asDateAndTime));
editEmail: (self at: 'modifier');
createEmail: (self at: 'creator').
^ response
createEmail: (self at: 'creator').
response metadata at: 'origin' ifPresent: [ response metadata at: 'origin' put: (self at: 'origin') ].
response metadata at: 'errata' ifPresent: [ response metadata at: 'errata' put: (self at: 'errata') ].
^ response
]
{ #category : #'*MiniDocs' }