@@ -3663,6 +3663,37 @@ public SoftwareCompetition createSoftwareContest(TCSubject tcSubject, SoftwareCo
3663
3663
public SoftwareCompetition createSoftwareContest (TCSubject tcSubject , SoftwareCompetition contest ,
3664
3664
long tcDirectProjectId , Date regEndDate , Date multiRoundEndDate , Date endDate )
3665
3665
throws ContestServiceException , PermissionServiceException {
3666
+ return createSoftwareContest (
3667
+ tcSubject , contest , tcDirectProjectId , regEndDate , multiRoundEndDate , endDate , false );
3668
+ }
3669
+
3670
+ /**
3671
+ * <p>
3672
+ * Creates a new <code>SoftwareCompetition</code> in the persistence.
3673
+ * </p>
3674
+ *
3675
+ * @param tcSubject TCSubject instance contains the login security info
3676
+ * for the current user
3677
+ * @param contest the <code>SoftwareCompetition</code> to create as a
3678
+ * contest
3679
+ * @param tcDirectProjectId the TC direct project id. a <code>long</code>
3680
+ * providing the ID of a client the new competition
3681
+ * belongs to.
3682
+ * @param regEndDate the registration end date
3683
+ * @param multiRoundEndDate the end date for the multiround phase. No multiround
3684
+ * if it's null.
3685
+ * @param endDate the end date for submission phase. Can be null if to
3686
+ * use default.
3687
+ * @param skipForum true if no need to create the forum
3688
+ *
3689
+ * @return the created <code>SoftwareCompetition</code> as a contest
3690
+ * @throws IllegalArgumentException if the input argument is invalid.
3691
+ * @throws ContestServiceException if an error occurs when interacting with the
3692
+ * service layer.
3693
+ */
3694
+ public SoftwareCompetition createSoftwareContest (TCSubject tcSubject , SoftwareCompetition contest ,
3695
+ long tcDirectProjectId , Date regEndDate , Date multiRoundEndDate , Date endDate , boolean skipForum )
3696
+ throws ContestServiceException , PermissionServiceException {
3666
3697
logger .debug ("createSoftwareContest with information : [tcSubject = " + tcSubject .getUserId ()
3667
3698
+ ", tcDirectProjectId =" + tcDirectProjectId + ", multiRoundEndDate = " + multiRoundEndDate + "]" );
3668
3699
@@ -3715,7 +3746,7 @@ public SoftwareCompetition createSoftwareContest(TCSubject tcSubject, SoftwareCo
3715
3746
checkBillingProjectCCA (contest );
3716
3747
3717
3748
// update the AssetDTO and update corresponding properties
3718
- createUpdateAssetDTO (tcSubject , contest );
3749
+ createUpdateAssetDTO (tcSubject , contest , skipForum );
3719
3750
3720
3751
com .topcoder .management .resource .Resource [] contestResources = createContestResources (tcSubject , contest ,
3721
3752
billingProjectId , requireApproval );
@@ -4015,10 +4046,11 @@ private boolean shouldAutoCreateBugHuntContest(SoftwareCompetition contest) {
4015
4046
* @param tcSubject TCSubject instance contains the login security info for the
4016
4047
* current user
4017
4048
* @param contest the contest
4049
+ * @param skipForum true if no need to create forum
4018
4050
* @throws EntityNotFoundException if any error occurs
4019
4051
* @throws com.topcoder.catalog.service.PersistenceException if any error occurs
4020
4052
*/
4021
- private void createUpdateAssetDTO (TCSubject tcSubject , SoftwareCompetition contest ) throws EntityNotFoundException ,
4053
+ private void createUpdateAssetDTO (TCSubject tcSubject , SoftwareCompetition contest , boolean skipForum ) throws EntityNotFoundException ,
4022
4054
com .topcoder .catalog .service .PersistenceException , DAOException , ConfigManagerException {
4023
4055
// check if it is going to create development contest
4024
4056
boolean isDevContest = isDevContest (contest );
@@ -4055,7 +4087,7 @@ else if (isDevContest) {
4055
4087
}
4056
4088
long forumId = 0 ;
4057
4089
// create forum
4058
- if (createForum ) {
4090
+ if (createForum && ! skipForum ) {
4059
4091
if (useExistingAsset && assetDTO .getForum () != null ) {
4060
4092
forumId = assetDTO .getForum ().getJiveCategoryId ();
4061
4093
} else {
0 commit comments