Fix the QueriesDocument and the Queries UI, Lombiq API Client for Orchard Core - This week in Orchard (09/08/2024)
Fix the QueriesDocument and the Queries UI, add new helpful Entity Extensions, and a demo about the Lombiq API Client for Orchard Core are the topics for the week. And don't forget that the discounted price for Orchard Harvest is available only until August 15! Let's see the details!
Orchard Core updates
Fix the QueriesDocument and the Queries UI
Previously, any query type had to inherit from Query and required its own distinct type (e.g., SqlQuery, LuceneQuery, ElasticQuery). However, thanks to this change, creating a custom type for each query type is no longer necessary. This update involved modifications to the IQueryManager and IQuerySource interfaces, as well as the Query class. Additionally, a new project, OrchardCore.Queries.Core, was introduced.
A migration process has been implemented to transition existing queries into the new structure, ensuring no impact on existing tenants. Let's see the key changes!
- Modification of interfaces and classes: Updates were made to the IQueryManager, IQuerySource interface, and Query class to accommodate the new structure.
- Addition of OrchardCore.Queries.Core: This new project supports the updated query handling mechanism.
And how you can implement the IQuerySource interface? We now request implementations of IQuerySource using keyed services. Below is an example of how to register new implementations:
services.AddQuerySource<SqlQuerySource>(SqlQuerySource.SourceName);
This approach allows for more flexible and modular query handling in Orchard Core.
Furthermore, we now have handlers for dealing with queries. To manipulate a query using a handler, implement the IQueryHandler interface. This provides a structured way to extend and customize the behavior of queries within the framework.
Add new helpful Entity Extensions
This change is about adding the following helpful extensions to the entity:
IEntity Alter<TAspect>(this IEntity entity, Action<TAspect> action)
bool TryGet<T>(this IEntity entity, out T aspect)
The new extensions simplify the following already existing extensions:
IEntity Alter<TAspect>(this IEntity entity, string name, Action<TAspect> action)
bool TryGet<T>(this IEntity entity, string name, out T aspect)
If we check out the code, you can see that from now on, we will not need to pass the name of the settings when updating it, providing the action to apply on the aspect is sufficient.
Demos
Lombiq API Client for Orchard Core
In this demo, we will check out the Lombiq API Client for Orchard Core, a client library for communicating with the Orchard Core web APIs. Currently, it contains an implementation for the tenant and content management APIs and a console application for testing and demonstration.
The project requires the Tenants feature, and OpenId features to be enabled and set up. The readme file of this library covers how you can set up the OpenId features but for easy use, enable the Deployment feature and import this recipe as a deployment package.
The library contains a simple tester console app for manually testing the features of the Lombiq API Client for Orchard Core. Let's see the Program.cs file of this app!
This tester app first sets up a tenant and edits that tenant. The next steps are creating a taxonomy and editing the taxonomy's display text by using API calls.
This library with the tester app is included in our Open-Source Orchard Core Extensions full Orchard Core solution. You will find our other useful Orchard Core-related open-source projects there, too. And as always, if you want to see this little tester app in action, head to YouTube for a recording!
News from the community
Orchard Harvest 2024 Program
The full Orchard Harvest program has finally arrived. This year’s program is packed with insightful sessions, engaging panels, and ample opportunities to connect with the Orchard community and to make Orchard Harvest the biggest Orchard Core event of the year. All sessions will be recorded and published on the Orchard YouTube channel after the event, so even if you can't make it live, you can see the sessions. However, being there live will allow you to ask the speakers, meet other community members, and have a lot of fun!
All indicated times are local time in Las Vegas. After each session, you'll have a chance to ask questions, and we'll have a short break too. Here is a detailed schedule to help you prepare for the conference.
Can't wait until September? Check out recordings from last year's special online Orchard Harvest on this YouTube channel here.
Ready to be a part of something extraordinary? Reserve your spot today and take advantage of early-bird pricing at Orchard Harvest Conference 2024. And don't forget that the discounted price is available only until August 15. Secure your spot today and get ready to level up your skills at Orchard Harvest Conference 2024! See you there!
Orchard Dojo Newsletter
Lombiq's Orchard Dojo Newsletter has 467 subscribers! We have started this newsletter to inform the community around Orchard of 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 would like to read our weekly articles? Tell them to subscribe here!