/** * Update page information. * * @param node Element for the page. * @param page Page. * @throws JDOMException */ public void updatePageInformation(Element node, Page page) throws JDOMException { // Retrieve basic page information Attribute attrPageId = node.getAttribute("pageid"); if (attrPageId != null) { page.setPageId(attrPageId.getValue()); } Attribute attrTitle = node.getAttribute("title"); if (attrTitle != null) { page.setTitle(attrTitle.getValue()); } page.setStartTimestamp(node.getAttributeValue("starttimestamp")); Attribute attrRedirect = node.getAttribute("redirect"); if (attrRedirect != null) { page.isRedirect(true); } Attribute attrMissing = node.getAttribute("missing"); if (attrMissing != null) { page.setExisting(Boolean.FALSE); } // Retrieve protection information XPath xpaProtection = XPath.newInstance("protection/pr[@type=\"edit\"]"); Element protectionNode = (Element) xpaProtection.selectSingleNode(node); if (protectionNode != null) { XPath xpaLevel = XPath.newInstance("./@level"); page.setEditProtectionLevel(xpaLevel.valueOf(protectionNode)); } }