Welcome, Guest. Please login or register.
Did you miss your activation email?
September 08, 2010, 02:47:30 PM
Home Help Search Login Register
News: Version 3.0 of Noojee Fax has been released.
Order it now from here.

+  Noojee Telephony Solutions Forums
|-+  Noojee Fax
| |-+  General Discussion
| | |-+  Noojee Fax Plugin - JDBC Template
« previous next »
Pages: [1] Print
Author Topic: Noojee Fax Plugin - JDBC Template  (Read 260 times)
Brett Sutton
Asterisk IT Staff
Sr. Member
*****
Offline Offline

Posts: 412



« on: December 08, 2009, 01:58:20 PM »

JDBC Configuration (Template)

The JDBC Configuration plugin allows the Fax header and Footer details to be pulled from a database on a per email address basis.

This allows each person to have their own header, footer, company name and return fax number displayed on each fax they send.

The plugin calls a stored procedure (not supplied) which is passed a single parameter the senders 'from email address'.
The database must return the following fields:
  • Company Name
  • Return Fax Number
  • Left Header
  • Centre Header
  • Right Header
  • Left Footer
  • Centre Footer
  • Right Footer
  • Header Font Name
  • Header Font Size
  • Header Font Style
  • Header Margin
  • Footer Font Name
  • Footer Font Size
  • Footer Font Style
  • Footer Margin

If any of the returned fields are null then then default settings from NoojeeFax.xml are used.
 

The following example creates the necessary database object for My SQL.

Code:
create table Template
(
Id int auto_increment,
EmailAddress varchar(40),
CompanyName varchar(120),
ReturnFaxNumber varchar(25),
LeftHeader varchar(20),
CentreHeader varchar(20),
RightHeader varchar(20),
LeftFooter varchar(20),
CentreFooter varchar(20),
RightFooter varchar(20),
HeaderFontName varchar(20),
HeaderFontSize int,
HeaderFontStyle int,
HeaderMargin int,
FooterFontName varchar(20),
FooterFontSize int,
FooterFontStyle int,
FooterMargin int,
primary key (Id) auto_increment
);

create index TemplateEmailAddress on Template (EmailAddress);

delimeter %%
create procedure sp_GetTemplate (aEmailAddress varchar(25))
BEGIN
select * from Template where EmailAddress = aEmailAddress;
END%%
delimiter ;

Note that the stored procedure name is sp_GetTemplate by default but that can be reconfigured if need be.

The NoojeeFax configuration entry is as follows:

Code:
<Template>
    <Name>au.com.noojee.noojeefax.template.JdbcTemplate</Name>
    <Arguments>com.mysql.jdbc.Driver,jdbc:mysql://localhost/noojeefax,noojeefax,noojeefax,sp_GetTemplatetemp</Arguments>
</Template>

Note that the default configuration file ships with a DefaultTemplate as described in the Template section above. The DefaultTemplate has a Templates element in the configuration file which must be removed when configuring the JdbcTemplate.
Logged
Pages: [1] Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!