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 */
016
017package org.ametys.web.repository.page;
018
019import org.ametys.plugins.repository.AmetysObject;
020import org.ametys.plugins.repository.AmetysRepositoryException;
021import org.ametys.plugins.repository.RemovableAmetysObject;
022import org.ametys.plugins.repository.data.ametysobject.ModifiableModelLessDataAwareAmetysObject;
023import org.ametys.plugins.repository.tag.TaggableAmetysObject;
024
025/**
026 * {@link AmetysObject} for storing page informations. <p>
027 */
028public interface ModifiablePage extends Page, ModifiableSitemapElement, ModifiableModelLessDataAwareAmetysObject, RemovableAmetysObject, TaggableAmetysObject
029{
030    /**
031     * Set the template name.
032     * @param template the template name.
033     * @throws AmetysRepositoryException if an error occurs.
034     */
035    void setTemplate(String template) throws AmetysRepositoryException;
036
037    /**
038     * Set the title.
039     * @param title the title.
040     * @throws AmetysRepositoryException if an error occurs.
041     */
042    void setTitle(String title) throws AmetysRepositoryException;
043    
044    /**
045     * Set the long title.
046     * @param title the title.
047     * @throws AmetysRepositoryException if an error occurs.
048     */
049    void setLongTitle(String title) throws AmetysRepositoryException;
050    
051    /**
052     * Set the sitemap name.
053     * @param sitemapName the sitemap name.
054     * @throws AmetysRepositoryException if an error occurs.
055     */
056    public void setSitemapName(String sitemapName) throws AmetysRepositoryException;
057
058    /**
059     * Set the site name.
060     * @param siteName the site name.
061     * @throws AmetysRepositoryException if an error occurs.
062     */
063    public void setSiteName(String siteName) throws AmetysRepositoryException;
064    
065    /**
066     * Set the type.<br>
067     * @param type the type.
068     * @throws AmetysRepositoryException if an error occurs.
069     * @see Page.PageType
070     */
071    void setType(PageType type) throws AmetysRepositoryException;
072
073    /**
074     * Set the linked URL.
075     * @param type the type of link
076     * @param url the linked URL (depending on the type)
077     * @throws AmetysRepositoryException if an error occurs.
078     */
079    void setURL(LinkType type, String url) throws AmetysRepositoryException;
080
081    /**
082     * Add a new {@link AmetysObject} referencing this page.
083     * @param ametysObjectId the {@link AmetysObject} ids referencing this page.
084     * @throws AmetysRepositoryException if an error occurs.
085     */
086    void addReferer(String ametysObjectId) throws AmetysRepositoryException;
087
088    /**
089     * Removes an {@link AmetysObject} referencing this page.
090     * @param ametysObjectId the {@link AmetysObject} ids referencing this page.
091     * @throws AmetysRepositoryException if an error occurs.
092     */
093    void removeReferer(String ametysObjectId) throws AmetysRepositoryException;
094    
095    /**
096     * Set the visibility of the page
097     * @param isVisible the page visibility.
098     * @throws AmetysRepositoryException if an error occurs.
099     */
100    void setVisible(boolean isVisible) throws AmetysRepositoryException;
101}