Creates a default {@link SitemapPage} object if one does not currently exist.
17390
public function requireDefaultRecords() {
		if(!$sitemap = DataObject::get_one('SitemapPage')) {
			$sitemap = new SitemapPage();

			$sitemap->Title   = _t('SitemapPage.SITEMAP', 'Sitemap');
			$sitemap->Content = sprintf (
				'<p>%s</p>',
				_t('SitemapPage.DEFAULTCONTENT','This page displays a sitemap of the pages in your site.')
			);

			$sitemap->write();
			$sitemap->doPublish();

			if(method_exists('DB', 'alteration_message')) {
				DB::alteration_message('Created default Sitemap page.', 'created');
			} else {
				Database::alteration_message('Created default Sitemap page.', 'created');
			}
		}

		parent::requireDefaultRecords();
	}
174561
void openSitemapEditor() {

        CmsObject cms = A_CmsUI.getCmsObject();
        String siteRoot = cms.getRequestContext().getSiteRoot();
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(siteRoot)) {
            String path = getPath(cms, A_CmsUI.get().getHttpSession());
            if (path != null) {
                try {
                    CmsAppWorkplaceUi ui = CmsAppWorkplaceUi.get();
                    if (ui.beforeViewChange(
                        new ViewChangeEvent(ui.getNavigator(), ui.getCurrentView(), null, APP_ID, null))) {
                        CmsResource res = cms.readResource(CmsADEManager.PATH_SITEMAP_EDITOR_JSP);
                        String link = OpenCms.getLinkManager().substituteLink(cms, res);
                        A_CmsUI.get().getPage().setLocation(link + "?path=" + path);
                    }
                    return;
                } catch (CmsException e) {
                    LOG.debug("Unable to open sitemap editor.", e);
                }
            }
        }
        Notification.show(CmsVaadinUtils.getMessageText(Messages.GUI_SITEMAP_NOT_AVAILABLE_0), Type.WARNING_MESSAGE);
    }
659678
private function AddSitemapChangeFrequencyField()
    {
        $name = 'SitemapChangeFrequency';
        $value = $this->page->Exists() ? $this->page->GetSitemapChangeFrequency() :
            (string)ChangeFrequency::Weekly();
        
        $field = new Select($name, $value);
        $values = ChangeFrequency::AllowedValues();
        foreach ($values as $val)
        {
            $field->AddOption($val, Trans('Core.Sitemap.ChangeFrequency.' . ucfirst($val)));
        }
        $this->AddField($field);   
    }
361378
public static final DefaultTupleMapper newObjectDefaultTupleMapper( ) {
        final ObjectMapper mapper = new ObjectMapper();
        return new DefaultTupleMapper(new TupleMapper<String>() {
            @Override
            public String map(Tuple input) {
                try {
                    return mapper.writeValueAsString(input.getValueByField(FIELD_SOURCE));
                } catch (JsonProcessingException e) {
                    throw new MappingException("Error happen while processing json on object", e);
                }
            }
        });
    }
1204804
public static <K, V> Map<K, V> createHashMapAdapter(int expectedMapSize) {
        final int initialCapacity = calculateInitialCapacity(expectedMapSize);
        return new HashMapAdapter<K, V>(initialCapacity, HASHMAP_DEFAULT_LOAD_FACTOR);
    }
266780
private ComboBox createSiteSelect(CmsObject cms) {

        final IndexedContainer availableSites = CmsVaadinUtils.getAvailableSitesContainer(cms, SITE_CAPTION);
        ComboBox combo = new ComboBox(null, availableSites);
        combo.setTextInputAllowed(true);
        combo.setNullSelectionAllowed(false);
        combo.setWidth("200px");
        combo.setInputPrompt(
            Messages.get().getBundle(UI.getCurrent().getLocale()).key(Messages.GUI_EXPLORER_CLICK_TO_EDIT_0));
        combo.setItemCaptionPropertyId(SITE_CAPTION);
        combo.select(cms.getRequestContext().getSiteRoot());
        combo.setFilteringMode(FilteringMode.CONTAINS);
        combo.addValueChangeListener(new ValueChangeListener() {

            private static final long serialVersionUID = 1L;

            public void valueChange(ValueChangeEvent event) {

                String value = (String)event.getProperty().getValue();
                if (availableSites.containsId(value)) {
                    changeSite(value, null);
                    m_appContext.updateOnChange();
                    availableSites.removeAllContainerFilters();
                }
            }
        });
        if (Page.getCurrent().getBrowserWindowHeight() > 650) {
            combo.setPageLength(20);
        }
        return combo;
    }
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)
138856
public function generateSitemap()
    {
        if ($this->findAllEntries()) {
            $sitemap = GeneralUtility::makeInstance(Sitemap::class);
            $sitemap->setUrlEntries($this->entryStorage);

            return $sitemap;
        }

        return null;
    }
444398
public void createSitemapSubEntry(final CmsClientSitemapEntry parent, final String sitemapFolderType) {

        CmsSitemapTreeItem item = CmsSitemapTreeItem.getItemById(parent.getId());
        AsyncCallback<CmsClientSitemapEntry> callback = new AsyncCallback<CmsClientSitemapEntry>() {

            public void onFailure(Throwable caught) {

                // do nothing
            }

            public void onSuccess(CmsClientSitemapEntry result) {

                makeNewEntry(parent, new I_CmsSimpleCallback<CmsClientSitemapEntry>() {

                    public void execute(CmsClientSitemapEntry newEntry) {

                        newEntry.setResourceTypeName(sitemapFolderType);
                        createSitemapSubEntry(newEntry, parent.getId(), sitemapFolderType);
                    }
                });
            }
        };
        if (item.getLoadState().equals(LoadState.UNLOADED)) {
            getChildren(parent.getId(), true, callback);
        } else {
            callback.onSuccess(parent);
        }
    }
1216254
private function AddSitemapRelevanceField()
    {
        $name = 'SitemapRelevance';
        $value = $this->page->Exists() ? 10* $this->page->GetSitemapRelevance() : 7;
        $field = new Select($name, $value);
        for ($val = 0; $val <= 10; ++$val)
        {
            $decSep = Trans('Core.DecimalSeparator');
            $thousSep = Trans('Core.ThousandsSeparator');
            $text = number_format($val / 10, 1, $decSep, $thousSep);
            $field->AddOption($val, $text);
        }
        $this->AddField($field);
    }
773527
private void handleDropSitemapEntry(
        final CmsSitemapTreeItem sitemapEntry,
        final I_CmsDropTarget target,
        CmsClientSitemapEntry parent) {

        if (isChangedPosition(sitemapEntry, target, true)) {
            // moving a tree entry around
            final CmsClientSitemapEntry entry = sitemapEntry.getSitemapEntry();
            m_controller.ensureUniqueName(parent, entry.getName(), new I_CmsSimpleCallback<String>() {

                public void execute(String uniqueName) {

                    if (!uniqueName.equals(entry.getName()) && isChangedPosition(sitemapEntry, target, false)) {
                        m_controller.editAndChangeName(
                            entry,
                            uniqueName,
                            Collections.<CmsPropertyModification> emptyList(),
                            entry.isNew(),
                            CmsReloadMode.none);
                        m_controller.move(entry, m_insertPath + uniqueName + "/", m_insertIndex);
                    } else {
                        m_controller.move(entry, m_insertPath + entry.getName() + "/", m_insertIndex);
                    }
                }
            });
        } else {
            sitemapEntry.resetEntry();
        }
    }
1134865
public static CmsResourceInfo createSitemapResourceInfo(CmsResource resource, CmsSite baseSite) {

        String title = resource.getName();
        String path = resource.getRootPath();

        CmsResourceInfo info = new CmsResourceInfo();
        CmsResourceUtil resUtil = new CmsResourceUtil(A_CmsUI.getCmsObject(), resource);

        CmsObject cms = A_CmsUI.getCmsObject();
        try {
            Map<String, CmsProperty> props = CmsProperty.toObjectMap(cms.readPropertyObjects(resource, false));
            CmsProperty navtextProp = props.get(CmsPropertyDefinition.PROPERTY_NAVTEXT);
            CmsProperty titleProp = props.get(CmsPropertyDefinition.PROPERTY_TITLE);

            if ((navtextProp != null) && (navtextProp.getValue() != null)) {
                title = navtextProp.getValue();
            } else if ((titleProp != null) && (titleProp.getValue() != null)) {
                title = titleProp.getValue();
            }
        } catch (Exception e) {
            LOG.error(e.getLocalizedMessage(), e);
        }
        info.getTopLine().setValue(title);
        if (baseSite != null) {
            String siteRoot = baseSite.getSiteRoot();
            if (path.startsWith(siteRoot)) {
                path = path.substring(siteRoot.length());
                path = CmsStringUtil.joinPaths("/", path);
            }
        }
        info.getBottomLine().setValue(path);
        Resource icon = CmsResourceIcon.getSitemapResourceIcon(
            A_CmsUI.getCmsObject(),
            resUtil.getResource(),
            IconMode.localeCompare);
        info.getResourceIcon().initContent(resUtil, icon, null, true, false);
        return info;
    }
962257
public static final DefaultTupleMapper newStringDefaultTupleMapper( ) {
        return new DefaultTupleMapper(new TupleMapper<String>() {
            @Override
            public String map(Tuple input) {
                return input.getStringByField(FIELD_SOURCE);
            }
        });
    }
976149
private JCheckBox getChkParseSitemapXml() {
		if (parseSitemapXml == null) {
			parseSitemapXml = new JCheckBox();
			parseSitemapXml.setText(Constant.messages.getString("spider.options.label.sitemapxml"));
		}
		return parseSitemapXml;
	}
1130663
protected function prepareDefaultValues(Site $site)
    {
        $defaults = $this->getDefaultSiteValues();

        foreach ($defaults as $key => $value) {
            $getMethod = 'get' . ucfirst($key);
            $setMethod = 'set' . ucfirst($key);

            $currentValue = $site->$getMethod();

            if (empty($currentValue)) {
                $site->$setMethod($value);
            }
        }

        return $site;
    }
1363036
private void setUpDefaultUriComboBox(List<CmsSite> allSites) {

        BeanItemContainer<CmsSite> objects = new BeanItemContainer<CmsSite>(CmsSite.class, allSites);
        m_fieldDefaultURI.setContainerDataSource(objects);
        m_fieldDefaultURI.setNullSelectionAllowed(false);
        m_fieldDefaultURI.setTextInputAllowed(false);
        m_fieldDefaultURI.setItemCaptionPropertyId("title");

        //set value
        String siteRoot = OpenCms.getSiteManager().getDefaultUri();
        if (siteRoot.endsWith("/")) {
            siteRoot = siteRoot.substring(0, siteRoot.length() - 1);
        }
        CmsSite site = OpenCms.getSiteManager().getSiteForSiteRoot(siteRoot);
        m_fieldDefaultURI.setValue(site);
    }
191954
protected function prepareNewSite(
        Site $newSite,
        array $defaultSiteSettings,
        string $createdByUserId,
        string $createdReason
    ) {
        $siteId = $newSite->getSiteId();
        if (!empty($siteId)) {
            throw new \Exception(
                "Site ID must be empty to create new site, id {$siteId} given."
            );
        }

        if (empty($newSite->getDomain())) {
            throw new \Exception('Domain is required to create new site.');
        }

        return $this->prepareDefaultValues(
            $newSite,
            $defaultSiteSettings,
            $createdByUserId,
            $createdReason
        );
    }