We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32674
    • 101 Posts
    Heya xPdo-pians,

    quick question. (well, sort of grin) Im looking to eventually attempt a port of the orm + CRUD code generator, ’Pork.Generator’ & ’Pork.dbObject’. I’d like to generate xpdo code and create CRUD grids for/into modx. The ’Pork’ project is very simple and quite beautifully done.

    overview of his CRUD generator with sample of gen’ed code is here: http://www.schizofreend.nl/Pork.Generator
    full demo is here: http://www.schizofreend.nl/demogenerator/

    His generator obviously ends up producing code for his ORM, but Im thinking it can’t be overly tough to use his basic generation framework, and change output to xpdo orb. (or even to generate full Custom Page Manager templates)

    Back to the question: Does anyone know of an existing xPdo code generator, in any state of completion, that I might take a peek at? (might be easier to start there, than work backwards from another orm’s code)
      • 22303 MODX Staff
      • 10,725 Posts
      xPDO has it’s own reverse and forward engineering generator built-in. It can generate a schema from an existing database and xPDOObjects are generated from these schemas. We may also in the future create a visual interface for developing/editing the schemas and reverse/forward engineering tasks.

      Please refer to http://svn.modxcms.com/docs/display/xPDO20/Creating+a+Model+With+xPDO
        • 32674
        • 101 Posts
        I saw that it can generate class code from db which is very nice feature. I was hoping someone had taken, or attempted to take it, it a step further to a full CRUD generator for the db too, like the Pork.generator does.

        Alas, it’s too often I say, "I’ll just roll my own" rolleyes

        Thanks for the great work on xPDO, btw. Great looking orm (or technically orb) from the dox. Cant wait to start fudging around with it.
          • 22303 MODX Staff
          • 10,725 Posts
          Quote from: wowzow at Mar 13, 2010, 05:46 PM

          I saw that it can generate class code from db which is very nice feature. I was hoping someone had taken, or attempted to take it, it a step further to a full CRUD generator for the db too, like the Pork.generator does.
          It is a CRUD generator, if by CRUD you mean a table class (or active record class) that provides the methods to create, read, update, and delete data. Maybe I don’t understand what you are getting at. huh
            • 32674
            • 101 Posts
            Sorry to confuse. Database CRUD forms generation, for each table is what Im after.
              • 22303 MODX Staff
              • 10,725 Posts
              Quote from: wowzow at Mar 13, 2010, 07:19 PM

              Sorry to confuse. Database CRUD forms generation, for each table is what Im after.
              Ah, now that makes more sense.

              I find it much easier to just let my designers create their forms to spec and then use the super easy CRUD methods of xPDO to process the data as needed. Form generation is IMO part of the presentation layer, while form processing may include many different layers. I’ve tried various form generators and even wrote one for xPDO/MODx called MakeForm, and I’ve always found them to be more trouble than just scripting what I need with the xPDO API for processing and letting the forms simply be html forms.

              That said, creating a form generator for xPDO should be fairly straightforward; just depends on how you want to do it.
                • 32674
                • 101 Posts
                Quote from: OpenGeek at Mar 14, 2010, 10:26 AM

                Ah, now that makes more sense.

                I find it much easier to just let my designers create their forms...
                Ahhh. ’Designer’ === me, 96.7% of the time, and I’m soooooooo lazy. laugh

                Quote from: OpenGeek at Mar 14, 2010, 10:26 AM

                Form generation is IMO part of the presentation layer, while form processing may include many different layers.
                Absolutely agree. I’d still like to auto-gen the forms as part of "modx initial setup" feature that I’d run OAOO to begin working on modx project.

                Quote from: OpenGeek at Mar 14, 2010, 10:26 AM

                I’ve tried various form generators and even wrote one for xPDO/MODx called MakeForm, and I’ve always found them to be more trouble than just scripting what I need with the xPDO API for processing and letting the forms simply be html forms.
                I know you’re probably not going to agree with what Im doing --- but Im actually looking to tweek modx revo a bit, and turn the modx manager UI into more of a "virtual business desktop" for my clients. Allow modx to become more than just a cms controller, but an enterprise app controller desktop of sorts -- well, if small, under 10 person bizzes can be called "enterprise". Basically allow the end user to login to modx, then run all their online apps from there, using Javascript widgets as views into other webapps/databases, including modx cms as an app. For example - vtiger crm, pbooks online accounting, email, existing custom client databases, blah, blah, etc. (The ACL features in revo should make it pretty reasonable to set up, with levels of permissions and access to the apps/docs/services)...

                ....so the forms generator Im looking for, would actually point and generate CRUD forms for apps/db *other* than a modx db. As I said, Im way too lazy, and would prefer to autogen all those UI forms, and their Custom Manager Pages than hand coding them. (causes repetitive stress syndrome in my brain grin )

                Quote from: OpenGeek at Mar 14, 2010, 10:26 AM

                That said, creating a form generator for xPDO should be fairly straightforward; just depends on how you want to do it.
                Yeah, Ive done them in asp classic several times, generally using codesmith generator. For this though, Im just going to modify the pork.generator app noted above to spit out modx UI manager page tabs and forms for each app as needed.

                Thanks for your tips and insight, but mostly--- your time/work on xPdo! Looking forward to learning it.

                wz
                  • 7923
                  • 4,213 Posts
                  Sorry for little off topic, but these two doesn’t seem to go very well together wink

                  Quote from: wowzow at Mar 14, 2010, 01:47 PM

                  I’m soooooooo lazy. laugh

                  Quote from: wowzow at Mar 14, 2010, 01:47 PM

                  turn the modx manager UI into more of a "virtual business desktop" .... run all their online apps .... vtiger crm, pbooks online accounting, email, existing custom client databases, blah, blah, etc.

                  How will you be able to create all that if you don’t have the energy to do simple html forms and couple controllers smiley


                    "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                    • 22303 MODX Staff
                    • 10,725 Posts
                    Quote from: wowzow at Mar 14, 2010, 01:47 PM

                    I know you’re probably not going to agree with what Im doing --- but Im actually looking to tweek modx revo a bit, and turn the modx manager UI into more of a "virtual business desktop" for my clients. Allow modx to become more than just a cms controller, but an enterprise app controller desktop of sorts -- well, if small, under 10 person bizzes can be called "enterprise". Basically allow the end user to login to modx, then run all their online apps from there, using Javascript widgets as views into other webapps/databases, including modx cms as an app. For example - vtiger crm, pbooks online accounting, email, existing custom client databases, blah, blah, etc. (The ACL features in revo should make it pretty reasonable to set up, with levels of permissions and access to the apps/docs/services)...
                    I suggest you create this as a MODx front-end package (create a custom context for your virtual business desktop); don’t modify the core manager. We will not support hacks to the manager moving forward.
                      • 32674
                      • 101 Posts
                      Quote from: OpenGeek at Mar 15, 2010, 08:36 AM

                      I suggest you create this as a MODx front-end package (create a custom context for your virtual business desktop); don’t modify the core manager. We will not support hacks to the manager moving forward.

                      There’s no plan to touch the core, or any code in modx for that matter. I’d simply make a folder called ’app’ and there would reside 95% of the custom code + all the apps code. The adapter pattern is a wonderful thing to keep my chocolate, outta your peanut butter. ;o)

                      Wouldn’t giving each app it’s own custom manager page in the backend make the most sense to an novice endu ser of a ’business desktop’? (say a different tab per app, or some such gui convention) e.g. Login to the backend, and voila, there sits all your usual modx cms controls for your website. Along with a tabbed series of cpm’s for each of your biz apps to control your empire. No?

                      Am I simplifying it too much? It made such perfect sense in my head. smiley