Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

1         Problem Scope

 

MFI’s typically generate client-facing documents (whose format varies from MFI to MFI) from their MIS. These documents are usually limited to the context of a Client (Client registration documents) and Loans (Loan Contracts, Passbooks etc.)

The actual functionality (wherein a user defines document templates in the system) could be reused for many other related Tasks like SMS Integration (https://mifosforge.jira.com/browse/MIFOSX-119), E-mail integration etc.

2         Template Definition Workflow

We would ideally want a user to select an Entity (Only Clients and Loan for the first cut).

A user would have a layout like the one shown below with

a)      A Rich Text Editor for generating WYSIWYG (What You See Is What You Get) documents

(Simple Jquery based editors like http://pietschsoft.com/demo/jHtmlArea/ could do the trick. Other Java-script editors like http://ckeditor.com/demo offer more functionality...and added complexity)

b)      An accordion (or any other UI Element) that would list the context sensitive “placeholders” for the selected entity in an easily visually discernible manner.

Placeholders would be used in the rich text editor enclosed by “${}” for easy detection and parsing Ex :${clientName}

 

1.1        Entity Types

 

Clients would work as a “simple” entity (as in a user selects a client and defines Templates for documents against the Client)

Loans would work as a “Compound” entity (That is a user would have to select a particular Loan product for associating templates against them, as Contracts etc. could vary from one Product to another)

 

 

1.2        Placeholder Types

 

Initially we could have two types of placeholders

  • Simple Placeholders (That generate Text Content): They would be replaced by the Text value the placeholder represents

Ex: ${clientName} would be replaced by “Andy Jones” etc

 

  • Complex Placeholder (That generate HTML Mark-up): They would be used primarily for generating Tabular Data.

Ex: The placeholder ${repaymentSchedule('date','principalAmount','interestAmount') } would create a HTML table for repayments with the table columns based on the passed in parameters ‘date', 'principalAmount', 'interestAmount'

2         Parser

Ideally, we would have a parser at the server (Java) which would replace the placeholders with context sensitive data and serve HTML reports to the Client.

Alternatively, we could also have services at the server side that exposes the context sensitive data and a Client side parser that would take care of merging the report template with the actual values exposed from the RESTful service

3         Database changes

We could store the HTML templates directly in the database (as they would be quite small and of very limited numbers)

Table: “m_user_documents”

Column Name

Data Type

Description

Id

Int

 

Entity_Type

Varchar(45)

An enumeration of allowed entities (Clients, Loans)

Entity_ID

int

Required only for “compound Entity’s”. Ex: ID of the Loan Product if the selected entity_type is a Loan

Document_name

Varchar(45)

The name of the document

Template

LongText

The HTML template for the document

 

 

 

 

  • No labels