Class TranslationAlertFunction

    • Method Detail

      • setPluginInfo

        public void setPluginInfo​(String pluginName,
                                  String featureName,
                                  String id)
        Description copied from interface: PluginAware
        Sets the plugin info relative to the current component.
        Note : The feature name may be null if the targeted component in declared at plugin level.
        Specified by:
        setPluginInfo in interface PluginAware
        Parameters:
        pluginName - Unique identifier for the plugin hosting the extension
        featureName - Unique feature identifier (unique for a given pluginName)
        id - Unique identifier of this component
      • execute

        public void execute​(Map transientVars,
                            Map args,
                            com.opensymphony.module.propertyset.PropertySet ps)
                     throws com.opensymphony.workflow.WorkflowException
        Specified by:
        execute in interface com.opensymphony.workflow.FunctionProvider
        Throws:
        com.opensymphony.workflow.WorkflowException
      • sendAlerts

        protected void sendAlerts​(WebContent content)
        Send the alerts to tell users the translated content was modified.
        Parameters:
        content - the modified content.
      • sendAlert

        protected void sendAlert​(Page page,
                                 WebContent content,
                                 Page translatedPage,
                                 Set<UserIdentity> users)
        Build and send an alert e-mail to inform of a translation to a list of users.
        Parameters:
        page - the modified page.
        content - the content which was modified.
        translatedPage - the translated page.
        users - the users to send the e-mail to.
      • sendMails

        protected void sendMails​(String subject,
                                 String body,
                                 Set<UserIdentity> users,
                                 String from)
        Send a translation alert e-mail to the specified users.
        Parameters:
        subject - the e-mail subject.
        body - the e-mail body.
        users - the users to send the e-mail to.
        from - the e-mail will be sent with this "from" header.
      • getUsersToNotify

        protected HashSet<UserIdentitygetUsersToNotify​(Page translatedPage)
        Get the users to notify about the page translation.
        Parameters:
        translatedPage - the translated version of the page.
        Returns:
        the logins of the users to notify.
      • getTranslations

        protected Map<String,​PagegetTranslations​(Page page)
        Get the translations of a given page.
        Parameters:
        page - the page.
        Returns:
        the translated pages as a Map of pages, indexed by sitemap name (language).
      • getPageUrl

        protected String getPageUrl​(Page page)
        Get the URL of the back-office, opening on the page tool.
        Parameters:
        page - the page to open on.
        Returns:
        the page URL.