Skip to content

Conversation

@miurahr
Copy link
Member

@miurahr miurahr commented Oct 29, 2025

This Pull Request introduces an exernal system integration module to manage external projects within OmegaT. It includes new connectors, configurations, utilities, and graphical interfaces for interaction with the external systems.

Pull request type

  • Feature enhancement -> [enhancement]

Which ticket is resolved?

What does this PR change?

  • New Module Setup: Added a new cmsconnectors module, including build.gradle and configuration files.
  • Core external system Connectors:
    • AbstractExternalSystemConnector.java: Base class with common defaults for connectors.
    • ExternalSystemConnectors.java: Centralized registry to manage connectors.
    • ExternalSystemConnector.java & ConnectorCapability.java: Interface and enumeration for defining connectors' behaviors and capabilities.
  • Wikimedia Connector:
    • WikimediaConnector.java: Implements integration for Wikimedia/MediaWiki content retrieval.
  • Translatewiki.net Connector:
    • TranslatewikiConnector.java: Implements integration for TranslateWiki project group search and PO data download.
  • TracWiki Connector:
    • TracWikiConnector.java: Trac project management system integration for downloading wiki contents.
  • DTO Models:
    • Added models (ExternalResource, ServiceTarget, and ExternalProject) for representing related data.
  • External system connection Configuration:
    • ExternalConnectorConfig.java and ExternalConnectorXmlStore.java: Handle application-wide configuration persistence into an XML file.
  • User Interface:
    • ExternalServiceConnectorPanel & ExternalServicePanelController: GUI additions for importing resources from the external systems.
  • ExternalServicePreferencesPanel & ExternalServicePreferencesController: Preferences UI for managing targets.
  • Core Integration:
    • Updated Core and CoreState to support the connectors.
    • Integrated the tools into the OmegaT main menu.

Other information

TODO Actions:

  • Unit tests and functional tests
  • Implement the logic to download Wikimedia page
  • Implement to retrieve page list from translatewiki.net
  • Implement page search feature on the menu the import dialog
  • Refactor retrieve page logic into ExternalRetrieve class

- Introduced a new `CmsConnector` SPI for external CMS support.
- Added `AbstractCmsConnector` base class with common helper methods and default implementations.
- Implemented DTOs (`CmsProject`, `CmsResource`, `CmsTarget`) for CMS integration.
- Provided `CmsConnectors` registry for managing CMS connectors.
- Added user interface components such as `CmsPanel`, `CmsConfigPanel`, and `CmsSyncDialog` for CMS interaction.
- Included `CmsPreferencesPanel` and `CmsPreferencesController` for managing CMS configurations.
- Enabled XML-based persistence for CMS settings through `CmsXmlStore`.

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
- Introduced `WikimediaConnector` for integrating with MediaWiki content.
- Added project and resource listing methods with placeholder/initial implementations.
- Registered connector with the CMS framework for plugin load/unload support.
- Configured build system with `build.gradle` and `gradle.properties` for module setup.

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
@miurahr miurahr changed the title topic/miurahr/externalget/interoperate-cms feature: realize CMS integration plugins Oct 29, 2025
- Reformatted CMS-related classes for better readability and alignment.
- Added missing GNU GPL license headers to several files.
- Improved variable initialization and refactored control flow for clarity.
- Applied consistent indentation and spacing across the CMS module.
- Enhanced comments and documentation for CMS panel and configuration classes.

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
- Removed unused `CmsTarget` default constructor and legacy JSON preference constant.
- Updated `CmsXmlStore.saveTargets` to void and adjusted related logic.
- Eliminated redundant variables and increment statements in `CmsPanel` and `CmsPreferencesPanel`.
- Refined exception logic in `AbstractCmsConnector.fetchResource`.

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
- Removed unused setters in `CmsTarget` and transitioned mutable fields to `final`.
- Replaced instance fields with local variables for buttons in `CmsPanel` and `CmsPreferencesPanel`.
- Eliminated legacy dialog methods and unused imports in `AbstractCmsConnector`.

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
- Added GNU GPL license headers to `CmsPreferencesController` and `CmsPreferencesPanel`.
- Improved code readability by aligning variable naming (e.g., `config` to `CONFIG`) in `WikimediaConnector`.
- Enclosed conditional block in `CmsPanel.getSelectedConnector()` for clarity.

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
- Renamed labels and buttons in `CmsPanel` to use localized string constants.
- Improved consistency and readability of string resource definitions in `Bundle.properties`.
- Replaced hardcoded strings with `OStrings` references for better localization support.
- Removed unused pre-fill logic in `CmsPanel.loadDefaults`.
- Simplified file path resolution in `CmsPanelController`.

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
- Added `CmsPreferencesController` to preferences window setup.
- Updated `CmsTarget` to include a default constructor and make fields mutable.

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
- Moved resource and URL retrieval logic to new `CmsRetrieval` class for better separation of concerns.
- Updated `CmsPanelController` to use `CmsRetrieval` for resource handling.
- Improved file naming logic and ensured directories are created before file write.
- Removed redundant imports and simplified control flow in `CmsPanelController`.

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
- Removed `projectId` parameter from `retrieveResourceFromUrl` method.
- Added overload method `fetchResource(String url)` to `CmsConnector` and updated implementations.
- Adjusted `CmsPanelController` logic to reflect API changes.
- Improved exception handling in `AbstractCmsConnector`.

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
- Renamed `cms` to `connectors` throughout the codebase for improved clarity and modularity.
- Updated class names, methods, and packages to align with the new `connectors` nomenclature.
- Adjusted file paths, build scripts, and settings to reflect module restructuring.

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
- Introduced `WikimediaConnector` and `TracWikiConnector` as new external service connectors.
- Updated `settings.gradle` to include the new connectors.
- Added build configurations, properties files, and Java classes for both connectors.
- Adjusted package structures and dependencies for consistency.

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
- Renamed `AbstractConnector` to `AbstractExternalServiceConnector` for better clarity.
- Updated comments, file names, and references to align with "external service connectors" terminology.
- Renamed CMS-related terms in DTOs, exceptions, and capabilities for consistency.

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
- Updated default file name from `external-resource.txt` to `external-service-resource.txt`.
- Aligned file naming conventions in `ExternalServiceRetrieval` for consistency.

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
@miurahr miurahr changed the title feature: realize CMS integration plugins feat: introduce External service integration SPI/API Nov 2, 2025
@omegat-org omegat-org deleted a comment from github-actions bot Nov 2, 2025
@omegat-org omegat-org deleted a comment from github-actions bot Nov 2, 2025
@omegat-org omegat-org deleted a comment from github-actions bot Nov 2, 2025
@omegat-org omegat-org deleted a comment from github-actions bot Nov 2, 2025
@omegat-org omegat-org deleted a comment from github-actions bot Nov 2, 2025
@omegat-org omegat-org deleted a comment from github-actions bot Nov 2, 2025
@omegat-org omegat-org deleted a comment from github-actions bot Nov 2, 2025
@omegat-org omegat-org deleted a comment from github-actions bot Nov 2, 2025
@omegat-org omegat-org deleted a comment from github-actions bot Nov 2, 2025
@omegat-org omegat-org deleted a comment from github-actions bot Nov 2, 2025
@omegat-org omegat-org deleted a comment from github-actions bot Nov 2, 2025
@omegat-org omegat-org deleted a comment from github-actions bot Nov 2, 2025
- Added comprehensive Javadoc for `TracWikiConnector` to document its functionality and features.

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
- Moved plural forms data and logic from `PoFilter` to new `PluralData` and `PluralInfo` utility classes.
- Simplified `PoFilter` by delegating plural forms handling to `PluralData`.

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
- Replaced hardcoded plural rules initialization in `PluralData` with loading from a `plurals.properties` file.
- Added a new constructor for `PluralInfo` to parse gettext-like plural definitions.
- Improved code maintainability by externalizing plural rules.

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
- Added `getGettextExpression` method in `PluralInfo` to generate gettext-style plural form expressions.
- Updated `PoFilter` to utilize `PluralInfo#getGettextExpression` for cleaner and maintainable code.

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
…conversion and enhanced tests

- Added `convertJsonToPo` method to TranslateWikiConnector for JSON-to-PO conversion.
- Introduced `fetchResourceAsJson` to streamline resource fetching logic.
- Updated unit tests to cover new functionality and added detailed validation.
- Refined test resources with additional payloads and expected PO outputs.
- Added `@VisibleForTesting` annotations for better testing practices.

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
@github-actions

This comment was marked as resolved.

@miurahr miurahr changed the title feat: introduce External service integration SPI/API feature: introduce TracWiki/MediaWiki/TranslateWiki connectors and an external service integration API Dec 12, 2025
- Added GPL license header to `PluralInfo` for compliance.
- Made `PluralData` a `final` class for immutability.
- Removed unused imports from `PoFilter` to improve code cleanliness.

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
@miurahr
Copy link
Member Author

miurahr commented Dec 16, 2025

It is better to change a package name of PluralData class to be "org.omegat.util.plural".

- Relocated `PluralData` and `PluralInfo` from `org.omegat.util.nlp` to `org.omegat.util.plural` for better package structure.
- Updated imports in related classes (`PoFilter`, `TranslateWikiConnector`) accordingly.

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
…d comment format

- Converted multi-line license block to standard single-line format across connectors.
- Simplified headers in `package-info.java` for alignment with current project conventions.

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
…viceConnectorPreferencesController`

- Removed redundant `loadFromPrefs` and `saveToPrefs` methods in `ExternalServiceConnectorPreferencesPanel`.
- Centralized preferences persistence logic in `ExternalServiceConnectorPreferencesController` using `ExternalConnectorXmlStore`.
- Updated `panel` fields to nullable and improved null-check handling.

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
- Added `PresetService` DTO to represent preset connectors with default URLs.
- Enhanced `IExternalServiceConnector` to include `getPresets` method for returning service presets.
- Replaced `allowCustomUrl` with `ConnectorCapability.READ_URL` for clarity in URL handling.
- Updated preferences panel to support preset selection and customize base URL.
- Implemented presets for `WikimediaCleanUrlConnector`, `TranslateWikiConnector`, and `TracWikiConnector`.

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
- Renamed property keys in `Bundle.properties` for consistency and clarity.
- Added new optional "Preset" fields in preferences with default "Custom" value.
- Changed TranslateWikiConnector's file extension from JSON to PO.
- Simplified and improved preset handling logic in connectors and preferences panel.

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
@github-actions
Copy link

❌ Quality checks failed.

Please look a Gradle Scan page for details:
https://gradle.com/s/mn46nu7ysr5hy

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
@github-actions
Copy link

❌ Quality checks failed.

Please look a Gradle Scan page for details:
https://gradle.com/s/sdkjupfceiwsq

Copy link
Member Author

@miurahr miurahr left a comment

Choose a reason for hiding this comment

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

Style: remove unused imports and if with braces

@omegat-org omegat-org deleted a comment from github-actions bot Dec 17, 2025
@omegat-org omegat-org deleted a comment from github-actions bot Dec 17, 2025
@omegat-org omegat-org deleted a comment from github-actions bot Dec 17, 2025
@brandelune

This comment was marked as off-topic.

@miurahr
Copy link
Member Author

miurahr commented Dec 23, 2025

Please clean module file produced in another Pull-Request or master branch.

I get a number of errors when doing ./gradlew run on this branch. Notably this one :

@brandelune
Copy link
Contributor

The feature seems nice but the dialog is a bit complex and since there are no explanations (no manual files either) I’m not sure how to deal with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants