Reads the categories assigned to a resource.

@return map from the resource path (root path) to the assigned categories
344607
public Map<String, CmsJspCategoryAccessBean> getReadResourceCategories() {

        if (null == m_resourceCategories) {
            m_resourceCategories = CmsCollectionsGenericWrapper.createLazyMap(new Transformer() {

                public Object transform(Object resourceName) {

                    try {
                        CmsResource resource = m_cms.readResource(
                            getRequestContext().removeSiteRoot((String)resourceName));
                        return new CmsJspCategoryAccessBean(m_cms, resource);
                    } catch (CmsException e) {
                        LOG.warn(e.getLocalizedMessage(), e);
                        return null;
                    }
                }
            });
        }
        return m_resourceCategories;
    }
717817
protected List<CmsCategory> getResourceCategories() throws CmsException {

        if (m_resCats == null) {
            m_resCats = m_categoryService.readResourceCategories(getJsp().getCmsObject(), getParamResource());
        }
        return m_resCats;
    }
1136141
protected function getCategories()
    {
        $customCategories = $this->news_customCategories ? StringUtil::deserialize($this->news_categories, true) : [];

        // Get the subcategories of custom categories
        if (\count($customCategories) > 0) {
            $customCategories = NewsCategoryModel::getAllSubcategoriesIds($customCategories);
        }

        // Get all categories whether they have news or not
        if ($this->news_showEmptyCategories) {
            if (\count($customCategories) > 0) {
                $categories = NewsCategoryModel::findPublishedByIds($customCategories);
            } else {
                $categories = NewsCategoryModel::findPublished();
            }
        } else {
            // Get the categories that do have news assigned
            $categories = NewsCategoryModel::findPublishedByArchives($this->news_archives, $customCategories);
        }

        return $categories;
    }
106706
public Collection<String> getBugCategories() {
        ArrayList<String> result = new ArrayList<>(categoryDescriptionMap.size());
        for(BugCategory c : categoryDescriptionMap.values()) {
            if (!c.isHidden()) {
                result.add(c.getCategory());
            }
        }
        return result;
    }
958773
public List<IssueCategory> getIssueCategories()
    {
        return this.issueCategories.values().stream()
                    .sorted((category1, category2) -> category1.getPriority() - category2.getPriority())
                    .collect(Collectors.toList());
    }
22285
public static function getCategories()
    {
        $languageSources = \lajax\translatemanager\models\LanguageSource::find()->select('category')->distinct()->all();

        $categories = [];
        foreach ($languageSources as $languageSource) {
            $categories[$languageSource->category] = $languageSource->category;
        }

        return $categories;
    }
341796
public ApiResponse<ApiSuccessResponse> getRootCategoriesWithHttpInfo(GetRootCategoriesData getRootCategoriesData) throws ApiException {
        com.squareup.okhttp.Call call = getRootCategoriesValidateBeforeCall(getRootCategoriesData, null, null);
        Type localVarReturnType = new TypeToken<ApiSuccessResponse>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }
92795
public Map<String, ResourceEntity> getResources() {
    if (resources==null && id!=null) {
      List<ResourceEntity> resourcesList = Context
        .getCommandContext()
        .getResourceManager()
        .findResourcesByDeploymentId(id);
      resources = new HashMap<String, ResourceEntity>();
      for (ResourceEntity resource: resourcesList) {
        resources.put(resource.getName(), resource);
      }
    }
    return resources;
  }
411433
public StringArray getCategories() {
    if (GOMention_Type.featOkTst && ((GOMention_Type)jcasType).casFeat_categories == null)
      jcasType.jcas.throwFeatMissing("categories", "de.julielab.jules.types.GOMention");
    return (StringArray)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((GOMention_Type)jcasType).casFeatCode_categories)));}
267942
public List<Category> getLEXCategories() {
        ClientResource resource = new ClientResource(Route.LEX_CATEGORY.url());

        try {
            Representation repr = resource.get();
            return mapper.readValue(repr.getText(), new TypeReference<List<Category>>() {});
        } catch (IOException ex) {
            LEX4JLogger.log(Level.WARNING, "Could not retrieve LEX categories correctly!");
            return null;
        }
    }
738705
public Set<Resource<L>> getRootResources() {
        graphLockRead.lock();
        try {
            Set<Resource<L>> roots = new HashSet<>();
            Set<Resource<L>> allResources = resourcesGraph.vertexSet();
            for (Resource<L> resource : allResources) {
                if (neighborIndex.predecessorsOf(resource).isEmpty()) {
                    roots.add(resource);
                }
            }
            return Collections.unmodifiableSet(roots);
        } finally {
            graphLockRead.unlock();
        }
    }
13714
public CategoryOverview getCategories() {
        ClientResource resource = new ClientResource(Route.ALL_CATEGORY.url());

        try {
            Representation repr = resource.get();
            return mapper.readValue(repr.getText(), CategoryOverview.class);
        } catch (IOException ex) {
            LEX4JLogger.log(Level.WARNING, "Could not retrieve the categories correctly!");
            return null;
        }
    }
1249624
private String getCategoryLabel(String categoryPath) {

        CmsObject cms = A_CmsUI.getCmsObject();
        String result = "";
        if (CmsStringUtil.isEmptyOrWhitespaceOnly(categoryPath)) {
            return result;
        }
        Locale locale = UI.getCurrent().getLocale();
        CmsCategoryService catService = CmsCategoryService.getInstance();

        try {
            if (m_useFullPathCategories) {
                //cut last slash
                categoryPath = categoryPath.substring(0, categoryPath.length() - 1);

                String currentPath = "";
                boolean isFirst = true;
                for (String part : categoryPath.split("/")) {
                    currentPath += part + "/";
                    CmsCategory cat = catService.localizeCategory(
                        cms,
                        catService.readCategory(cms, currentPath, "/"),
                        locale);
                    if (!isFirst) {
                        result += "  /  ";
                    } else {
                        isFirst = false;
                    }
                    result += cat.getTitle();
                }

            } else {

                CmsCategory cat = catService.localizeCategory(
                    cms,
                    catService.readCategory(cms, categoryPath, "/"),
                    locale);
                result = cat.getTitle();
            }
        } catch (Exception e) {
            LOG.error("Error reading category " + categoryPath + ".", e);
        }
        return result;
    }
988927
public function getCategory()
    {
        try {
            $category = $this->coreRegistry->registry('current_category');
            if ($category instanceof CategoryModel) {
                $categoryList = [];

                $categoryIds = $this->removeDefaultCategories($category->getPathIds());

                $linkField = 'entity_id';
                if (class_exists('Magento\Framework\EntityManager\MetadataPool')) {
                    // @codingStandardsIgnoreLine
                    $metadataPool = $this->objectManager->create(
                        'Magento\Framework\EntityManager\MetadataPool'
                    );
                    $linkField = $metadataPool->getMetadata(CategoryInterface::class)->getLinkField();
                }

                /** @var \Magento\Catalog\Model\ResourceModel\Category\Collection $categoryCollection */
                $categoryCollection = $this->categoryCollectionFactory->create()
                    ->setStore($this->storeManager->getStore())
                    ->addAttributeToSelect('name')
                    ->addFieldToFilter($linkField, ['in' => $categoryIds]);

                /** @var Category $category */
                foreach ($categoryCollection as $categoryItem) {
                    $categoryList[] = $categoryItem->getName();
                }

                return [
                    'names' => $categoryList,
                    'ids'   => $categoryIds,
                ];
            }
        } catch (\Exception $e) {
            throw $e;
        }
        return false;
    }
477552
public Map<String, String> getResourcePathToUriMappings() {
    if (resourcePathToUriMappings == null) {
      ImmutableMap.Builder<String, String> mapBuilder = ImmutableMap.<String, String>builder();
      // Ensure that resourcePath and uri ends with a '/'
      for (Map.Entry<String, String> mapping : mappings().entrySet()) {
        mapBuilder
            .put(ensureEndsWithSlash(mapping.getKey()), ensureEndsWithSlash(mapping.getValue()));
      }
      resourcePathToUriMappings = mapBuilder.build();
    }
    return resourcePathToUriMappings;
  }
700546
private function loadCategory()
    {
        $category   = $this->categoryFactory->create();
        $storeId    = $this->getRequest()->getParam('store');
        $categoryId = $this->getRequest()->getParam('entity_id');

        $category->setStoreId($storeId)->load($categoryId);

        return $category;
    }
533749
public Map<Integer, String> getLines(int categoryNumber)
    {
        if (lines == null)
        {
            lines = new TreeMap<>();
        }

        Map<String, Object> responseMap = super.getAttributes();
        for (Entry<String, Object> response : responseMap.entrySet())
        {
            String key = response.getKey();
            if (key.toLowerCase(Locale.US).contains("line"))
            {
                String[] keyParts = key.split("-");

                // if it doesn't have at least line-XXXXXX-XXXXXX, skip
                if (keyParts.length < 3)
                {
                    continue;
                }

                // try to get the number of this category, skip if we mess up
                Integer potentialCategoryNumber;
                try
                {
                    potentialCategoryNumber = Integer.parseInt(keyParts[1]);
                }
                catch (Exception exception)
                {
                    continue;
                }

                // try to get the number of this line, skip if we mess up
                Integer potentialLineNumber;
                try
                {
                    potentialLineNumber = Integer.parseInt(keyParts[2]);
                }
                catch (Exception exception)
                {
                    continue;
                }

                // get the List out for placing stuff in
                Map<Integer, String> linesForCategory = lines.get(potentialCategoryNumber);
                if (linesForCategory == null)
                {
                    linesForCategory = new TreeMap<>();
                }

                // put the line we just parsed into the line map for this category
                linesForCategory.put(potentialLineNumber, (String) response.getValue());
                if (!lines.containsKey(potentialCategoryNumber))
                {
                    lines.put(potentialCategoryNumber, linesForCategory);
                }
            }
        }

        return lines.get(categoryNumber);
    }