Forum Replies Created

  • gcrews

    Reply To: Creating a custom toolbar?

    Participants 0
    Replies 198
    Last Activity 8 years, 4 months ago

    Ok thanks for the information; I changed my code to only add it once. I guess if I need to update the toolbar at a later date I will change the toolbar name and delete the old one if it exits after XMetaL has fully loaded. That wayit only adds it once between customization updates.

    Reply

    gcrews

    Reply To: Creating a custom toolbar?

    Participants 0
    Replies 198
    Last Activity 8 years, 4 months ago

    I tried your code, it did the same thing.

    1. Placed code in macro file named zzz.mcr in startup

    2. Started xmetal.

    When no documents are open, the toolbar is visable and both of the items in the right-click menu are enabled. When I open a file they are both disabled. It seems to work properly after 2 restarts of Xmetal. It also works if you use the Ctrl key while xmetal is loading but then the new toolbar is floating by default.

    Do you know if the following note in the programmer's Guide is referring to the On_Application_Open or On_Default_CommandBars_Complete macro that your not supposed to create new tool-bars?
    The  pronoun “this” may be referring to the subject of that topic or the previous paragraph.

    http://xmetal.com/webhelp/en/xmetaldeveloper/pg/6.0/pg.html#When%20XMetaL%20starts%20or%20closes
    “Note: Do not use CommandBarControl.Delete or CommandBar.Delete in this event macro. Also, do not create a new toolbar in this event macro.”

    The delete topic has a note about not using .delete() in On_Default_CommandBars_Complete, so I would assume that note is referring to that macro, but if you are not supposed to create a toolbar in that macro where do you create it?

    Reply

    gcrews

    Reply To: Creating a custom toolbar?

    Participants 0
    Replies 198
    Last Activity 8 years, 4 months ago

    That’s what I have been doing but I ran into a slight glitch.  If Xmetal has ever been open before, the first time that my macro creates the toolbar it does not work quite right. The first time I open Xmetal after adding my macro code to a startup file, there are 2 instances of the toolbar when you right click on the menu area as shown in the screenshot. I delete all *.tbr files from my computer after every test, so the duplicates are not leftover from the previous macro run.  Additionally if you are in any DTD specific file the menu is not visible by default. After restarting Xmetal once, the menu is visible in DTD specific documents but there are still 2 items listed when right-clicking. After restarting Xmetal again, it finally only has one new toolbar and it is visible in DTD specific documents.

    Here is the code I have in the On_Default_CommandBars_Complete macro:
    [code] var cmdBars = Application.CommandBars;
    var oldBar = cmdBars.item(“New bar”);
    if(oldBar != null) {
    return;
    //oldBar.Delete();
    }
    var customBar = cmdBars.Add(“New bar”,sqcbPosTop);
    customBar.Visible = true;[/code]

    I commented out the delete line and just have it return now after reading some of the help files, seeing if that was the issue but it doesn’t seem to be. I need to be able to periodically update toolbar icons and possible add and remove items when I update our customizations.

    http://xmetal.com/webhelp/en/xmetaldeveloper/pg/6.0/pg.html#When%20XMetaL%20starts%20or%20closes
    “Note: Do not use CommandBarControl.Delete or CommandBar.Delete in this event macro. Also, do not create a new toolbar in this event macro.”
    (I can’t tell if this is referring to the On_Application_Open macro or the On_Default_CommandBars_Complete macro)
    “If you want to make modifications to the menus and toolbars, you can do it here; however, you cannot affect the visibility of toolbars from this event.”

    http://xmetal.com/webhelp/en/xmetaldeveloper/pg/6.0/pg.html#Delete
    “Do not use this method inside the On_Default_CommandBars_Complete event macro.”

    OK…, so when you and the documentation say you can “modify” the menus in On_Default_CommandBars_Complete what exactly can you modify if you are not supposed to call .Delete(), create new toolbars, change visibility, or call .reset() ?????
    The programing guide specifically says “Do not create a new toolbar in this event macro” does that mean I can create new buttons under a toolbar (oh wait I can’t remove ones though so anything I add I will never be able to delete…)?
    Am I supposed to create the new menu or delete all the items on that toolbar if it exists in in On_Application_Open? Then in On_Default_CommandBars_Complete populate the toolbar or something?

    Up until now it has been fine except I recently added a new toolbar for our writers and noticed the weird double behavior on someone’s computer after the customization update.

    The macro has to be robust and updatable. Everything up until this point I can push out any customizations and macro file updates relatively easily.  How am I supposed to update custom toolbar customizations if the macros are only supposed to create the toolbar only once? Have my customization script delete every *.tbr file from the system every time there’s an update? 

    Reply

    gcrews

    Reply To: Typeing 2 spaces

    Participants 0
    Replies 198
    Last Activity 8 years, 4 months ago

    I was wounding since I came across two non-breaking spaces ( ) in our DITA content and some of our processing was getting a parsing error because of it. It’s a specific string within text of a paragraph being quoted that specifically needed two spaces.  The documentation itself says with two spaces between the two words.  I ended up just just changing them in that instance to   and it seems to work ok now. I was just kind of wounding if there was a trick in XMetaL such as a special character in the symbol or special characters toolbars for non-breaking spaces or something. I don’t think I’m going to go through the trouble of making a special tag if it’s only once or twice that it’s needed.

    Reply

    gcrews

    Reply To: Refresh Images

    Participants 0
    Replies 198
    Last Activity 8 years, 4 months ago

    Ah didn’t think of that.  That works like a charm, thanks for the help.

    Reply

    gcrews

    Reply To: Xmetal hangs/crashes on ActiveDocument.Reload()

    Participants 0
    Replies 198
    Last Activity 8 years, 4 months ago

    frozen/hang/crash/Not responding, there all the same to me if an application GUI is not responding for over 5 min. How am I supposed to know its waiting on a web request? After 20 seconds any user is going to consider an application any of those terms.

    I see now that XmetaL was going out to w3.org every time I open a xhtml document and creating temp folders. There were over 2000 of those #### folders with no files in them, just some w3.org sub folders cluttering up my temp folder. Initially, xMetaL would frozen while waiting for w3.org when opening xhtml files. After adding the xhtml entries in the Rulescatalog file they opened fine with no delay. I see now though, it was still making http requests out to w3.org but was not waiting for a response and used the catalog entries instead. For some reason the Reload() function seems to force xMetaL to wait on w3.org again.

    Since I saw the HTML entries in the catalog file, I thought that's all that had to be changed to resolve them locally. I was looking though the information in the Mapping identifiers section of the Customization Guide. Sounds like On_Application_Resolve_Entity is what I need to create a macro for to resolve them to locally stored files. I will give that a try. I would have never thought there was a macro related to the resolving, all i was looking for was catalog related information. 

    What about using the addCatalog() function in the XML Catalog Resolver service the way that xmetalSamples.mcr adds a catalog.xml file around line 300?  That seems to work well and the entries are nicely defined in an xml file instead of hard coding them into if statements.  

    PS: I know why w3.org takes a long time to respond, because w3.org gets  way to many requests for those files and they intentionally make it take a very long time. At minimum it should cache them, not re-request them on every document  and changing views. You might want to take a look at this article from a few years ago:
     [url=http://www.w3.org/blog/systeam/2008/02/08/w3c_s_excessive_dtd_traffic/]http://www.w3.org/blog/systeam/2008/02/08/w3c_s_excessive_dtd_traffic/[/url]

    Thanks for the detailed information and suggestions.  

    Reply

    gcrews

    Reply To: Xmetal hangs/crashes on ActiveDocument.Reload()

    Participants 0
    Replies 198
    Last Activity 8 years, 4 months ago

    Update:
              After much hunting, I found how DocBook adds its catalog.xml in xmetalSamples.mcr. Looks like to correctly setup XMetaL with customized catalog entries you have to make a Javascript call and have a catalog xml file.  It seems XMetaL doesn’t fully use the entries to the Rulescatalog file for all resolving.

    Reply

    gcrews

    Reply To: File changes lost when closing document

    Participants 0
    Replies 198
    Last Activity 8 years, 5 months ago

    I suspected that was what was going on, thanks for the information.

    I am trying to solve the issue where a file should be read-only in XmetaL but it has become writable. A file may correctly be read-only when someone opens it but if they switch to code view or preview and back to normal or something it may become writable and they may have made changes. Setting the document node to ready-only will work for what we need. 

    Reply

    gcrews

    Reply To: File changes lost when closing document

    Participants 0
    Replies 198
    Last Activity 8 years, 5 months ago

    It does not seem to have anything to do with the file read-only flag.

    1. Create a macro that sets the the document container to read-only.
            var range = ActiveDocument.Range;      
            range.SelectAll();
            range.ReadOnlyContainer = true;
    2. Open a dita file.
    3. Make some changes.
    4. Run macro.
    5. Close the document.
    6. Xmetal asks to save changes.
    7. Choose yes.
    8. Reopen document.
    The changes you made to that document before the ReadOnlyContainer was set to true that you supposedly  just saved to disk were in fact not saved but lost. I suspect the save operation aborts simply because the document container is read-only, but there are a number of case where that may not be the case.

    Update: I think I found a bit of a workaround for what I need. By applying the ReadOnlyContainer to the DOM doc node, it seems to prevent editing but still saves properly when a user closes the document. The user can still delete the root node in normal mode but that’s about it.
    var doc = ActiveDocument.documentElement;
    var range = ActiveDocument.Range;
    range.SelectNodeContents(doc);
    range.ReadOnlyContainer = true;
    range = null;

    Reply

    gcrews

    Reply To: Horizontal scrolling

    Participants 0
    Replies 198
    Last Activity 8 years, 5 months ago

    I guess its not  a big issue. It gives you a false sense of more content though.
    The biggest issue is in code view where it is nearly impossible to horizontally scroll.

    Reply

    gcrews

    Reply To: Remember view mode in Desktop

    Participants 0
    Replies 198
    Last Activity 8 years, 5 months ago

    If I'm not mistaken doesn't XmetaL 7 remember the view mode?

    http://forums.xmetal.com/index.php/topic,1898.msg5555.html#msg5555

    Now it just needs to open the last folder 🙂
    Is there any programmatic way to change the  folder it's open to?

    Reply

    gcrews

    Reply To: On_Application_Before_Document_Open

    Participants 0
    Replies 198
    Last Activity 8 years, 5 months ago

    It's the DITA specific operations that perform the open events. I think i found a better way to accomplish what i was trying to do.

    Reply

    gcrews

    Reply To: deploy toolkit customizations before first run

    Participants 0
    Replies 198
    Last Activity 8 years, 6 months ago

    Actually part of my customization update completely deletes the print_local.xml.  There are a number of changes and customization in the program files print_local.xml that need to deployed to all users from time to time.

    All our writers frequently generate output and want to see their rendered content.

    Reply

    gcrews

    Reply To: deploy toolkit customizations before first run

    Participants 0
    Replies 198
    Last Activity 8 years, 6 months ago

    Ah, now I kind of remember why I was not customizing the common folder.  I was trying to use the same customization scripts for initial install and any future updates. 

    How should customization updates to the toolkit be done after Xmetal has installed and after an output may have been generated?  I update things on a daily basis sometimes.

    Reply

    gcrews

    Reply To: deploy toolkit customizations before first run

    Participants 0
    Replies 198
    Last Activity 8 years, 6 months ago

    Looks like that will work. Thanks for the info. In the past I thought I had tried that but ran into some issue.

    Reply

Products
Downloads
Support