Announcement

Collapse
No announcement yet.

Re[4]: need to know if a module is installed?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Re[4]: need to know if a module is installed?



    Hello jeff,

    Thanks for your input. This is helpful. I can imagine how some
    recursive loop of something exotic can get started.

    Might you have any ideas? Should I write a function to search the
    modules db directly -- creating my own indexes, and other such steps?

    TIA,

    Scott
    IDS

    Saturday, October 9, 2004, 11:46:27 PM, you wrote:

    j4c> Scott,

    j4c> Be very careful about calling those functions from within a
    j4c> module. All sorts of very nasty and hard to track down bad things
    j4c> can happen if you for example are inside a system extension
    j4c> module and call to see if module 'abc' is installed in the domain
    j4c> and the store. Not the least of which is that the wrong index may
    j4c> end up being left open and the main software may end up calling
    j4c> some random module next and trying to call whatever system
    j4c> extension function it just called in yours. And in fact your own
    j4c> module can even end up getting called twice in a row.

    j4c> - Jeff Huber
    j4c> President 4TheBest eCommerce Solutions
    j4c> http://4TheBest.com
    j4c> [email protected]
    j4c> Office: 760-742-1469
    j4c> Cell: 760-445-8454



    j4c> -----Original Message-----
    j4c> From: [email protected]
    j4c> [mailto:[email protected]] On Behalf Of Scott
    j4c> Shepard
    j4c> Sent: Friday, October 08, 2004 10:20 PM
    j4c> To: [email protected]
    j4c> Subject: Fwd: Re[2]: [mrc] need to know if a module is installed?


    j4c> Rethinking what my question is, because the docs aren't very
    j4c> good. I
    j4c> think what I'm really wanting to know is what the functions do.

    j4c> <MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{
    j4c> Module_Find_Code( g.Module_Code ) }">

    j4c> It think it will really be enough to know if "l.ok" is true or
    j4c> false.
    j4c> I was wondering how Module_Find_Code works.

    j4c> When realizing this I just found that I could go to see the
    j4c> function
    j4c> in "db.mv."

    j4c> No Harm Done Then! Question and problem solved!

    j4c> Thanks,

    j4c> Scott
    j4c> IDS

    j4c> This is a forwarded message
    j4c> From: Scott Shepard <[email protected]>
    j4c> To: [email protected]
    j4c> Date: Friday, October 8, 2004, 9:57:36 PM
    j4c> Subject: [mrc] need to know if a module is installed?

    j4c> ===8<==============Original message text===============
    j4c> Thanks Susan. Saw these in the docs at Miva.com, but there's no
    j4c> examples or
    j4c> explanation of implementation. When you look at some MM code, it
    j4c> isn't
    j4c> very efficient use for what I need to accomplish.

    j4c> I was hoping someone could share an example illustration the
    j4c> method. I
    j4c> probably presuming it's more complicated than it really is.

    j4c> TIA,

    j4c> Scott
    j4c> IDS

    j4c> Friday, October 8, 2004, 6:07:13 AM, you wrote:

    SP>> For the domain:

    SP>> Module_Find_Code('MODCODE')
    SP>> You may also then want to check Modules.d.active to determine
    j4c> if the module
    SP>> is active or not

    SP>> For the store:

    SP>> StoreModule_Find_ID(Modules.d.id) - assuming you've already
    j4c> done the above
    SP>> and therefore the Modules record pointer is on the right row

    SP>> HTH, Susan

    SP>> Susan Petracco
    SP>> [email protected]
    SP>> NetBlazon
    SP>> E-Business for Every Business

    >>> -----Original Message-----
    >>> From: [email protected]
    >>> [mailto:[email protected]] On Behalf Of Scott
    j4c> Shepard
    >>> Sent: Friday, October 08, 2004 5:55 AM
    >>> To: [email protected]
    >>> Subject: [mrc] need to know if a module is installed?
    >>>
    >>> Hello merchant-coders,
    >>>
    >>> What would be good method to figure out if a particular module
    j4c> is
    >>> installed in the domain and/or the store? Is there a function
    j4c> already
    >>> for this? I'm working on a custom mod that needs to know if
    j4c> certain
    >>> mods are already installed to enable features of the custom
    j4c> module.
    >>> These mods are not required for the custom module and user
    j4c> input is
    >>> not available/allowed in this instance.
    >>>
    >>> --
    >>> Best regards,
    >>> Scott
    >>> mailto:[email protected]
    >>>
    >>>
    >>>

    #2
    need to know if a module is installed?



    Using the built-in aliases and indexes is definitely very dangerous. You
    have to take care that after each such call the original indexes and filters
    are put back, otherwise it can indeed cause serious damage.

    There is a safe way available, though: open the Modules and StoreModules
    databases under other aliases than the default ones (i.e. IDS_Modules and
    IDS_StoreModules, without any indexes, and then use MvFILTER to lookup the
    specific module. Using MvFilter, although slower than MvFind is not too bad
    in this case, since the databases are never too big.

    Ivo Truxa

    | http://miva.truxoft.com
    | Advanced Miva Merchant modules



    -----Original Message-----
    From: Scott Shepard


    Hello jeff,

    Thanks for your input. This is helpful. I can imagine how some
    recursive loop of something exotic can get started.

    Might you have any ideas? Should I write a function to search the
    modules db directly -- creating my own indexes, and other such steps?

    TIA,

    Scott
    IDS

    Saturday, October 9, 2004, 11:46:27 PM, you wrote:

    j4c> Scott,

    j4c> Be very careful about calling those functions from within a
    j4c> module. All sorts of very nasty and hard to track down bad things
    j4c> can happen if you for example are inside a system extension
    j4c> module and call to see if module 'abc' is installed in the domain
    j4c> and the store. Not the least of which is that the wrong index may
    j4c> end up being left open and the main software may end up calling
    j4c> some random module next and trying to call whatever system
    j4c> extension function it just called in yours. And in fact your own
    j4c> module can even end up getting called twice in a row.

    j4c> - Jeff Huber
    j4c> President 4TheBest eCommerce Solutions
    j4c> http://4TheBest.com
    j4c> [email protected]
    j4c> Office: 760-742-1469
    j4c> Cell: 760-445-8454



    j4c> -----Original Message-----
    j4c> From: [email protected]
    j4c> [mailto:[email protected]] On Behalf Of Scott
    j4c> Shepard
    j4c> Sent: Friday, October 08, 2004 10:20 PM
    j4c> To: [email protected]
    j4c> Subject: Fwd: Re[2]: [mrc] need to know if a module is installed?


    j4c> Rethinking what my question is, because the docs aren't very
    j4c> good. I
    j4c> think what I'm really wanting to know is what the functions do.

    j4c> <MvDO FILE = "{ g.Library_DB }" NAME = "l.ok" VALUE = "{
    j4c> Module_Find_Code( g.Module_Code ) }">

    j4c> It think it will really be enough to know if "l.ok" is true or
    j4c> false.
    j4c> I was wondering how Module_Find_Code works.

    j4c> When realizing this I just found that I could go to see the
    j4c> function
    j4c> in "db.mv."

    j4c> No Harm Done Then! Question and problem solved!

    j4c> Thanks,

    j4c> Scott
    j4c> IDS

    j4c> This is a forwarded message
    j4c> From: Scott Shepard <[email protected]>
    j4c> To: [email protected]
    j4c> Date: Friday, October 8, 2004, 9:57:36 PM
    j4c> Subject: [mrc] need to know if a module is installed?

    j4c> ===8<==============Original message text===============
    j4c> Thanks Susan. Saw these in the docs at Miva.com, but there's no
    j4c> examples or
    j4c> explanation of implementation. When you look at some MM code, it
    j4c> isn't
    j4c> very efficient use for what I need to accomplish.

    j4c> I was hoping someone could share an example illustration the
    j4c> method. I
    j4c> probably presuming it's more complicated than it really is.

    j4c> TIA,

    j4c> Scott
    j4c> IDS

    j4c> Friday, October 8, 2004, 6:07:13 AM, you wrote:

    SP>> For the domain:

    SP>> Module_Find_Code('MODCODE')
    SP>> You may also then want to check Modules.d.active to determine
    j4c> if the module
    SP>> is active or not

    SP>> For the store:

    SP>> StoreModule_Find_ID(Modules.d.id) - assuming you've already
    j4c> done the above
    SP>> and therefore the Modules record pointer is on the right row

    SP>> HTH, Susan

    SP>> Susan Petracco
    SP>> [email protected]
    SP>> NetBlazon
    SP>> E-Business for Every Business

    >>> -----Original Message-----
    >>> From: [email protected]
    >>> [mailto:[email protected]] On Behalf Of Scott
    j4c> Shepard
    >>> Sent: Friday, October 08, 2004 5:55 AM
    >>> To: [email protected]
    >>> Subject: [mrc] need to know if a module is installed?
    >>>
    >>> Hello merchant-coders,
    >>>
    >>> What would be good method to figure out if a particular module
    j4c> is
    >>> installed in the domain and/or the store? Is there a function
    j4c> already
    >>> for this? I'm working on a custom mod that needs to know if
    j4c> certain
    >>> mods are already installed to enable features of the custom
    j4c> module.
    >>> These mods are not required for the custom module and user
    j4c> input is
    >>> not available/allowed in this instance.
    >>>
    >>> --
    >>> Best regards,
    >>> Scott
    >>> mailto:[email protected]
    >>>
    >>>
    >>>

    Comment


      #3
      need to know if a module is installed?



      From: Ivo Truxa

      >> Using the built-in aliases and indexes is definitely very dangerous.
      >> You have to take care that after each such call the original
      >> indexes and filters are put back, otherwise it can indeed cause
      >> serious damage.

      I forgot to mention the recno - when using the built-in functions, besides
      the indexes, and filters, also the original recno must be set back to the
      initial value with a MvGO (or MvFIND) command. That's not necessary when
      using the method with alternate aliases I proposed.

      Ivo Truxa

      | http://miva.truxoft.com
      | Advanced Miva Merchant modules




      There is a safe way available, though: open the Modules and StoreModules
      databases under other aliases than the default ones (i.e. IDS_Modules and
      IDS_StoreModules, without any indexes, and then use MvFILTER to lookup the
      specific module. Using MvFilter, although slower than MvFind is not too bad
      in this case, since the databases are never too big.

      Ivo Truxa

      | http://miva.truxoft.com
      | Advanced Miva Merchant modules





      Comment

      Working...
      X