We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8869
    • 32 Posts
    I have just discovered how powerful the @Bindings can be for connecting to the database and love this function.  However it occurs to me that if I were to set up a site which pulls content from the db into datagrids I would want my non-techie editors to be able to change the content in the database tables which are generating the dataset in the same manner they would edit any other content.  Obviously I would want to be able to specify which tables they have access to so that they were not able to corrupt any of the other tables in the DB.  Would it be possible to create an ’ms excel’ style editor which would let the users create rows, delete rows and alter content of rows.  (think it would be best if they weren’t able to create new or edit field names though in order to save confusion and possible breakdowns in functionality)

    Perhaps something along these lines http://www.turboajax.com/turbodbadmin_demo/
      • 22815
      • 1,097 Posts
      Such a feature would indeed mean that more structured "active" data could be used; while MODx’s content and TVs are flexible, there are still many times when one wants to have a dedicated table that will need adding to and modifying - either because it makes for better design, or because there is a legacy data table from another application.

      Ideally a MODx table editor could be configured to cross-reference between tables, so that cities had a drop-down for country for example, rather than just a number input field.

      Frankly, I wouldn’t mind if the _configuration_ of Table Editor was extremely techie, if by doing so there could be a safe and simple way for non-techie users to change data.
        No, I don't know what OpenGeek's saying half the time either.
        MODx Documentation: The Wiki | My Wiki contributions | Main MODx Documentation
        Forum: Where to post threads about add-ons | Forum Rules
        Like MODx? donate (and/or share your resources)
        Like me? See my Amazon wishlist
        MODx "Most Promising CMS" - so appropriate!
        • 6726
        • 7,075 Posts
        Interresting concept but how does TurboAdmin differs from phpMyAdmin ? It’s a layman’s question, I truly don’t see it so please enlighten me smiley

        It sure is easy to build a database, but the interresting thing is having the ability to extract, filter data without having to build specific MySQL queries, which is already possible with the @SELECT binding... Now what I’d like is a more "natural" language than MySQL to do extractions and filtering, and how do we accomplish that ? Forgive me if I am wrong but is not what the dbAPI is for ? MODx has one and if I understood correctly it will become more powerful with xPDO. Now it would be more technical than what you have in mind, but I kind of agree with Paul this kind of thing has to be handled carefully, might not be a good idea to let any user edit the data structure...
          .: COO - Commerce Guys - Community Driven Innovation :.


          MODx est l'outil id
          • 22303 MODX Staff
          • 10,725 Posts
          Well, since davidm let the cat out of the bag, I’ll go ahead and bring this up here and follow up with a post in the MODx team blog as soon as possible, because these issues are exactly the motivation for some design changes in MODx 1.0 and all of the motivation behind the design of xPDO.

          You might be interested in looking at this project I am working on, which will be powering the upcoming MODx 1.0 core framework. The xPDO (or OpenExpedio) project is my attempt to fill a gap I found in PHP, which is being able to provide a light-weight OR/M framework that can generate an efficient object-oriented API from a description of the model, and manage all aspects of it’s relational data source, including automatic-table creation and tools for easily managing data model changes; one that can be deployed on PHP 4, but take full advantage of PHP 5 (i.e. PDO) when available, and one that can work with other database platforms besides MySQL. It is still in what I would call a beta state, and by no means a complete OR/M solution yet, but it is being used in several client deployments and is definitely usable/testable, and has turned out to be of great help in managing a recent project I was responsible for involving a data model of some 49 different custom objects/tables, including integration with the MODx user/permissions system. I can make a change to my XML model and regenerate all the classes/maps in half a second, so it’s also wonderful for rapid prototyping, and the consistent API handles all CRUD operations for you; the only additional code and/or SQL required in the generated classes is for handling complex business logic.

          It is based on research I’ve been doing over the last year, and prototypes of the new MODx I’ve been building over the 6 months, with several existing PHP object-relational tools, including Propel, EZPDO, Metastorage, Doctrine, and a host of others.

          I also have versions of my current MakeTable and MakeForm classes from the MODx add-on repository in xPDO, that work with and take advantage of the new XPDO-generated API’s. These are great for quickly building table views and forms for managing the data or building complex custom views into the data; and the consistent OO API makes it possible to write very generic functions for just about anything you want to accomplish. Complete metadata maps of the objects round out the features, and should make writing a table editor script for it a piece of cake.

          All this said (and I have plenty more to say on the subject, don’t worry tongue), management interfaces and wizards for creating/editing xPDO objects/tables, generating xPDO classes, and managing objects created with those classes, are absolutely needed for xPDO, and I’d love to have some help making that happen. Anyone interested in getting involved, just let me know...
            • 6726
            • 7,075 Posts
            Quote from: OpenGeek at Jul 13, 2006, 09:05 PM
            Well, since davidm let the cat out of the bag...

            Ooops, I hope the cat didn’t escape too early, I sincerely thought you had brought this up in the Developpement and Coding forums...

            Nice read, BTW smiley
              .: COO - Commerce Guys - Community Driven Innovation :.


              MODx est l'outil id
              • 30223
              • 1,010 Posts
              Lots to look forward too smiley

              Now if I can add my 2c worth, for me the key phrase is
              ...I would want my non-techie editors to be able to change the content in the database tables which are generating the dataset in the same manner they would edit any other content.

              What I would really like to see in a future version is that the editing area of a document is more customisable. What I mean is that if for example I do have a page which pulls data from an external database table, when editing that page the right pane shows an appropriate table editor (instead of having to edit that data outside the document via a module or similar).

              I’ve thought about using a plugin replacing the RTE but I sofar fail to see how that might work. I’ve been working on a table editor module for 0.9x but haven’t been able to finish it yet.

              Hope I’m being clear...

                • 22815
                • 1,097 Posts
                @davidm - Yes, that TurboAdmin does look like phpMyAdmin only with Ajax, and is inappropriate as an editor because it naturally knows nothing of the relations between tables. The only benefit in duplicating that within MODx would be the time saved flipping to our favoured admin app. Admittedly in some cases (eg where access is only via Plesk and you need to log in to that and find your domain and click on your database and then click on webadmin), this is a massive timesaver!

                I think en8scl was after something "excel like" and was only pointing out the look and feel of the Data view (which does look nice) - I don’t think he actually wanted a full database editor, he just wanted editors to be able to edit a few tables within MODx.

                Yes, as davidm reminds us, the dbAPI lets us build database apps, and the @binding lets us use any table to supply data. This is precisely *why* a generic configurable table editor in the Manager would be so useful. For content, you can have custom "add blog entry" / "add comment" snippets on the frontend if you wish, but most pages will be created and edited using the full, flexible, generic document editor on the backend. For data, we can add custom input and edit facilities to the frontend, but for generic data editing we have nothing. OK, *I’m* perfectly happy using phpMyAdmin, but this is far too raw to let non-techies near.

                Sure, the powerful features of dbAPI (and in the future xPDO) let the original poster of this thread build a custom data-editor for his editors to use, but it would still be more desirable to have a generic Database Table Editor.

                However, having pointed out this thread during a discussion on the best way to scale ShopX, an eager coder called humaniweb has decided to try hacking together that specific editor so it can be used alongside MODx. For his purposes (maintaining characteristics of a product such as city of origin), this will be fine.

                But there is scope for much more:

                Right now, the ideal Generic Database Table Editor would be a Manager plugin which itself had a "plugin" config file for each table that was to be edited. There is no need for the Table Editor unless you have added a table to MODx, so the requirement for a techie to write a config would not be an issue. Where a common table is being used as part of another MODx extension - say for example an ecommerce extension that worked with an existing osCommerce database - the authors of the extension could make db editor config files available.

                The config files would not be dissimilar to a series of TVs - each field could be ascribed a data type and potentially a binding to another table for drop-down selection.

                There would be both a grid view of x rows at a time, and a single-entry view.

                The editor would *not* enable structural changes.

                The difference xPDO makes
                Well, primarily the difference is that it enables MODx to move into data management rather than just content management, and delivers on the promise of a framework. This will make a Database Table Editor easier to write, but doesn’t currently fulfil the desire for one - and as OpenGeek recognises, the need is increased. However, there seems a high chance that the focus would be on programming a table editor for xPDO, which could then be integrated with either the MODx manager or a MODx site, as appropriate.

                Hmmn. I think OpenGeek will be getting a PM. This looks like exciting times.
                  No, I don't know what OpenGeek's saying half the time either.
                  MODx Documentation: The Wiki | My Wiki contributions | Main MODx Documentation
                  Forum: Where to post threads about add-ons | Forum Rules
                  Like MODx? donate (and/or share your resources)
                  Like me? See my Amazon wishlist
                  MODx "Most Promising CMS" - so appropriate!
                  • 22303 MODX Staff
                  • 10,725 Posts
                  Quote from: davidm at Jul 14, 2006, 04:48 AM

                  Ooops, I hope the cat didn’t escape too early, I sincerely thought you had brought this up in the Developpement and Coding forums...

                  Nice read, BTW smiley

                  Not too early at all; actually the timing was impeccable. cool

                  Quote from: PaulGregory at Jul 14, 2006, 11:13 AM

                  The difference xPDO makes
                  Well, primarily the difference is that it enables MODx to move into data management rather than just content management, and delivers on the promise of a framework. This will make a Database Table Editor easier to write, but doesn’t currently fulfil the desire for one - and as OpenGeek recognises, the need is increased. However, there seems a high chance that the focus would be on programming a table editor for xPDO, which could then be integrated with either the MODx manager or a MODx site, as appropriate.

                  Indeed, the need is increased greatly. The good news is, if we build a generic management interface that works in the current MODx for xPDO, since the manager in 1.0 can be built and deployed in much the same way as the current MODx front-end, we can re-use whatever makes sense to for building appropriate parts of the 1.0 manager.

                  Quote from: PaulGregory at Jul 14, 2006, 11:13 AM

                  Hmmn. I think OpenGeek will be getting a PM. This looks like exciting times.

                  Great, I could use some additional brain- and man-power on this stuff; can’t wait to hear from you or anyone else interested in contributing in any way, to xPDO, or the MODx 1.0 efforts. And yes, I am quite excited about this myself; being the uber-geek that I am.
                  :’(

                  Cheers
                    • 6726
                    • 7,075 Posts
                    Thanks Paul, you helped me understand what a database table editor would mean, and man this is exciting smiley

                    Quote from: OpenGeek at Jul 14, 2006, 04:46 PM
                    The good news is, if we build a generic management interface that works in the current MODx for xPDO, since the manager in 1.0 can be built and deployed in much the same way as the current MODx front-end, we can re-use whatever makes sense to for building appropriate parts of the 1.0 manager.

                    The last bit about the 1.0 manager is quite an exhilarating thought for me grin !!!
                      .: COO - Commerce Guys - Community Driven Innovation :.


                      MODx est l'outil id
                      • 12471
                      • 4 Posts
                      Quote from: PaulGregory at Jul 14, 2006, 11:13 AM

                      The config files would not be dissimilar to a series of TVs - each field could be ascribed a data type and potentially a binding to another table for drop-down selection.

                      Wow... well. When integrating TurboAdmin i wasn’t thinking about hacking it to enable @binding with drop down menus...
                      I was just thinking about a simple table editor but you’re right it would be so cool.

                      But i’m excited by the idea.

                      OpenGeek : do you need some help ? I still have internet access for a few days before disappearing for 3 weeks. I’m not a great developper. Before i would be of no help for you but if you need i can give some of my time to help with this project of TableEditor...

                      Thanks all for this thread,
                      Julien.