Skip to content
Permalink
Browse files

Merge pull request #39 from jglick/ArgumentsColumn-JENKINS-37324

[JENKINS-37324] Add an ArgumentsColumn to the FlowGraphTable display
  • Loading branch information...
abayer committed Aug 1, 2017
2 parents 1074bea + 0440e40 commit 6515ef81f3a67cdfb0822206299d5a6f4cb2e7fc
12 pom.xml
@@ -65,17 +65,19 @@
<jenkins.version>1.642.3</jenkins.version>
<no-test-jar>false</no-test-jar>
<git-plugin.version>3.0.5</git-plugin.version>
<workflow-scm-step-plugin.version>2.4</workflow-scm-step-plugin.version>
<workflow-step-api-plugin.version>2.10</workflow-step-api-plugin.version>
</properties>
<dependencies>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-step-api</artifactId>
<version>2.9</version>
<version>${workflow-step-api-plugin.version}</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-api</artifactId>
<version>2.11</version>
<version>2.15</version>
<exclusions>
<exclusion>
<groupId>org.jenkins-ci.plugins</groupId>
@@ -96,7 +98,7 @@
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-step-api</artifactId>
<version>2.9</version>
<version>${workflow-step-api-plugin.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
@@ -133,7 +135,7 @@
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-scm-step</artifactId>
<version>2.3</version>
<version>${workflow-scm-step-plugin.version}</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -170,7 +172,7 @@
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-scm-step</artifactId>
<version>2.4</version>
<version>${workflow-scm-step-plugin.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
@@ -0,0 +1,58 @@
/*
* The MIT License
*
* Copyright 2017 CloudBees, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

package org.jenkinsci.plugins.workflow.support.visualization.table;

import hudson.Extension;
import org.jenkinsci.plugins.workflow.actions.ArgumentsAction;
import org.jenkinsci.plugins.workflow.graph.FlowNode;
import org.jenkinsci.plugins.workflow.visualization.table.FlowNodeViewColumn;
import org.jenkinsci.plugins.workflow.visualization.table.FlowNodeViewColumnDescriptor;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;
import org.kohsuke.stapler.DataBoundConstructor;

@Restricted(NoExternalUse.class)
public class ArgumentsColumn extends FlowNodeViewColumn {

@DataBoundConstructor public ArgumentsColumn() {}

public String get(FlowNode node) {
return ArgumentsAction.getStepArgumentsAsString(node);
}

@Extension public static class DescriptorImpl extends FlowNodeViewColumnDescriptor {

@Override public String getDisplayName() {
return "Arguments";
}

@SuppressWarnings("deprecation")
@Override public FlowNodeViewColumn getDefaultInstance() {
return new ArgumentsColumn();
}

}

}
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
The MIT License
Copyright 2017 CloudBees, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->

<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core">
<td>${column.get(node)}</td>
</j:jelly>

0 comments on commit 6515ef8

Please sign in to comment.
You can’t perform that action at this time.