Package net.sourceforge.jwbf.mediawiki.actions.editing

Examples of net.sourceforge.jwbf.mediawiki.actions.editing.GetRevision


   * {@inheritDoc}
   */
  public synchronized SimpleArticle readData(final String name, final int properties)
  throws ActionException, ProcessException {

    GetRevision ac;
    if (store != null) {
      if (store.containsKey(name)) {
        ac = new GetRevision(getVersion(), name, GetRevision.TIMESTAMP);
        performAction(ac);

        SimpleArticle storeSa = store.get(name);
        if (LOGGER.isDebugEnabled()) {
          LOGGER.debug("stored article (" + storeSa.getTitle() + ") revid: " + storeSa.getRevisionId());
        }
        SimpleArticle liveSa = ac.getArticle();
        if (LOGGER.isDebugEnabled()) {
          LOGGER.debug("live article revid: " + liveSa.getRevisionId());
        }
        if (liveSa.getRevisionId().equals(storeSa.getRevisionId())) {

          return store.get(name);
        }
      }

      ac = new GetRevision(getVersion(), name, properties);

      performAction(ac);
      LOGGER.debug("update cache (put)");
      store.put(ac.getArticle());

    } else {
      ac = new GetRevision(getVersion(), name, properties);

      performAction(ac);
    }
    return ac.getArticle();

  }
View Full Code Here

TOP

Related Classes of net.sourceforge.jwbf.mediawiki.actions.editing.GetRevision

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.