General XMetaL Discussion

XMetaL Community Forum General XMetaL Discussion XM 5.5: Macro – Determine if ditamap open in Map Editor

  • clloyd

    XM 5.5: Macro – Determine if ditamap open in Map Editor

    Participants 2
    Replies 3
    Last Activity 11 years, 11 months ago

    I'd like to run a macro only if no docs or ditamaps are open.
    This does fine for docs:

    if (Documents.count > 0)
    {
      Application.Alert(“Please check in and/or close any open documents before running the clear cache macro.”);
    }
    else
    {
      etc..

    But does not catch if ditamap is open in Map Editor. Can someone point me to an object to use here or some code? Thanks.

    Charles Lloyd
    Epicor Software

    Reply

    gcrews

    Reply to: XM 5.5: Macro – Determine if ditamap open in Map Editor

    Do not know if this is the correct way but it might work.

    if (Documents.count > 0 || getMapService()._ditaMaps.counter > 1 )

    Reply

    Derek Read

    Reply to: XM 5.5: Macro – Determine if ditamap open in Map Editor

    There are no official ways to do this as we don't expect (or support) this type of integration to be done with the DITA functionality. It might be done this way for now as a short term fix (which is what this seems to be for) but this code may change in the future (and this particular section of code that deals with maps is actually very likely to change). This is why there is no documentation for any of the DITA functions. If there becomes a need for this level of integration then we will likely eventually create a set of standard APIs that can be used.

    It would be good to know why you need to “clean up the cache”. I assume in your case this probably means clearing the cache used by the SharePoint connector? Perhaps this is something we should be aware of so we address that issue directly?

    Reply

    clloyd

    Reply to: XM 5.5: Macro – Determine if ditamap open in Map Editor

    Thanks gcrews, that code worked great.

    Derek, yes this is the cache for the Sharepoint connector. I'm not exactly sure what some of the reasons are that our users periodically clear this cache. I'll have our main person that supports our XM user base comment on that to you. I just refined a batch file that was in use so it would run as a macro and on multiple operating systems.

    Reply

  • You must be logged in to reply to this topic.

Lost Your Password?

Products
Downloads
Support