General XMetaL Discussion

XMetaL Community Forum General XMetaL Discussion Invoking auto-id generation from a macro?

  • schwamkrug

    Invoking auto-id generation from a macro?

    Participants 5
    Replies 6
    Last Activity 10 years, 2 months ago

    Hi all,

    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()?

    -Kyle

    Reply

    schwamkrug

    Reply to: Invoking auto-id generation from a macro?

    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.

    Reply

    XMetaLOldTimer

    Reply to: Invoking auto-id generation from a macro?

    Add a call the Jscript function nulAssignNewElements.

    [code]
      nulAssignNewElements();
    [/code]

    Regards

    Reply

    Derek Read

    Reply to: Invoking auto-id generation from a macro?

    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).

    Reply

    schwamkrug

    Reply to: Invoking auto-id generation from a macro?

    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.

    -Kyle

    Reply

    XMetaLOldTimer

    Reply to: Invoking auto-id generation from a macro?

    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. 

    Regards

    Reply

    schwamkrug

    Reply to: Invoking auto-id generation from a macro?

    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.

    Reply

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

Lost Your Password?

Products
Downloads
Support