Class PluginTaskViewConverter
- All Implemented Interfaces:
TaskViewConverter<com.xebialabs.xlrelease.domain.PluginTask>,PlanItemConverter
CustomScriptTaskViewConverter.
Why this reuses scriptDefinitionType
Every plugin task has task type xlrelease.PluginTask, so the view has to carry the
configuration type separately or the UI cannot tell an acme.Deploy from an
acme.TriggerBuild. TaskFullView already has exactly one field for "the definition
type to render this task by, which differs from type": scriptDefinitionType.
Reusing it was checked against the frontend rather than assumed. The field is never used as a
"this is a Jython task" discriminator: task.helper.ts's hasScriptDefinition(task) is a
presence check on the field itself, and getTaskDefinition uses it to mean "look the
definition up by this instead of by task.type" - which is precisely what a plugin task needs.
Consequently plugin tasks render with their own display name, icon and properties with no
frontend change and no new REST field. The name is historical; the semantics are not
script-specific.
-
Constructor Summary
ConstructorsConstructorDescriptionPluginTaskViewConverter(com.xebialabs.xlrelease.repository.ConfigurationRepository configurationRepository) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidfillVariableMappings(TaskFullView view, com.xebialabs.xlrelease.domain.PluginTask task) protected com.xebialabs.xlrelease.domain.PluginTaskfromView(TaskFullView view) protected Class<com.xebialabs.xlrelease.domain.PluginTask> toFullView(com.xebialabs.xlrelease.domain.PluginTask task, List<com.xebialabs.deployit.plugin.api.reflect.Type> allowedTaskTypesForAuthenticatedUser) Methods inherited from class com.xebialabs.xlrelease.views.converters.BaseTaskViewConverter
getTaskType, setUserViewConverter, toTaskMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.xebialabs.xlrelease.views.converters.PlanItemConverter
populatePlanItemView
-
Constructor Details
-
PluginTaskViewConverter
@Autowired public PluginTaskViewConverter(com.xebialabs.xlrelease.repository.ConfigurationRepository configurationRepository)
-
-
Method Details
-
getTaskClass
- Specified by:
getTaskClassin classBaseTaskViewConverter<com.xebialabs.xlrelease.domain.PluginTask>
-
toFullView
public TaskFullView toFullView(com.xebialabs.xlrelease.domain.PluginTask task, List<com.xebialabs.deployit.plugin.api.reflect.Type> allowedTaskTypesForAuthenticatedUser) - Specified by:
toFullViewin interfaceTaskViewConverter<com.xebialabs.xlrelease.domain.PluginTask>- Overrides:
toFullViewin classBaseTaskViewConverter<com.xebialabs.xlrelease.domain.PluginTask>
-
fromView
- Specified by:
fromViewin classBaseTaskViewConverter<com.xebialabs.xlrelease.domain.PluginTask>
-
fillVariableMappings
protected void fillVariableMappings(TaskFullView view, com.xebialabs.xlrelease.domain.PluginTask task) - Overrides:
fillVariableMappingsin classBaseTaskViewConverter<com.xebialabs.xlrelease.domain.PluginTask>
-