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