Skip to content

Commit

Permalink
#277 Correction of the Jenkins plug-in
Browse files Browse the repository at this point in the history
  • Loading branch information
dcoraboeuf committed Nov 8, 2013
1 parent dad85ab commit c648544
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public String getPropertyValue(Entity entity, int entityId, String extension, St
return get(
getDefaultLocale(),
format(
"/%s/%d/%s/%s",
"/ui/property/%s/%d/%s/%s",
entity.name(),
entityId,
extension,
Expand Down
2 changes: 1 addition & 1 deletion ontrack-jenkins/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>1.511</version>
<version>1.534</version>
<!-- which version of Jenkins is this plugin built against? -->
</parent>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package org.jenkinsci.plugins.ontrack;

import hudson.Extension;
import hudson.model.BuildListener;
import hudson.tasks.BuildStepDescriptor;
import net.ontrack.client.ManageUIClient;
import net.ontrack.client.PropertyUIClient;
import net.ontrack.client.support.ManageClientCall;
Expand All @@ -15,7 +17,7 @@
import hudson.model.*;

import java.io.IOException;
public class OntrackPropertyValue extends Builder {
public class OntrackBuildPropertyValue extends Builder {
private final String project;
private final String branch;
private final String promotionLevel;
Expand All @@ -26,8 +28,8 @@ public class OntrackPropertyValue extends Builder {
private final boolean failOnBlank;

@DataBoundConstructor
public OntrackPropertyValue(String project, String branch, String variable, String promotionLevel,
String extension, String name, String buildName, boolean failOnBlank) {
public OntrackBuildPropertyValue(String project, String branch, String variable, String promotionLevel,
String extension, String name, String buildName, boolean failOnBlank) {
this.project = project;
this.branch = branch;
this.promotionLevel = promotionLevel;
Expand Down Expand Up @@ -116,4 +118,19 @@ public String getBuildName() {
public boolean isFailOnBlank() {
return failOnBlank;
}

@Extension
public static class OntrackBuildPropertyValueDescription extends BuildStepDescriptor<Builder> {


@Override
public boolean isApplicable(Class<? extends AbstractProject> jobType) {
return true;
}

@Override
public String getDisplayName() {
return "Ontrack: Get build property value";
}
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<p
<f:entry title="Project" field="project">
<f:entry title="Project" field="project">
<f:textbox />
</f:entry>
<f:entry title="Branch" field="branch">
<f:textbox />
</f:entry>
<f:entry title="Validation stamp" field="promotionLevel">
<f:entry title="Promotion level" field="promotionLevel">
<f:textbox />
</f:entry>
<f:entry title="Build name" field="buildName">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,9 @@ public EditableProperty apply(PropertyExtensionDescriptor descriptor) {

@Override
@RequestMapping(value = "/{entity}/{entityId:\\d+}/{extension}/{name}", method = RequestMethod.GET)
public String getPropertyValue(@PathVariable Entity entity, @PathVariable int entityId, @PathVariable String extension, @PathVariable String name) {
public
@ResponseBody
String getPropertyValue(@PathVariable Entity entity, @PathVariable int entityId, @PathVariable String extension, @PathVariable String name) {
return propertiesService.getPropertyValue(entity, entityId, extension, name);
}

Expand Down

0 comments on commit c648544

Please sign in to comment.