Package org.jamwiki

Examples of org.jamwiki.WikiMessage


   */
  private void viewAdmin(HttpServletRequest request, ModelAndView next,
      WikiPageInfo pageInfo, Properties props) throws Exception {
    pageInfo.setContentJsp(JSP_ADMIN);
    pageInfo.setAdmin(true);
    pageInfo.setPageTitle(new WikiMessage("admin.title"));
    Map editors = WikiConfiguration.getInstance().getEditors();
    next.addObject("editors", editors);
    List<WikiConfigurationObject> dataHandlers = WikiConfiguration
        .getInstance().getDataHandlers();
    next.addObject("dataHandlers", dataHandlers);
View Full Code Here


   */
  private void viewAdminSystem(HttpServletRequest request, ModelAndView next,
      WikiPageInfo pageInfo) throws Exception {
    pageInfo.setContentJsp(JSP_ADMIN_SYSTEM);
    pageInfo.setAdmin(true);
    pageInfo.setPageTitle(new WikiMessage("admin.maintenance.title"));
    List<VirtualWiki> virtualWikiList = WikiBase.getDataHandler()
        .getVirtualWikiList();
    next.addObject("wikis", virtualWikiList);
    boolean allowExport = Environment.getValue(
        Environment.PROP_BASE_PERSISTENCE_TYPE).equals(
View Full Code Here

      WikiBase.getDataHandler().writeVirtualWiki(virtualWiki);
      if (StringUtils.isBlank(request.getParameter("virtualWikiId"))) {
        WikiBase.getDataHandler().setupSpecialPages(request.getLocale(), user,
            virtualWiki);
      }
      next.addObject("message", new WikiMessage(
          "admin.message.virtualwikiadded"));
    } catch (Exception e) {
      logger.severe("Failure while adding virtual wiki", e);
      next.addObject("message", new WikiMessage(
          "admin.message.virtualwikifail", e.getMessage()));
    }
    viewAdminSystem(request, next, pageInfo);
  }
View Full Code Here

  private void history(HttpServletRequest request, ModelAndView next,
      WikiPageInfo pageInfo) throws Exception {
    String virtualWiki = pageInfo.getVirtualWikiName();
    String topicName = WikiUtil.getTopicFromRequest(request);
    if (StringUtils.isBlank(topicName)) {
      throw new WikiException(new WikiMessage("common.exception.notopic"));
    }
    pageInfo.setContentJsp(JSP_HISTORY);
    pageInfo.setTopicName(topicName);
    pageInfo.setPageTitle(new WikiMessage("history.title", topicName));
    Pagination pagination = ServletUtil.loadPagination(request, next);
    List<RecentChange> changes = WikiBase.getDataHandler().getTopicHistory(
        virtualWiki, topicName, pagination, true);
    if (changes != null && changes.size() > 0) {
      next.addObject("changes", changes);
View Full Code Here

    Long topicVersionId = Long
        .parseLong(request.getParameter("topicVersionId"));
    TopicVersion topicVersion = WikiBase.getDataHandler().lookupTopicVersion(
        topicVersionId);
    if (topicVersion == null) {
      throw new WikiException(new WikiMessage("common.exception.notopic"));
    }
    Topic topic = WikiBase.getDataHandler().lookupTopic(virtualWiki, topicName,
        false, null);
    if (topic == null) {
      // the topic may have been deleted
      throw new WikiException(new WikiMessage("history.message.notopic",
          topicName));
    }
    topic.setTopicContent(topicVersion.getVersionContent());
    String versionDate = DateFormat.getDateTimeInstance().format(
        topicVersion.getEditDate());
    WikiMessage pageTitle = new WikiMessage("topic.title", topicName + " @"
        + versionDate);
    ServletUtil.viewTopic(request, next, pageInfo, pageTitle, topic, false,
        false);
  }
View Full Code Here

    }
    WikiUser user = ServletUtil.currentWikiUser();
    try {
      watchlist = WikiBase.getDataHandler().getWatchlist(virtualWiki, user.getUserId());
    } catch (DataAccessException e) {
      throw new WikiException(new WikiMessage("error.unknown", e.getMessage()), e);
    }
    if (request.getSession(false) != null) {
      // add watchlist to session
      request.getSession(false).setAttribute(WikiUtil.PARAMETER_WATCHLIST, watchlist);
    }
View Full Code Here

    next.addObject("categoryName", categoryName);
    List<Category> categoryTopics = null;
    try {
      categoryTopics = WikiBase.getDataHandler().lookupCategoryTopics(virtualWiki, topicName);
    } catch (DataAccessException e) {
      throw new WikiException(new WikiMessage("error.unknown", e.getMessage()), e);
    }
    List<Category> categoryImages = new ArrayList<Category>();
    LinkedHashMap<String, String> subCategories = new LinkedHashMap<String, String>();
    int i = 0;
    // loop through the results and split out images and sub-categories
View Full Code Here

        // user does not have appropriate permissions
        return false;
      }
      topic = WikiBase.getDataHandler().lookupTopic(virtualWiki, topicName, false, null);
    } catch (Exception e) {
      throw new WikiException(new WikiMessage("error.unknown", e.getMessage()), e);
    }
    if (topic == null) {
      // new topic, edit away...
      return true;
    }
View Full Code Here

  protected static void redirect(ModelAndView next, String virtualWiki, String destination) throws WikiException {
    String target = null;
    try {
      target = LinkUtil.buildTopicUrl(null, virtualWiki, destination, true);
    } catch (DataAccessException e) {
      throw new WikiException(new WikiMessage("error.unknown", e.getMessage()), e);
    }
    String view = ServletUtil.SPRING_REDIRECT_PREFIX + target;
    next.clear();
    next.setViewName(view);
  }
View Full Code Here

      } catch (ClassNotFoundException e) {
        validParser = false;
      }
    }
    if (!validParser) {
      errors.add(new WikiMessage("error.parserclass", parserClass));
    }
    return errors;
  }
View Full Code Here

TOP

Related Classes of org.jamwiki.WikiMessage

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.