Skip to content
Browse files

Nuking repository

  • Loading branch information...
1 parent 1fe2ac4 commit d2b45c49fe48c9761c2eae2923f7f4614777372a @synhershko synhershko committed
Showing with 9 additions and 6,566 deletions.
  1. +9 −0 .gitignore
  2. +0 −14 Orev.Tests/App.config
  3. +0 −402 Orev.Tests/Controllers/AccountControllerTest.cs
  4. +0 −42 Orev.Tests/Controllers/HomeControllerTest.cs
  5. +0 −48 Orev.Tests/Domain/Corpora.cs
  6. +0 −102 Orev.Tests/Domain/Judgments.cs
  7. +0 −29 Orev.Tests/Domain/Schema.cs
  8. +0 −70 Orev.Tests/Domain/Topics.cs
  9. +0 −105 Orev.Tests/Domain/Users.cs
  10. +0 −113 Orev.Tests/Orev.Tests.csproj
  11. BIN Orev.Tests/Orev.sdf
  12. +0 −35 Orev.Tests/Properties/AssemblyInfo.cs
  13. +0 −12 Orev.Tests/hibernate.cfg.xml
  14. +0 −37 Orev.sln
  15. +0 −18 OrevLib/Class1.cs
  16. +0 −16 OrevLib/Domain/Corpus.cs
  17. +0 −11 OrevLib/Domain/IOrevEntity.cs
  18. +0 −22 OrevLib/Domain/Judgment.cs
  19. +0 −17 OrevLib/Domain/Topic.cs
  20. +0 −39 OrevLib/Domain/User.cs
  21. +0 −28 OrevLib/Helpers/Encryption.cs
  22. +0 −88 OrevLib/Helpers/Randomizer.cs
  23. +0 −49 OrevLib/Mappings/Orev.hbm.xml
  24. +0 −44 OrevLib/Orev.cd
  25. +0 −88 OrevLib/OrevLib.csproj
  26. +0 −36 OrevLib/Properties/AssemblyInfo.cs
  27. +0 −21 OrevLib/Repositories/CorporaRepository.cs
  28. +0 −23 OrevLib/Repositories/IRepository.cs
  29. +0 −41 OrevLib/Repositories/NHibernateHelpers.cs
  30. +0 −172 OrevLib/Repositories/NHibernateRepository.cs
  31. +0 −48 OrevWeb/Common/NHibernateHelpers.cs
  32. +0 −94 OrevWeb/Common/OrevHelpers.cs
  33. +0 −351 OrevWeb/Content/Site.css
  34. +0 −158 OrevWeb/Controllers/AccountController.cs
  35. +0 −115 OrevWeb/Controllers/CorporaController.cs
  36. +0 −31 OrevWeb/Controllers/HomeController.cs
  37. +0 −167 OrevWeb/Controllers/JudgeController.cs
  38. +0 −162 OrevWeb/Controllers/TopicsController.cs
  39. +0 −1 OrevWeb/Global.asax
  40. +0 −34 OrevWeb/Global.asax.cs
  41. +0 −283 OrevWeb/Models/AccountModels.cs
  42. +0 −158 OrevWeb/OrevWeb.csproj
  43. +0 −35 OrevWeb/Properties/AssemblyInfo.cs
  44. +0 −52 OrevWeb/Views/Account/ChangePassword.aspx
  45. +0 −12 OrevWeb/Views/Account/ChangePasswordSuccess.aspx
  46. +0 −46 OrevWeb/Views/Account/LogOn.aspx
  47. +0 −60 OrevWeb/Views/Account/Register.aspx
  48. +0 −51 OrevWeb/Views/Corpora/Create.aspx
  49. +0 −11 OrevWeb/Views/Home/Index.aspx
  50. +0 −74 OrevWeb/Views/Judge/Index.aspx
  51. +0 −28 OrevWeb/Views/Judge/SelectLanguage.aspx
  52. +0 −26 OrevWeb/Views/Judge/SelectTopic.aspx
  53. +0 −11 OrevWeb/Views/Shared/Error.aspx
  54. +0 −14 OrevWeb/Views/Shared/LogOnUserControl.ascx
  55. +0 −42 OrevWeb/Views/Shared/Site.Master
  56. +0 −72 OrevWeb/Views/Topics/Create.aspx
  57. +0 −11 OrevWeb/Views/Topics/Index.aspx
  58. +0 −27 OrevWeb/Views/Topics/Languages.aspx
  59. +0 −64 OrevWeb/Views/Topics/List.aspx
  60. +0 −34 OrevWeb/Views/Web.config
  61. +0 −202 OrevWeb/Web.config
  62. +0 −28 OrevWeb/hibernate.cfg.xml
  63. BIN Shared/NHibernate/Antlr3.Runtime.dll
  64. +0 −22 Shared/NHibernate/Configuration_Templates/MSSQL.cfg.xml
  65. +0 −17 Shared/NHibernate/Configuration_Templates/MySql.cfg.xml
  66. +0 −17 Shared/NHibernate/Configuration_Templates/SQLite.cfg.xml
  67. BIN Shared/NHibernate/Iesi.Collections.dll
  68. BIN Shared/NHibernate/LinFu.DynamicProxy.dll
  69. +0 −167 Shared/NHibernate/LinFu.License.txt
  70. BIN Shared/NHibernate/NHibernate.ByteCode.LinFu.dll
  71. +0 −8 Shared/NHibernate/NHibernate.ByteCode.LinFu.xml
  72. BIN Shared/NHibernate/NHibernate.Linq.dll
  73. BIN Shared/NHibernate/NHibernate.dll
  74. BIN Shared/NHibernate/log4net.dll
  75. +0 −201 Shared/NHibernate/log4net.license.txt
  76. +0 −215 Shared/NHibernate/nhibernate-configuration.xsd
  77. +0 −1,695 Shared/NHibernate/nhibernate-mapping.xsd
View
9 .gitignore
@@ -4,9 +4,18 @@
# exclude patterns (uncomment them if you want to use them):
# *.[oa]
# *~
+_legacy/
OrevWeb/Corpora
obj
bin
+[Dd]ebug/
+[Rr]elease/
+build/
+[Bb]in/
+[Oo]bj/
+[Hh]elp/
*.suo
+*.sln.cache
+_ReSharper.*/
*.user
~$*
View
14 Orev.Tests/App.config
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!--
- Note: Add entries to the App.config file for configuration settings
- that apply only to the Test project.
--->
-<configuration>
- <appSettings>
-
- </appSettings>
-
- <connectionStrings>
-
- </connectionStrings>
-</configuration>
View
402 Orev.Tests/Controllers/AccountControllerTest.cs
@@ -1,402 +0,0 @@
-using System;
-using System.Security.Principal;
-using System.Web;
-using System.Web.Mvc;
-using System.Web.Routing;
-using System.Web.Security;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-using Orev;
-using Orev.Controllers;
-using Orev.Models;
-
-namespace Orev.Tests.Controllers
-{
-
- [TestClass]
- public class AccountControllerTest
- {
-
- [TestMethod]
- public void ChangePassword_Get_ReturnsView()
- {
- // Arrange
- AccountController controller = GetAccountController();
-
- // Act
- ActionResult result = controller.ChangePassword();
-
- // Assert
- Assert.IsInstanceOfType(result, typeof(ViewResult));
- Assert.AreEqual(10, ((ViewResult)result).ViewData["PasswordLength"]);
- }
-
- [TestMethod]
- public void ChangePassword_Post_ReturnsRedirectOnSuccess()
- {
- // Arrange
- AccountController controller = GetAccountController();
- ChangePasswordModel model = new ChangePasswordModel()
- {
- OldPassword = "goodOldPassword",
- NewPassword = "goodNewPassword",
- ConfirmPassword = "goodNewPassword"
- };
-
- // Act
- ActionResult result = controller.ChangePassword(model);
-
- // Assert
- Assert.IsInstanceOfType(result, typeof(RedirectToRouteResult));
- RedirectToRouteResult redirectResult = (RedirectToRouteResult)result;
- Assert.AreEqual("ChangePasswordSuccess", redirectResult.RouteValues["action"]);
- }
-
- [TestMethod]
- public void ChangePassword_Post_ReturnsViewIfChangePasswordFails()
- {
- // Arrange
- AccountController controller = GetAccountController();
- ChangePasswordModel model = new ChangePasswordModel()
- {
- OldPassword = "goodOldPassword",
- NewPassword = "badNewPassword",
- ConfirmPassword = "badNewPassword"
- };
-
- // Act
- ActionResult result = controller.ChangePassword(model);
-
- // Assert
- Assert.IsInstanceOfType(result, typeof(ViewResult));
- ViewResult viewResult = (ViewResult)result;
- Assert.AreEqual(model, viewResult.ViewData.Model);
- Assert.AreEqual("The current password is incorrect or the new password is invalid.", controller.ModelState[""].Errors[0].ErrorMessage);
- Assert.AreEqual(10, viewResult.ViewData["PasswordLength"]);
- }
-
- [TestMethod]
- public void ChangePassword_Post_ReturnsViewIfModelStateIsInvalid()
- {
- // Arrange
- AccountController controller = GetAccountController();
- ChangePasswordModel model = new ChangePasswordModel()
- {
- OldPassword = "goodOldPassword",
- NewPassword = "goodNewPassword",
- ConfirmPassword = "goodNewPassword"
- };
- controller.ModelState.AddModelError("", "Dummy error message.");
-
- // Act
- ActionResult result = controller.ChangePassword(model);
-
- // Assert
- Assert.IsInstanceOfType(result, typeof(ViewResult));
- ViewResult viewResult = (ViewResult)result;
- Assert.AreEqual(model, viewResult.ViewData.Model);
- Assert.AreEqual(10, viewResult.ViewData["PasswordLength"]);
- }
-
- [TestMethod]
- public void ChangePasswordSuccess_ReturnsView()
- {
- // Arrange
- AccountController controller = GetAccountController();
-
- // Act
- ActionResult result = controller.ChangePasswordSuccess();
-
- // Assert
- Assert.IsInstanceOfType(result, typeof(ViewResult));
- }
-
- [TestMethod]
- public void LogOff_LogsOutAndRedirects()
- {
- // Arrange
- AccountController controller = GetAccountController();
-
- // Act
- ActionResult result = controller.LogOff();
-
- // Assert
- Assert.IsInstanceOfType(result, typeof(RedirectToRouteResult));
- RedirectToRouteResult redirectResult = (RedirectToRouteResult)result;
- Assert.AreEqual("Home", redirectResult.RouteValues["controller"]);
- Assert.AreEqual("Index", redirectResult.RouteValues["action"]);
- Assert.IsTrue(((MockFormsAuthenticationService)controller.FormsService).SignOut_WasCalled);
- }
-
- [TestMethod]
- public void LogOn_Get_ReturnsView()
- {
- // Arrange
- AccountController controller = GetAccountController();
-
- // Act
- ActionResult result = controller.LogOn();
-
- // Assert
- Assert.IsInstanceOfType(result, typeof(ViewResult));
- }
-
- [TestMethod]
- public void LogOn_Post_ReturnsRedirectOnSuccess_WithoutReturnUrl()
- {
- // Arrange
- AccountController controller = GetAccountController();
- LogOnModel model = new LogOnModel()
- {
- UserName = "someUser",
- Password = "goodPassword",
- RememberMe = false
- };
-
- // Act
- ActionResult result = controller.LogOn(model, null);
-
- // Assert
- Assert.IsInstanceOfType(result, typeof(RedirectToRouteResult));
- RedirectToRouteResult redirectResult = (RedirectToRouteResult)result;
- Assert.AreEqual("Home", redirectResult.RouteValues["controller"]);
- Assert.AreEqual("Index", redirectResult.RouteValues["action"]);
- Assert.IsTrue(((MockFormsAuthenticationService)controller.FormsService).SignIn_WasCalled);
- }
-
- [TestMethod]
- public void LogOn_Post_ReturnsRedirectOnSuccess_WithReturnUrl()
- {
- // Arrange
- AccountController controller = GetAccountController();
- LogOnModel model = new LogOnModel()
- {
- UserName = "someUser",
- Password = "goodPassword",
- RememberMe = false
- };
-
- // Act
- ActionResult result = controller.LogOn(model, "/someUrl");
-
- // Assert
- Assert.IsInstanceOfType(result, typeof(RedirectResult));
- RedirectResult redirectResult = (RedirectResult)result;
- Assert.AreEqual("/someUrl", redirectResult.Url);
- Assert.IsTrue(((MockFormsAuthenticationService)controller.FormsService).SignIn_WasCalled);
- }
-
- [TestMethod]
- public void LogOn_Post_ReturnsViewIfModelStateIsInvalid()
- {
- // Arrange
- AccountController controller = GetAccountController();
- LogOnModel model = new LogOnModel()
- {
- UserName = "someUser",
- Password = "goodPassword",
- RememberMe = false
- };
- controller.ModelState.AddModelError("", "Dummy error message.");
-
- // Act
- ActionResult result = controller.LogOn(model, null);
-
- // Assert
- Assert.IsInstanceOfType(result, typeof(ViewResult));
- ViewResult viewResult = (ViewResult)result;
- Assert.AreEqual(model, viewResult.ViewData.Model);
- }
-
- [TestMethod]
- public void LogOn_Post_ReturnsViewIfValidateUserFails()
- {
- // Arrange
- AccountController controller = GetAccountController();
- LogOnModel model = new LogOnModel()
- {
- UserName = "someUser",
- Password = "badPassword",
- RememberMe = false
- };
-
- // Act
- ActionResult result = controller.LogOn(model, null);
-
- // Assert
- Assert.IsInstanceOfType(result, typeof(ViewResult));
- ViewResult viewResult = (ViewResult)result;
- Assert.AreEqual(model, viewResult.ViewData.Model);
- Assert.AreEqual("The user name or password provided is incorrect.", controller.ModelState[""].Errors[0].ErrorMessage);
- }
-
- [TestMethod]
- public void Register_Get_ReturnsView()
- {
- // Arrange
- AccountController controller = GetAccountController();
-
- // Act
- ActionResult result = controller.Register();
-
- // Assert
- Assert.IsInstanceOfType(result, typeof(ViewResult));
- Assert.AreEqual(10, ((ViewResult)result).ViewData["PasswordLength"]);
- }
-
- [TestMethod]
- public void Register_Post_ReturnsRedirectOnSuccess()
- {
- // Arrange
- AccountController controller = GetAccountController();
- RegisterModel model = new RegisterModel()
- {
- UserName = "someUser",
- Email = "goodEmail",
- Password = "goodPassword",
- ConfirmPassword = "goodPassword"
- };
-
- // Act
- ActionResult result = controller.Register(model);
-
- // Assert
- Assert.IsInstanceOfType(result, typeof(RedirectToRouteResult));
- RedirectToRouteResult redirectResult = (RedirectToRouteResult)result;
- Assert.AreEqual("Home", redirectResult.RouteValues["controller"]);
- Assert.AreEqual("Index", redirectResult.RouteValues["action"]);
- }
-
- [TestMethod]
- public void Register_Post_ReturnsViewIfRegistrationFails()
- {
- // Arrange
- AccountController controller = GetAccountController();
- RegisterModel model = new RegisterModel()
- {
- UserName = "duplicateUser",
- Email = "goodEmail",
- Password = "goodPassword",
- ConfirmPassword = "goodPassword"
- };
-
- // Act
- ActionResult result = controller.Register(model);
-
- // Assert
- Assert.IsInstanceOfType(result, typeof(ViewResult));
- ViewResult viewResult = (ViewResult)result;
- Assert.AreEqual(model, viewResult.ViewData.Model);
- Assert.AreEqual("Username already exists. Please enter a different user name.", controller.ModelState[""].Errors[0].ErrorMessage);
- Assert.AreEqual(10, viewResult.ViewData["PasswordLength"]);
- }
-
- [TestMethod]
- public void Register_Post_ReturnsViewIfModelStateIsInvalid()
- {
- // Arrange
- AccountController controller = GetAccountController();
- RegisterModel model = new RegisterModel()
- {
- UserName = "someUser",
- Email = "goodEmail",
- Password = "goodPassword",
- ConfirmPassword = "goodPassword"
- };
- controller.ModelState.AddModelError("", "Dummy error message.");
-
- // Act
- ActionResult result = controller.Register(model);
-
- // Assert
- Assert.IsInstanceOfType(result, typeof(ViewResult));
- ViewResult viewResult = (ViewResult)result;
- Assert.AreEqual(model, viewResult.ViewData.Model);
- Assert.AreEqual(10, viewResult.ViewData["PasswordLength"]);
- }
-
- private static AccountController GetAccountController()
- {
- AccountController controller = new AccountController()
- {
- FormsService = new MockFormsAuthenticationService(),
- MembershipService = new MockMembershipService()
- };
- controller.ControllerContext = new ControllerContext()
- {
- Controller = controller,
- RequestContext = new RequestContext(new MockHttpContext(), new RouteData())
- };
- return controller;
- }
-
- private class MockFormsAuthenticationService : IFormsAuthenticationService
- {
- public bool SignIn_WasCalled;
- public bool SignOut_WasCalled;
-
- public void SignIn(string userName, bool createPersistentCookie)
- {
- // verify that the arguments are what we expected
- Assert.AreEqual("someUser", userName);
- Assert.IsFalse(createPersistentCookie);
-
- SignIn_WasCalled = true;
- }
-
- public void SignOut()
- {
- SignOut_WasCalled = true;
- }
- }
-
- private class MockHttpContext : HttpContextBase
- {
- private readonly IPrincipal _user = new GenericPrincipal(new GenericIdentity("someUser"), null /* roles */);
-
- public override IPrincipal User
- {
- get
- {
- return _user;
- }
- set
- {
- base.User = value;
- }
- }
- }
-
- private class MockMembershipService : IMembershipService
- {
- public int MinPasswordLength
- {
- get { return 10; }
- }
-
- public bool ValidateUser(string userName, string password)
- {
- return (userName == "someUser" && password == "goodPassword");
- }
-
- public MembershipCreateStatus CreateUser(string userName, string password, string email)
- {
- if (userName == "duplicateUser")
- {
- return MembershipCreateStatus.DuplicateUserName;
- }
-
- // verify that values are what we expected
- Assert.AreEqual("goodPassword", password);
- Assert.AreEqual("goodEmail", email);
-
- return MembershipCreateStatus.Success;
- }
-
- public bool ChangePassword(string userName, string oldPassword, string newPassword)
- {
- return (userName == "someUser" && oldPassword == "goodOldPassword" && newPassword == "goodNewPassword");
- }
- }
-
- }
-}
View
42 Orev.Tests/Controllers/HomeControllerTest.cs
@@ -1,42 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Web.Mvc;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-using Orev;
-using Orev.Controllers;
-
-namespace Orev.Tests.Controllers
-{
- [TestClass]
- public class HomeControllerTest
- {
- [TestMethod]
- public void Index()
- {
- // Arrange
- HomeController controller = new HomeController();
-
- // Act
- ViewResult result = controller.Index() as ViewResult;
-
- // Assert
- ViewDataDictionary viewData = result.ViewData;
- Assert.AreEqual("Welcome to ASP.NET MVC!", viewData["Message"]);
- }
-
- //[TestMethod]
- //public void About()
- //{
- // // Arrange
- // HomeController controller = new HomeController();
-
- // // Act
- // ViewResult result = controller.About() as ViewResult;
-
- // // Assert
- // Assert.IsNotNull(result);
- //}
- }
-}
View
48 Orev.Tests/Domain/Corpora.cs
@@ -1,48 +0,0 @@
-using System;
-using System.Text;
-using System.Collections.Generic;
-using System.Linq;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-using Orev.Domain;
-using Orev.Helpers;
-using NHibernate;
-
-using CorpusRepository = Orev.Repositories.NHibernateRepository<Orev.Domain.Corpus>;
-
-namespace Orev.Tests.Domain
-{
- /// <summary>
- /// Summary description for Corpora
- /// </summary>
- [TestClass]
- [DeploymentItem(@"Orev.Tests\Orev.sdf")]
- [DeploymentItem(@"Orev.Tests\hibernate.cfg.xml")]
- public class Corpora
- {
- public Corpora()
- {
- }
-
- /// <summary>
- ///Gets or sets the test context which provides
- ///information about and functionality for the current test run.
- ///</summary>
- public TestContext TestContext { get; set; }
-
- [ClassInitialize]
- public static void InitTests(TestContext testContext)
- {
- Schema.GenerateSchema(); // Reset DB
- }
-
- [TestMethod]
- public void CanAddCorpus()
- {
- var crp = new Corpus { Name = "Test corpus", Description = "test", Language = "en-US", Path = "/test/" };
- using (var rep = new CorpusRepository())
- rep.Add(crp);
-
- Assert.IsTrue(crp.Id > 0);
- }
- }
-}
View
102 Orev.Tests/Domain/Judgments.cs
@@ -1,102 +0,0 @@
-using System;
-using System.Text;
-using System.Collections.Generic;
-using System.Linq;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-using Orev.Domain;
-using Orev.Helpers;
-using NHibernate;
-
-using UsersRepository = Orev.Repositories.NHibernateRepository<Orev.Domain.User>;
-using TopicsRepository = Orev.Repositories.NHibernateRepository<Orev.Domain.Topic>;
-using CorpusRepository = Orev.Repositories.NHibernateRepository<Orev.Domain.Corpus>;
-using JudgmentsRepository = Orev.Repositories.NHibernateRepository<Orev.Domain.Judgment>;
-
-namespace Orev.Tests.Domain
-{
- /// <summary>
- /// Summary description for Judgements
- /// </summary>
- [TestClass]
- [DeploymentItem(@"Orev.Tests\Orev.sdf")]
- [DeploymentItem(@"Orev.Tests\hibernate.cfg.xml")]
- public class Judgments
- {
- public Judgments()
- {
- }
-
- /// <summary>
- ///Gets or sets the test context which provides
- ///information about and functionality for the current test run.
- ///</summary>
- public TestContext TestContext { get; set; }
-
- public static Corpus testCorpus;
- public static Topic testTopic;
- public static User testUser;
-
- [ClassInitialize]
- public static void InitTests(TestContext testContext)
- {
- Schema.GenerateSchema(); // Reset DB
-
- // Add a corpus
- testCorpus = new Corpus { Name = "Test corpus", Description = "test", Language = "en-US", Path = "/test/" };
- using (var rep = new CorpusRepository())
- rep.Add(testCorpus);
-
- // Add a topic
- testTopic = new Topic { Title = "test topic", Description = "desc", Narrator = "narr", Language = "en-US" };
- using (var rep = new TopicsRepository())
- rep.Add(testTopic);
-
- // Add a test user
- testUser = new User { Email = "test@test.com", Registered = DateTime.Now, LastSeen = DateTime.Now };
- testUser.SetPassword("testPassword");
-
- using (var rep = new UsersRepository())
- rep.Add(testUser);
- }
-
- [TestMethod]
- public void CanAddJudgment()
- {
- var j = new Judgment
- {
- CorpusId = testCorpus.Id,
- DocumentId = "A",
- TopicId = testTopic.Id,
- UserId = testUser.Id,
- UserJudgement = false
- };
-
- using (var rep = new JudgmentsRepository())
- rep.Add(j);
-
- Assert.IsTrue(j.Id > 0);
- }
-
- [TestMethod]
- public void CanLoadByCorpusId()
- {
- // Add a judgement
- var j = new Judgment
- {
- CorpusId = testCorpus.Id,
- DocumentId = "B",
- TopicId = testTopic.Id,
- UserId = testUser.Id,
- UserJudgement = false
- };
-
- using (var rep = new JudgmentsRepository()){
- rep.Add(j);
-
- var judgments = rep.All(J => J.CorpusId == testCorpus.Id);
-
- Assert.IsTrue(judgments.Count() > 0);
- }
- }
- }
-}
View
29 Orev.Tests/Domain/Schema.cs
@@ -1,29 +0,0 @@
-using System;
-using Orev.Domain;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-using NHibernate.Cfg;
-using NHibernate.Tool.hbm2ddl;
-
-namespace Orev.Tests.Domain
-{
- [TestClass]
- [DeploymentItem(@"Orev.Tests\Orev.sdf")]
- [DeploymentItem(@"Orev.Tests\hibernate.cfg.xml")]
- public class Schema
- {
- public static Configuration GenerateSchema()
- {
- var cfg = new Configuration();
- cfg.Configure();
- new SchemaExport(cfg).Execute(true, true, false);
-
- return cfg;
- }
-
- [TestMethod]
- public void CanGenerateSchema()
- {
- GenerateSchema();
- }
- }
-}
View
70 Orev.Tests/Domain/Topics.cs
@@ -1,70 +0,0 @@
-using System;
-using System.Text;
-using System.Collections.Generic;
-using System.Linq;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-using Orev.Domain;
-using Orev.Helpers;
-using NHibernate;
-
-using TopicsRepository = Orev.Repositories.NHibernateRepository<Orev.Domain.Topic>;
-
-namespace Orev.Tests.Domain
-{
- /// <summary>
- /// Summary description for Topics
- /// </summary>
- [TestClass]
- [DeploymentItem(@"Orev.Tests\Orev.sdf")]
- [DeploymentItem(@"Orev.Tests\hibernate.cfg.xml")]
- public class Topics
- {
- public Topics()
- {
- }
-
- /// <summary>
- ///Gets or sets the test context which provides
- ///information about and functionality for the current test run.
- ///</summary>
- public TestContext TestContext { get; set; }
-
- public static ISession session;
-
- [ClassInitialize]
- public static void InitTests(TestContext testContext)
- {
- Schema.GenerateSchema(); // Reset DB
- }
-
- [TestMethod]
- public void CanAddTopic()
- {
- var topic = new Topic { Title = "test topic", Description = "desc", Narrator = "narr", Language = "en-US" };
-
- using (var rep = new TopicsRepository())
- rep.Add(topic);
-
- Assert.IsTrue(topic.Id > 0);
- }
-
- [TestMethod]
- public void CanLoadTopicById()
- {
- var topic = new Topic { Title = "test topic", Description = "desc", Narrator = "narr", Language = "en-US" };
-
- using (var rep = new TopicsRepository())
- rep.Add(topic);
-
- Assert.IsTrue(topic.Id > 0);
- int topicId = topic.Id;
-
- using (var rep = new TopicsRepository())
- {
- Topic t = rep.SingleOrDefault(T => T.Id == topicId);
- Assert.IsTrue(t != null);
- Assert.IsTrue(topicId == t.Id);
- }
- }
- }
-}
View
105 Orev.Tests/Domain/Users.cs
@@ -1,105 +0,0 @@
-using System;
-using System.Text;
-using System.Collections.Generic;
-using System.Linq;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-using Orev.Domain;
-using Orev.Helpers;
-using NHibernate;
-
-using UsersRepository = Orev.Repositories.NHibernateRepository<Orev.Domain.User>;
-
-namespace Orev.Tests.Domain
-{
- /// <summary>
- /// Summary description for Users
- /// </summary>
- [TestClass]
- [DeploymentItem(@"Orev.Tests\Orev.sdf")]
- [DeploymentItem(@"Orev.Tests\hibernate.cfg.xml")]
- public class Users
- {
- public Users()
- {
- }
-
- /// <summary>
- ///Gets or sets the test context which provides
- ///information about and functionality for the current test run.
- ///</summary>
- public TestContext TestContext { get; set; }
-
- public static ISession session;
-
- [ClassInitialize]
- public static void InitTests(TestContext testContext)
- {
- Schema.GenerateSchema(); // Reset DB
- }
-
- [TestMethod]
- public void CanCreateUser()
- {
- var usr = new User { Email = "test@test.com", Registered = DateTime.Now, LastSeen = DateTime.Now };
- usr.SetPassword("testPassword");
-
- using (var rep = new UsersRepository())
- rep.Add(usr);
-
- Assert.IsTrue(usr.Id > 0);
- }
-
- [TestMethod]
- public void VerifyDistinctEmails()
- {
- try
- {
- // Depending on the execution order, the first call could raise the expected exception
- CanCreateUser();
- CanCreateUser();
- }
- catch
- {
- return;
- }
-
- Assert.IsTrue(false, "More than one user with the same e-mail exist");
- }
-
- [TestMethod]
- public void CanAuthenticate()
- {
- const String email = "auth_test@test.com";
- const String pwd = "testPasswordAuth";
-
- var usr = new User { Email = email, Registered = DateTime.Now, LastSeen = DateTime.Now };
- usr.SetPassword(pwd);
-
- using (var rep = new UsersRepository())
- {
- rep.Add(usr);
- Assert.IsTrue(usr.Id > 0);
- }
-
- using (var rep = new UsersRepository())
- {
- User u = rep.SingleOrDefault(U => U.Email == email);
-
- Assert.IsTrue(u.Authenticate(pwd));
- Assert.IsTrue(usr.Id == u.Id);
- }
- }
-
- [TestMethod]
- public void CanChangePassword()
- {
- var usr = new User { Email = "pwd@test.com", Registered = DateTime.Now, LastSeen = DateTime.Now };
- usr.SetPassword("1234");
-
- Assert.IsTrue(usr.Authenticate("1234"));
-
- usr.SetPassword("4321");
- Assert.IsTrue(usr.Authenticate("4321"));
- }
- }
-}
View
113 Orev.Tests/Orev.Tests.csproj
@@ -1,113 +0,0 @@
-<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>9.0.30729</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{822C2CE0-8072-4000-920C-20E32D4813EA}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Orev.Tests</RootNamespace>
- <AssemblyName>Orev.Tests</AssemblyName>
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="LinFu.DynamicProxy, Version=1.0.3.14911, Culture=neutral, PublicKeyToken=62a6874124340d6e, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Shared\NHibernate\LinFu.DynamicProxy.dll</HintPath>
- </Reference>
- <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
- <Reference Include="NHibernate, Version=2.1.2.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Shared\NHibernate\NHibernate.dll</HintPath>
- </Reference>
- <Reference Include="NHibernate.ByteCode.LinFu, Version=2.1.2.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Shared\NHibernate\NHibernate.ByteCode.LinFu.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.ComponentModel.DataAnnotations">
- <RequiredTargetFramework>3.5</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.Configuration" />
- <Reference Include="System.Core">
- <RequiredTargetFramework>3.5</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.Data" />
- <Reference Include="System.Data.DataSetExtensions">
- <RequiredTargetFramework>3.5</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.Data.SqlServerCe, Version=3.5.1.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
- <Private>True</Private>
- </Reference>
- <Reference Include="System.Web" />
- <Reference Include="System.Web.Extensions">
- <RequiredTargetFramework>3.5</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.Web.Abstractions" />
- <Reference Include="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>C:\Program Files\Microsoft ASP.NET\ASP.NET MVC 2\\Assemblies\System.Web.Mvc.dll</HintPath>
- </Reference>
- <Reference Include="System.Web.Routing" />
- <Reference Include="System.Xml" />
- <Reference Include="System.Xml.Linq">
- <RequiredTargetFramework>3.5</RequiredTargetFramework>
- </Reference>
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Domain\Corpora.cs" />
- <Compile Include="Domain\Judgments.cs" />
- <Compile Include="Domain\Topics.cs" />
- <Compile Include="Domain\Users.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="Controllers\HomeControllerTest.cs" />
- <Compile Include="Controllers\AccountControllerTest.cs" />
- <Compile Include="Domain\Schema.cs" />
- </ItemGroup>
- <ItemGroup>
- <Content Include="App.config" />
- <EmbeddedResource Include="hibernate.cfg.xml">
- </EmbeddedResource>
- <Content Include="Orev.sdf">
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
- </Content>
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\OrevLib\OrevLib.csproj">
- <Project>{77BA6F00-14D7-4844-815A-6073199B293C}</Project>
- <Name>OrevLib</Name>
- </ProjectReference>
- <ProjectReference Include="..\OrevWeb\OrevWeb.csproj">
- <Project>{F26A9A5E-0D65-4EAC-83D5-B45F46EBE857}</Project>
- <Name>OrevWeb</Name>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
-</Project>
View
BIN Orev.Tests/Orev.sdf
Binary file not shown.
View
35 Orev.Tests/Properties/AssemblyInfo.cs
@@ -1,35 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("Orev.Tests")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("Orev.Tests")]
-[assembly: AssemblyCopyright("Copyright © 2010")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("50ee4f10-e6ee-491d-81e0-668ac15c047c")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Revision and Build Numbers
-// by using the '*' as shown below:
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
View
12 Orev.Tests/hibernate.cfg.xml
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
- <session-factory>
- <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
- <property name="dialect">NHibernate.Dialect.MsSqlCeDialect</property>
- <property name="connection.driver_class">NHibernate.Driver.SqlServerCeDriver</property>
- <property name="connection.connection_string">Data Source=Orev.sdf</property>
- <property name="proxyfactory.factory_class">NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu</property>
- <property name="show_sql">true</property>
- <mapping assembly="OrevLib" />
- </session-factory>
-</hibernate-configuration>
View
37 Orev.sln
@@ -1,37 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OrevWeb", "OrevWeb\OrevWeb.csproj", "{F26A9A5E-0D65-4EAC-83D5-B45F46EBE857}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orev.Tests", "Orev.Tests\Orev.Tests.csproj", "{822C2CE0-8072-4000-920C-20E32D4813EA}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{4EA3713C-1F2D-48D6-9299-ABF8771802ED}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OrevLib", "OrevLib\OrevLib.csproj", "{77BA6F00-14D7-4844-815A-6073199B293C}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {F26A9A5E-0D65-4EAC-83D5-B45F46EBE857}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {F26A9A5E-0D65-4EAC-83D5-B45F46EBE857}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {F26A9A5E-0D65-4EAC-83D5-B45F46EBE857}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {F26A9A5E-0D65-4EAC-83D5-B45F46EBE857}.Release|Any CPU.Build.0 = Release|Any CPU
- {822C2CE0-8072-4000-920C-20E32D4813EA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {822C2CE0-8072-4000-920C-20E32D4813EA}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {822C2CE0-8072-4000-920C-20E32D4813EA}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {822C2CE0-8072-4000-920C-20E32D4813EA}.Release|Any CPU.Build.0 = Release|Any CPU
- {77BA6F00-14D7-4844-815A-6073199B293C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {77BA6F00-14D7-4844-815A-6073199B293C}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {77BA6F00-14D7-4844-815A-6073199B293C}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {77BA6F00-14D7-4844-815A-6073199B293C}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(NestedProjects) = preSolution
- {822C2CE0-8072-4000-920C-20E32D4813EA} = {4EA3713C-1F2D-48D6-9299-ABF8771802ED}
- EndGlobalSection
-EndGlobal
View
18 OrevLib/Class1.cs
@@ -1,18 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-// http://nhforge.org/wikis/howtonh/your-first-nhibernate-based-application.aspx
-// http://www.theserverside.net/tt/articles/showarticle.tss?id=NHibernate
-// http://www.theserverside.net/tt/articles/showarticle.tss?id=NHibernateP2
-// http://www.sharplearningcurve.com/blog/post/2010/01/22/My-Crash-Course-In-High-Performance-NHibernate.aspx
-// http://www.guerillaprogrammer.com/jakew/post/2008/05/14/NHibernate-e28093-my-crash-introduction.aspx
-// http://daniel.wertheim.se/category/entity-storage/nhibernate-entity-storage/
-
-namespace OrevLib
-{
- public class Class1
- {
- }
-}
View
16 OrevLib/Domain/Corpus.cs
@@ -1,16 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace Orev.Domain
-{
- public class Corpus : IOrevEntity
- {
- public virtual int Id { get; set; }
- public virtual String Name { get; set; }
- public virtual String Description { get; set; }
- public virtual String Language { get; set; } // a language identifier string, en-US for example
- public virtual String Path { get; set; }
- }
-}
View
11 OrevLib/Domain/IOrevEntity.cs
@@ -1,11 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace Orev.Domain
-{
- public interface IOrevEntity
- {
- }
-}
View
22 OrevLib/Domain/Judgment.cs
@@ -1,22 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace Orev.Domain
-{
- public class Judgment : IOrevEntity
- {
- // Yes, we could use NHibernate's session.Load to load object proxies instead of somewhat
- // breaking the ORM/UoW logic of using object references, as we do below.
- // However, since a Judgment object is merely a small data unit which will hardly be loaded
- // back from storage, doing proper persistence is not our main concern.
-
- public virtual int Id { get; set; }
- public virtual int CorpusId { get; set; }
- public virtual String DocumentId { get; set; }
- public virtual int TopicId { get; set; }
- public virtual int UserId { get; set; }
- public virtual bool UserJudgement { get; set; }
- }
-}
View
17 OrevLib/Domain/Topic.cs
@@ -1,17 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace Orev.Domain
-{
- public class Topic : IOrevEntity
- {
- public virtual int Id { get; set; }
- public virtual String Title { get; set; }
- public virtual String Description { get; set; }
- public virtual String Narrator { get; set; }
- public virtual String Language { get; set; } // a language identifier string, en-US for example
- public virtual String SubmitterEmail { get; set; }
- }
-}
View
39 OrevLib/Domain/User.cs
@@ -1,39 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Orev.Helpers;
-
-namespace Orev.Domain
-{
- public class User : IOrevEntity
- {
- protected static readonly byte SaltLength = 5;
-
- // TODO: User roles, user status
-
- public virtual int Id { get; set; }
- public virtual String Email { get; set; }
-
- /// <summary>
- /// Hashed password, can only be set by consumers - use SetPassword(String) to do that
- /// </summary>
- public virtual String Password { get; set; }
- public virtual String Salt { get; set; }
-
- public virtual void SetPassword(String plainTextPwd)
- {
- Salt = Randomizer.GetRandomString(5, true, true);
- Password = Encryption.HashString(Salt + plainTextPwd);
- }
-
- public virtual bool Authenticate(String plainTextPwd)
- {
- String hashedPwd = Encryption.HashString(Salt + plainTextPwd);
- return Password.CompareTo(hashedPwd) == 0;
- }
-
- public virtual DateTime Registered { get; set; }
- public virtual DateTime LastSeen { get; set; }
- }
-}
View
28 OrevLib/Helpers/Encryption.cs
@@ -1,28 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace Orev.Helpers
-{
- public static class Encryption
- {
- public static string HashString(string str)
- {
- string rethash = "";
- try
- {
- System.Security.Cryptography.SHA1 hash = System.Security.Cryptography.SHA1.Create();
- System.Text.ASCIIEncoding encoder = new System.Text.ASCIIEncoding();
- byte[] combined = encoder.GetBytes(str);
- hash.ComputeHash(combined);
- rethash = Convert.ToBase64String(hash.Hash);
- }
- catch (Exception ex)
- {
- throw new Exception("Error in HashCode : " + ex.Message);
- }
- return rethash;
- }
- }
-}
View
88 OrevLib/Helpers/Randomizer.cs
@@ -1,88 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace Orev.Helpers
-{
- public class Randomizer
- {
- private static System.Random _RandomGen;
- private static System.Random RandomGen
- {
-
- get
- {
- if (_RandomGen == null)
- {
- _RandomGen = new System.Random();
- }
- return _RandomGen;
- }
- }
-
- /// <summary>
- /// gets a random string
- /// </summary>
- /// <param name="Length"></param>
- /// <param name="IncludeSpecialCharacters"></param>
- /// <param name="IncludeNumbers"></param>
- /// <returns></returns>
- public static string GetRandomString(int Length, bool IncludeSpecialCharacters, bool IncludeNumbers)
- {
- string returnval = "";
- for (int i = 1; i <= Length; i++)
- {
- returnval += GetRandomChar(IncludeSpecialCharacters, IncludeNumbers).ToString();
- }
- return returnval;
- }
-
- /// <summary>
- /// Gets a Random Character
- /// </summary>
- /// <param name="IncludeSpecialCharacters"></param>
- /// <param name="IncludeNumbers"></param>
- /// <returns></returns>
- public static char GetRandomChar(bool IncludeSpecialCharacters, bool IncludeNumbers)
- {
- //33-47 , 58-64, 91-96, 123-126 special characters
- //48-57 numbers
- //65-90 uppercase letters
- //97-122 lowercase letters
-
- bool GetNewChar = true;
- int randint = 0;
- if (IncludeNumbers && IncludeSpecialCharacters)
- {
- randint = RandomGen.Next(33, 122);
- }
- else if (IncludeNumbers)
- {
- //get a number between 48 and 122 but not between 58 and 64
- while (GetNewChar)
- {
- randint = RandomGen.Next(48, 122);
- GetNewChar = (randint >= 58 && randint <= 64) || (randint >= 91 && randint <= 96);
- }
- }
- else if (IncludeSpecialCharacters)
- {
- while (GetNewChar)
- {
- randint = RandomGen.Next(33, 122);
- GetNewChar = (randint >= 48 && randint <= 57);
- }
- }
- else
- {
- while (GetNewChar)
- {
- randint = RandomGen.Next(65, 122);
- GetNewChar = (randint >= 91 && randint <= 96);
- }
- }
- return Convert.ToChar(char.ConvertFromUtf32(randint));
- }
- }
-}
View
49 OrevLib/Mappings/Orev.hbm.xml
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
- assembly="OrevLib"
- namespace="Orev.Domain">
-
- <class name="Corpus" table="Orev_Corpora">
- <id name="Id" type="System.Int32">
- <generator class="hilo" />
- </id>
- <property name="Name" />
- <property name="Description" />
- <property name="Language" index="IDXCorpusLang" length="5" />
- <property name="Path" />
- </class>
-
- <class name="Topic" table="Orev_Topics">
- <id name="Id" type="System.Int32">
- <generator class="hilo" />
- </id>
- <property name="Title" />
- <property name="Description" length="8000" />
- <property name="Narrator" length="8000" />
- <property name="Language" index="IDXTopicLang" length="5" />
- <property name="SubmitterEmail" />
- </class>
-
- <class name="User" table="Orev_Users">
- <id name="Id" type="System.Int32">
- <generator class="hilo" />
- </id>
- <property name="Email" not-null="true" index="IDXUserEmail" unique="true" />
- <property name="Password" not-null="true" />
- <property name="Salt" length="10" />
- <property name="Registered" />
- <property name="LastSeen" />
- </class>
-
- <class name="Judgment" table="Orev_Judgments">
- <id name="Id" type="System.Int32">
- <generator class="hilo" />
- </id>
- <property name="CorpusId" not-null="true" index="IDXCorpusID" />
- <property name="DocumentId" not-null="true" index="IDXDocumentId" />
- <property name="TopicId" not-null="true" index="IDXTopicId" />
- <property name="UserId" not-null="true" index="IDXUserId" />
- <property name="UserJudgement" not-null="true" />
- </class>
-
-</hibernate-mapping>
View
44 OrevLib/Orev.cd
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<ClassDiagram MajorVersion="1" MinorVersion="1">
- <Comment CommentText="A Judgment points to a Corpus (and stores the specific document ID), Topic and User, and stores the judgment (true = relevant)">
- <Position X="4.635" Y="0.635" Height="0.719" Width="1.94" />
- </Comment>
- <Class Name="Orev.Domain.Corpus">
- <Position X="6.75" Y="0.5" Width="1.5" />
- <TypeIdentifier>
- <HashCode>AAACAAAACAAgAAIAAAAAAAQAAAAAAAAAAAAAAAAAAAA=</HashCode>
- <FileName>Domain\Corpus.cs</FileName>
- </TypeIdentifier>
- </Class>
- <Class Name="Orev.Domain.Judgment">
- <Position X="4.75" Y="1.5" Width="1.5" />
- <TypeIdentifier>
- <HashCode>AAACAEgAAAAAACAAAAAAAAgCAAAAAAAAAAAAAAAAAAA=</HashCode>
- <FileName>Domain\Judgement.cs</FileName>
- </TypeIdentifier>
- </Class>
- <Class Name="Orev.Domain.Topic">
- <Position X="6.75" Y="2.25" Width="1.5" />
- <TypeIdentifier>
- <HashCode>AAACAAAACAAgAEAAAAAAAAAAgAAAAAAAAAAAAAAAAAA=</HashCode>
- <FileName>Domain\Topic.cs</FileName>
- </TypeIdentifier>
- </Class>
- <Class Name="Orev.Domain.User">
- <Position X="2.75" Y="1.5" Width="1.5" />
- <Members>
- <Method Name="Authenticate" Hidden="true" />
- <Field Name="SaltLength" Hidden="true" />
- <Method Name="SetPassword" Hidden="true" />
- </Members>
- <Compartments>
- <Compartment Name="Fields" Collapsed="true" />
- <Compartment Name="Methods" Collapsed="true" />
- </Compartments>
- <TypeIdentifier>
- <HashCode>AABCAAAAACAAgAAAEAAAAAIAAAAAAAACAAAggAAAAAA=</HashCode>
- <FileName>Domain\User.cs</FileName>
- </TypeIdentifier>
- </Class>
- <Font Name="Tahoma" Size="8.25" />
-</ClassDiagram>
View
88 OrevLib/OrevLib.csproj
@@ -1,88 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>9.0.30729</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{77BA6F00-14D7-4844-815A-6073199B293C}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Orev</RootNamespace>
- <AssemblyName>OrevLib</AssemblyName>
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- <TargetFrameworkSubset>Full</TargetFrameworkSubset>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="NHibernate, Version=2.1.2.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Shared\NHibernate\NHibernate.dll</HintPath>
- </Reference>
- <Reference Include="NHibernate.Linq, Version=1.1.0.1001, Culture=neutral, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Shared\NHibernate\NHibernate.Linq.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Core">
- <RequiredTargetFramework>3.5</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.Data.SqlServerCe, Version=3.5.1.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
- <Private>True</Private>
- </Reference>
- <Reference Include="System.Xml.Linq">
- <RequiredTargetFramework>3.5</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.Data.DataSetExtensions">
- <RequiredTargetFramework>3.5</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Class1.cs" />
- <Compile Include="Domain\Corpus.cs" />
- <Compile Include="Domain\IOrevEntity.cs" />
- <Compile Include="Domain\Judgment.cs" />
- <Compile Include="Domain\User.cs" />
- <Compile Include="Helpers\Encryption.cs" />
- <Compile Include="Repositories\CorporaRepository.cs" />
- <Compile Include="Repositories\IRepository.cs" />
- <Compile Include="Domain\Topic.cs" />
- <Compile Include="Helpers\Randomizer.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="Repositories\NHibernateHelpers.cs" />
- <Compile Include="Repositories\NHibernateRepository.cs" />
- </ItemGroup>
- <ItemGroup>
- <EmbeddedResource Include="Mappings\Orev.hbm.xml" />
- </ItemGroup>
- <ItemGroup>
- <None Include="Orev.cd" />
- </ItemGroup>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
-</Project>
View
36 OrevLib/Properties/AssemblyInfo.cs
@@ -1,36 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("OrevLib")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("OrevLib")]
-[assembly: AssemblyCopyright("Copyright © 2010")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("568a4e05-c965-43fb-90d8-2ac03dae23f3")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
View
21 OrevLib/Repositories/CorporaRepository.cs
@@ -1,21 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Orev.Domain;
-
-namespace Orev.Repositories
-{
- public class CorporaRepository : NHibernateRepository<Corpus>
- {
- /// <summary>
- /// Pulls a corpus by language identifier, also can be used to prioritize corpora
- /// </summary>
- /// <param name="lang"></param>
- /// <returns></returns>
- public virtual Corpus SelectCorpusForLanguage(string lang)
- {
- return SingleOrDefault(C => C.Language == lang);
- }
- }
-}
View
23 OrevLib/Repositories/IRepository.cs
@@ -1,23 +0,0 @@
-using System;
-using System.Linq;
-using System.Linq.Expressions;
-using System.Collections.Generic;
-
-namespace Orev.Repositories
-{
- public interface IRepository<T>
- where T : class, Orev.Domain.IOrevEntity
- {
- void Commit();
- void Rollback();
-
- void Add(T item);
- void Update(T item);
- void Delete(T item);
-
- T SingleOrDefault(Expression<Func<T, bool>> query);
- IEnumerable<T> All(Expression<Func<T, bool>> query);
- int Count(Expression<Func<T, bool>> query);
- IEnumerable<T> Distinct(IEqualityComparer<T> comparer);
- }
-}
View
41 OrevLib/Repositories/NHibernateHelpers.cs
@@ -1,41 +0,0 @@
-using System;
-
-using NHibernate;
-using NHibernate.Cfg;
-using NHibernate.Tool.hbm2ddl;
-
-namespace Orev.Domain
-{
- public class NHibernateHelpers
- {
- public static Configuration GenerateSchema()
- {
- var cfg = new Configuration();
- cfg.Configure();
- new SchemaExport(cfg).Execute(true, true, false);
-
- return cfg;
- }
-
- /*private static ISessionFactory _sessionFactory;
-
- private static ISessionFactory SessionFactory
- {
- get
- {
- if (_sessionFactory == null)
- {
- var configuration = new Configuration();
- configuration.Configure();
- _sessionFactory = configuration.BuildSessionFactory();
- }
- return _sessionFactory;
- }
- }
-
- public static ISession OpenSession()
- {
- return SessionFactory.OpenSession();
- }*/
- }
-}
View
172 OrevLib/Repositories/NHibernateRepository.cs
@@ -1,172 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-using NHibernate;
-using NHibernate.Linq;
-using NHibernate.Cfg;
-
-namespace Orev.Repositories
-{
- public class NHibernateRepository<T> : IRepository<T>, IDisposable
- where T : class, Orev.Domain.IOrevEntity
- {
- #region SessionFactory
-
- private static ISessionFactory _sessionFactory;
-
- private static ISessionFactory SessionFactory
- {
- get
- {
- if (_sessionFactory == null)
- {
- var configuration = new Configuration();
- configuration.Configure();
- _sessionFactory = configuration.BuildSessionFactory();
- }
- return _sessionFactory;
- }
- }
-
- public static ISession OpenSession()
- {
- return SessionFactory.OpenSession();
- }
-
- #endregion
-
- private ISession NHSession { get; set; }
- private ITransaction Transaction { get; set; }
-
- public bool OwnsSession { get; set; }
- public bool ManualTransactions { get; set; }
-
- public NHibernateRepository()
- {
- this.NHSession = OpenSession();
- OwnsSession = true;
- ManualTransactions = false;
- }
-
- public NHibernateRepository(ISession session)
- {
- this.NHSession = session;
- OwnsSession = false;
- ManualTransactions = false;
- }
-
- /// <summary>
- /// Allows sharing a session and a transaction between repositories
- /// </summary>
- public NHibernateRepository(ISession session, ITransaction transaction)
- {
- this.NHSession = session;
- this.Transaction = transaction;
- OwnsSession = false;
- ManualTransactions = true;
- }
-
- #region Transactions
- public void BeginTransaction()
- {
- if (Transaction != null)
- Transaction.Dispose();
-
- Transaction = NHSession.BeginTransaction();
- }
-
- public void Commit()
- {
- Transaction.Commit();
- Transaction.Dispose();
- Transaction = null;
- }
-
- public void Rollback()
- {
- Transaction.Rollback();
- Transaction.Dispose();
- Transaction = null;
- }
- #endregion
-
- #region IRepository<T> Members
-
- public virtual void Add(T item)
- {
- if (!ManualTransactions) BeginTransaction();
- NHSession.Save(item);
- if (!ManualTransactions) Commit();
- }
-
- public virtual void Update(T item)
- {
- if (!ManualTransactions) BeginTransaction();
- NHSession.Update(item);
- if (!ManualTransactions) Commit();
- }
-
- public virtual void Delete(T item)
- {
- if (!ManualTransactions) BeginTransaction();
- NHSession.Delete(item);
- if (!ManualTransactions) Commit();
- }
-
- public virtual T SingleOrDefault(System.Linq.Expressions.Expression<Func<T, bool>> query)
- {
- return NHSession.Linq<T>().SingleOrDefault(query);
- }
-
- public virtual IEnumerable<T> All(System.Linq.Expressions.Expression<Func<T, bool>> query)
- {
- return NHSession.Linq<T>().Where(query).ToList();
- }
-
- public virtual int Count(System.Linq.Expressions.Expression<Func<T, bool>> query)
- {
- return NHSession.Linq<T>().Count(query);
- }
-
- public virtual IEnumerable<T> Distinct(IEqualityComparer<T> comparer)
- {
- return NHSession.Linq<T>().Distinct(comparer);
- }
-
- #endregion
-
- #region IDisposable Members
-
- public virtual void Dispose()
- {
- Dispose(true);
- }
-
- private void Dispose(bool disposing)
- {
- if (disposing)
- {
- if (Transaction != null)
- {
- Transaction.Rollback();
- Transaction.Dispose();
- Transaction = null;
- }
- if (OwnsSession && NHSession != null)
- {
- NHSession.Dispose();
- NHSession = null;
- }
- }
- }
-
- ~NHibernateRepository()
- {
- Dispose(false);
- }
-
- #endregion
- }
-}
View
48 OrevWeb/Common/NHibernateHelpers.cs
@@ -1,48 +0,0 @@
-using System;
-
-using NHibernate;
-using NHibernate.Cfg;
-using NHibernate.Tool.hbm2ddl;
-
-namespace OrevWeb.Helpers
-{
- public class NHibernateHelpers
- {
- public static Configuration GenerateSchema()
- {
- var cfg = new Configuration();
- cfg.Configure();
- new SchemaExport(cfg).Execute(false, true, false);
- return cfg;
- }
-
- public static Configuration UpdateSchema()
- {
- var cfg = new Configuration();
- cfg.Configure();
- new SchemaUpdate(cfg).Execute(false, true);
- return cfg;
- }
-
- private static ISessionFactory _sessionFactory;
-
- private static ISessionFactory SessionFactory
- {
- get
- {
- if (_sessionFactory == null)
- {
- var configuration = new Configuration();
- configuration.Configure();
- _sessionFactory = configuration.BuildSessionFactory();
- }
- return _sessionFactory;
- }
- }
-
- public static ISession OpenSession()
- {
- return SessionFactory.OpenSession();
- }
- }
-}
View
94 OrevWeb/Common/OrevHelpers.cs
@@ -1,94 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Web;
-using System.IO;
-
-using Orev.Domain;
-using JudgmentsRepository = Orev.Repositories.NHibernateRepository<Orev.Domain.Judgment>;
-
-namespace Orev.Common
-{
- public class TopicLanguageEqualityComparer : IEqualityComparer<Topic>
- {
- public bool Equals(Topic t1, Topic t2)
- {
- if (t1.Language == null)
- return false;
- if (t1.Language.Equals(t2))
- return true;
- return false;
- }
-
- public int GetHashCode(Topic t)
- {
- return t.GetHashCode();
- }
- }
-
- public static class OrevHelpers
- {
- private static Dictionary<int, LinkedList<string>> CorporaFiles = new Dictionary<int, LinkedList<string>>();
-
- public static string GetNextCorpusFile(Corpus c)
- {
- string ret = null;
-
- lock (CorporaFiles)
- {
- LinkedList<string> files = null;
- if (!CorporaFiles.TryGetValue(c.Id, out files) || files == null || files.Count == 0)
- {
- files = LoadCorpusFiles(c);
- if (files != null && files.Count > 0)
- {
- CorporaFiles.Remove(c.Id);
- CorporaFiles[c.Id] = files;
- }
- }
-
- if (files != null && files.Count > 0)
- {
- ret = files.First.Value;
- files.RemoveFirst();
- return ret;
- }
- }
-
- return null;
- }
-
- private static LinkedList<string> LoadCorpusFiles(Corpus c) // synced by caller
- {
- // TODO: If no files left that are not judged, set the corpus's status to "complete"
-
- string fullPath = HttpContext.Current.Request.PhysicalApplicationPath + c.Path;
-
- DirectoryInfo di = new DirectoryInfo(fullPath);
- if (di.Exists)
- {
- FileInfo[] rgFiles = di.GetFiles("*.htm*");
- LinkedList<string> filesList = new LinkedList<string>();
-
- using (var rep = new JudgmentsRepository())
- {
- foreach (FileInfo fi in rgFiles)
- {
- // Only add documents that are not judged yet
- if (rep.All(
- J =>
- J.CorpusId == c.Id
- && J.DocumentId
- .Equals(fi.Name)
- ).Count() == 0
- )
- filesList.AddLast(fi.Name);
- }
- }
-
- return filesList;
- }
- return null;
- }
- }
-}
View
351 OrevWeb/Content/Site.css
@@ -1,351 +0,0 @@
-/*----------------------------------------------------------
-The base color for this template is #5c87b2. If you'd like
-to use a different color start by replacing all instances of
-#5c87b2 with your new color.
-----------------------------------------------------------*/
-body
-{
- background-color: #5c87b2;
- font-size: .75em;
- font-family: Verdana, Helvetica, Sans-Serif;
- margin: 0;
- padding: 0;
- color: #696969;
-}
-
-a:link
-{
- color: #034af3;
- text-decoration: underline;
-}
-a:visited
-{
- color: #505abc;
-}
-a:hover
-{
- color: #1d60ff;
- text-decoration: none;
-}
-a:active
-{
- color: #12eb87;
-}
-
-p, ul
-{
- margin-bottom: 20px;
- line-height: 1.6em;
-}
-
-/* HEADINGS
-----------------------------------------------------------*/
-h1, h2, h3, h4, h5, h6
-{
- font-size: 1.5em;
- color: #000;
- font-family: Arial, Helvetica, sans-serif;
-}
-
-h1
-{
- font-size: 2em;
- padding-bottom: 0;
- margin-bottom: 0;
-}
-h2
-{
- padding: 0 0 10px 0;
-}
-h3
-{
- font-size: 1.2em;
-}
-h4
-{
- font-size: 1.1em;
-}
-h5, h6
-{
- font-size: 1em;
-}
-
-/* this rule styles <h2> tags that are the
-first child of the left and right table columns */
-.rightColumn > h1, .rightColumn > h2, .leftColumn > h1, .leftColumn > h2
-{
- margin-top: 0;
-}
-
-/* PRIMARY LAYOUT ELEMENTS
-----------------------------------------------------------*/
-
-/* you can specify a greater or lesser percentage for the
-page width. Or, you can specify an exact pixel width. */
-.page
-{
- width: 90%;
- margin-left: auto;
- margin-right: auto;
-}
-
-#header
-{
- position: relative;
- margin-bottom: 0px;
- color: #000;
- padding: 0;
-}
-
-#header h1
-{
- font-weight: bold;
- padding: 5px 0;
- margin: 0;
- color: #fff;
- border: none;
- line-height: 2em;
- font-family: Arial, Helvetica, sans-serif;
- font-size: 32px !important;
-}
-
-#main
-{
- padding: 30px 30px 15px 30px;
- background-color: #fff;
- margin-bottom: 30px;
- _height: 1px; /* only IE6 applies CSS properties starting with an underscore */
-}
-
-#footer
-{
- color: #999;
- padding: 10px 0;
- text-align: center;
- line-height: normal;
- margin: 0;
- font-size: .9em;
-}
-
-/* TAB MENU
-----------------------------------------------------------*/
-ul#menu
-{
- border-bottom: 1px #5C87B2 solid;
- padding: 0 0 2px;
- position: relative;
- margin: 0;
- text-align: right;
-}
-
-ul#menu li
-{
- display: inline;
- list-style: none;
-}
-
-ul#menu li#greeting
-{
- padding: 10px 20px;
- font-weight: bold;
- text-decoration: none;
- line-height: 2.8em;
- color: #fff;
-}
-
-ul#menu li a
-{
- padding: 10px 20px;
- font-weight: bold;
- text-decoration: none;
- line-height: 2.8em;
- background-color: #e8eef4;
- color: #034af3;
-}
-
-ul#menu li a:hover
-{
- background-color: #fff;
- text-decoration: none;
-}
-
-ul#menu li a:active
-{
- background-color: #a6e2a6;
- text-decoration: none;
-}
-
-ul#menu li.selected a
-{
- background-color: #fff;
- color: #000;
-}
-
-/* FORM LAYOUT ELEMENTS
-----------------------------------------------------------*/
-
-fieldset
-{
- margin: 1em 0;
- padding: 1em;
- border: 1px solid #CCC;
-}
-
-fieldset p
-{
- margin: 2px 12px 10px 10px;
-}
-
-legend
-{
- font-size: 1.1em;
- font-weight: 600;
- padding: 2px 4px 8px 4px;
-}
-
-input[type="text"]
-{
- width: 200px;
- border: 1px solid #CCC;
-}
-
-input[type="password"]
-{
- width: 200px;
- border: 1px solid #CCC;
-}
-
-/* TABLE
-----------------------------------------------------------*/
-
-table
-{
- border: solid 1px #e8eef4;
- border-collapse: collapse;
-}
-
-table td
-{
- padding: 5px;
- border: solid 1px #e8eef4;
-}
-
-table th
-{
- padding: 6px 5px;
- text-align: left;
- background-color: #e8eef4;
- border: solid 1px #e8eef4;
-}
-
-/* MISC
-----------------------------------------------------------*/
-.clear
-{
- clear: both;
-}
-
-.error
-{
- color:Red;
-}
-
-#menucontainer
-{
- margin-top:40px;
-}
-
-div#title
-{
- display:block;
- float:left;
- text-align:left;
-}
-
-#logindisplay
-{
- font-size:1.1em;
- display:block;
- text-align:right;
- margin:10px;
- color:White;
-}
-
-#logindisplay a:link
-{
- color: white;
- text-decoration: underline;
-}
-
-#logindisplay a:visited
-{
- color: white;
- text-decoration: underline;
-}
-
-#logindisplay a:hover
-{
- color: white;
- text-decoration: none;
-}
-
-/* Styles for validation helpers
------------------------------------------------------------*/
-.field-validation-error
-{
- color: #ff0000;
-}
-
-.field-validation-valid
-{
- display: none;
-}
-
-.input-validation-error
-{
- border: 1px solid #ff0000;
- background-color: #ffeeee;
-}
-
-.validation-summary-errors
-{
- font-weight: bold;
- color: #ff0000;
-}
-
-.validation-summary-valid
-{
- display: none;
-}
-
-/* Styles for editor and display helpers
-----------------------------------------------------------*/
-.display-label,
-.editor-label,
-.display-field,
-.editor-field
-{
- margin: 0.5em 0;
-}
-
-.text-box
-{