summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorakozak2011-11-22 09:07:00 (EST)
committer Winston Prakash2011-12-01 20:46:59 (EST)
commit6a2e1cd1eda22295ac2c412e8a19a881d34c08bd (patch)
treeadce8ed29276fa7a62156656249f7cc80a368005
parent1a313716af845857278f2b5b511a632789d13809 (diff)
downloadorg.eclipse.hudson.core-6a2e1cd1eda22295ac2c412e8a19a881d34c08bd.zip
org.eclipse.hudson.core-6a2e1cd1eda22295ac2c412e8a19a881d34c08bd.tar.gz
org.eclipse.hudson.core-6a2e1cd1eda22295ac2c412e8a19a881d34c08bd.tar.bz2
Migrated FreeStyleProject Advandced section to IProperty usage. Remove redundant method from interface
Signed-off-by: Winston Prakash <winston.prakash@gmail.com>
-rw-r--r--hudson-core/src/main/java/hudson/model/AbstractProject.java15
-rw-r--r--hudson-core/src/main/java/hudson/model/FreeStyleProject.java2
-rw-r--r--hudson-core/src/main/java/org/eclipse/hudson/api/model/IAbstractProject.java7
-rw-r--r--hudson-core/src/main/resources/lib/hudson/project/config-cleanWorkspace.jelly2
-rw-r--r--hudson-core/src/main/resources/lib/hudson/project/config-quietPeriod.jelly10
-rw-r--r--hudson-core/src/main/resources/lib/hudson/project/config-retryCount.jelly10
6 files changed, 29 insertions, 17 deletions
diff --git a/hudson-core/src/main/java/hudson/model/AbstractProject.java b/hudson-core/src/main/java/hudson/model/AbstractProject.java
index 6714fbf..4c9af61 100644
--- a/hudson-core/src/main/java/hudson/model/AbstractProject.java
+++ b/hudson-core/src/main/java/hudson/model/AbstractProject.java
@@ -358,9 +358,8 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
*/
@Exported
public boolean isConcurrentBuild() {
- return getBooleanProperty(CONCURRENT_BUILD_PROPERTY_NAME).getValue();
+ return Hudson.CONCURRENT_BUILD && getBooleanProperty(CONCURRENT_BUILD_PROPERTY_NAME).getValue();
}
-
public void setConcurrentBuild(boolean b) throws IOException {
getBooleanProperty(CONCURRENT_BUILD_PROPERTY_NAME).setValue(b);
save();
@@ -578,6 +577,7 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
/**
* Sets the custom quiet period of this project, or revert to the global default if null is given.
+ *
* @param seconds quiet period
* @throws IOException if any.
*/
@@ -610,6 +610,11 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
setScmCheckoutRetryCount(retryCount);
}
+ /**
+ * @return true if quiet period was configured.
+ * @deprecated as of 2.2.0
+ * This method was used only on UI side. No longer required.
+ */
// ugly name because of EL
public boolean getHasCustomQuietPeriod() {
return null != getIntegerProperty(QUIET_PERIOD_PROPERTY_NAME).getValue();
@@ -630,6 +635,12 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
setQuietPeriod(period);
}
+ /**
+ * Checks whether scmRetryCount is configured
+ *
+ * @return true if yes, false - otherwise.
+ * @deprecated as of 2.2.0
+ */
public boolean hasCustomScmCheckoutRetryCount(){
return null != getIntegerProperty(SCM_CHECKOUT_RETRY_COUNT_PROPERTY_NAME).getValue();
}
diff --git a/hudson-core/src/main/java/hudson/model/FreeStyleProject.java b/hudson-core/src/main/java/hudson/model/FreeStyleProject.java
index 775df14..dd6a067 100644
--- a/hudson-core/src/main/java/hudson/model/FreeStyleProject.java
+++ b/hudson-core/src/main/java/hudson/model/FreeStyleProject.java
@@ -92,9 +92,9 @@ public class FreeStyleProject extends Project<FreeStyleProject,FreeStyleBuild> i
@Override
protected void submit(StaplerRequest req, StaplerResponse rsp)
throws IOException, ServletException, Descriptor.FormException {
+ super.submit(req, rsp);
setCustomWorkspace(
req.hasParameter("customWorkspace") ? req.getParameter("customWorkspace.directory") : null);
- super.submit(req, rsp);
}
@Override
diff --git a/hudson-core/src/main/java/org/eclipse/hudson/api/model/IAbstractProject.java b/hudson-core/src/main/java/org/eclipse/hudson/api/model/IAbstractProject.java
index 3c51a97..aa40966 100644
--- a/hudson-core/src/main/java/org/eclipse/hudson/api/model/IAbstractProject.java
+++ b/hudson-core/src/main/java/org/eclipse/hudson/api/model/IAbstractProject.java
@@ -73,13 +73,6 @@ public interface IAbstractProject extends IJob {
boolean blockBuildWhenUpstreamBuilding();
/**
- * Checks whether scmRetryCount is configured
- *
- * @return true if yes, false - otherwise.
- */
- boolean hasCustomScmCheckoutRetryCount();
-
- /**
* Returns scm checkout retry count.
*
* @return int value.
diff --git a/hudson-core/src/main/resources/lib/hudson/project/config-cleanWorkspace.jelly b/hudson-core/src/main/resources/lib/hudson/project/config-cleanWorkspace.jelly
index 9bcf190..9bf46fb 100644
--- a/hudson-core/src/main/resources/lib/hudson/project/config-cleanWorkspace.jelly
+++ b/hudson-core/src/main/resources/lib/hudson/project/config-cleanWorkspace.jelly
@@ -18,7 +18,7 @@
<!-- clean workspace -->
<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">
<j:set var="cleanWorkspaceRequiredProperty" value="${it.getBooleanProperty(it.CLEAN_WORKSPACE_REQUIRED_PROPERTY_NAME)}"/>
- <j:set var="cleanWorkspaceRequired" value="${cleanWorkspaceRequired.getValue()}"/>
+ <j:set var="cleanWorkspaceRequired" value="${cleanWorkspaceRequiredProperty.getValue()}"/>
<f:optionalBlock name="cleanWorkspaceRequired" title="${%Clean workspace before build}"
checked="${cleanWorkspaceRequired}"
isCascadingValue="${cleanWorkspaceRequiredProperty.isPropertyOverridden()}"
diff --git a/hudson-core/src/main/resources/lib/hudson/project/config-quietPeriod.jelly b/hudson-core/src/main/resources/lib/hudson/project/config-quietPeriod.jelly
index f27a0cf..7aa261b 100644
--- a/hudson-core/src/main/resources/lib/hudson/project/config-quietPeriod.jelly
+++ b/hudson-core/src/main/resources/lib/hudson/project/config-quietPeriod.jelly
@@ -17,11 +17,15 @@
<!-- custom quiet period -->
<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">
- <f:optionalBlock name="hasCustomQuietPeriod" title="${%Quiet period}" checked="${it.hasCustomQuietPeriod}"
- help="/help/project-config/quietPeriod.html">
+ <j:set var="quietPeriodProperty" value="${it.getIntegerProperty(it.QUIET_PERIOD_PROPERTY_NAME)}"/>
+ <j:set var="quietPeriod" value="${quietPeriodProperty.getValue()}"/>
+ <f:optionalBlock name="hasCustomQuietPeriod" title="${%Quiet period}"
+ checked="${quietPeriod!=null and quietPeriod!=quietPeriodProperty.getDefaultValue()}"
+ isCascadingValue="${quietPeriodProperty.isPropertyOverridden()}"
+ help="/help/project-config/quietPeriod.html">
<f:entry title="${%Quiet period}"
description="${%Number of seconds}">
- <f:textbox clazz="number" name="quiet_period" value="${it.quietPeriod}"/>
+ <f:textbox clazz="number" name="quiet_period" value="${quietPeriod}"/>
</f:entry>
</f:optionalBlock>
</j:jelly>
diff --git a/hudson-core/src/main/resources/lib/hudson/project/config-retryCount.jelly b/hudson-core/src/main/resources/lib/hudson/project/config-retryCount.jelly
index 9531453..0918a82 100644
--- a/hudson-core/src/main/resources/lib/hudson/project/config-retryCount.jelly
+++ b/hudson-core/src/main/resources/lib/hudson/project/config-retryCount.jelly
@@ -17,10 +17,14 @@
<!-- custom retry count -->
<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">
- <f:optionalBlock name="hasCustomScmCheckoutRetryCount" title="${%Retry Count}" checked="${it.hasCustomScmCheckoutRetryCount()}"
- help="/help/project-config/scmCheckoutRetryCount.html">
+ <j:set var="scmCheckoutRetryCountProperty" value="${it.getIntegerProperty(it.SCM_CHECKOUT_RETRY_COUNT_PROPERTY_NAME)}"/>
+ <j:set var="scmCheckoutRetryCount" value="${scmCheckoutRetryCountProperty.getValue()}"/>
+ <f:optionalBlock name="hasCustomScmCheckoutRetryCount" title="${%Retry Count}"
+ checked="${scmCheckoutRetryCount!=null and scmCheckoutRetryCount!=scmCheckoutRetryCountProperty.getDefaultValue()}"
+ isCascadingValue="${scmCheckoutRetryCountProperty.isPropertyOverridden()}"
+ help="/help/project-config/scmCheckoutRetryCount.html">
<f:entry title="${%SCM checkout retry count}">
- <f:textbox name="scmCheckoutRetryCount" value="${it.scmCheckoutRetryCount}"/>
+ <f:textbox name="scmCheckoutRetryCount" value="${scmCheckoutRetryCount}"/>
</f:entry>
</f:optionalBlock>
</j:jelly>