We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17906
    • 18 Posts
    Hi,

    I’ve been analysing ModX for a project I’m starting on. I’ve posted about this in the forum a couple of hours before but I’ve finally been able to name what I’m looking for.

    Nowadays the JAVA world is talking about JCR (Java Content Repository) vs DB, some say JCR will replace the traditional DB. So some projects like Apache Graffito are developing what has been called OCM (Object Content Mapping) basically you just map the contents of an object to a content structure. I believe this could be done in ModX since the Templates, Template Variables and Widgets already provide some good grounds to build on.

    Basically we’d have a template for the models in the domain and template variables for the model’s fields.

    Relationships would require some new widgets to be created in order to define the type of model to relate to and the type of relation (ex in Rails: has_one, has_many, belongs_to, etc).

    The datagrid could be extended to support this and the search could now have a template field that would limit searches to types of objects.

    Advantages of this approach:

    - Easily create new document types, the default template variables could be just part of a Page model or something like that
    - Models would appear as documents in the manager’s navigation tree, We could expand the right button menu to add "Create [model]" instead of just the "Create Document" stuff
    - We could have a parent model for all of these to allow different content in a directory to be displayed as a single page without the need for special snippets for each model type. This is very similar to the schema used in more complex portals like Typo3, Vignette, etc .. we have pages and page contents.
    - Navigation tree could show also the model relations by using links, this would allow for tree like navigation even in complex relations

    Disadvantages:

    - Migration of legacy databases would require extra work. Perhaps a module to import data would help
    - Speed ?

    Well, I just hope I get some discussion going around this subject as I have to make a decision soon. Should I try this approach or just forget about the whole think and use separate DB tables for new models? I now is pretty easy to just develop a module from scratch to interact with new DB tables but this might put ModX in a higher level regarding other CMSs.
      • 6726
      • 7,075 Posts
      I have no answer to this but a few bookmarks to share : This and the following messages from Jason (OpenGeek) might be of interrest to you smiley

      You could also check out this post from Jason :
      http://modxcms.com/forums/index.php/topic,8462.msg59697.html#msg59697

      Also, not directly related but giving away hints about the future :
      http://modxcms.com/forums/index.php/topic,8421.msg59404.html#msg59404
      http://modxcms.com/forums/index.php/topic,8096.msg57402.html#msg57402
        .: COO - Commerce Guys - Community Driven Innovation :.


        MODx est l'outil id
        • 25663 MODX Staff
        • 12,272 Posts
        xPDO is one of the key pieces of our post-095 releases. It works amazingly well and enables much of what you’re discussing here MaDrense. You can find out more at http://xpdo.org/

        As far as your concerns, one of the benefits is that it actually makes migrating (or just accessing) legacy databases relatively straightforward. It’s probably not quite as quick as a purely procedural parser, but the other areas that a revised architecture offers include better caching and other system optimizations, not to mention grossly more capabilities so that the tradeoffs are very much tip the balance towards a more advanced solution vs continuing down the same path.
          Ryan Thrash, MODX Co-Founder
          Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
          • 17906
          • 18 Posts
          Isn’t xPDO just an ORB or ORM ? I’m thinking of having models as documents in ModX in order for them to appear in the manager’s navigation tree as well as their relations...

          Glad to have such quick feedback grin
            • 22303 MODX Staff
            • 10,725 Posts
            Quote from: MaDrense at Nov 08, 2006, 09:41 AM

            Isn’t xPDO just an ORB or ORM ? I’m thinking of having models as documents in ModX in order for them to appear in the manager’s navigation tree as well as their relations...

            Glad to have such quick feedback grin
            It is mostly an O/R mapping solution yes, but, the new MODx core written on it is addressing much of what you are discussing here, though mapping MODx data objects to content on the filesystem is going to come a little down the road.

            I am very familiar with JCR and OCM concepts, and I see xPDO/MODx expanding into this area as the PHP SDO project matures and I blend xPDO into much more than just an O/R mapping tool, code generator, and ActiveRecord pattern implementation.
              • 17906
              • 18 Posts
              Glad to see such interesting developments in PHP. I’ve been working with Ruby On Rails for a while and missed these....

              What is the status of your core rewrite ?

              So the bottom end is that I should just stick to using separate tables for models ? Or could I create some snippets like the NewsPublisher and allow user to view and modify model data on the web page and store it as content documents nonetheless.. I’d still have to deal with relations and such but integration with the Manager would be avoided.

              What is the best approach considering this project is to start as soon as possible? Module in the Manager with it’s own ORM, views, etc.. using new tables or Web Pages with snippets for managing the new models ?

              Thanks for the help... looking forward to new developments in ModX laugh