| Class | Line # | Actions | |||||
|---|---|---|---|---|---|---|---|
| BlogVisibilityUpdater | 56 | 0 | - | 0 | 0 |
| 1 | /* | |
| 2 | * See the NOTICE file distributed with this work for additional | |
| 3 | * information regarding copyright ownership. | |
| 4 | * | |
| 5 | * This is free software; you can redistribute it and/or modify it | |
| 6 | * under the terms of the GNU Lesser General Public License as | |
| 7 | * published by the Free Software Foundation; either version 2.1 of | |
| 8 | * the License, or (at your option) any later version. | |
| 9 | * | |
| 10 | * This software is distributed in the hope that it will be useful, | |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | * Lesser General Public License for more details. | |
| 14 | * | |
| 15 | * You should have received a copy of the GNU Lesser General Public | |
| 16 | * License along with this software; if not, write to the Free | |
| 17 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |
| 18 | * 02110-1301 USA, or see the FSF site: http://www.fsf.org. | |
| 19 | */ | |
| 20 | package org.xwiki.platform.blog; | |
| 21 | ||
| 22 | import org.xwiki.component.annotation.Role; | |
| 23 | import org.xwiki.stability.Unstable; | |
| 24 | ||
| 25 | import com.xpn.xwiki.doc.XWikiDocument; | |
| 26 | ||
| 27 | /** | |
| 28 | * Component that set the "hidden" flag of a document according to its blog post values. | |
| 29 | * | |
| 30 | * The Blog Application offers the ability to hide from the visitors some articles that are being written. When a blog | |
| 31 | * post is not "published" or "hidden", it is not listed on the blog pages. However, the visitor can still find the | |
| 32 | * article using the Search Engine or the breadcrumb. This is usually not what the writer expects. | |
| 33 | * | |
| 34 | * So we have decided to synchronize the "hidden" field of the document with the values of the object. | |
| 35 | * | |
| 36 | * Note: according to the blog workflow, a post cannot be "unpublished" and "hidden" in the same time. The workflow is: | |
| 37 | * "unpublished" (draft) -> "published" -> "hidden". | |
| 38 | * | |
| 39 | * For some reason, we cannot go back from "published" to "unpublished", and that is why the "hidden" field has been | |
| 40 | * introduced in the BlogPostClass. | |
| 41 | * | |
| 42 | * In the future we could also remove the "published" and the "hidden" boolean to replace them with a "status" field, | |
| 43 | * which would be more accurate to represent the blog workflow. | |
| 44 | * | |
| 45 | * TODO: decide if we should change the page's rights as well, ie. giving 'view' right only to the blog author or to a | |
| 46 | * "blog authors" group. | |
| 47 | * | |
| 48 | * @version $Id: 5a68b2bc9e5eb6d03501e1836dc1776bcce90a2b $ | |
| 49 | * | |
| 50 | * @since 9.0RC1 | |
| 51 | * @since 8.4.3 | |
| 52 | * @since 7.4.6 | |
| 53 | */ | |
| 54 | @Role | |
| 55 | @Unstable | |
| 56 | public interface BlogVisibilityUpdater | |
| 57 | { | |
| 58 | /** | |
| 59 | * Set the "hidden" flag of the document (without saving it) according to the values of the blog post. | |
| 60 | * @param document the document to modify | |
| 61 | */ | |
| 62 | void synchronizeHiddenMetadata(XWikiDocument document); | |
| 63 | } |