Ticket #2304 (closed tweak: obsolete)

Opened 10 years ago

Last modified 8 years ago

resource-change – Add ability to change resources of existing frames

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

Description

Changing a resource should be possible. The behavior should be as you deleted the frame and created a new one (but styling, size, resource should not be changed). If possible, make other options such as controls visibility to be preserved

Attachments

main-resource-change.patch (17.0 KB) - added by deni 10 years ago.

Change History

comment:1 Changed 10 years ago by dido

  • Category set to unknown
  • Analysis_score set to 0
  • Importance set to 50
  • Test_score set to 0
  • Design_score set to 0
  • Imp._score set to 0

comment:2 Changed 10 years ago by deni

  • Owner set to deni
  • Status changed from new to s1a_analysis_started

comment:3 Changed 10 years ago by deni

  • Status changed from s1a_analysis_started to s1b_analysis_finished

comment:4 Changed 10 years ago by deni

  • Design_owners set to deni
  • Status changed from s1b_analysis_finished to s1c_analysis_ok
  • Imp._owners set to deni
  • Analysis_reviewers set to deni
  • Analysis_score changed from 0 to 4

comment:5 Changed 10 years ago by deni

  • Status changed from s1c_analysis_ok to s2a_design_started

comment:6 Changed 10 years ago by deni

  • Status changed from s2a_design_started to s2b_design_finished
  • Add a new operation in ResourceImportLogic - ON_DROP_RESOURCE_OVER_FRAME_CONTENT. If possible, it changes the main resource of the frame to the resource that was dropped.
    • The main idea is to set the following two keys:
      • ResourceFrame.KEY_MAIN_RESOURCE
      • ResourceR4.KEY_KIND (because only image frames can show images, for example, otherwise there will be a lot of problems with the views)
    • The new frame kind can be found using ResourceImportManagers in the following way:
      ResourceImportProvider provider = SimpleResourceImportProvider.getProvider(
      	new ResourceKindMatcher(droppedResKind));
      final String newFrameKind = provider.getImportManager().getFrameKind();
      
  • In LibraryTabLogic do not handle the event if the book view is in preview mode, just return false. Handling the event in ON_PAGE_TEMPLATE_DND_IMPORT, for example, causes troubles when trying to change the content of an embedded book frame.
  • Remove the StringData from all ResourceDataProviders except HotText. Otherwise when dropping a resource over the content of a text frame, the resource name will be inserted.
  • Make sure that FrameViewLogic.ON_DROP_OVER_PADDING operation handles the event (and changes the background) only if image data was dropped over the padding of a frame.
    • Add a simple check whether the ImmPoint event parameter is outside the frame content.
    • The point parameter is currently wrong because of SceneInteractionLogic.SCENE_DND_OPERATION. In order to convert scene coordinates to the element's space, we should use the inverse matrix of the matrix we obtain by calling SceneHelper.getElementToSceneTransform(Scene, SceneElement)

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 3.5
  • Design_reviewers set to meddle

It's OK but two things:

  • First use the logic of the keys when getting values from the model. Not frameAccess.open(relRef, null).getRaw(ResourceR4.KEY_KIND);. The right use here is something like ResourceR4.KEY_KIND.get(frameAccess.open(relRef, null));. If in the future the kind become templated key, the first will not take in mind the template.
  • I don't like how big the ResourceImportLogic is getting... You can create for example another logic for the DND imports - DNDResourceImportLogic.
  • You should add the design changes you made about the chained frames.
  • That thing about the StringData, you must give the implementation before the review for hard testing...

comment:8 Changed 10 years ago by deni

  • Status changed from s2c_design_ok to s3a_implementation_started

comment:9 Changed 10 years ago by deni

  • Status changed from s3a_implementation_started to s3b_implementation_finished
  • In AppViewUtil.getView(VisualElement, ResourceAccess, Class<T>) ensure that no ClassCastExceptions will be thrown. Instead, when the cached result is not of the required type, return null.
  • Split the ELEMENT_DELETED event into two new events:
    • DELETING_ELEMENT that is fired before actually deleting an element, so that if the views that depend on the item that will be deleted are notified
    • DELETE_ELEMENT - the logics that handle this event will actually delete the element. It is their responsibility to fire DELETING_ELEMENT beforehand.
    • In ON_DROP_RESOURCE_OVER_FRAME_CONTENT before changing the main resource fire DELETING_ELEMENT event with parameter the frame. This will ensure that head frames will be removed from the chain, the timer of browser frames will be stopped and so on.

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

Merged to the trunk at [8659].

You left some commented code, some System.outs, you didn't comment on my note about the big resource import logic...
There was an undocumented method... The code was not a implementation phase code for review...

3p

comment:11 Changed 8 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.