Reads the URL names for all locales.<p>

@param structureId the id of resource for which the URL names should be read
@return returns the URL names for the resource

@throws CmsException if something goes wrong
769666
public List<String> readUrlNamesForAllLocales(CmsUUID structureId) throws CmsException {

        List<String> detailNames = m_securityManager.readUrlNamesForAllLocales(m_context, structureId);
        if (detailNames.isEmpty()) {
            List<String> result = new ArrayList<String>();
            result.add(structureId.toString());
            return result;
        }
        return detailNames;
    }
1225713
public void doEdit(final String filename, final CmsUUID structureId) {

        I_CmsEditableData editData = new I_CmsEditableData() {

            public String getContextId() {

                return "";
            }

            public String getEditId() {

                return null;
            }

            public String getElementId() {

                // TODO Auto-generated method stub
                return null;
            }

            public String getElementLanguage() {

                return null;
            }

            public String getElementName() {

                return null;
            }

            public String getNewLink() {

                return null;
            }

            public String getNewTitle() {

                return null;
            }

            public String getNoEditReason() {

                return null;
            }

            public String getPostCreateHandler() {

                return null;
            }

            public String getSitePath() {

                return filename;
            }

            public CmsUUID getStructureId() {

                return structureId;
            }

            public boolean hasEditHandler() {

                return false;
            }

            public boolean hasResource() {

                return true;
            }

            public boolean isUnreleasedOrExpired() {

                return false;
            }

            public void setSitePath(String sitePath) {

                // nothing to do
            }
        };
        if (m_useSelf) {
            FormElement form = CmsContentEditorDialog.generateForm(editData, false, "_self", null);
            RootPanel.getBodyElement().appendChild(form);
            form.submit();
        } else {

            I_CmsContentEditorHandler handler = new I_CmsContentEditorHandler() {

                @SuppressWarnings("synthetic-access")
                public void onClose(String sitePath, CmsUUID id, boolean isNew, boolean hasChangedSettings) {

                    if (!m_reload) {
                        return;
                    }

                    if (m_immediateReload) {
                        reloadTop();
                    }

                    // defer the window.location.reload until after the editor window has closed
                    // so we don't get another confirmation dialog
                    Timer timer = new Timer() {

                        @Override
                        public void run() {

                            reloadTop();

                        }

                    };
                    timer.schedule(10);
                }
            };
            CmsContentEditorDialog.get().openEditDialog(editData, false, null, new DialogOptions(), handler);
        }
    }
233125
private List<String> readLinkExcludes(CmsObject cms) {

        List<String> linkExcludes = new ArrayList<String>();

        try {
            // get the link exclude file
            String filePath = OpenCms.getSystemInfo().getConfigFilePath(cms, LINK_EXCLUDE_DEFINIFITON_FILE);
            CmsResource res = cms.readResource(filePath);
            CmsFile file = cms.readFile(res);
            CmsXmlContent linkExcludeDefinitions = CmsXmlContentFactory.unmarshal(cms, file);

            // get number of excludes
            int count = linkExcludeDefinitions.getIndexCount(XPATH_LINK, Locale.ENGLISH);

            for (int i = 1; i <= count; i++) {

                String exclude = linkExcludeDefinitions.getStringValue(cms, XPATH_LINK + "[" + i + "]", Locale.ENGLISH);
                linkExcludes.add(exclude);

            }

        } catch (CmsException e) {
            LOG.error(e);
        }

        return linkExcludes;
    }
1056423
protected I_CmsContextMenuEntry createTemplateContextSelectionMenuEntry(CmsUUID structureId) {

        final CmsTemplateContextInfo info = m_controller.getData().getTemplateContextInfo();
        if ((info.getCookieName() != null) && info.shouldShowTemplateContextContextMenuEntry()) {
            CmsContextMenuEntry parentEntry = new CmsContextMenuEntry(this, structureId, new I_CmsContextMenuCommand() {

                public void execute(
                    CmsUUID innerStructureId,
                    I_CmsContextMenuHandler handler,
                    CmsContextMenuEntryBean bean) {

                    // do nothing
                }

                public A_CmsContextMenuItem getItemWidget(
                    CmsUUID innerStructureId,
                    I_CmsContextMenuHandler handler,
                    CmsContextMenuEntryBean bean) {

                    return null;
                }

                public boolean hasItemWidget() {

                    return false;
                }

            });
            CmsContextMenuEntryBean parentBean = new CmsContextMenuEntryBean();

            parentBean.setLabel(
                org.opencms.gwt.client.Messages.get().key(
                    org.opencms.gwt.client.Messages.GUI_TEMPLATE_CONTEXT_PARENT_0));
            parentBean.setActive(true);
            parentBean.setVisible(true);
            parentEntry.setBean(parentBean);

            Map<String, String> contextNames = info.getContextLabels();

            List<I_CmsContextMenuEntry> templateContextEntries = new ArrayList<I_CmsContextMenuEntry>();
            for (Map.Entry<String, String> entry : contextNames.entrySet()) {
                final String key = entry.getKey();
                final String label = entry.getValue();
                if (info.hasClientVariants(key)) {
                    CmsContextMenuEntry singleContextEntry = createRawMenuEntry(structureId, DO_NOTHING);
                    boolean showCheckbox = Objects.equal(info.getSelectedContext(), entry.getKey());
                    decorateMenuEntry(singleContextEntry, label, showCheckbox);
                    List<I_CmsContextMenuEntry> variantEntries = new ArrayList<I_CmsContextMenuEntry>();
                    CmsContextMenuEntry editVariantEntry = createMenuEntryForTemplateContext(
                        info.getCookieName(),
                        key,
                        org.opencms.ade.containerpage.client.Messages.get().key(
                            org.opencms.ade.containerpage.client.Messages.GUI_TEMPLATE_CONTEXT_NO_VARIANT_0),
                        false,
                        this,
                        structureId);
                    variantEntries.add(editVariantEntry);
                    Map<String, CmsClientVariantInfo> variants = info.getClientVariants(key);
                    for (CmsClientVariantInfo variant : variants.values()) {
                        CmsContextMenuEntry currentVariantEntry = createRawMenuEntry(
                            structureId,
                            new ClientVariantSelectAction(key, variant));
                        decorateMenuEntry(currentVariantEntry, variant.getNiceName(), false);
                        variantEntries.add(currentVariantEntry);
                    }
                    singleContextEntry.setSubMenu(variantEntries);
                    templateContextEntries.add(singleContextEntry);

                } else {

                    CmsContextMenuEntry menuEntry = createMenuEntryForTemplateContext(
                        info.getCookieName(),
                        key,
                        label,
                        Objects.equal(key, info.getSelectedContext()),
                        this,
                        structureId);
                    templateContextEntries.add(menuEntry);
                }
            }
            templateContextEntries.add(
                createMenuEntryForTemplateContext(
                    info.getCookieName(),
                    null,
                    org.opencms.gwt.client.Messages.get().key(
                        org.opencms.gwt.client.Messages.GUI_TEMPLATE_CONTEXT_NONE_0),
                    Objects.equal(null, info.getSelectedContext()),
                    this,
                    structureId));
            parentEntry.setSubMenu(templateContextEntries);

            return parentEntry;

        } else {
            return null;
        }
    }
464768
public List<CmsUrlNameMappingEntry> readUrlNameMappings(CmsUrlNameMappingFilter filter) throws CmsException {

        return m_securityManager.readUrlNameMappings(m_context, filter);
    }
1098738
public void setStructureId(String structureId) {

        try {
            m_resourceBuilder.setStructureId(new CmsUUID(structureId));
            m_hasStructureId = true;

        } catch (Throwable e) {
            setThrowable(e);
        }

    }
271049
protected CmsResource readJspResource(CmsFlexController controller, String jspName) throws CmsException {

        // create an OpenCms user context that operates in the root site
        CmsObject cms = OpenCms.initCmsObject(controller.getCmsObject());
        // we only need to change the site, but not the project,
        // since the request has already the right project set
        cms.getRequestContext().setSiteRoot("");
        // try to read the resource
        return cms.readResource(jspName);
    }
870388
protected void readFolder(CmsUUID folderId, boolean clearFilter) throws CmsException {

        CmsObject cms = A_CmsUI.getCmsObject();
        if (clearFilter) {
            m_searchField.clear();
        }
        CmsResource folder = cms.readResource(folderId, FOLDERS);
        m_currentFolder = folderId;
        String folderPath = cms.getSitePath(folder);
        if (OpenCms.getSiteManager().isSharedFolder(cms.getRequestContext().getSiteRoot())) {
            folderPath = folderPath.substring(cms.getRequestContext().getSiteRoot().length());
        }
        setPathInfo(folderPath);
        List<CmsResource> childResources = cms.readResources(folder, FILES_N_FOLDERS, false);
        m_fileTable.fillTable(cms, childResources, clearFilter);
        boolean hasFolderChild = false;
        for (CmsResource child : childResources) {
            if (child.isFolder()) {
                hasFolderChild = true;
                break;
            }
        }
        m_treeContainer.setChildrenAllowed(folderId, hasFolderChild);
        String sitePath = folder.getRootPath().equals(cms.getRequestContext().getSiteRoot() + "/") ? "" : folderPath;
        String state = new StateBean(
            cms.getRequestContext().getSiteRoot(),
            sitePath,
            cms.getRequestContext().getCurrentProject().getUuid().toString()).asString();
        if (LOG.isDebugEnabled()) {
            String p = RandomStringUtils.randomAlphanumeric(5) + " readFolder ";
            LOG.debug(p + "siteRoot = " + cms.getRequestContext().getSiteRoot());
            LOG.debug(p + "folder = " + folder.getRootPath());
            LOG.debug(p + "folderPath = " + folderPath);
            LOG.debug(p + "sitePath = " + sitePath);
            LOG.debug(p + "state = " + state);
            LOG.debug(p + "m_currentState = " + m_currentState);
            LOG.debug(p + "m_currentState.asString = " + StateBean.parse(m_currentState).asString());
        }
        if ((m_currentState == null) || !(state).equals(StateBean.parse(m_currentState).asString())) {
            m_currentState = state;
            CmsAppWorkplaceUi.get().changeCurrentAppState(m_currentState);
        }
        m_locationCache.setFileExplorerLocation(cms.getRequestContext().getSiteRoot(), sitePath);
        m_uploadButton.setTargetFolder(folder.getRootPath());
        m_uploadArea.setTargetFolder(folder.getRootPath());
        if (!m_fileTree.isExpanded(folderId)) {
            expandCurrentFolder();
        }
        if (!m_fileTree.isSelected(folderId)) {
            m_fileTree.select(folderId);
        }
    }
717923
protected void parseLinks(CmsObject cms) throws CmsException {

        List<CmsResource> linkParseables = new ArrayList<>();
        for (CmsResourceImportData resData : m_moduleData.getResourceData()) {
            CmsResource importRes = resData.getImportResource();
            if ((importRes != null) && m_importIds.contains(importRes.getStructureId()) && isLinkParsable(importRes)) {
                linkParseables.add(importRes);
            }
        }
        m_report.println(Messages.get().container(Messages.RPT_START_PARSE_LINKS_0), I_CmsReport.FORMAT_HEADLINE);
        CmsImportVersion10.parseLinks(cms, linkParseables, m_report);
        m_report.println(Messages.get().container(Messages.RPT_END_PARSE_LINKS_0), I_CmsReport.FORMAT_HEADLINE);
    }
1032690
protected List<CmsResource> getInternalResources(CmsObject cms, Map<String, String> params) throws CmsException {

        synchronized (this) {
            if (m_resources == null) {
                m_resources = getResources(cms, params);
                Iterator<CmsResource> it = m_resources.iterator();
                while (it.hasNext()) {
                    CmsResource resource = it.next();
                    m_resCache.put(resource.getStructureId().toString(), resource);
                }
            }
        }
        return m_resources;
    }
143621
public CmsGallerySearchResult searchById(CmsUUID id, Locale locale) throws CmsException {

        I_CmsSearchDocument sDoc = m_index.getDocument(
            CmsSearchField.FIELD_ID,
            id.toString(),
            CmsGallerySearchResult.getRequiredSolrFields());

        CmsGallerySearchResult result = null;
        if ((sDoc != null) && (sDoc.getDocument() != null)) {
            result = new CmsGallerySearchResult(sDoc, m_cms, 100, locale);
        } else {
            CmsResource res = m_cms.readResource(id, CmsResourceFilter.ALL);
            result = new CmsGallerySearchResult(m_cms, res);
        }
        return result;
    }
789509
public static String getVaadinWorkplaceLink(CmsObject cms, CmsUUID structureId) {

        String resourceRootFolder = null;

        if (structureId != null) {
            try {
                resourceRootFolder = CmsResource.getFolderPath(
                    cms.readResource(structureId, CmsResourceFilter.ONLY_VISIBLE_NO_DELETED).getRootPath());
            } catch (CmsException e) {
                LOG.debug("Error reading resource for workplace link.", e);
            }
        }
        if (resourceRootFolder == null) {
            resourceRootFolder = cms.getRequestContext().getSiteRoot();
        }
        return getVaadinWorkplaceLink(cms, resourceRootFolder);

    }
441141
public List<CmsPropertyDefinition> readAllPropertyDefinitions(CmsRequestContext context) throws CmsException {

        CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
        List<CmsPropertyDefinition> result = null;
        try {
            result = m_driverManager.readAllPropertyDefinitions(dbc);
        } catch (Exception e) {
            dbc.report(null, Messages.get().container(Messages.ERR_READ_ALL_PROPDEF_0), e);
        } finally {
            dbc.clear();
        }
        return result;
    }
1085262
public static CmsEditExternalLinkDialog loadAndShowDialog(final CmsUUID structureId) {

        final CmsEditExternalLinkDialog dialog = new CmsEditExternalLinkDialog(structureId);
        CmsRpcAction<CmsExternalLinkInfoBean> action = new CmsRpcAction<CmsExternalLinkInfoBean>() {

            @Override
            public void execute() {

                CmsCoreProvider.getVfsService().loadLinkInfo(structureId, this);
            }

            @Override
            protected void onResponse(CmsExternalLinkInfoBean result) {

                dialog.initContent(result);
            }
        };
        action.execute();
        dialog.center();
        return dialog;
    }
279454
public void removeResourceFromUsersPubList(CmsObject cms, Collection<CmsUUID> structureIds) throws CmsException {

        m_securityManager.removeResourceFromUsersPubList(cms.getRequestContext(), structureIds);
    }
861840
public CmsProject readProject(CmsUUID id) throws CmsException {

        CmsDbContext dbc = m_dbContextFactory.getDbContext();
        CmsProject result = null;
        try {
            result = m_driverManager.readProject(dbc, id);
        } catch (Exception e) {
            dbc.report(null, Messages.get().container(Messages.ERR_READ_PROJECT_FOR_ID_1, id), e);
        } finally {
            dbc.clear();
        }
        return result;
    }
679054
public CmsUrlNameMappingFilter filterRejectStructureId(CmsUUID id) {

        if (id == null) {
            throw new IllegalArgumentException();
        }
        if (m_structureId != null) {
            throw new IllegalStateException();
        }
        CmsUrlNameMappingFilter result = new CmsUrlNameMappingFilter(this);
        result.m_rejectStructureId = id;
        return result;
    }