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();
        }
    }
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 ) { continue ; } if ( CmsResourceTypeXmlContainerPage . isContainerPage ( source ) ) { 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 ) ) { purgePages . addAll ( getContainerPagesToPurge ( cms , source . getStructureId ( ) ) ) ; } } return purgePages ; } catch ( CmsException e ) { LOG . error ( e . getLocalizedMessage ( ) , e ) ; return Collections . emptyList ( ) ; } }
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