-
-
Notifications
You must be signed in to change notification settings - Fork 125
feature: introduce TracWiki/MediaWiki/TranslateWiki connectors and an external service integration API #1748
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
- 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>
- 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>
- 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>
This comment was marked as resolved.
This comment was marked as resolved.
- 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>
|
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>
|
❌ Quality checks failed. Please look a Gradle Scan page for details: |
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
|
❌ Quality checks failed. Please look a Gradle Scan page for details: |
miurahr
left a comment
There was a problem hiding this 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
src/org/omegat/connectors/gui/ExternalServiceConnectorPreferencesPanel.java
Outdated
Show resolved
Hide resolved
Refactor ExternalServiceTargetEditor to use instance buttons and improve layout.
This comment was marked as off-topic.
This comment was marked as off-topic.
|
Please clean module file produced in another Pull-Request or master branch.
|
|
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. |
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
Which ticket is resolved?
What does this PR change?
Other information
TODO Actions: