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
Author:
Robert Sailer - AEG

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.


Related information:

    HistoryManager

Class protocol:

converting
o  convertStringToDate: aString
kludge

usage example(s):

     HistoryLine convertStringToDate:'18.10.1995' 
     HistoryLine convertStringToDate:'18.10.95'    
     HistoryLine convertStringToDate:'18.10.01'    
     HistoryLine convertStringToDate:'2001-03-01'    

o  convertStringToTime: aString
kludge

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  currentUserName
return the current users name -
that's either the userInfos-gecos field, or the users login name.

usage example(s):

     HistoryLine currentUserName

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: something
set firstPositionInSourceCode

o  isForAddition

o  isForCommented

o  isForCreation

o  isForDeletion

o  isForFormatted

o  isForModification

o  isForVariableRenamed

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

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

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

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

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.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Wed, 24 Apr 2024 16:31:32 GMT