forum.java
来自「Jive是基于JSP/JAVA技术构架的一个大型BBS论坛系统,这是Jive论坛」· Java 代码 · 共 498 行 · 第 1/2 页
JAVA
498 行
* arbitrary number of extended properties. This allows for enhanced * functionality that is not part of the base interface. * * @param name the name of the property to get. * @return the value of the property specified by <tt>name</tt>. */ public String getProperty(String name); /** * Sets an extended property of the forum. Each forum can have an * arbitrary number of extended properties. This allows for enhanced * functionality that is not part of the base interface.<p> * * If the property referenced by <code>name</code> already exists, its * value will be updated. * * @param name the name of the property to set. * @param value the new value for the property. * @throws UnauthorizedException if does not have ADMIN permissions. */ public void setProperty(String name, String value) throws UnauthorizedException; /** * Deletes an extended property. If the property specified by * <code>name</code> does not exist, this method will do nothing. * * @param name the name of the property to delete. * @throws UnauthorizedException if does not have ADMIN permissions. */ public void deleteProperty(String name) throws UnauthorizedException; /** * Returns an Iterator for the names of the forum properties. * * @return an Iterator for the names of the forum properties. */ public Iterator propertyNames(); /** * Returns the forum category that this forum belongs to. * * @return the forum category that this forum belongs to. */ public ForumCategory getForumCategory(); /** * Returns the thread specified by id. The method will return null * if the thread is not in the forum. * * @param threadID the id of the thread to get. * @return the ForumThread corresponding to <code>threadID</code> * @throws ForumThreadNotFoundException if the specified thread cannot be * loaded. */ public ForumThread getThread(long threadID) throws ForumThreadNotFoundException; /** * Adds a thread to the forum. * * @param thread the thread to add to the forum. * @throws UnauthorizedException if does not have CREATE_THREAD permissions. */ public void addThread(ForumThread thread) throws UnauthorizedException; /** * Deletes a thread and all of its messages. Once a thread is * deleted, the thread object should no longer be used. The search index and * other resources that referenced the thread and its messages will also be * updated appropriately. * * @param thread the thread to delete. * @throws UnauthorizedException if not an admin or moderator. */ public void deleteThread(ForumThread thread) throws UnauthorizedException; /** * Moves a thread from one forum to another. For this to work, the thread * must exist in the forum that this method is invoked on, and the user * calling this method must have admin or moderator permissions for the * forum this method is invoked on and <code>newForum</code>.<p> * * The main purpose of this method is to allow admins to move non-topical * threads into a more appropriate forum. * * @param thread the thread to move to another forum. * @param newForum the forum to move the thread to. * @throws UnauthorizedException if does not have admin or moderator * permissions for this forum and <code>newForum</code>. * @throws IllegalArgumentException if <code>thread</code> does not belong * to the forum that this method was invoked on. */ public void moveThread(ForumThread thread, Forum newForum) throws UnauthorizedException, IllegalArgumentException; /** * Returns a Iterator for all the threads in the forum. Threads will be * sorted on their modified date. * * @return an Iterator for the threads in the forum. */ public ForumThreadIterator threads(); /** * Returns a Iterator for all the threads in the forum that match the * criteria specified by the ResultFilter. * * @param resultFilter a ResultFilter object to perform filtering and * sorting with. * @return an Iterator for the threads in the forum that match the * ResultFilter. */ public ForumThreadIterator threads(ResultFilter resultFilter); /** * Returns an Iterator for the most popular threads in the forum. Popular * threads are defined as those that have the most new messages over a * period of time (e.g. the last 24 hours). When two threads have * identical numbers of new messages, newer threads will be ordered first.<p> * * A number of configurable Jive properties control how the popular threads * feature works:<ul> * <li> <code>popularThreads.numThreads</code> -- The number of * messages that will be returned in the list of popular threads. * Default is 4 threads. * <li> <code>popularThreads.timeWindow</code> -- The number of hours * to consider new messages in a thread from. Default is 24 hours, * which is suitable for sites with moderate to high amounts of * traffic. Sites with less traffic may wish to set the window * to a number of days. </ul> * * @return an Iterator for the most popular threads in the forum. */ public Iterator popularThreads(); /** * Returns an Iterator for all the messages in the forum. * * @return an Iterator for the messages in the forum. */ public Iterator messages(); /** * Returns a Iterator for all the messages in the forum that match the * criteria specified by the ResultFilter. * * @param resultFilter a ResultFilter object to perform filtering and * sorting with. * @return an Iterator for the messages in the forum that match the * ResultFilter. */ public Iterator messages(ResultFilter resultFilter); /** * Returns the number of threads in the forum. * * @return the number of threads in the forum. */ public int getThreadCount(); /** * Returns the number of threads in the forum based on the specified * ResultFilter. This is useful for determining such things as the number * of threads in a date range, etc. * * @param resultFilter a resultFilter to limit the query on. * @return the number of threads in the forum based on the filter. */ public int getThreadCount(ResultFilter resultFilter); /** * Returns the number of messages in the forum. * * @return the number of messages in the forum. */ public int getMessageCount(); /** * Returns the number of messages in the forum based on the specified * ResultFilter. This is useful for determining such things as the number * of messages in a date range, etc. * * @param resultFilter a resultFilter to limit the query on. * @return the number of messages in the forum based on the filter. */ public int getMessageCount(ResultFilter resultFilter); /** * Creates a query object to search the forum. * * @return a Query object that can be used to search the forum. */ public Query createQuery(); /** * Returns a filter manager that can be used to manage the filters for this * forum. Filter management is only for forum or system admins, excluding * the {@link FilterManager#applyFilters(ForumMessage)} method, which may * be useful to skin writers. * * @return a FilterManager to manage the filters for this forum. */ public FilterManager getFilterManager(); /** * Returns a gateway manager that can be used to manage the gateways for * this forum. Only system or forum admins can perform this function. * * @return a GatewayManager to manage the gateways for this forum. * @throws UnauthorizedException if not an admin. */ public GatewayManager getGatewayManager() throws UnauthorizedException; /** * Returns a permissions manager that can be used to set permissions for * this forum. Only admins can perform this function. * * @return a PermissionsManager to manage the permissions on this forum. * @throws UnauthorizedException is not an admin. */ public PermissionsManager getPermissionsManager() throws UnauthorizedException; /** * Returns the permissions for the forum that correspond to the * passed-in Authorization. This method is not generally useful to skin * writers. Instead, the hasPermission(int) method should be used for * permission checking. * * @param authorization the auth token to lookup permissions for. */ public abstract ForumPermissions getPermissions(Authorization authorization); /** * Returns true if the handle on the object has the permission specified. * For example, if a forum administrator has a handle on this object, then * calling hasPermission(ForumPermissions.FORUM_ADMIN) would return true.<p> * * A list of possible permissions can be found in the ForumPermissions * class. Certain methods of this class are restricted to certain * permissions as specified in the method comments. * * @param type a permission type from the ForumPermissions class. * @return true if the handle on the object has the specified permission. * @see ForumPermissions */ public boolean hasPermission(int type);}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?