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