Skip to content

Commit

Permalink
Proposed alpha lab codebase.
Browse files Browse the repository at this point in the history
  • Loading branch information
binodnp committed Feb 15, 2016
1 parent ebe3af2 commit 7b0629e
Show file tree
Hide file tree
Showing 434 changed files with 25,924 additions and 1,348 deletions.
63 changes: 63 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto

###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp

###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary

###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary

###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.hg
.ignored
bin
obj
*.pdb
Expand All @@ -7,4 +8,10 @@ obj
.my
src/Frapid.Web/Catalogs/
DomainsInstalled.json
src/Frapid.Web/Areas/MixERP.Forums/
src/Frapid.Web/Areas/MixERP.Forums/
src/Frapid.Web/Areas/MixERP.We/
src/Frapid.Web/Areas/MixERP.Me/
src/Frapid.Web/Areas/Frapid.Forms/
src/Frapid.Web/logo.png
src/Frapid.Web/logo-inverted.png
src/Frapid.Web/images/
20 changes: 20 additions & 0 deletions builds/with-private-modules.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@echo off
rmdir %~dp0..\src\Frapid.Web\bin /Q /S
@echo Building Frapid.Web.sln
"%programfiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" /verbosity:quiet /nologo /property:Configuration=Debug ../src/Frapid.Web.sln /p:VisualStudioVersion=14.0
@echo Building Frapid Dashboard
"%programfiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" /verbosity:quiet /nologo /property:Configuration=Debug ../src/Frapid.Web/Areas/Frapid.Dashboard/Frapid.Dashboard.sln /p:VisualStudioVersion=14.0
@echo Building Config Module
"%programfiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" /verbosity:quiet /nologo /property:Configuration=Debug ../src/Frapid.Web/Areas/Frapid.Config/Frapid.Config.sln /p:VisualStudioVersion=14.0
@echo Building Core Module
"%programfiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" /verbosity:quiet /nologo /property:Configuration=Debug ../src/Frapid.Web/Areas/Frapid.Core/Frapid.Core.sln /p:VisualStudioVersion=14.0
@echo Building WebsiteBuilder Module
"%programfiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" /verbosity:quiet /nologo /property:Configuration=Debug ../src/Frapid.Web/Areas/Frapid.WebsiteBuilder/Frapid.WebsiteBuilder.sln /p:VisualStudioVersion=14.0
@echo Building Account Module
"%programfiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" /verbosity:quiet /nologo /property:Configuration=Debug ../src/Frapid.Web/Areas/Frapid.Account/Frapid.Account.sln /p:VisualStudioVersion=14.0
@echo Building Forms Module
"%programfiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" /verbosity:quiet /nologo /property:Configuration=Debug ../src/Frapid.Web/Areas/Frapid.Forms/Frapid.Forms.sln /p:VisualStudioVersion=14.0
@echo Building Forums Module
"%programfiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" /verbosity:quiet /nologo /property:Configuration=Debug ../src/Frapid.Web/Areas/MixERP.Forums/MixERP.Forums.sln /p:VisualStudioVersion=14.0
@echo Done
pause
8 changes: 6 additions & 2 deletions src/Frapid.Web/Application/BundleConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ private static string[] GetScrudFactoryView()
{
return new[]
{
"~/Scripts/Modules/ScrudFactory/view/block-begin.js",
"~/Scripts/Modules/ScrudFactory/view/initialization.js",
"~/Scripts/Modules/ScrudFactory/shared/conversion.js",
"~/Scripts/Modules/ScrudFactory/shared/field-factory.js",
Expand Down Expand Up @@ -84,14 +85,16 @@ private static string[] GetScrudFactoryView()
"~/Scripts/Modules/ScrudFactory/view/view-shared.js",
"~/Scripts/Modules/ScrudFactory/view/view-success.js",
"~/Scripts/Modules/ScrudFactory/view/events-on-doc-ready.js",
"~/Scripts/Modules/ScrudFactory/view/events-on-viewready.js"
"~/Scripts/Modules/ScrudFactory/view/events-on-viewready.js",
"~/Scripts/Modules/ScrudFactory/view/block-end.js"
};
}

private static string[] GetScrudFactoryForm()
{
return new[]
{
"~/Scripts/Modules/ScrudFactory/form/block-begin.js",
"~/Scripts/Modules/ScrudFactory/form/initialization.js",
"~/Scripts/Modules/ScrudFactory/shared/conversion.js",
"~/Scripts/Modules/ScrudFactory/shared/field-factory.js",
Expand All @@ -118,7 +121,8 @@ private static string[] GetScrudFactoryForm()
"~/Scripts/Modules/ScrudFactory/form/event-on-doc-ready.js",
"~/Scripts/Modules/ScrudFactory/form/visibility.js",
"~/Scripts/Modules/ScrudFactory/form/trigger-events.js",
"~/Scripts/Modules/ScrudFactory/form/event-on-ajax-stop.js"
"~/Scripts/Modules/ScrudFactory/form/event-on-ajax-stop.js",
"~/Scripts/Modules/ScrudFactory/form/block-end.js"
};
}

Expand Down
26 changes: 26 additions & 0 deletions src/Frapid.Web/Application/EodTaskRegistration.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System;
using Frapid.Web.Jobs;
using Quartz;
using Quartz.Impl;

namespace Frapid.Web
{
public class EodTaskRegistration
{
public static void Register()
{
var factory = new StdSchedulerFactory();
var scheduler = factory.GetScheduler();
scheduler.Start();

var job = JobBuilder.Create<EndOfDayJob>().WithIdentity("DayEndTask", "Reminders").Build();
var trigger = TriggerBuilder.Create()
.WithIdentity("DayEndTask", "Reminders")
.WithSchedule(CronScheduleBuilder.DailyAtHourAndMinute(0, 15)
.InTimeZone(TimeZoneInfo.Local))
.Build();

scheduler.ScheduleJob(job, trigger);
}
}
}
37 changes: 23 additions & 14 deletions src/Frapid.Web/Application/StartupRegistration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,33 @@ public class StartupRegistration
{
public static void Register()
{
var iType = typeof(IStartupRegistration);
var members = AppDomain.CurrentDomain.GetAssemblies()
.SelectMany(x => x.GetTypes())
.Where(x => iType.IsAssignableFrom(x) && !x.IsInterface && !x.IsAbstract)
.Select(Activator.CreateInstance);

foreach (IStartupRegistration member in members)
try
{
try
{
member.Register();
}
catch (Exception ex)
var iType = typeof(IStartupRegistration);
var members = AppDomain.CurrentDomain.GetAssemblies()
.SelectMany(x => x.GetTypes())
.Where(x => iType.IsAssignableFrom(x) && !x.IsInterface && !x.IsAbstract)
.Select(Activator.CreateInstance);

foreach (IStartupRegistration member in members)
{
Log.Error("Could not register the startup job \"{job}\" due to errors. Exception: {Exception}", member.Description, ex);
throw;
try
{
member.Register();
}
catch (Exception ex)
{
Log.Error("Could not register the startup job \"{Description}\" due to errors. Exception: {Exception}", member.Description, ex);
throw;
}
}
}
catch (Exception ex)
{
Log.Error("{Exception}", ex);
throw;
}

}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.Web.Mvc;
using Frapid.Areas;
using Frapid.Areas.Authorization;
using Frapid.Dashboard.Controllers;

namespace Frapid.Account.Controllers.Backend
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Web.Mvc;
using Frapid.Account.ViewModels;
using Frapid.Areas;
using Frapid.Areas.Authorization;
using Frapid.Dashboard.Controllers;

namespace Frapid.Account.Controllers.Backend
Expand Down Expand Up @@ -31,7 +32,7 @@ public ActionResult Index(string file)
public ActionResult Save(Template model)
{
this.SetContents(model.Title, model.Contents);
return Json("OK");
return this.Ok();
}

private string GetContents(string file)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.Web.Mvc;
using Frapid.Areas;
using Frapid.Areas.Authorization;
using Frapid.Dashboard.Controllers;

namespace Frapid.Account.Controllers.Backend
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.Web.Mvc;
using Frapid.Areas;
using Frapid.Areas.Authorization;
using Frapid.Dashboard.Controllers;

namespace Frapid.Account.Controllers.Backend
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ protected ActionResult OnAuthenticated(LoginResult result, SignInInfo model = nu
}

this.Response.Cookies.Add(cookie);
return Json(token.ClientToken);
return this.Ok(token.ClientToken);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Threading.Tasks;
using System.Net;
using System.Threading.Tasks;
using System.Web.Mvc;
using Frapid.Account.InputModels;
using Frapid.Account.RemoteAuthentication;
Expand All @@ -24,7 +25,7 @@ public async Task<ActionResult> GoogleSignInAsync(GoogleAccount account)
}
catch (NpgsqlException)
{
return Json("Access is denied.");
return this.Failed("Access is denied.", HttpStatusCode.Forbidden);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public ActionResult Do(SignInInfo model)
}
catch (NpgsqlException)
{
return Json("Access is denied.");
return this.Failed("Access is denied.", HttpStatusCode.Forbidden);
}
}

Expand All @@ -68,7 +68,7 @@ public ActionResult Do(SignInInfo model)
[AllowAnonymous]
public ActionResult GetOffices()
{
return Json(Offices.GetOffices(), JsonRequestBehavior.AllowGet);
return this.Ok(Offices.GetOffices());
}

[Route("account/sign-in/languages")]
Expand All @@ -90,7 +90,7 @@ from info in
NativeName = info.NativeName
}).ToList();

return Json(languages, JsonRequestBehavior.AllowGet);
return this.Ok(languages);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Web.Mvc;
using System.Web.Security;
using Frapid.Areas;
using Frapid.Account.DAL;
using Frapid.Areas.Authorization;

namespace Frapid.Account.Controllers
{
Expand All @@ -13,7 +14,7 @@ public ActionResult SignOut()
{
if (this.MetaUser != null)
{
DAL.AccessTokens.Revoke(this.MetaUser.ClientToken);
AccessTokens.Revoke(this.MetaUser.ClientToken);
}

FormsAuthentication.SignOut();
Expand Down
Loading

0 comments on commit 7b0629e

Please sign in to comment.