use of com.xpn.xwiki.doc.rcs.XWikiRCSArchive in project xwiki-platform by xwiki.
the class XWikiDocumentArchive method setArchive.
/**
* 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);
this.updatedNodeInfos.add(nodeInfo);
this.updatedNodeContents.add(nodeContent);
}
} catch (Exception e) {
Object[] args = { text, Long.valueOf(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);
}
}
Aggregations