/** * @return the language of the described document * * @since 2.2M1 */ public String getLanguage() { return doc.getLanguage(); }
private void setDocumentDefaultAction(String docName, String language, int defaultAction) { if (this.files == null) { return; } for (DocumentInfo docInfo : this.files) { if (docInfo.getFullName().equals(docName) && docInfo.getLanguage().equals(language)) { docInfo.setAction(defaultAction); return; } } }
public void setDocumentAction(String docFullName, String language, int action) { for (DocumentInfo docInfo : this.plugin.getFiles()) { if ((docInfo.getFullName().compareTo(docFullName) == 0) && (language.equals(docInfo.getLanguage()))) { docInfo.setAction(action); } } }
Map<String, String> fileInfos = new HashMap<String, String>(); fileInfos.put("defaultAction", String.valueOf(docInfo.getAction())); fileInfos.put("language", String.valueOf(docInfo.getLanguage())); fileInfos.put("fullName", docInfo.getFullName());
+ " " + ((doc == null) ? "" : getLanguage())); if (log.isDebugEnabled()) { log.debug("Package test install document " + ((doc == null) ? "" : getFullName()) + " " + ((doc == null) ? "" : getLanguage()) + " result " + installable);
if (di.getFullName().equals(doc.getFullName()) && (di.getLanguage().equals(doc.getLanguage()))) { if (defaultAction != DocumentInfo.ACTION_NOT_DEFINED) { di.setAction(defaultAction);
LOG.debug("Package installing document " + doc.getFullName() + " " + doc.getLanguage()); addToSkipped(doc.getFullName() + ":" + doc.getLanguage(), context); return DocumentInfo.INSTALL_OK; addToErrors(doc.getFullName() + ":" + doc.getLanguage(), context); return DocumentInfo.INSTALL_IMPOSSIBLE; previousdoc = previousdoc.getTranslatedDocument(doc.getLanguage(), context); addToErrors(doc.getFullName() + ":" + doc.getLanguage(), context); if (LOG.isErrorEnabled()) { LOG.error("Failed to delete document " + previousdoc.getDocumentReference()); context.getWiki().saveDocument(doc.getDoc(), saveMessage, context); doc.getDoc().saveAllAttachments(false, true, context); addToInstalled(doc.getFullName() + ":" + doc.getLanguage(), context); addToErrors(doc.getFullName() + ":" + doc.getLanguage(), context); if (LOG.isErrorEnabled()) { LOG.error("Failed to save document " + doc.getFullName(), e);
Element elfile = new DOMElement("file"); elfile.addAttribute("defaultAction", String.valueOf(docInfo.getAction())); elfile.addAttribute("language", String.valueOf(docInfo.getLanguage())); elfile.addText(docInfo.getFullName()); wr.write(elfile);