Skip to content

Commit

Permalink
Project migrated from SVN repository to GIT
Browse files Browse the repository at this point in the history
  • Loading branch information
MandarTisge committed Nov 18, 2014
1 parent a98293b commit bca929c
Show file tree
Hide file tree
Showing 161 changed files with 46,897 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ publish/
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
*/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# If using the old MSBuild-Integrated Package Restore, uncomment this:
Expand Down Expand Up @@ -181,3 +181,9 @@ UpgradeLog*.htm

# Microsoft Fakes
FakesAssemblies/


# FSDTS IgnoreList
*.dll
packages
*/App_Data
20 changes: 20 additions & 0 deletions .nuget/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Antlr" version="3.4.1.9004" targetFramework="net45" />
<package id="bootstrap" version="3.0.0" targetFramework="net45" />
<package id="jQuery" version="1.10.2" targetFramework="net45" />
<package id="log4net" version="2.0.3" targetFramework="net45" />
<package id="Microsoft.AspNet.Mvc" version="5.0.0" targetFramework="net45" />
<package id="Microsoft.AspNet.Razor" version="3.0.0" targetFramework="net45" />
<package id="Microsoft.AspNet.Web.Optimization" version="1.1.1" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi" version="5.0.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.HelpPage" version="5.0.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.WebHost" version="5.0.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebPages" version="3.0.0" targetFramework="net45" />
<package id="Microsoft.Owin" version="2.1.0" targetFramework="net45" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
<package id="Modernizr" version="2.6.2" targetFramework="net45" />
<package id="Owin" version="1.0" targetFramework="net45" />
<package id="Respond" version="1.2.0" targetFramework="net45" />
<package id="WebGrease" version="1.5.2" targetFramework="net45" />
</packages>
33 changes: 33 additions & 0 deletions FSDTS.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.21005.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FSDTS", "FSDTS\FSDTS.csproj", "{8ACDE237-F799-471A-A001-7463CE3D75B3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FSDTS_UnitTest", "FSDTS_UnitTest\FSDTS_UnitTest.csproj", "{55E483C8-FBC8-4780-977B-B8EA6546962F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{C9B72249-0108-4D79-A2C2-48282C4EE37B}"
ProjectSection(SolutionItems) = preProject
.nuget\packages.config = .nuget\packages.config
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8ACDE237-F799-471A-A001-7463CE3D75B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8ACDE237-F799-471A-A001-7463CE3D75B3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8ACDE237-F799-471A-A001-7463CE3D75B3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8ACDE237-F799-471A-A001-7463CE3D75B3}.Release|Any CPU.Build.0 = Release|Any CPU
{55E483C8-FBC8-4780-977B-B8EA6546962F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{55E483C8-FBC8-4780-977B-B8EA6546962F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{55E483C8-FBC8-4780-977B-B8EA6546962F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{55E483C8-FBC8-4780-977B-B8EA6546962F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
43 changes: 43 additions & 0 deletions FSDTS/App_Start/BundleConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//-----------------------------------------------------------------------
// <copyright file="BundleConfig.cs" company="FSD">
// Data Tracking System
// </copyright>
//-----------------------------------------------------------------------

namespace FSDTS
{
using System.Web;
using System.Web.Optimization;

/// <summary>
/// Class BundleConfig.
/// </summary>
public class BundleConfig
{
/// <summary>
/// RegisterBundles method of BundleConfig class.
/// </summary>
/// <param name="bundles">Bundle Collection bundles</param>
////For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js"));

// Use the development version of Modernizr to develop with and learn from. Then, when you're
// ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
"~/Scripts/modernizr-*"));

bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
"~/Scripts/bootstrap.js",
"~/Scripts/respond.js"));

bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/bootstrap.css",
"~/Content/site.css"));

BundleTable.EnableOptimizations = true;
}
}
}
26 changes: 26 additions & 0 deletions FSDTS/App_Start/FilterConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//-----------------------------------------------------------------------
// <copyright file="FilterConfig.cs" company="FSD">
// Data Tracking System
// </copyright>
//-----------------------------------------------------------------------

namespace FSDTS
{
using System.Web;
using System.Web.Mvc;

/// <summary>
/// Class FilterConfig.
/// </summary>
public class FilterConfig
{
/// <summary>
/// RegisterGlobalFilters method of FilterConfig class.
/// </summary>
/// <param name="filters">Global Filter Collection filters</param>
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
}
}
}
34 changes: 34 additions & 0 deletions FSDTS/App_Start/RouteConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//-----------------------------------------------------------------------
// <copyright file="RouteConfig.cs" company="FSD">
// Data Tracking System
// </copyright>
//-----------------------------------------------------------------------
namespace FSDTS
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

/// <summary>
/// RouteConfig class.
/// </summary>
public class RouteConfig
{
/// <summary>
/// RegisterRoutes method of RouteConfig class.
/// </summary>
/// <param name="routes">RouteCollection routes</param>
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional });
}
}
}
65 changes: 65 additions & 0 deletions FSDTS/App_Start/Startup.Auth.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.EntityFramework;
using Microsoft.Owin;
using Microsoft.Owin.Security.Cookies;
using Microsoft.Owin.Security.OAuth;
using Owin;
using FSDTS.Providers;

namespace FSDTS
{
public partial class Startup
{
static Startup()
{
PublicClientId = "self";

UserManagerFactory = () => new UserManager<IdentityUser>(new UserStore<IdentityUser>());

OAuthOptions = new OAuthAuthorizationServerOptions
{
TokenEndpointPath = new PathString("/Token"),
Provider = new ApplicationOAuthProvider(PublicClientId, UserManagerFactory),
AuthorizeEndpointPath = new PathString("/api/Account/ExternalLogin"),
AccessTokenExpireTimeSpan = TimeSpan.FromDays(14),
AllowInsecureHttp = true
};
}

public static OAuthAuthorizationServerOptions OAuthOptions { get; private set; }

public static Func<UserManager<IdentityUser>> UserManagerFactory { get; set; }

public static string PublicClientId { get; private set; }

// For more information on configuring authentication, please visit http://go.microsoft.com/fwlink/?LinkId=301864
public void ConfigureAuth(IAppBuilder app)
{
// Enable the application to use a cookie to store information for the signed in user
// and to use a cookie to temporarily store information about a user logging in with a third party login provider
app.UseCookieAuthentication(new CookieAuthenticationOptions());
app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);

// Enable the application to use bearer tokens to authenticate users
app.UseOAuthBearerTokens(OAuthOptions);

// Uncomment the following lines to enable logging in with third party login providers
//app.UseMicrosoftAccountAuthentication(
// clientId: "",
// clientSecret: "");

//app.UseTwitterAuthentication(
// consumerKey: "",
// consumerSecret: "");

//app.UseFacebookAuthentication(
// appId: "",
// appSecret: "");

//app.UseGoogleAuthentication();
}
}
}
54 changes: 54 additions & 0 deletions FSDTS/App_Start/WebApiConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
//-----------------------------------------------------------------------
// <copyright file="WebApiConfig.cs" company="FSD">
// Data Tracking System
// </copyright>
//-----------------------------------------------------------------------
namespace FSDTS
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Web.Http;
using System.Web.Http.Cors;
using Microsoft.Owin.Security.OAuth;
using Newtonsoft.Json.Serialization;
//using System.Web.Http.OData;

/// <summary>
/// WebApiConfig class.
/// </summary>
public static class WebApiConfig
{
/// <summary>
/// Register method of WebApiConfig class.
/// </summary>
/// <param name="config">HttpConfiguration config</param>
public static void Register(HttpConfiguration config)
{
//// Web API configuration and services
//// Configure Web API to use only bearer token authentication.
config.SuppressDefaultHostAuthentication();
config.Filters.Add(new HostAuthenticationFilter(OAuthDefaults.AuthenticationType));
////config.EnableQuerySupport();
////var cors = new EnableCorsAttribute("*", "*", "*");
////config.EnableCors(cors);

//// Web API routes
config.MapHttpAttributeRoutes();

config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional });

config.Formatters.Remove(config.Formatters.XmlFormatter);

var json = config.Formatters.JsonFormatter;

json.SerializerSettings.Formatting = Newtonsoft.Json.Formatting.Indented;
json.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore;
json.SerializerSettings.PreserveReferencesHandling = Newtonsoft.Json.PreserveReferencesHandling.None;
}
}
}
40 changes: 40 additions & 0 deletions FSDTS/Areas/HelpPage/ApiDescriptionExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
namespace FSDTS.Areas.HelpPage
{
using System;
using System.Text;
using System.Web;
using System.Web.Http.Description;

public static class ApiDescriptionExtensions
{
/// <summary>
/// Generates an URI-friendly ID for the <see cref="ApiDescription"/>. E.g. "Get-Values-id_name" instead of "GetValues/{id}?name={name}"
/// </summary>
/// <param name="description">The <see cref="ApiDescription"/>.</param>
/// <returns>The ID as a string.</returns>
public static string GetFriendlyId(this ApiDescription description)
{
string path = description.RelativePath;
string[] urlParts = path.Split('?');
string localPath = urlParts[0];
string queryKeyString = null;
if (urlParts.Length > 1)
{
string query = urlParts[1];
string[] queryKeys = HttpUtility.ParseQueryString(query).AllKeys;
queryKeyString = String.Join("_", queryKeys);
}

StringBuilder friendlyPath = new StringBuilder();
friendlyPath.AppendFormat("{0}-{1}",
description.HttpMethod.Method,
localPath.Replace("/", "-").Replace("{", String.Empty).Replace("}", String.Empty));
if (queryKeyString != null)
{
friendlyPath.AppendFormat("_{0}", queryKeyString.Replace('.', '-'));
}

return friendlyPath.ToString();
}
}
}
Loading

0 comments on commit bca929c

Please sign in to comment.