Skip to content

Commit

Permalink
Issue #4: copy TDSessionDescription from tODE ... needed to create se…
Browse files Browse the repository at this point in the history
…ssion descriptions
  • Loading branch information
dalehenrich committed Jun 3, 2023
1 parent 895a50a commit 56e19e9
Show file tree
Hide file tree
Showing 76 changed files with 470 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rowan/components/Core.ston
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ RwSimpleProjectLoadComponentV2 {
#condition : 'common',
#projectNames : [ ],
#componentNames : [
'Tode',
'XDGB'
],
#packageNames : [
'GsDevKit_stones-Core'
],
#comment : ''
}
}
10 changes: 10 additions & 0 deletions rowan/components/Tode.ston
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
RwSimpleProjectLoadComponentV2 {
#name : 'Tode',
#condition : 'common',
#projectNames : [ ],
#componentNames : [ ],
#packageNames : [
'GsDevKit_stones-Tode'
],
#comment : 'Shared classes between GsDevKit_stones and Tode'
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
instance creation
importFrom: filepath
[
FileStream
readOnlyFileNamed: filepath
do: [ :fileStream |
^ ((Rowan globalNamed: 'TodeObjectSerializer') preferredSerializer fromString: fileStream contents)
asTDSessionDescription ] ]
on: ((Rowan globalNamed: 'Smalltalk') at: #'FileDoesNotExistException' ifAbsent: [ Error ])
do: [ :ex |
self
error:
'The session description file ' , filepath printString , ' cannot be found.' ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
instance creation
seaside
^ self new
name: 'seaside';
gemstoneVersion: '3.2.0';
gciLibraryName: 'libgcirpc-3.2.0-32';
stoneHost: 'localhost';
stoneName: 'seaside';
gemHost: 'localhost';
yourself
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
adornmentColor: anObject
adornmentColor := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
adornmentColor
^ adornmentColor
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
conversion
asTDSessionDescription
^ self
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
authorId: anObject
authorId := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
authorId
authorId ifNil: [ authorId := '' ].
^ authorId
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
accessing
backupDirectory: aString

(aString isEmpty or: [ aString last = $/ ])
ifTrue: [ backupDirectory := aString ]
ifFalse: [ backupDirectory := aString, '/' ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
accessing
backupDirectory

backupDirectory == nil ifTrue: [ backupDirectory := '' ].
^backupDirectory
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
accessing
dataDirectory: aString

(aString isEmpty or: [ aString last = $/ ])
ifTrue: [ dataDirectory := aString ]
ifFalse: [ dataDirectory := aString, '/' ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
accessing
dataDirectory

dataDirectory == nil ifTrue: [ dataDirectory := '' ].
^dataDirectory
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
defaults
defaultGemHost

^'glass'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
defaults
defaultGemTask

^'gemnetobject'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
defaults
defaultGemstoneVersion

^'3.2.0'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
defaults
defaultNetLDI

^'50377'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
defaults
defaultPassword

^'swordfish'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
defaults
defaultStoneHost

^'glass'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
defaults
defaultStoneName

^'seaside'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
defaults
defaultUserId

^'DataCurator'
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
environmentId: anObject
environmentId := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
environmentId
^ environmentId ifNil: [ environmentId := 0 ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
excludeNetLDIPort: anObject
excludeNetLDIPort := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
excludeNetLDIPort
excludeNetLDIPort ifNil: [ excludeNetLDIPort := true ].
^ excludeNetLDIPort
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
ston
excludedInstVarNames
| excluded |
excluded := Set new.
excluded add: #excludeNetLDIPort.
self netLDIPortRange ifNil: [ excluded add: #netLDIPortRange ].
self excludeNetLDIPort
ifTrue: [
"when excludeNetLDIPort is true, avoid exporting netLDIPort and
netLDIPortRange i.v.s because we may be passing the description
to an older version of tode"
self netLDIPort isEmpty
ifTrue: [ excluded add: #netLDIPort ].
self netLDIPortRange
ifNotNil: [ :range |
range isEmpty
ifTrue: [ excluded add: #netLDIPortRange ] ].
self authorId isEmpty
ifTrue: [ excluded add: #authorId ] ].
self snapshotDirectory isEmpty
ifTrue: [ excluded add: #snapshotDirectory ].
environmentId ifNil: [ excluded add: #environmentId ].
todeUserId ifNil: [ excluded add: #todeUserId ].
^ excluded
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
exportTo: filepath
self exportTo: filepath extension: ''
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
accessing
exportTo: filepath extension: extension
| stream old |
old := self excludeNetLDIPort.
[
"when exporting to file system, we are interested in including netLDIPort.. i.v.s"
self excludeNetLDIPort: false.
stream := FileStream forceNewFileNamed: filepath , self name , extension.
stream lineEndConvention: #lf.
stream nextPutAll: ((Rowan globalNamed: 'TodeObjectSerializer') preferredSerializer toStringPretty: self).
stream close ]
ensure: [ self excludeNetLDIPort: old ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
ston
fromSton: stonReader
stonReader
parseMapDo: [ :instVarName :value |
[ self instVarNamed: instVarName put: value ]
on: Error
do: [ :ignored |
"If the instance variable for a TDsessionDescription is missing ... it is for a good reason ... keep on truckin' ... if it's critical let's find out during execution rather than during import"
] ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
gciLibraryName: anObject
gciLibraryName := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
gciLibraryName
gciLibraryName ifNil: [ gciLibraryName := 'libgcirpc-' , self gemstoneVersion , '-32' ].
^ gciLibraryName
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
gemHost: aString

gemHost := aString
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
accessing
gemHost

gemHost == nil ifTrue: [ gemHost := self defaultGemHost ].
^gemHost
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
nrs
gemNRS

^'!tcp@' , self gemHost,
'#netldi:' , self netLDIOrNetLDIPort,
'#task!' , self gemTask.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
gemTask: aString

gemTask := aString
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
accessing
gemTask

gemTask == nil ifTrue: [ gemTask := self defaultGemTask ].
^gemTask
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
accessing
gemstoneVersion: aString
| tokens |
tokens := aString findTokens: '.'.
tokens size <= 2
ifTrue: [ self error: 'GemStone version must have a minimum of three version fields: ''3.2.0''' ].
gemstoneVersion := aString
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
gemstoneVersion
gemstoneVersion ifNil: [ gemstoneVersion := self defaultGemstoneVersion ].
^ gemstoneVersion
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
testing
isGuest

^ osUserId isNil
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
name: aString

name := aString
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
accessing
name

^name == nil
ifTrue: [ self class label ]
ifFalse: [ name ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
netLDI: aString

netLDI := aString
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
accessing
netLDI

netLDI == nil ifTrue: [ netLDI := self defaultNetLDI ].
^netLDI
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
accessing
netLDIOrNetLDIPort
^ self netLDIPort isEmpty
ifTrue: [ self netLDI ]
ifFalse: [ self netLDIPort ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
netLDIPort: anObject
netLDIPort := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
netLDIPort
netLDIPort ifNil: [ netLDIPort := '' ].
^ netLDIPort
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
netLDIPortRange: aString
netLDIPortRange := aString
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
netLDIPortRange
^ netLDIPortRange
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
osPassword: aString

osPassword := aString
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
accessing
osPassword

osPassword == nil ifTrue: [ osPassword := '' ].
^osPassword
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
osUserId: aString

osUserId := aString
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
password: aString

password := aString
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
accessing
password

password == nil ifTrue: [ password := self defaultPassword ].
^password
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
copying
postCopy

super postCopy.
self name: self name, ' copy'
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
serverGitRoot: anObject
serverGitRoot := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
serverGitRoot
^ serverGitRoot
Loading

0 comments on commit 56e19e9

Please sign in to comment.