We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21767
    • 44 Posts
    See the class modAccessResoureGroup on http://svn.modxcms.com/svn/tattoo/tattoo/branches/revolution-design2/core/model/modx/mysql/modaccessresourcegroup.map.inc.php

    Why has that class no principal field like the corresponding database table "modx_access_resource_groups"?

    I thought, I could fire a modx-object-query on it to find the usergroups which are allowed to use a dedicated resource. But with that it seems not possible. So, why do the modx classes differ so much from the database tables?

    When I have to make this on xpdo, how do I have to initialize it? I need any snippet example to learn it.

      • 21257 MODX Staff
      • 730 Posts
      modAccessResourceGroup extends modAccess, which defines the principal field (see modx.mysql.schema.xml)
        Mike Schell
        Lead Developer, MODX Cloud
        Email: [email protected]
        GitHub: https://github.com/netProphET/
        Twitter: @mkschell
        • 21767
        • 44 Posts
        Quote from: netProphET at Aug 10, 2010, 02:31 PM

        modAccessResourceGroup extends modAccess, which defines the principal field (see modx.mysql.schema.xml)


        That doesn’t help me.

        The database design in my view: (Zoom in)



        names:
        [table]
        [tr][td]database[/td][td]modx class[/td][td] [/td][/tr]
        [tr][td]access_resource_groups[/td][td]modAccessResourceGroup[/td][/tr]
        [tr][td]document_groups[/td][td]modResourceGroupResource[/td][/tr]
        [tr][td]document_group_names[/td][td]modResourceGroup[/td][/tr]
        [tr][td]membergroup_names[/td][td]modUserGroup[/td][/tr]
        [/table]

        I see only this way. My example record is clearly saved in access_resource_groups. But modAccessResourceGroup has no principal.

        See also:
        http://svn.modxcms.com/svn/tattoo/tattoo/branches/revolution/core/model/modx/mysql/
        http://svn.modxcms.com/crucible/browse/modx/trunk/manager/actions/access_permissions.dynamic.php?r=HEAD

          • 21767
          • 44 Posts
          I would say, it is a basically incorrect planning, or failure of the class model, that there is no way to detect the principal (a usergroup) of a ResoureGroup Access (modAccessResoureGroup).

          I will write an error message into JIRA.

          It is also a serious problem that there is no (graphic) overview on the modx data model anywhere.
            • 28215
            • 4,149 Posts
            1. It’s not a problem, as the fields are defined in modAccess. The modAccessResourceGroup class extends modAccess.
            2. We are aware of a need for a visual model. However, the model is complex and this takes time.
            3. We are no longer on SVN, btw. Please reference the Git repository here: http://github.com/modxcms/revolution/
              shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
              • 21767
              • 44 Posts
              Quote from: splittingred at Sep 09, 2010, 11:02 AM

              1. It’s not a problem, as the fields are defined in modAccess. The modAccessResourceGroup class extends modAccess.
              2. We are aware of a need for a visual model. However, the model is complex and this takes time.
              3. We are no longer on SVN, btw. Please reference the Git repository here: http://github.com/modxcms/revolution/

              1. I had tried it. I was too silly to have had success.
              As I have written above, I need any snippet example to learn it.
              Sadly I coundn’t find any application.

              2. Not really complex. We need for docu many small details of the model. Is there any prefered grafic tool to make such pictures?
                • 21257 MODX Staff
                • 730 Posts
                It’s really not a simple task, diagramming an object relational model.
                There are many kinds of relationships, heirarchies, inheritance to consider, plus the separation between the objects and how they’re persisted.
                I doubt it’s possible to make a complete picture of something like Revolution in one diagram. You need to start by knowing exactly what it is you want to convey. You may be able to find industry standard methodologies, tools, techniques (e.g. a UML class diagram) that give you what you’re looking for, or you may need your own hybrid approach in a generic diagramming tool.
                  Mike Schell
                  Lead Developer, MODX Cloud
                  Email: [email protected]
                  GitHub: https://github.com/netProphET/
                  Twitter: @mkschell
                  • 21767
                  • 44 Posts
                  Quote from: netProphET at Sep 09, 2010, 02:06 PM

                  It’s really not a simple task, diagramming an object relational model.
                  There are many kinds of relationships, heirarchies, inheritance to consider, plus the separation between the objects and how they’re persisted.
                  I doubt it’s possible to make a complete picture of something like Revolution in one diagram. You need to start by knowing exactly what it is you want to convey. You may be able to find industry standard methodologies, tools, techniques (e.g. a UML class diagram) that give you what you’re looking for, or you may need your own hybrid approach in a generic diagramming tool.

                  Okay, but I don’t mean "a complete picture of something like Revolution in one diagram". It is anyway better to have small explanations on specail topics in the documentation, for example in "Security" and "Making Member-Only Pages"
                    • 3749
                    • 24,544 Posts
                    The relationships are defined in core/model/schema/modx.mysql.schema.xml if that helps.
                      Did I help you? Buy me a beer
                      Get my Book: MODX:The Official Guide
                      MODX info for everyone: http://bobsguides.com/modx.html
                      My MODX Extras
                      Bob's Guides is now hosted at A2 MODX Hosting
                      • 21767
                      • 44 Posts
                      Quote from: BobRay at Sep 09, 2010, 06:22 PM

                      The relationships are defined in core/model/schema/modx.mysql.schema.xml if that helps.


                      It helps the detective. grin