001/*
002 *  Copyright 2010 Anyware Services
003 *
004 *  Licensed under the Apache License, Version 2.0 (the "License");
005 *  you may not use this file except in compliance with the License.
006 *  You may obtain a copy of the License at
007 *
008 *      http://www.apache.org/licenses/LICENSE-2.0
009 *
010 *  Unless required by applicable law or agreed to in writing, software
011 *  distributed under the License is distributed on an "AS IS" BASIS,
012 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 *  See the License for the specific language governing permissions and
014 *  limitations under the License.
015 */
016package org.ametys.web.repository.content;
017
018import java.util.Collection;
019
020import org.ametys.cms.repository.Content;
021import org.ametys.plugins.explorer.resources.ResourceCollection;
022import org.ametys.plugins.repository.AmetysRepositoryException;
023import org.ametys.plugins.repository.TraversableAmetysObject;
024import org.ametys.web.repository.SiteAwareAmetysObject;
025import org.ametys.web.repository.page.Page;
026import org.ametys.web.repository.page.ZoneItem;
027
028/**
029 * {@link Content} with additional data related to Web Content Management.<br>
030 * A WebContent is aware of its Site, of its referencing Pages
031 */
032public interface WebContent extends Content, TraversableAmetysObject, SiteAwareAmetysObject
033{
034    /** Constants for privacy level property. */
035    public static final String PROPERTY_PRIVACY = "privacy";
036    
037    /**
038     * Returns all pages referencing this Content.
039     * @return all pages referencing this Content.
040     * @throws AmetysRepositoryException if an error occurs.
041     */
042    public Collection<Page> getReferencingPages() throws AmetysRepositoryException;
043    
044    /**
045     * Returns all zone items referencing this Content.
046     * @return all zone items referencing this Content.
047     * @throws AmetysRepositoryException if an error occurs.
048     */
049    public Collection<ZoneItem> getReferencingZoneItems() throws AmetysRepositoryException;
050    
051    /**
052     * Retrieves the attachments root node
053     * @return The attachments root node, or null if the content is working on
054     * an (unmodifiable) old version and the attachments root is missing.
055     * @throws AmetysRepositoryException if an error occurs.
056     */
057    ResourceCollection getRootAttachments() throws AmetysRepositoryException;
058    
059    /**
060     * Retrieves the content's privacy level
061     * @return the content's privacy level
062     */
063    public String getPrivacyLevel();
064}