erotik film
bodyheat full moves www xxx kajal video la figa che sborra ver video de sexo porno
Luxury replica watches
sex
film izle film izle casino siteleri tipobet giris
asyabahis
escort antalya

When you buy this book you support this site! - Thank You for your support!

Apr 12

Written by: Michael Washington
4/12/2020 5:31 PM  RssIcon

image

As covered in What is Blazor Oqtane?, Oqtane is an application that is built using Microsoft’s Blazor technology. It allows you to deploy and run modules written in Blazor. When Oqtane is deployed and running, it provides a dynamic web experience that can be run as client side Blazor or as server side Blazor.

What makes Oqtane different from other Blazor applications, is that it produces the entire website, not just a single application. Oqtane was created by Shaun Walker and is inspired by the DotNetNuke web application framework. Initially created as a proof of concept, Oqtane is a native Blazor application written from the ground up using modern .NET Core technology. It is a modular framework offering a fully dynamic page compositing model, multi-site support, designer friendly templates ( skins ), and extensibility via third party modules.

See the article Creating a Hello World Module For Blazor Oqtane for instructions on getting started with Microsoft’s Blazor and Oqtane.

Creating A Custom Module For Oqtane

To extend and expand Oqtane, you can create custom modules.

There are two methods to create custom modules in Oqtane, inline, and external (as a separate Visual Studio project).

 

Create an Inline Module

image

Run Oqtane, log in as the Host account and open the Menu.

 

image

Select Add under Page Management.

 

image

Create a new page called Hello World Inline.

 

image

The page will be added to the navigation menu.

Select the link to navigate to the page

 

image

Click the Menu button to open the Menu, and add the Module Creator module to the page.

 

image

Close the menu.

 

image

Fill in the form and click Create Module.

Oqtane will need to restart to create the module.

If you are running the site in Visual Studio debugging mode, Visual Studio will stop.

Restart Visual Studio.

Oqtane will detect that a new module has been added and it will install the module.

 

image

We can confirm this by opening the menu…

 

image

Going to the Admin Dashboard

 

image

Selecting Module Management

 

image

… and we can view the Module definition.

 

Explore The Module

image

If we navigate to the page we created we will see the module.

 

image

Clicking the Page Edit button will allow us to see the Add HelloWorld button.

 

image

This will bring up a popup that allows us to add items.

 

image

We can edit and delete the items.

 

image

We can also go to the Manage Settings dialog.

 

image

This will allow us to navigate to the custom Settings page.

 

image

We can enter a custom settings value.

 

Looking At The Code

image

In Visual Studio, we can see that the wizard created a lot of code that gives us a good starting point for our custom module.

 

image

When we look in the database, we see that the table has been created to hold the data for the module code that was created.

 

image

We can also look at the data in the Settings table.

 

image

We see the value we entered in the Settings screen.

 

image

We can update the code.

For example, open the Oqtane.Client/Modules/HelloWorld/Index.razor page and remove the information text.

 

image

When we run the application, the module no longer displays the informational text.

 

Create an External Module

Creating an external Oqtane module allows us to create a module that is more easily packaged to be distributed to other Oqtane instances.

An External Oqtane module is created outside of the Oqtane solution in a folder at the same level as Oqtane. It contains all of the project and solution files already configured so that it can build and deploy the artifacts to the Oqtane instance. It also has the ability to package a module into a Nuget package.

 

image

Repeat the previous steps to create a module, however, this time select External for the Template.

 

image

This time we have to look at the file system to see that a new folder was created.

 

image

This folder contains all the code created by the wizard, including a Visual Studio solution file.

Open that file in another instance of Visual Studio.

 

Build The Project

image

We want to build the project, create the NuGet package for the Module, and put that Nuget package in the Module folder of the Oqtane solution.

Switch to Release mode (By default, the Nuget package is only set to be created when building in Release mode).

 

image

Build the Solution.

 

image

It should Build without errors.

 

image

When we view the Oqtane.Server/wwwroot/Modules directory of the Oqtane solution, we see the NuGet package for the Blog module has been copied to that location.

 

image

When we run the Oqtane application, we see that the module will be installed and will be usable.

 

Distribute Your Custom Module

image

You can install the .nupkg module in other Oqtane installations using Module Management, either by uploading it, or downloading it from Nuget in the Available Modules section (if you first upload the module to Nuget with the tag: Oqtane

Note: the module creator creates a *.nuspec for your module which contains the required Nuget tags automatically.

 

Debugging External Oqtane Modules

image

Debugging inline Oqtane modules is easy, simply set a breakpoint and hit F5 in Visual Studio, and when you run the Oqtane application it will hit your breakpoints.

For external Oqtane modules, you will want to open the Oqtane solution in one instance of Visual Studio, and the external Oqtane module in a separate instance of Visual Studio.

 

image

In the Visual Studio instance that contains the external module, select Debug mode.

 

image

Then Rebuild Solution.

 

image

You will see that the .pdb files, required for debugging, have been copied to the Oqtane solution.

 

image

In the Visual Studio instance that contains the Oqtane solution, rebuild the solution, then select Debug, then Start Without Debugging.

 

image

This will load Oqtane in the web browser.

 

image

In the Visual Studio instance that contains the external module, set a breakpoint.

 

image

Select Debug, then Attach to Process.

 

image

Attach to the process that Oqtane is running under.

 

image

Return to the web browser, and create a new page, and place an instance of the module on that page.

 

image

When using the module, in the web browser, your break points will be hit, allowing you to debug the module.

 

Links

www.oqtane.org

oqtane.framework

Focus on Module Development #348

Blazor Help Website

What is Blazor Oqtane?

Creating a Database Driven Module For Blazor Oqtane

Configuring The Blazor Oqtane Blog Module

Creating a Hello World Module For Blazor Oqtane

Creating a SQL Database Administration Module For Blazor Oqtane

Tags: Blazor , Oqtane
Categories:
Microsoft Visual Studio is a registered trademark of Microsoft Corporation / LightSwitch is a registered trademark of Microsoft Corporation