Issue 101274 - A directory on command line is silently ignored
A directory on command line is silently ignored
Status: CONFIRMED
Product: ucb
Classification: Code
Component: code
DEV300m46
PC (x86_64) All
: P5 (lowest) Trivial (vote)
: 3.x
Assigned To: mikhail.voytenko
:
Depends on:
Blocks: 90439
  Show dependency treegraph
 
Reported: 2009-04-22 14:24 UTC by dtardon
Modified: 2013-01-29 21:53 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
show a message when trying to open a directory like a document (5.70 KB, patch)
2009-04-22 14:26 UTC, dtardon
no flags Details | Diff
update patch for 3.3 (5.84 KB, patch)
2010-07-13 11:08 UTC, caolanm
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description dtardon 2009-04-22 14:24:12 UTC
There could be some warning about the fact one is trying to open a directory as
it's probably a mistake.

Reproducible by:

mkdir a-dir
oowriter a-dir

opens a new document.

oowriter a-dir some-doc.odt

opens some-doc.odt.
Comment 1 dtardon 2009-04-22 14:26:55 UTC
Created attachment 61729 [details]
show a message when trying to open a directory like a document
Comment 2 Frank Schönheit 2009-04-22 19:43:54 UTC
fs->dtardon: Thanks for contributing to OOo! However, I am in no way involved
into the code you touched here, sorry. I'll pass the issue to Kai Sommerfeld,
who I think has a better idea of who is responsible for this code.
Comment 3 dtardon 2009-04-22 20:06:12 UTC
Oops, I picked wrong component.... What I wanted was ucb.
Comment 4 kai.sommerfeld 2009-04-24 08:55:38 UTC
dtardon: Thanks for the patch. You integrated the new functionality (to display
the error box) in ucbhelper. I'm not sure whether this is the best approach. I
think, the actual problem is, that the framework code that uses ucbhelper to
load documents, does not react appropriately in case it tries to load a URL that
actually points to a folder. IIRC, ucb -> ucbhelper throws an exception in this
case or uses an interaction handler to display an error (if an interaction
handler is present and able to handle this certain interaction request). IMO,
the best approach would be to fix the framework code.

OTOH, fixing this in ucbhelper only has effect for ucb clients using ucb via
ucbhelper C++ API, not for ucb clients using ucb UNO API directly. Thus, if we
decide that the right place for a fix is not framework, it would be
ucb/source/ucp/*.

mav: What do you think abot this?
Comment 5 dtardon 2009-04-24 09:34:19 UTC
dtardon->kso:
> IIRC, ucb -> ucbhelper throws an exception in this
> case or uses an interaction handler to display an error (if an interaction
> handler is present and able to handle this certain interaction request). IMO,
> the best approach would be to fix the framework code.

I actually thought about it that way (i.e. do the concerned handling at
framework level) and even sketched some code, but then decided to do it in
ucbhelper. Looks I was wrong, then :(

> OTOH, fixing this in ucbhelper only has effect for ucb clients using ucb via
> ucbhelper C++ API, not for ucb clients using ucb UNO API directly. Thus, if we
> decide that the right place for a fix is not framework, it would be
> ucb/source/ucp/*.

That will be valid concern, I think. I overlooked that.

I'll give it another try.
Comment 6 mikhail.voytenko 2009-04-24 09:35:16 UTC
I would completely agree the error should be either reported in UCB in case the
standard InteractionHandler is provided, or in framework if there is no
InteractionHandler or a wrapper solution is used.

Taking the issue over.
Comment 7 mikhail.voytenko 2009-04-24 09:47:26 UTC
mav->dtardon: It could make sense to compare the behavior of the office in case
the command line contains a file that is not allowed to be opened. The UCB
reports error correctly in this case, I would suggest to take a look what it the
difference between this case and the case when the directory is opened. As I
have already mentioned the file ucp looks to set the error correctly.

Hope that helps.
Comment 8 kai.sommerfeld 2009-04-24 10:49:36 UTC
CC'ing myself. 
Comment 9 caolanm 2010-07-13 11:08:42 UTC
Created attachment 70591 [details]
update patch for 3.3
Comment 10 caolanm 2010-07-13 11:09:13 UTC
updated the patch for 3.3, though should revisit this and do a better approach
Comment 11 mikhail.voytenko 2010-07-13 11:23:38 UTC
Sorry, but the patch introduces changes in ucbhelper as the old one does. The
comments from kso mentioned above clearly state that the ucbhelper is not a
correct place to introduce the solution. It should be either UCB or framework.

By the way, it looks already to be too late for this task to get it in OOo3.3.