/** * @see org.opencms.workplace.list.A_CmsListExplorerDialog#getCollector() */ @Override public I_CmsListResourceCollector getCollector() { if (m_collector == null) { m_validator = new CmsRelationPublishValidator(getCms(), getSettings().getPublishList()); List resourceList = new ArrayList(m_validator.keySet()); Collections.sort(resourceList); m_collector = new CmsPublishBrokenRelationsCollector(this, resourceList); } return m_collector; }
CmsRelationPublishValidator validator = new CmsRelationPublishValidator(m_cms, publishList); m_relationValidator = validator; for (String resourceName : validator.keySet()) { CmsRelationValidatorInfoEntry infoEntry = validator.getInfoEntry(resourceName); try { CmsResource resource = m_cms.readResource(
if (detailId.equals(LIST_DETAIL_RELATIONS)) { CmsRelationValidatorInfoEntry infoEntry = m_validator.getInfoEntry(resourceName); Iterator<CmsRelation> itRelations = infoEntry.getRelations().iterator();
@SuppressWarnings("synthetic-access") @Override public void run() { LOG.info( "Checking broken relations is taking too long, using a different thread for checking and publishing now."); try { // Make sure the computation is finished by calling get() without a timeout parameter // We don't need the actual result of the get(), though; we just get the set of resource paths from the validator object brokenResourcesGetter.get(); List<CmsResource> resourcesToPublish = new ArrayList<CmsResource>(resources); Iterator<CmsResource> resIter = resourcesToPublish.iterator(); while (resIter.hasNext()) { CmsResource currentRes = resIter.next(); if (publish.getRelationValidator().keySet().contains(currentRes.getRootPath())) { resIter.remove(); LOG.info( "Excluding resource from publish list because relations would be broken: " + currentRes.getRootPath()); } } publish.publishResources(resourcesToPublish); } catch (Exception ex) { LOG.error(ex.getLocalizedMessage(), ex); } } };
if (detailId.equals(LIST_DETAIL_RELATIONS)) { CmsRelationValidatorInfoEntry infoEntry = m_validator.getInfoEntry(resourceName); Iterator itRelations = infoEntry.getRelations().iterator();
/** * @see org.opencms.workplace.list.A_CmsListExplorerDialog#getCollector() */ @Override public I_CmsListResourceCollector getCollector() { if (m_collector == null) { m_validator = new CmsRelationPublishValidator(getCms(), getSettings().getPublishList()); List<String> resourceList = new ArrayList<String>(m_validator.keySet()); Collections.sort(resourceList); m_collector = new CmsPublishBrokenRelationsCollector(this, resourceList); } return m_collector; }