Package plugins.Freetalk

Examples of plugins.Freetalk.SubscribedBoard


    {
        final String boardName = getMandatoryParameter(params, "BoardName");
        final String ownIdentityID = getMandatoryParameter(params, "OwnIdentityID");

        //throws exception when not found
        final SubscribedBoard board = mFreetalk.getMessageManager().getSubscription(mFreetalk.getIdentityManager().getOwnIdentity(ownIdentityID), boardName);

        synchronized(board) {
            for(BoardThreadLink threadReference : board.getThreads()) {
                final SimpleFieldSet sfs = new SimpleFieldSet(true);
                sfs.putOverwrite("Message", "MessageThread");
                sfs.putOverwrite("ID", threadReference.getThreadID());
                sfs.put("ReplyCount", board.threadReplyCount(threadReference.getThreadID()));
                sfs.put("LastReplyDate", threadReference.getLastReplyDate().getTime());
               
                try {
                final Message thread = threadReference.getMessage();
                  sfs.putOverwrite("Title", thread.getTitle());
View Full Code Here


            throw new InvalidParameterException("MinimumMessageIndex and MinimumMessageDate must not be specified together");
        }
        final boolean includeMessageText = Boolean.parseBoolean(params.get("IncludeMessageText"));
       
        //throws exception when not found
        final SubscribedBoard board = mFreetalk.getMessageManager().getSubscription(mFreetalk.getIdentityManager().getOwnIdentity(ownIdentityID), boardName);

        synchronized(board) {

            final List<BoardMessageLink> messageRefList;
            if (minimumMessageIndex > 0) {
                messageRefList = board.getMessagesByMinimumIndex(minimumMessageIndex, sortByMessageIndexAscending, sortByMessageDateAscending);
            } else if (minimumMessageDate > 0) {
                messageRefList = board.getMessagesByMinimumDate(new Date(minimumMessageDate), sortByMessageIndexAscending, sortByMessageDateAscending);
            } else {
                messageRefList = board.getAllMessages(sortByMessageIndexAscending);
            }

            // send all messages
            for(final BoardMessageLink reference : messageRefList) {
              try {
View Full Code Here

        final String threadID = params.get("ThreadID");
        final boolean sortByMessageDateAscending = Boolean.parseBoolean(params.get("SortByMessageDateAscending"));
        final boolean includeMessageText = Boolean.parseBoolean(params.get("IncludeMessageText"));

        //throws exception when not found
        final SubscribedBoard board = mFreetalk.getMessageManager().getSubscription(mFreetalk.getIdentityManager().getOwnIdentity(ownIdentityID), boardName);

        synchronized(board) {

          final BoardThreadLink threadLink = board.getThreadLink(threadID);
            final Iterable<BoardReplyLink> messageRefList;
            final Message thread = mFreetalk.getMessageManager().get(threadID); // throws exception when not found
            {
                // send thread root message
                sendSingleMessage(replysender, thread, threadLink.getIndex(), includeMessageText);
            }

            messageRefList = board.getAllThreadReplies(thread.getID(), sortByMessageDateAscending);

            // send all messages of thread
            for(final BoardMessageLink reference : messageRefList) {
              try {
                final Message msg = reference.getMessage();
View Full Code Here

        }

        final boolean includeMessageText = Boolean.parseBoolean(params.get("IncludeMessageText"));

        //throws exception when not found
        final SubscribedBoard board = mFreetalk.getMessageManager().getSubscription(mFreetalk.getIdentityManager().getOwnIdentity(ownIdentityID), boardName);
       
        final BoardMessageLink reference = board.getMessageByIndex(messageIndex); // throws exception when not found
       
        final Message message = reference.getMessage()// throws MessageNotFetchedException

        sendSingleMessage(replysender, message, messageIndex, includeMessageText);
    }
View Full Code Here

      printStatusLine("480 Authentification required");
      return;
    }
        try {
          final String boardName = FreetalkNNTPGroup.groupToBoardName(name);
          final SubscribedBoard board = mMessageManager.getSubscription(mAuthenticatedUser, boardName);
            mCurrentGroup = new FreetalkNNTPGroup(board);
            synchronized (board) {
                mCurrentMessageNum = mCurrentGroup.firstMessage();
                printStatusLine("211 " + mCurrentGroup.messageCount()
                        + " " + mCurrentGroup.firstMessage()
View Full Code Here

        }

        if (name != null) {
            try {
              final String boardName = FreetalkNNTPGroup.groupToBoardName(name);
              final SubscribedBoard board = mMessageManager.getSubscription(mAuthenticatedUser, boardName);
                mCurrentGroup = new FreetalkNNTPGroup(board);
            }
            catch (NoSuchBoardException e) {
                printStatusLine("411 No such group");
                return;
View Full Code Here

       
        final String fullBoardName = boardLanguage + "." + boardName;
       
        mFreetalk.getMessageManager().getOrCreateBoard(fullBoardName);
       
        SubscribedBoard subscribedBoard = mFreetalk.getMessageManager().subscribeToBoard(mOwnIdentity, fullBoardName);
       
        HTMLNode successBox = addContentBox(l10n().getString("NewBoardPage.CreateBoardSuccess.Header"));
              l10n().addL10nSubstitution(
                      successBox.addChild("div"),
                      "NewBoardPage.CreateBoardSuccess.Text",
                      new String[] { "link", "boardname" },
                      new HTMLNode[] {
                        HTMLNode.link(BoardPage.getURI(subscribedBoard)),
                        HTMLNode.text(subscribedBoard.getName()) }
                      );


        makeNewBoardPage(boardLanguage, "");
      } catch (Exception e) {
View Full Code Here

   
      try {
        MessageManager messageManager = mFreetalk.getMessageManager();
       
        if(subscribe) {
          SubscribedBoard board = messageManager.subscribeToBoard(mOwnIdentity, boardName);

          HTMLNode successBox = addContentBox(l10n().getString("SelectBoardsPage.SubscriptionSucceededBox.Header"));
                  l10n().addL10nSubstitution(
                          successBox.addChild("div"),
                          "SelectBoardsPage.SubscriptionSucceededBox.Text",
                          new String[] { "link", "boardname" },
                          new HTMLNode[] { HTMLNode.link(BoardPage.getURI(board)), HTMLNode.text(board.getName()) });
        }
        else if(unsubscribe) {
          messageManager.unsubscribeFromBoard(mOwnIdentity, boardName);
         
                    HTMLNode successBox = addContentBox(l10n().getString("SelectBoardsPage.UnsubscriptionSucceededBox.Header"));
View Full Code Here

        HTMLNode subscribeCell = row.addChild("td", new String[] { "align" }, new String[] { "center" });
        HTMLNode unsubscribeCell = row.addChild("td", new String[] { "align" }, new String[] { "center" });
       
        try {
          SubscribedBoard subscribedBoard = messageManager.getSubscription(mOwnIdentity, board.getName());
         
          // We are subscribed to that board so we can display some more information.
         
          nameCell.addChild(new HTMLNode("a", "href", BoardPage.getURI(board), board.getName()));
         
          try {
            latestMessageCell.addChild("#", dateFormat.format(subscribedBoard.getLatestMessage().getMessageDate()));
          } catch(NoSuchMessageException e) {
            latestMessageCell.addChild("#", "-");
          }
         
          messageCountCell.addChild("#", Integer.toString(subscribedBoard.messageCount()));
         
          HTMLNode unsubscribeForm = addFormChild(unsubscribeCell, Freetalk.PLUGIN_URI + "/SelectBoards" + "#" + board.getName(), "Unsubscribe");
          unsubscribeForm.addChild("input", new String[] {"type", "name", "value"}, new String[] { "hidden", "OwnIdentityID", mOwnIdentity.getID()});
          unsubscribeForm.addChild("input", new String[] {"type", "name", "value"}, new String[] { "hidden", "BoardName", board.getName()});
          if(languageFiltered) unsubscribeForm.addChild("input", new String[] {"type", "name", "value"}, new String[] { "hidden", "BoardLanguage", languageFilter});
View Full Code Here

TOP

Related Classes of plugins.Freetalk.SubscribedBoard

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.