Ticket #2385 (closed feature: obsolete)
page-templates-internal -- Add support for frames in page templates
Reported by: | deyan | Owned by: | deni |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | uncategorized | Version: | 2.0 |
Keywords: | Cc: | deni | |
Category: | unknown | Effort: | |
Importance: | Ticket_group: | ||
Estimated Number of Hours: | 0 | Add Hours to Ticket: | 0 |
Billable?: | yes | Total Hours: | 0 |
Analysis_owners: | deyan, deni | Design_owners: | deni |
Imp._owners: | deni | Test_owners: | |
Analysis_reviewers: | deni | Changelog: | Changelog |
Design_reviewers: | meddle | Imp._reviewers: | deyan, meddle, pap |
Test_reviewers: | Analysis_score: | 4 | |
Design_score: | 3.5 | Imp._score: | 3.5 |
Test_score: | 0 |
Description (last modified by deni) (diff)
Page templates should support frames in it. See Templates and implement the following:
- Adding template - should contain all frames (without UI for choosing which to add)
- Applying a template - By default, new frames are created. Existing frames are not deleted. However, changes to existing frames in the templates should be applied to all pages
- Creating a page - the page appears with all options that were checked (and all frames). If an option was not checked, it falls back to the parent template.
- [Optional] Replace the autotemplates used by autochaining with regular page templates.
Change History
comment:1 Changed 15 years ago by deyan
- Owner set to deyan
- Status changed from new to s1a_analysis_started
- Description modified (diff)
- Analysis_owners set to deyan, deni
comment:2 Changed 15 years ago by deyan
- Status changed from s1a_analysis_started to s1b_analysis_finished
- Description modified (diff)
comment:5 Changed 15 years ago by deni
- Design_owners set to deni
- Imp._owners set to deni
- Analysis_reviewers set to deni
- Analysis_score changed from 0 to 4
comment:7 Changed 15 years ago by deni
- Owner changed from deyan to deni
- Status changed from s1c_analysis_ok to s2a_design_started
comment:8 Changed 15 years ago by deni
- Status changed from s2a_design_started to s2b_design_finished
General idea
Applying a page template actually consists of templating the properties other than page elements and applying frame templates to existing or new frames.
- Templating properties other than page elements (for example border, background, padding) - no changes will be necessary
- Templating page elements (groups and frames) - for each element from the template we can either create a new one in the page or use it as a template for an existing one.
- This is rather straightforward for frames.
- For groups:
- We can create a new group analogous to the template one.
- We can also map the group for the template to an existing one and apply the same idea for its children. For each sub-element, we can either create a similar element in the group in the page, or use it as a template for an existing one.
TemplateUtil
The above logic will be implemented in a new method in TemplateUtil -
applyPageTemplate(PageH, ResourceRefR4, ImmMap<ResourceRefR4, ElementH>, List<ElementH>).
- Arguments:
- The first argument is the page to which the template will be applied and the second - an absolute reference to the template to apply.
- The ImmMap<ResourceRefR4, ElementH> argument maps frames from the template to frames from the page to which they should be applied as templates.
- The List<ElementH> contains sub-elements of the template from which new elements should be created.
- The method will do the following things:
- template page properties other that page elements - get all applicable templated keys and set their values to null
- apply frame templates to existing frames - not implemented now, but should be trivial. The difficult part is to construct this map, but this will be done in the logic for the 'Apply page template' dialog.
- create new elements from templates - use a private helper method templatePageElement(ElementH templeteH, ElementH parentH)
- templatePageElement(templateH, parentH) - creates a new element (child of the fiven parentH) from a template element (templateH). Recursive.
Make CompositeElement.KEY_SUB_ELEMENTS a non-templated key
Since it won't be used for templating the sub-elements in the regular way, CompositeElement.KEY_SUB_ELEMENTS does not need to be a templated key. Make it a SimpleKey<ImmList<ActivationChannel>> with default value - an empty list.
- Remove the boolean argument that shows whether the sub-elements come from a template in FrameH.create(...).
- Remove PageFramesUseTemplateHaloButton because it is obsolete and even if we need it in the future, its implementation should be totally different
comment:10 Changed 15 years ago by meddle
- Cc deni added
- Design_score changed from 0 to 3.5
- Design_reviewers set to meddle
- Status changed from s2b_design_finished to s2c_design_ok
- You know that key.equals(CompositeElement.KEY_SUB_ELEMENTS is wrong when comparing objects, the constant is the caller.
- Move these out of the AutoActions -> ResourceRefR4.generateRandomSub(FrameH.NAME_PREFIX);, don't make them too complex.
- I didn't understand when you make new elements and when you reuse old but with templates applied to them. When the elements from the template have the same title you don't make new resources?
3.5p
comment:11 Changed 15 years ago by deni
- Status changed from s2c_design_ok to s3a_implementation_started
comment:12 Changed 15 years ago by deni
- Status changed from s3a_implementation_started to s3b_implementation_finished
- Moved calling ResourceRefR4.generateRandomSub(String) outside the AutoAction.
- Changed the titles for the newly created groups and frames to be from the template, not auto-generated.
- Currently I always create new groups and frames from the template and never apply templates to existing ones. This will be fixed when the 'Apply page template' dialog is created. Then the user will be able to choose whether to create a new frame or apply a template to an existing one manually.
- Source code: [8932], [8934], [8939] and [8973]
comment:13 Changed 15 years ago by meddle
- Status changed from s3b_implementation_finished to s3c_implementation_ok
- Imp._score changed from 0 to 3.5
- Imp._reviewers set to deyan, meddle, pap
Merged into the trunk at [8984].
- I like the improvements of code
- The handling of NotAvailableErrors in the views should be temporary fix and something as an empty frame should be created.
- The task too much time for reviewing because of some exceptions.
3.5p
comment:14 Changed 13 years ago by meddle
- Status changed from s3c_implementation_ok to closed
- Resolution set to obsolete
Closing all the tickets before M Y1