Class ReTranslateKeysServiceImpl
- All Implemented Interfaces:
ReTranslateKeysService
- Since:
- 8.2.5
-
Constructor Summary
ConstructorsConstructorDescriptionReTranslateKeysServiceImpl(ApplicationProperties appProps, I18nHelper.BeanFactory i18nFactory, OfBizDelegator ofBizDelegator, com.atlassian.event.api.EventPublisher eventPublisher, QueryDslAccessor queryDslAccessor, JiraAuthenticationContext authContext, GlobalPermissionManager globalPermissionManager) -
Method Summary
Modifier and TypeMethodDescriptiondryRunReTranslateAllKeys(String tableOrEntityName, String columnOrFieldName, String keyName) Does a "dry run" of replacing all occurrences ofkeywith its default jira i18n translation in the table invalid input: '&' column specified bytableOrEntityNameinvalid input: '&'columnOrFieldName.reTranslateAllKeys(String tableOrEntityName, String columnOrFieldName, String keyName) Replaces all occurrences ofkeywith its default jira i18n translation in the table invalid input: '&' column specified bytableOrEntityNameinvalid input: '&'columnOrFieldName.
-
Constructor Details
-
ReTranslateKeysServiceImpl
public ReTranslateKeysServiceImpl(ApplicationProperties appProps, I18nHelper.BeanFactory i18nFactory, OfBizDelegator ofBizDelegator, com.atlassian.event.api.EventPublisher eventPublisher, QueryDslAccessor queryDslAccessor, JiraAuthenticationContext authContext, GlobalPermissionManager globalPermissionManager)
-
-
Method Details
-
dryRunReTranslateAllKeys
public ServiceOutcome<List<Pair<String,String>>> dryRunReTranslateAllKeys(String tableOrEntityName, String columnOrFieldName, String keyName) Description copied from interface:ReTranslateKeysServiceDoes a "dry run" of replacing all occurrences ofkeywith its default jira i18n translation in the table invalid input: '&' column specified bytableOrEntityNameinvalid input: '&'columnOrFieldName. Table invalid input: '&' column apply to AO tables; iftableOrEntityNamestarts with "AO_", then the assumption is that plugin tables are being targeted. Otherwise, we assume that Jira table is the intended target, and the first two parameters are interpreted as entityname and fieldname. These are OfBiz constructs that differ from raw table invalid input: '&' column names--for a full inventory of them, see Jira's entitymodel.xml file.This method has no side-effects. Values are read directly from the database, but nothing is written out to it.
This method is a way of previewing the results of a key-translation operation before actually applying it via
ReTranslateKeysService.reTranslateAllKeys(java.lang.String, java.lang.String, java.lang.String).- Specified by:
dryRunReTranslateAllKeysin interfaceReTranslateKeysService- Parameters:
tableOrEntityName- Either a plugins "AO_" style table name or a jira OfBiz-style entity name to check for translationscolumnOrFieldName- Either the name of a column from an AO-based table or an OfBiz-style field-namekeyName- an i18n key that will be replaced with its default jira i18n translation- Returns:
- A ServiceOutcome that contains a List of proposed translations OR the reasons for the call's failure.
-
reTranslateAllKeys
public ServiceOutcome<List<Pair<String,String>>> reTranslateAllKeys(String tableOrEntityName, String columnOrFieldName, String keyName) Description copied from interface:ReTranslateKeysServiceReplaces all occurrences ofkeywith its default jira i18n translation in the table invalid input: '&' column specified bytableOrEntityNameinvalid input: '&'columnOrFieldName. Table invalid input: '&' column apply to AO tables; iftableOrEntityNamestarts with "AO_", then the assumption is that plugin tables are being targeted. Otherwise, we assume that Jira table is the intended target, and the first two parameters are interpreted as entityname and fieldname. These are OfBiz constructs that differ from raw table invalid input: '&' column names--for a full inventory of them, see Jira's entitymodel.xml file.These transformations are applied to the database and overwrite the original text.
Clients should call
ReTranslateKeysService.dryRunReTranslateAllKeys(java.lang.String, java.lang.String, java.lang.String)first to check the expected translations without actually writing them out to the db.Note: When updating an AO table, a restart of either the affected plugins or all of Jira may be required in order for the changes to propagate from the database up into the plugins' caches.
- Specified by:
reTranslateAllKeysin interfaceReTranslateKeysService- Parameters:
tableOrEntityName- Either a plugins "AO_" style table name or a jira OfBiz-style entity name to check for translationscolumnOrFieldName- Either the name of a column from an AO-based table or an OfBiz-style field-namekeyName- an i18n key that will be replaced with its default jira i18n translation- Returns:
- A ServiceOutcome that contains a List of the translations carried out in the db OR the reasons for the call's failure.
-