Skip to content

Commit ecfa816

Browse files
authored
Merge branch 'master' into master
2 parents 7ea1362 + 73b53df commit ecfa816

File tree

13 files changed

+128
-11
lines changed

13 files changed

+128
-11
lines changed

eFormAPI/Installation/CustomActions/CustomAction.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -235,11 +235,12 @@ public static ActionResult InstallCA(Session session)
235235
if (session.CustomActionData["GENERATESSL"] == "1")
236236
{
237237
var siteId = GetSiteId(uiName);
238-
RunProcess(Path.Combine(installFolder, "letsencrypt\\letsencrypt.exe"), $"--plugin iissite --siteid { siteId } --accepttos --usedefaulttaskuser");
238+
var email = session.CustomActionData["EMAIL"];
239+
RunProcess(Path.Combine(installFolder, "letsencrypt\\letsencrypt.exe"), $"--plugin iissite --siteid { siteId } --emailaddress { email } --accepttos --usedefaulttaskuser");
239240
}
240241

241-
CongigureSecurity(clientLocation);
242-
CongigureSecurity(webApiLocation);
242+
ConfigureSecurity(clientLocation);
243+
ConfigureSecurity(webApiLocation);
243244
//DeleteDirectory(Path.Combine(installFolder, "letsencrypt"));
244245
IncrementProgressBar(session);
245246

@@ -348,8 +349,8 @@ public static ActionResult UpdateCA(Session session)
348349
ControlSites(customerNumber, domain, apiPort, uiPort, true);
349350
IncrementProgressBar(session);
350351

351-
CongigureSecurity(uiIisDir);
352-
CongigureSecurity(webApiLocation);
352+
ConfigureSecurity(uiIisDir);
353+
ConfigureSecurity(webApiLocation);
353354

354355
DeleteDirectory(apiTemp);
355356
DeleteDirectory(clientTemp);
@@ -510,7 +511,7 @@ private static void RenameFolders(string location, string apiName, string uiName
510511
DeleteDirectory(Path.Combine(location, "eform-client"));
511512
}
512513

513-
public static void CongigureSecurity(string folder)
514+
public static void ConfigureSecurity(string folder)
514515
{
515516
using (var powershell = PowerShell.Create())
516517
{

eFormAPI/Installation/MainInstaller/DomainNameDlg.wxs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,19 @@
99
<Control Type="Edit" Id="CustomerNumber" Width="220" Height="15" X="45" Y="132" Property="CUSTOMERNUMBER" Text="{80}" />
1010

1111
<Control Type="CheckBox" Id="certgen" Property="GENERATESSL" Width="215" Height="17" X="45" Y="165" CheckBoxValue="1" Text="Generate SSL certificate" />
12+
13+
<Control Id="EmailText" Type="Text" X="45" Y="182" Width="220" Height="15" Text ="&amp;Email address:">
14+
<Condition Action="show" >GENERATESSL</Condition>
15+
<Condition Action="hide"><![CDATA[GENERATESSL <> "1"]]></Condition>
16+
</Control>
17+
<Control Id="EmailBox" Type="Edit" X="45" Y="196" Width="220" Height="15" Property="EMAIL" Text="{80}">
18+
<Condition Action="show" >GENERATESSL</Condition>
19+
<Condition Action="hide"><![CDATA[GENERATESSL <> "1"]]></Condition>
20+
</Control>
1221

1322
<Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="&amp;Back" />
1423
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Text="&amp;Next">
15-
<Publish Event="SpawnDialog" Value="EmptyFieldDlg">NOT DOMAINNAME OR NOT CUSTOMERNUMBER</Publish>
24+
<Publish Event="SpawnDialog" Value="EmptyFieldDlg">(NOT DOMAINNAME OR NOT CUSTOMERNUMBER) OR (GENERATESSL AND NOT EMAIL)</Publish>
1625
</Control>
1726
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="Cancel">
1827
<Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>

eFormAPI/Installation/MainInstaller/MaintenanceTypeModifiedDlg.wxs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<Publish Property="DOMAINNAME" Value="{}" >1</Publish>
1414
<Publish Property="CUSTOMERNUMBER" Value="{}" >1</Publish>
1515
<Publish Property="GENERATESSL" Value="{}" >1</Publish>
16+
<Publish Property="EMAIL" Value="{}" >1</Publish>
1617
<Publish Property="CONFIGURATIONEXISTS" Value="{}" >1</Publish>
1718
</Control>
1819
<Control Id="Update" Type="PushButton" X="98" Y="139" Width="139" Height="33" Text="&amp;Update" >

eFormAPI/Installation/MainInstaller/Product.wxs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
<Property Id="DOMAINNAME" Value="{}" Secure="yes" />
3939
<Property Id="CUSTOMERNUMBER" Value="{}" Secure="yes" />
4040
<Property Id="GENERATESSL" Value="{}" Secure="yes" />
41+
<Property Id="EMAIL" Value="{}" Secure="yes" />
4142
<Property Id="INSTALLFOLDER" Value="C:\inetpub\wwwroot" Secure="yes" />
4243
<Property Id="KEEPFOLDERS" Value="eform-api\output" Secure="yes"/>
4344
<Property Id="KEEPSETTINGS" Value="1" Secure="yes"/>
@@ -70,7 +71,7 @@
7071

7172
<Binary Id="BinaryCA" SourceFile="BuildedCustomActions\CustomActions.CA.dll" />
7273

73-
<CustomAction Id="SetInstalValues" Property="Install" Value="INSTMODE=[INSTMODE];DOMAINNAME=[DOMAINNAME];CUSTOMERNUMBER=[CUSTOMERNUMBER];GENERATESSL=[GENERATESSL];INSTALLFOLDER=[INSTALLFOLDER];USEEXISTINGCONFIGURATION=[USEEXISTINGCONFIGURATION];CONFIGURATIONEXISTS=[CONFIGURATIONEXISTS];KEEPFOLDERS=[KEEPFOLDERS];KEEPFILES=[KEEPFILES]"/>
74+
<CustomAction Id="SetInstalValues" Property="Install" Value="INSTMODE=[INSTMODE];DOMAINNAME=[DOMAINNAME];CUSTOMERNUMBER=[CUSTOMERNUMBER];GENERATESSL=[GENERATESSL];INSTALLFOLDER=[INSTALLFOLDER];USEEXISTINGCONFIGURATION=[USEEXISTINGCONFIGURATION];CONFIGURATIONEXISTS=[CONFIGURATIONEXISTS];KEEPFOLDERS=[KEEPFOLDERS];KEEPFILES=[KEEPFILES];EMAIL=[EMAIL]"/>
7475
<CustomAction Id="SetRemoveValues" Property="RemoveService" Value="INSTMODE=[INSTMODE];DOMAINNAME=[DOMAINNAME];KEEPFOLDERS=[KEEPFOLDERS];KEEPSETTINGS=[KEEPSETTINGS];KEEPFILES=[KEEPFILES]" />
7576
<CustomAction Id="SetUpdateServiceValues" Property="UpdateService" Value="INSTMODE=[INSTMODE];DOMAINNAME=[DOMAINNAME];INSTALLFOLDER=[INSTALLFOLDER]" />
7677

eFormAPI/eFormAPI.Common/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<package id="EntityFramework" version="6.1.3" targetFramework="net46" />
88
<package id="EPPlus" version="4.1.1" targetFramework="net46" />
99
<package id="Microsoft.Office.Interop.Excel" version="15.0.4795.1000" targetFramework="net46" />
10-
<package id="Microting.eForm" version="2.1.87" targetFramework="net46" />
10+
<package id="Microting.eForm" version="2.1.90" targetFramework="net46" />
1111
<package id="MySql.Data" version="6.9.11" targetFramework="net46" />
1212
<package id="MySql.Data.Entity" version="6.9.11" targetFramework="net46" />
1313
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net46" />

eFormAPI/eFormAPI/Controllers/CasesController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public OperationDataResult<List<Case>> Index(int id)
2121
try
2222
{
2323
var core = _coreHelper.GetCore();
24-
var model = core.CaseReadAll(id, null, null);
24+
var model = core.CaseReadAll(id, null, null, Constants.WorkflowStates.NotRemoved, "", true, Constants.CaseSortParameters.CreatedAt);
2525
return new OperationDataResult<List<Case>>(true, model);
2626
}
2727
catch (Exception)

eFormAPI/eFormAPI/Controllers/TemplateFilesController.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ public HttpResponseMessage UploadEformZip()
258258
}
259259

260260
ZipFile.ExtractToDirectory(filePath, extractPath);
261+
File.Delete(filePath);
261262
return Request.CreateResponse(HttpStatusCode.OK);
262263
}
263264
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using eFormAPI.Web.Messages;
2+
using System.Threading.Tasks;
3+
using Rebus.Handlers;
4+
5+
namespace eFormAPI.Web.Handlers
6+
{
7+
public class GenerateJasperFilesHandler : IHandleMessages<GenerateJasperFiles>
8+
{
9+
//private readonly SqlController sqlController;
10+
11+
public GenerateJasperFilesHandler()
12+
{
13+
//this.sqlController = sqlController;
14+
}
15+
16+
#pragma warning disable 1998
17+
public async Task Handle(GenerateJasperFiles message)
18+
{
19+
//sqlController.NotificationCreate(message.NotificationId, message.MicrotringUUID, Constants.Notifications.UnitActivate);
20+
21+
// Potentially send new message onto local queue
22+
}
23+
}
24+
}

eFormAPI/eFormAPI/Infrastructure/Helpers/EFormCoreHelper.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,17 @@
55
using System.Web.WebPages;
66
using eFormCore;
77
using NLog;
8+
using Castle.Windsor;
9+
using eFormAPI.Web.Installers;
810

911
namespace eFormAPI.Web.Infrastructure.Helpers
1012
{
1113
public class EFormCoreHelper
1214
{
1315
private Core _core;
1416
private readonly Logger Logger = LogManager.GetCurrentClassLogger();
17+
IWindsorContainer container;
18+
1519

1620
#region ExceptionHandling
1721

@@ -75,7 +79,9 @@ public Core GetCore()
7579
try
7680
{
7781
running = _core.StartSqlOnly(connectionStr);
78-
} catch (Exception ex) {
82+
}
83+
catch (Exception ex)
84+
{
7985
AdminTools adminTools = new AdminTools(connectionStr);
8086
adminTools.MigrateDb();
8187
adminTools.DbSettingsReloadRemote();
@@ -84,6 +90,11 @@ public Core GetCore()
8490

8591
if (running)
8692
{
93+
container = new WindsorContainer();
94+
container.Install(
95+
new RebusHandlerInstaller()
96+
, new RebusInstaller(System.Configuration.ConfigurationManager.ConnectionStrings["eFormMainConnection"].ConnectionString)
97+
);
8798
return _core;
8899
}
89100
Logger.Error("Core is not running");
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using Castle.MicroKernel.Registration;
2+
using Castle.MicroKernel.SubSystems.Configuration;
3+
using Castle.Windsor;
4+
using Rebus.Handlers;
5+
6+
namespace eFormAPI.Web.Installers
7+
{
8+
public class RebusHandlerInstaller : IWindsorInstaller
9+
{
10+
public void Install(IWindsorContainer container, IConfigurationStore store)
11+
{
12+
container.Register(Classes.FromThisAssembly()
13+
.BasedOn(typeof(IHandleMessages<>))
14+
.WithServiceBase()
15+
.LifestyleTransient());
16+
}
17+
}
18+
}

0 commit comments

Comments
 (0)