We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9207 ☆ A M B ☆
    • 2,475 Posts
    I’m trying to create a simple CRUD interface to a custom database table -- more or less I’m trying to copy the Doodles Custom Manager Page, but I’m completely confused by its parts. Where’s the correct place to post questions about this? Some of the other threads look to be too old...

    Thanks!
      • 5340
      • 1,624 Posts
      I’m interested in this as well. smiley
        • 28215
        • 4,149 Posts
        Post it here.
          shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
          • 9207 ☆ A M B ☆
          • 2,475 Posts
          Well... I’m not sure where to begin. Deconstructing Doodles is F’ing hard... after 3 days, I’m coming up empty. If Jesus figured out immortality after 3 days, and I couldn’t figure out Doodles after 3 days, I can conclude one of two things:

          1. I am not Jesus
          2. Doodles, xPDO, and JS ext are hard

          Once I get some of this stuff figured out, I can make some tutorials, but I can’t make a tutorial when I’m barely scraping by myself. But here goes:

          1. In the core/components/doodles/model/doodles/Doodles.class.php, the class is defined as class Doodles whereas when I use my own xPDO generated models, they are always declared as extending xPDOObject. I would have expected the declaration to be class Doodles extends xPDOObject. What’s going on?
          2. Adding a bunch of methods to the class... is that normal? Does that stuff get annihilated if you re-generate your class files? That scares me. The generating of model/class files is integral to all of Revo, but the process is not well documented. I’ve figured it out a few times, but it still terrifies me.... and the prospect of having my custom-coded model classes blown away makes it even more difficult.
          3. Can you recommend a book or a site that gives a good foundation on using JS Ext? The complexity involved in going from a more standard interface with "Edit/Delete/View" buttons (with a separate controller for each) to JS Ext’s all-in-one AJAX magic is something like making a horse go light-speed. Trot to canter is ok... but trot to light-speed is bound to lose most riders. I think the only hope developers will have in understanding how to develop this stuff is to have solid examples with the stuff isolated (or become Jesus... see above).
          4. Processors? What are they? I don’t understand how these fit into MVC...
          5. Connectors? Same question... are they just controllers for other controllers? So instead of me requesting a resource via a controller, a connector handles an Ajax request made by another controller? Is that right?
          6. Why is there a separate Doodle class (singular)? I thought the xPDO classes would describe a single object in addition to a collection, no?


            • 28215
            • 4,149 Posts
            Quote from: Everett at Nov 22, 2010, 12:38 PM

            1. In the core/components/doodles/model/doodles/Doodles.class.php, the class is defined as class Doodles whereas when I use my own xPDO generated models, they are always declared as extending xPDOObject. I would have expected the declaration to be class Doodles extends xPDOObject. What’s going on?
            The Doodles base class is just a utility class that adds some Doodles-wide methods that are commonly used, such as storing the relative doodles base path and urls. That’s it.


            2. Adding a bunch of methods to the class... is that normal? Does that stuff get annihilated if you re-generate your class files? That scares me. The generating of model/class files is integral to all of Revo, but the process is not well documented. I’ve figured it out a few times, but it still terrifies me.... and the prospect of having my custom-coded model classes blown away makes it even more difficult.
            No, class files are never regenerated unless you explicitly delete them. Only the maps are regenerated.


            3. Can you recommend a book or a site that gives a good foundation on using JS Ext? The complexity involved in going from a more standard interface with "Edit/Delete/View" buttons (with a separate controller for each) to JS Ext’s all-in-one AJAX magic is something like making a horse go light-speed. Trot to canter is ok... but trot to light-speed is bound to lose most riders. I think the only hope developers will have in understanding how to develop this stuff is to have solid examples with the stuff isolated (or become Jesus... see above).

            I’ve found just looking at examples (like Doodles, or Quip, Discuss, Gallery, Batcher, Redirector, PackMan, etc) is far better than books.

            That said, you *don’t* have to use ExtJS. Just return the HTML normally. You just won’t get the styles or validation that MODx Revo uses.

            4. Processors? What are they? I don’t understand how these fit into MVC...
            5. Connectors? Same question... are they just controllers for other controllers? So instead of me requesting a resource via a controller, a connector handles an Ajax request made by another controller? Is that right?
            Think of them like form-layer accessors to the model. They are "controllers" that process data from the View. They are accessed via connectors, which are secure gateways protecting the processors.

            Separating the form-layer processing into "processors" allows the processing code to be isolated, more easily managed, and used in other places rather than just that specific form.

            6. Why is there a separate Doodle class (singular)? I thought the xPDO classes would describe a single object in addition to a collection, no?
            The Doodle class is the xPDOObject. The Doodles class is the utility class.



              shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
              • 27519
              • 275 Posts
              Quote from: Everett at Nov 22, 2010, 12:38 PM

              1. I am not Jesus
              2. Doodles, xPDO, and JS ext are hard

              You’re (probably) right on both, although Doodle is actually a simple app. I can only say that in hindsight though...
              I consider myself an average developer and it took me more than 3 days. I’d say 3 weeks before you see "the light"....

              What helped me:
              - Aks a lot of questions here.
              - Use the Sencha site with ExtJs API. Very helpful, loads of info there. Sencha forum is good as well with some VERY skilled members. Quick response there as well.
              - Choose a starting point. I worked from front-end to back-end. Stick to that, otherwise you’ll end up hopping around the code and it’ll turn into a big bowl of spaghetti.
              - Sort your debuggers: Javascript debugger and PHP debugger. Stepping through Doodles with Chrome Javascript console was an absolute eye opener for me.

              The difference between Doodle class and Doodles class confused me as well. It would have been better to use DoodleApp as a classname for Doodles.

              The learning curve is steep. But the good thing is - as far as ExtJs/MODext is concerned - that it actually IS a very productive environment taken the end result into consideration. I would not dare to think of the piles and piles of HTML and Javascript involved if I had to craft a quality UI without ExtJs. Or do Ajax calls. Or work with JSON stores and pass around complex data structures.
                MODx Revolution / MAMP / OS X