Pages: 1
Print
Author Topic: Invoking auto-id generation from a macro?  (Read 3346 times)
schwamkrug
Member

Posts: 33


« on: January 11, 2013, 01:03:12 PM »

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

Posts: 33


« Reply #1 on: April 09, 2013, 03:29:10 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.
Logged
XMetaLOldTimer
Administrator
Member

Posts: 57


« Reply #2 on: April 09, 2013, 05:04:42 PM »

Add a call the Jscript function nulAssignNewElements.

Code:
  nulAssignNewElements();

Regards
Logged

Addam Smith, XMetaL Project Lead & Architect
JustSystems Canada Inc.
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #3 on: April 09, 2013, 05:16:41 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).
Logged
schwamkrug
Member

Posts: 33


« Reply #4 on: April 11, 2013, 12:26:48 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.

-Kyle
Logged
XMetaLOldTimer
Administrator
Member

Posts: 57


« Reply #5 on: April 15, 2013, 04:28:49 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. 

Regards
Logged

Addam Smith, XMetaL Project Lead & Architect
JustSystems Canada Inc.
schwamkrug
Member

Posts: 33


« Reply #6 on: April 16, 2013, 08:39:46 AM »

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.
« Last Edit: April 16, 2013, 08:45:32 AM by schwamkrug » Logged
Pages: 1
Print
Jump to: