Interface AutoTranslateMergeService

  • All Known Implementing Classes:
    AutoTranslateMergeServiceImpl

    public interface AutoTranslateMergeService
    Service for handling merge operations related to auto-translation. Provides methods to retrieve properties for resources in the context of translations.
    • Method Detail

      • isProcessingNeeded

        boolean isProcessingNeeded​(org.apache.sling.api.resource.Resource resource)
        Checks whether there are any unmerged or unaccepted properties.
      • isAutomaticallyTranslated

        boolean isAutomaticallyTranslated​(org.apache.sling.api.resource.Resource resource)
        Checks whether this is an automatically translated resource.
      • saveTranslation

        Map<String,​String> saveTranslation​(@Nonnull
                                                 org.apache.sling.api.resource.Resource resource,
                                                 @Nonnull
                                                 String propertyName,
                                                 @Nonnull
                                                 String content,
                                                 @Nonnull
                                                 boolean markAsMerged)
                                          throws com.day.cq.wcm.api.WCMException
        Saves the new content to a property.
        Parameters:
        resource - the resource to save the translation to.
        propertyName - the name of the property to save the translation to.
        content - the new content to save.
        markAsMerged - whether to mark the property as merged
        Returns:
        a map containing "saved" and the text saved in the resource, to verify that it went OK, otherwise empty.
        Throws:
        com.day.cq.wcm.api.WCMException
      • approveTranslation

        void approveTranslation​(org.apache.sling.api.resource.Resource resource,
                                String propertyName)
                         throws com.day.cq.wcm.api.WCMException
        Approves a translation for the specified property of the given resource, marking it as accepted.
        Parameters:
        resource - the resource containing the property to approve
        propertyName - the name of the property for which the translation is to be approved
        Throws:
        com.day.cq.wcm.api.WCMException
      • changeInheritance

        void changeInheritance​(org.apache.sling.api.resource.Resource resource,
                               String propertyName,
                               AutoTranslateMergeService.CancelOrReenable kind)
                        throws com.day.cq.wcm.api.WCMException
        Cancels a translation for the specified property of the given resource, marking it as cancelled.
        Parameters:
        resource - the resource containing the property to cancel
        propertyName - the name of the property for which the translation is to be cancelled
        kind - whether to cancel or reenable the property
        Throws:
        com.day.cq.wcm.api.WCMException