Returns the newest URL names for the given structure id for each locale.<p>

@param id the structure id
@return the list of URL names for each locale

@throws CmsException if something goes wrong
778357
public List<String> getUrlNamesForAllLocales(CmsUUID id) throws CmsException {

        return m_securityManager.readUrlNamesForAllLocales(m_context, id);
    }
547257
public static List<Domain> suggestDomains(Structure s) throws StructureException{

		Atom[] ca = StructureTools.getRepresentativeAtomArray(s);

		return suggestDomains(ca);
	}
418156
protected void initContent(final CmsUUID structureId) {

        CmsRpcAction<CmsReplaceInfo> action = new CmsRpcAction<CmsReplaceInfo>() {

            @Override
            public void execute() {

                start(0, true);
                CmsCoreProvider.getVfsService().getFileReplaceInfo(structureId, this);
            }

            @Override
            protected void onResponse(CmsReplaceInfo result) {

                initContent(result);
                stop(false);
            }
        };
        action.execute();
    }
1014947
public List<String> readAllUrlNameMappingEntries(CmsRequestContext context, CmsUUID id) throws CmsException {

        CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
        try {
            List<CmsUrlNameMappingEntry> entries = m_driverManager.readUrlNameMappingEntries(
                dbc,
                context.getCurrentProject().isOnlineProject(),
                CmsUrlNameMappingFilter.ALL.filterStructureId(id));
            List<String> result = new ArrayList<String>();
            for (CmsUrlNameMappingEntry entry : entries) {
                result.add(entry.getName());
            }
            return result;
        } catch (Exception e) {
            CmsMessageContainer message = Messages.get().container(
                Messages.ERR_READ_NEWEST_URLNAME_FOR_ID_1,
                id.toString());
            dbc.report(null, message, e);
            return null;
        } finally {
            dbc.clear();
        }

    }
1209294
protected CmsUserSearchParameters getSearchParams() throws CmsException {

        CmsListState state = getListState();
        CmsUserSearchParameters params = new CmsUserSearchParameters();
        String searchFilter = state.getFilter();
        params.setSearchFilter(searchFilter);
        params.setPaging(getList().getMaxItemsPerPage(), state.getPage());
        params.setSorting(getSortKey(state.getColumn()), state.getOrder().equals(CmsListOrderEnum.ORDER_ASCENDING));
        String groupStr = getParamGroup();
        if (!CmsStringUtil.isEmpty(groupStr)) {
            CmsGroup group = getCms().readGroup(getParamGroup());
            params.setGroup(group);
        } else {
            List<CmsOrganizationalUnit> ous = OpenCms.getRoleManager().getManageableOrgUnits(getCms(), "", true, false);
            params.setAllowedOus(ous);
        }
        if (getParamFlags() != null) {
            int flags = Integer.parseInt(getParamFlags());
            params.setFlags(flags);
        }
        params.setCaseSensitive(false);
        return params;
    }
135846
public CmsHistoryResourceCollection getResourceHistoryInternal(CmsUUID structureId) throws CmsException {

        CmsHistoryResourceCollection result = new CmsHistoryResourceCollection();
        CmsObject cms = getCmsObject();
        CmsResource resource = cms.readResource(structureId, CmsResourceFilter.ALL);
        List<I_CmsHistoryResource> versions = cms.readAllAvailableVersions(resource);
        if (!resource.getState().isUnchanged()) {
            result.add(createHistoryResourceBean(cms, resource, true, -1));
        }
        int maxVersion = 0;

        if (versions.isEmpty()) {
            try {
                CmsProject online = cms.readProject(CmsProject.ONLINE_PROJECT_ID);
                CmsObject onlineCms = OpenCms.initCmsObject(cms);
                onlineCms.getRequestContext().setCurrentProject(online);
                CmsResource onlineResource = onlineCms.readResource(structureId, CmsResourceFilter.ALL);
                CmsHistoryResourceBean onlineResBean = createHistoryResourceBean(onlineCms, onlineResource, false, 0);
                result.add(onlineResBean);
            } catch (CmsVfsResourceNotFoundException e) {
                LOG.info(e.getLocalizedMessage(), e);
            } catch (Exception e) {
                LOG.error(e.getLocalizedMessage(), e);
            }
        } else {
            for (I_CmsHistoryResource historyRes : versions) {
                maxVersion = Math.max(maxVersion, historyRes.getVersion());
            }
            for (I_CmsHistoryResource historyRes : versions) {
                CmsHistoryResourceBean historyBean = createHistoryResourceBean(
                    cms,
                    (CmsResource)historyRes,
                    false,
                    maxVersion);
                result.add(historyBean);
            }
        }
        return result;
    }
1207744
@RequestMapping(value = "builds/{buildId}/links/from", method = RequestMethod.GET)
    public Resources<Build> getBuildLinksFrom(@PathVariable ID buildId) {
        return Resources.of(
                structureService.getBuildLinksFrom(structureService.getBuild(buildId)),
                uri(on(getClass()).getBuildLinksFrom(buildId))
        ).forView(Build.class);
    }
707904
public void commitUrlNameMappings() throws CmsException {

        Set<CmsUUID> structureIds = Sets.newHashSet();
        for (InternalUrlNameMappingEntry entry : m_urlNameMappingEntries) {
            structureIds.add(entry.getStructureId());
        }

        boolean urlnameReplace = false;
        for (CmsUUID structureId : structureIds) {
            try {
                CmsResource resource = m_cms.readResource(structureId, CmsResourceFilter.ALL);
                CmsProperty prop = m_cms.readPropertyObject(
                    resource,
                    CmsPropertyDefinition.PROPERTY_URLNAME_REPLACE,
                    true);
                if (!CmsStringUtil.isEmptyOrWhitespaceOnly(prop.getValue())) {
                    urlnameReplace = Boolean.parseBoolean(prop.getValue());
                }
            } catch (CmsException e) {
                LOG.error("Error while trying to read urlname.replace: " + e.getLocalizedMessage(), e);
            }

        }

        I_CmsFileNameGenerator nameGen = OpenCms.getResourceManager().getNameGenerator();
        for (InternalUrlNameMappingEntry entry : m_urlNameMappingEntries) {
            Iterator<String> nameSeq = nameGen.getUrlNameSequence(entry.getName());
            m_cms.writeUrlNameMapping(nameSeq, entry.getStructureId(), entry.getLocale().toString(), urlnameReplace);
        }

    }
1277770
private List<CmsContainerElementBean> getCachedElements(List<String> clientIds, String pageRootPath)
    throws CmsException {

        List<CmsContainerElementBean> result = new ArrayList<CmsContainerElementBean>();
        for (String id : clientIds) {
            try {
                result.add(getCachedElement(id, pageRootPath));
            } catch (CmsIllegalArgumentException e) {
                log(e.getLocalizedMessage(), e);
            }
        }
        return result;
    }
1137903
private Set<CmsResource> getResourcesFromPrincipal(CmsObject cms, CmsUUID id) throws CmsException {

        return cms.getResourcesForPrincipal(id, null, false);
    }
167545
private String getNewContentName() throws CmsException {

        String sitePath = OpenCms.getResourceManager().getNameGenerator().getNewFileName(
            m_cms,
            CmsStringUtil.joinPaths(
                m_cms.getRequestContext().removeSiteRoot(m_configuration.getContentParentFolder().getRootPath()),
                m_configuration.getNamePattern()),
            5);
        return sitePath;
    }
969978
private Set<String> getSearchIndexNames() {

        Set<String> names = new HashSet<String>();
        @SuppressWarnings("unchecked")
        Set<I_CmsSearchIndex> indexes = (Set<I_CmsSearchIndex>)getValue();
        for (I_CmsSearchIndex index : indexes) {
            names.add(index.getName());
        }
        return names;
    }
643013
public void getNewOptions(final String clientId, final I_CmsSimpleCallback<CmsDialogOptionsAndInfo> callback) {

        CmsRpcAction<CmsDialogOptionsAndInfo> action = new CmsRpcAction<CmsDialogOptionsAndInfo>() {

            @Override
            public void execute() {

                getContainerpageService().getNewOptions(
                    clientId,
                    getData().getRpcContext().getPageStructureId(),
                    getData().getRequestParams(),
                    this);
            }

            @Override
            protected void onResponse(CmsDialogOptionsAndInfo result) {

                callback.execute(result);
            }
        };

        action.execute();
    }
914651
public List<CmsLink> getLinks(CmsObject cms) {

        List<CmsLink> result = new ArrayList<CmsLink>();

        @SuppressWarnings("unchecked")
        List<Element> linkElements = m_element.elements(CmsXmlPage.NODE_LINK);
        for (Element linkElement : linkElements) {
            if (linkElement == null) {
                String uri = m_element.getText();
                if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(uri)) {
                    setStringValue(cms, uri);
                }
            }
            CmsLinkUpdateUtil.updateType(linkElement, getRelationType(getPath()));
            CmsLink link = new CmsLink(linkElement);
            link.checkConsistency(cms);
            if (CmsStringUtil.isEmptyOrWhitespaceOnly(link.getTarget())) {
                continue;
            }
            result.add(link);
        }
        return result;
    }
1159846
public CmsUUID convertToServerId(String id) throws CmsIllegalArgumentException {

        if (id == null) {
            throw new CmsIllegalArgumentException(
                org.opencms.xml.containerpage.Messages.get().container(
                    org.opencms.xml.containerpage.Messages.ERR_INVALID_ID_1,
                    id));
        }
        String serverId = getServerIdString(id);
        try {
            return new CmsUUID(serverId);
        } catch (NumberFormatException e) {
            throw new CmsIllegalArgumentException(
                org.opencms.xml.containerpage.Messages.get().container(
                    org.opencms.xml.containerpage.Messages.ERR_INVALID_ID_1,
                    id),
                e);
        }
    }
350268
private CmsResource getContainerpage(CmsObject cms) throws CmsException {

        String currentUri = cms.getRequestContext().getUri();
        CmsResource containerPage = cms.readResource(currentUri);
        if (!CmsResourceTypeXmlContainerPage.isContainerPage(containerPage)) {
            // container page is used as template
            String cntPagePath = cms.readPropertyObject(
                containerPage,
                CmsPropertyDefinition.PROPERTY_TEMPLATE_ELEMENTS,
                true).getValue("");
            try {
                containerPage = cms.readResource(cntPagePath);
            } catch (CmsException e) {
                if (!LOG.isDebugEnabled()) {
                    LOG.warn(e.getLocalizedMessage());
                }
                LOG.debug(e.getLocalizedMessage(), e);
            }
        }
        return containerPage;
    }
193996
public void initialize(CmsUUID id, Locale initialComparisonLocale) throws CmsException {

        removeAllComponents();
        CmsObject cms = A_CmsUI.getCmsObject();
        CmsResource res = cms.readResource(id);
        m_currentRoot = res;
        CmsSite site = OpenCms.getSiteManager().getSiteForRootPath(res.getRootPath());

        Locale rootLocale = OpenCms.getLocaleManager().getDefaultLocale(cms, res);
        m_rootLocale = rootLocale;
        Locale mainLocale = site.getMainTranslationLocale(null);
        List<Locale> secondaryLocales = site.getSecondaryTranslationLocales();

        List<Locale> possibleLocaleSelections = getMainLocaleSelectOptions(cms, res, mainLocale, secondaryLocales);
        m_rootLocaleSelector = new ComboBox();
        m_rootLocaleSelector.addStyleName("o-sitemap-localeselect");
        m_rootLocaleSelector.setNullSelectionAllowed(false);
        for (Locale selectableLocale : possibleLocaleSelections) {
            m_rootLocaleSelector.addItem(selectableLocale);
            m_rootLocaleSelector.setItemIcon(selectableLocale, FontOpenCms.SPACE);
            m_rootLocaleSelector.setItemCaption(
                selectableLocale,
                selectableLocale.getDisplayName(A_CmsUI.get().getLocale()));
        }
        m_rootLocaleSelector.setItemIcon(mainLocale, MAIN_LOCALE_ICON);
        m_rootLocaleSelector.setValue(m_rootLocale);
        m_rootLocaleSelector.addValueChangeListener(new ValueChangeListener() {

            private static final long serialVersionUID = 1L;

            @SuppressWarnings("synthetic-access")
            public void valueChange(ValueChangeEvent event) {

                if (!m_handlingLocaleChange) {
                    m_handlingLocaleChange = true;
                    try {
                        Locale newLocale = (Locale)(event.getProperty().getValue());
                        switchToLocale(newLocale);
                    } catch (Exception e) {
                        LOG.error(e.getLocalizedMessage(), e);
                        CmsErrorDialog.showErrorDialog(e);
                    } finally {
                        m_handlingLocaleChange = false;
                    }
                }
            }
        });

        m_comparisonLocaleSelector = new ComboBox();
        m_comparisonLocaleSelector.addStyleName("o-sitemap-localeselect");
        m_comparisonLocaleSelector.setNullSelectionAllowed(false);

        List<Locale> comparisonLocales = getComparisonLocales();
        Locale selectedComparisonLocale = null;
        for (Locale comparisonLocale : comparisonLocales) {
            m_comparisonLocaleSelector.addItem(comparisonLocale);
            m_comparisonLocaleSelector.setItemIcon(comparisonLocale, FontOpenCms.SPACE);
            m_comparisonLocaleSelector.setItemCaption(
                comparisonLocale,
                comparisonLocale.getDisplayName(A_CmsUI.get().getLocale()));
            if ((selectedComparisonLocale == null) && !comparisonLocale.equals(m_rootLocale)) {
                selectedComparisonLocale = comparisonLocale;
            }
            if ((initialComparisonLocale != null)
                && comparisonLocale.equals(initialComparisonLocale)
                && !comparisonLocale.equals(m_rootLocale)) {
                // if an initial comparison locale is given, it should have priority over the first comparison locale
                selectedComparisonLocale = comparisonLocale;
            }

        }
        m_comparisonLocale = selectedComparisonLocale;
        m_comparisonLocaleSelector.setValue(selectedComparisonLocale);
        m_comparisonLocaleSelector.setItemIcon(mainLocale, MAIN_LOCALE_ICON);

        m_comparisonLocaleSelector.addValueChangeListener(new ValueChangeListener() {

            private static final long serialVersionUID = 1L;

            @SuppressWarnings("synthetic-access")
            public void valueChange(ValueChangeEvent event) {

                if (!m_handlingLocaleChange) {
                    m_handlingLocaleChange = true;
                    try {
                        Locale locale = (Locale)(event.getProperty().getValue());
                        if (m_rootLocale.equals(locale)) {
                            Locale oldComparisonLocale = m_comparisonLocale;
                            if (getLocaleGroup().getResourcesByLocale().keySet().contains(oldComparisonLocale)) {
                                m_comparisonLocale = locale;
                                switchToLocale(oldComparisonLocale);
                                updateLocaleWidgets();
                            } else {
                                Notification.show(
                                    CmsVaadinUtils.getMessageText(
                                        Messages.GUI_LOCALECOMPARE_CANNOT_SWITCH_COMPARISON_LOCALE_0));
                                m_comparisonLocaleSelector.setValue(oldComparisonLocale);
                            }
                        } else {
                            m_comparisonLocale = locale;
                            updateLocaleWidgets();
                            initTree(m_currentRoot);
                        }

                    } catch (Exception e) {
                        LOG.error(e.getLocalizedMessage(), e);
                        CmsErrorDialog.showErrorDialog(e);
                    } finally {
                        m_handlingLocaleChange = false;
                    }
                }
            }
        });

        CssLayout localeSelectors = new CssLayout();
        localeSelectors.addStyleName(OpenCmsTheme.SITEMAP_LOCALE_BAR);

        m_rootLocaleSelector.setCaption(CmsVaadinUtils.getMessageText(Messages.GUI_LOCALECOMPARE_MAIN_LOCALE_0));
        m_comparisonLocaleSelector.setCaption(
            CmsVaadinUtils.getMessageText(Messages.GUI_LOCALECOMPARE_COMPARISON_LOCALE_0));

        localeSelectors.setWidth("100%");
        localeSelectors.addComponent(m_rootLocaleSelector);
        localeSelectors.addComponent(m_comparisonLocaleSelector);
        // localeSelectors.setComponentAlignment(wrapper2, Alignment.MIDDLE_RIGHT);

        setSpacing(true);
        addComponent(localeSelectors);
        addComponent(m_treeContainer);
        m_treeContainer.setWidth("100%");
        initTree(res);
    }