List Info

Thread: Re: Service names for css.ui.dialogs.XFilePicker / XFolderPicker implementation




Re: Service names for css.ui.dialogs.XFilePicker / XFolderPicker implementation
user name
2007-10-15 03:34:39
Hi Ariel,

Ariel Constenla-Haile wrote:
> Hello people,
> 
> I think this an issue (may be "type:defect,
component: api, 
> subcomponent: code [IDL source files]/ documentation
[Dev's Guide 
> 20.5.2.28]"):
> 
> as I said on a mail in extensions-dev
> [http://extensions.openoffice.org/servlet
s/ReadMsg?list=dev&msgNo=897],
> there are three service names you can use to implement
an XFilePicker or
> an XFolderPicker:
> 
> XFilePicker:
>          com.sun.star.ui.dialogs.FilePicker
>          com.sun.star.ui.dialogs.OfficeFilePicker
>          com.sun.star.ui.dialogs.SystemFilePicker
> XFolderPicker:
>          com.sun.star.ui.dialogs.FolderPicker
>          com.sun.star.ui.dialogs.OfficeFolderPicker
>          com.sun.star.ui.dialogs.SystemFolderPicker
> 
> 
> the difference is explained there on the mail (but just
covering the
> XFilePicker implementation asked by the developer).
FilePicker is the base service and the two others are
specializations of 
these FilePicker service (of course a IDL definition is
missing -> 
please file an issue).
I would say FilePicker can be seen more abstract and you
should either 
use the OfficeFilePicker or the SystemFilePicker. If you use
FilePicker 
it is not guaranteed which concrete one you get.

Anyway from an API point of view it should be regardless
which one you 
get but it seems that some implementations of the
SystemFilePicker 
doesn't support the service contract correct and break
existing 
solutions like yours.

I am sorry for that but that have to be addressed in the
Distro builds.


Juergen


> 
> I discovered this by "crash" and error
("crash" because Linux builds,
> made by distros, NOT by OOo, often broke my FilePickers
implementations),
> and by querying the SericeManager [1] every once in a
while.
> 
> Neither the API reference
> 
> http://api.openoffice.org/docs/
common/ref/com/sun/star/ui/dialogs/FilePicker.html 
> 
> 
> nor the new chapter of the Developer's Guide
> 
> http://api.openoffice.org/docs/
DevelopersGuide/GUI/GUI.xhtml#1_5_2_28_File_Picker 
> 
> 
> tell us about them.
> Making this services public to everyone on the API
reference (that's the
> first place where a developer looks(or should look) for
answers [2]),
> could help to prevent headaches to developers.
> 
> 
> Thanks,
> Ariel.
> 
> 
> 
> [1] Very simple:
> 
>     public static void main(String[] args){
>         XMultiComponentFactory xMCF = null;
>         XComponentContext xContext;
>         try {
>             xContext = Bootstrap.bootstrap();
>             xMCF = xContext.getServiceManager();
>             String[] servicesNames =
xMCF.getAvailableServiceNames();
>             java.util.Arrays.sort(servicesNames);
>             for (String name : servicesNames) {
>                 System.out.println(name);
>             }
>         } catch (BootstrapException ex) {
>             ex.printStackTrace();
>         } finally {
>             System.exit(0);
>         }
>     }
> 
> [2] Although
> 
> * the service names can be found searching OOo website
> [for example
> http://www.openoffice.org/servlets/ReadMsg?li
st=dev&msgNo=20474]
> 
> * and there is even an issue
> [http://api.openoffice.org/issues/show_bug.cgi?id=81581
] reported by an
> OOo Basic programmer about the OfficeFilePicker,
> 
> * and of course everyone in this mailing list may know
about them,
> 
> there is still a lack of "official"
documentation in the API reference 
> and the Dev's Guide.
> 
> 

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org


Re: Service names for css.ui.dialogs.XFilePicker / XFolderPicker implementation
user name
2007-10-15 10:22:22
Juergen Schmidt wrote:

> Hi Ariel,
> 
> Ariel Constenla-Haile wrote:
>> Hello people,
>> 
>> I think this an issue (may be "type:defect,
component: api, 
>> subcomponent: code [IDL source files]/
documentation [Dev's Guide 
>> 20.5.2.28]"):
>> 
>> as I said on a mail in extensions-dev
>> [http://extensions.openoffice.org/servlet
s/ReadMsg?list=dev&msgNo=897],
>> there are three service names you can use to
implement an XFilePicker or
>> an XFolderPicker:
>> 
>> XFilePicker:
>>          com.sun.star.ui.dialogs.FilePicker
>>          com.sun.star.ui.dialogs.OfficeFilePicker
>>          com.sun.star.ui.dialogs.SystemFilePicker
>> XFolderPicker:
>>          com.sun.star.ui.dialogs.FolderPicker
>>         
com.sun.star.ui.dialogs.OfficeFolderPicker
>>         
com.sun.star.ui.dialogs.SystemFolderPicker
>> 
>> 
>> the difference is explained there on the mail (but
just covering the
>> XFilePicker implementation asked by the
developer).
> FilePicker is the base service and the two others are
specializations of 
> these FilePicker service (of course a IDL definition is
missing -> 
> please file an issue).
> I would say FilePicker can be seen more abstract and
you should either 
> use the OfficeFilePicker or the SystemFilePicker. If
you use FilePicker 
> it is not guaranteed which concrete one you get.
> 
> Anyway from an API point of view it should be
regardless which one you 
> get but it seems that some implementations of the
SystemFilePicker 
> doesn't support the service contract correct and break
existing 
> solutions like yours.
> 
> I am sorry for that but that have to be addressed in
the Distro builds.

Are you sure? I think the system file picker implementations
for KDE and
Gnome are also part of "vanilla" OOo, they are
just not selected by
default. So if one of them does not correctly tell its
supported
services it must be fixed "upstream".

Ciao,
Mathias

-- 
Mathias Bauer (mba) - Project Lead OpenOffice.org Writer
OpenOffice.org Engineering at Sun: http://blogs.sun.com/Gu
llFOSS
Please don't reply to "nospamformbagmx.de".
I use it for the OOo lists and only rarely read other mails
sent to it.

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org


Re: Service names for css.ui.dialogs.XFilePicker / XFolderPicker implementation
user name
2007-10-17 10:14:22
Hi Jürgen,

Juergen Schmidt escribió:
> Hi Ariel,
> 
> Ariel Constenla-Haile wrote:
>> Hello people,
>>
>> I think this an issue (may be "type:defect,
component: api, 
>> subcomponent: code [IDL source files]/
documentation [Dev's Guide 
>> 20.5.2.28]"):
>>
>> as I said on a mail in extensions-dev
>> [http://extensions.openoffice.org/servlet
s/ReadMsg?list=dev&msgNo=897],
>> there are three service names you can use to
implement an XFilePicker or
>> an XFolderPicker:
>>
>> XFilePicker:
>>          com.sun.star.ui.dialogs.FilePicker
>>          com.sun.star.ui.dialogs.OfficeFilePicker
>>          com.sun.star.ui.dialogs.SystemFilePicker
>> XFolderPicker:
>>          com.sun.star.ui.dialogs.FolderPicker
>>         
com.sun.star.ui.dialogs.OfficeFolderPicker
>>         
com.sun.star.ui.dialogs.SystemFolderPicker
>>
>>
>> the difference is explained there on the mail (but
just covering the
>> XFilePicker implementation asked by the
developer).
> FilePicker is the base service and the two others are
specializations of 
> these FilePicker service (of course a IDL definition is
missing -> 
> please file an issue).

Done: issue 82722 http://www.openoffice.org/issues/show_bug.cgi?id=82722


> I would say FilePicker can be seen more abstract and
you should either 
> use the OfficeFilePicker or the SystemFilePicker. If
you use FilePicker 
> it is not guaranteed which concrete one you get.
> 
> Anyway from an API point of view it should be
regardless which one you 
> get but it seems that some implementations of the
SystemFilePicker 
> doesn't support the service contract correct and break
existing 
> solutions like yours.
> 
> I am sorry for that but that have to be addressed in
the Distro builds.
> 
> 
> Juergen

Well... I remember that I had crashes with a complex
implementation 
(different listeners for a FilePicker with image preview) on
Winndows XP 
using OOo build and "css.ui.dialogs.FilePicker" as
service name: the 
user was using the system dialogs, and listeners seemed to
be crashing 
OOo. So I decided to use ALWAYS
"css.ui.dialogs.OfficeFilePicker" as 
service name.

For my experience, it seems like complex manipulation fails
if you don't 
use OOo dialogs (OfficeFilePicker), and this even with OOo
builds, under 
Windows!


Bye and thanks,
Ariel.

> 
>>
>> I discovered this by "crash" and error
("crash" because Linux builds,
>> made by distros, NOT by OOo, often broke my
FilePickers implementations),
>> and by querying the SericeManager [1] every once in
a while.
>>
>> Neither the API reference
>>
>> http://api.openoffice.org/docs/
common/ref/com/sun/star/ui/dialogs/FilePicker.html 
>>
>>
>> nor the new chapter of the Developer's Guide
>>
>> http://api.openoffice.org/docs/
DevelopersGuide/GUI/GUI.xhtml#1_5_2_28_File_Picker 
>>
>>
>> tell us about them.
>> Making this services public to everyone on the API
reference (that's the
>> first place where a developer looks(or should look)
for answers [2]),
>> could help to prevent headaches to developers.
>>
>>
>> Thanks,
>> Ariel.
>>
>>
>>
>> [1] Very simple:
>>
>>     public static void main(String[] args){
>>         XMultiComponentFactory xMCF = null;
>>         XComponentContext xContext;
>>         try {
>>             xContext = Bootstrap.bootstrap();
>>             xMCF = xContext.getServiceManager();
>>             String[] servicesNames =
xMCF.getAvailableServiceNames();
>>             java.util.Arrays.sort(servicesNames);
>>             for (String name : servicesNames) {
>>                 System.out.println(name);
>>             }
>>         } catch (BootstrapException ex) {
>>             ex.printStackTrace();
>>         } finally {
>>             System.exit(0);
>>         }
>>     }
>>
>> [2] Although
>>
>> * the service names can be found searching OOo
website
>> [for example
>> http://www.openoffice.org/servlets/ReadMsg?li
st=dev&msgNo=20474]
>>
>> * and there is even an issue
>> [http://api.openoffice.org/issues/show_bug.cgi?id=81581
] reported by an
>> OOo Basic programmer about the OfficeFilePicker,
>>
>> * and of course everyone in this mailing list may
know about them,
>>
>> there is still a lack of "official"
documentation in the API reference 
>> and the Dev's Guide.
>>
>>

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org


[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )