Class MultilingualFieldWebScript

java.lang.Object
org.springframework.extensions.webscripts.AbstractWebScript
fr.becpg.repo.web.scripts.multilingual.MultilingualFieldWebScript
All Implemented Interfaces:
org.springframework.extensions.webscripts.WebScript

public class MultilingualFieldWebScript extends org.springframework.extensions.webscripts.AbstractWebScript
Return or save MLText field
Version:
$Id: $Id
Author:
matthieu
  • Field Details

  • Constructor Details

    • MultilingualFieldWebScript

      public MultilingualFieldWebScript()
  • Method Details

    • setServiceRegistry

      public void setServiceRegistry(org.alfresco.service.ServiceRegistry serviceRegistry)

      Setter for the field serviceRegistry.

      Parameters:
      serviceRegistry - a ServiceRegistry object.
    • setEntityFormatService

      public void setEntityFormatService(EntityFormatService entityFormatService)

      Setter for the field entityFormatService.

      Parameters:
      entityFormatService - a EntityFormatService object.
    • setGoogleApiKey

      public void setGoogleApiKey(String googleApiKey)

      Setter for the field googleApiKey.

      Parameters:
      googleApiKey - a String object.
    • setDeepLAPIKey

      public void setDeepLAPIKey(String deepLAPIKey)

      Setter for the field deepLAPIKey.

      Parameters:
      deepLAPIKey - a String object
    • execute

      public void execute(org.springframework.extensions.webscripts.WebScriptRequest req, org.springframework.extensions.webscripts.WebScriptResponse res) throws IOException
      Throws:
      IOException
    • getTranslatedText

      private String getTranslatedText(org.alfresco.service.cmr.repository.MLText mlText, String target)
    • extractMLTextFromVersion

      private org.alfresco.service.cmr.repository.MLText extractMLTextFromVersion(org.alfresco.service.cmr.repository.NodeRef versionNodeRef, String itemType, String itemId, org.alfresco.service.namespace.QName propertyQName, Locale defaultLocale)
      Extract MLText property from version JSON data.
      Parameters:
      versionNodeRef - the version node reference
      itemType - the item type from versioned nodeRef
      itemId - the item ID from versioned nodeRef
      propertyQName - the property QName to extract
      defaultLocale - the default locale to use if MLText is not found
      Returns:
      the extracted MLText or empty MLText if not found