directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pierre-Arnaud Marcelot ...@marcelot.net>
Subject Re: [Studio] Switch the 'default' property value of the LDIF Editor extension to 'false'
Date Fri, 10 Dec 2010 16:00:59 GMT

On 10 déc. 2010, at 16:49, Kiran Ayyagari wrote:

> On Fri, Dec 10, 2010 at 5:28 PM, Pierre-Arnaud Marcelot <pa@marcelot.net> wrote:
>> Hi Dev,
>> I'm facing an interesting issue in the writing of the Apache DS 2.0
>> Configuration Editor.
>> As the ApacheDS' configuration is now based on an LDIF file, Studio's LDIF
>> Editor always show up when opening the 'config.ldif' file from disk.
>> This is due to the fact that the 'default' property value is set to 'true'
>> in the LDIF Editor extension definition.
>> It is defined as is in the following file, '[Studio
>> Checkout]/plugins/ldifeditor/plugin.xml':
>> 
>>   <extension
>>          point="org.eclipse.ui.editors">
>>     <editor
>>           class="org.apache.directory.studio.ldifeditor.editor.LdifEditor"
>> 
>> contributorClass="org.apache.directory.studio.ldifeditor.editor.LdifEditorContributor"
>> ======>   default="true"
>>           extensions="ldif, ldiflog"
>>           icon="resources/icons/ldifeditor.gif"
>>           id="%Editor_LdifEditor_id"
>>           name="%Editor_LdifEditor_name"/>
>>    </extension>
>> 
>> I'd like to pass this value to "false" in order to allow the ApacheDS 2.0
>> Configuration Editor to be opened specifically if the filename is
>> 'config.ldif'.
> hmm, this might confuse users who are connecting to other servers(and
> they have accidentally trying
> to open their custom ldif file named 'config.ldif' ).

Are there any other servers using 'config.ldif' as default configuration file?

If yes, I have the possibility to pre-scan the file and validate or invalidate the editor
for a particular given file (but this has to be as lightweight as possible, especially is
there are multiple editor candidates).
Or, we could also rename the file to 'adsconfig.ldif' to avoid name collisions.

> Can we have a "Open With" or something similar tab to open the config
> file with different editor?

This is already provided a standard functionality for file in the workspace (as in the Java
perspective), but not when you open a file from the 'File > Open...' menu item.
In that case, Eclipse goes through a list of editor candidates based on their extension definition
(supported extensions, supported filenames, priority) and tries to find the good one.

> P.S:- This open a custom editor if file name is 'config.ldif' reminds
> me of classing linux windowing
>         environments which sometimes *hard* to predict why they are
> crashing or behaving
>         differently. It turns out, that it is due to some casing of
> letter names of a file or other
>         but leave no clue to the user about what it is expecting.
> 
> -- 
> Kiran Ayyagari


Mime
View raw message