ComplexPublicationServiceImpl implements ComplexPublicationService { @Override public Collection<FullPublicationInfo> getFullUnpublicationInfos(Collection<String> nodeIdentifiers, Collection<String> languages, boolean allSubTree, JCRSessionWrapper session) { try { List<PublicationInfo> publicationInfos = publicationService.getPublicationInfos(new ArrayList<>(nodeIdentifiers), null, false, true, allSubTree, Constants.LIVE_WORKSPACE, Constants.LIVE_WORKSPACE); LinkedHashMap<String, FullPublicationInfoImpl> result = new LinkedHashMap<>(); for (String language : languages) { Collection<FullPublicationInfoImpl> infos = convert(publicationInfos, language, "unpublish", session); String lastGroup = null; String lastTitle = null; Locale locale = new Locale(language); for (FullPublicationInfoImpl info : infos) { if (info.getPublicationStatus() != PublicationInfo.PUBLISHED) { continue; } if (info.getWorkflowDefinition() == null && !info.isAllowedToPublishWithoutWorkflow()) { continue; } result.put(language + "/" + info.getNodeIdentifier(), info); if (lastGroup == null || !info.getWorkflowGroup().equals(lastGroup)) { lastGroup = info.getWorkflowGroup(); lastTitle = info.getNodeTitle() + " ( " + locale.getDisplayName(locale) + " )"; } info.setWorkflowTitle(lastTitle); } } Set<String> clearedIdentifiers = clearNodeIdentifiersOnTranslationNodes(result); removeSharedNodes(result, languages, clearedIdentifiers); return new ArrayList<>(result.values()); } catch (RepositoryException e) { throw new JahiaRuntimeException(e); } }  void setSessionFactory(JCRSessionFactory sessionFactory); void setPublicationService(JCRPublicationService publicationService); void setWorkflowService(WorkflowService workflowService); void setSchedulerService(SchedulerService schedulerService); @Override AggregatedPublicationInfo getAggregatedPublicationInfo(String nodeIdentifier, String language, boolean subNodes, boolean references, JCRSessionWrapper sourceSession); @Override Collection<FullPublicationInfo> getFullPublicationInfos(Collection<String> nodeIdentifiers, Collection<String> languages, boolean allSubTree, JCRSessionWrapper sourceSession); @Override Collection<FullPublicationInfo> getFullUnpublicationInfos(Collection<String> nodeIdentifiers, Collection<String> languages, boolean allSubTree, JCRSessionWrapper session); @Override void publish(Collection<String> nodeIdentifiers, Collection<String> languages, JCRSessionWrapper session);  }
@Test public void getFullUnpublicationInfos() throws RepositoryException { getCleanSession(); JCRNodeWrapper enContent = englishEditSession.getNode(testHomeEdit.getPath()).addNode("testNode", "jnt:text"); enContent.setProperty("text", INITIAL_ENGLISH_TEXT_NODE_PROPERTY_VALUE); englishEditSession.save(); frenchEditSession.getNode(enContent.getPath()).setProperty("text", INITIAL_FRENCH_TEXT_NODE_PROPERTY_VALUE); frenchEditSession.save(); publicationService.publishByMainId(enContent.getIdentifier()); ResultInfo result = new ResultInfo(enContent.getI18N(Locale.ENGLISH).getIdentifier(), null); checkPublicationInfos(Collections.singletonList(enContent.getIdentifier()), Arrays.asList(Locale.ENGLISH.toString()), systemEditSession, Collections.singletonList(result)); ResultInfo result1 = new ResultInfo(enContent.getI18N(Locale.ENGLISH).getIdentifier(), null); ResultInfo result2 = new ResultInfo(enContent.getI18N(Locale.FRENCH).getIdentifier(), null); checkPublicationInfos(Collections.singletonList(enContent.getIdentifier()), Arrays.asList(Locale.ENGLISH.toString(), Locale.FRENCH.toString()), systemEditSession, Arrays.asList(result1, result2)); publicationService.unpublish(Collections.singletonList(enContent.getI18N(Locale.ENGLISH).getIdentifier())); result = new ResultInfo(enContent.getI18N(Locale.FRENCH).getIdentifier(), null); checkPublicationInfos(Collections.singletonList(enContent.getIdentifier()), Arrays.asList(Locale.FRENCH.toString()), systemEditSession, Collections.singletonList(result)); checkPublicationInfos(Collections.singletonList(enContent.getIdentifier()), Arrays.asList(Locale.ENGLISH.toString()), systemEditSession, Collections.emptyList()); checkPublicationInfos(Collections.singletonList(enContent.getIdentifier()), Arrays.asList(Locale.ENGLISH.toString(), Locale.FRENCH.toString()), systemEditSession, Arrays.asList(result2)); }