The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 Event handlers problem when files attached
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

peter.cook

UK
356 Posts

Posted - 01/16/2004 :  09:59:59 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi,

I've noticed that the [BeforeCompileSystem] and [AfterCompileSystem] don't work when files of any type are attached to my project. This is a problem. Please advise, thanks. Other event handlers work okay. Also, system files seem to recompile when any file is attached to my project so the problem could perhaps be related to this..?

Cheers,

pete

Mike Buess

USA
3037 Posts

Posted - 01/16/2004 :  3:34:13 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I haven't attached many files to projects yet and didn't notice that behavior until now. As you say, the other OEvent sections work fine but BeforeCompileSystem and AfterCompileSystem are bypassed. (Although the system files seem to compile anyway.) I rely on the *CompileSystem sections to prepare Origin on startup and will need to come up with a workaround. Reselecting the current menu level should work for me, but the solution may not be that simple for everyone.

Side issue: Shouldn't there be some indication in Origin itself when file(s) are attached to a project? Users who rarely open CodeBuilder would never know unless told by the person who did the attaching.

Mike Buess
Origin WebRing Member
Go to Top of Page

peter.cook

UK
356 Posts

Posted - 01/17/2004 :  11:46:17 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Mike,

Gather this is to be fixed in a LATER release as tracker QA-5853. Not too happy here....

Your point is a good one too!

Cheers,

Pete

Go to Top of Page

Gary Lane

USA
150 Posts

Posted - 02/02/2004 :  11:55:31 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Peter and Mike,

The bug reported above (#5853) will be fixed in Origin 7.5 SR2. Below I have documented in detail the triggering order for several different Origin scenarios. Also, I will talk to CP about Mike's other point which I think is important. In addition to indicating presence of attached files maybe we should also allow users to suppress execution of event handlers at project launch time? (For security reasons.)

Gary
OriginLab


There are several different scenarios on the order of Origin events triggering depending on what is happening:

Case1: When a project file is opened by including the project file name as a parameter on the command line and when the Origin project file contains source files in the Project folder of Code Builder:
BeforeUserCNF
AfterUserCNF
BeforeCompileSystem
AfterCompileSystem
BeforeOpenDoc
BeforeCompileProject
AfterCompileProject
AfterOpenDoc

Case2: When a project file is opened by including the project file name as a parameter on the command line and when the Origin project file does not contain source files in the Project folder of Code Builder:
BeforeUserCNF
AfterUserCNF
BeforeCompileSystem
AfterCompileSystem
BeforeOpenDoc
AfterOpenDoc

Case3: When a project file is opened by double-clicking on the project file and when the Origin project file contains source files in the Project folder of Code Builder:
BeforeUserCNF
AfterUserCNF
BeforeCompileSystem
AfterCompileSystem
BeforeOpenDoc
BeforeCompileProject
AfterCompileProject
AfterOpenDoc

Case4: When a project file is opened by double-clicking on the project file and when the Origin project file does not contain source files in the Project folder of Code Builder:
BeforeUserCNF
AfterUserCNF
BeforeCompileSystem
AfterCompileSystem
BeforeOpenDoc
AfterOpenDoc

Case5: When a project file is opened by selecting the File:Open menu item from inside Origin and when the Origin project file being opened contains source files in the Project folder of Code Builder:
of Code Builder:
BeforeCloseDoc
AfterCloseDoc
BeforeOpenDoc
BeforeCompileProject
AfterCompileProject
AfterOpenDoc

Case6: When a project file is opened by selecting the File:Open menu item from inside Origin and when the Origin project file being opened does not contain source files in the Project folder of Code Builder:
BeforeCloseDoc
AfterCloseDoc
BeforeOpenDoc
AfterOpenDoc

Case7: When exiting Origin:
BeforeCloseDoc
AfterCloseDoc
OnExitOrigin

Notes:
1. If there are no source files attched to the Project folder of Code Builder then System compilation does not occur in the same thread. But, if there are source files attached to the Project folder of Code Builder then the System files are always compiled before the Project files get compiled.
2. The compilation of source files attached to the Project folder of Code Builder is part of the document loading procedure...therefore if there are files attached to the Project folder of Code Builder then AfterOpenDoc occurs after files attached to the Project folder of Code Builder are compiled.
3. Opening files by double-clicking on them is a completely different story. In this case the project gets opened by means of DDE and sequence is going to be different. This is because DDE communication (where Windows sends a message to application to open document) happens after Origin is initialized and compilation.

Edited by - Gary Lane on 02/12/2004 3:34:35 PM
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 02/02/2004 :  12:47:58 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Gary,

Thanks for clarifying the triggering orders. Very useful.

Awareness of attachments might be achieved simply by appending w/Attachment or just + to the file path\name in the title bar...

Origin 7.5 - C:\MyFiles\MyProject+

Perhaps a special Windows icon for OPJ files with attachments could also be helpful. As for security issues I think precautions like you suggest would be wise.

Mike Buess
Origin WebRing Member
Go to Top of Page

peter.cook

UK
356 Posts

Posted - 02/03/2004 :  07:28:33 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi gary,

Thanks for info and glad to know it will be fixed for SR2.
One point : should not Case 2 be

BeforeUserCNF
AfterUserCNF
BeforeOpenDoc

BeforeCompileSystem
AfterCompileSystem

AfterOpenDoc

for consistency? The code would be difficult to manage if not.

Cheers,

Pete

Go to Top of Page

Gary Lane

USA
150 Posts

Posted - 02/04/2004 :  2:41:23 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Peter and Mike,

We are discussing with CP whether or not to change the order of Case 2 as suggested. The current order is set as is because when there are no attached files in the Project folder of Code Builder system compilation occurs in a separate Windows thread (not the same one as Origin). When there are files in the Project folder of Code Builder compilation is all in the Origin thread and compilation of attached files is part of opening the current document (OPJ). Nonetheless we are considering the suggestion....Thanks.

Also, I liked the idea of indicating on the title bar of Origin the presence of attached files with a + or some other symbol. Our current idea is to add an "Attached Files" folder in Project Explorer. You would be able to add/remove/open attached documents with standard Windows techniques inside the Project Explorer folder structure. For example, if you attached a Word document and double-clicked on it, it would open in Word. If you attached an OGS or C file and double-clicked on it, it would open in Code Builder, etc.

What do you think about that design? Thanks for you participation.

Gary
OriginLab

Edited by - Gary Lane on 02/12/2004 3:34:05 PM
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 02/04/2004 :  3:32:10 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Gary,

I think that Project Explorer access to attachments would be useful.

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 02/04/2004 3:32:49 PM
Go to Top of Page

peter.cook

UK
356 Posts

Posted - 02/05/2004 :  09:00:22 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Gary,

Mike's idea of eg '+' symbol is a good one and likewise the attached files folder! This seems perfectly logical. I would though like to be able to (optionally) hide the attached files folder and as an extra option to hide code files eg only display non origin attached files (this would help project projects with attached origin code and hide files from users; in our case they'll only want to see their own attached documents).

re Origin events I think I have a problem with case 2 as it stands. Please could you comment thanks - I'm hoping to incorporate this approach as part of our standard AZ set up :

I would really like to be able to use (the same) .c functions as installed on client however an origin project is opened. My understanding is that this would not be possible opening a project file in the command line but would be by double clicking or via File Open UNLESS the .c file is attached which won't be the case.

What's the reason for compiling being done in a different thread here - for info - out of my scope of expertise (easily done!)?

Cheers,

pete



Edited by - peter.cook on 02/05/2004 09:01:22 AM
Go to Top of Page

Gary Lane

USA
150 Posts

Posted - 02/05/2004 :  11:07:09 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Peter and Mike,

Just a follow up:

1. The latest 7.5 SR2 build ER815 will include the text <+N> on the Origin title bar where N is the number of attached files currently saved in the Project folder of Code Builder.

2. The "Attached Files" folder in Project Explorer is targeted for Origin 8. I added Peter's latest suggestion to the tracker item (#5869 for future reference).

3. I modified my post above outlining the trigger sequence of OEvents. The new (and newly consistent...thanks Peter) launch sequence is summarized below:

OEvents Launch Sequence:
1.BeforeUserCNF
2.AfterUserCNF
3.BeforeCompileSystem
4.AfterCompileSystem
5.BeforeOpenDoc
6.BeforeCompileProject
7.AfterCompileProject
8.AfterOpenDoc

Events 6 and 7 are triggered only if the OPJ has attached C files. The AfterOpenDoc event always triggers and is always last.

I hope this is helpful. Thanks for the input...this process seems to be working well.

Gary
OriginLab

Go to Top of Page

peter.cook

UK
356 Posts

Posted - 02/05/2004 :  11:54:36 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks Gary...seems good.

Cheers,

pete

Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000