Run the actual report.

@param locale
The locale to use for this report.
@throws MavenReportException
If the report generation failed.
960529
@Override
  public void executeReport (final Locale locale) throws MavenReportException
  {
    final Sink sink = getSink ();

    createReportHeader (getBundle (locale), sink);

    final File [] sourceDirs = getSourceDirectories ();
    for (final File sourceDir : sourceDirs)
    {
      final GrammarInfo [] grammarInfos = scanForGrammars (sourceDir);

      if (grammarInfos == null)
      {
        getLog ().debug ("Skipping non-existing source directory: " + sourceDir);
      }
      else
      {
        Arrays.sort (grammarInfos, GrammarInfoComparator.getInstance ());
        for (final GrammarInfo grammarInfo : grammarInfos)
        {
          final File grammarFile = grammarInfo.getGrammarFile ();

          String relativeOutputFileName = grammarInfo.getRelativeGrammarFile ();
          relativeOutputFileName = relativeOutputFileName.replaceAll ("(?i)\\.(jj|jjt|jtb)$",
                                                                      getOutputFileExtension ());

          final File jjdocOutputFile = new File (getJJDocOutputDirectory (), relativeOutputFileName);

          final JJDoc jjdoc = newJJDoc ();
          jjdoc.setInputFile (grammarFile);
          jjdoc.setOutputFile (jjdocOutputFile);
          try
          {
            jjdoc.run ();
          }
          catch (final Exception e)
          {
            throw new MavenReportException ("Failed to create BNF documentation: " + grammarFile, e);
          }

          createReportLink (sink, sourceDir, grammarFile, relativeOutputFileName);
        }
      }
    }

    createReportFooter (sink);
    sink.flush ();
    sink.close ();
  }
1265224
private void run(XmlOperation operation) throws ReportException {
        try {
            operation.run();
        } catch (XMLStreamException | IOException e) {
            throw new ReportException("Cannot write to XML report.", e);
        }
    }
487620
@Override
    public void run() {

        try {
            // do the content check
            m_contentCheck.startContentCheck(m_cms, getReport());
        } catch (Exception e) {
            getReport().println(e);
            if (LOG.isErrorEnabled()) {
                LOG.error(e.getLocalizedMessage());
            }
        }
    }
611943
public void setLocale(Locale locale) {
		if (locale == getLocale() || ignoreDatePatternChange) {
			return;
		}

		super.setLocale(locale);
		dateFormatter = (SimpleDateFormat) DateFormat.getDateInstance(DateFormat.MEDIUM, locale);
		setToolTipText(dateFormatter.toPattern());

		setDate(date, false);
		doLayout();
	}
303357
public static void run(Reporter reporter) {
      TCK tck = new TCK(new ObjenesisStd(), new ObjenesisSerializer(), reporter);
      tck.runTests();
   }
308103
public function initWriter( $locale )
    {
        $this->dom = $this->openTranslationFileForWriting( $locale );
        $this->writeLocale = $locale;
    }
835452
public void setLocale(String locale) {

        try {
            m_locale = LocaleUtils.toLocale(locale);
        } catch (IllegalArgumentException e) {
            LOG.error(Messages.get().getBundle().key(Messages.ERR_TAG_INVALID_LOCALE_1, "cms:navigation"), e);
            m_locale = null;
        }
    }
762815
public void updateLocale(String locale) throws SecurityException {
	checkWriteAccess();
	boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING);
	if (!hasAccess) throw new SecurityException("no access to update regional setting");

	Element scope = _getRootElement("regional");
	scope.setAttribute("locale", locale.trim());
    }
183992
@Override
    public void execute()
        throws MojoExecutionException
    {
        if ( !canGenerateReport() )
        {
            getLog().info( "Skipping SCoverage report generation" );
            return;
        }

        try
        {
            RenderingContext context = new RenderingContext( outputDirectory, getOutputName() + ".html" );
            SiteRendererSink sink = new SiteRendererSink( context );
            Locale locale = Locale.getDefault();
            generate( sink, locale );
        }
        catch ( MavenReportException e )
        {
            String prefix = "An error has occurred in " + getName( Locale.ENGLISH ) + " report generation";
            throw new MojoExecutionException( prefix + ": " + e.getMessage(), e );
        }
    }
1281779
void switchLocale(final String locale) {

        if (locale.equals(m_locale)) {
            return;
        }
        m_locale = locale;
        m_basePanel.clear();
        destroyForm(false);
        final CmsEntity entity = m_entityBackend.getEntity(m_entityId);
        m_entityId = getIdForLocale(locale);
        // if the content does not contain the requested locale yet, a new node will be created
        final boolean addedNewLocale = !m_contentLocales.contains(locale);
        if (m_registeredEntities.contains(m_entityId)) {
            unregistereEntity(m_entityId);
        }
        if (addedNewLocale) {
            loadNewDefinition(m_entityId, entity, new I_CmsSimpleCallback<CmsContentDefinition>() {

                public void execute(final CmsContentDefinition contentDefinition) {

                    setContentDefinition(contentDefinition);
                    renderFormContent();
                    setChanged();

                }
            });
        } else {
            loadDefinition(m_entityId, entity, new I_CmsSimpleCallback<CmsContentDefinition>() {

                public void execute(CmsContentDefinition contentDefinition) {

                    setContentDefinition(contentDefinition);
                    renderFormContent();
                }
            });
        }
    }
358305
public static void setLocale(final HttpServletRequest request, final Locale locale) {
        final HttpSession session = request.getSession(false);

        if (null == session) {
            LOGGER.warn("Ignores set locale caused by no session");

            return;
        }

        session.setAttribute(Keys.LOCALE, locale);
        LOGGER.log(Level.DEBUG, "Client[sessionId={0}] sets locale to [{1}]", new Object[]{session.getId(), locale.toString()});
    }
514247
public static void setLocale(@NonNull Locale locale) {
        if (!locale.equals(Locale.getDefault())) {
            LocalizationHelper.locale = locale;
            Locale.setDefault(locale);
        }
    }
1112944
protected void init(Locale locale, String siteRoot) {

        m_starttime = System.currentTimeMillis();
        m_locale = locale;
        m_siteRoot = siteRoot;
        m_messages = Messages.get().getBundle(locale);
    }
1251655
public void actionRename(I_CmsReport report) {

        m_report = report;
        List locales = OpenCms.getLocaleManager().getAvailableLocales();
        List xmlPages = getXmlPages();
        if (ALL.equals(getParamLocale())) {
            Iterator i = locales.iterator();
            while (i.hasNext()) {
                Locale locale = (Locale)i.next();
                performRenameOperation(xmlPages, locale);
            }
        } else {
            performRenameOperation(xmlPages, CmsLocaleManager.getLocale(getParamLocale()));
        }
    }
753643
@Override
    public void run() {

        try {
            // do the validation
            m_externLinkValidator.validateLinks(m_cms);
        } catch (Throwable e) {
            getReport().println(e);
            if (LOG.isErrorEnabled()) {
                LOG.error(e.getLocalizedMessage());
            }
        }
        if (m_fin != null) {
            m_fin.run();
        }
    }
830690
public void reload(Locale locale) {
        this.bundle = ResourceBundle.getBundle(Default.BUNDLE_NAME.toString(), locale);
    }
1223612
protected void setLocale( Locale locale )
    {
        if ( locale == null ) locale = getDefaultLocale();
        getSession().setAttribute( Globals.LOCALE_KEY, locale );
    }