Our blog contains the activity stream of Orchard Dojo: general news, new resources or tutorials are announced here.

Featured tags

IIS
API
All tags >

Cache Failover and Shared options, YesSql updates - This week in Orchard (26/11/2021)

Huge YesSql updates, new cache failover and shared options, Media Library improvements, and a new site running on Orchard Core! Do you want to know more? Then don't forget to check out our current post! Orchard Core updates YesSql updates YesSql has updates for the following drivers: MySqlConnector 2.0, Npgsql 6.0, Microsoft.Data.Sqlite 6.0. The Npgsql 6.0 has breaking changes in terms of date and time serialization. The breaking change is in the way it handles time stamps and date-time storage and the type of column that it stores them into. The Microsoft.Data.Sqlite is on 6.0, which contains the SQLite Connection Pooling, so it's pooling SQLite connections now. If we check out the benchmarks for MVC, where Orchard is one of them, and it's running the About page on SQLite, and you can see that on both Windows and Linux it goes up from around 5000 requests per second to 16000 requests per second and also the latency went down. Removed beforeFolderAdded to stop multiple calls to fetch folders When you click OK on the new Media Folder name dialog, the first thing it does after creating the new folder emits beforeFolderAdded which loads the folder we are currently on. Then it emits the folderAdded, which selects the new folder (triggering a load of the new folder through the watcher). It appears that both requests are in flight at the same time, and we are seeing that occasionally the beforeFolderAdded request comes in last and then makes it appear as if the new folder has all the contents of the previously selected folder. bus.$on('addFolder', function (target, folder) { if (self.model == target) {bus.$emit('beforeFolderAdded', self.model); if (self.children !== null) { self.children.push(folder); } folder.parent = self.model; bus.$emit('folderAdded', folder); }}); So, when we create a folder, we fire the beforeFolderAdded then folderAdded both of which load contents of a folder, but there is no guarantee on the order these calls will resolve in. Occasionally, we are seeing the first call to the original folder come in second, and the new folder appears to be populated with images already. Cache Failover and Shared options Sometimes the Redis server is not available because there could be timeouts for example. What do you serve when Redis is down, and it's part of your system. Do you serve something or just wait and try again? You could say that if the cache fails then go to the database and return something from there. But at the same time, it can also be dangerous because you could expose yourself to put your site down. If you expect not to do a lot of database stuff because you have a caching layer, you can put your site down. The DefaultDynamicCacheService uses the IMemoryCache to at least prevent something if Redis is down. For example, cache the id of a requested document locally so that the memory cache is used during the FailoverRetryLatency, which is a configuration value that has a 30 seconds value by default. News from the community Dixin's Blog is running on Orchard Core If you navigate to https://weblogs.asp.net/dixin, you will find a blog that contains several interesting posts about .NET, Windows, and many more. The site is using Orchard Core, and as you may notice, it's very fast, no matter how much content it has on it. Lombiq Gulp Extensions with Stylelint Our Gulp Extensions project now also provides Sass SCSS linting with Stylelint! To use it in your Gulp JS SCSS build pipeline, just configure the corresponding SCSS targets Gulp task. Read more about how you can do that here! Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 232 subscribers! We have started this newsletter to inform the community around Orchard with the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post is published to Orchard Dojo, including This week in Orchard of course. Do you know of other Orchard enthusiasts who you think would like to read our weekly articles? Tell them to subscribe here! If you are interested in more news around Orchard and the details of the topics above, don't forget to check out the recording of this week's Orchard meeting!

Workflows atomicity, Inline scripts and style sheets - This week in Orchard (07/02/2021)

Workflows atomicity, support inline scripts and style sheets, admin UI sticky buttons, filter and search feature for List Part too. Do we need to tell more about the content of our current post? Let's jump into the recent news of Orchard Core! Orchard Core updates Support Inline location for styles and scripts You can specify several options when working with commonly used resources like JavaScript libraries and CSS files like using a configured CDN or appending a version hash to all local scripts and style sheets. You can also specify a location the script should load, for example, you can say that I would like to render my style sheet in the HEAD of my page. If the location is not specified or specified as Inline, the script will be inserted wherever it is placed (inline). Let's say we have a site set up using the Agency recipe. Then let's navigate to Design -> Templates on the admin UI and find the predefined Content__LandingPage template. Here we can try out the new Inline mode using Liquid helpers! Try to inject the jQuery named script inline before we render the Portfolio content items. To do that we just need to add the following line: {% script name:"jQuery", at:"Inline" %}. And as you can see in the code, there is the script HTML tag right after the jQuery script text. Filter/search feature for List Part too If you navigate to the content items list of your site (Content -> Content Items) you can use a nice search feature that you can use to filter your content items by the display text values. You can also use the quick filters to see only the draft/published items or the ones that owned by you. But you can't use this filter for the List Part lists. Until now! If you have a site with a Blog recipe, head to the Blog option on the admin UI and check out the new UI. You will see the exact same filter and search here as we have seen on the content items list. New IUserClaimsProvider interface This is about the extensibility of the ClaimsProviders. You used to have to inherit from the DefaultUserClaimsPrincipalFactory to provide all the claims but now you have a new IUserClaimsProvider interface that you can implement. There are some default ones like the EmailClaimsProvider. Workaround for DateTimeOffset in indexes The OpenIdAuthorizationIndex hasn't been sent to Dapper by YesSql correctly. Here the DateTimeOffset? hasn't been handled correctly and the workaround is to use DateTime?. So, for now, the local fix is to use DateTime? instead of DateTimeOffset? in the index provider and DateTime instead of DateTimeOffset in the migrations. Demos Sticky action buttons on the admin UI The problem is that you have to do a lot of scrolling to find the action buttons to save, publish or preview your content item. There could be several options to solve this issue but now to experiment how easy to use the implemented solution, this one only affects the Templates page right now. The idea that has been implemented is to have sticky action buttons on the top of the page instead of showing them at the bottom of the screen. If you set up your site using the Agency recipe and open the predefined template (Design -> Templates) and scroll down a little bit you will see the same screen as we show here. If you would like to see the sticky buttons in action too, head to YouTube and check out this recording. And as always, if you have any feedback or suggestion on how to solve the issue of needing to scroll down a lot to reach the action buttons, don't hesitate to share your ideas on GitHub! Workflows atomicity In this demo, you could see a workflow that has a starting activity that is about to handle an incoming HTTP GET request. This workflow will call an endpoint using an HTTP GET request 30 times using a For Loop activity. After that 30 actions finished, the workflow will publish a new content item and display a simple success notification. You could ask that what is the goal to call a given endpoint 30 times and you are right. But for this time the goal of this workflow is to demonstrate that we have a long-running workflow and this process can perfectly demonstrate that. Make sure you can only have one instance of this workflow type at the same time by putting a tick in the Single instance checkbox. Because it's a single instance if you call this workflow again without the first one has been successfully finished, the execution will wait for the first one to be finished. So, the system will only start to execute the second call after the first execution was finished with or without an error. In this demo, you can see what will happen if you do 10 concurrent requests to start this workflow. You will see 10 workflow instances instead of 1. But why? It's a singleton, you should see only one instance, right? Let's navigate to the properties of the given workflow where you will see two new options: Lock timeout and Lock expiration and give them a value in ms like 10000. Now let's try to call this workflow again using 10 concurrent requests. What will happen that now if you check out the instances of the given workflow, you will find only one item there. Check out the recording to see what are these new options exactly and how to use them correctly! News from the community Work with us! You've completed the Dojo Course, congratulations! You’re now officially an Orchard Core developer. Would you like to work on a variety of challenging Orchard Core projects with the biggest Orchard team in the world? Work with us! Just send us an e-mail to crew at lombiq.com. Please include what you’re most interested in professionally and attach around 100 lines of any kind of code that you’re especially proud of or just link to the favorite open-source project of your own on GitHub or else. Orchard Dojo Newsletter Lombiq's Orchard Dojo Newsletter has 191 subscribers! We have started this newsletter to inform the community around Orchard with the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post published to Orchard Dojo, including This week in Orchard of course. Do you know of other Orchard enthusiasts who you think would like to read our weekly articles? Tell them to subscribe here! If you are interested in more news around Orchard and the details of the topics above, don't forget to check out the recording of this week's Orchard meeting!

This week in Orchard - 08/09/2019

Getting closer and closer to the release of .NET Core 3.0 and Orchard Core RC! What do we need to ship the new version and what are the newest features of Orchard Core? Find out now! On Orchard Core Updating YesSql In SQL server it was not working correctly if you pass the parameter as the limit value. You can do SELECT * FROM FOO @limit, where the @limit is the parameter. That will be converted to SELECT TOP @limit FROM FOO in SQL server, but that doesn't work. When you use a variable like this it needs parenthesis. Now every time when we render it in YesSQL, it's in parenthesis: SELECT TOP (@limit) FROM FOO.You can also find a xUnit test in the SqlParserTests.cs file, where the parameters of the InlineData attributes are also using parenthesis. Ability to extend/clear ContainedContentTypes Now if you want to update the ContainedContentTypes of the Container Part then you can do that. Before that, if you add a type it removes the old one. Now you can choose to merge it with the existing one. And by using the ClearContainedContentTypes extension method, you can also clear the ContainedContentTypes. Remove JSON specifier from GraphQL MD code blocks The documentation used the JSON highlighting for the GraphQL queries, which is the closest to a GraphQL query, but it's wrong. It could show some wrong colors, so now it's just doing nothing. A GraphQL query is not a JSON payload, just the result of the query. .NET Conf 2019 There will be the .NET Conf next month, which is a 3-day virtual developer event co-organized by the .NET community and Microsoft. Sébastien is submitting a talk about Orchard Core modularity and multitenancy. We hope that he will able to get a talk! On these days they launch .NET Core 3.0, which is the 23rd of September. A plan is to ship Orchard Core RC on the day after the .NET Core 3.0 and the builds are available. Upgrading an Orchard Core site that using .NET Core 2.2: it's non-breaking in terms of database or recipes and everything. We are just upgrading the APIs from 2.2 to 3.0. So, in theory, if we take a site that has been built with 2.2 and we just upgrade to the branch that using 3.0, then it should not change anything. The only thing it should change hopefully is the performance of the site because .NET Core 3.0 is much faster and use less memory than 2.2. The image of .NET 3.0 will also be available on Docker. To ship Orchard Core RC, we only need to have finalized all the things for localization. We have most everything we need, instead of the field syncing. Let's have a look at our Roadmap! You can see that everything is implemented from the backlog. Adding more localization packages will not be that hard, the repositories are already done for these packages. And we have PRs for almost every bonus features that listed in the roadmap. We also need to focus on every issue in GitHub that marked for RC and has a priority tag on it. A new website using Orchard Core Patient Access connects you to healthcare services when you need them most. Book GP appointments, order repeat prescriptions and explore your local pharmacy services. This site is running on Docker for Linux on Azure as an Azure Docker Service on Linux. It's based on GraphQL. For example, when you navigate to Pharmacy services and searching for healthcare services, then it's GraphQL. If you search for Hay fever treatments and using S66 as the postcode, the results that you got is returned by GraphQL. If you are interested in more websites using Orchard and Orchard Core, don't forget to visit Show Orchard. Show Orchard is a website for showing representative Orchard CMS (and now Orchard Core) websites all around the internet. It was started by Ryan Drew Burnett, but since he doesn't work with Orchard anymore, as announced earlier it is now maintained by our team at Lombiq Technologies. On Lombiq Orchard Dojo Newsletter Now we have 88 subscribers of the Lombiq's Orchard Dojo Newsletter! We have started this newsletter to inform the community around Orchard with the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post published to Orchard Dojo, including This week in Orchard of course. Do you know of other Orchard enthusiasts who you think would like to read our weekly articles? Tell them to subscribe here! If you are interested in more news around Orchard and the details of the topics above, don't forget to check out the recording of this week's Orchard meeting!

How to install SQL Server 2016 (and SSMS 2016)

As an update to our earlier how-to for setting up a developer environment with IIS and SQL Server 2014 for Orchard, here's a step-by-step guide for setting up SQL Server 2016 and SQL Server Management Studio 2016 on your machine. If you're upgrading from SQL Server 2005, we have good news for you: SQL Server 2016 is faster. Prerequisites Make sure that your msvcr120.dll file is the appropriate version, as described in the official documentation. SQL Server 2016 Go to the Technet Evaluation Center, sign in with a Microsoft ID and download the installer. Installation Select "Custom" as the installation type on the splash screen. New SQL Server stand-alone installation or add features to an existing installation (opens a new window) Product key Specify a free edition: Developer Feature Selection Instance Features -> Database Engine Services -> check (you probably won't need anything else) Instance Configuration Default instance -> select Instance ID: MSSQLSERVER (this will mean that the instance can be accessed with the shortest host name possible: ".", ".\" or "localhost", but also by your machine name; you may have to change this or remove a previous installation if this name is taken) Database Engine Configuration Server Configuration Authentication Mode -> Windows authentication mode Specify SQL Server administrators -> Add Current User Data Directories: change, if necessary SQL Server Management Studio 2016 Go the MSDN download page of the product to get the installer. What else to do Head back to the original article and follow the installation guide from step 9.

How-to: running Orchard locally through IIS using SQL Server

This tutorial shows you how to run Orchard on your development machine (that doesn't run Windows Server) not with Visual Studio's built-in Cassini webserver, but using a proper IIS webserver. As the database we'll use a standard SQL Server database, that's advised for non-trivial production installations, unlike SQL CE. Update (25th of June, 2016): Added link to a later blogpost about installing SQL Server 2016 and SQL Server Management Studio 2016. The video shows everything in detail, but here are the main points you have to follow, together with corresponding links. First we'll install IIS, corresponding tools and set up our Orchard instance as a website in IIS. Then we'll set up a local SQL Server too. Install WebMatrix, this will install Web Platform Installer as well. You may ask yourself "Why do I need WebMatrix? I'm not a rookie!" However WebMatrix is still a nice lightweight tool for certain tasks, especially for checking the SQL CE database of your experimental Orchard instances your run locally: WM's SQL browser is much more straightforward to use than SQL Server Management Studio for small datasets (what you'll likely have when you develop something and you want to dig around int the DB) and it supports SQL CE out of the box.Also, installing WM will install some dependencies that we'll need anyway, like IIS Express.If you absolutely want to avoid WM you could install Web PI directly, then install the latest IIS Express through Web PI as a minimum. Install IIS Manager (IIS Manager for Remote Administration) from Web PI. IIS Manager will enable us to edit the setup of IIS from a graphical interface. Actually as its name tells, you can use IIS Manager not just to manage your local IIS, but also remote servers (if they enable this). Install the following extensions through Web API: ASP.NET 4.5 or newer if you have it listed in Web PI (needed for running ASP.NET web apps) and IIS Recommended Configuration, HTTP Errors at least, but you'll likely need URL Rewrite too. If you don't have .NET 4.5 or newer already installed (because you run a system older than Windows 8) then you should install that (also possible through Web PI) first. Set up your first Orchard website in IIS by opening IIS Manager and doing the following: Add a new web site from under Sites. Under Physical Path browse the Orchard.Web folder of the instance you want to run with IIS. As the default binding the most simple value you can use is something like "mysite.localhost". This way you can run your sites with a nice url that is only reachable from your machine. Go to Application Pools in IIS Manager. Make sure the app pool you've created runs on the latest .NET framework.Also change the app pool's identity (under its Advanced Settings to your account with your user's credentials. This will come handy when setting up the SQL Server connection where we'll not use an SQL database user/pass combo but the connection will have "integrated security" (i.e. will use our user). If you use DB users then you don't need to change the app pool's identity, just remember to include that user/pass in your site's connection string then. Don't forget to build your solution latest at this point otherwise you'll see "Parser Error: Could not load type 'Orchard.Web.MvcApplication'." messages. At this point you can open up your site and install it with SQL CE just as usual. But we want more! We want full SQL Server! That's why we download SQL Server Express 2012 Advanced Tools (look for SQLEXPRADV_x64_ENU.exe), or if you're from the future, then the 2140 version of the same tool (I don't think SQL will ever die...). This includes everything we need. Update: here is SQL Server 2014 Express SP 1 (again, download SQLEXPRADV_x64_ENU.exe to get everything). Please visit our later blogpost about installing SQL Server 2016 and SQL Server Management Studio 2016. In the setup choose "New SQL Server stand-alone installation" and install SQL Server. You can basically leave everything on the default (you can set up your server as a default or named instance, it doesn't really matter most of the time; if you want to access your SQL server from under "localhost" though, select default). Now you can connect to your local SQL Server and explore it through SQL Server Management Studio that was installed through Advanced Tools. You can connect with your server's name (if you've chosen to give the server a name when installing), using just "localhost" or by using your computer's name. In Sql Server Configuration Manager make sure to enable TCP/IP connections under "SQL Server Network Configuration" (and as prompted, restart the SQL Server service under "SQL Server Services" in the Config Manager). Otherwise Orchard wouldn't be able to connect to the server. Now you can install Orchard backed by a full SQL Server! Orchard will need an existing DB, so create one from SQL Server Management Studio. Then you can use the following connection string at setup: "Data Source=localhost;Initial Catalog=MyDatabase;Integrated Security=True". Notice "Integrated Security": this means the connection won't need a user/pass as it will just use your Windows user's credentials. This is only possible because we've set up the app pool to run as your user in 4/4! Here we only showed how to run Orchard using IIS, but not how to also make Orchard development. But this part is fairly easy: you can always run your site through IIS by opening its url, without even opening Visual Studio. If you change something on the code because of Orchard's dynamic compilation feature you don't even have to hit Build (just remember to save project files too: use Ctrl + Shift + S to save all in VS if you've added a new file to your module for example). Naturally you can also attach the debugger to the IIS process running Orchard, that can be made a matter of a mouse click with the AttachTo extension.