Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 209341 - Can't open a bpel file thru File->Open
Summary: Can't open a bpel file thru File->Open
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BPEL (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: BPEL Model Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-09 09:48 EST by Oleg Danilov CLA
Modified: 2022-10-03 11:11 EDT (History)
4 users (show)

See Also:


Attachments
Create a file in the workspace referencing the external file (41.19 KB, patch)
2009-11-05 13:29 EST, Vincent Zurczak CLA
bbrodt: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Oleg Danilov CLA 2007-11-09 09:48:16 EST
Try open a .bpel file via menu: File->Open File.
You'll get an error saying about class cast problem:

org.eclipse.bpel.ui.BPELMultipageEditorPart:

...
BPELEditModelClient editModelClient = new BPELEditModelClient(this, ((IFileEditorInput) getEditorInput()).getFile(), this, loadOptions);
...

Actually getEditorInput() returns FileStoreEditorInput for file placed outside workspace.
Comment 1 Vincent Zurczak CLA 2009-11-05 13:29:02 EST
Created attachment 151472 [details]
Create a file in the workspace referencing the external file

It happens when you open a file which is not in the workspace.
The problem is that many things in the code are based on IFile. The best solution would be to replace it by a File object (there would be many files impacted by this change).

A temporary and lighter solution is to create a temporary file in the workspace which references the external file. For this, we create a hidden IProject. 

I attached a patch using this solution. 
The changes are preceeded by "Bug #209341".
Comment 2 Simon Moser CLA 2009-11-19 04:55:41 EST
Vincent, 

I applied the patch, however, it doesn't seem to work for me ?! If I do, I get a popup that says "Error creating Design Page", "Error opening editor. Can't read input file". I assume that this is related to your comment "The changes are preceeded by "Bug #209341", however, I assume the bug number is incorrect, since 209341 is this bug. Is there another patch that I need to apply before I can test this ?
Comment 3 Vincent Zurczak CLA 2009-11-19 08:10:28 EST
"The changes are preceeded by Bug #209341" refers to code changes.

My patch contains the original class plus my changes.
The lines I modified are preceeded by the words "Bug #2092341" (with no quote).
When you apply the patch, do you see a new project in the resource navigator (".temp" I think, I don't remember exactly its name)?
Comment 4 grid.qian CLA 2009-12-02 02:00:00 EST
Hi all,

Check out the newest codes from cvs head, I found Simon has apply part of the patch. That means the newest codes is right for this issue?

Grid
Comment 5 grid.qian CLA 2009-12-02 02:23:29 EST
I want to withdraw my last comment. The patch is applied as a whole.
Sorry for my carelessness. 

Grid
Comment 6 Vincent Zurczak CLA 2009-12-02 05:55:43 EST
And is it working now?
Simon reported issues. Can you open a BPEL file located outside the workspace?
Comment 7 grid.qian CLA 2009-12-02 21:17:12 EST
Hi Vincent,

It doesn't work well for now. When you open a bpel file by file>open firstly, it does not open it, but if you open the same file by file>open again, it can open it
.

Grid
Comment 8 Vincent Zurczak CLA 2009-12-03 09:20:11 EST
You're right. My mistake.
When you open a file with "File > Open...", the action searches external files in the file store system. If you open it for the first time, it is not found and the usual file input is returned and tried to be adapted to an IFile instance. Unsuccessfully.

If you open it after a first tentative, the file is resolved in the file store system, and it works. I'll try to fix it too.
Comment 9 Simon Moser CLA 2009-12-03 09:35:11 EST
(In reply to comment #8)
> You're right. My mistake.
> When you open a file with "File > Open...", the action searches external files
> in the file store system. If you open it for the first time, it is not found
> and the usual file input is returned and tried to be adapted to an IFile
> instance. Unsuccessfully.
> 
> If you open it after a first tentative, the file is resolved in the file store
> system, and it works. I'll try to fix it too.

Vincent, 

when you do an updated patch - pls. make sure that you base that off the latest code in HEAD (note also that you need e3.5 for that)
Comment 10 Robert Brodt CLA 2012-04-18 10:07:24 EDT
Appears to have been fixed
Comment 11 Robert Brodt CLA 2012-04-18 11:05:28 EDT
Comment on attachment 151472 [details]
Create a file in the workspace referencing the external file

Updated iplog flag for v1.0 release review