Any interest? Extra to manage packages and custom tables

I’ve always liked how simple it is to create almost anything in Modx. I love the Ace editor and being able to have Modx basically be an IDE.

In a lot of ways I prefer graphical representations and forms over files and directories that have to be created in a certain way.

I tried the CMP Generator and the graphical version of that, but one is broken and the other doesn’t really do what I want. I know Migx has some capability here as well, but I believe you have to paste in your schema.

I’m working on an Extra that makes it very easy to define your package, add objects and define your fields. Then you can build directly in the manager. Your database tables and fields are created. If you add a field and run the build again, it adds missing columns and indexes. (Code borrowed from modExtra)

I’m curious if anyone would be interested in that capability. I may just be building for myself :slight_smile:

I think this would make custom tables more accessible to new Modx users.

Also, I may make a tutorial to demonstrate how I built it. It’s running Vue.js and an iFrame methodology that allows it to play nice with and match the style of the existing manager. I tweaked Bootstrap styles and colors to match the manager pretty closely.

@lkfranklin did a nice video that gets some of the way there but I ran into problems with styling and some other things. I think I solved those issues though.

I’m still able to use the connector, processor methodology.

Thanks!
-Jared

3 Likes

Sounds great to me!
What’s making you go down the iFrame route? Did you encounter some conflicts between ExtJS and VueJS?

I normally use GPM to manage my extras in development:

And often kick-start the extra with this:

1 Like

Just to mention what’s already out there (in addition to theboxer’s tools) in case you’re not aware of these.

PackMan lets you build extra packages in the Manager, but it’s pretty limited and also cumbersome for version updates.

MyComponent is a more complete package development system, but it’s not particularly graphical or form-based. It has lots of helpful AI features for internationalization, creating properties and settings tables, updating copyrights, etc. I basically assumes that you’re doing work in either the Manager or a code editor IDE like PhpStorm, and lets you synchronize either way, import the latest version of your objects into the Manager and run the build from there.

ClassExtender provides a platform for creating custom tables, but it’s mainly aimed at extending modUser and modResource.

I should also mention Gitify and Teleport.

1 Like

Thanks for that, I hadn’t come across GPM. I’m not sure how I missed that. I use Collections all the time and love it. @theboxer did a great job with collections.

I actually used Collections and a separate context to store a mockup first version of the idea. Then just had a resource that output the schema and I could tag on ?build=true to have it run the build script. I used that to build the schema and tables for the Extra.

Why the iFrame?

  • I ran into problems with ExtJS trying to attach to the wrapping element if I used the return template option. I could likely have gotten around that.
  • The current 2.x CSS and div structure is insane in my opinion :slight_smile: , but, it can be since ExtJS is managing it. Trying to figure out the right sequence of Divs, nesting and classes was seeming like too much work. Also, I noticed that ExtJS applies inline styles to a lot of elements dynamically to achieve desired results.
  • Anyway… Short answer is I saw potential conflicts and downsides and wanted to ensure that when I ran into problems, they were definitely caused by me or my code.
1 Like

I had come across PackMan previously and totally forgotten about it. Thanks for resurfacing that. It does answer a question I had which was, “Should I include any functionality around creating the transport package?” Looks like I’ll hold off since there seems to be plenty of work done around that.

I’m playing with MyComponent (YourMyComponent? :slight_smile: ) to see what it can do.

The functionality I’ve built so far is focused on the ability to easily define your schema file and tables. And a way to build them on the fly, add a field, delete a field, and have that update into the database quickly.

I’ll have to figure out how I dovetail my process into those existing Extras.

I personally would find this very useful, do quite a bit of custom table stuff myself and recently restful apis with custom tables. Used migx and schema route which was not necessarily difficult but quite open to human error if the schema is not defined correctly. Some kind of UI / gui generator would be really useful, especially for defining relationships

Cool… I’ll post back here once the beta is published. Might be this weekend, it’s like 99% done.

I should probably clarify what I’m building is NOT a drag and drop interface like the video of UiCMPGenerator.

I built out a form interface that speeds up the process but still gives you full flexibility to edit and modify the XML results.

1 Like

Re iFrame: all very good points! I think next time I’m going to give that a go myself… :wink:

“The current 2.x CSS and div structure is insane in my opinion :slight_smile: , but, it can be since ExtJS is managing it. Trying to figure out the right sequence of Divs, nesting and classes was seeming like too much work. Also, I noticed that ExtJS applies inline styles to a lot of elements dynamically to achieve desired results.”

I couldn’t agree more. I’m currently working on some Codeception acceptance tests for MODX and you need to give CSS or XPath identifiers for stuff on the page. You can’t use many of the IDs because they’re generated on-the-fly by Ext and could change. So you end up with ugly and fragile XPaths like this:

$I->click("//span[starts-with(@class,'x-tab-strip-text') and text()='Permissions']");

$I->click("//input[starts-with(@id,'modx-crgact') and contains(@id, 'authority')]");
1 Like

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.