Generates the sitemap(s) and index based on the configuration file specified in DynamicSitemaps.config_path.
 If you supply a block, that block is evaluated instead of the configuration file.
771560
def generate(&block)
      create_temp_dir
      if block
        instance_eval &block
      else
        instance_eval open(DynamicSitemaps.config_path).read, DynamicSitemaps.config_path
      end
      generate_index
      move_to_destination
      ping_search_engines
    ensure
      remove_temp_dir
    end
284420
def sitemap(name = :sitemap, options = {}, &block)
      options = name.kind_of?(Hash) ? name : options
      name = name.kind_of?(String) || name.kind_of?(Symbol) ? name : :sitemap
      config = {controller: :sitemap, url_limit: nil}.merge(options)

      sitemap_raw_route_name = "#{name}_sitemap"
      sitemap_route_name = name_for_action(sitemap_raw_route_name, nil)

      begin

        unless @set.routes.find {|route| route.name.eql?(sitemap_route_name)}

          # create a route for the sitemap using the name that was passed to the sitemap method inside config/routes.
          match %(/#{name}.:format), controller: config[:controller], action: name, via: [:get], as: sitemap_raw_route_name

          # if not found here, then, there must be a real problem.
          # later, i will implement an exception, etc.
          sitemap_route = @set.routes.find {|route| route.name.eql?(sitemap_route_name)}

          # identify the route as a "sitemap" route and build it's full name.
          sitemap_route.is_sitemap = true
          sitemap_route.url_limit = config[:url_limit]
          sitemap_route.sitemap_route_name = sitemap_route_name
          sitemap_route.sitemap_raw_route_name = sitemap_raw_route_name

          # this is how I am faking to always point to the SitemapController
          # regardless of namespace
          sitemap_route.defaults[:controller] = "sitemap"

        end

      rescue ArgumentError => e
        unless e.message.include?("Invalid route name")
          raise e
        end
      end

      # now, find the route again, because, we need to set the following boolean and there might be several
      # calls to sitemap without a block.  if we were to set this boolean in the code above when checking
      # if the route already exists, then, the boolean may never be set.
      sitemap_route = @set.routes.find {|route| route.is_sitemap? && route.name.eql?(sitemap_route_name) }

      # once a sitemap route has been flagged as being defined with a block, then, you should never set it back to false.
      # one of the features is to be able to encapsulate a set of routes within a sitemap as many times as you need.
      # meaning, you might want to wrap five routes at the top of the file, three in the middle, and two at the bottom and
      # have all of them included in the default sitemap.
      # Since all routes within a sitemap block will be marked with the same name, 
      # I am not keeping track of sitemaps being defined with or without a block, so, all I need to know is about one of them.
      unless sitemap_route.sitemap_with_block?
        sitemap_route.sitemap_with_block = true if block_given?
      end

      # DuckMap::SitemapControllerHelpers is a module that is included in SitemapBaseController and contains
      # methods such as sitemap_build, etc.  Define a method to handle the sitemap on DuckMap::SitemapControllerHelpers
      # so that method is visible to the default sitemap controller as well as any custom controllers that inherit from it.
      # originally, I was simply defining the method directly on SitemapBaseController, however, it was causing problems
      # during the development cycle of edit and refresh.  Defining methods here seemed to cure that problem.
      # for example, the default sitemap: /sitemap.xml will define a method named: sitemap
      # on the DuckMap::SitemapControllerHelpers module.
      unless DuckMap::SitemapControllerHelpers.public_method_defined?(name)
        DuckMap::SitemapControllerHelpers.send :define_method, name do

          if DuckMap::Config.attributes[:sitemap_content].eql?(:xml)

            sitemap_build

          end

          respond_to do |format|
            format.xml { render }
          end
        end
      end

      # determine if the sitemap definition included a block.
      if block_given?

        # the starting point would be after the current set of routes and would be length plus one.
        # however, the starting point index is the length of routes, since arrays are zero based.
        start_point = @set.routes.length

        # push a copy of the current filter settings onto an array.
        # this will allow you to specify criteria setting within a sitemap definition without affecting
        # the default settings after the block is finished executing.
        @set.sitemap_filters.push

        # yield to the block.  all standard route code should execute just fine and define namespaces, resource, matches, etc.
        yield

        total = run_filter(sitemap_route.sitemap_route_name, start_point)

        # knock the current filter setting off of the stack
        @set.sitemap_filters.pop

        DuckMap.logger.debug %(total routes filtered: #{@set.routes.length - start_point}  included? #{total})

        @set.routes.each do |route|
          DuckMap.logger.debug %(  Route name: #{route.name}) if route.sitemap_route_name.eql?(sitemap_route.sitemap_route_name)
        end

      end

      return nil
    end
710813
private void initializeFileData(String baseSitePath) throws CmsException {

        m_resultMap.clear();
        m_siteRootLink = OpenCms.getLinkManager().getOnlineLink(m_siteGuestCms, "/");
        m_siteRootLink = CmsFileUtil.removeTrailingSeparator(m_siteRootLink);
        m_detailPageInfos = OpenCms.getADEManager().getAllDetailPages(m_guestCms);
        for (CmsDetailPageInfo detailPageInfo : m_detailPageInfos) {
            String type = detailPageInfo.getType();
            String path = detailPageInfo.getUri();
            path = CmsFileUtil.removeTrailingSeparator(path);
            m_detailTypesByPage.put(path, type);
        }
        List<CmsAlias> siteAliases = OpenCms.getAliasManager().getAliasesForSite(
            m_siteGuestCms,
            m_siteGuestCms.getRequestContext().getSiteRoot());
        for (CmsAlias alias : siteAliases) {
            if (isAliasBelowBaseFolder(alias) && (alias.getMode() == CmsAliasMode.page)) {
                CmsUUID aliasId = alias.getStructureId();
                m_pageAliasesBelowBaseFolderByStructureId.put(aliasId, alias);
            }
        }

    }
396385
public static String generateState(CmsSearchReplaceSettings settings) {

        String state = "";
        state = A_CmsWorkplaceApp.addParamToState(state, SITE_ROOT, settings.getSiteRoot());
        state = A_CmsWorkplaceApp.addParamToState(state, SEARCH_TYPE, settings.getType().name());
        state = A_CmsWorkplaceApp.addParamToState(state, SEARCH_PATTERN, settings.getSearchpattern());
        if (!settings.getPaths().isEmpty()) {
            state = A_CmsWorkplaceApp.addParamToState(state, FOLDER, settings.getPaths().get(0));
        }
        state = A_CmsWorkplaceApp.addParamToState(state, RESOURCE_TYPE, settings.getTypes());
        state = A_CmsWorkplaceApp.addParamToState(state, LOCALE, settings.getLocale());
        state = A_CmsWorkplaceApp.addParamToState(state, QUERY, settings.getQuery());
        state = A_CmsWorkplaceApp.addParamToState(state, INDEX, settings.getSource());
        state = A_CmsWorkplaceApp.addParamToState(state, XPATH, settings.getXpath());
        state = A_CmsWorkplaceApp.addParamToState(state, IGNORE_SUBSITES, String.valueOf(settings.ignoreSubSites()));
        state = A_CmsWorkplaceApp.addParamToState(state, PROPERTY, settings.getProperty().getName());

        return state;
    }
1041442
public void addSite(String siteKey) {
		ValueMap gv = new ValueMap(siteKey);
		if (!this.valueMaps.contains(gv)) {
			this.valueMaps.add(gv);
		}
	}
934665
def make_config_get(conf_path):
    
    project_root = _get_project_root_from_conf_path(conf_path)
    config = load_config_in_dir(project_root)
    return partial(config_get, config)
912903
function publishSiteMaps () {
    var path = 'sitemap.xml';

    return publishRobotsTxt ()
        .then(function () {
            return fs.statAsync(path);
        })
        .then(function (pStat) {
            if (pStat.isFile()) {
                // file exists; throw Error to proceed with creating of sitemaps for posts and tags
                return publishPostsSiteMap()
                    .then(function () {
                        return publishTagsSiteMap();
                    })
                    .catch(log.error);
            }
            else {
                // create sitemap.xml file
                throw new Error();
            }
        })
        .catch(function () {
            var sitemap = sm.createSitemap ({
                hostname: config.siteUrl,
                cacheTime: 600000,        // 600 sec - cache purge period
                urls: [{
                        url: '/sitemap-posts.xml',
                        changeFreq: 'weekly',
                        priority: 0.8,
                        lastmodrealtime: true
                    },
                    {
                        url: '/sitemap-tags.xml',
                        changeFreq: 'weekly',
                        priority: 0.8,
                        lastmodrealtime: true
                    }]
            });

            return fs
                .openAsync(path, 'w')
                .then(function () {
                    return fs
                        .writeFileAsync(path, sitemap.toString())
                        .then(function () {
                            // file exists; throw Error to proceed with creating of sitemaps for posts and tags
                            return publishPostsSiteMap().then(function () {
                                return publishTagsSiteMap().catch(log.error);
                            });
                        })
                        .catch(log.error);
                })
                .catch(log.error);
        });
}
996341
def _generate_route_keys(self, methods, path):
        
        for method in methods:
            yield self._route_key(method, path)
1037671
def generate(self, profile, parameters, projectpath, inputfiles, provenancedata=None):
        """"""

        project = os.path.basename(projectpath)

        if self.parent: #pylint: disable=too-many-nested-blocks
            #We have a parent, infer the correct filename

            #copy filename from parent
            parent = self.getparent(profile)

            #get input files for the parent InputTemplate
            parentinputfiles = parent.matchingfiles(projectpath)
            if not parentinputfiles:
                raise Exception("OutputTemplate '"+self.id + "' has parent '" + self.parent + "', but no matching input files were found!")

            #Do we specify a full filename?
            for seqnr, inputfilename, inputtemplate in parentinputfiles: #pylint: disable=unused-variable

                if self.filename:
                    filename = self.filename
                    parentfile = CLAMInputFile(projectpath, inputfilename)
                elif parent:
                    filename = inputfilename
                    parentfile = CLAMInputFile(projectpath, inputfilename)
                else:
                    raise Exception("OutputTemplate '"+self.id + "' has no parent nor filename defined!")

                #Make actual CLAMInputFile objects of ALL relevant input files, that is: all unique=True files and all unique=False files with the same sequence number
                relevantinputfiles = []
                for seqnr2, inputfilename2, inputtemplate2 in inputfiles:
                    if seqnr2 == 0 or seqnr2 == seqnr:
                        relevantinputfiles.append( (inputtemplate2, CLAMInputFile(projectpath, inputfilename2)) )

                #resolve # in filename (done later)
                #if not self.unique:
                #    filename.replace('#',str(seqnr))

                if not self.filename and self.removeextensions:
                    #Remove unwanted extensions
                    if self.removeextensions is True:
                        #Remove any and all extensions
                        filename = filename.split('.')[0]
                    elif isinstance(self.removeextensions, list):
                        #Remove specified extension
                        for ext in self.removeextensions:
                            if ext:
                                if ext[0] != '.' and filename[-len(ext) - 1:] == '.' + ext:
                                    filename = filename[:-len(ext) - 1]
                                elif ext[0] == '.' and filename[-len(ext):] == ext:
                                    filename = filename[:-len(ext)]


                if self.extension and not self.filename and filename[-len(self.extension) - 1:] != '.' + self.extension: #(also prevents duplicate extensions)
                    filename += '.' + self.extension


                #Now we create the actual metadata
                metadata = self.generatemetadata(parameters, parentfile, relevantinputfiles, provenancedata)

                #Resolve filename
                filename = resolveoutputfilename(filename, parameters, metadata, self, seqnr, project, inputfilename)

                yield inputtemplate, inputfilename, filename, metadata

        elif self.unique and self.filename:
            #outputtemplate has no parent, but specified a filename and is unique, this implies it is not dependent on input files:

            metadata = self.generatemetadata(parameters, None, [], provenancedata)

            filename = resolveoutputfilename(self.filename, parameters, metadata, self, 0, project, None)

            yield None, None, filename, metadata
        else:
            raise Exception("Unable to generate from OutputTemplate, no parent or filename specified")
1234773
public static void generate(ConfigurationImpl configuration,
                                IndexBuilder indexbuilder) throws DocFileIOException {
        DocPath filename = DocPaths.INDEX_ALL;
        SingleIndexWriter indexgen = new SingleIndexWriter(configuration,
                                         filename, indexbuilder);
        indexgen.generateIndexFile();
    }
398410
def _prepare_settings(pspath, settings):
    '''
    
    '''
    prepared_settings = []
    for setting in settings:
        match = re.search(r'Collection\[(\{.*\})\]', setting['name'])
        if match:
            name = setting['name'][:match.start(1)-1]
            match_dict = yaml.load(match.group(1))
            index = _collection_match_to_index(pspath, setting['filter'], name, match_dict)
            if index != -1:
                setting['name'] = setting['name'].replace(match.group(1), str(index))
                prepared_settings.append(setting)
        else:
            prepared_settings.append(setting)
    return prepared_settings
13244
def generate_require_paths
      return configured_require_paths unless gemspec?
      result = []
      gemspecs.each do |file|
        base = File.dirname(file)
        # @todo Evaluating gemspec files violates the goal of not running
        #   workspace code, but this is how Gem::Specification.load does it
        #   anyway.
        begin
          spec = eval(File.read(file), binding, file)
          next unless Gem::Specification === spec
          result.concat(spec.require_paths.map { |path| File.join(base, path) })
        rescue Exception => e
          # Don't die if we have an error during eval-ing a gem spec.
          # Concat the default lib directory instead.
          Solargraph.logger.warn "Error reading #{file}: [#{e.class}] #{e.message}"
          result.push File.join(base, 'lib')
        end
      end
      result.concat config.require_paths
      result.push File.join(directory, 'lib') if result.empty?
      result
    end
1188475
public void setSitePath(String sitepath) {

        if (!isLeafType() && !sitepath.endsWith("/")) {
            sitepath = sitepath + "/";
        }
        m_sitePath = sitepath;
    }
73042
public List<CmsXmlSitemapUrlBean> generateSitemapBeans() throws CmsException {

        String baseSitePath = m_siteGuestCms.getRequestContext().removeSiteRoot(m_baseFolderRootPath);
        initializeFileData(baseSitePath);
        for (CmsResource resource : getDirectPages()) {
            String sitePath = m_siteGuestCms.getSitePath(resource);
            List<CmsProperty> propertyList = m_siteGuestCms.readPropertyObjects(resource, true);
            String onlineLink = OpenCms.getLinkManager().getOnlineLink(m_siteGuestCms, sitePath);
            boolean isContainerPage = CmsResourceTypeXmlContainerPage.isContainerPage(resource);
            long dateModified = resource.getDateLastModified();
            if (isContainerPage) {
                if (m_computeContainerPageDates) {
                    dateModified = computeContainerPageModificationDate(resource);
                } else {
                    dateModified = -1;
                }
            }
            CmsXmlSitemapUrlBean urlBean = new CmsXmlSitemapUrlBean(
                replaceServerUri(onlineLink),
                dateModified,
                getChangeFrequency(propertyList),
                getPriority(propertyList));
            urlBean.setOriginalResource(resource);
            addResult(urlBean, 3);
            if (isContainerPage) {
                Locale locale = getLocale(resource, propertyList);
                addDetailLinks(resource, locale);
            }
        }

        for (CmsUUID aliasStructureId : m_pageAliasesBelowBaseFolderByStructureId.keySet()) {
            addAliasLinks(aliasStructureId);
        }

        List<CmsXmlSitemapUrlBean> result = new ArrayList<CmsXmlSitemapUrlBean>();
        for (ResultEntry resultEntry : m_resultMap.values()) {
            result.add(resultEntry.getUrlBean());
        }
        return result;
    }
1169601
@SuppressWarnings("deprecation")
    protected boolean isSitemapConfiguration(String rootPath, int type) {

        if (type == m_configType.getTypeId()) {
            return rootPath.endsWith(CmsADEManager.CONFIG_SUFFIX);
        } else {
            return OpenCms.getResourceManager().matchResourceType(TYPE_SITEMAP_MASTER_CONFIG, type);
        }
    }
1107077
public static void generate(ConfigurationImpl configuration,
            IndexBuilder indexBuilder) throws DocFileIOException {
        if (configuration.frames) {
            generate(configuration, indexBuilder, DocPaths.ALLCLASSES_FRAME, true);
            generate(configuration, indexBuilder, DocPaths.ALLCLASSES_NOFRAME, false);
        } else {
            generate(configuration, indexBuilder, DocPaths.ALLCLASSES, false);
        }
    }
931871
def run_sitemap(_):
    '''
    
    '''
    site_map_file = 'xx_sitemap.txt'
    if os.path.exists(site_map_file):
        os.remove(site_map_file)

    gen_wiki_map(site_map_file)
    gen_post_map(site_map_file)