UI-O-Matic + T4 Templates = Almost instant CRUD UI for your custom tables in Umbraco
I’ve just published a new package on Nuget that makes it even easier to generate an integrated CRUD UI for custom tables in Umbraco, as you know for UI-O-Matic you only need to create a PetaPoco poco and decorate that with some additional attibute + implement an interface for each table, if you have a lot of tables that’s really boring work mapping a table manually to a poco. So I’m happy to introduce you to the t4 templates that will do that mapping for you.
Show me
Simply install the package through nuget
PM> Install-Package Nibble.Umbraco.UIOMaticT4Templates
That will add 3 new files to your project
- \Models\Generated\Database.tt
- \Models\Generated\UIOMatic.Core.ttinclude
- Models\Generated\UIOMatic.Generator.ttinclude
To now generate your pocos you’ll just have to save the Database.tt file, if no connectionstring is supplied it will use the Umbraco one, but if you point it to a different conn string (by adding it’s name) it will use that.
Example
I must note that I only modified the PetaPoco t4 templates so all credit for the excellent work in that one goes to the PetaPoco team.
Hi Tim! I’m getting an error trying to install the package on 7.4.3 its:
“Already referencing a newer version of ‘Microsoft.AspNet.Mvc”
I’m on MVC 5.2.3, any advice?
Thanks!
Hi Tim,
I’m getting an error after install the package on 7.4.3
Error:
Severity Code Description Project File Line Suppression State
Error Running transformation: System.IndexOutOfRangeException: Index was outside the bounds of the array.
at System.Array.InternalGetReference(Void* elemRef, Int32 rank, Int32* pIndices)
at System.Array.GetValue(Int32 index)
at Microsoft.VisualStudio.TextTemplatingA6A4C1765CA6C6AABF8C17625F5ADEE86AFF5C39774EEFC4D5CA8C503D4268C064EC53EB0103E5C05E0EF7BFE1CFD5228A34E0C44BB3CF26F123880F81B92C7A.GeneratedTextTransformation.GetCurrentProject()
at Microsoft.VisualStudio.TextTemplatingA6A4C1765CA6C6AABF8C17625F5ADEE86AFF5C39774EEFC4D5CA8C503D4268C064EC53EB0103E5C05E0EF7BFE1CFD5228A34E0C44BB3CF26F123880F81B92C7A.GeneratedTextTransformation.GetConnectionString(String& connectionStringName, String& providerName)
at Microsoft.VisualStudio.TextTemplatingA6A4C1765CA6C6AABF8C17625F5ADEE86AFF5C39774EEFC4D5CA8C503D4268C064EC53EB0103E5C05E0EF7BFE1CFD5228A34E0C44BB3CF26F123880F81B92C7A.GeneratedTextTransformation.InitConnectionString()
at Microsoft.VisualStudio.TextTemplatingA6A4C1765CA6C6AABF8C17625F5ADEE86AFF5C39774EEFC4D5CA8C503D4268C064EC53EB0103E5C05E0EF7BFE1CFD5228A34E0C44BB3CF26F123880F81B92C7A.GeneratedTextTransformation.LoadTables()
at Microsoft.VisualStudio.TextTemplatingA6A4C1765CA6C6AABF8C17625F5ADEE86AFF5C39774EEFC4D5CA8C503D4268C064EC53EB0103E5C05E0EF7BFE1CFD5228A34E0C44BB3CF26F123880F81B92C7A.GeneratedTextTransformation.TransformText() Ta2heal.web D:\MARLY\Ta2heal.web\Models\Generated\Database.tt 1
————-
And when access uiomatic via umbraco back-office it looks like the image below
image url: http://imageshack.com/a/img922/605/l7BgBM.png
What can I do?
the problem solved by reinstalling.
Update-Package –reinstall Nibble.Umbraco.UIOMaticT4Templates
i have same problem
@Amr did you try to reinstall?