loadcomponentfromurl

View: New views
14 Messages — Rating Filter:   Alert me  

loadcomponentfromurl

by Wei Min Teo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi,

 

I would like to specify a character encoding set to use when opening a file.

Using

 

ploadprops[0].Name = CharacterSet

ploadprops[0].Value <<= OUString::createFromAscii("UTF-8")

...

 

However, this still doesn't seem to work. I suspect that the string i've passed in is not valid.

How get i get a list of legitimate strings that characterset will take in for loadcomponentfromurl??

 

Thanks.

 

 

Cheers,

 

Wei Min
     
_________________________________________________________________
Windows 7: Simplify what you do everyday. Find the right PC for you.
http://windows.microsoft.com/shop

Re: loadcomponentfromurl

by Mikhail.Voytenko :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Wei Min,

Please try "UTF8" as the value.
Although I am not sure that all the filters check the property. Which
filter are you going to use?

Best regards,
Mikhail.

On 11/05/09 09:50, Wei Min Teo wrote:

> Hi,
>
>  
>
> I would like to specify a character encoding set to use when opening a file.
>
> Using
>
>  
>
> ploadprops[0].Name = CharacterSet
>
> ploadprops[0].Value <<= OUString::createFromAscii("UTF-8")
>
> ..
>
>  
>
> However, this still doesn't seem to work. I suspect that the string i've passed in is not valid.
>
> How get i get a list of legitimate strings that characterset will take in for loadcomponentfromurl??
>
>  
>
> Thanks.
>
>  
>
>  
>
> Cheers,
>
>  
>
> Wei Min
>      
> _________________________________________________________________
> Windows 7: Simplify what you do everyday. Find the right PC for you.
> http://windows.microsoft.com/shop
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


RE: loadcomponentfromurl

by Wei Min Teo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi,

 

I'm not going to use any filters or perhaps it automatically uses a default filter. Anyway, to clarify, I think my problem occurs with opening *.doc or *.ppt files. When I open it prompts me on which character encoding i want to use. This would "hang" an automation program. Thus, I thought I could pass in the character encoding set for it to open by using ChracterSet UTF8 in the media descriptor. However, this didn't work even with "UTF8". Do I have to use this with some filter implementation? If so, how can i do that?

 

Or perhaps I need to implement an exceptionhandler for this case?

 

Thanks.

 

Cheers,

 

Wei Min
 

> Date: Thu, 5 Nov 2009 12:49:04 +0100
> From: Mikhail.Voytenko@...
> To: dev@...
> Subject: Re: [api-dev] loadcomponentfromurl
>
> Hi Wei Min,
>
> Please try "UTF8" as the value.
> Although I am not sure that all the filters check the property. Which
> filter are you going to use?
>
> Best regards,
> Mikhail.
>
> On 11/05/09 09:50, Wei Min Teo wrote:
> > Hi,
> >
> >
> >
> > I would like to specify a character encoding set to use when opening a file.
> >
> > Using
> >
> >
> >
> > ploadprops[0].Name = CharacterSet
> >
> > ploadprops[0].Value <<= OUString::createFromAscii("UTF-8")
> >
> > ..
> >
> >
> >
> > However, this still doesn't seem to work. I suspect that the string i've passed in is not valid.
> >
> > How get i get a list of legitimate strings that characterset will take in for loadcomponentfromurl??
> >
> >
> >
> > Thanks.
> >
> >
> >
> >
> >
> > Cheers,
> >
> >
> >
> > Wei Min
> >
> > _________________________________________________________________
> > Windows 7: Simplify what you do everyday. Find the right PC for you.
> > http://windows.microsoft.com/shop
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@...
> For additional commands, e-mail: dev-help@...
>
     
_________________________________________________________________
New Windows 7: Simplify what you do everyday. Find the right PC for you.
http://windows.microsoft.com/shop

Re: loadcomponentfromurl

by Ariel Constenla-Haile :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Wei,

On Thursday 05 November 2009, 22:51, Wei Min Teo wrote:
> I'm not going to use any filters or perhaps it automatically uses a default
>  filter. Anyway, to clarify, I think my problem occurs with opening *.doc
>  or *.ppt files. When I open it prompts me on which character encoding i
>  want to use. This would "hang" an automation program.

this sounds like the Writer encoding text dialog, that shows up for example
when you try to open with OOo an unkown file format (by default is treated as
text, and you are prompted to select the encoding, etc.)

Aren't you passing a filter name?

>  Thus, I thought I
>  could pass in the character encoding set for it to open by using
>  ChracterSet UTF8 in the media descriptor. However, this didn't work even
>  with "UTF8". Do I have to use this with some filter implementation? If so,
>  how can i do that?


Regards
--
Ariel Constenla-Haile
La Plata, Argentina

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


Re: loadcomponentfromurl

by Juergen Schmidt-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ariel Constenla-Haile wrote:

> Hello Wei,
>
> On Thursday 05 November 2009, 22:51, Wei Min Teo wrote:
>> I'm not going to use any filters or perhaps it automatically uses a default
>>  filter. Anyway, to clarify, I think my problem occurs with opening *.doc
>>  or *.ppt files. When I open it prompts me on which character encoding i
>>  want to use. This would "hang" an automation program.
>
> this sounds like the Writer encoding text dialog, that shows up for example
> when you try to open with OOo an unkown file format (by default is treated as
> text, and you are prompted to select the encoding, etc.)
>
> Aren't you passing a filter name?

even if he doesn't use a filter name, the type detection should work
well for .doc and .ppt files. Sounds strange.

Juergen

>
>>  Thus, I thought I
>>  could pass in the character encoding set for it to open by using
>>  ChracterSet UTF8 in the media descriptor. However, this didn't work even
>>  with "UTF8". Do I have to use this with some filter implementation? If so,
>>  how can i do that?
>
>
> Regards


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


Re: loadcomponentfromurl

by Mikhail.Voytenko :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

On 11/06/09 08:50, Juergen Schmidt wrote:

> Ariel Constenla-Haile wrote:
>> Hello Wei,
>>
>> On Thursday 05 November 2009, 22:51, Wei Min Teo wrote:
>>> I'm not going to use any filters or perhaps it automatically uses a
>>> default
>>>  filter. Anyway, to clarify, I think my problem occurs with opening
>>> *.doc
>>>  or *.ppt files. When I open it prompts me on which character encoding i
>>>  want to use. This would "hang" an automation program.
>>
>> this sounds like the Writer encoding text dialog, that shows up for
>> example when you try to open with OOo an unkown file format (by
>> default is treated as text, and you are prompted to select the
>> encoding, etc.)
>>
>> Aren't you passing a filter name?
>
> even if he doesn't use a filter name, the type detection should work
> well for .doc and .ppt files. Sounds strange.

The type detection works well and the correct filter is detected as I
understand. The problem here, is that the mentioned filters need
character encoding, thus the FilterOptions dialog ( not "Unknown file
format" dialog ) is shown.

Generally speaking, a filter that gets no filter options should check
the CharacterSet property from the MediaDescriptor. Unfortunately it
does not happen in this case. For me it looks like a missing feature, I
would suggest to submit an enhancement issue for each filter that does
not support the property currently.

The only workaround, that I see for now, is to make the type detection
explicitly to get the required filter name. And based on the filter name
provide the filter options in the format the filter requires it. The
problem here is that there seems to be no documentation regarding filter
options format for each filter. Thus you would probably have to ask on
the applications-related lists regarding each filter ( for example on
dev@... regarding writer filters ).

Best regards,
Mikhail.

>
> Juergen
>
>>
>>>  Thus, I thought I
>>>  could pass in the character encoding set for it to open by using
>>>  ChracterSet UTF8 in the media descriptor. However, this didn't work
>>> even
>>>  with "UTF8". Do I have to use this with some filter implementation?
>>> If so,
>>>  how can i do that?
>>
>>
>> Regards
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@...
> For additional commands, e-mail: dev-help@...
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


Re: loadcomponentfromurl

by Juergen Schmidt-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Mikhail Voytenko wrote:

> Hi,
>
> On 11/06/09 08:50, Juergen Schmidt wrote:
>> Ariel Constenla-Haile wrote:
>>> Hello Wei,
>>>
>>> On Thursday 05 November 2009, 22:51, Wei Min Teo wrote:
>>>> I'm not going to use any filters or perhaps it automatically uses a
>>>> default
>>>>  filter. Anyway, to clarify, I think my problem occurs with opening
>>>> *.doc
>>>>  or *.ppt files. When I open it prompts me on which character
>>>> encoding i
>>>>  want to use. This would "hang" an automation program.
>>>
>>> this sounds like the Writer encoding text dialog, that shows up for
>>> example when you try to open with OOo an unkown file format (by
>>> default is treated as text, and you are prompted to select the
>>> encoding, etc.)
>>>
>>> Aren't you passing a filter name?
>>
>> even if he doesn't use a filter name, the type detection should work
>> well for .doc and .ppt files. Sounds strange.
>
> The type detection works well and the correct filter is detected as I
> understand. The problem here, is that the mentioned filters need
> character encoding, thus the FilterOptions dialog ( not "Unknown file
> format" dialog ) is shown.
>
i don't think so. A valid .doc file is auto detected and the word filter
doesn't have a filter options dialog as far as i know. It looks more
like the scenario that Ariel has described.

Maybe a complete code snippet could help to understand ...

Juergen


> Generally speaking, a filter that gets no filter options should check
> the CharacterSet property from the MediaDescriptor. Unfortunately it
> does not happen in this case. For me it looks like a missing feature, I
> would suggest to submit an enhancement issue for each filter that does
> not support the property currently.
>
> The only workaround, that I see for now, is to make the type detection
> explicitly to get the required filter name. And based on the filter name
> provide the filter options in the format the filter requires it. The
> problem here is that there seems to be no documentation regarding filter
> options format for each filter. Thus you would probably have to ask on
> the applications-related lists regarding each filter ( for example on
> dev@... regarding writer filters ).
>
> Best regards,
> Mikhail.
>
>>
>> Juergen
>>
>>>
>>>>  Thus, I thought I
>>>>  could pass in the character encoding set for it to open by using
>>>>  ChracterSet UTF8 in the media descriptor. However, this didn't work
>>>> even
>>>>  with "UTF8". Do I have to use this with some filter implementation?
>>>> If so,
>>>>  how can i do that?
>>>
>>>
>>> Regards
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@...
>> For additional commands, e-mail: dev-help@...
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@...
> For additional commands, e-mail: dev-help@...
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


Re: loadcomponentfromurl

by Bernard Marcelly :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Message de Wei Min Teo  date 2009-11-06 02:51 :
> Hi,
>
>  
>
> I'm not going to use any filters or perhaps it automatically uses a default filter.
> Anyway, to clarify, I think my problem occurs with opening *.doc or *.ppt files.
> When I open it prompts me on which character encoding i want to use.

It means these are not real .doc or .ppt files.
Microsoft sometimes creates simple (not formatted) text files as .doc
Probably it uses Windows encoding ( e.g. Windows 1252 for European text).
Open those files with user interface, you will be requested an encoding. If you
can't find a correct one, how could you find it by program?

Another case is when a file is corrupted : no solution here.

Regards
  Bernard


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


Re: loadcomponentfromurl

by Mikhail.Voytenko :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

On 11/06/09 10:26, Juergen Schmidt wrote:

> Mikhail Voytenko wrote:
>> Hi,
>>
>> On 11/06/09 08:50, Juergen Schmidt wrote:
>>> Ariel Constenla-Haile wrote:
>>>> Hello Wei,
>>>>
>>>> On Thursday 05 November 2009, 22:51, Wei Min Teo wrote:
>>>>> I'm not going to use any filters or perhaps it automatically uses a
>>>>> default
>>>>>  filter. Anyway, to clarify, I think my problem occurs with opening
>>>>> *.doc
>>>>>  or *.ppt files. When I open it prompts me on which character
>>>>> encoding i
>>>>>  want to use. This would "hang" an automation program.
>>>>
>>>> this sounds like the Writer encoding text dialog, that shows up for
>>>> example when you try to open with OOo an unkown file format (by
>>>> default is treated as text, and you are prompted to select the
>>>> encoding, etc.)
>>>>
>>>> Aren't you passing a filter name?
>>>
>>> even if he doesn't use a filter name, the type detection should work
>>> well for .doc and .ppt files. Sounds strange.
>>
>> The type detection works well and the correct filter is detected as I
>> understand. The problem here, is that the mentioned filters need
>> character encoding, thus the FilterOptions dialog ( not "Unknown file
>> format" dialog ) is shown.
>>
> i don't think so. A valid .doc file is auto detected and the word filter
> doesn't have a filter options dialog as far as i know. It looks more
> like the scenario that Ariel has described.

Sorry, I was wrong in my last comment.
Indeed the text filter still wins sometimes by unknown formats, although
actually the filter selection dialog should be shown. And MSWord filter
  has no filter options dialog.

>
> Maybe a complete code snippet could help to understand ...

It is probably more interesting to take a look to the document. I
suspect that Bernard is right and the document is no valid .doc document.

Best regards,
Mikhail.

>
> Juergen
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


RE: loadcomponentfromurl

by Wei Min Teo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi all,

 

Thanks for your responses.

 

Let's assume that indeed those files are not "legitimate" .doc files. If someone creates a text file and renames it as .doc, the Writer encoding text dialog will pop out a UI. If I do choose a encoding such as UTF-8, it will be able to open the text file with no problems and the text will be readable. This is what i want to do programatically, to open with a specified encoding without using the pop-out UI.

 

Is it possible to do this?

 

 

 

Cheers,

 

Wei Min
 

> Date: Fri, 6 Nov 2009 12:10:58 +0100
> From: Mikhail.Voytenko@...
> To: dev@...
> Subject: Re: [api-dev] loadcomponentfromurl
>
> Hi,
>
> On 11/06/09 10:26, Juergen Schmidt wrote:
> > Mikhail Voytenko wrote:
> >> Hi,
> >>
> >> On 11/06/09 08:50, Juergen Schmidt wrote:
> >>> Ariel Constenla-Haile wrote:
> >>>> Hello Wei,
> >>>>
> >>>> On Thursday 05 November 2009, 22:51, Wei Min Teo wrote:
> >>>>> I'm not going to use any filters or perhaps it automatically uses a
> >>>>> default
> >>>>> filter. Anyway, to clarify, I think my problem occurs with opening
> >>>>> *.doc
> >>>>> or *.ppt files. When I open it prompts me on which character
> >>>>> encoding i
> >>>>> want to use. This would "hang" an automation program.
> >>>>
> >>>> this sounds like the Writer encoding text dialog, that shows up for
> >>>> example when you try to open with OOo an unkown file format (by
> >>>> default is treated as text, and you are prompted to select the
> >>>> encoding, etc.)
> >>>>
> >>>> Aren't you passing a filter name?
> >>>
> >>> even if he doesn't use a filter name, the type detection should work
> >>> well for .doc and .ppt files. Sounds strange.
> >>
> >> The type detection works well and the correct filter is detected as I
> >> understand. The problem here, is that the mentioned filters need
> >> character encoding, thus the FilterOptions dialog ( not "Unknown file
> >> format" dialog ) is shown.
> >>
> > i don't think so. A valid .doc file is auto detected and the word filter
> > doesn't have a filter options dialog as far as i know. It looks more
> > like the scenario that Ariel has described.
>
> Sorry, I was wrong in my last comment.
> Indeed the text filter still wins sometimes by unknown formats, although
> actually the filter selection dialog should be shown. And MSWord filter
> has no filter options dialog.
>
> >
> > Maybe a complete code snippet could help to understand ...
>
> It is probably more interesting to take a look to the document. I
> suspect that Bernard is right and the document is no valid .doc document.
>
> Best regards,
> Mikhail.
>
> >
> > Juergen
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@...
> For additional commands, e-mail: dev-help@...
>
     
_________________________________________________________________
Windows 7: Simplify what you do everyday. Find the right PC for you.
http://windows.microsoft.com/shop

Re: loadcomponentfromurl

by Mikhail.Voytenko :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Wei Min,

As I have written in one of the previous emails, I would suggest to make
the type detection explicitly to get the required filter name. And in
case you get "Text (encoded)" filter, please add the filter options
containing the encoding.

The problem with filter options is that there seems to be no
documentation regarding them. According to source-code the following
property in the MediaDescriptor might work in case of "Text (encoded)"
filter.
Prop.Name = "FilterOptions"
Prop.Value <<= "UTF8"

Before you start with the TypeDetection usage, please try just to add
the filter options property in MediaDescriptor and try it with the
problematic documents. Just to be sure that the options are accepted in
this format.

Best regards,
Mikhail.

On 11/09/09 03:09, Wei Min Teo wrote:

> Hi all,
>
>  
>
> Thanks for your responses.
>
>  
>
> Let's assume that indeed those files are not "legitimate" .doc files. If someone creates a text file and renames it as .doc, the Writer encoding text dialog will pop out a UI. If I do choose a encoding such as UTF-8, it will be able to open the text file with no problems and the text will be readable. This is what i want to do programatically, to open with a specified encoding without using the pop-out UI.
>
>  
>
> Is it possible to do this?
>
>  
>
>  
>
>  
>
> Cheers,
>
>  
>
> Wei Min
>  
>> Date: Fri, 6 Nov 2009 12:10:58 +0100
>> From: Mikhail.Voytenko@...
>> To: dev@...
>> Subject: Re: [api-dev] loadcomponentfromurl
>>
>> Hi,
>>
>> On 11/06/09 10:26, Juergen Schmidt wrote:
>>> Mikhail Voytenko wrote:
>>>> Hi,
>>>>
>>>> On 11/06/09 08:50, Juergen Schmidt wrote:
>>>>> Ariel Constenla-Haile wrote:
>>>>>> Hello Wei,
>>>>>>
>>>>>> On Thursday 05 November 2009, 22:51, Wei Min Teo wrote:
>>>>>>> I'm not going to use any filters or perhaps it automatically uses a
>>>>>>> default
>>>>>>> filter. Anyway, to clarify, I think my problem occurs with opening
>>>>>>> *.doc
>>>>>>> or *.ppt files. When I open it prompts me on which character
>>>>>>> encoding i
>>>>>>> want to use. This would "hang" an automation program.
>>>>>> this sounds like the Writer encoding text dialog, that shows up for
>>>>>> example when you try to open with OOo an unkown file format (by
>>>>>> default is treated as text, and you are prompted to select the
>>>>>> encoding, etc.)
>>>>>>
>>>>>> Aren't you passing a filter name?
>>>>> even if he doesn't use a filter name, the type detection should work
>>>>> well for .doc and .ppt files. Sounds strange.
>>>> The type detection works well and the correct filter is detected as I
>>>> understand. The problem here, is that the mentioned filters need
>>>> character encoding, thus the FilterOptions dialog ( not "Unknown file
>>>> format" dialog ) is shown.
>>>>
>>> i don't think so. A valid .doc file is auto detected and the word filter
>>> doesn't have a filter options dialog as far as i know. It looks more
>>> like the scenario that Ariel has described.
>> Sorry, I was wrong in my last comment.
>> Indeed the text filter still wins sometimes by unknown formats, although
>> actually the filter selection dialog should be shown. And MSWord filter
>> has no filter options dialog.
>>
>>> Maybe a complete code snippet could help to understand ...
>> It is probably more interesting to take a look to the document. I
>> suspect that Bernard is right and the document is no valid .doc document.
>>
>> Best regards,
>> Mikhail.
>>
>>> Juergen
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@...
>> For additional commands, e-mail: dev-help@...
>>
>      
> _________________________________________________________________
> Windows 7: Simplify what you do everyday. Find the right PC for you.
> http://windows.microsoft.com/shop
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


Re: loadcomponentfromurl

by Juergen Schmidt-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Mikhail is right, an important piece of documentation is missing here
and i renew my request that we document filter specific settings
somewhere. A wiki page showing the names that have to be used via API
and all filter specific settings. These settings depends on the filter
implementation and should be documented for each filter.

Today we have only a list of filter names somewhere in the framework
wiki section.

Juergen

Mikhail Voytenko wrote:

> Hi Wei Min,
>
> As I have written in one of the previous emails, I would suggest to make
> the type detection explicitly to get the required filter name. And in
> case you get "Text (encoded)" filter, please add the filter options
> containing the encoding.
>
> The problem with filter options is that there seems to be no
> documentation regarding them. According to source-code the following
> property in the MediaDescriptor might work in case of "Text (encoded)"
> filter.
> Prop.Name = "FilterOptions"
> Prop.Value <<= "UTF8"
>
> Before you start with the TypeDetection usage, please try just to add
> the filter options property in MediaDescriptor and try it with the
> problematic documents. Just to be sure that the options are accepted in
> this format.
>
> Best regards,
> Mikhail.
>
> On 11/09/09 03:09, Wei Min Teo wrote:
>> Hi all,
>>
>>  
>>
>> Thanks for your responses.
>>
>>  
>>
>> Let's assume that indeed those files are not "legitimate" .doc files. If someone creates a text file and renames it as .doc, the Writer encoding text dialog will pop out a UI. If I do choose a encoding such as UTF-8, it will be able to open the text file with no problems and the text will be readable. This is what i want to do programatically, to open with a specified encoding without using the pop-out UI.
>>
>>  
>>
>> Is it possible to do this?
>>
>>  
>>
>>  
>>
>>  
>>
>> Cheers,
>>
>>  
>>
>> Wei Min
>>  
>>> Date: Fri, 6 Nov 2009 12:10:58 +0100
>>> From: Mikhail.Voytenko@...
>>> To: dev@...
>>> Subject: Re: [api-dev] loadcomponentfromurl
>>>
>>> Hi,
>>>
>>> On 11/06/09 10:26, Juergen Schmidt wrote:
>>>> Mikhail Voytenko wrote:
>>>>> Hi,
>>>>>
>>>>> On 11/06/09 08:50, Juergen Schmidt wrote:
>>>>>> Ariel Constenla-Haile wrote:
>>>>>>> Hello Wei,
>>>>>>>
>>>>>>> On Thursday 05 November 2009, 22:51, Wei Min Teo wrote:
>>>>>>>> I'm not going to use any filters or perhaps it automatically uses a
>>>>>>>> default
>>>>>>>> filter. Anyway, to clarify, I think my problem occurs with opening
>>>>>>>> *.doc
>>>>>>>> or *.ppt files. When I open it prompts me on which character
>>>>>>>> encoding i
>>>>>>>> want to use. This would "hang" an automation program.
>>>>>>> this sounds like the Writer encoding text dialog, that shows up for
>>>>>>> example when you try to open with OOo an unkown file format (by
>>>>>>> default is treated as text, and you are prompted to select the
>>>>>>> encoding, etc.)
>>>>>>>
>>>>>>> Aren't you passing a filter name?
>>>>>> even if he doesn't use a filter name, the type detection should work
>>>>>> well for .doc and .ppt files. Sounds strange.
>>>>> The type detection works well and the correct filter is detected as I
>>>>> understand. The problem here, is that the mentioned filters need
>>>>> character encoding, thus the FilterOptions dialog ( not "Unknown file
>>>>> format" dialog ) is shown.
>>>>>
>>>> i don't think so. A valid .doc file is auto detected and the word filter
>>>> doesn't have a filter options dialog as far as i know. It looks more
>>>> like the scenario that Ariel has described.
>>> Sorry, I was wrong in my last comment.
>>> Indeed the text filter still wins sometimes by unknown formats, although
>>> actually the filter selection dialog should be shown. And MSWord filter
>>> has no filter options dialog.
>>>
>>>> Maybe a complete code snippet could help to understand ...
>>> It is probably more interesting to take a look to the document. I
>>> suspect that Bernard is right and the document is no valid .doc document.
>>>
>>> Best regards,
>>> Mikhail.
>>>
>>>> Juergen
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@...
>>> For additional commands, e-mail: dev-help@...
>>>
>>      
>> _________________________________________________________________
>> Windows 7: Simplify what you do everyday. Find the right PC for you.
>> http://windows.microsoft.com/shop
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@...
> For additional commands, e-mail: dev-help@...
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


RE: loadcomponentfromurl

by Wei Min Teo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi,

 

I've created a text file, renamed the extension to odt and tried using filteroptions. It is unable to open the file. However, if i select this option via the text encoding dialog UI, it is able to display the text.

 
> > Prop.Name = "FilterOptions"
> > Prop.Value <<= "UTF8"
 

I've yet to try the type detection, will further update after i figure it out.

Thanks.

 

Cheers,

Wei Min
 

> Date: Mon, 9 Nov 2009 10:14:56 +0100
> From: Juergen.Schmidt@...
> To: dev@...
> Subject: Re: [api-dev] loadcomponentfromurl
>
> Mikhail is right, an important piece of documentation is missing here
> and i renew my request that we document filter specific settings
> somewhere. A wiki page showing the names that have to be used via API
> and all filter specific settings. These settings depends on the filter
> implementation and should be documented for each filter.
>
> Today we have only a list of filter names somewhere in the framework
> wiki section.
>
> Juergen
>
> Mikhail Voytenko wrote:
> > Hi Wei Min,
> >
> > As I have written in one of the previous emails, I would suggest to make
> > the type detection explicitly to get the required filter name. And in
> > case you get "Text (encoded)" filter, please add the filter options
> > containing the encoding.
> >
> > The problem with filter options is that there seems to be no
> > documentation regarding them. According to source-code the following
> > property in the MediaDescriptor might work in case of "Text (encoded)"
> > filter.
> > Prop.Name = "FilterOptions"
> > Prop.Value <<= "UTF8"
> >
> > Before you start with the TypeDetection usage, please try just to add
> > the filter options property in MediaDescriptor and try it with the
> > problematic documents. Just to be sure that the options are accepted in
> > this format.
> >
> > Best regards,
> > Mikhail.
> >
> > On 11/09/09 03:09, Wei Min Teo wrote:
> >> Hi all,
> >>
> >>
> >>
> >> Thanks for your responses.
> >>
> >>
> >>
> >> Let's assume that indeed those files are not "legitimate" .doc files. If someone creates a text file and renames it as .doc, the Writer encoding text dialog will pop out a UI. If I do choose a encoding such as UTF-8, it will be able to open the text file with no problems and the text will be readable. This is what i want to do programatically, to open with a specified encoding without using the pop-out UI.
> >>
> >>
> >>
> >> Is it possible to do this?
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> Cheers,
> >>
> >>
> >>
> >> Wei Min
> >>
> >>> Date: Fri, 6 Nov 2009 12:10:58 +0100
> >>> From: Mikhail.Voytenko@...
> >>> To: dev@...
> >>> Subject: Re: [api-dev] loadcomponentfromurl
> >>>
> >>> Hi,
> >>>
> >>> On 11/06/09 10:26, Juergen Schmidt wrote:
> >>>> Mikhail Voytenko wrote:
> >>>>> Hi,
> >>>>>
> >>>>> On 11/06/09 08:50, Juergen Schmidt wrote:
> >>>>>> Ariel Constenla-Haile wrote:
> >>>>>>> Hello Wei,
> >>>>>>>
> >>>>>>> On Thursday 05 November 2009, 22:51, Wei Min Teo wrote:
> >>>>>>>> I'm not going to use any filters or perhaps it automatically uses a
> >>>>>>>> default
> >>>>>>>> filter. Anyway, to clarify, I think my problem occurs with opening
> >>>>>>>> *.doc
> >>>>>>>> or *.ppt files. When I open it prompts me on which character
> >>>>>>>> encoding i
> >>>>>>>> want to use. This would "hang" an automation program.
> >>>>>>> this sounds like the Writer encoding text dialog, that shows up for
> >>>>>>> example when you try to open with OOo an unkown file format (by
> >>>>>>> default is treated as text, and you are prompted to select the
> >>>>>>> encoding, etc.)
> >>>>>>>
> >>>>>>> Aren't you passing a filter name?
> >>>>>> even if he doesn't use a filter name, the type detection should work
> >>>>>> well for .doc and .ppt files. Sounds strange.
> >>>>> The type detection works well and the correct filter is detected as I
> >>>>> understand. The problem here, is that the mentioned filters need
> >>>>> character encoding, thus the FilterOptions dialog ( not "Unknown file
> >>>>> format" dialog ) is shown.
> >>>>>
> >>>> i don't think so. A valid .doc file is auto detected and the word filter
> >>>> doesn't have a filter options dialog as far as i know. It looks more
> >>>> like the scenario that Ariel has described.
> >>> Sorry, I was wrong in my last comment.
> >>> Indeed the text filter still wins sometimes by unknown formats, although
> >>> actually the filter selection dialog should be shown. And MSWord filter
> >>> has no filter options dialog.
> >>>
> >>>> Maybe a complete code snippet could help to understand ...
> >>> It is probably more interesting to take a look to the document. I
> >>> suspect that Bernard is right and the document is no valid .doc document.
> >>>
> >>> Best regards,
> >>> Mikhail.
> >>>
> >>>> Juergen
> >>>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: dev-unsubscribe@...
> >>> For additional commands, e-mail: dev-help@...
> >>>
> >>
> >> _________________________________________________________________
> >> Windows 7: Simplify what you do everyday. Find the right PC for you.
> >> http://windows.microsoft.com/shop
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@...
> > For additional commands, e-mail: dev-help@...
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@...
> For additional commands, e-mail: dev-help@...
>
     
_________________________________________________________________
New Windows 7: Find the right PC for you. Learn more.
http://windows.microsoft.com/shop

Re: loadcomponentfromurl

by Bernard Marcelly :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
You must also specify the filter name...

props(0).Name = "FilterName"
props(0).Value = "Text (encoded)"
props(1).Name = "FilterOptions"
props(1).Value = "UTF8"

Regards
  Bernard

Message de Wei Min Teo  date 2009-11-16 07:34 :

> Hi,
>
>  
>
> I've created a text file, renamed the extension to odt and tried using filteroptions. It is unable to open the file. However, if i select this option via the text encoding dialog UI, it is able to display the text.
>
>  
>>> Prop.Name = "FilterOptions"
>>> Prop.Value <<= "UTF8"
>  
>
> I've yet to try the type detection, will further update after i figure it out.
>
> Thanks.
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...