Bug 458197 - [Profile Applications] Customized DSML palettes not enabled in UI when loading Profile Applications
Summary: [Profile Applications] Customized DSML palettes not enabled in UI when loadin...
Status: VERIFIED FIXED
Alias: None
Product: Papyrus
Classification: Modeling
Component: Core (show other bugs)
Version: 1.1.0   Edit
Hardware: All All
: P2 major (vote)
Target Milestone: M5   Edit
Assignee: Christian Damus CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 431953 431957 457712
Blocks: 399859 438966
  Show dependency tree
 
Reported: 2015-01-22 18:03 EST by Toni Siljamäki CLA
Modified: 2015-02-10 11:21 EST (History)
5 users (show)

See Also:


Attachments
Test sequence for Customized DSML UI for models with separate Profile Applications (1.41 MB, application/vnd.openxmlformats-officedocument.presentationml.presentation)
2015-01-22 18:03 EST, Toni Siljamäki CLA
no flags Details
PW protected test case (7.98 MB, application/octet-stream)
2015-01-22 18:10 EST, Toni Siljamäki CLA
no flags Details
Small error log (20.53 KB, application/octet-stream)
2015-02-10 10:59 EST, Toni Siljamäki CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Toni Siljamäki CLA 2015-01-22 18:03:26 EST
Created attachment 250163 [details]
Test sequence for Customized DSML UI for models with separate Profile Applications

As demo'ed at EclipseCon :), in Papyrus we can have multiple integrated DSML's
in this "grand" system model (also with plain UML), each having their own and
DSML-customized UI automatically enabled when opening a particular DSML model.

The customized UI is of course based on the DSML profile(s), so when we open
a particular DSML model, Papyrus automatically adapts itself, displaying a
customized UI designed for the opened DSML model. :)

PROBLEM: The DSML-customized-UI must also be automatically enabled when loading
separate Profile Applications into a DSML model, which not is the case today,
hence this bugzilla report.

Attaching the test sequence here so that it can be tried out by other
DSML developers, who hopefully can contribute additional test cases. :)
Comment 1 Toni Siljamäki CLA 2015-01-22 18:10:48 EST
Created attachment 250164 [details]
PW protected test case

This is a 7-zip password protected test case. (PW provided earlier)
Comment 2 Christian Damus CLA 2015-01-27 14:49:01 EST
Indeed.  Nothing is telling the palette service that a profile has been loaded and that it needs to refresh the palette.

I have an idea how to fix this.  This won't be the first component that needs notification when profile applications come and go that are externalized.
Comment 3 Christian Damus CLA 2015-01-27 14:59:21 EST
The same problem is reproducible in a non-externalization scenario.  It happens also if I delete the profile application and then undo.

When I delete the profile application, the palette is properly updated.  On undo, the profile application and all stereotypes are restored, but the palette does not show the profile-specific drawers and tools.
Comment 4 Toni Siljamäki CLA 2015-01-27 17:10:43 EST
This is a Marking Model / Profile Application and DSL UI customization
issue that simply must work, just like issues related to Bug 457712.

Customized UI refresh is an issue also reported earlier (like F5 issues),
mostly about automatic refreshes related to stylesheet rendering of diagrams.

In this particular case, AFTER loading the profile application,
you can manually enable the UI palettes again by:

1) right-click in the palette
2) select "customize"
3) uncheck and check the check-box for the palette

...and the palette gets available again. :)
...without clicking "OK" or anything.

This test can be repeated again right after unloading-and-loading
the profile application.
Comment 5 Christian Damus CLA 2015-01-28 00:42:12 EST
(In reply to Toni Siljamäki from comment #4)
> This is a Marking Model / Profile Application and DSL UI customization
> issue that simply must work, just like issues related to Bug 457712.

That is why this was assigned for resolution within the Mars M5 milestone.

I have pushed a patch to Gerrit for review:

  https://git.eclipse.org/r/40518

This adds a new Profile Application Service that detects when profiles are applied to and unapplied from packages and notifies interested listeners of those changes.  So, the Palette Service now adds itself as a listener on the Profile Application Service to refresh itself when profile applications come and go.  This replaces the previous IPapyrusListener-based refresh trigger.

The Profile Application Service also allows clients to inject application/unapplication events that it otherwise could not detect on its own.  The DecoratorModel that handles loading of profile-application models makes use of this capability to let clients of the Profile Application Service know when externalized profiles have been loaded (unloads take care of themselves via the usual notification mechanism).

The Gerrit patch also contains a bunch of unit tests covering profile-application change scenarios of various complexity to verify the unfortunately complex analysis of notifications from the editing domain, owing to the fact that changes in either or both of the profile-applications list of a package and applied-profile reference of an application constitute application/unapplication of a profile on a package.  These tests are in a new test fragment, as there previously were no tests for the oep.uml.profile plug-in that defines the new service.
Comment 6 Toni Siljamäki CLA 2015-01-28 10:06:55 EST
Great!
Additional bugzilla coming soon, on a related "refresh" issue.
Comment 7 Camille Letavernier CLA 2015-02-10 04:38:11 EST
> I have pushed a patch to Gerrit for review:
> 
> https://git.eclipse.org/r/40518

The contribution has been merged into master
Comment 8 Toni Siljamäki CLA 2015-02-10 05:08:32 EST
Can it be tested today?
/Toni
Comment 9 Camille Letavernier CLA 2015-02-10 05:11:48 EST
> Can it be tested today?

The Mars Nightly build including the patch is published. So I guess it can
Comment 10 Christian Damus CLA 2015-02-10 08:26:22 EST
(In reply to Camille Letavernier from comment #7)
> > I have pushed a patch to Gerrit for review:
> > 
> > https://git.eclipse.org/r/40518
> 
> The contribution has been merged into master

Thanks, Camille!

That should resolve this bug (I'll double-check later, as it has been a while and the landscape may have changed).
Comment 11 Toni Siljamäki CLA 2015-02-10 10:51:13 EST
Yes, this one works now, thanx, that is, enabling the DSL palette.

I got some other strange errors though when ceating the profile application
and loading/unloading it several times. I'm having also the test model
attached to Bug 459488 in my workspace, and at one point some error was detected in that model (but I did not have it open), and then the created
profile application was lost.

Maybe the error happened when scanning the workspace for
profile application models?

I'm not able to easily reproduce that error, but the pop-up window
complaned a href being null, or something.
Comment 12 Christian Damus CLA 2015-02-10 10:53:56 EST
(In reply to Toni Siljamäki from comment #11)
> 
> Maybe the error happened when scanning the workspace for
> profile application models?

Yes, we're having some issues with concurrent initialization of EPackages in that scan (bug 456934) which I'm looking into now, together with Camille.


> I'm not able to easily reproduce that error, but the pop-up window
> complaned a href being null, or something.

I'll want to look into it when you do reproduce it again, so keep your eyes peeled! :-)
Comment 13 Toni Siljamäki CLA 2015-02-10 10:59:51 EST
Created attachment 250682 [details]
Small error log

Attached are some errors that happened, but not every time.
...for instance reerences to missing classes etc.
Comment 14 Toni Siljamäki CLA 2015-02-10 11:04:03 EST
These errors in the log happens every time I restart Eclipse/Papyrus.
Comment 15 Christian Damus CLA 2015-02-10 11:21:56 EST
(In reply to Toni Siljamäki from comment #13)
> Created attachment 250682 [details]
> Small error log
> 
> Attached are some errors that happened, but not every time.
> ...for instance reerences to missing classes etc.

Thanks, Toni.  These exceptions are related to the new modelled element types framework that was merged to master over the week-end.  Nothing to do with separate profile applications or the palette.  And also not the problem I was thinking of in concurrent EPackage registration.  I've raised bug 459573 for these exceptions.