Ticket #2300 (closed tweak: obsolete)

Opened 10 years ago

Last modified 9 years ago

drag-out – Should be able to drag resources out of Sophie

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: Changelog
Design_reviewers: meddle Imp._reviewers: kyli
Test_reviewers: Analysis_score: 4
Design_score: 3.5 Imp._score: 2
Test_score: 0

Description (last modified by deyan) (diff)

Should be able to select multiple resources from the resources palette and drag them out of the Sophie window. This should export all of the resources as different files depending on their type.


drag-out-to-file-system.patch (20.9 KB) - added by deni 10 years ago.

Change History

comment:1 Changed 10 years ago by deyan

  • Description modified (diff)

Batch update from file 2401.csv

comment:2 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:3 Changed 10 years ago by deni

  • Design_owners set to deni
  • Owner set to deni
  • Status changed from new to s1a_analysis_started
  • Imp._owners set to deni

comment:4 Changed 10 years ago by deni

  • Status changed from s1a_analysis_started to s1b_analysis_finished

comment:5 Changed 10 years ago by deni

  • Status changed from s1b_analysis_finished to s1c_analysis_ok
  • Analysis_reviewers set to deni
  • Analysis_score changed from 0 to 4
  • Will be implemented only for a single resource, partly because selecting multiple resources in a palette is not currently supported.
  • All resources will be exported in Sophie2 format.

comment:6 Changed 10 years ago by deni

  • Status changed from s1c_analysis_ok to s2a_design_started

comment:7 Changed 10 years ago by deni

  • Status changed from s2a_design_started to s2b_design_finished
  • FileListData changes:
    • Make the List<File> getFiles() method abstract.
    • When the FileListDndProvider creates a new FileListData, the abstract method should be implemented. Move its current implementation there.
  • CommonResourceDataProvider and ResourceTransferable changes:
    • CommonResourceDataProvider should be an extension for datas that all resources provide. This can be achieved in two ways:
      • Make all other ResourceDataProviders extend it, or
      • In ResourceTransferable.registerData(List<DndData>) register the datas from all appropriate providers (i.e. remove the 'return' statement).
      • I prefer the second option, because it is easier to implement.
    • CommonResourceDataProvider should provide FileListData, in addition to ResourceRef- and ResourceRevisionData.
      • It will use SophieFormatExportManager to export the resources into files.
      • In order to initialize the format manager, it will need the current resource locator. It will get it from the transferable.
    • ResourceTransferable will have a new ResourceLocator private field, a getter for it and an argument in the constructor.
  • Exporting ResourceTransferables when dragging out of the Resources palette is already written - AllResourcesPaletteLogic.ON_DND_EXPORT
  • Problems with the current implementation:
    • Copy/paste of frames - instead of pasting the frame, an error message that the file cannot be pasted appears. Maybe we should make sure that the operation for pasting frames is with higher priority that the one that handles pasting files.
    • There is something wrong with the dependencies between modules. I need main.dnd to depend on main.func.resources in order to use an ExportManager in CommonResourceDataProvider, but it caused a cyclic dependency.
      • I moved CommonResourceDataProvider in main.func.resources and it worked.
    • I think that as soon as you copy or start dragging a resource, the file is created somewhere (when running fake in sophie2-platform/modules/org.sophie2.launcher). Probably it should be removed...

Changed 10 years ago by deni

comment:8 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
  • I think the design passes, please make sure that there are no exceptions...
  • For the implementation, attach new patch, this one can not be applied, I lost 15 minutes trying to work it out...


comment:9 Changed 10 years ago by deni

  • Status changed from s2c_design_ok to s3a_implementation_started

comment:10 Changed 10 years ago by deni

  • Status changed from s3a_implementation_started to s3b_implementation_finished
  • CommonResourceDataProvider was moved to main.func.resources.
  • All files created when copying or dragging a resource are in the temp folder. They are not created by File.createTemFile(...), because it changes their names. However they should be deleted when the JVM in which Sophie is running stops.
  • I changed the sortkeys of the operations in ResourceImportLogic so that dropping a resource is before dropping a file.
  • Source code: [8664]

comment:11 Changed 10 years ago by deni

  • Status changed from s3b_implementation_finished to s2c_design_ok

comment:12 Changed 10 years ago by deni

  • Status changed from s2c_design_ok to s3a_implementation_started

comment:13 Changed 10 years ago by deni

  • Status changed from s3a_implementation_started to s3b_implementation_finished
  • Split FileListData in two classes.
    • The data flavors it supports have different representation classes (List<File> for javaFileListFlavor and String for "text/uri-list"). When exporting it to awt transferable, a ClassCastException was thrown.
    • abstract class BaseFileListData extends DndData - Base class for implementations of DndData responsible for transferring files.
      • All logics that previously worked with FileListData will now work with the base class.
    • abstract class JavaFileListData extends BaseFileListData - uses DataFlavor.javaFileListFlavor}
    • abstract class URIListData extends BaseFileListData - uses "text/uri-list;class=java.lang.String" data flavor.
  • Make sure that there are no conflicts between ON_DROP_FILE and ON_DROP_RESOURCE_OVER_PWA operations:
    • ON_DROP_FILE should be first, because when dragging files inside Sophie in Linux, we have both plain text and "uri-list" datas. If the ON_DROP_RESOURCE_OVER_PWA is first, it will insert a new text frame with the filenames as content. However, this is not the expected behavour.
    • In ON_DROP_FILE we should check whether the transferable contains ResourceRef- or ResourceRevisionData. If so, it should not handle the event. This is necessary, because we don't want to go through files when tranferring resources internally, although ResourceTransferables have file data and this is possible.

comment:14 Changed 10 years ago by deni

  • Please review this ticket together with #2302

comment:15 Changed 10 years ago by kyli

  • Status changed from s3b_implementation_finished to s2c_design_ok
  • Imp._reviewers set to kyli
  • Imp._score changed from 0 to 2
  • Changelog set to [wiki:Changelog]
  • The results from the testing were that this code does not work on some linux platforms (I was testing it on 64 bit Ubuntu 9.04 and received "Operation not supported" error. Same was in 32 bit Fedora. It runs OK on Windows, Mac and 64 bit Debian). Please, inspect the problems with the platforms I mentioned.
  • Implementations based on this one should be done in the branches/private/kyli/dnd branch. It contains all the code so far, as well it is merged with the current trunk. The old branch causes too much conflicts.


comment:16 Changed 9 years ago by meddle

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

Closing all the tickets before M Y1

Note: See TracTickets for help on using tickets.