eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'HistoryManager::HistoryLine':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: HistoryLine (private in HistoryManager

This class is only visible from within HistoryManager.

Inheritance:

   Object
   |
   +--HistoryManager::HistoryLine

Package:
stx:libbasic3
Category:
System-Changes-History
Owner:
HistoryManager

Description:


The class HistoryLine is part of the HistoryManagerProjcet.

HistoryLine knows how to compose and parse comment lines which are
used to keep track of changes. These historyLines are added at the end of
a methods source code and to the special history classmethod.

HistoryLine and HistoryManager where generously provided by AEG for inclusion into the
ST/X class delivery.

copyright

COPYRIGHT (c) 1995 by AEG Industry Automation COPYRIGHT (c) 1995 by Claus Gittinger All Rights Reserved This software is furnished under a license and may be used only in accordance with the terms of that license and with the inclusion of the above copyright notice. This software may not be provided or otherwise made available to, or used by, any other person. No title to or ownership of the software is hereby transferred.

Class protocol:

converting
o  convertStringToDate: aString
kludge

Usage example(s):

     HistoryLine convertStringToDate:'18.10.1995' -> 18-10-1995
     HistoryLine convertStringToDate:'18.10.95'   -> 18-10-1995 
     HistoryLine convertStringToDate:'18.10.01'   -> 18-10-2001 
     HistoryLine convertStringToDate:'2001-03-01' -> 01-03-2001   

o  convertStringToTime: aString
was a kludge by Robert; not needed, as Time can convert both hh:mm and hh:mm:ss

Usage example(s):

     HistoryLine convertStringToTime:'18:23:15'       
     HistoryLine convertStringToTime:'18:23:15 foo'       
     HistoryLine convertStringToTime:'18:23'       
     HistoryLine convertStringToTime:'18:23 foo'       

filtering
o  filterHistoryLines: aCollectionOfHistoryLines
check the collection against multiple occurrence of the same user,
and remove all but the youngest (per user).

o  modificationLimit
Answer the number of seconds between creation and
modifcation of a method within which the modification
line won't be added.

o  timeIsShortFrom: histLine1 to: histLine2

initialization
o  initialize
setup class variables

Usage example(s):

     HistoryLine initialize

instance creation
o  fromString: aString
parses the argument, aString;
create & return a new Instance with the values

Usage example(s):

     HistoryLine fromString: 'Modified: 01.12.93 / 18:32:30 / M.Noell'
     HistoryLine fromString: 'Created: 01.12.93 / 18:32:30 / M.Noell'

o  fromString: aString at: position
parses the String and creates a new Instance with the values.
The positionvalue is normally used to remove the HistoryLines from the sourceCode.
Claus: return nil, if the string is not a valid historyString.

Usage example(s):

     HistoryLine fromString: 'Modified: 21.12.93 / 18:32:30 / R.Sailer'
     HistoryLine fromString: 'Created: 21.12.1993 / 18:32:30 / Felicitas Gabriele Felger'
     HistoryLine fromString: 'Deleted: 21.12.93 / 18:32:30 / Astrid Weisseise'
     HistoryLine fromString: 'Deleted: foo bar / 21.12.93 / 18:32:30 / Astrid Weisseise'

o  new
get a new history line.
Preinitialize it as a modified-Line for the current user

o  newCreated
public - get a new created-Line for the current user

Usage example(s):

     HistoryLine newCreated

private
o  type: type what: what
private - for integration purposes only


Instance protocol:

accessing
o  date
return the date

o  date: something
set the date

o  firstPositionInSourceCode
return firstPositionInSourceCode

o  firstPositionInSourceCode: anInteger
set firstPositionInSourceCode

o  isForAddition

o  isForCommented

o  isForCreation

o  isForDeletion

o  isForFormatted

o  isForModification

o  isForVariableRenamed

o  lastPositionInSourceCode
return lastPositionInSourceCode

o  lastPositionInSourceCode: anInteger
set lastPositionInSourceCode

o  time
return the time

o  time: something
set the time

o  type
return the type

o  type: something
set the type

o  user
return the user

o  user: something
set the user

o  what
return the what-changed info

o  what: someStringOrSelector
set the what-changed info

comparing
o  = aHistoryLine
compares two instances of HistoryLine

Usage example(s):

    | h1 h2 |

    h1 := HistoryLine for: OperatingSystem getLoginName.
    h2 := h1 copy.

    h1 = h2 ifTrue:[
        InfoBox new title: 'users are equal'; show.
    ].

    h2 := HistoryLine for: OperatingSystem getLoginName.
    h1 = h2 ifFalse:[
        InfoBox new title: 'users are not equal'; show.
    ].

o  hash
return a hash key for the receiver

Usage example(s):

    Check hashCode

    |h1 h2 oc |

    h1 := HistoryLine new hash.
    h2 := HistoryLine new hash.
    oc := OrderedCollection new.
    oc add: h1.
    oc add: h2.
    ^oc

    using hash in a set:

    | h1 h2 aSet oc |
    h1 := HistoryLine new hash.
    h2 := HistoryLine new hash.
    oc := OrderedCollection new.
    oc add: h1.
    oc add: h2.
    aSet := oc asSet.
    ^aSet

o  sameDate: aHistoryLine
returns true if aUserName = user in preperation for a SortedCollection of HistoryLines

Usage example(s):

    | h1 h2 |

    h1 := HistoryLine new.
    h2 := h1 copy.

    (h1 sameDate: h2)  ifTrue:[
	InfoBox new title: 'Dates are equal'; show.
    ].

    h2 := HistoryLine for: 'R.Sailer'.
    h2 date: (Date day: 12 month: 6 year:1981).
    (h1 sameDate: h2) ifFalse:[
	InfoBox new title: 'users are not equal'; show.
    ].

o  sameType: aHistoryLine
returns true if the Type = type in preperation for a SortedCollection of HistoryLines

Usage example(s):

    | h1 h2 |

    h1 := HistoryLine new.
    h2 := h1 copy.

    (h1 sameType: h2)  ifTrue:[
	InfoBox new title: 'Types are equal'; show.
    ].

    h2 := HistoryLine createdBy: 'R.Sailer'.
    (h1 sameType: h2) ifFalse:[
	InfoBox new title: 'Types are not equal'; show.
    ].

o  sameUser: aHistoryLine
returns true if aUserName = user in preperation for a SortedCollection of HistoryLines

Usage example(s):

    | h1 h2 |

    h1 := HistoryLine new.
    h2 := h1 copy.

    (h1 sameUser: h2)  ifTrue:[
	InfoBox new title: 'users are equal'; show.
    ].

    h2 := HistoryLine for: 'R.Sailer'.
    (h1 sameUser: h2) ifFalse:[
	InfoBox new title: 'users are not equal'; show.
    ].

o  sameWhat: aHistoryLine
returns true if the what = type in preperation for a SortedCollection of HistoryLines

printing & storing
o  printOn: aStream
return a printed representation of a HistoryLine as a string

Usage example(s):

     self new printOn:Transcript

queries
o  isCreated
returns true if the bodytext is CreatedString

Usage example(s):

        HistoryLine new isModified
        (HistoryLine for: 'R.Sailer') isCreated 
        (HistoryLine createdBy: 'R.Sailer') isCreated 
        HistoryLine deleted isModified 
        (HistoryLine deletedBy: 'M.Noell') isModified 

o  isDeleted
returns true if the bodytext is DeletedString

Usage example(s):

        HistoryLine deleted isDeleted
        HistoryLine new isDeleted

o  isKindOfModified
returns true if the bodytext is ModifiedString

o  isModified
returns true if the bodytext is ModifiedString

Usage example(s):

        HistoryLine new isModified
        (HistoryLine for: 'R.Sailer') isModified 
        HistoryLine deleted isModified 
        (HistoryLine deletedBy: 'M.Noell') isModified 


Examples:


HistoryLine initialize.

HistoryLine new.

HistoryLine for: 'R.Sailer'.    for integration purposes ONLY

HistoryLine deleted.


ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Sat, 21 Dec 2024 15:45:34 GMT