#####################################################################
#####################################################################
## Copyright 2005 Steven R. Newcomb                                ##
##                                                                 ##
## This software is licensed under the Apache License, Version 2.0 ##
## (the "License"); you may not use this file except in compliance ##
## with the License.  Copies of the License are available at       ##
##        http://www.apache.org/licenses/LICENSE-2.0               ##
##                                                                 ##
## Unless required by applicable law or agreed to in writing,      ##
## software distributed under the License is distributed on an "AS ##
## IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either ##
## express or implied.  See the License for the specific language  ##
## governing permissions and limitations under the License.        ##
##                                                                 ##
## Copies of the source code and the license are available at      ##
##        http://www.versavant.org                                 ##
#####################################################################
#####################################################################

####################################
cvsRevision = "$Revision: 1.3 $" ##
####################################
import versavant, sys

tmName = "Patricks Topic Map"
tmDesc = ""
TMAName = "PLDTMA"
TMAConfigFilePath = "tmaconf.xml"

#######################################################
def main():
    vsv = versavant.Versavant( suppressLicenseMessage=True)
    vsv.newTopicMap( tmName, tmDesc)
    vsv.loadTMA( tmName, TMAName, TMAConfigFilePath)

    OPT = vsv.registerOriginalPopulationTask( tmName, 'opt.py',
	    'OPTfunc', 'pld OPT', 'just fooling around', '\'%s\'' % ( TMAName))
    vsv.populate( OPT)

    print "\nBEFORE MERGING:"

    print vsv.showLiveNonSystemProxies( tmName)

    vsv.merge( tmName)

    print "\nAFTER MERGING:"
    print vsv.showLiveNonSystemProxies( tmName)

#######################################################
if __name__ == "__main__":
    ## If this script has been invoked directly, as opposed to being
    ## imported by another script...

    main()  ## ...execute function main()
    ## (This is a Python convention.)

