License Renewal Classes refactor

From LeonWiki!

Jump to: navigation, search

Object Model for Refactored Renewal Manager Module

Image:RenewalMgrObjectDomain.jpg

Object Model for Refactored Renewal License Module

Image:RenewalLicenseObjectDiagram.jpg

Algorithm based on above object models

  1. RenewLicense module is now dedicated to GUI, upfront configuration and raw data/contact inputs
    • Display the GUI
    • Get/save application properties
    • Get/save email properties
    • Get/save supported products
    • Get/save headers (data and contacts)
    • Read in the logo
    • Respond to text/email generation button click
  2. The new renewalmgr module contains all the new classes and is dedicated to using the records acquired by renewLicense for building all the objects
    • Read records and build objects from the records provided by renewLicense module
    • The RenewalMgr object contains two sets: companies and offlineCompanies
    1. Companies: the set of all companies that have a product that is supported AND have the necessary data/contact information for either email or text generation
    2. OfflineCompanies: the set of companies that have a product that is supported AND are to be text generated for one or more of the following reasons
      • The company is a 'Manual' renewal
      • The company is missing the primary email from the contacts
      • The company is missing any contact information
      • Data and/or contact zip code is missing
      • There are > 1 primary email contacts
      • The SubRole field in the contact information is empty
  3. Email/Text Generation
    • When the user clicks the email or text generation button
    1. The EmailTask or TextTask class is instantiated
    2. From the Task classes, the Emailer or TextFiler class is instantiated which performs the actual output
      • The Emailer/TextFiler iterates over the set of companies, builds the context information and then outputs the Email or Text.

           if 'text' == mode:
               textFiler = TextFiler()
               for company in companies.values():
                   textFiler.generateTextFile(company)
                   count = self.setStatus(count)
               for company in offlineCompanies.values():
                   textFiler.generateTextFile(company)
                   count = self.setStatus(count)
           elif 'email' == mode:
               emailer = Emailer()
               textFiler = TextFiler()
               for company in companies.values():
                   emailer.createEmail(company)
                   count = self.setStatus(count)
               for company in offlineCompanies.values():
                   textFiler.generateTextFile(company)
                   count = self.setStatus(count)

Personal tools
Alchemy Software, Inc.
Alchemy Software Website