├── AltinnDesktopTool ├── App.xaml.cs ├── Resources │ ├── Entypo.ttf │ ├── Entypo-license.txt │ └── WindowsIcons-license.txt ├── View │ ├── Images │ │ ├── Altinn.png │ │ ├── Digdir.png │ │ ├── altinn.ico │ │ ├── altinnT.ico │ │ ├── altinnT.xcf │ │ └── a-logo-blue.png │ ├── SearchOrganizationInformation.xaml.cs │ ├── SearchRolesAndRightsInformation.xaml.cs │ ├── Footer.xaml.cs │ ├── RolesSearchResultView.xaml.cs │ ├── MainWindow.xaml.cs │ ├── SearchResultView.xaml.cs │ ├── Footer.xaml │ ├── SearchOrganizationInformation.xaml │ ├── SearchRolesAndRightsInformation.xaml │ ├── MainWindow.xaml │ └── RolesSearchResultView.xaml ├── Settings.StyleCop ├── Properties │ ├── Settings.settings │ ├── Settings.Designer.cs │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── ViewModel │ ├── AltinnViewModelBase.cs │ ├── MapperProfiles │ │ └── SearchMapperProfile.cs │ ├── MainViewModel.cs │ ├── FooterViewModel.cs │ ├── ViewModelLocator.cs │ └── RolesSearchResultViewModel.cs ├── Configuration │ ├── IUIEnvironmentConfig.cs │ ├── EnvironmentConfigurations.xml │ ├── EnvironmentConfiguration.cs │ └── EnvironmentConfigurationManager.cs ├── Model │ ├── OfficialContactModel.cs │ ├── PersonalContactModel.cs │ ├── SearchType.cs │ ├── RoleModel.cs │ ├── SearchRolesAndRightsInformationModel.cs │ ├── SearchOrganizationInformationModel.cs │ ├── SearchResultModel.cs │ ├── RolesSearchResultModel.cs │ ├── OrganizationModel.cs │ └── ModelBase.cs ├── Utils │ ├── Helpers │ │ ├── AutomapperHelper.cs │ │ ├── BindingProxy.cs │ │ └── ProxyConfigHelper.cs │ ├── PubSub │ │ ├── PubSubEventArgs.cs │ │ ├── EventNames.cs │ │ └── PubSub.cs │ └── Converters │ │ └── RadioButtonCheckedConverter.cs ├── packages.config ├── App.xaml └── App.config ├── AltinnDesktopToolSetup ├── altinn.ico ├── AltinnDesktopToolSetup.wax ├── AltinnDesktopToolSetup.wixproj └── Product.wxs ├── renovate.json ├── IntegrationUnitTest ├── packages.config ├── Properties │ └── AssemblyInfo.cs ├── AltinnRestClientTest.cs └── IntegrationUnitTest.csproj ├── RestClient ├── Settings.StyleCop ├── packages.config ├── Controllers │ ├── IRestQueryController.cs │ ├── ControllerContext.cs │ ├── RestQueryControllerAttribute.cs │ └── AltinnBaseController.cs ├── Deserialize │ ├── OuterJson.cs │ ├── Deserializer.cs │ └── HalJsonConverter.cs ├── DTO │ ├── Role.cs │ ├── OfficialContact.cs │ ├── HalJsonResource.cs │ ├── Organization.cs │ └── PersonalContact.cs ├── Properties │ └── AssemblyInfo.cs ├── IRestQueryConfig.cs ├── Resources │ ├── RestClientErrorCodes.cs │ └── RestClientException.cs ├── IRestQuery.cs └── RestClient.csproj ├── RestClient.Test ├── packages.config ├── Properties │ └── AssemblyInfo.cs ├── RestClientExceptionTest.cs ├── RestQueryStubTest.cs └── RestClient.Test.csproj ├── AltinnDesktopToolTest ├── packages.config ├── Configuration │ ├── EnvironmentConfigurations.xml │ └── EnvironmentConfigurationTest.cs ├── Properties │ └── AssemblyInfo.cs ├── ViewModel │ ├── RolesSearchResultModelTest.cs │ └── SearchResultViewModelTest.cs └── AltinnDesktopToolTest.csproj ├── README.md ├── AltinnDesktopTool.sln ├── AltinnDesktopTool.sln.DotSettings └── .gitignore /AltinnDesktopTool/App.xaml.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /AltinnDesktopToolSetup/altinn.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altinn/altinn-desktop-tool/main/AltinnDesktopToolSetup/altinn.ico -------------------------------------------------------------------------------- /AltinnDesktopTool/Resources/Entypo.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altinn/altinn-desktop-tool/main/AltinnDesktopTool/Resources/Entypo.ttf -------------------------------------------------------------------------------- /AltinnDesktopTool/View/Images/Altinn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altinn/altinn-desktop-tool/main/AltinnDesktopTool/View/Images/Altinn.png -------------------------------------------------------------------------------- /AltinnDesktopTool/View/Images/Digdir.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altinn/altinn-desktop-tool/main/AltinnDesktopTool/View/Images/Digdir.png -------------------------------------------------------------------------------- /AltinnDesktopTool/View/Images/altinn.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altinn/altinn-desktop-tool/main/AltinnDesktopTool/View/Images/altinn.ico -------------------------------------------------------------------------------- /AltinnDesktopTool/View/Images/altinnT.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altinn/altinn-desktop-tool/main/AltinnDesktopTool/View/Images/altinnT.ico -------------------------------------------------------------------------------- /AltinnDesktopTool/View/Images/altinnT.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altinn/altinn-desktop-tool/main/AltinnDesktopTool/View/Images/altinnT.xcf -------------------------------------------------------------------------------- /AltinnDesktopTool/View/Images/a-logo-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altinn/altinn-desktop-tool/main/AltinnDesktopTool/View/Images/a-logo-blue.png -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": [ 4 | "local>Altinn/renovate-config" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /AltinnDesktopTool/Resources/Entypo-license.txt: -------------------------------------------------------------------------------- 1 | Entypo (http://www.entypo.com/) is created by Daniel Bruce and released under the Creative Commons, Share Alike/Attribution license. 2 | 3 | http://creativecommons.org/licenses/by-sa/3.0/ -------------------------------------------------------------------------------- /AltinnDesktopTool/Settings.StyleCop: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | xaml 5 | 6 | 7 | -------------------------------------------------------------------------------- /AltinnDesktopTool/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /IntegrationUnitTest/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /RestClient/Settings.StyleCop: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | deserializable 5 | Dto 6 | Json 7 | 8 | 9 | -------------------------------------------------------------------------------- /RestClient.Test/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /RestClient/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /RestClient/Controllers/IRestQueryController.cs: -------------------------------------------------------------------------------- 1 | namespace RestClient.Controllers 2 | { 3 | /// 4 | /// Interface representing the controller. Inherits the IRestQuery and adds the ControllerContext. 5 | /// 6 | public interface IRestQueryController : IRestQuery 7 | { 8 | /// 9 | /// Gets or sets the controller context. 10 | /// 11 | ControllerContext Context { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /AltinnDesktopToolSetup/AltinnDesktopToolSetup.wax: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | AltinnDesktopTool\AltinnDesktopTool.csproj 5 | 6 | 7 | 8 | 9 | 10 | false 11 | -------------------------------------------------------------------------------- /AltinnDesktopTool/ViewModel/AltinnViewModelBase.cs: -------------------------------------------------------------------------------- 1 | using AltinnDesktopTool.Model; 2 | using GalaSoft.MvvmLight; 3 | 4 | namespace AltinnDesktopTool.ViewModel 5 | { 6 | /// 7 | /// Base class for ViewModels 8 | /// 9 | public class AltinnViewModelBase : ViewModelBase 10 | { 11 | /// 12 | /// Gets or sets the Model object of the ViewModel class 13 | /// 14 | public virtual ModelBase Model { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /AltinnDesktopToolTest/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /AltinnDesktopTool/View/SearchOrganizationInformation.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace AltinnDesktopTool.View 2 | { 3 | /// 4 | /// Interaction logic for SearchOrganizationInformation.xaml 5 | /// 6 | public partial class SearchOrganizationInformation 7 | { 8 | /// 9 | /// Initializes a new instance of the SearchOrganizationInformation class. 10 | /// 11 | public SearchOrganizationInformation() 12 | { 13 | this.InitializeComponent(); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /AltinnDesktopTool/View/SearchRolesAndRightsInformation.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace AltinnDesktopTool.View 2 | { 3 | /// 4 | /// Interaction logic for SearchRolesAndRightsInformation.xaml 5 | /// 6 | public partial class SearchRolesAndRightsInformation 7 | { 8 | /// 9 | /// Initializes a new instance of the SearchRolesAndRightsInformation class. 10 | /// 11 | public SearchRolesAndRightsInformation() 12 | { 13 | this.InitializeComponent(); 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /AltinnDesktopToolTest/Configuration/EnvironmentConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | PROD 5 | Blue 6 | 7 | /api/serviceowner/ 8 | 9 | false 10 | 30 11 | 12 | -------------------------------------------------------------------------------- /AltinnDesktopTool/Configuration/IUIEnvironmentConfig.cs: -------------------------------------------------------------------------------- 1 | namespace AltinnDesktopTool.Configuration 2 | { 3 | /// 4 | /// Configuration for User Interface 5 | /// 6 | public interface IUiEnvironmentConfig 7 | { 8 | /// 9 | /// Gets or sets the Name of environment 10 | /// 11 | string Name { get; set; } 12 | 13 | /// 14 | /// Gets or sets the Name of theme selected for this environment 15 | /// 16 | string ThemeName { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /AltinnDesktopTool/Model/OfficialContactModel.cs: -------------------------------------------------------------------------------- 1 | namespace AltinnDesktopTool.Model 2 | { 3 | /// 4 | /// Model for Official Contact 5 | /// 6 | public class OfficialContactModel : ModelBase 7 | { 8 | /// 9 | /// Gets or sets the Mobile number as received from source 10 | /// 11 | public string MobileNumber { get; set; } 12 | 13 | /// 14 | /// Gets or sets the Email Address as received from source 15 | /// 16 | public string EmailAddress { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /AltinnDesktopTool/View/Footer.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace AltinnDesktopTool.View 2 | { 3 | /// 4 | /// Interaction logic for Footer.xaml 5 | /// 6 | public partial class Footer 7 | { 8 | /// 9 | /// Initializes a new instance of the Footer class. 10 | /// 11 | public Footer() 12 | { 13 | this.InitializeComponent(); 14 | } 15 | 16 | private void ComboBox_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e) 17 | { 18 | 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /AltinnDesktopTool/View/RolesSearchResultView.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace AltinnDesktopTool.View 2 | { 3 | /// 4 | /// Interaction logic for RolesSearchResultView.xaml 5 | /// 6 | public partial class RolesSearchResultView 7 | { 8 | /// 9 | /// Initializes a new instance of the RolesSearchResultView class. 10 | /// 11 | public RolesSearchResultView() 12 | { 13 | this.InitializeComponent(); 14 | } 15 | 16 | private void RoleGrid_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e) 17 | { 18 | 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /AltinnDesktopTool/Configuration/EnvironmentConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | PROD 5 | Blue 6 | 7 | 8 | 9 | false 10 | 30 11 | 12 | 13 | TT02 14 | Orange 15 | 16 | 17 | 18 | false 19 | 30 20 | 21 | -------------------------------------------------------------------------------- /AltinnDesktopTool/Utils/Helpers/AutomapperHelper.cs: -------------------------------------------------------------------------------- 1 | using AltinnDesktopTool.ViewModel.MapperProfiles; 2 | using AutoMapper; 3 | 4 | namespace AltinnDesktopTool.Utils.Helpers 5 | { 6 | /// 7 | /// Helper class for AutoMapper 8 | /// 9 | public class AutoMapperHelper 10 | { 11 | /// 12 | /// Create the mapper 13 | /// 14 | /// The IMapper object 15 | public static IMapper RunCreateMaps() 16 | { 17 | // Add profiles here 18 | Mapper.Initialize(cfg => 19 | { 20 | cfg.AddProfile(); 21 | }); 22 | 23 | return Mapper.Configuration.CreateMapper(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /RestClient/Controllers/ControllerContext.cs: -------------------------------------------------------------------------------- 1 | using Common.Logging; 2 | 3 | namespace RestClient.Controllers 4 | { 5 | /// 6 | /// The required data for the controller. 7 | /// 8 | public class ControllerContext 9 | { 10 | /// 11 | /// Gets or sets the log4net Log object, may be null. 12 | /// 13 | public ILog Log { get; set; } 14 | 15 | /// 16 | /// Gets or sets the Http wrapper for REST calls to Altinn server. 17 | /// 18 | public AltinnRestClient RestClient { get; set; } 19 | 20 | /// 21 | /// Gets or sets the base address for this controller including the controller name. 22 | /// 23 | public string ControllerBaseAddress { get; set; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /AltinnDesktopTool/Utils/Helpers/BindingProxy.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | namespace AltinnDesktopTool.Utils.Helpers 4 | { 5 | /// 6 | /// Binding class that is used when DataContext is not available to view or context 7 | /// 8 | public class BindingProxy : Freezable 9 | { 10 | protected override Freezable CreateInstanceCore() 11 | { 12 | return new BindingProxy(); 13 | } 14 | 15 | public object Data 16 | { 17 | get { return (object)GetValue(DataProperty); } 18 | set { SetValue(DataProperty, value); } 19 | } 20 | 21 | public static readonly DependencyProperty DataProperty = DependencyProperty.Register("Data", typeof(object), typeof(BindingProxy), new UIPropertyMetadata(null)); 22 | 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /RestClient/Deserialize/OuterJson.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Linq; 3 | 4 | namespace RestClient.Deserialize 5 | { 6 | /// 7 | /// Deserialization wrapper for the outer JSON object which comes with the HAL format 8 | /// 9 | public class OuterJson 10 | { 11 | /// 12 | /// Gets or sets the _links container 13 | /// 14 | [JsonProperty(PropertyName = "_links")] 15 | // ReSharper disable once InconsistentNaming 16 | public JObject _links { get; set; } 17 | 18 | /// 19 | /// Gets or sets the _embedded container 20 | /// 21 | [JsonProperty(PropertyName = "_embedded")] 22 | // ReSharper disable once InconsistentNaming 23 | public JObject _embedded { get; set; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /AltinnDesktopTool/View/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | using MahApps.Metro.Controls.Dialogs; 3 | 4 | namespace AltinnDesktopTool.View 5 | { 6 | /// 7 | /// Interaction logic for MainWindow.xaml 8 | /// 9 | public partial class MainWindow 10 | { 11 | /// 12 | /// Initializes a new instance of the MainWindow class. 13 | /// 14 | public MainWindow() 15 | { 16 | this.InitializeComponent(); 17 | } 18 | 19 | private async void ButtonBase_OnClick(object sender, RoutedEventArgs e) 20 | { 21 | await this.ShowMessageAsync(View.Resources.HeaderText, View.Resources.InfoText); 22 | } 23 | 24 | private void SearchResultView_Loaded(object sender, RoutedEventArgs e) 25 | { 26 | 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /AltinnDesktopTool/Utils/PubSub/PubSubEventArgs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace AltinnDesktopTool.Utils.PubSub 4 | { 5 | /// 6 | /// Defines the PubSub event arguments 7 | /// 8 | /// The event args contains an Item of this type 9 | public class PubSubEventArgs : EventArgs 10 | { 11 | /// 12 | /// Initializes a new instance of the class. 13 | /// 14 | /// 15 | /// Mandatory item of the defined type for the PubSubEventArgs 16 | /// 17 | public PubSubEventArgs(T item) 18 | { 19 | this.Item = item; 20 | } 21 | 22 | /// 23 | /// Gets or sets the argument item 24 | /// 25 | public T Item { get; set; } 26 | } 27 | } -------------------------------------------------------------------------------- /AltinnDesktopTool/ViewModel/MapperProfiles/SearchMapperProfile.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | 3 | namespace AltinnDesktopTool.ViewModel.MapperProfiles 4 | { 5 | /// 6 | /// SearchMapperProfile class for configuring profile maps 7 | /// 8 | public class SearchMapperProfile : Profile 9 | { 10 | /// 11 | /// Initializes a new instance of the class, configures AutoMapper 12 | /// 13 | public SearchMapperProfile() 14 | { 15 | this.CreateMap(); 16 | this.CreateMap(); 17 | this.CreateMap(); 18 | this.CreateMap(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /RestClient/DTO/Role.cs: -------------------------------------------------------------------------------- 1 | namespace RestClient.DTO 2 | { 3 | /// 4 | /// Data transfer object representing a role from the service owner API. 5 | /// 6 | [PluralName("Roles")] 7 | public class Role : HalJsonResource 8 | { 9 | /// 10 | /// Gets or sets the role type. 11 | /// 12 | public string RoleType { get; set; } 13 | 14 | /// 15 | /// Gets or sets the role definition id. 16 | /// 17 | public string RoleDefinitionId { get; set; } 18 | 19 | /// 20 | /// Gets or sets the role name. 21 | /// 22 | public string RoleName { get; set; } 23 | 24 | /// 25 | /// Gets or sets the role description. 26 | /// 27 | public string RoleDescription { get; set; } 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /AltinnDesktopTool/Model/PersonalContactModel.cs: -------------------------------------------------------------------------------- 1 | namespace AltinnDesktopTool.Model 2 | { 3 | /// 4 | /// Model for Personal Contact 5 | /// 6 | public class PersonalContactModel : ModelBase 7 | { 8 | /// 9 | /// Gets or sets the Contact Name (as mapped from DTO) 10 | /// 11 | public string Name { get; set; } 12 | 13 | /// 14 | /// Gets or sets the Social Security Number (as mapped from DTO) 15 | /// 16 | public string SocialSecurityNumber { get; set; } 17 | 18 | /// 19 | /// Gets or sets Mobile Number (as mapped from DTO) 20 | /// 21 | public string MobileNumber { get; set; } 22 | 23 | /// 24 | /// Gets or sets the Email address (as mapped from DTO) 25 | /// 26 | public string EmailAddress { get; set; } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /AltinnDesktopTool/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /AltinnDesktopTool/Model/SearchType.cs: -------------------------------------------------------------------------------- 1 | namespace AltinnDesktopTool.Model 2 | { 3 | /// 4 | /// Indicates the type of input given in the search. 5 | /// 6 | public enum SearchType 7 | { 8 | /// 9 | /// The search input is undefined. Try to find the correct type automatically. 10 | /// 11 | Smart = 0, 12 | 13 | /// 14 | /// The search input is a phone number. 15 | /// 16 | PhoneNumber = 1, 17 | 18 | /// 19 | /// The search input is an email address. 20 | /// 21 | EMail = 2, 22 | 23 | /// 24 | /// The search input is an organization number. 25 | /// 26 | OrganizationNumber = 3, 27 | 28 | /// 29 | /// The search input is a sosial security number. 30 | /// 31 | SSN = 4, 32 | 33 | /// 34 | /// The search input is unknown. 35 | /// 36 | Unknown = 5 37 | } 38 | } -------------------------------------------------------------------------------- /RestClient/DTO/OfficialContact.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace RestClient.DTO 4 | { 5 | /// 6 | /// Data transfer object representing an official contact from the service owner API. 7 | /// 8 | [PluralName("OfficialContacts")] 9 | public class OfficialContact : HalJsonResource 10 | { 11 | /// 12 | /// Gets or sets the mobile number of the official contact. 13 | /// 14 | public string MobileNumber { get; set; } 15 | 16 | /// 17 | /// Gets or sets the date for the last time the mobile number was added or changed. 18 | /// 19 | public DateTime? MobileNumberChanged { get; set; } 20 | 21 | /// 22 | /// Gets or sets the email address of the official contact. 23 | /// 24 | public string EmailAddress { get; set; } 25 | 26 | /// 27 | /// Gets or sets the date for the last time the email address was added or changed. 28 | /// 29 | public DateTime? EmailAddressChanged { get; set; } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /AltinnDesktopTool/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace AltinnDesktopTool.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.7.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /AltinnDesktopToolTest/Configuration/EnvironmentConfigurationTest.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using AltinnDesktopTool.Configuration; 3 | using Microsoft.VisualStudio.TestTools.UnitTesting; 4 | 5 | namespace AltinnDesktopToolTest.Configuration 6 | { 7 | /// 8 | /// Test class for unit tests of the class. 9 | /// 10 | [TestClass] 11 | public class EnvironmentConfigurationTest 12 | { 13 | /// 14 | /// Scenario: 15 | /// Access environment configurations. 16 | /// Expected Result: 17 | /// Configuration settings are loaded from the file and returned. 18 | /// Success Criteria: 19 | /// The configuration object is not null and contains at least one environment. 20 | /// 21 | [TestMethod] 22 | public void EnvironmentConfigurationsTest_LoadTest() 23 | { 24 | // Arrange 25 | // Act 26 | List configs = EnvironmentConfigurationManager.EnvironmentConfigurations; 27 | 28 | // Assert 29 | Assert.IsNotNull(configs); 30 | Assert.IsTrue(configs.Count > 0); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /AltinnDesktopTool/Utils/Helpers/ProxyConfigHelper.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using AltinnDesktopTool.Configuration; 3 | using RestClient; 4 | 5 | namespace AltinnDesktopTool.Utils.Helpers 6 | { 7 | /// 8 | /// Helper class for the Proxy Configuration 9 | /// 10 | public class ProxyConfigHelper 11 | { 12 | /// 13 | /// Gets the RestQueryConfig object from the configuration manager. Returns production configuration by default. 14 | /// 15 | /// The IRestQueryConfig object 16 | public static IRestQueryConfig GetConfig() 17 | { 18 | return EnvironmentConfigurationManager.EnvironmentConfigurations.FirstOrDefault(c => c.Name == "PROD"); 19 | } 20 | 21 | /// 22 | /// Gets the RestQueryConfig object by name from the configuration manager. 23 | /// 24 | /// Name of the environment 25 | /// RestQueryConfig object which matches the environmentName 26 | public static IRestQueryConfig GetConfig(string environmentName) 27 | { 28 | return EnvironmentConfigurationManager.EnvironmentConfigurations.FirstOrDefault(c => c.Name == environmentName); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /AltinnDesktopTool/View/SearchResultView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Controls; 2 | using System.Windows.Controls.Primitives; 3 | using System.Windows.Input; 4 | 5 | namespace AltinnDesktopTool.View 6 | { 7 | /// 8 | /// Interaction logic for SearchResultView.xaml 9 | /// 10 | public partial class SearchResultView 11 | { 12 | /// 13 | /// Initializes a new instance of the SearchResultView class. 14 | /// 15 | public SearchResultView() 16 | { 17 | this.InitializeComponent(); 18 | } 19 | 20 | private void UIElement_OnPreviewMouseDown(object sender, MouseButtonEventArgs e) 21 | { 22 | CheckBox checkBox = (CheckBox)sender; 23 | if (checkBox.IsChecked ?? false) 24 | { 25 | checkBox.SetCurrentValue(ToggleButton.IsCheckedProperty, false); 26 | } 27 | else 28 | { 29 | checkBox.SetCurrentValue(ToggleButton.IsCheckedProperty, true); 30 | } 31 | 32 | e.Handled = true; 33 | } 34 | 35 | private void OrganizationGrid_SelectionChanged(object sender, SelectionChangedEventArgs e) 36 | { 37 | 38 | } 39 | 40 | private void PersonalContactsGrid_Scroll(object sender, ScrollEventArgs e) 41 | { 42 | 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /RestClient/DTO/HalJsonResource.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace RestClient.DTO 4 | { 5 | /// 6 | /// Base class for Dto objects - deserializable from HAL+JSON format 7 | /// 8 | public class HalJsonResource 9 | { 10 | /// 11 | /// Initializes a new instance of the class 12 | /// 13 | public HalJsonResource() 14 | { 15 | Type t = this.GetType(); 16 | if (t.IsDefined(typeof(PluralNameAttribute), false) == false) 17 | { 18 | throw new InvalidOperationException("Missing Plural name attribute on HalJsonResource class!"); 19 | } 20 | } 21 | } 22 | 23 | /// 24 | /// Attribute for indicating object list name 25 | /// 26 | [AttributeUsage(AttributeTargets.Class)] 27 | public class PluralNameAttribute : Attribute 28 | { 29 | /// 30 | /// Gets the plural name 31 | /// 32 | public readonly string PluralName; 33 | 34 | /// 35 | /// Initializes a new instance of the class 36 | /// 37 | /// Plural name to be set 38 | public PluralNameAttribute(string pluralName) 39 | { 40 | this.PluralName = pluralName; 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /RestClient/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("RestClient")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("Capgemini")] 11 | [assembly: AssemblyProduct("RestClient")] 12 | [assembly: AssemblyCopyright("Copyright © Capgemini 2016")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("bf6fb931-d0c9-48a4-9e9d-15eb71b0f13e")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /AltinnDesktopToolTest/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("AltinnDesktopToolTest")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("AltinnDesktopToolTest")] 12 | [assembly: AssemblyCopyright("Copyright © 2016")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("2be6ffde-ea7e-47ea-8eee-1be75869c151")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /RestClient.Test/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("RestClient.Test")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("Capgemini")] 11 | [assembly: AssemblyProduct("RestClient.Test")] 12 | [assembly: AssemblyCopyright("Copyright © Capgemini 2016")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("f97e7ff9-c66b-4c94-8503-d72ed7ee459b")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /IntegrationUnitTest/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("IntegrationUnitTest")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("Capgemini")] 11 | [assembly: AssemblyProduct("IntegrationUnitTest")] 12 | [assembly: AssemblyCopyright("Copyright © Capgemini 2016")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("b6215dbe-2806-49ed-91a6-7185256b1a85")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /AltinnDesktopTool/ViewModel/MainViewModel.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using System.Windows; 3 | using AltinnDesktopTool.Configuration; 4 | using AltinnDesktopTool.Utils.PubSub; 5 | using GalaSoft.MvvmLight; 6 | using GalaSoft.MvvmLight.Command; 7 | using MahApps.Metro; 8 | 9 | namespace AltinnDesktopTool.ViewModel 10 | { 11 | /// 12 | /// ViewModel for MainView 13 | /// 14 | public class MainViewModel : ViewModelBase 15 | { 16 | /// 17 | /// Initializes a new instance of the MainViewModel class. 18 | /// 19 | public MainViewModel() 20 | { 21 | PubSub.RegisterEvent(EventNames.EnvironmentChangedEvent, this.EnvironmentChangedEventHandler); 22 | this.ClosingWindowCommand = new RelayCommand(this.ClosingWindowCommandHandler); 23 | } 24 | 25 | /// 26 | /// Gets or sets Closing window command 27 | /// 28 | public RelayCommand ClosingWindowCommand { get; set; } 29 | 30 | private void ClosingWindowCommandHandler(CancelEventArgs obj) 31 | { 32 | ViewModelLocator.Cleanup(); 33 | } 34 | 35 | private void EnvironmentChangedEventHandler(object sender, PubSubEventArgs args) 36 | { 37 | ThemeManager.ChangeAppStyle(Application.Current, ThemeManager.GetAccent(EnvironmentConfigurationManager.ActiveEnvironmentConfiguration.ThemeName), ThemeManager.GetAppTheme("BaseLight")); 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /RestClient/IRestQueryConfig.cs: -------------------------------------------------------------------------------- 1 | namespace RestClient 2 | { 3 | /// 4 | /// The Query configuration as required by the RestQuery component. 5 | /// 6 | public interface IRestQueryConfig 7 | { 8 | /// 9 | /// Gets or sets the base address for the REST api for the environment that this configuration is connected to. 10 | /// 11 | /// 12 | /// When the url is like: https://host/x/y/organizations/orgno and organizations is the name of the controller, 13 | /// then the base address must be https://host/x/y/ including the ending '/'. 14 | /// The BaseAddress may be changed, in which case AltinnRestClient will reconnect to new host on next call. 15 | /// 16 | string BaseAddress { get; set; } 17 | 18 | /// 19 | /// Gets or sets the ApiKey to be used by the client. 20 | /// 21 | string ApiKey { get; set; } 22 | 23 | /// 24 | /// Gets or sets the thumbprint of the certificate required to authenticate as service owner. 25 | /// 26 | string ThumbPrint { get; set; } 27 | 28 | /// 29 | /// Gets or sets a value indicating whether the client should ignore SSL errors. 30 | /// 31 | bool IgnoreSslErrors { get; set; } 32 | 33 | /// 34 | /// Gets or sets the timeout for a request in seconds. 35 | /// 36 | int Timeout { get; set; } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /RestClient/DTO/Organization.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace RestClient.DTO 4 | { 5 | /// 6 | /// Data transfer object representing an organization from the service owner API. 7 | /// 8 | [PluralName("Organizations")] 9 | public class Organization : HalJsonResource 10 | { 11 | /// 12 | /// Gets or sets the name of the organization. 13 | /// 14 | public string Name { get; set; } 15 | 16 | /// 17 | /// Gets or sets the organization number. 18 | /// 19 | public string OrganizationNumber { get; set; } 20 | 21 | /// 22 | /// Gets or sets the type of organization. 23 | /// 24 | public string Type { get; set; } 25 | 26 | /// 27 | /// Gets or sets the time for the last update to the organization profile. 28 | /// 29 | public DateTime? LastChanged { get; set; } 30 | 31 | /// 32 | /// Gets or sets the time for the last profile confirmation. 33 | /// 34 | public DateTime? LastConfirmed { get; set; } 35 | 36 | /// 37 | /// Gets or sets the list of official contacts associated with the organization. 38 | /// 39 | public string OfficialContacts { get; set; } 40 | 41 | /// 42 | /// Gets or sets the list of personal contacts associated with the organization. 43 | /// 44 | public string PersonalContacts { get; set; } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /RestClient/DTO/PersonalContact.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace RestClient.DTO 4 | { 5 | /// 6 | /// Data transfer object representing a personal contact from the service owner API. 7 | /// 8 | [PluralName("PersonalContacts")] 9 | public class PersonalContact : HalJsonResource 10 | { 11 | /// 12 | /// Gets or sets a unique id on the personal contact in Altinn. 13 | /// 14 | public string PersonalContactId { get; set; } 15 | 16 | /// 17 | /// Gets or sets the name of the contact. 18 | /// 19 | public string Name { get; set; } 20 | 21 | /// 22 | /// Gets or sets the social security number of the contact. 23 | /// 24 | public string SocialSecurityNumber { get; set; } 25 | 26 | /// 27 | /// Gets or sets the mobile number of the personal contact. 28 | /// 29 | public string MobileNumber { get; set; } 30 | 31 | /// 32 | /// Gets or sets the date for the last time the mobile number was added or changed. 33 | /// 34 | public DateTime? MobileNumberChanged { get; set; } 35 | 36 | /// 37 | /// Gets or sets the email address of the personal contact. 38 | /// 39 | public string EmailAddress { get; set; } 40 | 41 | /// 42 | /// Gets or sets the date for the last time the email address was added or changed. 43 | /// 44 | public DateTime? EmailAddressChanged { get; set; } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # **Important Update: Transition from WPF Toolkit to Web Application** 2 | 3 | We are excited to announce that the WPF Client, previously utilized by Altinn Support, is transitioning to a new, modern web application. 4 | 5 | ### New Repository 6 | The WPF Toolkit repository is now archived. The new repository can be found [here.](https://github.com/Altinn/altinn-support-dashboard) 7 | 8 | ### What This Means for You 9 | The transition marks the end of maintenance for the old WPF Toolkit, as we move towards a more secure and interactive platform. This upgrade is part of our ongoing efforts to enhance user experience and ensure the highest level of security. 10 | 11 | ### Have Questions? 12 | We're here to help. If you have any questions or need further clarification, please feel free to reach out to [Espen E. Halsen](mailto:espen.elstad.halsen@digdir.no?subject=[Altinn-WPF-Archived]). We appreciate your cooperation and understanding during this transition phase. 13 | 14 | ------------------------ 15 | 16 | # OUTDATED WPF client used by Altinn support 17 | Uses a public REST service to lookup contact information and roles delegated in the Altinn contact registry. 18 | ## Building 19 | Install WiX Toolset http://wixtoolset.org/ 20 | 21 | Open AltinnDesktopTool.sln in Visual Studio and build the msi file. 22 | 23 | If used for upgrades, change product code and increment version numbers. 24 | 25 | ## Support 26 | The application is currently being updated / upgraded. If you have any questions or bugs, please make an issue or refer to: 27 | 28 | [Espen E. Halsen](mailto:espen.elstad.halsen@digdir.no?subject=[Altinn-WPF-Support]) 29 | 30 | [Andreas C. Bjørnå](mailto:andreas.chummuenwai.bjorna@digdir.no?subject=[Altinn-WPF-Support]) 31 | -------------------------------------------------------------------------------- /AltinnDesktopTool/App.xaml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /RestClient/Controllers/RestQueryControllerAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace RestClient.Controllers 4 | { 5 | /// 6 | /// Each class implementing IRestQueryController must have this attribute to identify it as a RestQueryController and define its name. 7 | /// The name will be used as part of the URL to identify the controller. 8 | /// 9 | [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] 10 | public class RestQueryControllerAttribute : Attribute 11 | { 12 | /// 13 | /// Initializes a new instance of the RestQueryControllerAttribute class with name and type set to null. 14 | /// 15 | public RestQueryControllerAttribute() 16 | { 17 | } 18 | 19 | /// 20 | /// Initializes a new instance of the RestQueryControllerAttribute class with a given name and supported type. 21 | /// 22 | /// The name of the controller. 23 | /// The type supported by the controller. 24 | public RestQueryControllerAttribute(string name, Type supportedType) 25 | { 26 | this.Name = name; 27 | this.SupportedType = supportedType; 28 | } 29 | 30 | /// 31 | /// Gets or sets the name identifying the controller 32 | /// 33 | public string Name { get; set; } 34 | 35 | /// 36 | /// Gets or sets the supported type for a controller. 37 | /// 38 | public Type SupportedType { get; set; } 39 | 40 | /// 41 | /// Gets or sets the controller type. 42 | /// 43 | internal Type ControllerType { get; set; } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /AltinnDesktopTool/Model/RoleModel.cs: -------------------------------------------------------------------------------- 1 | using AltinnDesktopTool.Utils.PubSub; 2 | 3 | namespace AltinnDesktopTool.Model 4 | { 5 | public class RoleModel : ModelBase 6 | { 7 | private bool isSelected; 8 | 9 | /// 10 | /// Gets or sets the role type 11 | /// 12 | public string RoleType { get; set; } 13 | 14 | /// 15 | /// Gets or sets the role definition id 16 | /// 17 | public string RoleDefinitionId { get; set; } 18 | 19 | /// 20 | /// Gets or sets the role name 21 | /// 22 | public string RoleName { get; set; } 23 | 24 | /// 25 | /// Gets or sets the role description 26 | /// 27 | public string RoleDescription { get; set; } 28 | 29 | /// 30 | /// Gets or sets a value indicating whether an item is selected 31 | /// 32 | public bool IsSelected 33 | { 34 | get 35 | { 36 | return this.isSelected; 37 | } 38 | 39 | set 40 | { 41 | this.isSelected = value; 42 | this.RaisePropertyChanged(() => this.IsSelected); 43 | PubSub.RaiseEvent(EventNames.RoleSelectedChangedEvent, this, new PubSubEventArgs(this)); 44 | } 45 | } 46 | 47 | /// 48 | /// Sets IsSelected 49 | /// 50 | /// boolean value 51 | public void SetIsSelected(bool value) 52 | { 53 | this.isSelected = value; 54 | this.RaisePropertyChanged(() => this.IsSelected); 55 | } 56 | 57 | 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /AltinnDesktopTool/Configuration/EnvironmentConfiguration.cs: -------------------------------------------------------------------------------- 1 | using RestClient; 2 | 3 | namespace AltinnDesktopTool.Configuration 4 | { 5 | /// 6 | /// Class for storing environment based configuration settings 7 | /// 8 | public class EnvironmentConfiguration : IUiEnvironmentConfig, IRestQueryConfig 9 | { 10 | /// 11 | /// Gets or sets the name of the environment that this configuration is connected to. 12 | /// 13 | public string Name { get; set; } 14 | 15 | /// 16 | /// Gets or sets the theme name for the environment that this configuration is connected to. 17 | /// 18 | public string ThemeName { get; set; } 19 | 20 | /// 21 | /// Gets or sets the api key for the environment that this configuration is connected to. 22 | /// 23 | public string ApiKey { get; set; } 24 | 25 | /// 26 | /// Gets or sets the base address for the REST api for the environment that this configuration is connected to. 27 | /// 28 | public string BaseAddress { get; set; } 29 | 30 | /// 31 | /// Gets or sets the certificate thumbprint for the environment that this configuration is connected to. 32 | /// 33 | public string ThumbPrint { get; set; } 34 | 35 | /// 36 | /// Gets or sets a value indicating whether the client should ignore SSL errors. 37 | /// 38 | public bool IgnoreSslErrors { get; set; } 39 | 40 | /// 41 | /// Gets or sets the timeout for the REST api call for the environment that this configuration is connected to. 42 | /// 43 | public int Timeout { get; set; } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /AltinnDesktopTool/View/Footer.xaml: -------------------------------------------------------------------------------- 1 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /RestClient/Resources/RestClientErrorCodes.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace RestClient.Resources 4 | { 5 | /// 6 | /// All possible error codes from the REST client. 7 | /// 8 | public static class RestClientErrorCodes 9 | { 10 | /// 11 | /// The client has wrong or missing configuration values. 12 | /// 13 | public const string RestClientConfigurationError = "RestClientConfigurationError"; 14 | 15 | /// 16 | /// The remote API returned something the client was unable to deserialize. 17 | /// 18 | public const string RestClientDeserialiationError = "RestClientDeserialiationError"; 19 | 20 | /// 21 | /// The remote API returned a http status that the REST client is unable to handle. 22 | /// 23 | public const string RestClientUnableToHandleResponse = "RestClientUnableToHandleResponse"; 24 | 25 | /// 26 | /// The remote API returned http status code 400 Bad Request. 27 | /// 28 | public const string RemoteApiReturnedStatusBadRequest = "RemoteApiReturnedStatusBadRequest"; 29 | 30 | /// 31 | /// The remote API returned http status code 401 Unauthorized. 32 | /// 33 | public const string RemoteApiReturnedStatusUnauthorized = "RemoteApiReturnedStatusUnauthorized"; 34 | 35 | /// 36 | /// The remote API returned http status code 403 Forbidden. 37 | /// 38 | public const string RemoteApiReturnedStatusForbidden = "RemoteApiReturnedStatusForbidden"; 39 | 40 | /// 41 | /// The remote API returned http status code 404 Not Found. 42 | /// 43 | public const string RemoteApiReturnedStatusNotFound = "RemoteApiReturnedStatusNotFound"; 44 | 45 | /// 46 | /// The remote API returned http status code 500 Internal Server Error. 47 | /// 48 | public const string RemoteApiReturnedStatusInternalServerError = "RemoteApiReturnedStatusInternalServerError"; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /AltinnDesktopTool/Resources/WindowsIcons-license.txt: -------------------------------------------------------------------------------- 1 | # License 2 | 3 | Please carefully understand the license and download the latest icons at ModernUIIcons.com. 4 | 5 | ## Understand Your Rights 6 | No Attribution and No Derived Works 7 | http://creativecommons.org/licenses/by-nd/3.0/ * 8 | 9 | - If your project is open source include this license file in the source. 10 | - Nothing is needed in the front facing project (UNLESS you 11 | are using any of the icons listed below in the attribution section). 12 | - Commercial use is not only allowed but encouraged. If it is an icon 13 | in the attribution list below, you still need to attribute those! 14 | - Do not distribute the entire package (I've allowed this dozens of 15 | times for open source projects, but email me first). 16 | 17 | ## Creator 18 | - Austin Andrews (@templarian) 19 | 20 | ## Contributor** 21 | - Jay Zawrotny (@JayZawrotny) 22 | - A Bunch 23 | - Oren Nachman 24 | - appbar.chevron.down 25 | - appbar.chevron.up 26 | - appbar.chevron.left 27 | - appbar.chevron.right 28 | 29 | ## Derived Works 30 | - Alex Peattie 31 | - Social: http://www.alexpeattie.com/projects/justvector_icons/ 32 | 33 | ## Attribution*** 34 | - Kris Vandermotten (@kvandermotten) 35 | - appbar.medical.pulse 36 | - Constantin Kichinsky (@kichinsky) 37 | - appbar.currency.rubles 38 | - appbar.currency.grivna 39 | - Massimo Savazzi (@msavazzi) 40 | - List of missing exported icons 41 | - Proletkult Graphik, from The Noun Project 42 | - appbar.draw.pen (inspired) 43 | - Olivier Guin, from The Noun Project 44 | - appbar.draw.marker 45 | - Gibran Bisio, from The Noun Project 46 | - appbar.draw.bucket 47 | Andrew Forrester, from The Noun Project 48 | - appbar.fingerprint 49 | 50 | * The license is for attribution, but this is not required. 51 | ** Developers and designers that emailed Templarian the source .design icons to be added into the package. PNGs also accepted, but may take longer to be added. 52 | *** Icons I've copied so closely you want to attribute them and are also under the CC license. 53 | 54 | Contact 55 | - http://templarian.com/ 56 | - admin[@]templarian[.]com 57 | 58 | * Does not apply to copyrighted logos 59 | - Skype 60 | - Facebook 61 | - Twitter 62 | - etc... 63 | -------------------------------------------------------------------------------- /IntegrationUnitTest/AltinnRestClientTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.VisualStudio.TestTools.UnitTesting; 3 | using RestClient; 4 | 5 | namespace IntegrationUnitTest 6 | { 7 | /// 8 | /// Test class for unit tests of the AltinnRestClient class. 9 | /// 10 | [TestClass] 11 | public class AltinnRestClientTest 12 | { 13 | private const string Baseaddress = "https://tt02.altinn.basefarm.net/"; 14 | 15 | private const string Apikey = "APIKEY"; 16 | 17 | private const string Thumbprint = "THUMBPRINT"; 18 | 19 | /// 20 | /// Scenario: 21 | /// Perform a Get request without any inputs. 22 | /// Expected Result: 23 | /// A long list of organizations. 24 | /// Success Criteria: 25 | /// There are no exceptions. 26 | /// 27 | [TestMethod] 28 | public void GetTest_RequestUnfiltered_ListOfOrganizations() 29 | { 30 | // Arrange 31 | AltinnRestClient client = new AltinnRestClient 32 | { 33 | BaseAddress = Baseaddress, 34 | ApiKey = Apikey, 35 | Thumbprint = Thumbprint, 36 | IgnoreSslErrors = false, 37 | Timeout = 10 38 | }; 39 | 40 | // Authenticate 41 | // NOTE: Altinn returns 401 even if it is validated. 42 | const string Orgno = "910021451"; 43 | string uriPart = "api/serviceowner/organizations?ForceEIAuthentication"; 44 | try 45 | { 46 | client.Get(uriPart); 47 | } 48 | catch (Exception ex) 49 | { 50 | Console.WriteLine(ex.Message); 51 | } 52 | 53 | // Get by orgno 54 | uriPart = "api/serviceowner/organizations/" + Orgno; 55 | string result = "N/A"; 56 | try 57 | { 58 | result = client.Get(uriPart); 59 | } 60 | catch (Exception ex) 61 | { 62 | Console.WriteLine(ex.Message); 63 | } 64 | 65 | Console.WriteLine(result); 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /AltinnDesktopTool/Utils/PubSub/EventNames.cs: -------------------------------------------------------------------------------- 1 | namespace AltinnDesktopTool.Utils.PubSub 2 | { 3 | /// 4 | /// Static class containing the registered events used 5 | /// 6 | public static class EventNames 7 | { 8 | /// 9 | /// Search event 10 | /// 11 | public static readonly string SearchResultReceivedEvent = "SearchResultReceivedEvent"; 12 | 13 | /// 14 | /// Environment Changed Event 15 | /// 16 | public static readonly string EnvironmentChangedEvent = "EnvironmentChangedEvent"; 17 | 18 | /// 19 | /// Search StartedEvent 20 | /// 21 | public static readonly string SearchStartedEvent = "SearchStartedEvent"; 22 | 23 | /// 24 | /// Organization Selected Changed Event 25 | /// 26 | public static readonly string OrganizationSelectedChangedEvent = "OrganizationSelectedChangedEvent"; 27 | 28 | /// 29 | /// Organization Selected Changed All Event 30 | /// 31 | public static readonly string OrganizationSelectedAllChangedEvent = "OrganizationSelectedAllChangedEvent"; 32 | 33 | /// 34 | /// Role Selected Changed Event 35 | /// 36 | public static readonly string RoleSelectedChangedEvent = "RoleSelectedChangedEvent"; 37 | 38 | /// 39 | /// Role Selected Changed All Event 40 | /// 41 | public static readonly string RoleSelectedAllChangedEvent = "RoleSelectedAllChangedEvent"; 42 | 43 | /// 44 | /// Tab Selected Changed Event 45 | /// 46 | public static readonly string TabItemChangedEvent = "TabItemChangedEvent"; 47 | 48 | /// 49 | /// Role Search Event 50 | /// 51 | public static readonly string RoleSearchResultReceivedEvent = "RoleSearchResultReceivedEvent"; 52 | 53 | /// 54 | /// Role Search Started Event 55 | /// 56 | public static readonly string RoleSearchStartedEvent = "RoleSearchStartedEvent"; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /AltinnDesktopTool/Model/SearchRolesAndRightsInformationModel.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Media; 2 | 3 | namespace AltinnDesktopTool.Model 4 | { 5 | public class SearchRolesAndRightsInformationModel : ModelBase 6 | { 7 | private string subjectSearchText; 8 | private string reporteeSearchText; 9 | private string labelText; 10 | private Brush labelBrush; 11 | 12 | /// 13 | /// Gets or sets the text to be displayed as feedback from the search. 14 | /// 15 | public string LabelText 16 | { 17 | get 18 | { 19 | return this.labelText; 20 | } 21 | 22 | set 23 | { 24 | this.labelText = value; 25 | this.RaisePropertyChanged(() => this.LabelText); 26 | } 27 | } 28 | 29 | /// 30 | /// Gets or sets the brush used to define the look of the label foreground color. 31 | /// 32 | public Brush LabelBrush 33 | { 34 | get 35 | { 36 | return this.labelBrush; 37 | } 38 | 39 | set 40 | { 41 | this.labelBrush = value; 42 | this.RaisePropertyChanged(() => this.LabelBrush); 43 | } 44 | } 45 | 46 | /// 47 | /// Gets or sets the subject search text. 48 | /// 49 | public string SubjectSearchText 50 | { 51 | get 52 | { 53 | return this.subjectSearchText; 54 | } 55 | 56 | set 57 | { 58 | this.subjectSearchText = value; 59 | this.RaisePropertyChanged(() => this.SubjectSearchText); 60 | } 61 | } 62 | 63 | /// 64 | /// Gets or sets the reportee search text. 65 | /// 66 | public string ReporteeSearchText 67 | { 68 | get 69 | { 70 | return this.reporteeSearchText; 71 | } 72 | 73 | set 74 | { 75 | this.reporteeSearchText = value; 76 | this.RaisePropertyChanged(() => this.ReporteeSearchText); 77 | } 78 | } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /AltinnDesktopTool/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | using System.Windows; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Altinn Toolkit")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Altinn Toolkit")] 13 | [assembly: AssemblyCopyright("Copyright © Altinn 2023")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | //In order to begin building localizable applications, set 23 | //CultureYouAreCodingWith in your .csproj file 24 | //inside a . For example, if you are using US english 25 | //in your source files, set the to en-US. Then uncomment 26 | //the NeutralResourceLanguage attribute below. Update the "en-US" in 27 | //the line below to match the UICulture setting in the project file. 28 | [assembly: ThemeInfo( 29 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 30 | //(used if a resource is not found in the page, 31 | // or application resource dictionaries) 32 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 33 | //(used if a resource is not found in the page, 34 | // app, or any theme specific resource dictionaries) 35 | )] 36 | 37 | // Version information for an assembly consists of the following four values: 38 | // 39 | // Major Version 40 | // Minor Version 41 | // Build Number 42 | // Revision 43 | // 44 | // You can specify all the values or you can default the Build and Revision Numbers 45 | // by using the '*' as shown below: 46 | // [assembly: AssemblyVersion("1.0.*")] 47 | [assembly: AssemblyVersion("1.0.0.0")] 48 | [assembly: AssemblyFileVersion("1.0.0.0")] 49 | -------------------------------------------------------------------------------- /AltinnDesktopTool/Model/SearchOrganizationInformationModel.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | using System.Windows.Media; 3 | using AltinnDesktopTool.Properties; 4 | 5 | namespace AltinnDesktopTool.Model 6 | { 7 | /// 8 | /// This model holds the data required to perform a search and details about the label that displays the result of the search. 9 | /// 10 | public class SearchOrganizationInformationModel : ModelBase 11 | { 12 | private string searchText; 13 | private string labelText; 14 | private Brush labelBrush; 15 | 16 | /// 17 | /// Gets or sets the text to be displayed as feedback from the search. 18 | /// 19 | public string LabelText 20 | { 21 | get 22 | { 23 | return this.labelText; 24 | } 25 | 26 | set 27 | { 28 | this.labelText = value; 29 | this.RaisePropertyChanged(() => this.LabelText); 30 | } 31 | } 32 | 33 | /// 34 | /// Gets or sets the brush used to define the look of the label foreground color. 35 | /// 36 | public Brush LabelBrush 37 | { 38 | get 39 | { 40 | return this.labelBrush; 41 | } 42 | 43 | set 44 | { 45 | this.labelBrush = value; 46 | this.RaisePropertyChanged(() => this.LabelBrush); 47 | } 48 | } 49 | 50 | /// 51 | /// Gets or sets the search text. 52 | /// 53 | [Required(ErrorMessageResourceType = typeof(Resources), ErrorMessageResourceName = "SearchOrganizationInformationModel_SearchText_You_must_enter_a_string_")] 54 | public string SearchText 55 | { 56 | get 57 | { 58 | return this.searchText; 59 | } 60 | 61 | set 62 | { 63 | this.searchText = value; 64 | this.RaisePropertyChanged(() => this.SearchText); 65 | this.ValidateModelProperty(value, "SearchText"); 66 | } 67 | } 68 | 69 | /// 70 | /// Gets or sets the search type indicating what the user is searching for. 71 | /// 72 | public SearchType SearchType { get; set; } 73 | } 74 | } -------------------------------------------------------------------------------- /AltinnDesktopTool/Utils/PubSub/PubSub.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace AltinnDesktopTool.Utils.PubSub 4 | { 5 | /// 6 | /// Defines the handler 7 | /// 8 | /// The View Type 9 | /// The Sender 10 | /// The Arguments 11 | public delegate void PubSubEventHandler(object sender, PubSubEventArgs e); 12 | 13 | /// 14 | /// Class to register and raise events between views 15 | /// 16 | /// The View Type 17 | public static class PubSub 18 | { 19 | private static Dictionary> events = 20 | new Dictionary>(); 21 | 22 | /// 23 | /// Adds a new event 24 | /// 25 | /// The event name 26 | /// The event handler 27 | public static void AddEvent(string name, PubSubEventHandler handler) 28 | { 29 | if (!events.ContainsKey(name)) 30 | { 31 | events.Add(name, handler); 32 | } 33 | } 34 | 35 | /// 36 | /// Raises a new event 37 | /// 38 | /// The name of the event 39 | /// The object sender of the event 40 | /// The arguments 41 | public static void RaiseEvent(string name, object sender, PubSubEventArgs args) 42 | { 43 | if (events.ContainsKey(name) && events[name] != null) 44 | { 45 | events[name](sender, args); 46 | } 47 | } 48 | 49 | /// 50 | /// Registers an event 51 | /// 52 | /// The event name 53 | /// The event handler 54 | public static void RegisterEvent(string name, PubSubEventHandler handler) 55 | { 56 | if (events.ContainsKey(name)) 57 | { 58 | events[name] += handler; 59 | } 60 | else 61 | { 62 | events.Add(name, handler); 63 | } 64 | } 65 | 66 | /// 67 | /// Clears the registered events 68 | /// 69 | public static void ClearEvents() 70 | { 71 | events = new Dictionary>(); 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /AltinnDesktopTool/ViewModel/FooterViewModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.ObjectModel; 2 | using System.Linq; 3 | using System.Windows.Input; 4 | 5 | using AltinnDesktopTool.Configuration; 6 | using AltinnDesktopTool.Utils.PubSub; 7 | 8 | using GalaSoft.MvvmLight; 9 | using GalaSoft.MvvmLight.Command; 10 | 11 | namespace AltinnDesktopTool.ViewModel 12 | { 13 | /// 14 | /// ViewModel class, container for Environment change related components 15 | /// 16 | public class FooterViewModel : ViewModelBase 17 | { 18 | /// 19 | /// Initializes a new instance of the class. 20 | /// ViewModel for Footer view 21 | /// 22 | public FooterViewModel() 23 | { 24 | this.ChangeEnvironmentCommand = new RelayCommand(this.ChangeEnvironmentHandler); 25 | 26 | this.EnvironmentNames = new ObservableCollection(EnvironmentConfigurationManager.EnvironmentConfigurations.Select(c => c.Name).ToList()); 27 | this.SelectedEnvironment = EnvironmentConfigurationManager.ActiveEnvironmentConfiguration.Name; 28 | 29 | PubSub.AddEvent(EventNames.EnvironmentChangedEvent, this.EnvironmentChangedEventHandler); 30 | } 31 | 32 | /// 33 | /// Environment changed event 34 | /// 35 | public event PubSubEventHandler EnvironmentChangedEventHandler; 36 | 37 | /// 38 | /// Gets or sets the Selected environment name 39 | /// 40 | public string SelectedEnvironment { get; set; } 41 | 42 | /// 43 | /// Gets or sets the available environment names 44 | /// 45 | public ObservableCollection EnvironmentNames { get; set; } 46 | 47 | /// 48 | /// Gets a command which will define a behavior on Change environment event 49 | /// 50 | public ICommand ChangeEnvironmentCommand { get; private set; } 51 | 52 | /// 53 | /// Event handler for the ChangeEnvironment command. Sets the active environment configuration and raises EnvironmentChanged event. 54 | /// 55 | public void ChangeEnvironmentHandler() 56 | { 57 | EnvironmentConfigurationManager.ActiveEnvironmentConfiguration = EnvironmentConfigurationManager.EnvironmentConfigurations.Single(c => c.Name == this.SelectedEnvironment); 58 | PubSub.RaiseEvent(EventNames.EnvironmentChangedEvent, this, new PubSubEventArgs(this.SelectedEnvironment)); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /AltinnDesktopToolSetup/AltinnDesktopToolSetup.wixproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | x86 6 | 3.10 7 | 18fd8a01-a620-4c49-9214-389ce758ce87 8 | 2.0 9 | AltinnToolkitInstaller 10 | Package 11 | $(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets 12 | $(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets 13 | 14 | 15 | bin\$(Configuration)\ 16 | obj\$(Configuration)\ 17 | Debug 18 | 19 | 20 | bin\$(Configuration)\ 21 | obj\$(Configuration)\ 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | AltinnDesktopTool 33 | {11bcd26a-9604-4b02-bccf-f85c693f685f} 34 | True 35 | True 36 | Binaries;Content;Satellites 37 | INSTALLFOLDER 38 | 39 | 40 | 41 | 42 | $(WixExtDir)\WixUIExtension.dll 43 | WixUIExtension 44 | 45 | 46 | 47 | 55 | -------------------------------------------------------------------------------- /RestClient/IRestQuery.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using RestClient.DTO; 3 | 4 | namespace RestClient 5 | { 6 | /// 7 | /// Interface representing the Client Proxy for accessing the service owner Altinn REST server interface. 8 | /// 9 | public interface IRestQuery 10 | { 11 | /// 12 | /// Fetches a list of objects from the given URL location. 13 | /// 14 | /// The type of data object (DTO) which must be a subclass of to be returned. 15 | /// The url to send to Altinn. 16 | /// The found object or null if not found. 17 | /// 18 | /// Controller is identified by the controller having [RestQueryController(SupportedType=T)] defined with a matching T type. 19 | /// 20 | IList GetByLink(string url) where T : HalJsonResource; 21 | 22 | /// 23 | /// Search for a list of objects by filtering on a given name value pair. 24 | /// The possible values name value pairs depends on the controller being called. 25 | /// The controller is identified by the type T. 26 | /// 27 | /// The type of objects to be retrieved. This also determines the controller to call. 28 | /// The name value pair filter 29 | /// A list of objects, empty or null if none found 30 | IList Get(KeyValuePair filter) where T : HalJsonResource; 31 | 32 | /// 33 | /// Fetches a object by a given link (url). 34 | /// This is useful where a link is returned in a previous call. 35 | /// 36 | /// The type of object to be retrieved. 37 | /// The id of the object to retrieve 38 | /// An object, possibly null if none found 39 | T Get(string id) where T : HalJsonResource; 40 | 41 | /// 42 | /// Perform a REST API request based on the pattern: {baseAddress}/{controller}?{key1}={value1}&{key2}={value2}. 43 | /// 44 | /// The type of object the controller should attempt to deserialize the json response into. 45 | /// The filter values for the search. 46 | /// A list of instances of the expected type. 47 | IList Get(List> filter) where T : HalJsonResource; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /RestClient/Deserialize/Deserializer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Newtonsoft.Json; 4 | using Newtonsoft.Json.Linq; 5 | using RestClient.DTO; 6 | using RestClient.Resources; 7 | 8 | namespace RestClient.Deserialize 9 | { 10 | /// 11 | /// Class for deserializing HAL+JSON format 12 | /// 13 | public class Deserializer 14 | { 15 | private static readonly string ErrorOnDeserialization = "Error while deserializing Json data"; 16 | 17 | /// 18 | /// Deserializes a list of Typed objects from HAL+JSON format. 19 | /// Type T should have HalJsonResource as base class 20 | /// 21 | /// type T 22 | /// Input string to deserialize 23 | /// Typed list of T 24 | public static List DeserializeHalJsonResourceList(string json) where T : HalJsonResource 25 | { 26 | List resources; 27 | 28 | try 29 | { 30 | OuterJson outerResource = JsonConvert.DeserializeObject(json); 31 | JObject innerObjectJson = outerResource._embedded; 32 | 33 | PluralNameAttribute attribute = (PluralNameAttribute)Attribute.GetCustomAttribute(typeof(T), typeof(PluralNameAttribute)); 34 | 35 | JToken resource = innerObjectJson[attribute.PluralName.ToLower()]; 36 | resources = JsonConvert.DeserializeObject>(resource.ToString(), new HalJsonConverter()); 37 | } 38 | catch (Exception e) 39 | { 40 | throw new RestClientException(ErrorOnDeserialization, RestClientErrorCodes.RestClientDeserialiationError, e); 41 | } 42 | 43 | return resources; 44 | } 45 | 46 | /// 47 | /// Deserializes a Typed object from HAL+JSON format 48 | /// Type T should have HalJsonResource as base class 49 | /// 50 | /// type T 51 | /// Input string in json format 52 | /// Instance of type T 53 | public static T DeserializeHalJsonResource(string json) where T : HalJsonResource 54 | { 55 | T resource; 56 | 57 | try 58 | { 59 | resource = JsonConvert.DeserializeObject(json, new HalJsonConverter()); 60 | } 61 | catch (Exception e) 62 | { 63 | throw new RestClientException(ErrorOnDeserialization, RestClientErrorCodes.RestClientDeserialiationError, e); 64 | } 65 | 66 | return resource; 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /AltinnDesktopTool/View/SearchOrganizationInformation.xaml: -------------------------------------------------------------------------------- 1 | 12 | 13 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 |