We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22303 MODX Staff
    • 10,725 Posts
    Quote from: mmuller at Aug 02, 2010, 10:31 AM

    BobRay, Ryan, Splitting,

    Here is an example of how to fully document how to extend/develop a cms in a CMF with clear information on the underlying terminology used throughout. I must admit that having taken a look at this it is quite exciting - but I still love modxcms, it just seems somehow - overcomplicated now...

    http://doc.silverstripe.org/tutorial:2-extending-a-basic-site <- and this is just to show how to extend the initial core page templating/admin area...

    I am sure you guys can see that by providing clear examples of the processes necessary to develop within modx then the community and plugins will develop much quicker - in fact most of the available plugins are from one of the dev’s at the moment, I’m sure he would like a break wink
    So you are saying the tutorial that describes explicitly how to create Custom Manager Pages is not a good example of how to "fully document" the process of creating Custom Manager Pages? Or have a lost the point here?
      • 19909
      • 49 Posts
      No Jason,

      but:

      $xpdo->setLogTarget('ECHO');
      
      /* your stuff here */
      
      
      $xpdo->log(xPDO::LOG_LEVEL_INFO, "Generating . . .");


      Is not exactly explanatory...

      Here’s a list of questions for you then:

      1. When starting to developing a package - how does one go about using setting up xpdo and the classes - explicitly where do I place the files and what exactly needs to go in to the build script to output the correct classes from my xml schema - I have different doc’s from three different sources now...

      2. Once the classes are built - what is the preferred development route - in situ in a MAMP/LAMP environment or in an Eclipse IDE with SVN? both are discussed but neither are fully explained in detail to setup - afaik

      3. A lot of the examples expect a certain level of knowledge of the underlying architecture - when I go to the documentation I see ’This page is under development’ - fine but if thats the case please explain in detail the processes involved - maybe?

      I agree Jason that I am probably not up to speed with modx and its architecture but the documentation isn’t fully developed either - which will leave you with a problem enhancing the system with 3rd party packages.

      I have developed sites in Revolution - http://firstclassfinishltd.co.uk is the latest. But, I am wanting to go further with the system and would like to develop packages that I can also give back...

      Best Regards,

      MM
        • 19909
        • 49 Posts
        In fact I have downloaded Shaun’s Doodles demo and can see that I am moving in the right direction - my xml schema seems correct and has the three tables I want setup in there. I have my folders set out correctly too - ready for my processors etc etc.

        Unfortunately, in the doodles package there isn’t a build script for the included doodles.mysql.schema.xml file - if one had been present I doubt I would have needed to start this thread, but I am glad I did as it is highlighting some good points I feel for you to move forward with when documenting modxcms and its 3rd party component development.

        So, Shaun - do you have a copy of your build script that I can take a look at and then maybe - i’ll get my xml to build my classes for me - then I can pester you all about developing the interface next wink
          • 28215
          • 4,149 Posts
            shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
            • 22303 MODX Staff
            • 10,725 Posts
            Quote from: mmuller at Aug 02, 2010, 01:00 PM

            Here’s a list of questions for you then:

            1. When starting to developing a package - how does one go about using setting up xpdo and the classes - explicitly where do I place the files and what exactly needs to go in to the build script to output the correct classes from my xml schema - I have different doc’s from three different sources now...
            First, the flexibility of the packaging system is a bit of a leaky abstraction, and we know this is not as well documented as need be. That said, all we have is Shaun and my own experience developing Extras to share, and to me, that limits innovation. So the idea is that different people may find innovative new ways to work with the framework. From there, additional easy-to-use tools and tutorials will make this packaging system more accessible to those with only cursory knowledge of it’s internals.

            Quote from: mmuller at Aug 02, 2010, 01:00 PM

            2. Once the classes are built - what is the preferred development route - in situ in a MAMP/LAMP environment or in an Eclipse IDE with SVN? both are discussed but neither are fully explained in detail to setup - afaik
            Again, we do not want to dictate your approach to development or the tools you use to do it with. Sometimes I use NetBeans (gave up Eclipse after 10 years myself, just seems to get worse in terms of PHP), sometimes I do everything in TextMate. Sometimes I develop directly in the manager when it’s a small snippet or plugin, and then create a script to build it. When it comes to bigger projects, we tend to do round-trip development from the file system in a component working copy (from Subversion or Git) by configuring the component paths in our test MODx installation.

            Quote from: mmuller at Aug 02, 2010, 01:00 PM

            3. A lot of the examples expect a certain level of knowledge of the underlying architecture - when I go to the documentation I see ’This page is under development’ - fine but if thats the case please explain in detail the processes involved - maybe?
            Agreed, and I think the only cure is for others to gain that knowledge and help share it from an outside perspective. Sometimes it’s very hard for the authors to see what is not self-explanatory, or at least I find it to be the case.

            Quote from: mmuller at Aug 02, 2010, 01:00 PM

            I agree Jason that I am probably not up to speed with modx and its architecture but the documentation isn’t fully developed either - which will leave you with a problem enhancing the system with 3rd party packages.

            I have developed sites in Revolution - http://firstclassfinishltd.co.uk is the latest. But, I am wanting to go further with the system and would like to develop packages that I can also give back...
            And I agree, our documentation needs a lot of development and I will do what I can to assist in improving this in the short term, but I’m sure this is not going to happen overnight as we do have a lot of conflicting priorities from an overall project perspective. Blame me, I’m great at creating leaky abstractions and suck at explaining/documenting them. Shaun tries to counteract that, but we need him producing code and innovating as well. I’m hoping we can get some help in the technical writing department from those who are learning the API’s and pioneering on a new framework like you are, but I also know it’s a lot to expect.

            In summary, we are painfully aware of the immature state of our documentation, welcome any assistance you or anyone else can provide in improving it as you dig deeper into the framework, and would like to assure the community we will be doing everything possible to improve it ourselves short- and long-term.
              • 20413
              • 2,877 Posts
              Did you check out the Doodles screencast: http://vimeo.com/1968472
              in all of this?
                @hawproductions | http://mrhaw.com/

                Infograph: MODX Advanced Install in 7 steps:
                http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

                Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
                http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
                • 19909
                • 49 Posts
                Quote from: mrhaw at Aug 02, 2010, 03:20 PM

                Did you check out the Doodles screencast: http://vimeo.com/1968472
                in all of this?

                MrHaw <-> Didn’t know it existed, again if you know its great but if you don’t - it means nada to anyone...

                Splittingred <-> many thanks for the link, I know what I’ll be reading over tonight...

                Opengeek <-> Don’t take my comments the wrong way, I love modx, I love the way you are improving the framework (evo felt a little hackish at best) and I really want to begin developing packages for the community through items I develop hopefully for clients.

                As part of that I will do my best to write up the stages I go through in attempting to build my first package and will send it in to you guys to read, rewrite and generally have a good laugh at the code and documentation - and call me the pot for calling you the kettle wink

                All the best and I look forward to many more chats and discussions over the next few weeks - my package needs to be functioning in 5-6 weeks time - arrrrrgggh !

                Nothing like pressure to add to the excitement !

                Also just a small addition - this is the kind of thing I am trying to get across (without sounding whiney or nooobish):

                This is taken from here http://svn.modxcms.com/svn/modx-components/tutorials/storefinder/trunk/_build/build.schema.php
                <?php
                /**
                 * Build Schema script
                 *
                 * @package storefinder
                 * @subpackage build
                 */
                $mtime = microtime();
                $mtime = explode(" ", $mtime);
                $mtime = $mtime[1] + $mtime[0];
                $tstart = $mtime;
                set_time_limit(0);
                
                require_once dirname(__FILE__) . '/build.config.php';
                include_once MODX_CORE_PATH . 'model/modx/modx.class.php';
                $modx= new modX();
                $modx->initialize('mgr');
                $modx->loadClass('transport.modPackageBuilder','',false, true);
                $modx->setLogLevel(MODX_LOG_LEVEL_INFO);
                $modx->setLogTarget(XPDO_CLI_MODE ? 'ECHO' : 'HTML');
                
                $root = dirname(dirname(__FILE__)).'/';
                $sources = array(
                    'root' => $root,
                    'core' => $root.'core/components/storefinder/',
                    'model' => $root.'core/components/storefinder/model/',
                    'assets' => $root.'assets/components/storefinder/',
                    'schema' => $root.'_build/schema/',
                );
                $manager= $modx->getManager();
                $generator= $manager->getGenerator();
                
                $generator->classTemplate= <<<EOD
                <?php
                /**
                 * [+phpdoc-package+]
                 */
                class [+class+] extends [+extends+] {
                    function [+class+](& \$xpdo) {
                        \$this->__construct(\$xpdo);
                    }
                    function __construct(& \$xpdo) {
                        parent :: __construct(\$xpdo);
                    }
                }
                ?>
                EOD;
                $generator->platformTemplate= <<<EOD
                <?php
                /**
                 * [+phpdoc-package+]
                 */
                require_once (strtr(realpath(dirname(dirname(__FILE__))), '\\\\', '/') . '/[+class-lowercase+].class.php');
                class [+class+]_[+platform+] extends [+class+] {
                    function [+class+]_[+platform+](& \$xpdo) {
                        \$this->__construct(\$xpdo);
                    }
                    function __construct(& \$xpdo) {
                        parent :: __construct(\$xpdo);
                    }
                }
                ?>
                EOD;
                $generator->mapHeader= <<<EOD
                <?php
                /**
                 * [+phpdoc-package+]
                 */
                EOD;
                $generator->parseSchema($sources['schema'].'storefinder.mysql.schema.xml', $sources['model']);
                
                
                $mtime= microtime();
                $mtime= explode(" ", $mtime);
                $mtime= $mtime[1] + $mtime[0];
                $tend= $mtime;
                $totalTime= ($tend - $tstart);
                $totalTime= sprintf("%2.4f s", $totalTime);
                
                echo "\nExecution time: {$totalTime}\n";
                
                exit ();


                Whereas this is taken from the tutorial here http://svn.modxcms.com/docs/display/xPDO20/Generating+the+Model+Code for learning how to write the model code.
                $xpdo->setLogLevel(xPDO::LOG_LEVEL_INFO);
                $xpdo->setLogTarget(XPDO_CLI_MODE ? 'ECHO' : 'HTML');
                
                $manager= $xpdo->getManager();
                $generator= $manager->getGenerator();
                
                $generator->classTemplate= <<<EOD
                <?php
                /**
                 * [+phpdoc-package+]
                 */
                class [+class+] extends [+extends+] {}
                ?>
                EOD;
                $generator->platformTemplate= <<<EOD
                <?php
                /**
                 * [+phpdoc-package+]
                 */
                require_once (strtr(realpath(dirname(dirname(__FILE__))), '\\\\', '/') . '/[+class-lowercase+].class.php');
                class [+class+]_[+platform+] extends [+class+] {}
                ?>
                EOD;
                $generator->mapHeader= <<<EOD
                <?php
                /**
                 * [+phpdoc-package+]
                 */
                EOD;
                
                $schema = '/path/to/storefinder.mysql.schema.xml';
                $target = '/path/to/storefinder/model/';
                $generator->parseSchema($schema,$target);



                Different and missing vital information laugh

                Best Regards,

                MM
                  • 5340
                  • 1,624 Posts
                  Hi mmuler,

                  Just wondering if you would be kind enough to share your thoughts/findings on building a plugin in a tutorial. I know it takes time but maybe you’ll find some, in the near future.

                  Thanks
                    • 19909
                    • 49 Posts
                    Quote from: cipa at Aug 02, 2010, 05:18 PM

                    Hi mmuler,

                    Just wondering if you would be kind enough to share your thoughts/findings on building a plugin in a tutorial. I know it takes time but maybe you’ll find some, in the near future.

                    Thanks

                    Cipa,

                    I have a need to build a plugin/package over the next few weeks (eek client pressure is good) and while I do this I will make notes on the process involved (if not I’ll try to do it after the client work). Obviously, If my skills fall short and the package never materialises I’ll still try to post as much info as I can about how far I get into it.

                    Hopefully, it shouldn’t cause me too much trouble the basic’s behind the package is firstly it will have a table for recipients, a table for the newsletters and their associated templates to use and a table to say which recipients are assigned to which newsletters smiley

                    This will have a custom manager page for the editing, entry and deletion of these items

                    And finally some code that I hope to create a function from to parse each recipient to, which will build the email and send it in a loop...

                    Adventurous, hell yes ! But you have to start somewhere and here is as good a place as any !

                    regards,

                    MM