Class ReTranslateKeysInternalResource

java.lang.Object
com.atlassian.jira.rest.internal.v2.retranslatekeys.ReTranslateKeysInternalResource

@Path("retranslatekeys") @Produces("application/json") @Consumes("application/json") public class ReTranslateKeysInternalResource extends Object
Resource for testing out and applying i18n key replacements to the contents of a specified db table invalid input: '&' column. Both Ofbiz/Jira core and ActiveObjects/Plugin tables can be targeted, although the incantations are slightly different in each case.
Since:
8.2.5
  • Constructor Details

  • Method Details

    • dryRunReTranslateAllKeys

      @GET @Path("{tableOrEntityName}/{columnOrFieldName}") public jakarta.ws.rs.core.Response dryRunReTranslateAllKeys(@PathParam("tableOrEntityName") String tableOrEntityName, @PathParam("columnOrFieldName") String columnOrFieldName, @QueryParam("key") String key)
      Returns the results of doing a "dry run" of replacing all occurrences of key with its default jira i18n translation in table invalid input: '&' column specified by tableOrEntityName invalid input: '&' columnOrFieldName. Table invalid input: '&' column apply to AO tables; if tableOrEntityName starts 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.

      GET-ting this endpoint 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 calling POST against the same URL.

      Parameters:
      tableOrEntityName - Either a plugins "AO_" style table name or a jira OfBiz-style entity name to check for translations
      columnOrFieldName - Either the name of a column from an AO-based table or an OfBiz-style field-name
      key - an i18n key that will be replaced with its default jira i18n translation
      Returns:
      a List of proposed translations in the form of ReTranslateKeysInternalResource.BeforeAfterBeans; empty if none are found.
    • reTranslateAllKeys

      @POST @Path("{tableOrEntityName}/{columnOrFieldName}") public jakarta.ws.rs.core.Response reTranslateAllKeys(@PathParam("tableOrEntityName") String tableOrEntityName, @PathParam("columnOrFieldName") String columnOrFieldName, @QueryParam("key") String key)
      Returns the results of replacing all occurrences of key with its default jira i18n translation in the table invalid input: '&' column specified by tableOrEntityName invalid input: '&' columnOrFieldName. Table invalid input: '&' column apply to AO tables; if tableOrEntityName starts 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.

      POST-ing to this endpoint means that the transformations are applied to the database and overwrite the original text.

      Clients should first call GET against this same URL 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.

      Parameters:
      tableOrEntityName - Either a plugins "AO_" style table name or a jira OfBiz-style entity name to check for translations
      columnOrFieldName - Either the name of a column from an AO-based table or an OfBiz-style field-name
      key - an i18n key that will be replaced with its default jira i18n translation
      Returns:
      List of carried-out translations in the form of ReTranslateKeysInternalResource.BeforeAfterBeans; empty if none are found.