9 Replies Latest reply on Mar 4, 2011 7:41 AM by SidianConsulting

    Extension handler "type" attribute

    SidianConsulting Level 1

      Hey everyone,

       

      I'm writing my first CF Builder extension, which is just some text processing that will happen in the editor on selected text.  Easy enough so far.

       

      I just wanted to verify what the docs say about the "type" attribute of the handler tag in the ide_config.xml file:

       

      Type:

      Specifies the handler type.
      The handler type you can specify is "CFM"

       

      What this means is that my extension menu item doesn't show up when right clicking in the editor in ANY files but CFM files.  So if I want to process text in an HTML or PHP file, I'm pretty much out of luck.  This seems so short-sighted and ridiculous.  I hope I am wrong.

       

      Thanks,

      Andy

        • 1. Re: Extension handler "type" attribute
          cfjedimaster Level 3

          You are wrong. The type here has nothing to do with the type of

          file you can work with the navigator. It is the type of handler. Ie,

          when menu item X is executed, run this handler, and what type of

          handler is it. Right now CFB can only run CFM handlers files In the

          future that might change.

          • 2. Re: Extension handler "type" attribute
            SidianConsulting Level 1

            Okay, Ray.  I am glad I am wrong.  So, why doesn't my context menu appear when I right-click in the editor when I have a file other than a .cfm or .cfc open?

             

            Thanks,

            Andy

            • 3. Re: Extension handler "type" attribute
              cfjedimaster Level 3

              Can you share your ide_config.xml?

              • 4. Re: Extension handler "type" attribute
                SidianConsulting Level 1

                Sure, this extension is to basically add a few things I was used to in Homesite.

                 

                Here you go:

                 

                <application>
                    <name>Text Processor</name>
                    <author></author>
                    <version>1.0</version>
                    <email></email>
                    <menucontributions>
                        <contribution target="editor">
                            <menu name="Text Processor">                   
                                <action name="Convert to unordered list" handlerid="toUnorderedList">
                                    <dialog
                                    >
                                    </dialog>
                                </action>
                                <action name="Convert to ordered list" handlerid="toOrderedList">
                                    <dialog
                                    >
                                    </dialog>
                                </action>
                                <action name="Convert to uppercase" handlerid="toUpper">
                                    <dialog
                                    >
                                    </dialog>
                                </action>
                                <action name="Convert to lowercase" handlerid="toLower">
                                    <dialog
                                    >
                                    </dialog>
                                </action>
                                <action name="Strip HTML tags" handlerid="stripHTML">
                                    <dialog
                                    >
                                    </dialog>
                                </action>               
                                <action name="Format paragraphs" handlerid="formatParagraphs">
                                    <dialog
                                    >
                                    </dialog>
                                </action>               
                            </menu>       
                        </contribution>           
                    </menucontributions>
                    <handlers>
                        <handler id="toUnorderedList" type="cfm" filename="toUnorderedList.cfm" />
                        <handler id="toOrderedList" type="cfm" filename="toOrderedList.cfm" />
                        <handler id="toUpper" type="cfm" filename="toUpper.cfm" />
                        <handler id="toLower" type="cfm" filename="toLower.cfm" />
                        <handler id="stripHTML" type="cfm" filename="stripHTML.cfm" />       
                        <handler id="formatParagraphs" type="cfm" filename="formatParagraphs.cfm" />       
                    </handlers>
                </application>

                • 5. Re: Extension handler "type" attribute
                  SidianConsulting Level 1

                  One other thing, I downloaded CF Builder 2.0 Beta today and I tried my extension in there on files other than .cfm and .cfc and still no go.  My extension works correctly, so I assume this is expected behavior or there is some setting somewhere I am missing.  I went over the whole Extension section in the docs but I don't see anything that touches on this.

                  • 6. Re: Extension handler "type" attribute
                    cfjedimaster Level 3

                    Shoot - I'm sorry. I thought you were right clicking on files as in

                    the Navigator view, where it would work. But as to the editor, you are

                    right, I don't think you can do it in a non-CFM file, UNLESS you right

                    click/open the file in Navigator and select Open with and pick the

                    Builder editor. Give that a shot?

                    • 7. Re: Extension handler "type" attribute
                      SidianConsulting Level 1

                      Thanks Ray.  The solution is to right click any file, choose Open With > Other > Adobe CFML Editor.  Choosing "CF Builder HTML Editor" doesn't give you extension context menus in the editor, which ultimately tells us we need to use the "Adobe CFML Editor" to open all files in which one would want to use editor extension right-click context menus.  A bit unintuitive but overall it's logical.

                      • 8. Re: Extension handler "type" attribute
                        cfjedimaster Level 3

                        Coolio. Sorry so slow - in Scotland at a conference.

                        • 9. Re: Extension handler "type" attribute
                          SidianConsulting Level 1

                          No problem.  I actually answered a question related to this in another thread regarding files not opening in the editor they are "supposed to".

                           

                          For future reference for anyone who might run into this "extension problem", the solution would be to go to Window > Preferences > General > Editors > File Associations and associate php, htm, html and whatever other file extensions you want to be able to call up CF Builder context menu extensions in and change the editor to "Adobe CFML Editor" and set it as the default to open those specific file types.

                           

                          One thing I thought might be a caveat was if you change the editor that opens a file, for example .htm, to "Adobe CFML Editor", will that editor's profile apply to the .html file?  Apparently not as all the color coding and HTML editor-specific options still apply to the file, so this seems the best of both worlds.