Loading all available categories.<p>
977433
private void loadCategories() {

        CmsRpcAction<List<CmsCategoryTreeEntry>> action = new CmsRpcAction<List<CmsCategoryTreeEntry>>() {

            @Override
            public void execute() {

                start(200, true);
                CmsCoreProvider.getService().getCategoriesForSitePath(m_dialogBean.getReferenceSitePath(), this);
            }

            @Override
            protected void onResponse(List<CmsCategoryTreeEntry> result) {

                m_dialogBean.setCategories(result);
                m_handler.setCategoriesTabContent(result, new ArrayList<String>());
                m_handler.onCategoriesTabSelection();
                stop(false);
            }
        };
        action.execute();
    }
450747
public String[] getCategories() {

        List<String> l = m_parameters.getCategories();
        return l.toArray(new String[l.size()]);
    }
655450
public void loadTable() {

        m_container.removeAllItems();
        List<I_CmsSearchIndex> indexes = m_manager.getAllElements();

        for (I_CmsSearchIndex index : indexes) {
            Item item = m_container.addItem(index);
            item.getItemProperty(TableProperty.Name).setValue(index.getName());
            item.getItemProperty(TableProperty.FieldConfig).setValue(index.getFieldConfiguration().getName());
            item.getItemProperty(TableProperty.Locale).setValue(index.getLocale().getDisplayName());
            item.getItemProperty(TableProperty.Project).setValue(index.getProject());
            item.getItemProperty(TableProperty.Rebuild).setValue(index.getRebuildMode());
        }
    }
735379
public void fillContent(List<CmsGalleryFolderBean> galleryInfos, List<String> selectedGalleries) {

        clearList();
        m_selectedGalleries = selectedGalleries;
        if (!galleryInfos.isEmpty()) {
            for (CmsGalleryFolderBean galleryInfo : galleryInfos) {
                m_galleries.put(galleryInfo.getPath(), galleryInfo);
            }

            m_itemIterator = new ListItemGenerator(galleryInfos);
            loadMoreItems();
        } else {
            showIsEmptyLabel();
        }
        onContentChange();
    }
584360
private void loadGalleries() {

        CmsRpcAction<List<CmsGalleryFolderBean>> action = new CmsRpcAction<List<CmsGalleryFolderBean>>() {

            @Override
            public void execute() {

                start(200, true);
                List<String> types = new ArrayList<String>();
                for (CmsResourceTypeBean type : m_dialogBean.getTypes()) {
                    types.add(type.getType());
                }

                getGalleryService().getGalleries(types, this);
            }

            @Override
            protected void onResponse(List<CmsGalleryFolderBean> result) {

                m_dialogBean.setGalleries(result);
                m_handler.setGalleriesTabContent(result, m_searchObject.getGalleries());
                m_handler.onGalleriesTabSelection();
                stop(false);
            }
        };
        action.execute();
    }
794545
public Category loadSelectedCategory() {
    String breadcrumb = storageHandler.loadSelectedCategory();
    Category defaultCategory = getCategories().get(DEFAULT_CATEGORY);
    if (breadcrumb == null) {
      return defaultCategory;
    }
    return flatCategoriesLst.stream()
        .filter(category -> category.getBreadcrumb().equals(breadcrumb))
        .findAny().orElse(defaultCategory);
  }
1065724
public final ImmutableList<TaxonomyTerm> categories() {
      ImmutableList<TaxonomyTerm> categories = taxonomyTerms.get(CATEGORY_TAXONOMY);
      return categories != null ? categories : ImmutableList.of();
   }
1061662
public List<CmsCategory> readResourceCategories(CmsObject cms, CmsResource resource) throws CmsException {

        return internalReadResourceCategories(cms, resource, false);
    }
910097
public void addCategory(String category) throws JSONException {
		logger.debug("Adding category [" + category + "]");
		put("category", category, this.apsDictionary, true);
	}
894758
public void updateContentList(List<CmsCategoryBean> categoriesBeans, List<String> selectedCategories) {

        clearList();
        if (m_categories == null) {
            m_categories = new HashMap<String, CmsCategoryBean>();
        }
        if ((categoriesBeans != null) && !categoriesBeans.isEmpty()) {
            for (CmsCategoryBean categoryBean : categoriesBeans) {
                m_categories.put(categoryBean.getPath(), categoryBean);
                // set the list item widget
                CmsDataValue dataValue = new CmsDataValue(
                    600,
                    3,
                    CmsCategoryBean.SMALL_ICON_CLASSES,
                    categoryBean.getTitle(),
                    CmsStringUtil.isNotEmptyOrWhitespaceOnly(categoryBean.getDescription())
                    ? categoryBean.getDescription()
                    : categoryBean.getPath());
                // the checkbox
                CmsCheckBox checkBox = new CmsCheckBox();
                if ((selectedCategories != null) && selectedCategories.contains(categoryBean.getPath())) {
                    checkBox.setChecked(true);
                }
                SelectionHandler selectionHandler = new SelectionHandler(categoryBean.getPath(), checkBox);
                checkBox.addClickHandler(selectionHandler);
                dataValue.addClickHandler(selectionHandler);
                dataValue.setUnselectable();
                // set the category list item and add to list
                CmsTreeItem listItem = new CmsTreeItem(false, checkBox, dataValue);
                listItem.setSmallView(true);
                listItem.setId(categoryBean.getPath());
                addWidgetToList(listItem);
            }
        } else {
            showIsEmptyLabel();
        }
    }
325336
public function loadCatMenues()
    {
        $this->_load(self::TYPE_CATEGORY_MENU);
        $aArray = [];

        if ($this->count()) {
            foreach ($this as $oContent) {
                // add into category tree
                if (!isset($aArray[$oContent->getCategoryId()])) {
                    $aArray[$oContent->getCategoryId()] = [];
                }

                $aArray[$oContent->oxcontents__oxcatid->value][] = $oContent;
            }
        }

        $this->_aArray = $aArray;
    }
681008
private static List<CmsCategory> getCategories(CmsObject cms, CmsResource resource) {

        if ((null != resource) && (null != cms)) {
            try {
                return CmsCategoryService.getInstance().readResourceCategories(cms, resource);
            } catch (CmsException e) {
                LOG.error(e.getLocalizedMessage(), e);
            }
        }
        return new ArrayList<CmsCategory>(0);
    }
866559
public function load($categories)
    {
        if (is_string($categories)) {
            $categories = [$categories];
        }

        foreach ($categories as $idx => $category) {
            if (isset($this->items[$category])) {
                unset($categories[$idx]);
            } else {
                $this->items[$category] = [];
            }
        }

        if (empty($categories)) {
            return;
        }

        $result = (new Query())->select(['category', 'key', 'value'])->from('setting')->where([
            'category' => $categories
        ])->all();

        foreach ($result as $row) {
            try {
                $this->items[$row['category']][$row['key']] = Json::decode($row['value']);
            } catch (InvalidParamException $ex) {
                $this->items[$row['category']][$row['key']] = $row['value'];
            }
        }
    }
283623
public void loadAndShow() {

        CmsRpcAction<CmsRenameInfoBean> infoAction = new CmsRpcAction<CmsRenameInfoBean>() {

            @Override
            public void execute() {

                start(0, true);
                CmsCoreProvider.getVfsService().getRenameInfo(m_structureId, this);
            }

            @Override
            protected void onResponse(CmsRenameInfoBean renameInfo) {

                stop(false);
                CmsRenameView view = new CmsRenameView(renameInfo, m_renameHandler);
                for (CmsPushButton button : view.getDialogButtons()) {
                    addButton(button);
                }
                setMainContent(view);
                view.setDialog(CmsRenameDialog.this);
                center();
            }
        };
        infoAction.execute();
    }
1190967
private void loadCategories(SQLiteDatabase db) throws UnknownPoiCategoryException {
        // Maximum ID (for root node)
        int maxID = 0;

        // Maps categories to their parent IDs
        Map<PoiCategory, Integer> parentMap = new HashMap<>();

        Cursor cursor = null;
        try {
            cursor = db.rawQuery(SELECT_STATEMENT, null);
            while (cursor.moveToNext()) {
                // Column values
                int categoryID = cursor.getInt(0);
                String categoryTitle = cursor.getString(1);
                int categoryParentID = cursor.getInt(2);

                PoiCategory pc = new DoubleLinkedPoiCategory(categoryTitle, null, categoryID);
                this.categoryMap.put(categoryID, pc);

                // category --> parent ID
                parentMap.put(pc, categoryParentID);

                // check for root node
                if (categoryID > maxID) {
                    maxID = categoryID;
                }
            }
        } catch (Exception e) {
            LOGGER.log(Level.SEVERE, e.getMessage(), e);
        } finally {
            try {
                if (cursor != null) {
                    cursor.close();
                }
            } catch (Exception e) {
                LOGGER.log(Level.SEVERE, e.getMessage(), e);
            }
        }

        // Set root category and remove it from parents map
        this.rootCategory = getPoiCategoryByID(maxID);
        parentMap.remove(this.rootCategory);

        // Assign parent categories
        for (PoiCategory c : parentMap.keySet()) {
            c.setParent(getPoiCategoryByID(parentMap.get(c)));
        }
    }
576159
public void loadProjects() {

        CmsObject cms = A_CmsUI.getCmsObject();
        Locale locale = UI.getCurrent().getLocale();
        m_container.removeAllItems();
        boolean isMultiOU = false;
        // hide ou column if only one ou exists
        try {
            isMultiOU = !OpenCms.getOrgUnitManager().getOrganizationalUnits(cms, "", true).isEmpty();
        } catch (CmsException e) {
            // noop
        }
        if (isMultiOU) {
            setVisibleColumns(
                CmsProjectsTable.PROP_NAME,
                CmsProjectsTable.PROP_DESCRIPTION,
                PROP_PUBLISH_DATE,
                PROP_PUBLISH_USER,
                CmsProjectsTable.PROP_ORG_UNIT,
                CmsProjectsTable.PROP_OWNER,
                CmsProjectsTable.PROP_MANAGER,
                CmsProjectsTable.PROP_USER,
                CmsProjectsTable.PROP_DATE_CREATED,
                CmsProjectsTable.PROP_RESOURCES);
        } else {
            setVisibleColumns(
                CmsProjectsTable.PROP_NAME,
                CmsProjectsTable.PROP_DESCRIPTION,
                PROP_PUBLISH_DATE,
                PROP_PUBLISH_USER,
                CmsProjectsTable.PROP_OWNER,
                CmsProjectsTable.PROP_MANAGER,
                CmsProjectsTable.PROP_USER,
                CmsProjectsTable.PROP_DATE_CREATED,
                CmsProjectsTable.PROP_RESOURCES);
        }

        // get content
        try {
            List<CmsHistoryProject> projects = cms.getAllHistoricalProjects();
            for (CmsHistoryProject project : projects) {
                Item item = m_container.addItem(new Integer(project.getPublishTag()));
                if (item != null) {
                    item.getItemProperty(CmsProjectsTable.PROP_ID).setValue(project.getUuid());
                    item.getItemProperty(CmsProjectsTable.PROP_NAME).setValue(project.getSimpleName());
                    item.getItemProperty(CmsProjectsTable.PROP_DESCRIPTION).setValue(project.getDescription());
                    item.getItemProperty(PROP_PUBLISH_DATE).setValue(new Date(project.getPublishingDate()));
                    item.getItemProperty(PROP_PUBLISH_USER).setValue(project.getPublishedByName(cms));
                    try {
                        item.getItemProperty(CmsProjectsTable.PROP_ORG_UNIT).setValue(
                            OpenCms.getOrgUnitManager().readOrganizationalUnit(cms, project.getOuFqn()).getDisplayName(
                                locale));
                        item.getItemProperty(CmsProjectsTable.PROP_OWNER).setValue(
                            cms.readUser(project.getOwnerId()).getName());
                        item.getItemProperty(CmsProjectsTable.PROP_MANAGER).setValue(
                            cms.readGroup(project.getManagerGroupId()).getSimpleName());
                        item.getItemProperty(CmsProjectsTable.PROP_USER).setValue(
                            cms.readGroup(project.getGroupId()).getSimpleName());
                    } catch (CmsException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    }
                    item.getItemProperty(CmsProjectsTable.PROP_DATE_CREATED).setValue(
                        new Date(project.getDateCreated()));

                    StringBuffer html = new StringBuffer(512);
                    for (String resource : cms.readProjectResources(project)) {
                        html.append(resource);
                        html.append("<br />");
                    }
                    Label resLabel = new Label();
                    resLabel.setContentMode(ContentMode.HTML);
                    resLabel.setValue(html.toString());
                    item.getItemProperty(CmsProjectsTable.PROP_RESOURCES).setValue(resLabel);
                }
            }
            m_container.sort(new Object[] {PROP_PUBLISH_DATE}, new boolean[] {false});
        } catch (CmsException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
169992
void openWindow() {

        if (m_dialogWindow == null) {
            m_dialogWindow = CmsBasicDialog.prepareWindow(DialogWidth.wide);
            m_dialogWindow.setCaption("Select categories");
        }
        if (m_dialog == null) {
            m_dialog = new CmsCategorySelectDialog("/");
            m_dialogWindow.setContent(m_dialog);
            m_dialog.addSelectionHandler(this);
        }
        A_CmsUI.get().addWindow(m_dialogWindow);
        m_dialogWindow.center();
        m_dialog.setSelectedCategories(m_tree.getSelectedCategories());
    }