001/*
002 *  Copyright 2021 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.plugins.odfsync.utils;
017
018import org.ametys.odf.course.CourseFactory;
019import org.ametys.odf.courselist.CourseListFactory;
020import org.ametys.odf.coursepart.CoursePartFactory;
021import org.ametys.odf.orgunit.OrgUnitFactory;
022import org.ametys.odf.person.PersonFactory;
023import org.ametys.odf.program.ContainerFactory;
024import org.ametys.odf.program.ProgramFactory;
025import org.ametys.odf.program.SubProgramFactory;
026
027/**
028 * Object to describe content workflow elements.
029 */
030public enum ContentWorkflowDescription
031{
032    /** Program workflow description */
033    PROGRAM_WF_DESCRIPTION(ProgramFactory.PROGRAM_CONTENT_TYPE, "program", 1, 4),
034    /** Subprogram workflow description */
035    SUBPROGRAM_WF_DESCRIPTION(SubProgramFactory.SUBPROGRAM_CONTENT_TYPE, "subprogram", 1, 4),
036    /** Container workflow description */
037    CONTAINER_WF_DESCRIPTION(ContainerFactory.CONTAINER_CONTENT_TYPE, "container", 1, 4),
038    /** Course list workflow description */
039    COURSELIST_WF_DESCRIPTION(CourseListFactory.COURSE_LIST_CONTENT_TYPE, "courselist", 1, 4),
040    /** Course workflow description */
041    COURSE_WF_DESCRIPTION(CourseFactory.COURSE_CONTENT_TYPE, "course", 1, 4),
042    /** Course part workflow description */
043    COURSEPART_WF_DESCRIPTION(CoursePartFactory.COURSE_PART_CONTENT_TYPE, "course-part", 1, -1),
044    /** Orgunit workflow description */
045    ORGUNIT_WF_DESCRIPTION(OrgUnitFactory.ORGUNIT_CONTENT_TYPE, "orgunit", 1, 4),
046    /** Person workflow description */
047    PERSON_WF_DESCRIPTION(PersonFactory.PERSON_CONTENT_TYPE, "person", 1, 4);
048    
049    private String _contentType;
050    private String _workflowName;
051    private int _initialActionId;
052    private int _validationActionId;
053    
054    ContentWorkflowDescription(String contentType, String workflowName, int initialActionId, int validationActionId)
055    {
056        _contentType = contentType;
057        _workflowName = workflowName;
058        _initialActionId = initialActionId;
059        _validationActionId = validationActionId;
060    }
061    
062    /**
063     * Get the content type.
064     * @return the content type ID
065     */
066    public String getContentType()
067    {
068        return _contentType;
069    }
070    
071    /**
072     * Get the workflow name.
073     * @return the workflow name
074     */
075    public String getWorkflowName()
076    {
077        return _workflowName;
078    }
079    
080    /**
081     * Get the initial action ID.
082     * @return the initial action ID
083     */
084    public int getInitialActionId()
085    {
086        return _initialActionId;
087    }
088    
089    /**
090     * Get the validation action ID.
091     * @return the validation action ID
092     */
093    public int getValidationActionId()
094    {
095        return _validationActionId;
096    }
097}