<%@ page import="java.text.*, java.util.*, com.jivesoftware.base.*, com.jivesoftware.forum.*, com.artima.website.*, com.artima.jivecoupled.skins.announce.DraftsPage, com.artima.jivecoupled.*" errorPage="../error.jsp" %> <% DraftsPage.Context context = DraftsPage.process(request, response, session, out); if (context.isRedirected()) { return; } boolean adminIsUser = context.isAdminIsUser(); Client clientForUser = context.getClientForUser(); ColorStyle colorStyle = context.getColorStyle(); boolean allTopics = context.isAllTopics(); String topic = context.getTopic(); ForumFactory forumFactory = context.getForumFactory(); int start = context.getStart(); int range = context.getRange(); User pageUser = context.getPageUser(); String dontLinkToThisPage = ""; boolean isGuest = false; %> Artima Pavilion Draft Announcements
The Artima Developer Community

Artima Pavilion Announcements
<% if (!adminIsUser) { %> Draft Announcements for <%= clientForUser.getVendor().getName() %>
<% } else { %> All Draft Announcements
<% } %>

<% if (!adminIsUser) { %> <%= com.artima.jivecoupled.Vendor.buildVendorLogoAndShortDesc(clientForUser.getVendor().getHandle()) %> <% } else { %> <% } %>
 
Post New Announcement
 
View Your Announcements
 
Post New Announcement
 
View All Announcements
 
Topics
<% if (allTopics) { %> All Topics
<% } else { %> All Topics
<% } %> <% String topicBeingDisplayed = ""; if (!allTopics) { topicBeingDisplayed = topic; } List topics = Topic.getTopicsForForum(ArtimaConstants.PAVILION_ANNOUNCEMENTS_FORUM); for (Iterator it = topics.iterator(); it.hasNext();) { Topic theTopic = (Topic) it.next(); String topicHandle = theTopic.getHandle(); String topicName = theTopic.getName(); if (topicBeingDisplayed.equals(topicHandle)) { %> <%= topicName %>
<% } else { %> <%= topicName %>
<% } } %>
<% if (!allTopics) { %>
Click to go back to all announcements ">   Back to All Draft Announcements

<% } %> <% // Load the forum Forum coolStuff = forumFactory.getForum(ArtimaConstants.PAVILION_ANNOUNCEMENTS_FORUM); // Create a ResultFilter for creating thread iterators and getting thread // counts ResultFilter filter = ResultFilter.createDefaultThreadFilter(); filter.setStartIndex(start); filter.setNumResults(range); if (!allTopics) { filter.addProperty(ArtimaConstants.TOPIC_PROPERTY_PREFIX + topic, "true"); } filter.setSortField(JiveConstants.CREATION_DATE); // This makes the result come back in order of thread creation, not modification filter.setSortOrder(ResultFilter.DESCENDING); if (!adminIsUser) { filter.addProperty(ArtimaConstants.CLIENT, clientForUser.getHandle()); } filter.setModerationRangeMin(0); filter.setModerationRangeMax(0); // More forum properties int numThreads = coolStuff.getThreadCount(filter); int numMessages = coolStuff.getMessageCount(filter); // Iterator of threads ForumThreadIterator threads = coolStuff.getThreads(filter); // Number of int numPages = 0; if (numThreads != range) { numPages = (int)Math.ceil((double)numThreads/(double)range); } else { numPages = 1; } String urlParameters = null; if (topic != null) { urlParameters = "topic=" + topic; } String paginatorHTML = Paginators.getPaginator(urlParameters, "drafts", numThreads, numPages, start, range); boolean noPostsForThisUser = false; if (!allTopics && !threads.hasNext()) { noPostsForThisUser = true; } %>
<% if (!allTopics) { %> Draft Announcements about <%= Topic.getNameForHandle(ArtimaConstants.PAVILION_ANNOUNCEMENTS_FORUM, topic) %> <% } else { %> All Draft Announcements <% } %> "> <%= paginatorHTML %>
<% while (threads.hasNext()) { ForumThread thread = (ForumThread)threads.next(); long threadID = thread.getID(); ForumMessage rootMessage = thread.getRootMessage(); String subject = rootMessage.getSubject(); User author = rootMessage.getUser(); DateFormat dateFormat = ArtimaConstants.MONTH_DAY_YEAR_FORMAT; String monthYearPubDateForm = rootMessage.getProperty(ArtimaConstants.MONTH_YEAR_PUBDATE_FORM); if (monthYearPubDateForm != null) { dateFormat = ArtimaConstants.MONTH_YEAR_FORMAT; } String creationDate = dateFormat.format(rootMessage.getCreationDate()); String lastUpdate = dateFormat.format(thread.getModificationDate()); String username = "Guest"; if (!rootMessage.isAnonymous()) { username = author.getName(); if (username == null || username.equals("null")) { username = author.getUsername(); } } // Number of topics, messages in this forum int numThreadMessages = thread.getMessageCount(); int numReplies = numThreadMessages - 1; // For a while, there will be posts in which the summary is embedded // in the body. String summary = StringCleaner.extractSummaryFromBody(rootMessage.getBody()); // New posts will have the summary as an extended property... if (summary.length() == 0) { summary = rootMessage.getProperty(ArtimaConstants.SUMMARY); } String itemsVendorHandle = thread.getProperty(ArtimaConstants.VENDOR); Vendor itemsVendor = Vendor.getVendor(itemsVendorHandle); String threadVendorName = itemsVendor.getName(); ColorStyle threadColorStyle = ColorStyle.SAFE_DARK_GRAY_SAFE_LIGHT_YELLOW; String pendingPayment = thread.getProperty(ArtimaConstants.CLIENT_PENDING_PAYMENT); if (pendingPayment != null && pendingPayment.equals(ArtimaConstants.FINAL_POST)) { threadColorStyle = ColorStyle.SAFE_DARK_GRAY_LIGHTPINK; } %> <% } %>
>
<%= subject %>
from <%= threadVendorName %>, <%= creationDate %>
<%= summary %>
View
Edit
Delete
"> <%= paginatorHTML %>
<% if (clientForUser != null && clientForUser.isPendingPayment()) { %>

Note: Announcements with titles shown in a pink background have been marked final. These announcements will go live once payment has been received. <% } %>

<% LoginBox.outputLoginBox(out, isGuest, dontLinkToThisPage, pageUser, colorStyle, "/announce/drafts.jsp", "/announce/"); %>

Google
  Web Artima.com   
Copyright © 1996-2006 Artima Software, Inc. All Rights Reserved.
Trouble with this page? Contact: webmaster@artima.com