/** * Deserialize class. Used in {@link com.xpn.xwiki.plugin.packaging.PackagePlugin}. * * @param text - archive in JRCS format * @throws XWikiException if parse error */ public void setArchive(String text) throws XWikiException { try { XWikiRCSArchive archive = new XWikiRCSArchive(text); resetArchive(); Collection nodes = archive.getNodes(getId()); for (Iterator it = nodes.iterator(); it.hasNext();) { XWikiRCSNodeInfo nodeInfo = (XWikiRCSNodeInfo) it.next(); XWikiRCSNodeContent nodeContent = (XWikiRCSNodeContent) it.next(); updateNode(nodeInfo); updatedNodeInfos.add(nodeInfo); updatedNodeContents.add(nodeContent); } } catch (Exception e) { Object[] args = {text, new Long(getId())}; throw new XWikiException(XWikiException.MODULE_XWIKI_DIFF, XWikiException.ERROR_XWIKI_DIFF_CONTENT_ERROR, "Exception while constructing archive for JRCS string [{0}] for document [{1}]", e, args); } }
public Object doInHibernate(Session session) throws HibernateException, XWikiException { XWikiDocumentArchive archive = getXWikiDocumentArchive(doc, context); archive.resetArchive(); archive.getDeletedNodeInfo().clear(); doc.setMinorEdit(false); deleteArchive(doc, false, context); updateXWikiDocArchive(doc, false, context); return null; } });
/** @param versions - collection of XWikiRCSNodeInfo */ public void setNodes(Collection<XWikiRCSNodeInfo> versions) { resetArchive(); for (XWikiRCSNodeInfo node : versions) { updateNode(node); } if (getNodes().size() > 0) { // ensure latest version is full getLatestNode().setDiff(false); updateNode(getLatestNode()); } }
Version firstVersionBefore = getPrevVersion(lowerBound); if (firstVersionAfter == null && firstVersionBefore == null) { resetArchive(); return;