001/*
002 *  Copyright 2017 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.odf;
017
018import org.ametys.odf.cdmfr.CDMEntity;
019import org.ametys.odf.program.Program;
020import org.ametys.plugins.repository.AmetysRepositoryException;
021
022/**
023 * This interface represent a ODF content which is part of a program
024 *
025 */
026public interface ProgramItem extends CDMEntity
027{
028    /** {@link Program} content type */
029    public static final String PROGRAM_ITEM_CONTENT_TYPE = "org.ametys.plugins.odf.Content.programItem";
030    
031    /** The attribute holding the catalog */
032    public static final String CATALOG = "catalog";
033    
034    /** The attribute holding the code */
035    public static final String CODE = "code";
036    
037    /** The attribute holding the publishable state */
038    public static final String PUBLISHABLE = "publishable";
039    
040    /** The attribute holding the repeater of educational booklets */
041    public static final String EDUCATIONAL_BOOKLETS = "educational-booklets";
042    
043    /**
044     * Get the catalog of this content
045     * @return the name of catalog or null if not set
046     */
047    public String getCatalog();
048    
049    /**
050     * Set the catalog
051     * @param name the name of catalog to set
052     * @throws AmetysRepositoryException if an error occurred
053     */
054    public void setCatalog(String name) throws AmetysRepositoryException;
055    
056    /**
057     * Get the CDM-fr of the {@link ProgramItem}
058     * @return the CDM-fr code
059     */
060    public String getCode();
061    
062    /**
063     * Set the CDM-fr code
064     * @param code the CDM-fr to set
065     * @throws AmetysRepositoryException if an error occurs
066     */
067    public void setCode(String code) throws AmetysRepositoryException;
068    
069    /**
070     * <code>true</code> if the {@link ProgramItem} is publishable
071     * @return <code>true</code> if the {@link ProgramItem} is publishable
072     */
073    public boolean isPublishable();
074    
075    /**
076     * Set publishable to <code>true</code> to make the {@link ProgramItem} publishable
077     * @param isPublishable <code>true</code> to make the {@link ProgramItem} publishable
078     */
079    public void setPublishable(boolean isPublishable);
080}