Returns an extended filter with the given resource restriction.<p>

@param structureId the structure id to filter

@return an extended filter with the given resource restriction
493747
public CmsVisitEntryFilter filterResource(CmsUUID structureId) {

        CmsVisitEntryFilter filter = (CmsVisitEntryFilter)clone();
        filter.m_structureId = structureId;
        return filter;
    }
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;
    }
1160362
private CmsResource getResource(CmsUUID structureId) {

        CmsResource resource = m_resources.get(structureId);
        if (resource == null) {
            try {
                resource = m_cms.readResource(structureId, CmsResourceFilter.ALL);
                m_resources.put(structureId, resource);
            } catch (CmsException e) {
                LOG.info(e.getLocalizedMessage(), e);
            }
        }
        return resource;
    }
1098738
public void setStructureId(String structureId) {

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

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

    }
388598
public CmsLockFilter filterProject(CmsUUID projectId) {

        CmsLockFilter filter = (CmsLockFilter)clone();
        filter.m_projectId = projectId;
        return filter;
    }
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;
    }
1013059
private CmsLockFilter getBlockingFilter() {

        CmsLockFilter blockingFilter = CmsLockFilter.FILTER_ALL;
        blockingFilter = blockingFilter.filterNotLockableByUser(getCms().getRequestContext().getCurrentUser());
        if (!isDirectPublish()) {
            blockingFilter = blockingFilter.filterProject(new CmsUUID(getParamProjectid()));
        }
        return blockingFilter;
    }
1371937
public static function fromLegacyToolbarAction(\SimpleXMLElement $node, $structureExtensionId) {
        $data = array(
            'id'          => (string)$node['id'],
            'extension'   => $structureExtensionId,
            'name'		  => (string)$node['title'],
            'level'		  => (int)$node['level'],
            'description' => empty($text) ? null : $text,
            'binding'     => isset($node['binding']) ? (string)$node['binding'] :  (isset($node['js']) ? (string)$node['js'] : null),
            'structure'   => isset($node['structure']) ? (string)$node['structure'] : null,
            'group'       => self::GROUP_SETTINGS,
            'icon'        => isset($node['icon']) ? Icon::fromArray(array('id' => (string)$node['icon']), $structureExtensionId) : null
        );
        $children = array();
        if (isset($node['structure'])) {
            $children = array();
            // (string)$node['structure']
        }
        return new static($data, $children); 
    }
1181279
public void removeResourceFromUsersPubList(CmsRequestContext context, Collection<CmsUUID> structureIds)
    throws CmsException {

        CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
        try {
            m_driverManager.removeResourceFromUsersPubList(dbc, context.getCurrentUser().getId(), structureIds);
        } catch (Exception e) {
            dbc.report(
                null,
                Messages.get().container(
                    Messages.ERR_REMOVE_RESOURCE_FROM_PUBLIST_2,
                    context.getCurrentUser().getName(),
                    structureIds),
                e);

        } finally {
            dbc.clear();
        }
    }
350413
public function prune($structureNode = null)
    {
        if ($structureNode) {
            $this->addUsingAlias(StructureNodeTableMap::COL_ID, $structureNode->getId(), Criteria::NOT_EQUAL);
        }

        return $this;
    }
717214
public Optional<LinkedResource> getById(String id)
  {
    return Optional.fromNullable(resourcesById.get(id));
  }
50280
private boolean vfsResourceWithStructureId(CmsUUID importId) {

        return m_cms.existsResource(importId, CmsResourceFilter.ALL)
            || m_onlineCms.existsResource(importId, CmsResourceFilter.ALL);
    }
62557
public void setTargetFolder(CmsUUID structureId) throws CmsException {

        CmsObject cms = A_CmsUI.getCmsObject();
        CmsResource res = cms.readResource(structureId);
        setTargetForlder(res);
    }
166069
public static List<CmsContextMenuEntryBean> getContextMenuEntries(
        final CmsObject cms,
        CmsUUID structureId,
        final AdeContext context) {

        Map<String, CmsContextMenuEntryBean> entries = new LinkedHashMap<String, CmsContextMenuEntryBean>();
        try {
            final List<CmsResource> resources;
            CmsResource resource = cms.readResource(structureId, CmsResourceFilter.ONLY_VISIBLE_NO_DELETED);
            // in case of sitemap editor check visibility with empty list
            if (context.equals(AdeContext.sitemapeditor)) {
                resources = Collections.emptyList();
            } else {
                resources = Collections.singletonList(resource);
            }
            Locale locale = OpenCms.getWorkplaceManager().getWorkplaceLocale(cms);
            // context to check item visibility
            I_CmsDialogContext dcontext = new I_CmsDialogContextWithAdeContext() {

                public void error(Throwable error) {
                    // not supported
                }

                public void finish(CmsProject project, String siteRoot) {
                    // not supported
                }

                public void finish(Collection<CmsUUID> result) {
                    // not supported
                }

                public void focus(CmsUUID id) {
                    // not supported
                }

                public AdeContext getAdeContext() {

                    return context;
                }

                public List<CmsUUID> getAllStructureIdsInView() {

                    return null;
                }

                public String getAppId() {

                    return context.name();
                }

                public CmsObject getCms() {

                    return cms;
                }

                public ContextType getContextType() {

                    ContextType type;
                    switch (context) {
                        case pageeditor:
                        case editprovider:
                            type = ContextType.containerpageToolbar;
                            break;
                        case sitemapeditor:
                            type = ContextType.sitemapToolbar;
                            break;
                        default:
                            type = ContextType.fileTable;
                    }
                    return type;
                }

                public List<CmsResource> getResources() {

                    return resources;
                }

                public void navigateTo(String appId) {
                    // not supported
                }

                public void onViewChange() {
                    // not supported
                }

                public void reload() {
                    // not supported
                }

                public void setWindow(Window window) {
                    // not supported
                }

                public void start(String title, Component dialog) {
                    // not supported
                }

                public void start(String title, Component dialog, DialogWidth width) {
                    // not supported
                }

                public void updateUserInfo() {
                    // not supported
                }
            };
            Map<String, List<CmsContextMenuEntryBean>> submenus = new HashMap<String, List<CmsContextMenuEntryBean>>();
            List<I_CmsContextMenuItem> items = new ArrayList<I_CmsContextMenuItem>(
                OpenCms.getWorkplaceAppManager().getMenuItemProvider().getMenuItems());
            Collections.sort(items, new Comparator<I_CmsContextMenuItem>() {

                public int compare(I_CmsContextMenuItem arg0, I_CmsContextMenuItem arg1) {

                    return Float.compare(arg0.getOrder(), arg1.getOrder());
                }
            });

            for (I_CmsContextMenuItem item : items) {

                if (!item.isLeafItem()) {
                    CmsMenuItemVisibilityMode visibility = item.getVisibility(dcontext);
                    if (!visibility.isInVisible()) {
                        entries.put(
                            item.getId(),
                            new CmsContextMenuEntryBean(
                                visibility.isActive(),
                                true,
                                null,
                                item.getTitle(locale),
                                null,
                                CmsStringUtil.isEmptyOrWhitespaceOnly(visibility.getMessageKey())
                                ? null
                                : OpenCms.getWorkplaceManager().getMessages(locale).getString(
                                    visibility.getMessageKey()),
                                false,
                                new ArrayList<CmsContextMenuEntryBean>()));
                    }
                } else if ((item instanceof I_CmsADEAction) && ((I_CmsADEAction)item).isAdeSupported()) {
                    CmsMenuItemVisibilityMode visibility = item.getVisibility(dcontext);
                    if (!visibility.isInVisible()) {
                        String jspPath = ((I_CmsADEAction)item).getJspPath();
                        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(jspPath)) {
                            jspPath = OpenCms.getLinkManager().substituteLink(cms, jspPath);
                        }
                        CmsContextMenuEntryBean itemBean = new CmsContextMenuEntryBean(
                            visibility.isActive(),
                            true,
                            jspPath,
                            item.getTitle(locale),
                            ((I_CmsADEAction)item).getCommandClassName(),
                            CmsStringUtil.isEmptyOrWhitespaceOnly(visibility.getMessageKey())
                            ? null
                            : OpenCms.getWorkplaceManager().getMessages(locale).getString(visibility.getMessageKey()),
                            false,
                            null);
                        Map<String, String> params = ((I_CmsADEAction)item).getParams();
                        if (params != null) {
                            params = new HashMap<String, String>(params);
                            for (Entry<String, String> param : params.entrySet()) {
                                String value = CmsVfsService.prepareFileNameForEditor(cms, resource, param.getValue());
                                param.setValue(value);
                            }
                            itemBean.setParams(params);
                        }
                        entries.put(item.getId(), itemBean);
                        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(item.getParentId())) {
                            List<CmsContextMenuEntryBean> submenu;
                            if (submenus.containsKey(item.getParentId())) {
                                submenu = submenus.get(item.getParentId());
                            } else {
                                submenu = new ArrayList<CmsContextMenuEntryBean>();
                                submenus.put(item.getParentId(), submenu);
                            }
                            submenu.add(itemBean);
                        }
                    }
                }
            }
            List<CmsContextMenuEntryBean> result = new ArrayList<CmsContextMenuEntryBean>();
            for (I_CmsContextMenuItem item : items) {
                if (entries.containsKey(item.getId())) {
                    if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(item.getParentId())) {
                        if (entries.containsKey(item.getParentId())) {
                            CmsContextMenuEntryBean parent = entries.get(item.getParentId());
                            if (parent.getSubMenu() != null) {
                                parent.getSubMenu().add(entries.get(item.getId()));
                            }
                        }
                    } else {
                        result.add(entries.get(item.getId()));
                    }
                }
            }
            return result;
        } catch (CmsException e) {
            // ignore, the user probably has not enough permissions to read the resource
            LOG.debug(e.getLocalizedMessage(), e);
        }
        return Collections.emptyList();
    }
1207411
public static void loadDialog(final CmsUUID structureId, final I_CmsHistoryActionHandler handler) {

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

            @Override
            public void execute() {

                start(200, true);
                CmsCoreProvider.getVfsService().getResourceHistory(structureId, this);
            }

            @Override
            protected void onResponse(CmsHistoryResourceCollection result) {

                stop(false);
                final CmsPopup popup = new CmsPopup(CmsHistoryMessages.dialogTitle(), 1150);
                popup.addDialogClose(null);
                CmsResourceHistoryView view = new CmsResourceHistoryView(result, handler);
                handler.setPostRevertAction(new Runnable() {

                    public void run() {

                        popup.hide();
                    }
                });
                popup.setMainContent(view);
                popup.setModal(true);
                popup.setGlassEnabled(true);
                popup.centerHorizontally(80);
            }

        };
        action.execute();

    }
889936
public CmsRelationFilter filterResource(CmsResource resource) {

        CmsRelationFilter filter = filterStructureId(resource.getStructureId());
        filter = filterPath(resource.getRootPath());
        return filter;
    }
52098
public CmsResource getTarget(CmsObject cms, CmsResourceFilter filter) throws CmsException {

        try {
            // first look up by id
            return cms.readResource(getTargetId(), filter);
        } catch (CmsVfsResourceNotFoundException e) {
            // then look up by name, but from the root site
            String storedSiteRoot = cms.getRequestContext().getSiteRoot();
            try {
                cms.getRequestContext().setSiteRoot("");
                return cms.readResource(getTargetPath(), filter);
            } finally {
                cms.getRequestContext().setSiteRoot(storedSiteRoot);
            }
        }
    }