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.91 date: 2019/03/03 13:32:56
user: cg
file: HistoryManager.st directory: libbasic3
module: stx stc-classLibrary: libbasic3
Author:
Robert Sailer - AEG

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.


Related information:

    HistoryLine

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 methods source code.

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

o  withoutHistoryLines: someString
given some methods sourceString, return a copy without any
history lines

usage example(s):

     HistoryManager withoutHistoryLines:nil  
     HistoryManager withoutHistoryLines:''  
     HistoryManager 
        withoutHistoryLines:(HistoryManager class 
                                compiledMethodAt:#withoutHistoryLines:) source

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.


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

Demonstration:


    HistoryManager activate


    HistoryManager deactivate



ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Tue, 19 Mar 2024 05:10:17 GMT