Feature #2013
implement the SELF system handle
100%
Subtasks
History
#1 Updated by Greg Shah about 11 years ago
- Estimated time deleted (
24.00)
The SELF system handle returns the handle to the resource currently being processed in a trigger or other callback processing.
For milestone 7, this is only used in a SAX callback (an arbitrary procedure in the app), it must access the corresponding SAX resource handle.
These attributes are in use:
PRIVATE-DATA
LOCATOR-LINE-NUMBER
LOCATOR-COLUMN-NUMBER
Of course, it's use for other resources should not be disabled by adding this capability.
#2 Updated by Constantin Asofiei about 11 years ago
How I see this working: we have a SelfManager class which manages a stack of "self" handles. Each event responsible of creating a new SELF handle must call SelfManager.pushSelf(<handle>) before calling the trigger/procedure/etc and will call SelfManager.popSelf() after calling the trigger/procedure/etc. KW_SELF will be converted to SelfManager.self() and will act as a real handle. Any i.e. ch = self:private-data
calls will be converted to:
ch.assign(handle.unwrap(SelfManager.self()).getPrivateData());
#3 Updated by Constantin Asofiei about 11 years ago
- File ca_upd20130221c.zip added
- Status changed from New to WIP
Attached update with proposed solution (built on top of revision 10179). With this approach, all attribute/method access convert naturally and we have little impact on the generated code.
#4 Updated by Greg Shah about 11 years ago
I like it.
#5 Updated by Constantin Asofiei about 11 years ago
I'm leaving a conversion to run over night, hopefully all SELF-handle usage will convert nicely.
#6 Updated by Constantin Asofiei about 11 years ago
- File ca_upd20130222a.zip added
Fixed a conversion error, I'm running conversion again.
#7 Updated by Constantin Asofiei about 11 years ago
- File ca_upd20130222c.zip added
Added testcases. they are for session handle, I've deleted it from here.
#8 Updated by Constantin Asofiei about 11 years ago
- File ca_upd20130222d.zip added
Added testcases (previous were for session handle)
#9 Updated by Constantin Asofiei about 11 years ago
- File deleted (
ca_upd20130222c.zip)
#10 Updated by Constantin Asofiei about 11 years ago
- File ca_upd20130222e.zip added
Conversion has finished, there was a APPLY ... TO SELF problem, fixed in attached update. All other changes look good. I'm running conversion again.
#11 Updated by Constantin Asofiei about 11 years ago
Conversion regression testing has passed - compilation was OK, all changes are expected.
#12 Updated by Greg Shah about 11 years ago
Code Feedback:
1. refName is a dead variable and can be removed from methods_attributes.rules.
2. How do we emit the frame/widget getter for static widget (not handles) attribute/method dereferencing? It would be useful to explain this in a comment in methods_attributes.rules.
Otherwise, it looks good.
Am I correct in understanding that all that remains on the runtime side is to review all event types (other than UI triggers which are already implemented) and implement the handle push/pop properly. That should not take long at all, as far as I can guess.
Be ready to merge up. We will go into testing later today.
#13 Updated by Constantin Asofiei about 11 years ago
- File ca_upd20130222h.zip added
1. refName is a dead variable and can be removed from methods_attributes.rules.
OK, removed
2. How do we emit the frame/widget getter for static widget (not handles) attribute/method dereferencing? It would be useful to explain this in a comment in methods_attributes.rules.
something like this:
form i with frame f1. i:row in frame f1 = 1.
converts to this:
f1Frame.widgeti().setRow(new integer(1));
I've added notes to methods_attributes.rules
Am I correct in understanding that all that remains on the runtime side is to review all event types (other than UI triggers which are already implemented) and implement the handle push/pop properly. That should not take long at all, as far as I can guess.
Correct.
Attached update is merged with 10187.
#14 Updated by Greg Shah about 11 years ago
The code looks good.
This rule-set covers only the cases when an attribute/method is accessed using a handle ref (returned by a method, a variable, system handle, etc). All cases of widget attributes and methods accessed using the widget (with or without a frame qualifier) are managed by the frame-related rules, as annotations/frame_scoping, covert/ui_statements and convert/frame_generator.
I think it might be more correct to say that the rule-set only handles the resource reference for handle types. In the cases where static frame/widget/buffer resources are accessed using the COLON operator, the resource reference is emitted elsewhere but the attribute or method part is still emitted by methods_attributes.rules, right?
#15 Updated by Constantin Asofiei about 11 years ago
- File ca_upd20130222h.zip added
I think it might be more correct to say that the rule-set only handles the resource reference for handle types. In the cases where static frame/widget/buffer resources are accessed using the COLON operator, the resource reference is emitted elsewhere but the attribute or method part is still emitted by methods_attributes.rules, right?
Yup, you are correct, I was misguided by the frame-related options which are emitted in various places (and the setters/getters look similar to the attributes).
Attached update has the same name as previous one.
#16 Updated by Greg Shah about 11 years ago
This is the latest version merged up to bzr 10188. It will go into testing next.
#17 Updated by Greg Shah about 11 years ago
- File ca_upd20130222j.zip added
#18 Updated by Greg Shah about 11 years ago
- File deleted (
ca_upd20130222j.zip)
#19 Updated by Greg Shah about 11 years ago
- File ca_upd20130222j.zip added
Here is the right version.
#20 Updated by Greg Shah about 11 years ago
Passed conversion testing. Checked into bzr as 10189.
#21 Updated by Constantin Asofiei about 11 years ago
- File ca_upd20130223h.zip added
Fixed initialization of context-local data in SelfManager.
#22 Updated by Greg Shah about 11 years ago
The change looks fine. This is being conversion tested now.
#23 Updated by Constantin Asofiei about 11 years ago
Committed to bzr revision 10194, passed runtime regression testing.
#24 Updated by Constantin Asofiei about 11 years ago
About the runtime implementation of SELF handles: I don't want to do this in a separate task; instead, each case which can generate a new SELF handle should be implemented when that feature is implemented (and the implementation is as simple as adding push/pop calls using SelfManager APIs).
Transcript from the docs:
• You can reference the SELF handle only within a user-interface trigger or the event procedure for an ActiveX control or asynchronous remote request. • In user-interface triggers, SELF is not automatically the widget that has input focus. To give input focus to the widget referenced by SELF, you must apply the ENTRY event to SELF within the trigger block. Note that you must do this for fill-in widgets whose AUTO-ZAP attribute you want to set, as in this fragment • In the event procedure of an asynchronous remote request or in the context of a procedure called directly or indirectly by this event procedure, SELF returns the associated asynchronous request handle. • In the event procedure of an ActiveX control, SELF returns the control-frame handle and the COM-SELF system handle returns the control-frame COM-HANDLE value. • If referenced within a READ-RESPONSE event procedure, then SELF is the socket handle associated with the connection that received the message. If referenced within the CONNECT event procedure, then SELF is the server socket handle.
We should add notes to each task associated with each above case and close #2015 and #2013 (note that UI triggers are implemented properly).
#25 Updated by Constantin Asofiei over 10 years ago
NullWidget
usage should be removed and SELF handle (for widgets) tested carefully - see notes 21/22 in #1612.
#26 Updated by Greg Shah over 10 years ago
What is left to do on this task? I think your recent work with async events/sockets probably filled most of the gaps. We aren't going to do anything with Active-X controls in this task, so I wonder what is actually open here. Perhaps just the NullWidget stuff is open?
#27 Updated by Constantin Asofiei over 10 years ago
Perhaps just the NullWidget stuff is open?
Yes, only the NullWidget usage remains to be removed.
#28 Updated by Constantin Asofiei over 10 years ago
- File ca_upd20140120a.zip added
This removes NullWidget and makes both SELF and FOCUS act as real handles. Manual testing looks OK, waiting for the automated testing to finish.
#29 Updated by Greg Shah over 10 years ago
Code Review 0120a
I am fine with the changes. Commit and distribute them when they pass testing.
#30 Updated by Constantin Asofiei over 10 years ago
- File ca_upd20140121d.zip added
Passed conversion and runtime testing, committed to bzr rev 10445.
#31 Updated by Greg Shah over 10 years ago
- Status changed from WIP to Closed
#32 Updated by Greg Shah over 7 years ago
- Target version changed from Milestone 7 to Runtime Support for Server Features