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    
035    /**
036     * Returns all pages referencing this Content.
037     * @return all pages referencing this Content.
038     * @throws AmetysRepositoryException if an error occurs.
039     */
040    public Collection<Page> getReferencingPages() throws AmetysRepositoryException;
041    
042    /**
043     * Returns all zone items referencing this Content.
044     * @return all zone items referencing this Content.
045     * @throws AmetysRepositoryException if an error occurs.
046     */
047    public Collection<ZoneItem> getReferencingZoneItems() throws AmetysRepositoryException;
048    
049    /**
050     * Retrieves the attachments root node
051     * @return The attachments root node, or null if the content is working on
052     * an (unmodifiable) old version and the attachments root is missing.
053     * @throws AmetysRepositoryException if an error occurs.
054     */
055    ResourceCollection getRootAttachments() throws AmetysRepositoryException;
056}