StoreSourceCodeManager.st
author Claus Gittinger <cg@exept.de>
Mon, 03 Jan 2011 16:31:09 +0100
changeset 2309 d01e36094bf9
parent 2198 24cbf780471b
child 2328 4620ff63e9b2
permissions -rw-r--r--
category
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
"{ Package: 'stx:libbasic3' }"
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
AbstractSourceCodeManager subclass:#StoreSourceCodeManager
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
	instanceVariableNames:''
1731
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    16
	classVariableNames:'Verbose Connection DefaultDBInfo DBInfoPerModule'
1530
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	poolDictionaries:''
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	category:'System-SourceCodeManagement'
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
!
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
1731
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    21
Object subclass:#DBInfo
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    22
	instanceVariableNames:'hostName dbName userName password'
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    23
	classVariableNames:''
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    24
	poolDictionaries:''
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    25
	privateIn:StoreSourceCodeManager
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    26
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    27
1530
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
!StoreSourceCodeManager class methodsFor:'documentation'!
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
copyright
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
"
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 COPYRIGHT (c) 2006 eXept Software AG
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
              All Rights Reserved
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
 This software is furnished under a license and may be used
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
 only in accordance with the terms of that license and with the
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
 inclusion of the above copyright notice.   This software may not
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
 be provided or otherwise made available to, or used by, any
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
 other person.  No title to or ownership of the software is
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
 hereby transferred.
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
"
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
documentation
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
"
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
    WARNING:
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
        this class is incomplete and provided as a sceletton
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
        if CVS is not to be used as a SourceCodeManager.
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
        We highly recommend to use CVS.
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
    SourceCodeManager which accesses sourcecode through a Store Database.
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
    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
    53
"
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
! !
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
1731
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    56
!StoreSourceCodeManager class methodsFor:'initialization'!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    57
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    58
connectToDatabase
1734
659de14f0d95 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1732
diff changeset
    59
    |session dbInfo|
659de14f0d95 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1732
diff changeset
    60
659de14f0d95 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1732
diff changeset
    61
    dbInfo := self defaultDBInfo.
1731
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    62
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    63
    SQL::SQLError handle:[:ex |
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    64
        self warn:('Failed to connect to Database:\\' withCRs,ex description).
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    65
        ^ self.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    66
    ] do:[
1734
659de14f0d95 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1732
diff changeset
    67
        session := self tryToConnectToDatabase:dbInfo.
1731
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
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    70
    session isNil ifTrue:[
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    71
        self warn:'OOPS - Failed to connect to Database'.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    72
        ^ self
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    73
    ].
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    74
    Connection := session.
1734
659de14f0d95 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1732
diff changeset
    75
    Transcript showCR:('Connected to Store-DB: ',dbInfo hostAndDBName).
1731
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
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    78
tryToConnectToDatabase:dbInfo
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    79
    |session|
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    80
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    81
    session := SQL::ODBCSession new.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    82
    session 
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    83
        connectWithUsername:(dbInfo userName) 
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    84
        password:(dbInfo password) 
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    85
        dbname:(dbInfo dbName).
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    86
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    87
    (session isConnected) ifFalse:[
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    88
        ^ nil.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    89
    ].
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    90
    ^ session
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    91
! !
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    92
1530
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
!StoreSourceCodeManager class methodsFor:'accessing'!
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
1731
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    95
dbName
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    96
    ^ self defaultDBInfo dbName
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
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
    99
dbName:aString
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   100
    self defaultDBInfo dbName:aString.
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
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   103
defaultDBInfo
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   104
    DefaultDBInfo isNil ifTrue:[
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   105
        DefaultDBInfo := DBInfo new
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   106
    ].
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   107
    ^ DefaultDBInfo
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
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   110
hostAndDBName
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   111
    ^ self defaultDBInfo hostAndDBName
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
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   114
hostAndDBName:aString
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   115
    self defaultDBInfo hostAndDBName:aString.
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
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   118
hostName
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   119
    ^ self defaultDBInfo hostName
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
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   122
hostName:aString
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   123
    self defaultDBInfo hostName:aString.
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
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   126
newDBInfo
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   127
    ^ DBInfo new
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
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   130
password
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   131
    ^ self defaultDBInfo password
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
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   134
password:aString
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   135
    self defaultDBInfo password:aString.
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
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   138
repositoryInfoPerModule
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   139
    ^ DBInfoPerModule ? #()
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   140
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   141
    "Created: / 16-08-2006 / 11:06:09 / cg"
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
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   144
repositoryInfoPerModule:aCollectionOfDBinfos
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   145
    DBInfoPerModule := aCollectionOfDBinfos
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   146
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   147
    "Created: / 16-08-2006 / 11:06:09 / cg"
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
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   150
userName
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   151
    ^ self defaultDBInfo userName
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
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   154
userName:aString
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   155
    self defaultDBInfo userName:aString.
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
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   158
!StoreSourceCodeManager class methodsFor:'queries'!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   159
2198
24cbf780471b added: #nameOfVersionMethodForExtensions
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
   160
isExperimental
24cbf780471b added: #nameOfVersionMethodForExtensions
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
   161
    ^ OperatingSystem getLoginName ~= 'cg'.
24cbf780471b added: #nameOfVersionMethodForExtensions
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
   162
    ^ true
24cbf780471b added: #nameOfVersionMethodForExtensions
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
   163
24cbf780471b added: #nameOfVersionMethodForExtensions
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
   164
    "Created: / 16-08-2006 / 11:23:09 / cg"
24cbf780471b added: #nameOfVersionMethodForExtensions
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
   165
!
24cbf780471b added: #nameOfVersionMethodForExtensions
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
   166
1530
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   167
managerTypeName
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   168
    ^ 'Store DB'
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   169
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   170
    "Created: / 16-08-2006 / 11:06:09 / cg"
2139
00a8e5ffba8e added nameOfVersionMethodInClasses
Claus Gittinger <cg@exept.de>
parents: 1900
diff changeset
   171
!
00a8e5ffba8e added nameOfVersionMethodInClasses
Claus Gittinger <cg@exept.de>
parents: 1900
diff changeset
   172
2198
24cbf780471b added: #nameOfVersionMethodForExtensions
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
   173
nameOfVersionMethodForExtensions
24cbf780471b added: #nameOfVersionMethodForExtensions
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
   174
    ^ #'extensionsVersion_STORE'
24cbf780471b added: #nameOfVersionMethodForExtensions
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
   175
!
24cbf780471b added: #nameOfVersionMethodForExtensions
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
   176
2139
00a8e5ffba8e added nameOfVersionMethodInClasses
Claus Gittinger <cg@exept.de>
parents: 1900
diff changeset
   177
nameOfVersionMethodInClasses
00a8e5ffba8e added nameOfVersionMethodInClasses
Claus Gittinger <cg@exept.de>
parents: 1900
diff changeset
   178
    ^ #'version_STORE'
1530
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   179
! !
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   180
1892
Claus Gittinger <cg@exept.de>
parents: 1737
diff changeset
   181
!StoreSourceCodeManager class methodsFor:'saving'!
Claus Gittinger <cg@exept.de>
parents: 1737
diff changeset
   182
Claus Gittinger <cg@exept.de>
parents: 1737
diff changeset
   183
savePreferencesOn:aStream
1900
050004f4d636 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1892
diff changeset
   184
    aStream nextPutLine:'  StoreSourceCodeManager notNil ifTrue:['.
050004f4d636 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1892
diff changeset
   185
    aStream nextPutLine:'    StoreSourceCodeManager repositoryInfoPerModule:' , self repositoryInfoPerModule storeString , '.'.
1892
Claus Gittinger <cg@exept.de>
parents: 1737
diff changeset
   186
    (Smalltalk at:#SourceCodeManager) == StoreSourceCodeManager ifTrue:[
1900
050004f4d636 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1892
diff changeset
   187
        aStream nextPutLine:'    Smalltalk at:#SourceCodeManager put: StoreSourceCodeManager.'.
050004f4d636 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1892
diff changeset
   188
        aStream nextPutLine:'    StoreSourceCodeManager hostAndDBName:' , self hostAndDBName storeString , '.'.
050004f4d636 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1892
diff changeset
   189
        aStream nextPutLine:'    StoreSourceCodeManager dbName:' , self dbName storeString , '.'.
050004f4d636 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1892
diff changeset
   190
        aStream nextPutLine:'    StoreSourceCodeManager userName:' , self userName storeString , '.'.
1892
Claus Gittinger <cg@exept.de>
parents: 1737
diff changeset
   191
    ].
1900
050004f4d636 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1892
diff changeset
   192
    aStream nextPutLine:'  ].'.
1892
Claus Gittinger <cg@exept.de>
parents: 1737
diff changeset
   193
Claus Gittinger <cg@exept.de>
parents: 1737
diff changeset
   194
    "Created: / 09-11-2006 / 15:10:25 / cg"
1900
050004f4d636 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1892
diff changeset
   195
    "Modified: / 10-11-2006 / 18:13:49 / cg"
1892
Claus Gittinger <cg@exept.de>
parents: 1737
diff changeset
   196
! !
Claus Gittinger <cg@exept.de>
parents: 1737
diff changeset
   197
1530
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   198
!StoreSourceCodeManager class methodsFor:'testing'!
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   200
isStore
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
    ^ true
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
    "Created: / 16-08-2006 / 10:59:06 / cg"
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
! !
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
1731
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   206
!StoreSourceCodeManager::DBInfo methodsFor:'accessing'!
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
dbName
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   209
    ^ dbName
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   210
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   211
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   212
dbName:something
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   213
    dbName := something.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   214
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   215
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   216
hostAndDBName
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   217
    hostName isEmptyOrNil ifTrue:[ ^ dbName ].
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   218
    ^ dbName,'@',hostName
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   219
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   220
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   221
hostAndDBName: aString
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   222
    |idx|
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   223
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   224
    idx := aString indexOf:$@.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   225
    idx == 0 ifTrue:[
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   226
        dbName := aString.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   227
        hostName := nil.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   228
    ] ifFalse:[
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   229
        dbName := aString copyTo:idx-1.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   230
        hostName := (aString copyFrom:idx+1).
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
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   233
1732
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   234
hostAndDBName:hostAndDBNameArg userName:userNameArg password:passwordArg 
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   235
    self hostAndDBName:hostAndDBNameArg.
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   236
    userName := userNameArg.
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   237
    password := passwordArg.
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   238
!
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   239
1731
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   240
hostName
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   241
    ^ hostName
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
hostName:something
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   245
    hostName := 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
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   248
hostName:hostNameArg dbName:dbNameArg userName:userNameArg password:passwordArg 
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   249
    "set instance variables (automatically generated)"
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   250
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   251
    hostName := hostNameArg.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   252
    dbName := dbNameArg.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   253
    userName := userNameArg.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   254
    password := passwordArg.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   255
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   256
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   257
password
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   258
    ^ password
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   259
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   260
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   261
password:something
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   262
    password := something.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   263
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   264
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   265
userName
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   266
    ^ userName
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   267
!
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   268
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   269
userName:something
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   270
    userName := something.
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   271
! !
16af565d0676 db connection established
Claus Gittinger <cg@exept.de>
parents: 1530
diff changeset
   272
2309
d01e36094bf9 category
Claus Gittinger <cg@exept.de>
parents: 2198
diff changeset
   273
!StoreSourceCodeManager::DBInfo methodsFor:'printing & storing'!
1732
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   274
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   275
storeOn:aStream
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   276
    aStream 
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   277
        nextPutAll:'(';
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   278
        nextPutAll:self class name;
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   279
        nextPutAll:' basicNew';
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   280
        nextPutAll:' hostAndDBName:';
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   281
        store: self hostAndDBName;
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   282
        nextPutAll:' userName:';
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   283
        store: self userName;
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   284
        nextPutAll:' password:';
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   285
        store: self password;
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   286
        nextPutAll:')'.
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   287
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   288
    "
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   289
     self readFrom:(self basicNew hostAndDBName:'a' userName:'b' password:'c') storeString
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   290
     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
   291
    "
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   292
! !
61f9b9c98087 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1731
diff changeset
   293
1530
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   294
!StoreSourceCodeManager class methodsFor:'documentation'!
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   295
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   296
version
2309
d01e36094bf9 category
Claus Gittinger <cg@exept.de>
parents: 2198
diff changeset
   297
    ^ '$Header: /cvs/stx/stx/libbasic3/StoreSourceCodeManager.st,v 1.11 2011-01-03 15:31:09 cg Exp $'
2198
24cbf780471b added: #nameOfVersionMethodForExtensions
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
   298
!
24cbf780471b added: #nameOfVersionMethodForExtensions
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
   299
24cbf780471b added: #nameOfVersionMethodForExtensions
Claus Gittinger <cg@exept.de>
parents: 2139
diff changeset
   300
version_CVS
2309
d01e36094bf9 category
Claus Gittinger <cg@exept.de>
parents: 2198
diff changeset
   301
    ^ '$Header: /cvs/stx/stx/libbasic3/StoreSourceCodeManager.st,v 1.11 2011-01-03 15:31:09 cg Exp $'
1530
72861343b2a2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   302
! !