-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Brian Wigfield
committed
Sep 7, 2011
1 parent
a6dbdc2
commit 5725b10
Showing
54 changed files
with
8,878 additions
and
394 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using gleanBoard.Domain.Events.Converters; | ||
using SimpleCqrs.Eventing; | ||
|
||
namespace gleanBoard.Domain.Events | ||
{ | ||
public class CardCreatedConverter : IEventConverter<CardCreatedEvent_v1, CardCreatedEvent> | ||
{ | ||
public CardCreatedEvent Convert(CardCreatedEvent_v1 sourceEvent) | ||
{ | ||
return new CardCreatedEvent | ||
{ | ||
AggregateRootId = sourceEvent.AggregateRootId, | ||
EventDate = sourceEvent.EventDate, | ||
Sequence = sourceEvent.Sequence, | ||
Card = sourceEvent.Card, | ||
Description = "No Description", | ||
Lane = sourceEvent.Lane, | ||
Postion = sourceEvent.Postion, | ||
Title = sourceEvent.Title | ||
}; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/gleanBoard/Domain/Events/Converters/CardCreatedEvent_v1.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System; | ||
using SimpleCqrs.Eventing; | ||
|
||
namespace gleanBoard.Domain.Events.Converters | ||
{ | ||
public class CardCreatedEvent_v1 : DomainEvent | ||
{ | ||
public Guid Card { get; set; } | ||
public Guid Lane { get; set; } | ||
public string Title { get; set; } | ||
public int Postion { get; set; } | ||
|
||
public override int GetHashCode() { return 1726483226;} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,21 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using gleanBoard.Domain.Events; | ||
using SimpleCqrs.Eventing; | ||
|
||
namespace gleanBoard.Handlers | ||
{ | ||
public class RebuildData | ||
{ | ||
public DateTime? AsOf { get; set; } | ||
} | ||
|
||
public class RebuildViewsHandler | ||
{ | ||
public RebuildViews Get() | ||
public bool Get(RebuildData data) | ||
{ | ||
var events = Runtime.Locator.Resolve<IEventStore>().GetEventsByEventTypes(new List<Type> { typeof(BoardCreatedEvent), typeof(CardCreatedEvent), typeof(LaneCreatedEvent), typeof(CardMovedEvent) }, DateTime.Now.AddYears(-1), DateTime.Now); | ||
Runtime.Locator.Resolve<IEventBus>().PublishEvents(events); | ||
return new RebuildViews {Result = true}; | ||
Runtime.Locator.Resolve<SimpleCqrs.Utilites.DomainEventReplayer>().ReplayEventsForHandlerType( | ||
typeof(Domain.Views.BoardView), | ||
DateTime.Now.AddYears(-1), | ||
data.AsOf.GetValueOrDefault(DateTime.Now)); | ||
return true; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
using System; | ||
using System.Web.Compilation; | ||
using gleanBoard.Handlers; | ||
using Nancy; | ||
using Nancy.ModelBinding; | ||
|
||
namespace gleanBoard | ||
{ | ||
|
||
public class MyModule : NancyModule | ||
{ | ||
|
||
public MyModule() | ||
{ | ||
|
||
Get["/"] = _ => | ||
{ | ||
var replay = Runtime.Locator.Resolve<SimpleCqrs.Utilites.DomainEventReplayer>(); | ||
var ll = | ||
replay.ExpandEventTypesWithAncestors( | ||
replay.GetDomainEventTypesHandledByHandler(typeof(Domain.Views.BoardView))); | ||
|
||
return View["Views/Home.cshtml"]; | ||
}; | ||
|
||
Get["/board"] = _ => | ||
{ | ||
return View["Views/Board.cshtml", new BoardHandler().Get()]; | ||
}; | ||
|
||
Get["/tools/rebuildviews/{AsOf}"] = _ => | ||
{ | ||
var asOf = DateTime.Now; | ||
DateTime.TryParse(_.AsOf, out asOf); | ||
return View[new RebuildViewsHandler().Get(new RebuildData{ AsOf = asOf })]; | ||
}; | ||
|
||
Get["/signup"] = _ => | ||
{ | ||
return View["Views/SignUp.cshtml"]; | ||
}; | ||
|
||
Post["/signup"] = _ => | ||
{ | ||
return View[new SignUpHandler().Post(this.Bind<SignUpData>())]; | ||
}; | ||
|
||
Post["/card/create"] = _ => | ||
{ | ||
return View[new CardHandler().Post(this.Bind<NewCardData>())]; | ||
}; | ||
|
||
Post["/card/move"] = _ => | ||
{ | ||
return View[new MoveCardHandler().Post(this.Bind<MoveCardHandler.MoveLaneData>())]; | ||
}; | ||
|
||
Post["/lane/create"] = _ => | ||
{ | ||
return View[new LaneHandler().Post(this.Bind<NewLaneData>())]; | ||
}; | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,10 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Web; | ||
|
||
namespace gleanBoard.Resources | ||
namespace gleanBoard.Resources | ||
{ | ||
public class NewCard | ||
{ | ||
public string Id { get; set; } | ||
public string Title { get; set; } | ||
public string Lane { get; set; } | ||
public string Description { get; set; } | ||
} | ||
} |
Oops, something went wrong.