diff --git a/BExIS++.sln b/BExIS++.sln index b5f2dae32..0fb584eb3 100644 --- a/BExIS++.sln +++ b/BExIS++.sln @@ -2176,8 +2176,8 @@ Global {0E5F4B53-398A-4634-9921-03B9CACBE8E0} = {B3E28333-80F7-4853-9DAE-253D8E8454C5} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {9B6E4921-8EBA-487D-A098-3E473A0EAC64} EnterpriseLibraryConfigurationToolBinariesPath = packages\Unity.2.1.505.0\lib\NET35;packages\Unity.2.1.505.2\lib\NET35 + SolutionGuid = {9B6E4921-8EBA-487D-A098-3E473A0EAC64} EndGlobalSection GlobalSection(SubversionScc) = preSolution Svn-Managed = True diff --git a/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/ComponentConfigController.cs b/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/ComponentConfigController.cs index 628366059..ab9e7ec62 100644 --- a/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/ComponentConfigController.cs +++ b/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/ComponentConfigController.cs @@ -3,11 +3,14 @@ using Newtonsoft.Json; using System.IO; using System.Web.Mvc; +using System.Web.SessionState; using Vaiona.Utils.Cfg; namespace BExIS.Modules.Dcm.UI.Controllers { + + [SessionState(SessionStateBehavior.ReadOnly)] public class ComponentConfigController : Controller { public ActionResult Index(long id = 0) diff --git a/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/CreateController.cs b/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/CreateController.cs index b2005d499..2742b2e76 100644 --- a/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/CreateController.cs +++ b/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/CreateController.cs @@ -1,4 +1,4 @@ -using BExIS.App.Bootstrap.Attributes; +using BExIS.App.Bootstrap.Attributes; using BExIS.Dim.Entities.Mappings; using BExIS.Dim.Helpers.Mappings; using BExIS.Dim.Services.Mappings; @@ -29,9 +29,11 @@ using System.Xml.XPath; using Vaiona.Entities.Common; using BExIS.Utils.Config; +using System.Web.SessionState; namespace BExIS.Modules.Dcm.UI.Controllers { + [SessionState(SessionStateBehavior.ReadOnly)] public class CreateController : Controller { private readonly GroupManager _groupManager; diff --git a/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/EditController.cs b/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/EditController.cs index a2e089b1a..38b76c17e 100644 --- a/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/EditController.cs +++ b/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/EditController.cs @@ -9,12 +9,15 @@ using System; using System.Collections.Generic; using System.Web.Mvc; +using System.Web.SessionState; namespace BExIS.Modules.Dcm.UI.Controllers -{ +{ + [SessionState(SessionStateBehavior.ReadOnly)] public class EditController : Controller { // GET: Edit + [BExISEntityAuthorize(typeof(Dataset), "id", RightType.Write)] public ActionResult Index(long id, int version = 0) { diff --git a/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/EntityTemplatesController.cs b/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/EntityTemplatesController.cs index 8d2ce0a23..455f32313 100644 --- a/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/EntityTemplatesController.cs +++ b/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/EntityTemplatesController.cs @@ -18,11 +18,14 @@ using System.Collections.Generic; using System.Linq; using System.Web.Mvc; +using System.Web.SessionState; using Telerik.Web.Mvc.Extensions; using Vaiona.Web.Extensions; namespace BExIS.Modules.Dcm.UI.Controllers { + + [SessionState(SessionStateBehavior.ReadOnly)] public class EntityTemplatesController : Controller { private readonly GroupManager _groupManager; diff --git a/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/Hooks/AttachmentUploadController.cs b/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/Hooks/AttachmentUploadController.cs index 51cb1c789..0f857f998 100644 --- a/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/Hooks/AttachmentUploadController.cs +++ b/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/Hooks/AttachmentUploadController.cs @@ -1,4 +1,4 @@ -using BExIS.App.Bootstrap.Attributes; +using BExIS.App.Bootstrap.Attributes; using BExIS.App.Bootstrap.Helpers; using BExIS.Dlm.Entities.Data; using BExIS.Dlm.Services.Data; @@ -22,6 +22,7 @@ using System.Net.Mail; using System.Web; using System.Web.Mvc; +using System.Web.SessionState; using Vaiona.Entities.Common; using Vaiona.Utils.Cfg; using Vaiona.Web.Extensions; @@ -31,6 +32,7 @@ namespace BExIS.Modules.Dcm.UI.Controllers { + [SessionState(SessionStateBehavior.ReadOnly)] public class AttachmentUploadController : Controller { /// diff --git a/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/Hooks/DataController.cs b/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/Hooks/DataController.cs index ebcefb2df..4386cf91a 100644 --- a/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/Hooks/DataController.cs +++ b/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/Hooks/DataController.cs @@ -1,4 +1,4 @@ -using BExIS.App.Bootstrap.Attributes; +using BExIS.App.Bootstrap.Attributes; using BExIS.App.Bootstrap.Helpers; using BExIS.Dlm.Services.Data; using BExIS.Modules.Dcm.UI.Hooks; @@ -12,12 +12,14 @@ using System.Linq; using System.Web; using System.Web.Mvc; +using System.Web.SessionState; using Telerik.Web.Mvc.Infrastructure.Implementation; using Vaiona.Utils.Cfg; using Vaiona.Web.Mvc.Modularity; namespace BExIS.Modules.Dcm.UI.Controllers { + [SessionState(SessionStateBehavior.ReadOnly)] public class DataController : Controller { // GET: Data diff --git a/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/Hooks/DataDescriptionController.cs b/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/Hooks/DataDescriptionController.cs index 11643a4d0..5cbcd5cdb 100644 --- a/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/Hooks/DataDescriptionController.cs +++ b/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/Hooks/DataDescriptionController.cs @@ -1,4 +1,4 @@ -using BExIS.App.Bootstrap.Attributes; +using BExIS.App.Bootstrap.Attributes; using BExIS.App.Bootstrap.Helpers; using BExIS.Dlm.Services.Data; using BExIS.Dlm.Services.DataStructure; @@ -17,6 +17,7 @@ using System.Linq; using System.Web; using System.Web.Mvc; +using System.Web.SessionState; using Vaiona.Utils.Cfg; using Vaiona.Web.Mvc.Modularity; @@ -24,6 +25,7 @@ namespace BExIS.Modules.Dcm.UI.Controllers { + [SessionState(SessionStateBehavior.ReadOnly)] public class DataDescriptionController : Controller { /// diff --git a/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/Hooks/EntityReferenceController.cs b/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/Hooks/EntityReferenceController.cs index 08434acb6..e1308e08a 100644 --- a/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/Hooks/EntityReferenceController.cs +++ b/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/Hooks/EntityReferenceController.cs @@ -1,4 +1,4 @@ -using BExIS.App.Bootstrap.Attributes; +using BExIS.App.Bootstrap.Attributes; using BExIS.Dlm.Entities.Data; using BExIS.Dlm.Services.MetadataStructure; using BExIS.Security.Entities.Authorization; @@ -14,10 +14,12 @@ using System.Collections.Generic; using System.Linq; using System.Web.Mvc; +using System.Web.SessionState; using Vaiona.Persistence.Api; namespace BExIS.Modules.Dcm.UI.Controllers { + [SessionState(SessionStateBehavior.ReadOnly)] public class EntityReferenceController : Controller { private XmlDatasetHelper xmlDatasetHelper = new XmlDatasetHelper(); diff --git a/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/Hooks/FileUploadController.cs b/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/Hooks/FileUploadController.cs index 78723e68e..8caea3b6c 100644 --- a/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/Hooks/FileUploadController.cs +++ b/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/Hooks/FileUploadController.cs @@ -1,4 +1,4 @@ -using BExIS.App.Bootstrap.Attributes; +using BExIS.App.Bootstrap.Attributes; using BExIS.App.Bootstrap.Helpers; using BExIS.Dlm.Entities.DataStructure; using BExIS.Dlm.Services.Data; @@ -20,6 +20,7 @@ using System.Web; using System.Web.Mvc; using System.Web.Routing; +using System.Web.SessionState; using Vaiona.Utils.Cfg; using Vaiona.Web.Extensions; using Vaiona.Web.Mvc.Modularity; @@ -28,6 +29,7 @@ namespace BExIS.Modules.Dcm.UI.Controllers { + [SessionState(SessionStateBehavior.ReadOnly)] public class FileUploadController : Controller { /// diff --git a/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/Hooks/MetadataController.cs b/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/Hooks/MetadataController.cs index 2b61d49c2..0ab7f7bcc 100644 --- a/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/Hooks/MetadataController.cs +++ b/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/Hooks/MetadataController.cs @@ -1,13 +1,15 @@ -using BExIS.App.Bootstrap.Attributes; +using BExIS.App.Bootstrap.Attributes; using BExIS.Dlm.Entities.Data; using BExIS.Modules.Dcm.UI.Models.Edit; using BExIS.Security.Entities.Authorization; using System; using System.Web.Mvc; +using System.Web.SessionState; using Vaiona.Web.Mvc.Modularity; namespace BExIS.Modules.Dcm.UI.Controllers { + [SessionState(SessionStateBehavior.ReadOnly)] public class MetadataController : Controller { diff --git a/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/Hooks/SubmitController.cs b/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/Hooks/SubmitController.cs index b2515a709..feaeb8acf 100644 --- a/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/Hooks/SubmitController.cs +++ b/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/Hooks/SubmitController.cs @@ -1,4 +1,4 @@ -using BExIS.App.Bootstrap.Attributes; +using BExIS.App.Bootstrap.Attributes; using BExIS.App.Bootstrap.Helpers; using BExIS.Dlm.Entities.Data; using BExIS.Modules.Dcm.UI.Helpers; @@ -19,12 +19,14 @@ using System.Threading.Tasks; using System.Web.Mvc; using System.Web.Routing; +using System.Web.SessionState; using Vaiona.Entities.Common; using Vaiona.Web.Mvc; using Vaiona.Web.Mvc.Modularity; namespace BExIS.Modules.Dcm.UI.Controllers { + [SessionState(SessionStateBehavior.ReadOnly)] public class SubmitController : BaseController { private User _user; diff --git a/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/Hooks/ValidationController.cs b/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/Hooks/ValidationController.cs index efec39b6a..9345871b8 100644 --- a/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/Hooks/ValidationController.cs +++ b/Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI/Controllers/Hooks/ValidationController.cs @@ -1,4 +1,4 @@ -using BExIS.App.Bootstrap.Attributes; +using BExIS.App.Bootstrap.Attributes; using BExIS.App.Bootstrap.Helpers; using BExIS.Dlm.Entities.Data; using BExIS.Dlm.Entities.DataStructure; @@ -21,12 +21,14 @@ using System.IO; using System.Linq; using System.Web.Mvc; +using System.Web.SessionState; using Telerik.Web.Mvc.Extensions; using Vaiona.Utils.Cfg; using Vaiona.Web.Mvc.Modularity; namespace BExIS.Modules.Dcm.UI.Controllers { + [SessionState(SessionStateBehavior.ReadOnly)] public class ValidationController : Controller { private FileStream Stream; diff --git a/Console/BExIS.Web.Shell/Areas/DDM/BExIS.Modules.Ddm.UI/Controllers/TagInfoController.cs b/Console/BExIS.Web.Shell/Areas/DDM/BExIS.Modules.Ddm.UI/Controllers/TagInfoController.cs index ec63e9f69..e60601c44 100644 --- a/Console/BExIS.Web.Shell/Areas/DDM/BExIS.Modules.Ddm.UI/Controllers/TagInfoController.cs +++ b/Console/BExIS.Web.Shell/Areas/DDM/BExIS.Modules.Ddm.UI/Controllers/TagInfoController.cs @@ -12,6 +12,7 @@ using System.Linq; using System.Web.Mvc; using System.Web.Routing; +using System.Web.SessionState; using Telerik.Web.Mvc.Extensions; using Vaiona.Web.Mvc; using Vaiona.Web.Mvc.Modularity; @@ -19,6 +20,7 @@ namespace BExIS.Modules.Ddm.UI.Controllers { + [SessionState(SessionStateBehavior.ReadOnly)] public class TagInfoController : BaseController { private readonly UserManager _userManager; diff --git a/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI/Controllers/ConstraintsController.cs b/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI/Controllers/ConstraintsController.cs index 552c031f4..fc86ae40a 100644 --- a/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI/Controllers/ConstraintsController.cs +++ b/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI/Controllers/ConstraintsController.cs @@ -16,10 +16,12 @@ using System.Data; using System.Linq; using System.Web.Mvc; +using System.Web.SessionState; using System.Web.UI.WebControls; namespace BExIS.Modules.Rpm.UI.Controllers { + [SessionState(SessionStateBehavior.ReadOnly)] public class ConstraintsController : Controller { private readonly UserManager _userManager; diff --git a/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI/Controllers/DataStructureController.cs b/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI/Controllers/DataStructureController.cs index f219287f7..45b317e2f 100644 --- a/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI/Controllers/DataStructureController.cs +++ b/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI/Controllers/DataStructureController.cs @@ -26,6 +26,7 @@ using System.Text; using System.Web; using System.Web.Mvc; +using System.Web.SessionState; using System.Web.UI.HtmlControls; using Vaiona.Utils.Cfg; using Vaiona.Web.Mvc.Data; @@ -33,6 +34,8 @@ namespace BExIS.Modules.Rpm.UI.Controllers { + + [SessionState(SessionStateBehavior.ReadOnly)] public class DataStructureController : Controller { public ActionResult Index() @@ -804,7 +807,7 @@ public JsonResult GetVariableTemplates() { foreach (var variableTemplate in variableTemplates.Where(t => t.Approved)) { - list.Add(_helper.ConvertTo(variableTemplate, "other")); + list.Add(_helper.ConvertTo(variableTemplate, unitManager, "other")); } } diff --git a/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI/Controllers/DataTypeController.cs b/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI/Controllers/DataTypeController.cs index 0c91dcada..2abfe8e39 100644 --- a/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI/Controllers/DataTypeController.cs +++ b/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI/Controllers/DataTypeController.cs @@ -8,9 +8,11 @@ using System.Collections.Generic; using System.Linq; using System.Web.Mvc; +using System.Web.SessionState; namespace BExIS.Modules.Rpm.UI.Controllers { + [SessionState(SessionStateBehavior.ReadOnly)] public class DataTypeController : Controller { public ActionResult Index() diff --git a/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI/Controllers/DimensionController.cs b/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI/Controllers/DimensionController.cs index 38aec4d6c..143fdb5e8 100644 --- a/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI/Controllers/DimensionController.cs +++ b/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI/Controllers/DimensionController.cs @@ -7,9 +7,12 @@ using System.Collections.Generic; using System.Linq; using System.Web.Mvc; +using System.Web.SessionState; namespace BExIS.Modules.Rpm.UI.Controllers { + + [SessionState(SessionStateBehavior.ReadOnly)] public class DimensionController : Controller { public ActionResult Index() diff --git a/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI/Controllers/ExternalLinkController.cs b/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI/Controllers/ExternalLinkController.cs index 19885e609..1a6dc3003 100644 --- a/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI/Controllers/ExternalLinkController.cs +++ b/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI/Controllers/ExternalLinkController.cs @@ -9,9 +9,12 @@ using System.Collections.Generic; using System.Linq; using System.Web.Mvc; +using System.Web.SessionState; namespace BExIS.Modules.Rpm.UI.Controllers { + + [SessionState(SessionStateBehavior.ReadOnly)] public class ExternalLinkController : Controller { // GET: ExternalLink diff --git a/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI/Controllers/FileController.cs b/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI/Controllers/FileController.cs index 1c6a47806..9a57ed551 100644 --- a/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI/Controllers/FileController.cs +++ b/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI/Controllers/FileController.cs @@ -11,6 +11,7 @@ using System.Linq; using System.Web; using System.Web.Mvc; +using System.Web.SessionState; using Vaiona.Utils.Cfg; using Vaiona.Web.Mvc.Data; using BExIS.UI.Models; @@ -19,6 +20,8 @@ namespace BExIS.Modules.Rpm.UI.Controllers { + + [SessionState(SessionStateBehavior.ReadOnly)] public class FileController : Controller { // GET: File diff --git a/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI/Controllers/MeaningController.cs b/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI/Controllers/MeaningController.cs index b2e879c44..739e02d2e 100644 --- a/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI/Controllers/MeaningController.cs +++ b/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI/Controllers/MeaningController.cs @@ -9,9 +9,12 @@ using System.Collections.Generic; using System.Linq; using System.Web.Mvc; +using System.Web.SessionState; namespace BExIS.Modules.Rpm.UI.Controllers { + + [SessionState(SessionStateBehavior.ReadOnly)] public class MeaningController : Controller { // GET: Meanings diff --git a/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI/Controllers/StructuresController.cs b/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI/Controllers/StructuresController.cs index 8b6131a5c..36b43a36d 100644 --- a/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI/Controllers/StructuresController.cs +++ b/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI/Controllers/StructuresController.cs @@ -6,10 +6,12 @@ using System.Net; using System.Web.Http; using System.Web.Http.Description; +using System.Web.SessionState; using Vaiona.Persistence.Api; namespace BExIS.Modules.Rpm.UI.Controllers { + [System.Web.Mvc.SessionState(SessionStateBehavior.ReadOnly)] public class StructuresController : ApiController { // GET: api/Structures diff --git a/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI/Controllers/UnitController.cs b/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI/Controllers/UnitController.cs index c01ed1ed4..0ea6eb0a1 100644 --- a/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI/Controllers/UnitController.cs +++ b/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI/Controllers/UnitController.cs @@ -14,9 +14,12 @@ using System.Collections.Generic; using System.Linq; using System.Web.Mvc; +using System.Web.SessionState; namespace BExIS.Modules.Rpm.UI.Controllers { + + [SessionState(SessionStateBehavior.ReadOnly)] public class UnitController : Controller { public ActionResult Index() diff --git a/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI/Controllers/VariableTemplateController.cs b/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI/Controllers/VariableTemplateController.cs index 71198b156..02921bab8 100644 --- a/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI/Controllers/VariableTemplateController.cs +++ b/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI/Controllers/VariableTemplateController.cs @@ -9,9 +9,11 @@ using System.Collections.Generic; using System.Linq; using System.Web.Mvc; +using System.Web.SessionState; namespace BExIS.Modules.Rpm.UI.Controllers { + [SessionState(SessionStateBehavior.ReadOnly)] public class VariableTemplateController : Controller { // GET: VariableTemplate diff --git a/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI/Helpers/VariableHelper.cs b/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI/Helpers/VariableHelper.cs index 7806f67f5..f65233870 100644 --- a/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI/Helpers/VariableHelper.cs +++ b/Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI/Helpers/VariableHelper.cs @@ -126,7 +126,7 @@ public List GetConstraints() { using (var constraintManager = new ConstraintManager()) { - var constraints = constraintManager.Get().Where(c => c.DataContainer == null); + var constraints = constraintManager.ConstraintRepository.Query(c => c.DataContainer == null); List list = new List(); if (constraints.Any()) @@ -198,6 +198,36 @@ public VariableTemplateItem ConvertTo(VariableTemplate variableTemplate, string } } + public VariableTemplateItem ConvertTo(VariableTemplate variableTemplate, UnitManager unitManager, string group = "") + { + + VariableTemplateItem item = new VariableTemplateItem(); + item.Id = variableTemplate.Id; + item.Text = variableTemplate.Label; + item.DataType = variableTemplate.DataType.Name; + item.DataTypes = variableTemplate.Unit.AssociatedDataTypes.Select(x => x.Name).ToList(); + item.Meanings = variableTemplate.Meanings.Select(x => x.Name).ToList(); + item.Group = group; + item.Description = variableTemplate.Description; + item.Unit = variableTemplate.Unit.Abbreviation; + + + if (variableTemplate.VariableConstraints.Any()) + item.Constraints = variableTemplate.VariableConstraints.Select(x => x.Name).ToList(); + + // set units also from dimensions + item.Units = new List() { variableTemplate.Unit.Abbreviation }; // add unit + if (variableTemplate.Unit.Dimension != null) // if dimension exist add all units belong to this dimension + { + var dimension = unitManager.DimensionRepo.Get(variableTemplate.Unit.Dimension.Id); + dimension.Units.ToList().ForEach(u => item.Units.Add(u.Abbreviation)); + item.Units.Distinct(); + } + + return item; + + } + public List ConvertTo(ICollection meanings) { using (var meaningManager = new MeaningManager()) diff --git a/Console/BExIS.Web.Shell/Controllers/AccountController.cs b/Console/BExIS.Web.Shell/Controllers/AccountController.cs index a16026e4c..f466c531d 100644 --- a/Console/BExIS.Web.Shell/Controllers/AccountController.cs +++ b/Console/BExIS.Web.Shell/Controllers/AccountController.cs @@ -331,6 +331,13 @@ public async Task Login(LoginViewModel model, string returnUrl) authManager.SignIn(new AuthenticationProperties { IsPersistent = model.RememberMe }, new ClaimsIdentity(identity) ); + // Forcefully remove the old cache if it exists + string cacheKey = "Menu_" + user.UserName; + if (HttpContext.Cache[cacheKey] != null) + { + HttpContext.Cache.Remove(cacheKey); + } + return RedirectToLocal(returnUrl); case SignInStatus.LockedOut: diff --git a/Console/BExIS.Web.Shell/Controllers/FooterController.cs b/Console/BExIS.Web.Shell/Controllers/FooterController.cs index 2cf514bd7..7dc9371fc 100644 --- a/Console/BExIS.Web.Shell/Controllers/FooterController.cs +++ b/Console/BExIS.Web.Shell/Controllers/FooterController.cs @@ -1,9 +1,11 @@ using System.Web.Mvc; +using System.Web.SessionState; using Vaiona.Web.Extensions; using Vaiona.Web.Mvc.Models; namespace BExIS.Web.Shell.Controllers { + [SessionState(SessionStateBehavior.ReadOnly)] public class FooterController : Controller { // GET: footer diff --git a/Console/BExIS.Web.Shell/Controllers/HeaderController.cs b/Console/BExIS.Web.Shell/Controllers/HeaderController.cs index f40a3ec52..1b49f0492 100644 --- a/Console/BExIS.Web.Shell/Controllers/HeaderController.cs +++ b/Console/BExIS.Web.Shell/Controllers/HeaderController.cs @@ -1,8 +1,10 @@ using System.Web.Mvc; +using System.Web.SessionState; using Vaiona.Web.Extensions; namespace BExIS.Web.Shell.Controllers { + [SessionState(SessionStateBehavior.ReadOnly)] public class HeaderController : Controller { // GET: Header diff --git a/Console/BExIS.Web.Shell/Controllers/HelpController.cs b/Console/BExIS.Web.Shell/Controllers/HelpController.cs index c257f1101..e5089eabf 100644 --- a/Console/BExIS.Web.Shell/Controllers/HelpController.cs +++ b/Console/BExIS.Web.Shell/Controllers/HelpController.cs @@ -1,9 +1,11 @@ using BExIS.UI.Helpers; using BExIS.Utils.Config; using System.Web.Mvc; +using System.Web.SessionState; namespace BExIS.Web.Shell.Controllers { + [SessionState(SessionStateBehavior.ReadOnly)] public class HelpController : Controller { // GET: Help diff --git a/Console/BExIS.Web.Shell/Controllers/HomeController.cs b/Console/BExIS.Web.Shell/Controllers/HomeController.cs index 7c2f69b46..8e134c20b 100644 --- a/Console/BExIS.Web.Shell/Controllers/HomeController.cs +++ b/Console/BExIS.Web.Shell/Controllers/HomeController.cs @@ -12,6 +12,7 @@ using System.IO; using System.Web; using System.Web.Mvc; +using System.Web.SessionState; using Vaiona.Web.Extensions; using Vaiona.Web.Mvc.Data; using Vaiona.Web.Mvc.Models; @@ -19,6 +20,7 @@ namespace BExIS.Web.Shell.Controllers { + [SessionState(SessionStateBehavior.ReadOnly)] public class HomeController : Controller { private readonly UserManager _userManager; diff --git a/Console/BExIS.Web.Shell/Controllers/JSController.cs b/Console/BExIS.Web.Shell/Controllers/JSController.cs index f67e2a259..e324b680c 100644 --- a/Console/BExIS.Web.Shell/Controllers/JSController.cs +++ b/Console/BExIS.Web.Shell/Controllers/JSController.cs @@ -1,7 +1,9 @@ using System.Web.Mvc; +using System.Web.SessionState; namespace SessionTimeout.Controllers { + [SessionState(SessionStateBehavior.ReadOnly)] public class JSController : Controller { // GET: JS diff --git a/Console/BExIS.Web.Shell/Controllers/MenuController.cs b/Console/BExIS.Web.Shell/Controllers/MenuController.cs index 9bdc2c940..5d470d6d2 100644 --- a/Console/BExIS.Web.Shell/Controllers/MenuController.cs +++ b/Console/BExIS.Web.Shell/Controllers/MenuController.cs @@ -1,4 +1,4 @@ -using BExIS.App.Bootstrap.Extensions; +using BExIS.App.Bootstrap.Extensions; using BExIS.App.Bootstrap.Helpers; using BExIS.Security.Entities.Subjects; using BExIS.Security.Services.Subjects; @@ -9,10 +9,12 @@ using System.Linq; using System.Web; using System.Web.Mvc; +using System.Web.SessionState; using Vaiona.Web.Extensions; namespace BExIS.Web.Shell.Controllers { + [SessionState(SessionStateBehavior.ReadOnly)] public class MenuController : Controller { private readonly UserManager _userManager; @@ -53,9 +55,10 @@ public JsonResult Index() } - if (Session["Menu"] != null) + string cacheKey = $"Menu_{userName}"; + if (isAuthenticated && HttpContext.Cache[cacheKey] != null) { - return Json((Menu)Session["Menu"], JsonRequestBehavior.AllowGet); + return Json((Menu)HttpContext.Cache[cacheKey], JsonRequestBehavior.AllowGet); } @@ -82,8 +85,18 @@ public JsonResult Index() if (Session.GetTenant().ExtendedMenus != null) menu.Extended = MenuHelper.ExtendedMenu(Session.GetTenant().ExtendedMenus.Element("ExtendedMenu")); - // set menu to session if user is authenticated - if(!string.IsNullOrEmpty(userName) && isAuthenticated) Session["Menu"] = menu; + // set menu to cache if user is authenticated + if (!string.IsNullOrEmpty(userName) && isAuthenticated) + { + // This expires exactly 20 minutes from now, no matter what + HttpContext.Cache.Insert( + cacheKey, + menu, + null, + DateTime.Now.AddMinutes(20), // Absolute expiration set to 20 mins + System.Web.Caching.Cache.NoSlidingExpiration // Disable sliding expiration +); + } return Json(menu, JsonRequestBehavior.AllowGet); } diff --git a/Console/BExIS.Web.Shell/Controllers/SettingsController.cs b/Console/BExIS.Web.Shell/Controllers/SettingsController.cs index b64ba46a0..48d7ce5f3 100644 --- a/Console/BExIS.Web.Shell/Controllers/SettingsController.cs +++ b/Console/BExIS.Web.Shell/Controllers/SettingsController.cs @@ -8,12 +8,14 @@ using System.Collections.Generic; using System.Linq; using System.Web.Mvc; +using System.Web.SessionState; using Vaiona.Utils.Cfg; using Vaiona.Web.Mvc.Modularity; using ModuleSettings = Vaiona.Web.Mvc.Modularity.ModuleSettings; namespace BExIS.Web.Shell.Controllers { + [SessionState(SessionStateBehavior.ReadOnly)] public class SettingsController : Controller { private readonly UserManager _userManager; diff --git a/Console/BExIS.Web.Shell/Controllers/TokensController.cs b/Console/BExIS.Web.Shell/Controllers/TokensController.cs index 937462869..be0f291cf 100644 --- a/Console/BExIS.Web.Shell/Controllers/TokensController.cs +++ b/Console/BExIS.Web.Shell/Controllers/TokensController.cs @@ -13,9 +13,11 @@ using System.Threading.Tasks; using System.Web.Helpers; using System.Web.Mvc; +using System.Web.SessionState; namespace BExIS.Web.Shell.Controllers { + [SessionState(SessionStateBehavior.ReadOnly)] public class TokensController : Controller { private readonly UserManager _userManager;