Part of the reason that you’re not getting much help is that *very* few people have yet done what you’re trying to do. I’m an experienced Revolution user and PHP coder and I’ve documented a lot of the xPDO methods, but I have yet to create a schema.
You haven’t told us what you’re trying to do, so it’s hard to know what’s relevant or if you need to use xPDO (or even know about it). A main point of xPDO is to make it easy to do database operations without having to use the traditional PHP database functions. So, you’d only need a schema of your own (MODx already has one) if all three of these are true:
1) You need to add one or more custom database tables to the MODx install.
2) You want to access those tables with PHP code.
3) You want to use xPDO to interact with them rather than traditional PHP DB functions.
If you’ve added tables to a MODx install before and used PHP functions to interact with them, that will still work. It’s worth learning xPDO if you’re going to do this often, IMO.
That said, I have to agree with you that the docs you were referred to are very vague on what to do with the schema file once you have it. I just went over them and I couldn’t figure it out from them either. They are for people creating Transport Packages that will install a third-party component to share with others. There is a definite need, IMO, for a simpler tutorial for people who just want to create an extra table or two and access them with xPDO without creating a full-blown Transport Package or having it SVN compatible (especially since we’re not using SVN any more).
This tutorial is more to the point for you, although it still assumes SVN so you can ignore all the stuff relating to trunk, tags, and branches.
http://rtfm.modx.com/display/~splittingred/2008/06/26/Writing+a+3rd+Party+Component+in+MODx+Revolution%2C+Pt.+I
For your purposes, "doodles" would be replaced by the name of your "component" -- it’s an arbitrary name and you can use anything you want.
The tutorial doesn’t say where the doodles directory actually goes, but I believe it would be assets/components/doodles. I would leave out the trunk directory from the structure, and move everything below it up one level, and omit the branches and tags directories. Then use this in the code:
$trunk = $trunk = dirname(dirname(__FILE__));
The schema file should be _build/schema/yourComponent.mysql.schema.xml and the line at the end of the script will be:
$builder->buildSchema($trunk.'/assets/model/',$trunk.'/_build/schema/yourCompnent.mysql.schema.xml');
I’m guessing here, so it may take some trial and error to make it work.
When and if the script works, the files you need to make your "component" work should be in assets/components/
yourComponent/assets/model/
To get beyond that, I’d suggest installing the Doodles package and looking at how the snippet works.
Here is the line that initializes the system:
$dood = $modx->getService('doodles','Doodles',$modx->getOption('doodles.core_path',null,$modx->getOption('core_path').'components/doodles/').'model/doodles/',$scriptProperties);
If you don’t set a &doodles.core_path parameter in your snippet tag, I believe it assumes that you’ve copied the files from assets/components/doodles to core/components/doodles.
I hope this makes at least some sense.
Someday, if I ever have time, I’ll do a tutorial on this. If you get it working, maybe you can do it.
Tutorials are best written by people who’ve just figured things out -- not people who have been working with things for a long time.