Directory Studio
  1. Directory Studio
  2. DIRSTUDIO-447

Add the ability to use wildcards (?, *) in the ATs or OCs selection dialog to ease the search

    Details

      Description

      Add the ability to use wildcards (?, *) in the ATs or OCs selection dialog to ease the search

      1. DIRSTUDIO-447-mod2.patch
        4 kB
        Keheliya Gallaba
      2. ASF.LICENSE.NOT.GRANTED--DIRSTUDIO-447-mod.patch
        3 kB
        Keheliya Gallaba
      3. DIRSTUDIO-447.patch
        1 kB
        Keheliya Gallaba

        Activity

        Hide
        Stefan Seelmann added a comment -

        postponed

        Show
        Stefan Seelmann added a comment - postponed
        Hide
        Keheliya Gallaba added a comment -

        Adding the patch

        This enables the ability to use wildcards (?, *) in the ATs or OCs selection dialog to ease the search.

        Eg:
        sh?? will return 'ship', 'shut' but not 'shock'
        sh* will return 'shock' but not 'bash'
        *sh will return 'bash'
        sh will return 'bash', 'ship' or 'fisher'

        Show
        Keheliya Gallaba added a comment - Adding the patch This enables the ability to use wildcards (?, *) in the ATs or OCs selection dialog to ease the search. Eg: sh?? will return 'ship', 'shut' but not 'shock' sh* will return 'shock' but not 'bash' *sh will return 'bash' sh will return 'bash', 'ship' or 'fisher'
        Hide
        Stefan Seelmann added a comment -

        Thanks for the patch.

        I'm not the creator of this issues but I just want to give some quick feedback as Pierre-Arnaud is on vacations.

        Your patch is for the schema search view (and useful though): http://directory.apache.org/studio/static/users_guide/schema_editor/gettingstarted_views_search.html

        However I think Pierre-Arnaud created this issue to improve the dialogs for selection of object classes (OC) and attribute types (AT). They popup if you press the add buttons in the object class editor: http://directory.apache.org/studio/static/users_guide/schema_editor/gettingstarted_editors_object_class.html. The OC dialog pops up if you press the add button for the "Superior classes" field. The AT dialog pops up if you press the add button in the "Mandatory attributes" or "Optional attributes" section.

        It would be cool if you could provide a second patch

        Show
        Stefan Seelmann added a comment - Thanks for the patch. I'm not the creator of this issues but I just want to give some quick feedback as Pierre-Arnaud is on vacations. Your patch is for the schema search view (and useful though): http://directory.apache.org/studio/static/users_guide/schema_editor/gettingstarted_views_search.html However I think Pierre-Arnaud created this issue to improve the dialogs for selection of object classes (OC) and attribute types (AT). They popup if you press the add buttons in the object class editor: http://directory.apache.org/studio/static/users_guide/schema_editor/gettingstarted_editors_object_class.html . The OC dialog pops up if you press the add button for the "Superior classes" field. The AT dialog pops up if you press the add button in the "Mandatory attributes" or "Optional attributes" section. It would be cool if you could provide a second patch
        Hide
        Keheliya Gallaba added a comment -

        Thank you Seelmann for the feedback.
        I'll discuss in IRC to clarify the idea and come up with a second patch.

        Show
        Keheliya Gallaba added a comment - Thank you Seelmann for the feedback. I'll discuss in IRC to clarify the idea and come up with a second patch.
        Hide
        Keheliya Gallaba added a comment -

        Modified Patch Added.
        Wildcards (?, *) support in the ATs or OCs selection dialogs and schema search view.

        Show
        Keheliya Gallaba added a comment - Modified Patch Added. Wildcards (?, *) support in the ATs or OCs selection dialogs and schema search view.
        Hide
        Pierre-Arnaud Marcelot added a comment -

        Thanks Keheliya!

        I'll take some time to review these patches.

        Show
        Pierre-Arnaud Marcelot added a comment - Thanks Keheliya! I'll take some time to review these patches.
        Hide
        Pierre-Arnaud Marcelot added a comment -

        Hi Keheliya,

        A few comments on your patch.

        The fix on the SearchView is working good.

        However, the fix on the other ATs or OCs selection dialogs is not working as we would expect the dialog to behave.
        Everything works fine when using ? and * symbol, but we expect the list to remove item while typing and thus 'implicity' put a ".*" search pattern at the end of the regex.

        Here's an example:
        If I want to find the object class name "automount", I will start by typing the character 'a'.
        This expected behavior of the dialog is to display in the list all object classes starting with the character 'a' (even if I did ended my search with a '*').
        Then I'll type the character 'u', which will narrow down the list to only two elements "automount" and "automountMap".

        This is more ergonomic in the way that you're narrowing the list as long as you type and once you see the element you're interested in, you simply press the down key to select it.
        This is exactly what is done in Eclipse in the Class/Interface selection dialog and it's good to maintain the same concept in Studio for the user.

        I'm sure you weren't aware of this requirement at the time you wrote the patch.

        One more comment.
        At Directory, we are using specific rules for code formatting and your patch does not follow them.
        Especially, we replace every tab by 4 spaces in your case.
        I encourage you to load our code templates and code formatting files in your own Eclipse.
        These files are located here:
        http://svn.apache.org/repos/asf/directory/project/trunk/resources/codetemplates.xml
        http://svn.apache.org/repos/asf/directory/project/trunk/resources/formatting.xml

        One last thing.
        When you have multiple strings on the same line, strings that don't need to be translated and extracted in properties files, you should add as many "//$NON-NLS-X$" elements as strings you have.
        For example, instead of this:
        searchRegexp = searchText.replaceAll( "
        *", "\\\\S*" ); //$NON-NLS-1$
        you should have that:
        searchRegexp = searchText.replaceAll( "
        *", "\\\\S*" ); //$NON-NLS-1$ //$NON-NLS-2$

        Thanks

        Show
        Pierre-Arnaud Marcelot added a comment - Hi Keheliya, A few comments on your patch. The fix on the SearchView is working good. However, the fix on the other ATs or OCs selection dialogs is not working as we would expect the dialog to behave. Everything works fine when using ? and * symbol, but we expect the list to remove item while typing and thus 'implicity' put a ".*" search pattern at the end of the regex. Here's an example: If I want to find the object class name "automount", I will start by typing the character 'a'. This expected behavior of the dialog is to display in the list all object classes starting with the character 'a' (even if I did ended my search with a '*'). Then I'll type the character 'u', which will narrow down the list to only two elements "automount" and "automountMap". This is more ergonomic in the way that you're narrowing the list as long as you type and once you see the element you're interested in, you simply press the down key to select it. This is exactly what is done in Eclipse in the Class/Interface selection dialog and it's good to maintain the same concept in Studio for the user. I'm sure you weren't aware of this requirement at the time you wrote the patch. One more comment. At Directory, we are using specific rules for code formatting and your patch does not follow them. Especially, we replace every tab by 4 spaces in your case. I encourage you to load our code templates and code formatting files in your own Eclipse. These files are located here: http://svn.apache.org/repos/asf/directory/project/trunk/resources/codetemplates.xml http://svn.apache.org/repos/asf/directory/project/trunk/resources/formatting.xml One last thing. When you have multiple strings on the same line, strings that don't need to be translated and extracted in properties files, you should add as many "//$NON-NLS-X$" elements as strings you have. For example, instead of this: searchRegexp = searchText.replaceAll( " *", " \\\\S *" ); //$NON-NLS-1$ you should have that: searchRegexp = searchText.replaceAll( " *", " \\\\S *" ); //$NON-NLS-1$ //$NON-NLS-2$ Thanks
        Hide
        Keheliya Gallaba added a comment -

        Modified patch added.

        Fixed ATs or OCs selection dialogs searches to be more ergonomic and followed Apache Directory code formatting guidelines.

        Show
        Keheliya Gallaba added a comment - Modified patch added. Fixed ATs or OCs selection dialogs searches to be more ergonomic and followed Apache Directory code formatting guidelines.
        Hide
        Pierre-Arnaud Marcelot added a comment -

        Hi Keheliya,

        The dialogs are now working perfectly and the formatting of the patch is ok and following our standards.
        I'll push the modifications of your patch to trunk.

        Thanks for fixing this.

        Show
        Pierre-Arnaud Marcelot added a comment - Hi Keheliya, The dialogs are now working perfectly and the formatting of the patch is ok and following our standards. I'll push the modifications of your patch to trunk. Thanks for fixing this.
        Hide
        Pierre-Arnaud Marcelot added a comment -

        Fixed at revision 936652.

        Applied patch from Keheliya Gallaba.

        http://svn.apache.org/viewvc?rev=936652&view=rev

        Show
        Pierre-Arnaud Marcelot added a comment - Fixed at revision 936652. Applied patch from Keheliya Gallaba. http://svn.apache.org/viewvc?rev=936652&view=rev

          People

          • Assignee:
            Pierre-Arnaud Marcelot
            Reporter:
            Pierre-Arnaud Marcelot
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development