private void removeWeblogEntryTag(WeblogEntryTag tag) throws WebloggerException {
   if (tag.getWeblogEntry().isPublished()) {
     updateTagCount(tag.getName(), tag.getWeblogEntry().getWebsite(), -1);
   }
   this.strategy.remove(tag);
 }
  // TODO: perhaps the createAnchor() and queuePings() items should go outside this method?
  public void saveWeblogEntry(WeblogEntry entry) throws WebloggerException {

    if (entry.getCategory() == null) {
      // Entry is invalid without category, so use weblog client cat
      WeblogCategory cat = entry.getWebsite().getBloggerCategory();
      if (cat == null) {
        // Still no category, so use first one found
        cat = entry.getWebsite().getWeblogCategories().iterator().next();
      }
      entry.setCategory(cat);
    }

    // Entry is invalid without local. if missing use weblog default
    if (entry.getLocale() == null) {
      entry.setLocale(entry.getWebsite().getLocale());
    }

    if (entry.getAnchor() == null || entry.getAnchor().trim().equals("")) {
      entry.setAnchor(this.createAnchor(entry));
    }

    if (entry.isPublished()) {
      // tag aggregates are updated only when entry published in order for
      // tag cloud counts to match published articles
      if (entry.getRefreshAggregates()) {
        // blog entry wasn't published before, so all tags need to be incremented
        for (WeblogEntryTag tag : entry.getTags()) {
          updateTagCount(tag.getName(), entry.getWebsite(), 1);
        }
      } else {
        // only new tags need to be incremented
        for (WeblogEntryTag tag : entry.getAddedTags()) {
          updateTagCount(tag.getName(), entry.getWebsite(), 1);
        }
      }
    } else {
      if (entry.getRefreshAggregates()) {
        // blog entry no longer published so need to reduce aggregate count
        for (WeblogEntryTag tag : entry.getTags()) {
          updateTagCount(tag.getName(), entry.getWebsite(), -1);
        }
      }
    }

    for (WeblogEntryTag tag : entry.getRemovedTags()) {
      removeWeblogEntryTag(tag);
    }

    // if the entry was published to future, set status as SCHEDULED
    // we only consider an entry future published if it is scheduled
    // more than 1 minute into the future
    if (PubStatus.PUBLISHED.equals(entry.getStatus())
        && entry
            .getPubTime()
            .after(new Date(System.currentTimeMillis() + RollerConstants.MIN_IN_MS))) {
      entry.setStatus(PubStatus.SCHEDULED);
    }

    // Store value object (creates new or updates existing)
    entry.setUpdateTime(new Timestamp(new Date().getTime()));

    this.strategy.store(entry);

    // update weblog last modified date.  date updated by saveWebsite()
    if (entry.isPublished()) {
      roller.getWeblogManager().saveWeblog(entry.getWebsite());
    }

    if (entry.isPublished()) {
      // Queue applicable pings for this update.
      roller.getAutopingManager().queueApplicableAutoPings(entry);
    }
  }