Class AutoTranslateMergeServiceImpl

  • All Implemented Interfaces:
    AutoTranslateMergeService

    public class AutoTranslateMergeServiceImpl
    extends Object
    implements AutoTranslateMergeService
    Implementation of the AutoTranslateMergeService. Provides methods to retrieve properties for resources in the context of translations.
    • Field Detail

      • configurationService

        protected com.composum.ai.backend.slingbase.AIConfigurationService configurationService
    • Constructor Detail

      • AutoTranslateMergeServiceImpl

        public AutoTranslateMergeServiceImpl()
    • Method Detail

      • saveTranslation

        public void 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
        Description copied from interface: AutoTranslateMergeService
        Saves the new content to a property.
        Specified by:
        saveTranslation in interface AutoTranslateMergeService
        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
        Throws:
        com.day.cq.wcm.api.WCMException
      • descendantsStream

        protected Stream<org.apache.sling.api.resource.Resource> descendantsStream​(org.apache.sling.api.resource.Resource resource)
      • getComponentName

        protected String getComponentName​(org.apache.sling.api.resource.Resource resource)
        Determines the jcr:title of the current component, as found by sling:resourceType
      • getComponentTitle

        protected String getComponentTitle​(@Nonnull
                                           org.apache.sling.api.resource.Resource resource)
        Determines the jcr:title , title or text of the component by searching upwards for such a property.