UIOMatic
UIOMatic copied to clipboard
Add UIOMatic to Umbraco 9
Hi im currently trying to add UIOMatic version 4.0.3 to my Umbraco 9 project (9.5.2)
I don't see any helpful links right now on the web to solve the errors.
I've tried 2 different things either by adding .AddUIOMatic() method to umbraco builder in the Startup.cs or add UIOMaticHelper as Singelton.
Or
Is their any documentation how to? :)
@marciogoularte any pointers?
yes. I did a test and got the same error. Config here is null
https://github.com/TimGeyssens/UIOMatic/blob/1cc43157965364c6708a969be08f3a94772f03fd/src/UIOMatic/Web/UIOMaticServerVariablesHandler.cs#L61
probably don't have UIOMatic config in appsettings.json
But I no longer have the example of the project I sent you
First a caveat - I just started on a site migration of a v7 project to 9 and haven't got my UIOMatic working completely yet, but have got past that error message you are seeing. You are going to need the following config section in your appsettings.json:
"UIOMatic": { "PluginFolder": "test", "Settings": { "defaultListViewPageSize": "10", "rteFieldEditorButtons": "\"preview\", \"|\", \"undo\", \"redo\", \"|\", \"copy\", \"cut\", \"paste\", \"|\", \"bold\", \"italic\", \"|\", \"link\", \"unlink\"", }, },
I've changed my line 61 in UIOMaticServerVariablesHandler.cs to put in some defaults (below), just to make getting started easier, and might put in a PR for that once I've verified everything is working:
{ "settings", Config!=null ? Config.Settings : new Dictionary<string, string>() { { "defaultListViewPageSize", "10" }, { "rteFieldEditorButtons", "\"preview\", \"|\", \"undo\", \"redo\", \"|\", \"copy\", \"cut\", \"paste\", \"|\", \"bold\", \"italic\", \"|\", \"link\", \"unlink\"" } } }
Having .AddUIOMatic is enough in the startup.cs ConfigureServices as that internally adds the Services.AddSingleton<IUIOMaticHelper, UIOMaticHelper>(); call, but you are going to have to configure the UIOMatic serviceproxy in the Configure method as well (haven't got far enough into the code yet to know what the serviceproxy does vis-a-vis just getting the default .Net core service provider):
` public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IServiceProviderProxy UIOMaticSericeProxy) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); }
// app.UseSession();
app.UseUmbraco()
.WithMiddleware(u =>
{
u.UseBackOffice();
u.UseWebsite();
// This enables the Azure Blob storage middleware for media.
u.UseAzureBlobMediaFileSystem();
})
.WithEndpoints(u =>
{
u.UseInstallerEndpoints();
u.UseBackOfficeEndpoints();
u.UseWebsiteEndpoints();
});
UIOMatic.ServiceLocator.Initialize(UIOMaticSericeProxy);
}`
Hi @dataworking
Thank you for the reply. Do you know if you got this to work. Let me know if I implemented the code at the right place like you did or if i missed something:
Because it did not look like it worked for me. I noticed that i got a auto generated "Person" list there too but seem to create some issues in the console:
Might be related to some angular wrong version or could be something else missing here?
Ive also tried adding my own class just to test like from the first page here: https://github.com/TimGeyssens/UIOMatic but without the person alias because it was already taken because of that "Person" list so i tried like person2 just as an example. Seem not to work either.
Also is the Person list suppose to be there all the time? I couldn't seem to find it in my projects file if its in like a json template file or something?
Because it did not look like it worked for me. I noticed that i got a auto generated "Person" list there too but seem to create some issues in the console:
Might be related to some angular wrong version or could be something else missing here?
Hi, are you trying to get it to work against an Umbraco 7/8 project you are upgrading or against a new project? I noticed that some of the migrations code is currently commented out in the source code, so it might not support creating the necessary POCOs at the moment. Over the next 2-3 days I will be attempting to get my existing U7 project to work as an upgrade. Assuming that works ok, I will see if I can take a look at the commented out code to see if that is the cause.
@dataworking Hi, we want to do that actually but this project i made as an example and its just pure Umbraco 9 here and UIOMatic v4
@dataworking Hi, we want to do that actually but this project i made as an example and its just pure Umbraco 9 here and UIOMatic v4
I think more work is required to get the source to persist new POCOs to the db (ie create the tables), but with existing tables from an upgrade it is working:
I also added a bit of temporary code to my UIOMaticHelper.cs Ln 110 as I don't want the default Person type considered, but I am hoping to remove that later once I understand more about how this package works at a code level:
if (typesWithMyAttribute.Count() > 1) { typesWithMyAttribute = typesWithMyAttribute.Where(pocoType => pocoType.AssemblyQualifiedName != typeof(Person).AssemblyQualifiedName); }
@dataworking @TimGeyssens Hi again. Im not quite sure what that line of code will do in order for uiomatic to work. We dont need to focus on the upgrade from Umb 7 to 9 but rather just see a brand new project with UIOMatic version 4.0.3 and Umbraco 9 (9.5.2). Should be some documentation if its not working at startup i assume? :)
could you try the latest version 4.1.0? this one adds some default config
and v5 on umbraco v10
Hi @TimGeyssens, It seem to work fine now with appearing correctly in the menu and in the list after the installation of UIOMatic v5 and Umbraco v10. The only more issue i found is that the App_Plugins folder was missing. I tried the old App_Plugins i used on other previous projects but seem to generate some errors. Can you provide with the complete App_Plugins folder for the new v5 UIOMatic, perhaps create v5.0.1/v5.1 or adding it here on github? :) thanks!
Hi @Lamborobin, That is strange. The App_Plugins folder should be copied with the package. I'll take a look for you later today on what is happening there.
Hi @patrickdemooij9. Thank you so much! The scenario is:
- Create a new vs project.
- Install the Umbraco 10 in VS 2022.
- Install UIOMatic v5 in the NuGet package manager.
- Create the People class from the docs
- Complete the installation of Umbraco with a local db.
- Add the People table in the local db.
- Debug and try create new person
You should not see (if you don't get the App_Plugins added) the correct name either in the top menu.
@Lamborobin This should now be fixed in the latest release (https://github.com/TimGeyssens/UIOMatic/releases/tag/5.1.0). Give it a try and see if this also works for you!
That worked fantastic thank you @patrickdemooij9 for the new version it works perfectly so far! Ive tried CRUD and do alot of small stuff and seem to work as expected. Will get back if i see any errors with this version :)