File Source: TopicTagPlugin.java

     1  /*
     2   * Licensed to the Apache Software Foundation (ASF) under one or more
     3   * contributor license agreements.  The ASF licenses this file to You
     4   * under the Apache License, Version 2.0 (the "License"); you may not
     5   * use this file except in compliance with the License.
     6   * You may obtain a copy of the License at
     7   *
     8   *   http://www.apache.org/licenses/LICENSE-2.0
     9   *
    10   * Unless required by applicable law or agreed to in writing, software
    11   * distributed under the License is distributed on an "AS IS" BASIS,
    12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13   * See the License for the specific language governing permissions and
    14   * limitations under the License.  For additional information regarding
    15   * copyright in this work, please see the NOTICE file in the top level
    16   * directory of this distribution.
    17   */
    18  
    19  package org.apache.roller.weblogger.business.plugins.entry;
    20  
    21  import org.apache.commons.logging.Log;
    22  import org.apache.commons.logging.LogFactory;
    23  import org.apache.roller.weblogger.WebloggerException;
    24  import org.apache.roller.weblogger.config.WebloggerConfig;
    25  import org.apache.roller.weblogger.business.BookmarkManager;
    26  import org.apache.roller.weblogger.business.WebloggerFactory;
    27  import org.apache.roller.weblogger.pojos.WeblogBookmark;
    28  import org.apache.roller.weblogger.pojos.WeblogEntry;
    29  import org.apache.roller.weblogger.pojos.Weblog;
    30  import org.apache.roller.weblogger.business.plugins.entry.WeblogEntryPlugin;
    31  
    32  import java.io.UnsupportedEncodingException;
    33  import java.net.URLEncoder;
    34  import java.text.FieldPosition;
    35  import java.text.MessageFormat;
    36  import java.util.HashMap;
    37  import java.util.Iterator;
    38  import java.util.List;
    39  import java.util.Map;
    40  import java.util.regex.Matcher;
    41  import java.util.regex.Pattern;
    42  import java.util.regex.PatternSyntaxException;
    43  
    44  
    45  /**
    46   * Provides an easy way to write topic tag links for Technorati (or similar services).
    47   * <p/>
    48   * Looks for occurrences of topic tag specifiers of the form
    49   * <pre>
    50   * <code>topic:{topicbookmark}[tag]</code>  OR    <code>topic:[tag]</code>
    51   * </pre>
    52   * and replaces them with a topic tag link of the form:
    53   * <pre>
    54   * <code><a rel="tag" href="site/tag">tag</a></code>
    55   * </pre>
    56   * <p/>
    57   * More information on topic tag links can be found at <a href="http://www.technorati.com">Technorati</a>.
    58   * <p/>
    59   * <p/>
    60   * In the first form, the <code>topicbookmark</code> is used as the name of a bookmark, and the URL from that bookmark
    61   * entry is used as the <code>site</code> portion in the <code>href</code> of the link.
    62   * <p/>
    63   * All folders are searched to find a bookmark with the name specified by <code>topicbookmark</code>. A name must match
    64   * exactly, ignoring case.  The first matching bookmark is used, and folders may be searched in any order.  The
    65   * bookmark's URL value can end in a "/" or not; either will work.
    66   * <p/>
    67   * The second form is equivalent to using the string "Default Topic Site" as the value of <code>topicbookmark</code>.
    68   * <p/>
    69   * If the bookmark lookup fails, then "http://www.technorati.com/tag" is used as the site name in the topic tag link.
    70   * <p/>
    71   * You can specify some Roller site-wide properties in the roller.properties or roller-custom.properties to override
    72   * some of the defaults of this plugin. All of these are optional.
    73   * <p/>
    74   * <dl> <dt><code>org.apache.roller.weblogger.presentation.velocity.plugins.topictag.TopicTagPlugin.defaultTopicBookmarkName</code></dt>
    75   * <dd>Specify the name of the default topic bookmark instead of "Default Topic Site"</dd>
    76   * <p/>
    77   * <dt><code>org.apache.roller.weblogger.presentation.velocity.plugins.topictag.TopicTagPlugin.defaultTopicSite</code></dt> <dd>Specify
    78   * the default site name to be used instead of "http://www.technorati.com" for the case in which all of the lookups
    79   * fail.</dd>
    80   * <p/>
    81   * <dt><code>org.apache.roller.weblogger.presentation.velocity.plugins.topictag.TopicTagPlugin.tagPatternWithBookmark</code></dt> <dd>Can
    82   * be used to redefine the regular expression used to find a long-form topic tag specifiers in the input.  This pattern
    83   * corresponds to the "long form" and must have two matching groups.  Group 1 must correspond to the bookmark name.
    84   * Group 2 must correspond to the tag.</dd>
    85   * <p/>
    86   * <dt><code>org.apache.roller.weblogger.presentation.velocity.plugins.topictag.TopicTagPlugin.tagPatternDefaultBookmark</code></dt>
    87   * <dd>Can be used to redefine the regular expression used to find short-form topic tag specifiers in the input. This
    88   * pattern must have one matching group, which corresponds to the tag.</dd>
    89   * <p/>
    90   * <dt><code>org.apache.roller.weblogger.presentation.velocity.plugins.topictag.TopicTagPlugin.linkFormatString</code></dt> <dd>Can be
    91   * used to redefine the format of the generated link.  This string is a message format string with three positional
    92   * parameters.  Parameter <code>{0}</code> represents the site including a trailing "/",  parameter <code>{1}</code>
    93   * represents the url-encoded tag and parameter <code>{2}</code> represents the original unencoded tag text.</dd>
    94   * <p/>
    95   * </dl>
    96   *
    97   * @author <a href="mailto:anil@busybuddha.org">Anil Gangolli</a>
    98   * @version 0.3
    99   */
   100  public class TopicTagPlugin implements WeblogEntryPlugin
   101  {
   102      private static final String version = "0.3";
             /* 
    P/P       *  Method: org.apache.roller.weblogger.business.plugins.entry.TopicTagPlugin__static_init
              * 
              *  Presumptions:
              *    org.apache.commons.logging.LogFactory:getFactory(...)@103 != null
              * 
              *  Postconditions:
              *    init'ed(mLogger)
              */
   103      private static final Log mLogger = LogFactory.getFactory().getInstance(TopicTagPlugin.class);
   104  
   105  
   106      // Default values of properties that can be set from the web.xml configuration.
   107      private String defaultTopicBookmarkName = "Default Topic Site";
   108      private String defaultTopicSite = "http://www.technorati.com/tag";
   109      private String tagRegexWithBookmark = "topic:\\{(.*?)\\}\\[(.*?)\\]";
   110      private String tagRegexWithoutBookmark = "topic:\\[(.*?)\\]";
   111      private String linkFormatString = "<a rel=\"tag\" href=\"{0}{1}\">{2}</a>";
   112  
   113      // Compiled form of the regular expressions above.  Compiled during the init()
   114      private Pattern tagPatternWithBookmark;
   115      private Pattern tagPatternWithoutBookmark;
   116      private MessageFormat linkFormat;
   117  
   118      // A map of the user's bookmarks (values of type BookmarkData) keyed by name (String).   If the user has multiple
   119      // bookmarks with the same name in different folders, only one gets used (the last encountered).
   120      private Map userBookmarks;
   121  
   122  
   123      public TopicTagPlugin()
             /* 
    P/P       *  Method: void org.apache.roller.weblogger.business.plugins.entry.TopicTagPlugin()
              * 
              *  Postconditions:
              *    this.defaultTopicBookmarkName == &"Default Topic Site"
              *    this.defaultTopicSite == &"http:..www.technorati.com.tag"
              *    this.linkFormatString == &"<a rel="tag" href="{0}{1}">{2}<.a>"
              *    this.tagRegexWithBookmark == &"topic:\{(.*?)\}\[(.*?)\]"
              *    this.tagRegexWithoutBookmark == &"topic:\[(.*?)\]"
              */
   124      {
   125      }
   126  
   127      /**
   128       * Initialize the plugin instance.   This sets up the configurable properties and default topic site.
   129       * 
   130       * @param rreq Plugins may need to access RollerRequest.
   131       * @param ctx  Plugins may place objects into the Velocity Context.
   132       * @see PagWeblogEntryPluginit(org.apache.roller.weblogger.presentation.RollerRequest, org.apache.velocity.context.Context)
   133       */
   134      public void init(Weblog website) throws WebloggerException
   135      {
                 /* 
    P/P           *  Method: void init(Weblog)
                  * 
                  *  Preconditions:
                  *    init'ed(this.defaultTopicBookmarkName)
                  *    init'ed(this.defaultTopicSite)
                  *    init'ed(this.linkFormatString)
                  *    init'ed(this.tagRegexWithBookmark)
                  *    init'ed(this.tagRegexWithoutBookmark)
                  *    org/apache/roller/weblogger/config/WebloggerConfig.config != null
                  *    org/apache/roller/weblogger/config/WebloggerConfig.log != null
                  *    (soft) org/apache/roller/weblogger/business/WebloggerFactory.webloggerProvider != null
                  *    (soft) org/apache/roller/weblogger/business/WebloggerFactory.webloggerProvider.webloggerInstance != null
                  * 
                  *  Presumptions:
                  *    java.util.regex.Matcher:groupCount(...)@167 == 2
                  *    java.util.regex.Matcher:groupCount(...)@183 == 1
                  *    java.util.regex.Pattern:compile(...)@160 != null
                  *    java.util.regex.Pattern:compile(...)@176 != null
                  *    java.util.regex.Pattern:matcher(...)@167 != null
                  *    ...
                  * 
                  *  Postconditions:
                  *    init'ed(java.lang.StringBuilder:toString(...)._tainted)
                  *    init'ed(this.defaultTopicBookmarkName)
                  *    this.defaultTopicSite != null
                  *    this.linkFormat == &new MessageFormat(init#10)
                  *    init'ed(this.linkFormatString)
                  *    (soft) this.tagPatternWithBookmark != null
                  *    (soft) this.tagPatternWithoutBookmark != null
                  *    init'ed(this.tagRegexWithBookmark)
                  *    init'ed(this.tagRegexWithoutBookmark)
                  *    this.userBookmarks == &new HashMap(buildBookmarkMap#1)
                  *    ...
                  * 
                  *  Test Vectors:
                  *    java.lang.String:endsWith(...)@152: {1}, {0}
                  *    java.util.Map:get(...)@148: Addr_Set{null}, Inverse{null}
                  *    org.apache.commons.logging.Log:isDebugEnabled(...)@136: {0}, {1}
                  */
   136          if (mLogger.isDebugEnabled())
   137          {
   138              mLogger.debug("TopicTagPlugin v. " + version);
   139          }
   140  
   141          // Initialize property settings
   142          initializeProperties();
   143  
   144          // Build map of the user's bookmarks
   145          userBookmarks = buildBookmarkMap(website);
   146  
   147          // Determine default topic site from bookmark if present
   148          WeblogBookmark defaultTopicBookmark = (WeblogBookmark) userBookmarks.get(defaultTopicBookmarkName);
   149          if (defaultTopicBookmark != null) defaultTopicSite = defaultTopicBookmark.getUrl();
   150  
   151          // Append / to defaultTopicSite if it doesn't have it
+  152          if (!defaultTopicSite.endsWith("/"))
   153          {
   154              defaultTopicSite += "/";
   155          }
   156  
   157          // Compile patterns and make sure they have the correct number of matching groups in them.
   158          try
   159          {
   160              tagPatternWithBookmark = Pattern.compile(tagRegexWithBookmark);
   161          }
   162          catch (PatternSyntaxException e)
   163          {
   164              throw new WebloggerException("Invalid regular expression for topic tags with bookmark '" +
   165                  tagRegexWithBookmark + "': " + e.getMessage());
   166          }
   167          int groupCount = tagPatternWithBookmark.matcher("").groupCount();
   168          if (groupCount != 2)
   169          {
   170              throw new WebloggerException("Regular expression for topic tags with bookmark '" + tagRegexWithBookmark +
   171                  "' contains wrong number of capture groups.  Must have exactly 2.  Contains " + groupCount);
   172          }
   173  
   174          try
   175          {
   176              tagPatternWithoutBookmark = Pattern.compile(tagRegexWithoutBookmark);
   177          }
   178          catch (PatternSyntaxException e)
   179          {
   180              throw new WebloggerException("Invalid regular expression for topic tags without bookmark '" +
   181                  tagRegexWithoutBookmark + "': " + e.getMessage());
   182          }
   183          groupCount = tagPatternWithoutBookmark.matcher("").groupCount();
   184          if (groupCount != 1)
   185          {
   186              throw new WebloggerException("Regular expression for topic tags without bookmark '" + tagRegexWithoutBookmark +
   187                  "' contains wrong number of capture groups.  Must have exactly 1.  Contains " + groupCount);
   188          }
   189  
   190          // Create link format from format string
   191          setLinkFormat(new MessageFormat(linkFormatString));
   192      }
   193  
   194      /**
   195       * Apply the plugin to the given entry.  Returns the entry text with topic tags expanded.
   196       *
   197       * @param entry           WeblogEntry to which plugin should be applied.
   198       * @param singleEntry     Ignored.
   199       * @return Results of applying plugin to entry.
   200       */
   201      public String render(WeblogEntry entry, String str)
   202      {
                 /* 
    P/P           *  Method: String render(WeblogEntry, String)
                  * 
                  *  Preconditions:
                  *    str != null
                  *    this.tagPatternWithBookmark != null
                  *    this.tagPatternWithoutBookmark != null
                  *    (soft) this.defaultTopicSite != null
                  *    (soft) this.linkFormat != null
                  *    (soft) this.linkFormatString != null
                  *    (soft) this.userBookmarks != null
                  * 
                  *  Presumptions:
                  *    java.util.regex.Matcher:group(...)@212 != null
                  *    java.util.regex.Matcher:group(...)@233 != null
                  *    java.util.regex.Pattern:matcher(...)@208 != null
                  *    java.util.regex.Pattern:matcher(...)@230 != null
                  * 
                  *  Postconditions:
                  *    java.lang.StringBuffer:toString(...)._tainted == 0
                  *    return_value == &java.lang.StringBuffer:toString(...)
                  * 
                  *  Test Vectors:
                  *    java.lang.String:endsWith(...)@218: {1}, {0}
                  *    java.util.regex.Matcher:find(...)@209: {0}, {1}
                  *    java.util.regex.Matcher:find(...)@231: {0}, {1}
                  */
   203          String entryText = str;
   204          StringBuffer result = new StringBuffer(entryText.length());
   205          MessageFormat fmt = getLinkFormat();
   206  
   207          // Replace all of the instances matching the pattern with bookmark specified.
   208          Matcher m = tagPatternWithBookmark.matcher(entryText);
   209          while (m.find())
   210          {
   211              String bookmark = m.group(1);
   212              String tag = m.group(2);
   213              String site = getBookmarkSite(bookmark);
   214              if (site == null)
   215              {
   216                  site = getDefaultTopicSite();
   217              }
   218              if (!site.endsWith("/"))
   219              {
   220                  site += "/";
   221              }
   222              String link = generateLink(fmt, site, tag);
   223              m.appendReplacement(result, link);
   224          }
   225          m.appendTail(result);
   226  
   227          // Now, in a second phase replace all of the instances matching the pattern without bookmark specified.
   228          entryText = result.toString();
   229          result = new StringBuffer(entryText.length());
   230          m = tagPatternWithoutBookmark.matcher(entryText);
   231          while (m.find())
   232          {
   233              String tag = m.group(1);
   234              String site = getDefaultTopicSite();
   235              String link = generateLink(fmt, site, tag);
   236              m.appendReplacement(result, link);
   237          }
   238          m.appendTail(result);
   239  
   240          return result.toString();
   241      }
   242      
   243  
   244      /**
   245       * Returns the human-friendly name of this Plugin. This is what users will see.
   246       *
   247       * @return The human-friendly name of this Plugin.
   248       */
   249      public String getName()
   250      {
   251          // TODO: i18n
                 /* 
    P/P           *  Method: String getName()
                  * 
                  *  Postconditions:
                  *    return_value == &"Topic Tags"
                  */
   252          return "Topic Tags";
   253      }
   254  
   255      /**
   256       * Briefly describes the function of the Plugin. May contain HTML.
   257       *
   258       * @return A brief description of the Plugin.
   259       */
   260      public String getDescription()
   261      {
   262          // TODO: i18n
                 /* 
    P/P           *  Method: String getDescription()
                  * 
                  *  Postconditions:
                  *    return_value == &"Expands topic tags for <a href=\'http:..www.technorati.com\'>Technorat ... de> bookmark, if that is defined, otherwise http:..www.technorati.com."
                  */
   263          return "Expands topic tags for <a href=\\'http://www.technorati.com\\'>Technorati</a> and similar sites. " +
   264              "Topic tags are of the form <code>topic:{topicbookmark}[tag]</code>, where <code>topicbookmark</code> " +
   265              "is the name of a bookmark whose URL will be used for the site name in the topic tag. " +
   266              "If <code>{topicbookmark}</code> is omitted the plugin will use the URL of the <code>Default Topic Site</code> " +
   267              "bookmark, if that is defined, otherwise http://www.technorati.com.";
   268      }
   269  
   270      /**
   271       * Helper to generate the link from the link format and values of the site and tag.
   272       *
   273       * @param fmt  link format.  This should have positional parameters {0} representing site with terminal /,  {1} for
   274       *             url-encoded-tag, and {2} for visible tag text.
   275       * @param site base portion of the URL
   276       * @param tag  tag value
   277       * @return the generated link as a string
   278       */
   279      protected String generateLink(MessageFormat fmt, String site, String tag)
   280      {
   281          // Allocate initial capacity of buffer of approximately the right length.
                 /* 
    P/P           *  Method: String generateLink(MessageFormat, String, String)
                  * 
                  *  Preconditions:
                  *    fmt != null
                  *    site != null
                  *    tag != null
                  *    this.linkFormatString != null
                  * 
                  *  Presumptions:
                  *    java.lang.String:length(...)@282 + java.lang.String:length(...)@282 in 0..232-1
                  *    java.lang.String:length(...)@282 + java.lang.String:length(...)@282 + java.lang.String:length(...)@282 in 0..232-1
                  * 
                  *  Postconditions:
                  *    java.lang.StringBuffer:toString(...)._tainted == 0
                  *    return_value == &java.lang.StringBuffer:toString(...)
                  */
   282          StringBuffer sb = new StringBuffer(site.length() + tag.length() + getLinkFormatString().length());
   283          fmt.format(new Object[]{site, urlEncode(tag), tag}, sb, new FieldPosition(0));
   284          return sb.toString();
   285      }
   286  
   287      /**
   288       * Resolve the bookmark name and return the URL from it.  If the bookmark can't be found, return null
   289       *
   290       * @param bookmarkName name of the bookmark
   291       * @return String form of the URL from the bookmark by that name from any of the user's folders, or null if not
   292       *         found.
   293       */
   294      protected String getBookmarkSite(String bookmarkName)
   295      {
                 /* 
    P/P           *  Method: String getBookmarkSite(String)
                  * 
                  *  Preconditions:
                  *    this.userBookmarks != null
                  * 
                  *  Postconditions:
                  *    init'ed(return_value)
                  */
   296          WeblogBookmark bookmark = (WeblogBookmark) getUserBookmarks().get(bookmarkName);
   297          return bookmark == null ? null : bookmark.getUrl();
   298      }
   299  
   300  
   301      /**
   302       * Build the bookmark map.
   303       * If ignoreBookmarks property is set, an empty map is returned.
   304       * @return map of the user's bookmarks (type BookmarkData), keyed by name (type String).
   305       */
   306      protected Map buildBookmarkMap(Weblog website) throws WebloggerException
   307      {
                 /* 
    P/P           *  Method: Map buildBookmarkMap(Weblog)
                  * 
                  *  Preconditions:
                  *    org/apache/roller/weblogger/config/WebloggerConfig.config != null
                  *    org/apache/roller/weblogger/config/WebloggerConfig.log != null
                  *    (soft) org/apache/roller/weblogger/business/WebloggerFactory.webloggerProvider != null
                  *    (soft) org/apache/roller/weblogger/business/WebloggerFactory.webloggerProvider.webloggerInstance != null
                  * 
                  *  Presumptions:
                  *    bMgr.strategy != null
                  *    bMgr.strategy.emf != null
                  *    bMgr.strategy.emf@319 != null
                  *    bMgr.strategy.threadLocalEntityManager != null
                  *    getWeblogger(...).bookmarkManager != null
                  *    ...
                  * 
                  *  Postconditions:
                  *    return_value == &new HashMap(buildBookmarkMap#1)
                  *    new HashMap(buildBookmarkMap#1) num objects == 1
                  * 
                  *  Test Vectors:
                  *    website: Inverse{null}, Addr_Set{null}
                  *    java.util.Iterator:hasNext(...)@321: {0}, {1}
                  */
   308          Map bookmarkMap = new HashMap();
   309          if (WebloggerConfig.getBooleanProperty("plugins.topictag.ignoreBookmarks")) {
   310              return bookmarkMap;
   311          }
   312          if (website == null)
   313          {
   314              mLogger.debug("Init called without website.  Skipping bookmark initialization.");
   315          }
   316          else
   317          {
   318              BookmarkManager bMgr = WebloggerFactory.getWeblogger().getBookmarkManager();
   319              List bookmarks = bMgr.getBookmarks(bMgr.getRootFolder(website), true);
   320  
+  321              for (Iterator i = bookmarks.iterator(); i.hasNext();)
   322              {
   323                  WeblogBookmark b = (WeblogBookmark) i.next();
   324                  bookmarkMap.put(b.getName(), b);
   325              }
   326          }
   327          return bookmarkMap;
   328      }
   329  
   330  
   331      // Sets up properties.  For better and worse, doesn't use reflection
   332      private void initializeProperties()
   333      {
                 /* 
    P/P           *  Method: void initializeProperties()
                  * 
                  *  Preconditions:
                  *    init'ed(this.defaultTopicBookmarkName)
                  *    init'ed(this.defaultTopicSite)
                  *    init'ed(this.linkFormatString)
                  *    init'ed(this.tagRegexWithBookmark)
                  *    init'ed(this.tagRegexWithoutBookmark)
                  *    org/apache/roller/weblogger/config/WebloggerConfig.config != null
                  *    org/apache/roller/weblogger/config/WebloggerConfig.log != null
                  * 
                  *  Postconditions:
                  *    init'ed(this.defaultTopicBookmarkName)
                  *    init'ed(this.defaultTopicSite)
                  *    init'ed(this.linkFormatString)
                  *    init'ed(this.tagRegexWithBookmark)
                  *    init'ed(this.tagRegexWithoutBookmark)
                  */
   334          setDefaultTopicBookmarkName(getSetting("defaultTopicBookmarkName", getDefaultTopicBookmarkName()));
   335          setDefaultTopicSite(getSetting("defaultTopicSite", getDefaultTopicSite()));
   336          setTagRegexWithBookmark(getSetting("tagRegexWithBookmark", getTagRegexWithBookmark()));
   337          setTagRegexWithoutBookmark(getSetting("tagRegexWithoutBookmark", getTagRegexWithoutBookmark()));
   338          setLinkFormatString(getSetting("linkFormatString", getLinkFormatString()));
   339      }
   340  
   341      private String getSetting(String propName, String defaultValue)
   342      {
                 /* 
    P/P           *  Method: String getSetting(String, String)
                  * 
                  *  Preconditions:
                  *    org/apache/roller/weblogger/config/WebloggerConfig.config != null
                  *    org/apache/roller/weblogger/config/WebloggerConfig.log != null
                  * 
                  *  Postconditions:
                  *    init'ed(return_value)
                  */
   343          String fullPropName = "plugins.topictag." + propName;
   344          String val = (String) WebloggerConfig.getProperty(fullPropName);
   345          return (val != null) ? val : defaultValue;
   346      }
   347  
   348  
   349      // Private helper to URL encode the tag text.
   350      private String urlEncode(String text)
   351      {
   352          // URL encode the searchtext
   353          try
   354          {
                     /* 
    P/P               *  Method: String urlEncode(String)
                      * 
                      *  Postconditions:
                      *    init'ed(return_value)
                      */
   355              return URLEncoder.encode(text, "UTF-8");
   356          }
   357          catch (UnsupportedEncodingException uex)
   358          {
   359              // Should never actually occur for UTF-8.  If it does, we barf bitterly.
   360              throw new RuntimeException(uex);
   361          }
   362      }
   363  
   364  
   365      // Property getters and setters
   366  
   367  
   368      public String getDefaultTopicSite()
   369      {
                 /* 
    P/P           *  Method: String getDefaultTopicSite()
                  * 
                  *  Preconditions:
                  *    init'ed(this.defaultTopicSite)
                  * 
                  *  Postconditions:
                  *    return_value == this.defaultTopicSite
                  *    init'ed(return_value)
                  */
   370          return defaultTopicSite;
   371      }
   372  
   373      public void setDefaultTopicSite(String defaultTopicSite)
   374      {
                 /* 
    P/P           *  Method: void setDefaultTopicSite(String)
                  * 
                  *  Postconditions:
                  *    this.defaultTopicSite == defaultTopicSite
                  *    init'ed(this.defaultTopicSite)
                  */
   375          this.defaultTopicSite = defaultTopicSite;
   376      }
   377  
   378      public String getTagRegexWithBookmark()
   379      {
                 /* 
    P/P           *  Method: String getTagRegexWithBookmark()
                  * 
                  *  Preconditions:
                  *    init'ed(this.tagRegexWithBookmark)
                  * 
                  *  Postconditions:
                  *    return_value == this.tagRegexWithBookmark
                  *    init'ed(return_value)
                  */
   380          return tagRegexWithBookmark;
   381      }
   382  
   383      public void setTagRegexWithBookmark(String tagRegexWithBookmark)
   384      {
                 /* 
    P/P           *  Method: void setTagRegexWithBookmark(String)
                  * 
                  *  Postconditions:
                  *    this.tagRegexWithBookmark == tagRegexWithBookmark
                  *    init'ed(this.tagRegexWithBookmark)
                  */
   385          this.tagRegexWithBookmark = tagRegexWithBookmark;
   386      }
   387  
   388      public String getTagRegexWithoutBookmark()
   389      {
                 /* 
    P/P           *  Method: String getTagRegexWithoutBookmark()
                  * 
                  *  Preconditions:
                  *    init'ed(this.tagRegexWithoutBookmark)
                  * 
                  *  Postconditions:
                  *    return_value == this.tagRegexWithoutBookmark
                  *    init'ed(return_value)
                  */
   390          return tagRegexWithoutBookmark;
   391      }
   392  
   393      public void setTagRegexWithoutBookmark(String tagRegexWithoutBookmark)
   394      {
                 /* 
    P/P           *  Method: void setTagRegexWithoutBookmark(String)
                  * 
                  *  Postconditions:
                  *    this.tagRegexWithoutBookmark == tagRegexWithoutBookmark
                  *    init'ed(this.tagRegexWithoutBookmark)
                  */
   395          this.tagRegexWithoutBookmark = tagRegexWithoutBookmark;
   396      }
   397  
   398      public String getLinkFormatString()
   399      {
                 /* 
    P/P           *  Method: String getLinkFormatString()
                  * 
                  *  Preconditions:
                  *    init'ed(this.linkFormatString)
                  * 
                  *  Postconditions:
                  *    return_value == this.linkFormatString
                  *    init'ed(return_value)
                  */
   400          return linkFormatString;
   401      }
   402  
   403      public void setLinkFormatString(String linkFormatString)
   404      {
                 /* 
    P/P           *  Method: void setLinkFormatString(String)
                  * 
                  *  Postconditions:
                  *    this.linkFormatString == linkFormatString
                  *    init'ed(this.linkFormatString)
                  */
   405          this.linkFormatString = linkFormatString;
   406      }
   407  
   408      public MessageFormat getLinkFormat()
   409      {
                 /* 
    P/P           *  Method: MessageFormat getLinkFormat()
                  * 
                  *  Preconditions:
                  *    init'ed(this.linkFormat)
                  * 
                  *  Postconditions:
                  *    return_value == this.linkFormat
                  *    init'ed(return_value)
                  */
   410          return linkFormat;
   411      }
   412  
   413      public void setLinkFormat(MessageFormat linkFormat)
   414      {
                 /* 
    P/P           *  Method: void setLinkFormat(MessageFormat)
                  * 
                  *  Postconditions:
                  *    this.linkFormat == linkFormat
                  *    init'ed(this.linkFormat)
                  */
   415          this.linkFormat = linkFormat;
   416      }
   417  
   418      public Pattern getTagPatternWithBookmark()
   419      {
                 /* 
    P/P           *  Method: Pattern getTagPatternWithBookmark()
                  * 
                  *  Preconditions:
                  *    init'ed(this.tagPatternWithBookmark)
                  * 
                  *  Postconditions:
                  *    return_value == this.tagPatternWithBookmark
                  *    init'ed(return_value)
                  */
   420          return tagPatternWithBookmark;
   421      }
   422  
   423      public void setTagPatternWithBookmark(Pattern tagPatternWithBookmark)
   424      {
                 /* 
    P/P           *  Method: void setTagPatternWithBookmark(Pattern)
                  * 
                  *  Postconditions:
                  *    this.tagPatternWithBookmark == tagPatternWithBookmark
                  *    init'ed(this.tagPatternWithBookmark)
                  */
   425          this.tagPatternWithBookmark = tagPatternWithBookmark;
   426      }
   427  
   428      public Pattern getTagPatternWithoutBookmark()
   429      {
                 /* 
    P/P           *  Method: Pattern getTagPatternWithoutBookmark()
                  * 
                  *  Preconditions:
                  *    init'ed(this.tagPatternWithoutBookmark)
                  * 
                  *  Postconditions:
                  *    return_value == this.tagPatternWithoutBookmark
                  *    init'ed(return_value)
                  */
   430          return tagPatternWithoutBookmark;
   431      }
   432  
   433      public void setTagPatternWithoutBookmark(Pattern tagPatternWithoutBookmark)
   434      {
                 /* 
    P/P           *  Method: void setTagPatternWithoutBookmark(Pattern)
                  * 
                  *  Postconditions:
                  *    this.tagPatternWithoutBookmark == tagPatternWithoutBookmark
                  *    init'ed(this.tagPatternWithoutBookmark)
                  */
   435          this.tagPatternWithoutBookmark = tagPatternWithoutBookmark;
   436      }
   437  
   438      public String getDefaultTopicBookmarkName()
   439      {
                 /* 
    P/P           *  Method: String getDefaultTopicBookmarkName()
                  * 
                  *  Preconditions:
                  *    init'ed(this.defaultTopicBookmarkName)
                  * 
                  *  Postconditions:
                  *    return_value == this.defaultTopicBookmarkName
                  *    init'ed(return_value)
                  */
   440          return defaultTopicBookmarkName;
   441      }
   442  
   443      public void setDefaultTopicBookmarkName(String defaultTopicBookmarkName)
   444      {
                 /* 
    P/P           *  Method: void setDefaultTopicBookmarkName(String)
                  * 
                  *  Postconditions:
                  *    this.defaultTopicBookmarkName == defaultTopicBookmarkName
                  *    init'ed(this.defaultTopicBookmarkName)
                  */
   445          this.defaultTopicBookmarkName = defaultTopicBookmarkName;
   446      }
   447  
   448      public Map getUserBookmarks()
   449      {
                 /* 
    P/P           *  Method: Map getUserBookmarks()
                  * 
                  *  Preconditions:
                  *    init'ed(this.userBookmarks)
                  * 
                  *  Postconditions:
                  *    return_value == this.userBookmarks
                  *    init'ed(return_value)
                  */
   450          return userBookmarks;
   451      }
   452  
   453      public void setUserBookmarks(Map userBookmarks)
   454      {
                 /* 
    P/P           *  Method: void setUserBookmarks(Map)
                  * 
                  *  Postconditions:
                  *    this.userBookmarks == userBookmarks
                  *    init'ed(this.userBookmarks)
                  */
   455          this.userBookmarks = userBookmarks;
   456      }
   457      
   458  }








SofCheck Inspector Build Version : 2.18479
TopicTagPlugin.java 2009-Jan-02 14:25:02
TopicTagPlugin.class 2009-Sep-04 03:12:31