Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X
This is a follow-on to a post from yesterday. My core problem is that I need all my xinlcude file references to be relative paths from the including document to the referneced include file. If I have an xinclude in file 1 that has a relative path to an include file and I copy or cut the xinclude, then paste it into file 2, the Arbortext is transforming the relative path to an absolute path for the pasted reference.
I've used the paste callback to intercept the paste, but when I examine the paste buffer the raw markup with the relative path is there. The source of the paste buffer is not available to the paste callback, so I can't construct the proper relative path and do my own insert and cancel the default paste.
I already have a custom version of the create_include alias that ensures that my paths are relative when an inclusion is created from a selection, but this alias isn't called by the paste operation of an already existing xinclude.
Can anyone point me to the underlying alias or function that Arbortext is using to paste an xinclud so that I can override it with a custom function? Is there another callback or hook that I can use to sucessfully insert a paste buffer that contains an xinclude?
Steve
Thanks Clay, but that's not quite the issue. I can get the contents of the paste buffer, but by the time it is there, I can't tell where it came from. Say I have three documents open, target, source 1, and source 2. If I copy the xinclude from source 1, I can change the current doc to source 2 and even make a selection in source 2 without copying. I then shift my focus to target and paste (should be from default buffer). I can intercept the paste callback and manipulate the contents of the paste buffer. However, because I don't know if it came from source 1, source 2, or even target, the relative path in the xinclude that makes up the contents of the paste buffer in unknown, so I can't modify it to be a correct relative path when it is inserted into target.
Core Arbortext must understand this, but I can't figure out how they know the source of the paste buffer in order to change the relative path to an absolute path to the fragment pointed to by the xinclude. Does that make sense?
Steve
Hey Steve,
Sorry I'm a little slow to respond. I see in the intervening time it took to compose this response, the thread here has progressed a little further. I'll continue here with a response to your first post anyway.
Unfortunately, I can't point you to the underlying alias or function that Arbortext is using to paste an xinclude. We had need to locate that code point back 4-5 years ago when addressing a concern similar to yours and were not able to find it. At that time, we grew to suspect the key code was not within ACL code but was instead located somewhere, such as within a dll, where it was inaccessible for customization.
Our experiences in this area may not perfectly address your situation, but hopefully providing you with insights from our similar need for cut/copy/paste customizations may prove helpful.
Our needs are similar in that our xinclude references are encoded with a logical file ID which is resolved to a physical file dynamically based on the environment under which the reference is being made. And our references were being changed to physical file path references over the course of cut/copy/paste operations by default editor behavior.
Detailed view of our solution:
Hopefully, you'll find some of these insights useful for your case.
Bob Beetcher
In Reply to Steve Cuzner:
This is a follow-on to a post from yesterday. My core problem is that I need all my xinlcude file references to be relative paths from the including document to the referneced include file. If I have an xinclude in file 1 that has a relative path to an include file and I copy or cut the xinclude, then paste it into file 2, the Arbortext is transforming the relative path to an absolute path for the pasted reference.
I've used the paste callback to intercept the paste, but when I examine the paste buffer the raw markup with the relative path is there. The source of the paste buffer is not available to the paste callback, so I can't construct the proper relative path and do my own insert and cancel the default paste.
I already have a custom version of the create_include alias that ensures that my paths are relative when an inclusion is created from a selection, but this alias isn't called by the paste operation of an already existing xinclude.
Can anyone point me to the underlying alias or function that Arbortext is using to paste an xinclud so that I can override it with a custom function? Is there another callback or hook that I can use to sucessfully insert a paste buffer that contains an xinclude?
Steve