Ticket #2413 (closed bug: obsolete)

Opened 10 years ago

Last modified 9 years ago

page-templates-editing - Adding/Removing element to page template, should result in corresponding change to the page it is applied to.

Reported by: todor Owned by: deni
Priority: major Milestone: X3
Component: uncategorized Version: 2.0
Keywords: Cc:
Category: unknown Effort:
Importance: Ticket_group:
Estimated Number of Hours: 0 Add Hours to Ticket: 0
Billable?: yes Total Hours: 0
Analysis_owners: todor Design_owners: deni
Imp._owners: deni Test_owners:
Analysis_reviewers: deni Changelog: Changelog
Design_reviewers: meddle Imp._reviewers: meddle, todor, deyan
Test_reviewers: Analysis_score: 3.5
Design_score: 4 Imp._score: 3
Test_score: 0

Description (last modified by todor) (diff)

Adding/Removing element to page template, should result in corresponding change to the page it is applied to.

  • When a frame is added to the page template, this should result in adding new frames in all pages that are using this template.
  • Same thing must be valid for deleting frame from the template.

(The same must be applied to groups of elements or certain parts of the group (frame that is part of group) etc.)

Attachments

add-remove-eleents-from-template-de.patch (13.5 KB) - added by deni 10 years ago.
sync-template-subelements-impl.patch (19.2 KB) - added by deni 10 years ago.

Change History

comment:1 Changed 10 years ago by todor

  • Description modified (diff)

comment:2 Changed 10 years ago by todor

  • Description modified (diff)

comment:3 Changed 10 years ago by todor

  • Status changed from new to s1b_analysis_finished

comment:4 Changed 10 years ago by deni

  • Status changed from s1b_analysis_finished to s2a_design_started
  • The analysis is ok.
  • Adding/removing elements as a result of changing the template will register significant AutoActions. This means that it can be undone.

comment:5 Changed 10 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 3.5

comment:6 Changed 10 years ago by deni

  • Status changed from s2a_design_started to s2b_design_finished
  • Add an AutoProperty in ElementH that keeps track of the subelements of the element's template and fires an event when a new subelement is added or when an existing one is deleted.
    • Add an inner enum TemplateEventIds in ElementH that contains 2 events:
      • TEMPLATE_ELEMENT_ADDED fired when a new element is added to the template
      • TEMPLATE_ELEMENT_DELETED fired when an existing element is deleted from the template
      • Both events have a ResourceRefR4 parameter pointing to the resource that was added/removed.
    • The property keeps the previous subelements value in a private field and after computing the new subelements, compares the two lists to determine which elements have been added/removed.
    • The property should not fire any events when the template itself has changed. Otherwise when applying a page template, a new element will be added for each slot (in addition to the actions the user has chosen from the 'Apply page template' dialog).
  • Make sure that while applying a page template in TemplateUtil.applyPageTemplate(...) when associating a group from the page with a group from the template, the KEY_TEMPLATE is appropriately set. This will ensure that when a frame is added to an existing group in the template of a page, a new frame will be added to the group on the page that is associated with the template group.
  • Add a new logic class to handle events related to changes in the template of an element - CompositeTemplateLogic in org.sophie2.main.func.templates.composite package. It should contain the following 2 operations:
    • ON_TEMPLATE_SUBELEMENT_ADDED - handles adding a new element (sub-template) to the template of the source element. Creates a new sub-element by the sub-template.
      • Before adding the new element, it should check whether it has not already been added. This is possible when there are 2 ElementHs for the same resource at the same time or after undo-ing the action that removed a sub-element from the template.
        • Since a sub-template can be used only once, checking whether the sub-template is already used should be enough.
    • ON_TEMPLATE_SUBELEMENT_DELETED - handles deleting a sub-element (sub-template) from the template of the source element. Deletes the element that was using the sub-template.
      • There might be no such element or it might have alrealy been deleted.
  • Make TemplateUtil.createTemplate(...) use a single AutoAction, so that the property updates after the template's creation is complete. Otherwise the order of the AutoActions was not correct.

Changed 10 years ago by deni

comment:7 Changed 10 years ago by meddle

  • Status changed from s2b_design_finished to s2c_design_ok
  • Design_score changed from 0 to 4
  • Design_reviewers set to meddle
  • I think the idea is good, if it works with the server collaboration it is OK.
  • Use ImmTreeList instead naive.

4p

comment:8 Changed 10 years ago by deni

  • Owner set to deni
  • Status changed from s2c_design_ok to s3a_implementation_started

Changed 10 years ago by deni

comment:9 Changed 10 years ago by deni

  • Status changed from s3a_implementation_started to s3b_implementation_finished
  • Applied the same approach to change the resource kind of a templated frame when the main resource and the kind of its template change.
    • The property is in FrameH.
  • Adding/removing elements as a result of adding/removing a subelement from the template registers significant autoactions. This means they can be undone. This might be inconvenient for the users, especially when there are many changes. However, I can't think of any solution...

comment:10 Changed 10 years ago by meddle

  • Status changed from s3b_implementation_finished to s3c_implementation_ok
  • Imp._score changed from 0 to 3
  • Imp._reviewers set to meddle, todor, deyan

Merged into the trunk at [9104].

  • To many bugs.

comment:11 Changed 9 years ago by meddle

  • Status changed from s3c_implementation_ok to closed
  • Resolution set to obsolete

Closing all the tickets before M Y1

Note: See TracTickets for help on using tickets.