@Test public void testGetDocumentBundlesWhenDocumentDoesNotExist() { setPreferencesTranslationBundle(this.translationDocumentReference1); setCfgTranslationBundle(this.translationDocumentReference2); List<XWikiDocument> docs = this.tool.getDocumentBundles(); assertEquals(0, docs.size()); }
public List<XWikiDocument> getDocumentBundles() { XWikiContext context = getXWikiContext(); String defaultLanguage = context.getWiki().getDefaultLanguage(context); List<XWikiDocument> result = new ArrayList<XWikiDocument>(); for (String docName : getDocumentBundleNames()) { for (XWikiDocument docBundle : getDocumentBundles(docName.trim(), defaultLanguage)) { if (docBundle != null) { if (!docBundle.isNew()) { Long docId = Long.valueOf(docBundle.getId()); Date docDate = docBundle.getDate(); if (!docDate.equals(this.previousDates.get(docId))) { this.docsToRefresh.add(docId); this.previousDates.put(docId, docDate); } result.add(docBundle); } else { LOGGER.warn("The document [" + docBundle.getFullName() + "] is listed " + "as an internationalization document bundle but it does not " + "exist."); } } } } return result; }
XWikiMessageTool { public List<XWikiDocument> getDocumentBundles() { XWikiContext context = getXWikiContext(); String defaultLanguage = context.getWiki().getDefaultLanguage(context); List<XWikiDocument> result = new ArrayList<XWikiDocument>(); for (String docName : getDocumentBundleNames()) { for (XWikiDocument docBundle : getDocumentBundles(docName.trim(), defaultLanguage)) { if (docBundle != null) { if (!docBundle.isNew()) { Long docId = Long.valueOf(docBundle.getId()); Date docDate = docBundle.getDate(); if (!docDate.equals(this.previousDates.get(docId))) { this.docsToRefresh.add(docId); this.previousDates.put(docId, docDate); } result.add(docBundle); } else { LOGGER.warn("The document [" + docBundle.getFullName() + "] is listed " + "as an internationalization document bundle but it does not " + "exist."); } } } } return result; } }
XWikiMessageTool { public List<XWikiDocument> getDocumentBundles() { XWikiContext context = getXWikiContext(); String defaultLanguage = context.getWiki().getDefaultLanguage(context); List<XWikiDocument> result = new ArrayList<XWikiDocument>(); for (String docName : getDocumentBundleNames()) { for (XWikiDocument docBundle : getDocumentBundles(docName.trim(), defaultLanguage)) { if (docBundle != null) { if (!docBundle.isNew()) { Long docId = Long.valueOf(docBundle.getId()); Date docDate = docBundle.getDate(); if (!docDate.equals(this.previousDates.get(docId))) { this.docsToRefresh.add(docId); this.previousDates.put(docId, docDate); } result.add(docBundle); } else { LOGGER.warn("The document [" + docBundle.getFullName() + "] is listed " + "as an internationalization document bundle but it does not " + "exist."); } } } } return result; } XWikiMessageTool(ContextualLocalizationManager localization);  XWikiMessageTool(ResourceBundle bundle, XWikiContext context); }
XWikiMessageTool { public List<XWikiDocument> getDocumentBundles() { XWikiContext context = getXWikiContext(); String defaultLanguage = context.getWiki().getDefaultLanguage(context); List<XWikiDocument> result = new ArrayList<XWikiDocument>(); for (String docName : getDocumentBundleNames()) { for (XWikiDocument docBundle : getDocumentBundles(docName.trim(), defaultLanguage)) { if (docBundle != null) { if (!docBundle.isNew()) { Long docId = Long.valueOf(docBundle.getId()); Date docDate = docBundle.getDate(); if (!docDate.equals(this.previousDates.get(docId))) { this.docsToRefresh.add(docId); this.previousDates.put(docId, docDate); } result.add(docBundle); } else { LOGGER.warn("The document [" + docBundle.getFullName() + "] is listed " + "as an internationalization document bundle but it does not " + "exist."); } } } } return result; } XWikiMessageTool(ContextualLocalizationManager localization);  XWikiMessageTool(ResourceBundle bundle, XWikiContext context); String get(String key); String get(String key, List<?> params); String get(String key, Object... params); List<XWikiDocument> getDocumentBundles(); XWikiDocument getDocumentBundle(String documentName); List<XWikiDocument> getDocumentBundles(String documentName, String defaultLanguage); Properties getDocumentBundleProperties(XWikiDocument docBundle); }
XWikiMessageTool { public List<XWikiDocument> getDocumentBundles() { XWikiContext context = getXWikiContext(); String defaultLanguage = context.getWiki().getDefaultLanguage(context); List<XWikiDocument> result = new ArrayList<XWikiDocument>(); for (String docName : getDocumentBundleNames()) { for (XWikiDocument docBundle : getDocumentBundles(docName.trim(), defaultLanguage)) { if (docBundle != null) { if (!docBundle.isNew()) { Long docId = Long.valueOf(docBundle.getId()); Date docDate = docBundle.getDate(); if (!docDate.equals(this.previousDates.get(docId))) { this.docsToRefresh.add(docId); this.previousDates.put(docId, docDate); } result.add(docBundle); } else { LOGGER.warn("The document [" + docBundle.getFullName() + "] is listed " + "as an internationalization document bundle but it does not " + "exist."); } } } } return result; } XWikiMessageTool(ContextualLocalizationManager localization);  XWikiMessageTool(ResourceBundle bundle, XWikiContext context); String get(String key); String get(String key, List<?> params); String get(String key, Object... params); List<XWikiDocument> getDocumentBundles(); XWikiDocument getDocumentBundle(String documentName); List<XWikiDocument> getDocumentBundles(String documentName, String defaultLanguage); Properties getDocumentBundleProperties(XWikiDocument docBundle);  }