Skip to content

Commit 85ee208

Browse files
committed
Introduce OnTopic 4.0.0
2 parents 19900e6 + b144ea4 commit 85ee208

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+3202
-0
lines changed

.gitignore

Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
## Ignore Visual Studio temporary files, build results, and
2+
## files generated by popular Visual Studio add-ons.
3+
4+
# Archive data (generated by app)
5+
[Ww]ebsite/[Aa]rchives/*/
6+
[Ww]ebsite/[Ss]cripts/
7+
[Ww]ebsite/[Dd]ebug/
8+
9+
# User-specific files
10+
*.suo
11+
*.user
12+
*.sln.docstates
13+
14+
# Build results
15+
[Dd]ebug/
16+
[Dd]ebugPublic/
17+
[Rr]elease/
18+
x64/
19+
build/
20+
bld/
21+
[Bb]in/
22+
[Oo]bj/
23+
*.nupkg
24+
25+
# Roslyn cache directories
26+
*.ide/
27+
28+
# MSTest test Results
29+
[Tt]est[Rr]esult*/
30+
[Bb]uild[Ll]og.*
31+
32+
#NUNIT
33+
*.VisualState.xml
34+
TestResult.xml
35+
36+
# Build Results of an ATL Project
37+
[Dd]ebugPS/
38+
[Rr]eleasePS/
39+
dlldata.c
40+
41+
*_i.c
42+
*_p.c
43+
*_i.h
44+
*.bat
45+
*.ilk
46+
*.meta
47+
*.obj
48+
*.pch
49+
*.pdb
50+
*.pgc
51+
*.pgd
52+
*.rsp
53+
*.sbr
54+
*.tlb
55+
*.tli
56+
*.tlh
57+
*.tmp
58+
*.tmp_proj
59+
*.log
60+
*.vspscc
61+
*.vssscc
62+
.builds
63+
*.pidb
64+
*.svclog
65+
*.scc
66+
67+
# Chutzpah Test files
68+
_Chutzpah*
69+
70+
# Visual C++ cache files
71+
ipch/
72+
*.aps
73+
*.ncb
74+
*.opensdf
75+
*.sdf
76+
*.cachefile
77+
78+
# Visual Studio profiler
79+
*.psess
80+
*.vsp
81+
*.vspx
82+
83+
# TFS 2012 Local Workspace
84+
$tf/
85+
86+
# Guidance Automation Toolkit
87+
*.gpState
88+
89+
# ReSharper is a .NET coding add-in
90+
_ReSharper*/
91+
*.[Rr]e[Ss]harper
92+
*.DotSettings.user
93+
94+
# JustCode is a .NET coding addin-in
95+
.JustCode
96+
97+
# TeamCity is a build add-in
98+
_TeamCity*
99+
100+
# DotCover is a Code Coverage Tool
101+
*.dotCover
102+
103+
# NCrunch
104+
_NCrunch_*
105+
.*crunch*.local.xml
106+
107+
# MightyMoose
108+
*.mm.*
109+
AutoTest.Net/
110+
111+
# Web workbench (sass)
112+
.sass-cache/
113+
114+
# Installshield output folder
115+
[Ee]xpress/
116+
117+
# DocProject is a documentation generator add-in
118+
DocProject/buildhelp/
119+
DocProject/Help/*.HxT
120+
DocProject/Help/*.HxC
121+
DocProject/Help/*.hhc
122+
DocProject/Help/*.hhk
123+
DocProject/Help/*.hhp
124+
DocProject/Help/Html2
125+
DocProject/Help/html
126+
127+
# Click-Once directory
128+
publish/
129+
130+
# Publish Web Output
131+
*.[Pp]ublish.xml
132+
*.azurePubxml
133+
## TODO: Comment the next line if you want to checkin your
134+
## web deploy settings but do note that will include unencrypted
135+
## passwords
136+
#*.pubxml
137+
138+
# NuGet Packages Directory
139+
packages/*
140+
## TODO: If the tool you use requires repositories.config
141+
## uncomment the next line
142+
#!packages/repositories.config
143+
144+
# Enable "build/" folder in the NuGet Packages folder since
145+
# NuGet packages use it for MSBuild targets.
146+
# This line needs to be after the ignore of the build folder
147+
# (and the packages folder if the line above has been uncommented)
148+
!packages/build/
149+
150+
# Windows Azure Build Output
151+
csx/
152+
*.build.csdef
153+
154+
# Windows Store app package directory
155+
AppPackages/
156+
157+
# Others
158+
sql/
159+
*.Cache
160+
ClientBin/
161+
[Ss]tyle[Cc]op.*
162+
~$*
163+
*~
164+
*.dbmdl
165+
*.dbproj.schemaview
166+
*.jfm
167+
*.pfx
168+
*.publishsettings
169+
node_modules/
170+
bower_components/
171+
172+
# RIA/Silverlight projects
173+
Generated_Code/
174+
175+
# Backup & report files from converting an old project file
176+
# to a newer Visual Studio version. Backup files are not needed,
177+
# because we have git ;-)
178+
_UpgradeReport_Files/
179+
Backup*/
180+
UpgradeLog*.XML
181+
UpgradeLog*.htm
182+
183+
# SQL Server files
184+
*.mdf
185+
*.ldf
186+
187+
# Business Intelligence projects
188+
*.rdl.data
189+
*.bim.layout
190+
*.bim_*.settings
191+
192+
# Microsoft Fakes
193+
FakesAssemblies/
194+
195+
# LightSwitch generated files
196+
GeneratedArtifacts/
197+
_Pvt_Extensions/
198+
ModelManifest.xml
199+
.vs
200+
201+
# Custom
202+
ConnectionStrings.config

GitVersion.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
assembly-versioning-scheme: MajorMinorPatch
2+
mode: ContinuousDelivery
3+
branches: {}
4+
ignore:
5+
sha: []
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/*==============================================================================================================================
2+
| Author Ignia, LLC
3+
| Client Ignia, LLC
4+
| Project OnTopicSample OnTopic Site
5+
\=============================================================================================================================*/
6+
using System.Web.Mvc;
7+
using System.Web.Routing;
8+
9+
namespace OnTopic.Web.Mvc.Host {
10+
11+
/*============================================================================================================================
12+
| CLASS: ROUTE CONFIGURATION
13+
\---------------------------------------------------------------------------------------------------------------------------*/
14+
/// <summary>
15+
/// Provides default routing configuration for MVC.
16+
/// </summary>
17+
public static class RouteConfig {
18+
19+
/*==========================================================================================================================
20+
| METHOD: REGISTER ROUTES
21+
\-------------------------------------------------------------------------------------------------------------------------*/
22+
/// <summary>
23+
/// Provided a <see cref="RouteCollection"/>, registers all routes associated with the application.
24+
/// </summary>
25+
/// <param name="routes">
26+
/// The route collection for the server, typically passed from the <see cref="System.Web.HttpApplication"/> class.
27+
/// </param>
28+
public static void RegisterRoutes(RouteCollection routes) {
29+
30+
/*------------------------------------------------------------------------------------------------------------------------
31+
| Handle OnTopic redirects
32+
\-----------------------------------------------------------------------------------------------------------------------*/
33+
routes.MapRoute(
34+
name: "TopicRedirect",
35+
url: "Topic/{topicId}",
36+
defaults: new { controller = "Redirect", action = "Redirect" }
37+
);
38+
39+
/*------------------------------------------------------------------------------------------------------------------------
40+
| Handle OnTopic Web namespace
41+
\-----------------------------------------------------------------------------------------------------------------------*/
42+
routes.MapRoute(
43+
name: "WebTopics",
44+
url: "Web/{*path}",
45+
defaults: new { controller = "Topic", action = "Index", id = UrlParameter.Optional, rootTopic = "Web" }
46+
);
47+
48+
/*------------------------------------------------------------------------------------------------------------------------
49+
| Handle default route convention
50+
\-----------------------------------------------------------------------------------------------------------------------*/
51+
routes.MapRoute(
52+
name: "Default",
53+
url: "{controller}/{action}/{id}",
54+
defaults: new { controller = "Fallback", action = "Index", id = UrlParameter.Optional }
55+
);
56+
57+
}
58+
59+
} //Class
60+
} //Namespace
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*==============================================================================================================================
2+
| Author Ignia, LLC
3+
| Client Ignia, LLC
4+
| Project OnTopicSample OnTopic Site
5+
\=============================================================================================================================*/
6+
using OnTopic.ViewModels;
7+
using OnTopic.Web.Mvc.Controllers;
8+
9+
namespace OnTopic.Web.Mvc.Host.Controllers {
10+
11+
/*============================================================================================================================
12+
| CLASS: ERROR CONTROLLER
13+
\---------------------------------------------------------------------------------------------------------------------------*/
14+
/// <summary>
15+
/// Provides access to the views associated with 400 and 500 error results.
16+
/// </summary>
17+
public class ErrorController : ErrorControllerBase<PageTopicViewModel> {
18+
19+
} // Class
20+
} // Namespace
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
/*==============================================================================================================================
2+
| Author Ignia, LLC
3+
| Client Ignia, LLC
4+
| Project OnTopicSample OnTopic Site
5+
\=============================================================================================================================*/
6+
using System.Threading.Tasks;
7+
using System.Web.Mvc;
8+
using OnTopic.Repositories;
9+
using OnTopic.Web.Mvc.Controllers;
10+
using OnTopic.Web.Mvc.Models;
11+
using OnTopic.ViewModels;
12+
using OnTopic.Mapping.Hierarchical;
13+
14+
namespace OnTopic.Web.Mvc.Host.Controllers {
15+
16+
/*============================================================================================================================
17+
| CLASS: LAYOUT CONTROLLER
18+
\---------------------------------------------------------------------------------------------------------------------------*/
19+
/// <summary>
20+
/// Provides access to the default homepage for the site.
21+
/// </summary>
22+
public class LayoutController : LayoutControllerBase<NavigationTopicViewModel> {
23+
24+
/*==========================================================================================================================
25+
| PRIVATE FIELDS
26+
\-------------------------------------------------------------------------------------------------------------------------*/
27+
private readonly ITopicRepository _topicRepository = null;
28+
29+
/*==========================================================================================================================
30+
| CONSTRUCTOR
31+
\-------------------------------------------------------------------------------------------------------------------------*/
32+
/// <summary>
33+
/// Initializes a new instance of a Topic Controller with necessary dependencies.
34+
/// </summary>
35+
/// <returns>A topic controller for loading OnTopic views.</returns>
36+
public LayoutController(
37+
ITopicRoutingService topicRoutingService,
38+
IHierarchicalTopicMappingService<NavigationTopicViewModel> hierarchicalTopicMappingService,
39+
ITopicRepository topicRepository
40+
) : base(
41+
topicRoutingService,
42+
hierarchicalTopicMappingService
43+
) {
44+
_topicRepository = topicRepository;
45+
}
46+
47+
/*==========================================================================================================================
48+
| PAGE LEVEL NAVIGATION
49+
\-------------------------------------------------------------------------------------------------------------------------*/
50+
/// <summary>
51+
/// Provides page-level navigation for the current page.
52+
/// </summary>
53+
public async Task<PartialViewResult> PageLevelNavigation() {
54+
55+
/*------------------------------------------------------------------------------------------------------------------------
56+
| Establish variables
57+
\-----------------------------------------------------------------------------------------------------------------------*/
58+
var currentTopic = CurrentTopic;
59+
var navigationRootTopic = currentTopic;
60+
61+
/*------------------------------------------------------------------------------------------------------------------------
62+
| Identify navigation root
63+
>-------------------------------------------------------------------------------------------------------------------------
64+
| The navigation root in the case of the page-level navigation any parent of content type "PageGroup".
65+
\-----------------------------------------------------------------------------------------------------------------------*/
66+
if (navigationRootTopic != null) {
67+
while (navigationRootTopic.Parent != null && !navigationRootTopic.ContentType.Equals("PageGroup")) {
68+
navigationRootTopic = navigationRootTopic.Parent;
69+
}
70+
}
71+
72+
if (navigationRootTopic?.Parent == null) navigationRootTopic = null;
73+
74+
/*------------------------------------------------------------------------------------------------------------------------
75+
| Construct view model
76+
\-----------------------------------------------------------------------------------------------------------------------*/
77+
var navigationViewModel = new NavigationViewModel<NavigationTopicViewModel>() {
78+
NavigationRoot = await HierarchicalTopicMappingService.GetRootViewModelAsync(navigationRootTopic),
79+
CurrentKey = CurrentTopic?.GetUniqueKey()
80+
};
81+
82+
/*------------------------------------------------------------------------------------------------------------------------
83+
| Return the corresponding view
84+
\-----------------------------------------------------------------------------------------------------------------------*/
85+
return PartialView(navigationViewModel);
86+
87+
}
88+
89+
} // Class
90+
} // Namespace

OnTopic.Web.Mvc.Host/Global.asax

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<%@ Application Codebehind="Global.asax.cs" Inherits="OnTopic.Web.Mvc.Host.Global" Language="C#" %>

0 commit comments

Comments
 (0)