Pages: 1
Print
Author Topic: XM 5.5: Macro - Determine if ditamap open in Map Editor  (Read 3112 times)
clloyd
Member

Posts: 6


« on: November 05, 2010, 04:28:21 PM »

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
Logged
gcrews
Member

Posts: 265


« Reply #1 on: November 07, 2010, 01:53:57 PM »

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

if (Documents.count > 0 || getMapService()._ditaMaps.counter > 1 )
...
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2606



WWW
« Reply #2 on: November 08, 2010, 11:20:18 AM »

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?
Logged
clloyd
Member

Posts: 6


« Reply #3 on: November 08, 2010, 11:38:25 AM »

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.
Logged
Pages: 1
Print
Jump to: