Returns the folder filter string.<p>

@return the folder filter
508629
String getFolderFilter() {

        String result = "";
        List<String> parentFolderVals = Lists.newArrayList();
        if (!m_config.getFolders().isEmpty()) {
            for (String value : m_config.getFolders()) {
                parentFolderVals.add("\"" + value + "\"");
            }
        }
        if (parentFolderVals.isEmpty()) {
            result = "fq=parent-folders:(\"/\")";
        } else {
            result = "fq=parent-folders:(" + CmsStringUtil.listAsString(parentFolderVals, " OR ") + ")";
        }
        return result;
    }
1290791
@Nullable
    public final String getDefFolder() {
        if (getFolder() == null) {
            if (parent == null) {
                return null;
            }
            return parent.getFolder();
        }
        return getFolder();
    }
675701
public CmsRelationFilter filterIncludeChildren() {

        CmsRelationFilter filter = (CmsRelationFilter)clone();
        filter.m_includeSubresources = true;
        return filter;
    }
670685
private String getLogFolderPath() {

        String path = null;
        if (OpenCms.getRunLevel() >= OpenCms.RUNLEVEL_3_SHELL_ACCESS) {
            path = new File(OpenCms.getSystemInfo().getLogFileRfsPath()).getParent();
            // making sure the path ends with the file separator CHAR
            if ((path != null) && !path.endsWith(File.separator)) {
                path += File.separator;
            }

        }
        return path;
    }
621649
public String getToLink() {

        if (m_link == null) {
            String target = toString();
            if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(target)) {
                m_link = substituteLink(getCmsObject(), target);
            } else {
                m_link = "";
            }
        }
        return m_link;
    }
1196241
public CmsResourceTranslator getFolderTranslator() {

        String[] array = new String[0];
        if (m_folderTranslationEnabled) {
            array = new String[m_folderTranslations.size()];
            for (int i = 0; i < m_folderTranslations.size(); i++) {
                array[i] = m_folderTranslations.get(i);
            }
        }
        return new CmsResourceTranslator(array, false);
    }
1261766
String getFilterQuery() {

        String result = m_config.getFilterQuery();
        if (result == null) {
            result = "";
        }
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(result) && !result.startsWith("&")) {
            result = "&" + result;
        }
        if (!result.contains(CommonParams.FL + "=")) {
            result += "&" + CommonParams.FL + "=" + getDefaultReturnFields();
        }
        I_CmsListDateRestriction dateRestriction = m_config.getDateRestriction();
        if (dateRestriction != null) {
            result += "&fq="
                + CmsSearchField.FIELD_INSTANCEDATE_CURRENT_TILL
                + "_"
                + getSearchLocale().toString()
                + "_dt:"
                + dateRestriction.getRange();

        }
        return result;
    }
1192372
public CmsSolrQuery getQuery(CmsObject cms) {

        final CmsSolrQuery query = new CmsSolrQuery();

        // set categories
        query.setCategories(m_categories);

        // set container types
        if (null != m_containerTypes) {
            query.addFilterQuery(CmsSearchField.FIELD_CONTAINER_TYPES, m_containerTypes, false, false);
        }

        // Set date created time filter
        query.addFilterQuery(
            CmsSearchUtil.getDateCreatedTimeRangeFilterQuery(
                CmsSearchField.FIELD_DATE_CREATED,
                getDateCreatedRange().m_startTime,
                getDateCreatedRange().m_endTime));

        // Set date last modified time filter
        query.addFilterQuery(
            CmsSearchUtil.getDateCreatedTimeRangeFilterQuery(
                CmsSearchField.FIELD_DATE_LASTMODIFIED,
                getDateLastModifiedRange().m_startTime,
                getDateLastModifiedRange().m_endTime));

        // set scope / folders to search in
        m_foldersToSearchIn = new ArrayList<String>();
        addFoldersToSearchIn(m_folders);
        addFoldersToSearchIn(m_galleries);
        setSearchFolders(cms);
        query.addFilterQuery(
            CmsSearchField.FIELD_PARENT_FOLDERS,
            new ArrayList<String>(m_foldersToSearchIn),
            false,
            true);

        if (!m_ignoreSearchExclude) {
            // Reference for the values: CmsGallerySearchIndex.java, field EXCLUDE_PROPERTY_VALUES
            query.addFilterQuery(
                "-" + CmsSearchField.FIELD_SEARCH_EXCLUDE,
                Arrays.asList(
                    new String[] {
                        A_CmsSearchIndex.PROPERTY_SEARCH_EXCLUDE_VALUE_ALL,
                        A_CmsSearchIndex.PROPERTY_SEARCH_EXCLUDE_VALUE_GALLERY}),
                false,
                true);
        }

        // set matches per page
        query.setRows(new Integer(m_matchesPerPage));

        // set resource types
        if (null != m_resourceTypes) {
            List<String> resourceTypes = new ArrayList<>(m_resourceTypes);
            if (m_resourceTypes.contains(CmsResourceTypeFunctionConfig.TYPE_NAME)
                && !m_resourceTypes.contains(CmsXmlDynamicFunctionHandler.TYPE_FUNCTION)) {
                resourceTypes.add(CmsXmlDynamicFunctionHandler.TYPE_FUNCTION);
            }
            query.setResourceTypes(resourceTypes);
        }

        // set result page
        query.setStart(new Integer((m_resultPage - 1) * m_matchesPerPage));

        // set search locale
        if (null != m_locale) {
            query.setLocales(CmsLocaleManager.getLocale(m_locale));
        }

        // set search words
        if (null != m_words) {
            query.setQuery(m_words);
        }

        // set sort order
        query.setSort(getSort().getFirst(), getSort().getSecond());

        // set result collapsing by id
        query.addFilterQuery("{!collapse field=id}");

        query.setFields(CmsGallerySearchResult.getRequiredSolrFields());

        if ((m_allowedFunctions != null) && !m_allowedFunctions.isEmpty()) {
            String functionFilter = "((-type:("
                + CmsXmlDynamicFunctionHandler.TYPE_FUNCTION
                + " OR "
                + CmsResourceTypeFunctionConfig.TYPE_NAME
                + ")) OR (id:(";
            Iterator<CmsUUID> it = m_allowedFunctions.iterator();
            while (it.hasNext()) {
                CmsUUID id = it.next();
                functionFilter += id.toString();
                if (it.hasNext()) {
                    functionFilter += " OR ";
                }
            }
            functionFilter += ")))";
            query.addFilterQuery(functionFilter);
        }

        return query;
    }
937246
public String getFolderPath(CmsObject cms, String pageFolderRootPath) {

        checkInitialized();
        if (m_folderOrName != null) {
            return m_folderOrName.getFolderPath(cms, pageFolderRootPath);
        } else {
            String siteRoot = null;
            if (pageFolderRootPath != null) {
                siteRoot = OpenCms.getSiteManager().getSiteRoot(pageFolderRootPath);
            }
            if (siteRoot == null) {
                siteRoot = cms.getRequestContext().getSiteRoot();
            }
            return CmsStringUtil.joinPaths(siteRoot, CmsADEManager.CONTENT_FOLDER_NAME, m_typeName);
        }
    }
460111
public String getRootFolder() {

        String folder = "/";
        if (getSettings().getUserSettings().getRestrictExplorerView()) {
            folder = getSettings().getUserSettings().getStartFolder();
        }
        try {
            getCms().readFolder(folder, CmsResourceFilter.IGNORE_EXPIRATION);
            return folder;
        } catch (CmsException e) {
            // should usually never happen
            if (LOG.isInfoEnabled()) {
                LOG.info(e);
            }
            return "/";
        }
    }
504525
public List<String> getFilterParameters() {
        final List<String> parameters = new ArrayList<>();
        filterKeysToValues.forEach((filterKey, filterValues) -> {
            filterValues.forEach(filterValue -> {
                final String parameterString = String.format("%s:%s", filterKey, filterValue);
                parameters.add(parameterString);
            });
        });

        return parameters;
    }
425948
public List<String> getAllSelectedSitePath() {

        List<String> result = new ArrayList<String>();
        for (String cat : m_selectedCategories) {
            result.add(((CmsDataValue)m_categories.get(cat).getMainWidget()).getParameter(2));
        }
        return result;
    }
864185
public String getFolderPath(CmsObject cms, String pageFolderPath) {

        if (m_folder != null) {
            try {
                return OpenCms.getADEManager().getRootPath(
                    m_folder.getStructureId(),
                    cms.getRequestContext().getCurrentProject().isOnlineProject());
            } catch (CmsException e) {
                LOG.error(e.getLocalizedMessage(), e);
                return m_folder.getRootPath();
            }
        } else if (m_basePath != null) {
            return CmsStringUtil.joinPaths(m_basePath, m_folderName);
        } else if (m_isPageRelative) {
            if (pageFolderPath == null) {
                throw new IllegalArgumentException(
                    "getFolderPath called without page folder, but pageRelative is enabled!");
            }
            return CmsStringUtil.joinPaths(pageFolderPath, ELEMENTS_FOLDER_NAME);
        } else {
            return CmsStringUtil.joinPaths(
                cms.getRequestContext().getSiteRoot(),
                CmsADEManager.CONTENT_FOLDER_NAME,
                m_folderName);
        }

    }
135134
public String getFileList() {

        // if mode is "listonly", only the list will be shown
        boolean galleryView = VIEW_GALLERY.equals(getSettings().getExplorerMode());
        // if mode is "listview", all file in the set collector will be shown
        boolean listView = VIEW_LIST.equals(getSettings().getExplorerMode());

        String currentFolder = getSettings().getExplorerResource();
        try {
            getCms().readResource(currentFolder, CmsResourceFilter.ALL);
        } catch (CmsException e) {
            // file was not readable
            currentFolder = "/";
        }

        // start creating content
        StringBuffer content = new StringBuffer(2048);
        content.append(getInitializationHeader());

        // now get the entries for the file list
        List<CmsResource> resources = getResources(getSettings().getExplorerResource());

        // if a folder contains to much entries we split them to pages of C_ENTRYS_PER_PAGE length
        int startat = 0;
        int stopat = resources.size();
        int selectedPage = 1;
        int numberOfPages = 0;
        int maxEntrys = getSettings().getUserSettings().getExplorerFileEntries();

        if (!galleryView) {
            selectedPage = getSettings().getExplorerPage();
            if (stopat > maxEntrys) {
                // we have to split
                numberOfPages = ((stopat - 1) / maxEntrys) + 1;
                if (selectedPage > numberOfPages) {
                    // the user has changed the folder and then selected a page for the old folder
                    selectedPage = 1;
                }
                startat = (selectedPage - 1) * maxEntrys;
                if ((startat + maxEntrys) < stopat) {
                    stopat = startat + maxEntrys;
                }
            }
        }
        // now check which file list columns we want to show
        int preferences = getUserPreferences();

        boolean showTitle = (preferences & CmsUserSettings.FILELIST_TITLE) > 0;
        boolean showNavText = (preferences & CmsUserSettings.FILELIST_NAVTEXT) > 0;
        boolean showPermissions = (preferences & CmsUserSettings.FILELIST_PERMISSIONS) > 0;
        boolean showDateLastModified = (preferences & CmsUserSettings.FILELIST_DATE_LASTMODIFIED) > 0;
        boolean showUserWhoLastModified = (preferences & CmsUserSettings.FILELIST_USER_LASTMODIFIED) > 0;
        boolean showDateCreated = (preferences & CmsUserSettings.FILELIST_DATE_CREATED) > 0;
        boolean showUserWhoCreated = (preferences & CmsUserSettings.FILELIST_USER_CREATED) > 0;
        boolean showDateReleased = (preferences & CmsUserSettings.FILELIST_DATE_RELEASED) > 0;
        boolean showDateExpired = (preferences & CmsUserSettings.FILELIST_DATE_EXPIRED) > 0;

        boolean fullPath = galleryView || listView;

        // set the right reference project
        CmsProject referenceProject;
        try {
            if (!listView) {
                referenceProject = getCms().readProject(getSettings().getProject());
            } else {
                referenceProject = getCms().readProject(getSettings().getExplorerProjectId());
            }
        } catch (CmsException ex) {
            referenceProject = getCms().getRequestContext().getCurrentProject();
        }

        CmsResourceUtil resUtil = new CmsResourceUtil(getCms());
        resUtil.setReferenceProject(referenceProject);

        for (int i = startat; i < stopat; i++) {
            CmsResource res = resources.get(i);
            resUtil.setResource(res);
            content.append(
                getInitializationEntry(
                    resUtil,
                    fullPath,
                    showTitle,
                    showNavText,
                    showPermissions,
                    showDateLastModified,
                    showUserWhoLastModified,
                    showDateCreated,
                    showUserWhoCreated,
                    showDateReleased,
                    showDateExpired));
        }

        content.append(getInitializationFooter(numberOfPages, selectedPage));
        return content.toString();
    }
905742
public String getName() {

        if (CmsStringUtil.isEmptyOrWhitespaceOnly(m_path)) {
            return "";
        }
        String result = CmsResource.getName(m_path);
        // remove trailing slash as categories are not displayed like folders
        if (CmsResource.isFolder(result)) {
            result = result.substring(0, result.length() - 1);
        }
        return result;
    }
602257
public CmsLockFilter getNonBlockingFilter() {

        if (m_nonBlockingFilter == null) {
            m_nonBlockingFilter = CmsLockFilter.FILTER_ALL;
            m_nonBlockingFilter = m_nonBlockingFilter.filterLockableByUser(
                getCms().getRequestContext().getCurrentUser());
            m_nonBlockingFilter = m_nonBlockingFilter.filterSharedExclusive();
        }
        return m_nonBlockingFilter;
    }
1175330
protected String getResourceName() {

        String resource = getItem().get(m_resColumnPathId).toString();
        if (!getWp().getCms().existsResource(resource, CmsResourceFilter.DEFAULT)) {
            String siteRoot = OpenCms.getSiteManager().getSiteRoot(resource);
            if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(siteRoot)) {
                resource = resource.substring(siteRoot.length());
            }
            if (!getWp().getCms().existsResource(resource, CmsResourceFilter.DEFAULT)) {
                resource = null;
            }
        }
        return resource;
    }