From 55c4ac1bfe565f1ca7f537fdd8b7a201be28e581 Mon Sep 17 00:00:00 2001 From: xue <> Date: Thu, 10 Nov 2005 12:47:19 +0000 Subject: Initial import of prado framework --- framework/TODO.txt | 306 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 306 insertions(+) create mode 100644 framework/TODO.txt (limited to 'framework/TODO.txt') diff --git a/framework/TODO.txt b/framework/TODO.txt new file mode 100644 index 00000000..0bfaab26 --- /dev/null +++ b/framework/TODO.txt @@ -0,0 +1,306 @@ + +think more about encoding/decoding +<%@ MasterClass="Pages.MasterPage" %> +THtmlTextWriter::addStyleAttribute(), also change how TStyle renders its content. + + +callback + +http://www.xisc.com/index.php?page=homepage + +Features to be implemented later: +- SmartNavigation: TForm, TPage +- DefaultButton: TForm, TClientScriptManager + +Main Problems: +1. How to solve viewstate ID mapping problems? What if a control has changed its ID before saving viewstate? +5. What if in a getter, it needs to address a sibling or child control? +6. learn more details about WebParts +http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_sp2003_ta/html/sharepoint_northwindwebparts.asp + +When a page is requested, asp.net 2.0 does the following +- application creates the page instance by new operator +- application invokes page.processrequest +- page.frameworkinitialize is invoked +- ... ControlBuilder.InitObject(page) +- ... ... set SkinID +- ... ... apply stylesheet skin +- ... ... init simple properties (basic property types) +- ... ... init complex proprerties (e.g. Font-Name), may need to call InitObject on Font +- ... ... init data bindings +- ... ... call BuildChildren if item implements IParserAccessor (Control implements it) +- ... ... ... for each body item +- ... ... ... ... get the control builder for the control class +- ... ... ... ... call ControlBuilder.BuildObject +- ... ... ... ... ... call InitObject +- ... ... ... ... if it is user control (control with template) +- ... ... ... ... ... call UserControl.InitializeAsUserControl(page) +- ... ... ... ... ... ... call frameworkinitialize (won't call InitObject anymore) +- ... ... ... ... call control.AddParsedSubObject(item) +- ... ... init template properties (should be a property with template type, will use TemplateBuilder to build the object) +- ... ... bind field to control (pass some fields from TemplateControl to the new control) + +How is a UserControl initialized if created dynamically? +- ... InitializeAsUserControl invoked in OnInit (which will be caught up if the control is dynamically created) + + + + +Findings: + + +Control lifecycles: + +const CS_CONSTRUCTED=0; // after constructor +const CS_FRAMEWORK_INITIALIZED=1; // after children created and properties set +const CS_CHILDREN_INITIALIZED=2; // right before OnInit (also before applySkin, but after children OnInit) +const CS_INITIALIZED=3; // right after OnInit +const CS_STATE_LOADED=4; // right after loading state +const CS_LOADED=5; // right after loaded +const CS_PRERENDERED=6; // right after prerender + +stylesheet is applied before setting control properties (after skinID is set) +skin is applied right before OnInit + + + +ControlBuilder is responsible to call AddParsedSubObject +Its BuildChildren is + +My understanding of lifecycles: + +Page constructed (using new operator) +Page.ProcessRequest + Page.FrameworkInitialize + Page.InitializeStyleSheet + Page.determinePostBackMode + Page.loadScrollPosition + Page.performPreInit + Page.initRecursive + Page.onInitComplete + Page.loadAllState + Page.processPostData + Page.onPreLoad + Page.loadRecursive + Page.processPostData + Page.raiseChangedEvents + Page.raisePostBackEvent + Page.onLoadComplete + Page.raiseCallBackEvent -> exit + Page.preRenderRecursive + Page.performPreRenderComplete + Page.saveAllState + Page.onSaveStateComplete + Page.renderControl + Page.unloadRecursive + + +Possible solution for SkinID: setting SkinID will cause skin change immediately. +With control hierarchy storing: + + +Page constructed (template parsed but not instantiated) +Page.loadAllState <---- page state totally restored +Page.loadRecursive +Page.processPostData +Page.raiseChangedEvents +Page.raisePostBackEvent or Page.raiseCallBackEvent +Page.preRenderRecursive +Page.saveAllState +Page.renderControl +Page.unloadRecursive + + + +Page constructed +Page.frameworkInitialize (instantiating template) +Page.initRecursive +Page.saveAllState +Page.renderControl +Page.unloadRecursive + + + + +edit distance. +(UIUC) Jiawei Han: graph similarity mining + +module service? +page service? + + +index.php?page=path.to.page + + +TODOs + +renderer?? +Dispose +-->> viewstate id-based or index-based, structure keeping?? <<-- +HttpContext, url/path +template path +adapter +parser + + +class metadata attributes: +e.g. the body content of a control can be parsed as child controls, or property values +or list items + +Imagine a usecase (hmmm...could have problem....) How to specify two list properties for a single control? + +abc + + xxx + yyy + + + + +how to define a control with template?? +TemplateControl.LoadControl or LoadTemplate is used for controls that allows taking template contents for their attributes. + + +UserControl! starting from the template instead of class + + + +idNotCalculated = 1; +marked = 2; +disableViewState = 4; +controlsCreated = 8; +invisible = 0x10; +visibleDirty = 0x20; +idNotRequired = 0x40; +isNamingContainer = 0x80; +creatingControls = 0x100; +notVisibleOnPage = 0x200; +themeApplied = 0x400; +mustRenderID = 0x800; +disableTheming = 0x1000; +enableThemingSet = 0x2000; +styleSheetApplied = 0x4000; +controlAdapterResolved = 0x8000; +designMode = 0x10000; +designModeChecked = 0x20000; +disableChildControlState = 0x40000; +isWebControlDisabled = 0x80000; +controlStateApplied = 0x100000; +useGeneratedID = 0x200000; + +TODO: + +clean up ID, namingcontainer things: + +A control can be added into page hierarchy in the following ways +- newly created in template + - manual ID + - need automatic ID +- dynamically created in code + - manual ID + - need automatic ID +- a previously removed control + - manual ID + - need automatic ID +When a control changes its ID, the following things are necessary: +- If it is a namingContainer + - all its descendant must update their unique ID +- If it is a normal control, nothing needs to be done +- In both cases, the namingContainer's nametable has to be updated +When a control changes its page, ...? +- All its children have to change the page too +When a control changes its parent, ...? +- This is like remvoedControl + addedControl. +When a control changes its namingcontainer ...? +- All its child controls have to change namingcontainer recursively + The old namingContainer nametable must also be changed recursively. +When a control changes its templateControl...?? +- Nothing to be done. + + + +ControlState +============ +Constructed +Initialized +ViewStateLoaded +Loaded +PreRendered + + + +asp.net 2.0 lifecycles +======================== +Application: BeginRequest +Application: PreAuthenticateRequest +Application: AuthenticateRequest +Application: PostAuthenticateRequest +Application: PreAuthorizeRequest +Application: AuthorizeRequest +Application: PostAuthorizeRequest +Application: PreResolveRequestCache +Application: ResolveRequestCache +Application: PostResolveRequestCache +Application: PreMapRequestHandler +Page: Construct +Application: PostMapRequestHandler +Application: PreAcquireRequestState +Application: AcquireRequestState +Application: PostAcquireRequestState +Application: PreRequestHandlerExecute +Page: AddParsedSubObject +Page: CreateControlCollection +Page: AddedControl +Page: AddParsedSubObject +Page: AddedControl +Page: ResolveAdapter +Page: DeterminePostBackMode +Page: PreInit +Control: ResolveAdapter +Control: Init +Control: TrackViewState +Page: Init +Page: TrackViewState +Page: InitComplete +Page: LoadPageStateFromPersistenceMedium +Control: LoadViewState +Page: EnsureChildControls +Page: CreateChildControls +Page: PreLoad +Page: Load +Control: DataBind +Control: Load +Page: EnsureChildControls +Page: LoadComplete +Page: EnsureChildControls +Page: PreRender +Control: EnsureChildControls +Control: PreRender +Page: PreRenderComplete +Page: SaveViewState +Control: SaveViewState +Page: SaveViewState +Control: SaveViewState +Page: SavePageStateToPersistenceMedium +Page: SaveStateComplete +Page: CreateHtmlTextWriter +Page: RenderControl +Page: Render +Page: RenderChildren +Control: RenderControl +Page: VerifyRenderingInServerForm +Page: CreateHtmlTextWriter +Control: Unload +Control: Dispose +Page: Unload +Page: Dispose +Application: PostRequestHandlerExecute +Application: PreReleaseRequestState +Application: ReleaseRequestState +Application: PostReleaseRequestState +Application: PreUpdateRequestCache +Application: UpdateRequestCache +Application: PostUpdateRequestCache +Application: EndRequest +Application: PreSendRequestHeaders +Application: PreSendRequestContent \ No newline at end of file -- cgit v1.2.3