| author | akozak | 2011-11-22 09:07:00 (EST) |
|---|---|---|
| committer | Winston Prakash | 2011-12-01 20:46:59 (EST) |
| commit | 378aba9f4582e9934353a26beb0d1ee00050e780 (patch) (side-by-side diff) | |
| tree | cc862c12b1affc2190c2e4cd5c14a9a3acb191bc | |
| parent | 6e0fcc9d88b0fec8ae50f8fd472cc606c4409f39 (diff) | |
| download | org.eclipse.hudson.core-378aba9f4582e9934353a26beb0d1ee00050e780.zip org.eclipse.hudson.core-378aba9f4582e9934353a26beb0d1ee00050e780.tar.gz org.eclipse.hudson.core-378aba9f4582e9934353a26beb0d1ee00050e780.tar.bz2 | |
Migrated FreeStyleProject Advandced section to IProperty usage. Remove redundant method from interface
Signed-off-by: Winston Prakash <winston.prakash@gmail.com>
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> |

