General XMetaL Discussion
XMetaL Community Forum › General XMetaL Discussion › XM 5.5: Macro – Determine if ditamap open in Map Editor
-
clloyd November 5, 2010 at 10:28 pm
XM 5.5: Macro – Determine if ditamap open in Map Editor
November 5, 2010 at 10:28 pmParticipants 2Replies 3Last Activity 12 years, 2 months agoI'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 Softwaregcrews November 7, 2010 at 7:53 pm
Reply to: XM 5.5: Macro – Determine if ditamap open in Map Editor
November 7, 2010 at 7:53 pmDo not know if this is the correct way but it might work.
if (Documents.count > 0 || getMapService()._ditaMaps.counter > 1 )
…Derek Read November 8, 2010 at 5:20 pm
Reply to: XM 5.5: Macro – Determine if ditamap open in Map Editor
November 8, 2010 at 5:20 pmThere 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?
clloyd November 8, 2010 at 5:38 pm
Reply to: XM 5.5: Macro – Determine if ditamap open in Map Editor
November 8, 2010 at 5:38 pmThanks 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.
-
AuthorPosts
- You must be logged in to reply to this topic.