001/*
002 *  Copyright 2022 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.page;
017
018import org.ametys.plugins.repository.AmetysObjectIterable;
019import org.ametys.plugins.repository.AmetysRepositoryException;
020import org.ametys.plugins.repository.ModifiableTraversableAmetysObject;
021import org.ametys.plugins.repository.data.holder.ModifiableModelAwareDataHolder;
022
023/**
024 * Sitemap element that can be modified
025 */
026public interface ModifiableSitemapElement extends SitemapElement, ModifiableTraversableAmetysObject
027{
028    /**
029     * Retrieves the zones.
030     * @return the zones.
031     * @throws AmetysRepositoryException if an error occurs.
032     */
033    @Override
034    AmetysObjectIterable<ModifiableZone> getZones() throws AmetysRepositoryException;
035
036    /**
037     * Retrieves a given zone.
038     * @param name the name of the zone.
039     * @return the given zone.
040     * @throws UnknownZoneException if there is no zone for the given name.
041     * @throws AmetysRepositoryException if an error occurs.
042     */
043    @Override
044    ModifiableZone getZone(String name) throws UnknownZoneException, AmetysRepositoryException;
045
046    /**
047     * Creates a given zone.<br> 
048     * @param name the name of the zone.
049     * @return the given zone.
050     * @throws AmetysRepositoryException if an error occurs.
051     */
052    ModifiableZone createZone(String name) throws AmetysRepositoryException;
053
054    /**
055     * Get the view parameters
056     * @return the view parameters
057     * @throws AmetysRepositoryException if an error occurs.
058     */
059    @Override
060    ModifiableModelAwareDataHolder getTemplateParametersHolder() throws AmetysRepositoryException;
061}