1 classdef EmailLoggerBuilder
2 methods (Access=
private)
3 function self=EmailLoggerBuilder()
7 function emailLogger=fromConfRepoMgr(confRepoMgr,appName,inpSubjSuffName,mainLogFileName,fTempDirGetter,varargin)
10 {
'emailAttachmentNameList';...
12 'iscellofstring(x)'},0);
13 [urlCodeStr,urlStr,branchName,revisionStr]=...
16 tmpDirName=fTempDirGetter(appName);
18 zipLogFileName=[tmpDirName,
filesep,
'mainlog.zip'];
20 dstConfFileName=[tmpDirName,
filesep,
'cur_conf',
'.xml'];
21 confRepoMgr.copyConfFile(dstConfFileName,
'destIsFile',
true);
25 subjectSuffix=[
',pid:',num2str(pidVal),
',conf:',...
26 confRepoMgr.getCurConfName(),inpSubjSuffName,...
27 ',',urlCodeStr,
':',urlStr];
29 if confRepoMgr.isParam(
'emailNotification.smtpUserName')
30 addArgList=[addArgList,{
'smtpUserName',...
31 confRepoMgr.getParam(
'emailNotification.smtpUserName')}];
32 if confRepoMgr.isParam(
'emailNotification.smtpPassword')
33 addArgList=[addArgList,{
'smtpPassword',...
34 confRepoMgr.getParam(
'emailNotification.smtpPassword')}];
36 elseif confRepoMgr.isParam(
'emailNotification.smtpPassword')
37 throwerror(
'wrongInput',[
'smtpPassword can only be ',...
38 'specified when smtpUser name is specified']);
41 if confRepoMgr.isParam(
'emailNotification.from.isEnabled')
42 fromEmailAddress=confRepoMgr.getParam(...
43 'emailNotification.from.emailAddress');
44 inpArgList={
'fromEmailAddress',fromEmailAddress};
50 'emailDistributionList',...
51 confRepoMgr.getParam(
'emailNotification.distributionList'),...
52 'emailAttachmentNameList',...
53 [{mainLogFileName,dstConfFileName},addAttachNameList],...
54 'emailAttachmentZippedNameList',...
55 [{zipLogFileName},cell(1,numel(addAttachNameList)+1)],...
56 'smtpServer',confRepoMgr.getParam(
'emailNotification.smtpServer'),...
57 'subjectSuffix',subjectSuffix,...
59 [appName,
':',branchName,
':',revisionStr],addArgList{:},...
61 ~confRepoMgr.getParam(
'emailNotification.isEnabled'),...
function throwerror(in msgTag, in varargin)
THROWERROR works similarly to built-in ERROR function in case when there is no output arguments but s...
function parseparext(in args, in propNameValMat, in varargin)
PARSEPAREXT behaves in the same way as mxberry.core.parseparams but returns property values in a more...