Some smaller updates for DbLocalizationProvider

Localization provider is well and alive. Lately I've been heads down busy with porting some of the parts over to .Net Core targeting .Net Standard version 2.0. Anyway just wanted to let you know some of the smaller updates and fixes for the latest version of the provider packages. Multi-Target -> NetFx and Core Now there are specific multi targets for .Net Framework and .Net Core for and packages. This was required due to reported issues when package was used context together with WebApi (to be more specific -…

Keep reading

Alternative Localization for Asp.Net Core Applications

Asp.Net Core Built-In Support This is code fragment from official documentation how to localize content using built-in functionality. App Content Localization [Route("api/[controller]")] public class AboutController : Controller { private readonly IStringLocalizer<AboutController> _localizer; public AboutController(IStringLocalizer<AboutController> localizer) { _localizer = localizer; } [HttpGet] public string Get() { return _localizer["About Title"]; } } And if you are working with Html content that shouldn't be escaped during rendering - you are using IHtmlLocalizer implementation that returns LocalizedHtmlString instance. public class BookController : Controller { private readonly IHtmlLocalizer<BookController> _localizer; public BookController(…

Keep reading

Year in Review

This is yet another period of the year when you pause a bit and look back. I've been taught to be in the present moment and not to look in the past or try to predict the future, but nonetheless it's a way to thank you all great people around me. Episerver has a great ecosystem and great community, I am very thankful to both. Spare time projects is great way to achieve something, to help other fellows and sharpen a bit your own technical and soft skills. This was…

Keep reading

Fix Logging in Azure Functions when Reusing Your Component

There are cases when your project follows hype and you face the case when you need to reuse your component in serverless world. This blog post is about how to fix logging (I picked Common.Logging, but actual implementation does not matter) when reusing some of your components in Azure Functions. Existing Component Most of the time I see that transition to functions or serverless computing is not done by rewriting component that does black magic and delivers business logic, but instead - just referencing it and invoking from function.…

Keep reading

Episerverless = Episerver + Azure Functions

I did talk about this topic couple times solo, and also together with Henrik Fransas in Episerver Partner Close-up in Stockholm this year. Received lot of questions regarding source code availability and also about recordings of the session(s). Unfortunately there are no recordings of the conferences I/we were. So I decided just compile together a blog post. Objective Idea for the conference talk(s) was to show how you can integrate Azure Functions with Episerver and how that nicely plays together. There are zillions problems to solve with…

Keep reading

LocalizationProvider - Tree View, Export and Migrations

It's been a while since last blog post about localization provider. It just means that I've been heads down busy with implementing some great features :) Anyway - these are most probably last features before I'm switching over to .Net Core. I know that you might ask - why you need .Net Core if Episerver is still not there yet!? I'm planning to migrate to .Net Core because Episerver plugin is just small fraction of localization provider and actually you can use it outside of Episerver also - just in regular…

Keep reading

Strongly Localized EPiServer Categories

Initially strongly typed localization provider was not planned to be used everywhere in EPiServer, but localizing categories came as complimentary feature: [LocalizedResource(KeyPrefix = "/categories/")] public class Categories { [ResourceKey("category[@name=\"" + nameof(SampleCategory) + "\"]/description")] public static string SampleCategory => "Some Category !"; } Still there is lot of ceremony to get things right.. Sick and tired of generating proper resource keys for localizing EPiServer categories? Say no more. Localization provider gives you now (within latest version) possibility to decorate your class with attribute and necessary translations will be added automagically. Here is a…

Keep reading

Feedback Taken - EPiServer Localization Provider Updates

Listen to the audience. I was more than lucky to be on some local user groups to talk about strongly typed localization provider for EPiServer. Feedback from the audience is more likely to be provided than awaiting comments in blog posts. You have to listen to the audience, you really have to. They are your consumers, they know more about the context and projects where and how your library might be used. Over couple of last weeks I've been heads down busy with some of the feedback implementation. Here is…

Keep reading

Breaking Change in ImageResizer EPiServer Plugin

Usually I don't post small changes in separate blog post, but I think that it's worth to mention breaking changes in latest ImageResizer (IR) plugin for EPiServer. Before If you are using Fluent API to resize the image, then you may face inconsistency in API. Passing in null or ContentReference.EmptyReference you will get an ArgumentNullException exception: @Html.ResizeImage(null, 100, 100) However, if passing in string.Empty for the another overload - you would get back empty string: @Html.ResizeImage(string.Empty, 100, 100) Why this is bad -…

Keep reading

Updates for DbLocalizationProvider - Foreign Resources

Blog post about latest updates for database localization provider project. Release mainly focuses on foreign affairs - foreign, hidden and referenced resources. Read further for more info. Foreign Resources Good friend and colleague of mine asked once: "How do I register localized resources for ValidationIssue enum from EPiServer Commerce assembly?" Short answer back then was - you can't. Until now. With latest database localization provider now you can tell provider to get familiar with so called foreign resources and include those in sync process as well - even they are…

Keep reading

Disposable Dependency for Azure WebJob

Recently we had experience with Azure WebJobs hosting system and specificely - with disposable jobs. This blog post will describe how to properly handle disposable job dependency. Why Dependency? You might ask, why I need to have dependencies for the Azure WebJob. The only purpose for WebJob would be to kick-off rest of the services and transfer control to them to do the work. According to some software architectural theories - WebJob is just the delivery mechanism, it's a trigger for other services to step up and carry out the…

Keep reading

DbLocalizationProvider step closer to front-end

Along with other smaller bug fixes, database-driven localization provider for EPiServer got closer to front-end. We joined forces together with my old pal and friend Arve Systad and made it possible to add translations to client side resources as well. Setup So setup for the client-side resource localization with help of DbLocalizationProvider plugin is more or less straight forward. You will need to install DbLocalizationProvider.EPiServer.JsResourceHandler package from EPiServer feed and add corresponding <script> include in your markup file to fetch translations from the server: <script…

Keep reading

Small Enhancement for Feature Folders

Great colleague of mine Māris Krivtežs wrote blog post about feature folders describing code organization into folders by features or functional areas rather than technology or different grouping. However, one of cons from Maris' approach we couldn't reconcile with - name of the sub-feature folder needs to follow Mvc controller naming convention. "Another issue is related to the sub-feature folder naming. Sub-feature folder still should be called with the same name as a controller." So I made tiny adjustment to the view engine worth sharing. Adjusted code is below. public…

Keep reading

Localization Provider - Import and Export (Merge)

It's been awhile since last update for DbLocalizationProvider for EPiServer. Anyway things been in my backlog. Period around New Year is not the most productive for me :) This blog post will describe some of the interesting stuff I've been lately busy with. Export & Import - View Diff Once upon a time I got sick of merging and importing new resources from staging environment (with adjusted translations by editors) into production database where on the other hand editors already made changes to existing resources. Up till now import process only…

Keep reading

Scheduled Jobs Updates

Some great updates have been delivered to EPiServer Scheduled Jobs infrastructure within version 10.3. In this blog post we will review some of the important changes. Scanning Process Property IsStoppable is now calculated during scanning process. Scheduled jobs scanner detects whether job is stoppable or not. If so - it's written down to the database and used later when job is being triggered. Also - now with v10.3 you don't need to inherit from base class (EPiServer.Scheduler.ScheduledJobBase). In this case all you need is to have…

Keep reading

Customize Css styles loaded from EPiServer.Forms.Samples

This blog post will describe a way how to customize styles and scripts loaded by EPiServer.Forms.Samples package. Background Unfortunately EPiServer.Forms package does not have DateTime picker available in standard package. So you need to download and reference sample package that contains reference scripts and form elements for some additional stuff. Among others one of them is date time picker. It's based on jQuery UI. More or less everything is OK, until you need to customize look & feel of the date time picker. The way how it's…

Keep reading

Playing with Fire - Part 2, updates for DbLocalizationProvider for EPiServer

Story continues with fire and localization cases inside EPiServer sites. This time smaller update for database localization provider, but still - worth sharing. Support for Custom Attributes Currently database provider supports and understands just a few System.Attribute child classes: [LocalizedModel] - this is main marking attribute for making sure that provider resource sync process will pickup decorated class and scan resources there; [LocalizedResource] - this is similar as LocalizedModel, but makes sure that resources discovered at this class will take localized resource semantics. Read more here about differences; [ResourceKey]…

Keep reading

Playing with Fire - Localized EPiServer View Models

Recently released driven localization provider for EPiServer had main focus on more complex view models along the other smaller bug fixes and features. And specifically - there were few unsupported scenarios for the view models with base/parent class. Here is the list of all new features in v2.1. Extract Abstractions Until now, if I do need to decorate some of the resources that are located in some core area assembly - you need to reference DbLocalizationProvider library that had some undesired dependencies (for instance, why do I need…

Keep reading

ImageResizer Plugin for EPiServer v10

ImageResizer.Net Plugin for EPiServer v10 is released. ImageResizer.Plugins.EPiServerBlobReader got version 5.0.0. "Old" NuGet package for EPiServer 9.x is updated with upper version constraint fix. Now plugin package v4.2 has upper EPiServer version set under v10 exclusive. Note About Image Preview That was quite "interesting" experience to realize changes in EPiServer.Web.BlobHttpHandler. This is eventually the guy who is responsible for returning Blob back to the client. A bit more details below. Background First of all a bit background. Images in EPiServer EditUI…

Keep reading

Baking Round Shaped Software - Mapping to the Code

This part of the round shaped software blog posts as promised will be about mapping the theoretical terms and ideas mentioned in previous post to the actual code fragments and components. Application for the Post To move further and map theory to the code, I've created really simple sample application for managing the users. To demonstrate mediator internals and round shaped architecture - we will stick with hand crafted mediator. Mediator will be able to handle commands, queries and events. In the application you can: enlist existing users (for the…

Keep reading