nasa/mct — pull request #148 by VWoeltjen (2013-08-15 18:02:56+00:00)
Title: [Save All] Resolve save all related issues to support Scenario plug-in

This pull request partially resolves nasa/MCT-Plugins#30 and nasa/MCT-Plugins#33

Two main changes:
* Save All now always saves the top-level component on which it is invoked, even if it is not marked dirty. This is primarily to hook into necessary commit-cycle events such as viewPersisted(), which plug-ins would expect to be invoked. Side effects may include marking other manifestations of the top-level component as "stale" even if the only real changes have occurred to referenced components; this seems appropriate, though, as by definition Save All is only relevant if a component incorporates elements of child models for at least one view.
* Persistence marks "work units delegates" as stale for similar purposes; a component's work unit delegate manages it in some context, such as a Collection component manages sub-components in a canvas view. Because the version of the work unit delegate has not actually changed, it was previously marked stale using a "nuclear option" approach of treating the incoming version as though it were Integer.MAX_VALUE. This was overly aggressive and caused up-to-date views to be marked stale in several circumstances (such as nasa/MCT-Plugins#33). This pull request adds a separate setStaleByVersion method which specifies the component id of the updated object; this way, components can find the actual descendant that has changed and see if its actual version is out-of-date (thus only marking themselves stale if it is really necessary)

Wrote or re-wrote unit tests (Y/N): Y
Ran entire suite of unit tests successfully (Y/N): Y
Verified bug fix with the replication steps in issue or verified that implementation meets the requirement cited in issue (Y/N): Y
Code coverage requirements satisfied (new code=80%, changed code=at least as high as existing) (Y/N): Y
Code review date and attendees: Code review by pull request
Describe potential impact on other areas of the code: Save All, Canvas
Describe any test prerequisites for this fix (e.g., restart the database): N/A
If bug is a regression, describe the cause: N/A
Did you modify any pom.xml file? If yes, change must be approved by PM. N