StoreSourceCodeManager.st
author Claus Gittinger <cg@exept.de>
Fri, 25 Aug 2006 18:14:18 +0200
changeset 1732 61f9b9c98087
parent 1731 16af565d0676
child 1734 659de14f0d95
permissions -rw-r--r--
*** empty log message ***
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1530
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
 COPYRIGHT (c) 2006 eXept Software AG
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
              All Rights Reserved
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 hereby transferred.
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
"{ Package: 'stx:libbasic3' }"
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
AbstractSourceCodeManager subclass:#StoreSourceCodeManager
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
	instanceVariableNames:''
1731
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    17
	classVariableNames:'Verbose Connection DefaultDBInfo DBInfoPerModule'
1530
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	poolDictionaries:''
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	category:'System-SourceCodeManagement'
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
!
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
1731
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    22
Object subclass:#DBInfo
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    23
	instanceVariableNames:'hostName dbName userName password'
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    24
	classVariableNames:''
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    25
	poolDictionaries:''
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    26
	privateIn:StoreSourceCodeManager
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    27
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    28
1530
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
!StoreSourceCodeManager class methodsFor:'documentation'!
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
copyright
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
"
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 COPYRIGHT (c) 2006 eXept Software AG
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
              All Rights Reserved
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
 This software is furnished under a license and may be used
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
 only in accordance with the terms of that license and with the
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
 inclusion of the above copyright notice.   This software may not
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
 be provided or otherwise made available to, or used by, any
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
 other person.  No title to or ownership of the software is
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
 hereby transferred.
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
"
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
!
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
documentation
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
"
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
    WARNING:
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
        this class is incomplete and provided as a sceletton
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
        if CVS is not to be used as a SourceCodeManager.
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
        We highly recommend to use CVS.
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
    SourceCodeManager which accesses sourcecode through a Store Database.
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
    This class is part of ongoing development and not yet released for public use.
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
"
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
! !
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
1731
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    57
!StoreSourceCodeManager class methodsFor:'initialization'!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    58
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    59
connectToDatabase
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    60
    |session|
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    61
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    62
    SQL::SQLError handle:[:ex |
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    63
        self warn:('Failed to connect to Database:\\' withCRs,ex description).
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    64
        ^ self.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    65
    ] do:[
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    66
        session := self tryToConnectToDatabase:(self defaultDBInfo).
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    67
    ].
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    68
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    69
    session isNil ifTrue:[
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    70
        self warn:'OOPS - Failed to connect to Database'.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    71
        ^ self
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    72
    ].
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    73
    Connection := session.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    74
self halt.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    75
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    76
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    77
tryToConnectToDatabase:dbInfo
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    78
    |session|
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    79
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    80
    session := SQL::ODBCSession new.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    81
    session 
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    82
        connectWithUsername:(dbInfo userName) 
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    83
        password:(dbInfo password) 
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    84
        dbname:(dbInfo dbName).
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    85
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    86
    (session isConnected) ifFalse:[
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    87
        ^ nil.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    88
    ].
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    89
    ^ session
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    90
! !
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    91
1530
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
!StoreSourceCodeManager class methodsFor:'accessing'!
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
1731
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    94
dbName
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    95
    ^ self defaultDBInfo dbName
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    96
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    97
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    98
dbName:aString
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    99
    self defaultDBInfo dbName:aString.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   100
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   101
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   102
defaultDBInfo
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   103
    DefaultDBInfo isNil ifTrue:[
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   104
        DefaultDBInfo := DBInfo new
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   105
    ].
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   106
    ^ DefaultDBInfo
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   107
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   108
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   109
hostAndDBName
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   110
    ^ self defaultDBInfo hostAndDBName
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   111
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   112
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   113
hostAndDBName:aString
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   114
    self defaultDBInfo hostAndDBName:aString.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   115
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   116
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   117
hostName
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   118
    ^ self defaultDBInfo hostName
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   119
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   120
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   121
hostName:aString
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   122
    self defaultDBInfo hostName:aString.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   123
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   124
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   125
newDBInfo
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   126
    ^ DBInfo new
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   127
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   128
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   129
password
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   130
    ^ self defaultDBInfo password
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   131
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   132
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   133
password:aString
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   134
    self defaultDBInfo password:aString.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   135
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   136
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   137
repositoryInfoPerModule
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   138
    ^ DBInfoPerModule ? #()
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   139
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   140
    "Created: / 16-08-2006 / 11:06:09 / cg"
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   141
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   142
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   143
repositoryInfoPerModule:aCollectionOfDBinfos
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   144
    DBInfoPerModule := aCollectionOfDBinfos
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   145
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   146
    "Created: / 16-08-2006 / 11:06:09 / cg"
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   147
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   148
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   149
userName
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   150
    ^ self defaultDBInfo userName
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   151
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   152
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   153
userName:aString
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   154
    self defaultDBInfo userName:aString.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   155
! !
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   156
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   157
!StoreSourceCodeManager class methodsFor:'queries'!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   158
1530
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   159
managerTypeName
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   160
    ^ 'Store DB'
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   161
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   162
    "Created: / 16-08-2006 / 11:06:09 / cg"
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   163
! !
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   164
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   165
!StoreSourceCodeManager class methodsFor:'testing'!
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   166
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   167
isExperimental
1732
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   168
    ^ false.
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   169
    ^ true
1530
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   170
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   171
    "Created: / 16-08-2006 / 11:23:09 / cg"
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   172
!
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   173
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   174
isStore
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   175
    ^ true
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   176
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   177
    "Created: / 16-08-2006 / 10:59:06 / cg"
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
! !
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   179
1731
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   180
!StoreSourceCodeManager::DBInfo methodsFor:'accessing'!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   181
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   182
dbName
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   183
    ^ dbName
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   184
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   185
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   186
dbName:something
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   187
    dbName := something.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   188
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   189
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   190
hostAndDBName
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   191
    hostName isEmptyOrNil ifTrue:[ ^ dbName ].
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   192
    dbName isEmptyOrNil ifTrue:[ self halt. ^ hostName ].
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   193
    ^ dbName,'@',hostName
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   194
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   195
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   196
hostAndDBName: aString
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   197
    |idx|
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   198
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   199
    idx := aString indexOf:$@.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   200
    idx == 0 ifTrue:[
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   201
        dbName := aString.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   202
        hostName := nil.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   203
    ] ifFalse:[
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   204
        dbName := aString copyTo:idx-1.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   205
        hostName := (aString copyFrom:idx+1).
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   206
    ]
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   207
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   208
1732
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   209
hostAndDBName:hostAndDBNameArg userName:userNameArg password:passwordArg 
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   210
    self hostAndDBName:hostAndDBNameArg.
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   211
    userName := userNameArg.
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   212
    password := passwordArg.
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   213
!
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   214
1731
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   215
hostName
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   216
    ^ hostName
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   217
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   218
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   219
hostName:something
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   220
    hostName := something.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   221
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   222
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   223
hostName:hostNameArg dbName:dbNameArg userName:userNameArg password:passwordArg 
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   224
    "set instance variables (automatically generated)"
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   225
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   226
    hostName := hostNameArg.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   227
    dbName := dbNameArg.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   228
    userName := userNameArg.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   229
    password := passwordArg.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   230
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   231
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   232
password
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   233
    ^ password
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   234
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   235
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   236
password:something
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   237
    password := something.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   238
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   239
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   240
userName
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   241
    ^ userName
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   242
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   243
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   244
userName:something
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   245
    userName := something.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   246
! !
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   247
1732
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   248
!StoreSourceCodeManager::DBInfo methodsFor:'printing and storing'!
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   249
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   250
storeOn:aStream
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   251
    aStream 
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   252
        nextPutAll:'(';
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   253
        nextPutAll:self class name;
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   254
        nextPutAll:' basicNew';
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   255
        nextPutAll:' hostAndDBName:';
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   256
        store: self hostAndDBName;
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   257
        nextPutAll:' userName:';
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   258
        store: self userName;
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   259
        nextPutAll:' password:';
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   260
        store: self password;
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   261
        nextPutAll:')'.
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   262
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   263
    "
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   264
     self readFrom:(self basicNew hostAndDBName:'a' userName:'b' password:'c') storeString
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   265
     self readFrom:(self basicNew hostAndDBName:'a@h' userName:'b' password:'c') storeString
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   266
    "
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   267
! !
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   268
1530
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   269
!StoreSourceCodeManager class methodsFor:'documentation'!
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   270
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   271
version
1732
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   272
    ^ '$Header: /cvs/stx/stx/libbasic3/StoreSourceCodeManager.st,v 1.3 2006-08-25 16:14:18 cg Exp $'
1530
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   273
! !