Package de.zib.scalaris.examples.wikipedia.data

Examples of de.zib.scalaris.examples.wikipedia.data.Revision


                    System.err.println("Unknown restriction: " + restrictions_array[i]);
                }
            }
        }
        // get current revision (the largest one):
        Revision curRev = null;
        if (!revisions.isEmpty()) {
            curRev = revisions.lastEntry().getValue();
            curRev.setUnpackedText(lastRevText);
        }
        final_page = new Page(title,
                Integer.parseInt(id), redirect, restrictions_map, curRev);
    }
View Full Code Here


        if (inRevision) {
            if (localName.equals("revision")) {
                inRevision = false;
                if (!skipRevisions) {
                    currentRevision.endRevision(uri, localName, qName);
                    Revision curRev = currentRevision.getRevision();
                    // check rev not too new:
                    if (maxTime == null ||
                            !Revision.stringToCalendar(curRev.getTimestamp()).after(maxTime)) {
                        // check rev not too old:
                        if (minTime != null &&
                                Revision.stringToCalendar(curRev.getTimestamp()).compareTo(minTime) <= 0) {
                            // keep only the newest (old) revision
                            revisions.clear();
                        }
                        if (maxRevisions != (-1) && revisions.size() >= maxRevisions) {
                            revisions.remove(revisions.firstKey());
                        }
                        if (!revisions.isEmpty()) {
                            revisions.lastEntry().getValue().setUnpackedText(lastRevText);
                        }
                        revisions.put(curRev.getId(), curRev);
                        lastRevText = currentRevision.getText();
                    }
                }
            } else {
                if (!skipRevisions) {
View Full Code Here

     */
    public static RevisionResult getRevision(Connection connection,
            String title, int id, final MyNamespace nsObject) {
        final long timeAtStart = System.currentTimeMillis();
        Page page = null;
        Revision revision = null;
        if (connection == null) {
            return new RevisionResult(false, "no connection to Scalaris", true,
                    page, revision, false, false, title,
                    System.currentTimeMillis() - timeAtStart);
        }
View Full Code Here

     * @param qName
     *            The qualified name (with prefix), or the empty string if
     *            qualified names are not available.
     */
    public void endRevision(String uri, String localName, String qName) {
        final_revision = new Revision(Integer.parseInt(id), timestamp,
                minorChange, currentContributor.getContributor(), comment);
    }
View Full Code Here

            // save page
            Contributor contributor = new Contributor();
            contributor.setIp(request.getRemoteAddr());
            String timestamp = Revision.calendarToString(Calendar.getInstance(TimeZone.getTimeZone("UTC")));
            int newRevId = (oldVersion == -1) ? 1 : oldVersion + 1;
            Revision newRev = new Revision(newRevId, timestamp, minorChange, contributor, summary);
            newRev.setUnpackedText(content);

            SavePageResult result;
            int retries = 0;
            while (true) {
                result = savePage(connection, title, newRev, oldVersion, null, siteinfo, "", namespace);
View Full Code Here

TOP

Related Classes of de.zib.scalaris.examples.wikipedia.data.Revision

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.