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.cms.workflow; 017 018import java.util.List; 019import java.util.Map; 020 021import org.ametys.plugins.workflow.component.AmetysObjectCurrentStepCondition; 022import org.ametys.runtime.i18n.I18nizableText; 023 024/** 025 * OSWorkflow condition to test the current step of a content 026 * The following configuration have to be used:<br> 027 * <pre> 028 * <condition type="avalon"> 029 * <arg name="role">org.ametys.cms.workflow.ContentCurrentStepCondition</arg> 030 * <arg name="step">2</arg> 031 * </condition> 032 * </pre> 033 * <br> 034 * @deprecated use {@link AmetysObjectCurrentStepCondition} instead with additional argument: <arg name="object-key">org.ametys.cms.repository.Content</arg> 035 */ 036@Deprecated 037public class ContentCurrentStepCondition extends AmetysObjectCurrentStepCondition 038{ 039 @Override 040 protected Object _getAmetysObjectKey(Map args) 041 { 042 return AbstractContentWorkflowComponent.CONTENT_KEY; 043 } 044 045 @Override 046 public I18nizableText getLabel() 047 { 048 return new I18nizableText("plugin.cms", "PLUGINS_CMS_CONTENT_CURRENT_STEP_CONDITION_LABEL"); 049 } 050 051 @Override 052 public I18nizableText getFullLabel(Map<String, String> argumentsValues) 053 { 054 String stepId = argumentsValues.get("step"); 055 return new I18nizableText("plugin.cms", "PLUGINS_CMS_CONTENT_CURRENT_STEP_CONDITION_DESCRIPTION", List.of(stepId)); 056 } 057}