eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'HistoryManager':

Home

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

Class: HistoryManager


Inheritance:

   Object
   |
   +--HistoryManager

Package:
stx:libbasic3
Category:
System-Changes-History
Version:
rev: 1.103 date: 2023/01/12 15:18:03
user: cg
file: HistoryManager.st directory: libbasic3
module: stx stc-classLibrary: libbasic3

Description:


This class is part of the HistoryManagerProject.
It helps to keep track of changes made to methods.

All Methods and Classes in the system get a HistroyLine which 
contains a timestamp and the name of the changing user. 
This is acually the Unix loginname.

The Manager registers itself to get notifications 
on change, intercepts them and appends a historyLine to the method's
code.

The HistoryManager can be turned on/off from a private.rc script,
or via the Launcher menu.

The method's history line is filtered, to only contain one
entry per modifying user, containing the date of the last change.
If fullHistoryMode is on, the classes history-ethod is also updated for
every change (containing every change).
Full mode is enabled via:
    HistoryManager fullHistoryUpdate:true
or via the Launchers compilation-settings dialog.

claus:
    I changed things to avoid depending on every class in the system.
    Now also catch Smalltalk change messages, related to class changes.

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:

accessing
o  fullHistoryUpdate
return true, if the historyManagement does full updates

o  fullHistoryUpdate: aBoolean
set/clear, full updates

o  instance
return the one and only historyManager instance

o  isActive
return true, if the historyManagement is activated

activation / deactivation
o  activate
activate the HistoryManagement

Usage example(s):

creating an instance activates me

Usage example(s):

     HistoryManager activate

o  deactivate
deactivate the HistoryManagement

Usage example(s):

     HistoryManager deactivate

change & update
o  update: what with: aParameter from: changedObject
intercepts system restart - reinstall mySelf as dependent of all classes

helpers
o  codeForInitialHistoryMethodIn: aClass
create an initial (empty) history method

o  createInitialHistoryMethodIn: aClass
create an initial (empty) history method

** This is an obsolete interface - do not use it (it may vanish in future versions) **

o  getAllHistoriesFrom: someString
returns anArray of HistoryLines from a string.
Usually, the argument is a method's source code.

Usage example(s):

     HistoryManager getAllHistoriesFrom:( HistoryManager class sourceCodeAt:#getAllHistoriesFrom: )

o  getLastHistoryLineFrom: someString
returns the last HistoryLine, if no HistoryLine available, return nil

o  withoutHistoryLines: someString
given some method's sourceString, return a copy without any
history lines

Usage example(s):

     HistoryManager withoutHistoryLines:nil  
     HistoryManager withoutHistoryLines:''  
     HistoryManager 
        withoutHistoryLines:(HistoryManager class sourceCodeAt:#withoutHistoryLines:)

initialization
o  enforcedUserName

o  enforcedUserName: aStringOrNil
self enforcedUserName:'fm'
self enforcedUserName:nil

o  initMe
setup theOneAndOnly instance of myself (if not already present

o  initialize
add myself as a dependent of ObjectMemory to be told about image restarts

instance creation
o  new
because there can be only ONE HistoryManager, new must me redefiend

Usage example(s):

    HistoryManager new.

queries
o  currentUserName
return the current user's name

Usage example(s):

     HistoryManager currentUserName    


Instance protocol:

accessing
o  fullHistoryUpdate
return the fullHistoryUpdate;
if true, the classes history method is also updated.

o  fullHistoryUpdate: aBoolean
set the fullHistoryUpdate;
if true, the classes history method is also updated.

o  historyMode
return historyMode

o  historyMode: something
set historyMode

change & update
o  update: something with: someArgument from: changedObject
arrive here, whenever any class changed somehow.
(something contains aSymbol describing what happened)

o  updateAfterClassChange: whatChange in: aClass
it is a class definition that has changed

o  updateAfterMethodChange: selector from: oldMethod in: changedClass

initialization
o  exclude
public - return an exclusionlist for some smalltalk classes which should not be notified or historisized

o  initialize
public - make me depend on all smalltalk classes (except the exclusionList)
to be notified later about changes. This intercepts source installation and allows
be to patch the source-string with a historyLine.

o  releaseDependencies
no longer depend on class changes

updateHistory
o  addHistory: what with: argument to: someString filter: doFilter
private - add a historyLine at end to the sourceCode;
check for multiple lines of the same user and merge into one.
What may be one of #modification or #creation, to choose among
'Modified' or 'Created' lines.

o  addHistory: what with: argument to: previousHistories inSource: someString filter: doFilter
private - add a historyLine at end to the sourceCode;
check for multiple lines of the same user and merge into one.
What may be one of #modification or #creation, to choose among
'Modified' or 'Created' lines.

o  addHistory: what with: arg toHistoryMethodOf: aClass
private - add a historyLine at end of the classes history methods
source - if there is one

o  createHistoryMethodFor: aClass
private - create a history method


Private classes:

    HistoryLine


ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Sat, 23 Nov 2024 09:37:49 GMT