General XMetaL Discussion
schwamkrug January 11, 2013 at 7:03 pm
Invoking auto-id generation from a macro?January 11, 2013 at 7:03 pmParticipants 5Replies 6Last Activity 9 years, 10 months ago
I've got a macro that calls InsertWithTemplate(). It's been working great, but I just realized that auto ID generation doesn't occur. If I insert the same element from the element list, it does occur.
The only workaround I've found is to call ActiveDocument.Validate() after InsertWithTemplate(). However, this is kind of invasive, as users get the dialog saying validation was successful.
So, I'm wondering if there's a less invasive way to invoke ID generation after I call InsertWithTemplate()?
-Kyleschwamkrug April 9, 2013 at 9:29 pm
Reply to: Invoking auto-id generation from a macro?April 9, 2013 at 9:29 pm
Just now getting back to this… Is there any other way to invoke auto-id generation from a macro? This is in XMetaL 6.0, by the way.XMetaLOldTimer April 9, 2013 at 11:04 pm
Reply to: Invoking auto-id generation from a macro?April 9, 2013 at 11:04 pm
Add a call the Jscript function nulAssignNewElements.
RegardsDerek Read April 9, 2013 at 11:16 pm
Reply to: Invoking auto-id generation from a macro?April 9, 2013 at 11:16 pm
Note: XMetaLOldTimer is assuming you are working with XMetaL Author Enterprise and modifying the DITA authoring functionality. That function is only present with the DITA customization's macros.
Not enough information in your post to be sure. If it is not the case then we would need more detail, keeping in mind that making such changes is unsupported (so you would need to support anyone using your solution and XMetaL Support would not be able to do so).schwamkrug April 11, 2013 at 6:26 pm
Reply to: Invoking auto-id generation from a macro?April 11, 2013 at 6:26 pm
Thanks! Worked like a charm!
Derek, I'm possibly getting too hung up on semantics here… This macro is indeed being used with DITA topics, but I'm not directly modifying the DITA authoring functionality like I was with my question about @type attribute insertion. Our CMS's functionality for creating conrefs is a bit cumbersome, so I created a macro that will let you copy/paste content as a conref, rather than a plain copy/paste. It also lets you create conref ranges if you copy a set of elements. It's deployed as a macro in the startup dir, so I suspect that macro would be available with any other doctypes, although it would almost certainly throw errors with non-DITA files.
I'd be happy to send it to you if you're interested. This macro is pretty specific to our CMS environment, but it might be useful to others with some tweaking.
-KyleXMetaLOldTimer April 15, 2013 at 10:28 pm
Reply to: Invoking auto-id generation from a macro?April 15, 2013 at 10:28 pm
Our CMS's functionality for creating conrefs is a bit cumbersome, so I created a macro that will let you copy/paste content as a conref, rather than a plain copy/paste. It also lets you create conref ranges if you copy a set of elements.
Is there anything about your CMS's conref markup that would make it DITA-invalid? I am curious to see what this cumbersome conref markup looks like.
Btw, the XMetaL Connector SDK is the only supported means by which our DITA feature can be setup to inter-operate with any CMS. The latest DITA 1.2 keyref features along with the MapEditor and our integrated DITA Open Toolkit are all coded to delegate reference resolution, locking, and fetching to the XMetaL Connector.
Regardsschwamkrug April 16, 2013 at 2:39 pm
Reply to: Invoking auto-id generation from a macro?April 16, 2013 at 2:39 pm
No, there's nothing DITA-invalid about the markup, and it's not the markup that's cumbersome. What makes it cumbersome is our CMS's conref creation UI. You have to go through multiple dialogs, each of which can be kind of slow to open. Then, you discover that you forgot to add an ID to the element you want to conref, so you have to check out that topic, add the ID, then go through the conref creation dialogs again. My macro just lets my users copy/paste a paragraph (or whatever) and get a conref instead of a plain copy/paste. It doesn't directly interoperate with the CMS. It just looks at topic/element ids at copy time to add a conref to the clipboard.
- You must be logged in to reply to this topic.