Skip to content

Commit

Permalink
[JENKINS-18280] Updated gui with checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfgarnet committed Aug 6, 2013
1 parent 846471e commit 9160fb0
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 3 deletions.
28 changes: 26 additions & 2 deletions src/main/java/net/praqma/hudson/scm/CCUCMScm.java
Expand Up @@ -79,6 +79,11 @@ public class CCUCMScm extends SCM {

private boolean forceDeliver;

/**
* Determines whether to remove the view private files or not
*/
private boolean removeViewPrivateFiles;

/* Old notifier fields */
private boolean recommend;
private boolean makeTag;
Expand All @@ -105,7 +110,7 @@ public CCUCMScm() {

@DataBoundConstructor
public CCUCMScm( String component, String levelToPoll, String loadModule, boolean newest, String polling, String stream, String treatUnstable,
boolean createBaseline, String nameTemplate, boolean forceDeliver, boolean recommend, boolean makeTag, boolean setDescription, String buildProject ) {
boolean createBaseline, String nameTemplate, boolean forceDeliver, boolean removeViewPrivateFiles, boolean recommend, boolean makeTag, boolean setDescription, String buildProject ) {

this.component = component;
this.loadModule = loadModule;
Expand All @@ -119,6 +124,8 @@ public CCUCMScm( String component, String levelToPoll, String loadModule, boolea
this.nameTemplate = nameTemplate;

this.forceDeliver = forceDeliver;
this.removeViewPrivateFiles = removeViewPrivateFiles;

this.recommend = recommend;
this.makeTag = makeTag;
this.setDescription = setDescription;
Expand Down Expand Up @@ -888,7 +895,11 @@ public boolean getForceDeliver() {
return forceDeliver;
}

public boolean isCreateBaseline() {
public boolean isRemoveViewPrivateFiles() {
return removeViewPrivateFiles;
}

public boolean isCreateBaseline() {
return this.createBaseline;
}

Expand Down Expand Up @@ -1040,5 +1051,18 @@ public List<String> getLoadModules() {
loadModules.add( "Modifiable" );
return loadModules;
}

public FormValidation doCheckMode( @QueryParameter String mode, @QueryParameter String checked ) throws IOException {
boolean isChecked = checked.equalsIgnoreCase( "true" );
if( isChecked ) {
if( mode.equals( "self" ) ) {
return FormValidation.warning( "You cannot create a baseline in self mode!" );
} else {
return FormValidation.ok();
}
} else {
return FormValidation.ok();
}
}
}
}
Expand Up @@ -39,7 +39,7 @@
<!-- unstable -->

<f:entry title="Create baseline" help="/plugin/clearcase-ucm-plugin/scm/help-createBaseline.html">
<f:checkbox name="CCUCM.createBaseline" checked="${scm.createBaseline}" />
<f:checkbox name="CCUCM.createBaseline" checked="${scm.createBaseline}" checkUrl="'${rootURL}/scm/CCUCMScm/checkMode?checked='+(this.checked)+'&amp;mode='+encodeURIComponent(Form.findMatchingInput(this,'CCUCM.polling').value)" />
</f:entry>

<f:entry title="Name template" help="/plugin/clearcase-ucm-plugin/scm/help-template.html" field="template">
Expand Down Expand Up @@ -73,6 +73,10 @@
<f:entry title="Force deliver" help="/plugin/clearcase-ucm-plugin/scm/help-forceDeliver.html">
<f:checkbox name="CCUCM.forceDeliver" checked="${scm.forceDeliver}" />
</f:entry>

<f:entry title="Remove view private files" help="/plugin/clearcase-ucm-plugin/scm/help-removeViewPrivateFiles.html">
<f:checkbox name="CCUCM.removeViewPrivateFiles" checked="${scm.removeViewPrivateFiles}" default="true"/>
</f:entry>

<f:entry title="Build project" help="/plugin/clearcase-ucm-plugin/scm/help-buildProject.html">
<f:textbox name="buildProject" value="${scm.buildProject}"/>
Expand Down
3 changes: 3 additions & 0 deletions src/main/webapp/scm/help-removeViewPrivateFiles.html
@@ -0,0 +1,3 @@
<div>
When checked the view private files of the ClearCase UCM view are removed.
</div>

0 comments on commit 9160fb0

Please sign in to comment.