Opens the sitemap editor for the current site.<p>
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);
    }
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);
        }
    }
1012105
public void onReceiveSitemapPreloadData(CmsSitemapEntryBean sitemapPreloadData) {

        CmsSitemapTab sitemapTab = m_galleryDialog.getSitemapTab();
        if (sitemapTab != null) {
            sitemapTab.onReceiveSitemapPreloadData(sitemapPreloadData);
        }
    }
1177971
public void hookSiteMapListener(SiteMapPanel siteMapPanel) {
        for (ExtensionHook hook : extensionHooks.values()) {
            hookSiteMapListeners(siteMapPanel, hook.getSiteMapListenerList());
        }
    }
1068645
def start_output (self):
        """"""
        super(SitemapXmlLogger, self).start_output()
        self.xml_start_output()
        attrs = {u"xmlns": u"http://www.sitemaps.org/schemas/sitemap/0.9"}
        self.xml_starttag(u'urlset', attrs)
        self.flush()
910308
protected void openDialog() {

        CmsCreateModelPageDialog dialog = new CmsCreateModelPageDialog(
            CmsSitemapView.getInstance().getController(),
            m_isModelGroup);
        dialog.center();
    }
754518
private void selectSite(String siteRoot) {

        if (m_sortSelectBox == null) {
            return;
        }
        Map<String, String> options = m_sortSelectBox.getItems();
        String option = null;
        for (Map.Entry<String, String> entry : options.entrySet()) {
            if (CmsStringUtil.comparePaths(entry.getKey(), siteRoot)) {
                option = entry.getKey();
                break;
            }
        }
        if (option != null) {
            m_sortSelectBox.setFormValue(option, false);
        }
    }
575492
private void createIndexHTML(String siteRoot) throws CmsIllegalArgumentException, CmsException {

        if (!m_cms.existsResource(siteRoot + INDEX_HTML)) {
            //Create index.html
            I_CmsResourceType containerType = OpenCms.getResourceManager().getResourceType(
                org.opencms.file.types.CmsResourceTypeXmlContainerPage.RESOURCE_TYPE_NAME);
            m_cms.createResource(siteRoot + INDEX_HTML, containerType);
        }
    }
584934
private void setupComboBoxSite() {

        IndexedContainer container = CmsVaadinUtils.getAvailableSitesContainer(A_CmsUI.getCmsObject(), "title");
        m_site.setContainerDataSource(container);
        m_site.setItemCaptionMode(ItemCaptionMode.PROPERTY);
        m_site.setItemCaptionPropertyId("title");
        m_site.setNullSelectionAllowed(false);
        m_site.setTextInputAllowed(false);
        m_site.setValue(A_CmsUI.getCmsObject().getRequestContext().getSiteRoot());
        m_site.addValueChangeListener(new ValueChangeListener() {

            private static final long serialVersionUID = -1019243885633462477L;

            public void valueChange(ValueChangeEvent event) {

                changeSite();
                removeUnvalidPathFields();
            }
        });

        m_project.setContainerDataSource(CmsVaadinUtils.getProjectsContainer(A_CmsUI.getCmsObject(), "caption"));
        m_project.setItemCaptionPropertyId("caption");
        m_project.select(A_CmsUI.getCmsObject().getRequestContext().getCurrentProject().getUuid());
        m_project.setNewItemsAllowed(false);
        m_project.setNullSelectionAllowed(false);
        m_project.setTextInputAllowed(false);
    }
848844
void internalOpenDialog(
        final CmsContainerPageElementPanel element,
        String editContentId,
        final boolean inline,
        boolean wasNew) {

        if (!m_editorOpened) {
            m_editorOpened = true;
            m_handler.disableToolbarButtons();
            m_handler.deactivateCurrentButton();
            m_currentElementId = editContentId;
            final String serverId = CmsContainerpageController.getServerId(m_currentElementId);
            final Runnable classicEdit = new Runnable() {

                public void run() {

                    CmsEditableData editableData = new CmsEditableData();
                    editableData.setElementLanguage(CmsCoreProvider.get().getLocale());
                    editableData.setStructureId(new CmsUUID(serverId));
                    editableData.setSitePath(element.getSitePath());
                    editableData.setMainLanguage(m_handler.m_controller.getData().getMainLocale());
                    CmsContentEditorDialog.get().openEditDialog(
                        editableData,
                        false,
                        null,
                        new DialogOptions(),
                        CmsContentEditorHandler.this);
                }
            };

            if (m_handler.m_controller.getData().isUseClassicEditor() || element.isNewEditorDisabled()) {
                classicEdit.run();
            } else {
                String editorLocale = CmsCoreProvider.get().getLocale();
                final String mainLocale;
                if (m_handler.m_controller.getData().getMainLocale() == null) {
                    Element htmlEl = CmsDomUtil.querySelector(
                        "[" + CmsGwtConstants.ATTR_DATA_ID + "*='" + serverId + "']",
                        element.getElement());
                    if (htmlEl != null) {
                        String entityId = htmlEl.getAttribute(CmsGwtConstants.ATTR_DATA_ID);
                        mainLocale = CmsContentDefinition.getLocaleFromId(entityId);
                    } else {
                        mainLocale = null;
                    }
                } else {
                    mainLocale = m_handler.m_controller.getData().getMainLocale();
                }
                I_CmsSimpleCallback<Boolean> onClose = new I_CmsSimpleCallback<Boolean>() {

                    public void execute(Boolean hasChangedSettings) {

                        addClosedEditorHistoryItem();
                        onClose(element.getSitePath(), new CmsUUID(serverId), false, hasChangedSettings.booleanValue());
                    }
                };
                if (inline && CmsContentEditor.hasEditable(element.getElement())) {
                    addEditingHistoryItem(true);
                    CmsEditorContext context = getEditorContext();
                    context.setHtmlContextInfo(getContextInfo(element));
                    // remove expired style before initializing the editor
                    element.setReleasedAndNotExpired(true);
                    // in case of new elements, ignore load time
                    CmsDebugLog.consoleLog("Opening inline editor for element. Was new: " + wasNew);
                    long loadTime = wasNew ? Long.MAX_VALUE : m_handler.m_controller.getLoadTime();
                    CmsContentEditor.getInstance().openInlineEditor(
                        context,
                        new CmsUUID(serverId),
                        editorLocale,
                        element,
                        mainLocale,
                        loadTime,
                        onClose);
                } else {
                    addEditingHistoryItem(false);
                    Map<String, String> settingPresets = new HashMap<String, String>();
                    CmsEditorContext context = getEditorContext();
                    I_CmsDropContainer dropContainer = element.getParentTarget();
                    if (dropContainer instanceof CmsContainerPageContainer) {
                        CmsContainerPageContainer container = (CmsContainerPageContainer)dropContainer;
                        settingPresets.putAll(container.getSettingPresets());
                    }
                    context.setSettingPresets(settingPresets);

                    boolean allowSettings = m_handler.m_controller.getData().allowSettingsInEditor()
                        && !m_handler.m_controller.isEditingDisabled()
                        && !serverId.equals(String.valueOf(m_handler.m_controller.getData().getDetailId()));
                    I_CmsSimpleCallback<Boolean> openEditor = new I_CmsSimpleCallback<Boolean>() {

                        public void execute(Boolean lockedPage) {

                            CmsContentEditor.getInstance().openFormEditor(
                                context,
                                editorLocale,
                                serverId,
                                lockedPage.booleanValue() ? getCurrentElementId() : null,
                                null,
                                null,
                                null,
                                null,
                                mainLocale,
                                null,
                                onClose);
                        }
                    };
                    if (allowSettings) {
                        if (m_handler.m_controller.getData().getDetailContainerPage() != null) {
                            CmsCoreProvider.get().lock(
                                m_handler.m_controller.getData().getDetailContainerPage(),
                                m_handler.m_controller.getLoadTime(),
                                openEditor);
                        } else {
                            CmsCoreProvider.get().lock(
                                CmsCoreProvider.get().getStructureId(),
                                m_handler.m_controller.getLoadTime(),
                                openEditor);
                        }
                    } else {
                        openEditor.execute(Boolean.FALSE);
                    }

                }
            }
        } else {
            CmsDebugLog.getInstance().printLine("Editor is already being opened.");
        }
    }
825340
public void openStandAloneFormEditor(final CmsEditorContext context) {

        initEventPreviewHandler();
        final CmsContentDefinition definition;
        try {
            definition = (CmsContentDefinition)CmsRpcPrefetcher.getSerializedObjectFromDictionary(
                getService(),
                I_CmsContentService.DICT_CONTENT_DEFINITION);
        } catch (SerializationException e) {
            RootPanel.get().add(new Label(e.getMessage()));
            return;
        }
        m_isStandAlone = true;
        if (definition.isModelInfo()) {
            openModelSelectDialog(context, definition);
        } else {
            CmsCoreProvider.get().lock(
                CmsContentDefinition.entityIdToUuid(definition.getEntityId()),
                new I_CmsSimpleCallback<Boolean>() {

                    public void execute(Boolean arg) {

                        if (arg.booleanValue()) {

                            registerContentDefinition(definition);
                            // register all external widgets
                            WidgetRegistry.getInstance().registerExternalWidgets(
                                definition.getExternalWidgetConfigurations(),
                                new Command() {

                                    public void execute() {

                                        initEditor(context, definition, null, false, null);
                                    }
                                });

                        } else {
                            showLockedResourceMessage();
                        }
                    }
                });
        }
    }
1029424
public void updateEditorMode() {

        CmsClientSitemapEntry entry = getSitemapEntry();
        getListItemWidget().setIcon(CmsSitemapView.getInstance().getIconForEntry(entry));
        setAdditionalStyles(entry, getListItemWidget());
        for (Widget child : m_children) {
            if (child instanceof CmsSitemapTreeItem) {
                ((CmsSitemapTreeItem)child).updateEditorMode();
            }
        }
    }
94385
public void addModelPageToSitemapConfiguration(CmsResource sitemapConfig, CmsResource modelPage, boolean disabled)
    throws CmsException {

        CmsFile sitemapConfigFile = m_cms.readFile(sitemapConfig);
        CmsXmlContent content = CmsXmlContentFactory.unmarshal(m_cms, sitemapConfigFile);
        CmsConfigurationReader reader = new CmsConfigurationReader(m_cms);
        reader.parseConfiguration(m_adeConfig.getBasePath(), content);
        List<CmsModelPageConfig> modelPageConfigs = reader.getModelPageConfigs();

        int i = 0;
        boolean isDefault = false;
        for (CmsModelPageConfig config : modelPageConfigs) {
            if (config.getResource().getStructureId().equals(modelPage.getStructureId())) {
                isDefault = config.isDefault();
                break;
            }
            i += 1;
        }
        if (i >= modelPageConfigs.size()) {
            content.addValue(m_cms, CmsConfigurationReader.N_MODEL_PAGE, Locale.ENGLISH, i);
        }
        String prefix = CmsConfigurationReader.N_MODEL_PAGE + "[" + (1 + i) + "]";
        content.getValue(prefix + "/" + CmsConfigurationReader.N_PAGE, Locale.ENGLISH).setStringValue(
            m_cms,
            modelPage.getRootPath());
        content.getValue(prefix + "/" + CmsConfigurationReader.N_DISABLED, Locale.ENGLISH).setStringValue(
            m_cms,
            "" + disabled);
        content.getValue(prefix + "/" + CmsConfigurationReader.N_IS_DEFAULT, Locale.ENGLISH).setStringValue(
            m_cms,
            "" + isDefault);
        writeSitemapConfig(content, sitemapConfigFile);
    }
853223
public void createSitemapSubEntry(final CmsClientSitemapEntry newEntry, CmsUUID parentId, String sitemapType) {

        CmsUUID structureId = m_data.getDefaultNewElementInfo().getCopyResourceId();
        newEntry.setResourceTypeName(sitemapType);
        create(newEntry, parentId, m_data.getDefaultNewElementInfo().getId(), structureId, null, true);
    }
1327327
protected void openFileSelector() {

        try {

            final Window window = CmsBasicDialog.prepareWindow(DialogWidth.max);
            window.setCaption(m_fileSelectCaption != null ? m_fileSelectCaption : getWindowCaption());
            A_CmsUI.get().addWindow(window);
            CmsResourceSelectDialog fileSelect;

            //Switch if cms object was set.
            if (m_cms == null) {
                fileSelect = new CmsResourceSelectDialog(m_filter, A_CmsUI.getCmsObject(), getOptions());
            } else {
                fileSelect = new CmsResourceSelectDialog(m_filter, m_cms, getOptions());
            }
            if (m_diableSiteSwitch) {
                fileSelect.disableSiteSwitch();
            }
            fileSelect.showSitemapView(m_startWithSitemapView);

            T value = getValue();
            if (value instanceof CmsResource) {
                fileSelect.showStartResource((CmsResource)value);
            } else if (value instanceof String) {
                if (CmsStringUtil.isEmptyOrWhitespaceOnly((String)value)) {
                    fileSelect.openPath(m_defaultPath);
                } else {
                    fileSelect.openPath((String)value);
                }
            }

            window.setContent(fileSelect);
            fileSelect.addSelectionHandler(new I_CmsSelectionHandler<CmsResource>() {

                public void onSelection(CmsResource selected) {

                    if (!resourceIsValid(selected)) {
                        return;
                    }
                    setResourceValue(selected);
                    window.close();

                }
            });
        } catch (CmsException e) {
            LOG.error(e.getLocalizedMessage(), e);
            CmsErrorDialog.showErrorDialog(e);
        }
    }
460882
public void actionNew() throws JspException {

        String newFileName = "";
        try {
            newFileName = A_CmsResourceCollector.createResourceForCollector(
                getCms(),
                m_paramNewLink,
                getElementLocale(),
                getParamResource(),
                getParamModelFile(),
                getParamMode(),
                getParamPostCreateHandler());
            // wipe out parameters for the editor to ensure proper operation
            setParamNewLink(null);
            setParamAction(null);
            setParamResource(newFileName);
            setAction(ACTION_DEFAULT);

            // create the temporary file to work with
            setParamTempfile(createTempFile());

            // set the member variables for the content
            m_file = getCms().readFile(getParamTempfile(), CmsResourceFilter.ALL);
            if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(getParamModelFile())) {
                m_content = CmsXmlContentFactory.unmarshal(
                    getCms(),
                    getCms().readFile(newFileName, CmsResourceFilter.ALL));
            } else {
                m_content = CmsXmlContentFactory.unmarshal(getCms(), m_file);
            }

        } catch (CmsException e) {
            if (LOG.isErrorEnabled()) {
                LOG.error(Messages.get().getBundle().key(Messages.LOG_CREATE_XML_CONTENT_ITEM_1, m_paramNewLink), e);
            }
            throw new JspException(e);
        } finally {
            try {
                // delete the new file
                getCms().deleteResource(newFileName, CmsResource.DELETE_REMOVE_SIBLINGS);
            } catch (CmsException e) {
                // ignore
            }
        }
    }
505728
public void openEditDialog(String siteRoot) {

        CmsEditSiteForm form;
        String caption;
        if (siteRoot != null) {
            form = new CmsEditSiteForm(m_rootCms, this, siteRoot);
            caption = CmsVaadinUtils.getMessageText(
                Messages.GUI_SITE_CONFIGURATION_EDIT_1,
                m_sitesTable.getContainer().getItem(siteRoot).getItemProperty(TableProperty.Title).getValue());
        } else {
            form = new CmsEditSiteForm(m_rootCms, this);
            caption = CmsVaadinUtils.getMessageText(Messages.GUI_SITE_ADD_0);
        }
        openDialog(form, caption);
    }