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

    I am a complete novice at this so I apologies in advance for a possible obvious answer to my quesstion....

    I have an existing database that I would like to use with MODX, and been reading a lot about xPDO. I've come to the conclusion I can use the reverse engineering script here
    http://rtfm.modx.com/display/revolution20/Reverse+Engineer+xPDO+Classes+from+Existing+Database+Table
    to create the classes I need and then define the relationships afterwards.

    The bit I am stuck at what to define as the

    // Your package shortname:
    $package_name = '';


    Its confused me because I just want to create my classes based on my database and not sure what it has to do with a package?

    Many thanks in advance.

    This question has been answered by Bruno17. See the first response.

    • discuss.answer
      • 4172
      • 5,888 Posts
      Before you can work with xpdo will need to have a xpdo-package.
      This means, a file-directory , normally under core/components/XXX
      with some subfolders which will contain your schema and some xpdo-classes and map-files after running parse-schema


      XXX is your package-name - use allways lowercase packagenames!

      you can also use the package-manager-feature of MIGXdb to create your package-folder, run write-schema and parse-schema.
      Example how to use it is here:
      http://rtfm.modx.com/display/ADDON/MIGXdb.Create+doodles+manager+with+help+of+MIGXdb
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 40541
        • 85 Posts
        Thanks for replying.

        I haven't come across MIGXdb so just looking into that - hit a small problem though, on this page
        http://rtfm.modx.com/display/ADDON/MIGXdb.Configuration
        where is says the following:

        Create a new action

        System->Actions

        right-click 'migx' ->create Action here

        controller: index

        When actually doing this for real on Revo 2.2.6-pl I have an extra mandatory option called 'Parent Controller' and the options are as follows that isn't documented:

        No Action
        Core - browser
        Core - context
        Core - context/create
        Core - context/update
        Core - context/view
        Core - element
        Core - element/chunk
        Core - element/chunk/create
        Core - element/chunk/update
        Core - element/plugin
        Core - element/plugin/create
        Core - element/plugin/update
        Core - element/propertyset/index
        Core - element/snippet
        Core - element/snippet/create
        Core - element/snippet/update
        Core - element/template
        Core - element/template/create
        Core - element/template/tvsort

        Do you know which one I should pick?

        Thanks.
        • Select the top item, I thinks it's none or no parent or something like that.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 40541
            • 85 Posts
            Thanks.

            Sorry though, I should added that when I did that and went onto the next step:

            Create a new menu

            System->Actions

            right-click 'Components' ->Place Action here

            lexicon key: migx
            action: migx - index
            parameters: &configs=packagemanager||migxconfigs||setup

            When it comes to selecting the action, the drop down list is the same as above with no option for 'migs - index' - which I had just created in the previous step and where I thought I might be going wrong?
              • 4172
              • 5,888 Posts
              there is a pagination on that selectbox
                -------------------------------

                you can buy me a beer, if you like MIGX

                http://webcmsolutions.de/migx.html

                Thanks!
                • 40541
                • 85 Posts
                LOL, so there is.

                Thanks for your time anyway.