Skip to content

LT-21960: Fix export for multiple reversals and filtering#464

Merged
mark-sil merged 4 commits into
release/9.3from
LT-21960b
Sep 23, 2025
Merged

LT-21960: Fix export for multiple reversals and filtering#464
mark-sil merged 4 commits into
release/9.3from
LT-21960b

Conversation

@mark-sil

@mark-sil mark-sil commented Sep 17, 2025

Copy link
Copy Markdown
Contributor

When exporting to Word, Webonary, or XHTML, we now get the entry data from direct data access, instead of relying on the GUI to display the data we want to get.
The GUI updates were mostly being done through property change notifications or mediator messages. The problems we were seeing was when these notifications and messages were combined with the many existing special cases where we don’t want to update the GUI, or we want to delay the GUI update. Getting the combination correct to fix one situation was resulting in other situations that were incorrect.

Problems resolved:

  • Exporting multiple reversals to Word or Webonary.
  • Exporting multiple reversals with different filtering to Word or Webonary.
  • Exporting to Word, Webonary, or XHTML immediately after starting Flex. In this state, depending on what is being viewed, either the main dictionary clerk or the reversal clerk has been created, but not both.
  • The GUI no longer flash with visual updates while doing an export.

Notes:
Since now we are getting the entry text without calling XmlBrowseViewBaseVc.DisplayCell(), we no longer need the changes that were added to fix LT-21198. This PR also removes the change in Commit 0503457 that added OverrideWs.

Remaining Issues:

  • Exporting multiple reversals with different sorting to Word or Webonary.
  • When there are multiple reversals with different sorting then the display in Flex can also sometimes be incorrect.

This change is Reviewable

When exporting to Word, Webonary, or XHTML, we now get the
entry data from direct data access, instead of relying on the
GUI to display the data we want to get.
The GUI updates were mostly being done through property change
notifications or mediator messages.  The problems we were seeing
was when these notifications and messages were combined with the
many existing special cases where we don’t want to update the GUI,
or we want to delay the GUI update. Getting the combination
correct to fix one situation was resulting in other situations
that were incorrect.

Problems resolved:
- Exporting multiple reversals to Word or Webonary.
- Exporting multiple reversals with different filtering
to Word or Webonary.
- Exporting to Word, Webonary, or XHTML immediately after starting
Flex. In this state, depending on what is being viewed, either the
main dictionary clerk or the reversal clerk has been created, but
not both.
- The GUI no longer flash with visual updates while doing an export.

Notes:
Since now we are getting the entry text without calling
XmlBrowseViewBaseVc.DisplayCell(), we no longer need the changes
that were added to fix LT-21198. This PR also removes the change
in Commit 0503457 that added OverrideWs.

Remaining Issues:
- Exporting multiple reversals with different sorting
to Word or Webonary.
- When there are multiple reversals with different sorting
then the display in Flex can also sometimes be incorrect.

Change-Id: Ie091b69b8f06ba16659e032cf0a908abb85076bd
Change-Id: Ie913ead92119f9152b45c36c02677ab46410955b

@jasonleenaylor jasonleenaylor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jasonleenaylor reviewed 39 of 41 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @mark-sil)


Src/xWorks/DictionaryConfigurationModel.cs line 340 at r2 (raw file):

		/// Gets the reversal configuration model for the specified writing system.
		/// </summary>
		public static DictionaryConfigurationModel GetReversalConfigurationModel(string ws, LcmCache cache, PropertyTable propTable)

I'm sure this method existed somewhere already...or did you move it.


Src/xWorks/RecordClerk.cs line 476 at r2 (raw file):

		{
			CheckDisposed();
			return m_list.PropertyTableId("sorter", dictConfig);

Does this handle 'null' safely?


Src/xWorks/RecordClerk.cs line 3092 at r2 (raw file):

		/// </summary>
		/// <param name="reversalGuid">The Guid that identifies the reversal.</param>
		public int[] GetReversalFilteredAndSortedEntries(Guid reversalGuid, DictionaryPublicationDecorator decorator, DictionaryConfigurationModel revConfig)

I don't love having these methods here. RecordClerk should in theory be ignorant of such specific list types.
Could they be added as extension methods from some Dictionary or Reversal classes?

Code quote:

		/// <summary>
		/// Gets the filtered and sorted dictionary entries.
		/// </summary>
		public int[] GetDictionaryFilteredAndSortedEntries(DictionaryPublicationDecorator decorator)
		{
			// Filters and Sorts the list, then populates the virtual cache with the result.
			m_list.FilterAndSortList();

			// Gets the entries from the virtual cache.
			int[] retEntries = decorator.VecProp(Cache.LangProject.LexDbOA.Hvo, VirtualFlid);

			return retEntries;
		}

		/// <summary>
		/// Gets the filtered and sorted entries for the specified reversal.
		/// </summary>
		/// <param name="reversalGuid">The Guid that identifies the reversal.</param>
		public int[] GetReversalFilteredAndSortedEntries(Guid reversalGuid, DictionaryPublicationDecorator decorator, DictionaryConfigurationModel revConfig)

Change-Id: Ie322f50fda6323863deafe65efec227b81005c7f

@mark-sil mark-sil left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 37 of 41 files reviewed, all discussions resolved (waiting on @jasonleenaylor)


Src/xWorks/DictionaryConfigurationModel.cs line 340 at r2 (raw file):

Previously, jasonleenaylor (Jason Naylor) wrote…

I'm sure this method existed somewhere already...or did you move it.

I don’t think it previously existed.  Part of it came from FwXWindow.ShowUploadToWebonaryDialog().


Src/xWorks/RecordClerk.cs line 476 at r2 (raw file):

Previously, jasonleenaylor (Jason Naylor) wrote…

Does this handle 'null' safely?

I think it does. Only the override for reversals uses the config, and if it is null then PropertyTableId() falls back to the old behavior of getting the "ReversalIndexPublicationLayout" from the property table; which should only happen when the Gui is being used.


Src/xWorks/RecordClerk.cs line 3092 at r2 (raw file):

Previously, jasonleenaylor (Jason Naylor) wrote…

I don't love having these methods here. RecordClerk should in theory be ignorant of such specific list types.
Could they be added as extension methods from some Dictionary or Reversal classes?

   Moved methods to ExportService

@jasonleenaylor jasonleenaylor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

@jasonleenaylor reviewed 4 of 4 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @mark-sil)

@mark-sil mark-sil merged commit 699d1ad into release/9.3 Sep 23, 2025
5 checks passed
@mark-sil mark-sil deleted the LT-21960b branch September 23, 2025 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants