License Renewal Classes refactor
From LeonWiki!
Object Model for Refactored Renewal Manager Module
Object Model for Refactored Renewal License Module
Algorithm based on above object models
- 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
- 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
- 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
- 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
- Email/Text Generation
- When the user clicks the email or text generation button
- The EmailTask or TextTask class is instantiated
- 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)


