Gets the exported container pages that should be purged when the content with the given id is published.<p>

@param cms the current CMS context
@param targetId the structure id of the published content

@return the list of files to purge
172437
private List<File> getContainerPagesToPurge(CmsObject cms, CmsUUID targetId) {

        try {
            List<File> purgePages = new ArrayList<File>();
            List<CmsRelation> relations = cms.readRelations(CmsRelationFilter.relationsToStructureId(targetId));
            for (CmsRelation relation : relations) {
                CmsResource source = null;
                try {
                    source = relation.getSource(cms, CmsResourceFilter.ALL);
                } catch (CmsPermissionViolationException e) {
                    // export user can't read the file
                    continue;
                }
                if (CmsResourceTypeXmlContainerPage.isContainerPage(source)) {

                    // purge pages directly containing the content

                    String vfsName = source.getRootPath();
                    String rfsName = OpenCms.getStaticExportManager().getRfsName(cms, vfsName);
                    String exportPath = CmsFileUtil.normalizePath(
                        OpenCms.getStaticExportManager().getExportPath(vfsName));
                    String rfsExportFileName = exportPath
                        + rfsName.substring(OpenCms.getStaticExportManager().getRfsPrefix(vfsName).length());
                    File file = new File(rfsExportFileName);
                    purgePages.add(file);
                } else if (targetId.equals(source.getStructureId())
                    && OpenCms.getResourceManager().getResourceType(source.getTypeId()).getTypeName().equals(
                        CmsResourceTypeXmlContainerPage.GROUP_CONTAINER_TYPE_NAME)) {
                    LOG.warn(
                        Messages.get().getBundle().key(
                            Messages.LOG_WARN_ELEMENT_GROUP_REFERENCES_SELF_1,
                            source.getRootPath()));
                } else if (OpenCms.getResourceManager().getResourceType(source.getTypeId()).getTypeName().equals(
                    CmsResourceTypeXmlContainerPage.GROUP_CONTAINER_TYPE_NAME)) {
                    // purge pages containing group containers containing the content

                    purgePages.addAll(getContainerPagesToPurge(cms, source.getStructureId()));
                }
            }
            return purgePages;
        } catch (CmsException e) {
            LOG.error(e.getLocalizedMessage(), e);
            return Collections.emptyList();
        }
    }
1229402
private List<CmsResource> getContents(String folderPath, String type) throws CmsException {

        CmsPathMap<CmsResource> pathMap = getPathMapForType(type);
        return pathMap.getChildValues(folderPath);
    }
476415
public List<CmsUUID> getIdsOfAlreadyPublishedResources() {

        List<CmsUUID> alreadyPublished = new ArrayList<CmsUUID>();
        List<CmsPublishResource> allResources = new ArrayList<CmsPublishResource>();
        for (CmsPublishGroup group : m_groups) {

            for (CmsPublishResource resource : group.getResources()) {
                allResources.add(resource);
                for (CmsPublishResource related : resource.getRelated()) {
                    allResources.add(related);
                }
            }

        }
        for (CmsPublishResource resource : allResources) {
            if ((resource.getInfo() != null) && (resource.getInfo().getType() == Type.PUBLISHED)) {
                alreadyPublished.add(resource.getId());
            }
        }
        return alreadyPublished;
    }
319794
private List<CmsListInfoBean> collectSitemapTypeInfos(CmsObject cms, CmsADEConfigData configData) {

        List<CmsListInfoBean> subsitemapFolderTypeInfos = new ArrayList<CmsListInfoBean>();
        List<Integer> sitemapTypeIds = CmsResourceTypeFolderSubSitemap.getSubSitemapResourceTypeIds();
        String checkPath = configData.getBasePath();
        if (checkPath != null) {
            checkPath = cms.getRequestContext().removeSiteRoot(checkPath);
        } else {
            checkPath = "/";
        }
        CmsResource checkResource = null;
        try {
            checkResource = cms.readResource(checkPath);
        } catch (CmsException e) {
            LOG.warn(e.getLocalizedMessage(), e);
        }

        for (Integer typeId : sitemapTypeIds) {
            try {
                I_CmsResourceType sitemapType = OpenCms.getResourceManager().getResourceType(typeId.intValue());
                String typeName = sitemapType.getTypeName();
                CmsExplorerTypeSettings explorerType = OpenCms.getWorkplaceManager().getExplorerTypeSetting(typeName);

                // if explorer type and check resource available, perform a permission check
                if ((explorerType != null) && (checkResource != null)) {
                    try {
                        CmsExplorerTypeAccess access = explorerType.getAccess();
                        if (!access.getPermissions(cms, checkResource).requiresControlPermission()) {
                            continue;
                        }
                    } catch (Exception e) {
                        LOG.error(e.getLocalizedMessage(), e);
                    }
                }
                CmsListInfoBean infoBean = buildSitemapTypeInfo(sitemapType);
                subsitemapFolderTypeInfos.add(infoBean);

            } catch (CmsLoaderException e) {
                LOG.warn("Could not read sitemap folder type " + typeId + ": " + e.getLocalizedMessage(), e);
            }
        }
        return subsitemapFolderTypeInfos;
    }
338404
private List<CmsResource> getVirtualResourcesForExport(CmsObject cms) throws CmsException {

        List<CmsResource> virtualResources = Lists.newArrayList();
        for (String name : OpenCms.getModuleManager().getImportExportRepository().getModuleFileNames()) {
            String path = CmsStringUtil.joinPaths(EXPORT_PATH, name);
            CmsResource res = createFakeBinaryFile(path);
            virtualResources.add(res);
        }
        return virtualResources;

    }
680727
public CmsPublishResourcesList getPublishResourcesList() throws JspException {

        if (getPublishList() != null) {
            return new CmsPublishResourcesList(
                getJsp(),
                getParentFolder(),
                Boolean.valueOf(getParamRelatedresources()).booleanValue());
        }

        return null;
    }
697311
public List<org.opencms.ade.containerpage.client.ui.CmsContainerPageElementPanel> getAllDragElements() {

        List<org.opencms.ade.containerpage.client.ui.CmsContainerPageElementPanel> result = new ArrayList<org.opencms.ade.containerpage.client.ui.CmsContainerPageElementPanel>();
        Iterator<org.opencms.ade.containerpage.client.ui.CmsContainerPageContainer> it = m_targetContainers.values().iterator();
        while (it.hasNext()) {
            result.addAll(it.next().getAllDragElements());
        }
        if (isGroupcontainerEditing()) {
            Iterator<Widget> itSub = m_groupEditor.getGroupContainerWidget().iterator();
            while (itSub.hasNext()) {
                Widget w = itSub.next();
                if (w instanceof org.opencms.ade.containerpage.client.ui.CmsContainerPageElementPanel) {
                    result.add((org.opencms.ade.containerpage.client.ui.CmsContainerPageElementPanel)w);
                }
            }
        }
        return result;
    }
644146
private List<String> getExcludes(CmsObject cms) {

        // get the list of link excludes form the cache if possible
        CmsVfsMemoryObjectCache cache = CmsVfsMemoryObjectCache.getVfsMemoryObjectCache();
        String filePath = OpenCms.getSystemInfo().getConfigFilePath(cms, LINK_EXCLUDE_DEFINIFITON_FILE);
        @SuppressWarnings("unchecked")
        List<String> excludes = (List<String>)cache.getCachedObject(cms, filePath);
        if (excludes == null) {
            // nothing found in cache, so read definition file and store the result in cache
            excludes = readLinkExcludes(cms);
            cache.putCachedObject(cms, filePath, excludes);
        }
        return excludes;
    }
1175915
protected List<CmsResource> getDirectPages() throws CmsException {

        List<CmsResource> result = new ArrayList<CmsResource>();
        result.addAll(getNavigationPages());
        Set<String> includeRoots = m_includeExcludeSet.getIncludeRoots();
        for (String includeRoot : includeRoots) {
            try {
                CmsResource resource = m_guestCms.readResource(includeRoot);
                if (resource.isFile()) {
                    result.add(resource);
                } else {
                    List<CmsResource> subtreeFiles = m_guestCms.readResources(
                        includeRoot,
                        CmsResourceFilter.DEFAULT_FILES,
                        true);
                    result.addAll(subtreeFiles);
                }
            } catch (CmsVfsResourceNotFoundException e) {
                LOG.warn("Could not read include resource: " + includeRoot);
            }
        }
        Iterator<CmsResource> filterIter = result.iterator();
        while (filterIter.hasNext()) {
            CmsResource currentResource = filterIter.next();
            if (currentResource.isInternal() || m_includeExcludeSet.isExcluded(currentResource.getRootPath())) {
                filterIter.remove();
            }
        }
        return result;
    }
738062
public void cleanUpContainers() {

        List<String> removed = new ArrayList<String>();
        for (Entry<String, CmsContainerPageContainer> entry : m_targetContainers.entrySet()) {
            if (!RootPanel.getBodyElement().isOrHasChild(entry.getValue().getElement())) {
                removed.add(entry.getKey());
            }
        }
        for (String containerId : removed) {
            m_targetContainers.remove(containerId);
            m_containers.remove(containerId);
        }
        if (removed.size() > 0) {
            scheduleGalleryUpdate();
        }
    }
922646
public CmsPublishList getPublishList(CmsObject cms) throws CmsException {

        return m_securityManager.fillPublishList(
            cms.getRequestContext(),
            new CmsPublishList(cms.getRequestContext().getCurrentProject()));
    }
316760
public Map<String, org.opencms.ade.containerpage.client.ui.CmsContainerPageContainer> getContainerTargets() {

        Map<String, org.opencms.ade.containerpage.client.ui.CmsContainerPageContainer> result = new HashMap<String, org.opencms.ade.containerpage.client.ui.CmsContainerPageContainer>();
        for (Entry<String, org.opencms.ade.containerpage.client.ui.CmsContainerPageContainer> entry : m_targetContainers.entrySet()) {
            if (entry.getValue().isEditable()
                && (!isDetailPage() || (entry.getValue().isDetailOnly() || entry.getValue().isDetailView()))) {
                result.put(entry.getKey(), entry.getValue());
            }
        }
        return result;
    }
1365670
@SuppressWarnings("unused")
    public Set<String> getCSSHeadIncludes(CmsObject cms, CmsResource resource) throws CmsException {

        return getCSSHeadIncludes();
    }
1218469
public CmsFileInfo[] getFiles() {

        JsArray<CmsFileInfo> files = m_impl.getFiles(m_inputElement);
        CmsFileInfo[] result = new CmsFileInfo[files.length()];
        for (int i = 0; i < files.length(); ++i) {
            result[i] = files.get(i);
        }
        return result;
    }
620250
private List<EntityType> getNewSources(MappingTarget target) {
    return dataService
        .getEntityTypeIds()
        .filter(name -> isValidSource(target, name))
        .map(dataService::getEntityType)
        .collect(toList());
  }
891714
@Override
	public Map<String,byte[]> findScriptResourcesForAgent( String targetId ) throws IOException {

		Map<String,byte[]> result = new HashMap<>( 0 );
		File targetDir = new File( findTargetDirectory( targetId ), Constants.PROJECT_SUB_DIR_SCRIPTS );
		if( targetDir.isDirectory()){

			List<String> exclusionPatterns = Arrays.asList(
				"(?i).*" + Pattern.quote( Constants.LOCAL_RESOURCE_PREFIX ) + ".*"
			);

			result.putAll( Utils.storeDirectoryResourcesAsBytes( targetDir, exclusionPatterns ));
		}

		return result;
	}
263981
protected List<CmsContainerPageElementPanel> getAllContainerPageElements(boolean includeGroupContents) {

        List<CmsContainerPageElementPanel> elemWidgets = new ArrayList<CmsContainerPageElementPanel>();
        for (Entry<String, org.opencms.ade.containerpage.client.ui.CmsContainerPageContainer> entry : CmsContainerpageController.get().getContainerTargets().entrySet()) {
            Iterator<Widget> elIt = entry.getValue().iterator();
            while (elIt.hasNext()) {
                try {
                    org.opencms.ade.containerpage.client.ui.CmsContainerPageElementPanel elementWidget = (org.opencms.ade.containerpage.client.ui.CmsContainerPageElementPanel)elIt.next();
                    elemWidgets.add(elementWidget);
                    if (includeGroupContents && (elementWidget instanceof CmsGroupContainerElementPanel)) {
                        List<CmsContainerPageElementPanel> groupChildren = ((CmsGroupContainerElementPanel)elementWidget).getGroupChildren();
                        elemWidgets.addAll(groupChildren);
                    }
                } catch (ClassCastException e) {
                    // no proper container element, skip it (this should never happen!)
                    CmsDebugLog.getInstance().printLine(
                        "WARNING: there is an inappropriate element within a container");
                }
            }
        }
        return elemWidgets;
    }