001/*
002 *  Copyright 2022 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.workflow.task;
017
018import org.apache.cocoon.xml.AttributesImpl;
019import org.xml.sax.SAXException;
020
021import org.ametys.cms.workflow.TasksGenerator;
022import org.ametys.cms.workflow.WorkflowTasksComponent.Task;
023
024/**
025 * Generate the task lists with the changed values 
026 */
027public class TasksWithChangesGenerator extends TasksGenerator
028{
029    @Override
030    protected void _saxAdditionalAttributes(Task task, AttributesImpl attrs) throws SAXException
031    {
032        super._saxAdditionalAttributes(task, attrs);
033        
034        if (((AbstractOdfWorkflowTasksWithChangesComponent) _tasksManager).showChanges(task))
035        {
036            attrs.addCDATAAttribute("showChanges", "true");
037        }
038        if (((AbstractOdfWorkflowTasksWithChangesComponent) _tasksManager).showImportantChanges(task))
039        {
040            attrs.addCDATAAttribute("showImportantChanges", "true");
041        }
042    }
043
044}