diff --git a/services/contest_service_facade/src/java/main/com/topcoder/service/facade/contest/ejb/ContestServiceFacadeBean.java b/services/contest_service_facade/src/java/main/com/topcoder/service/facade/contest/ejb/ContestServiceFacadeBean.java index 494e17fca..8a99c9b59 100644 --- a/services/contest_service_facade/src/java/main/com/topcoder/service/facade/contest/ejb/ContestServiceFacadeBean.java +++ b/services/contest_service_facade/src/java/main/com/topcoder/service/facade/contest/ejb/ContestServiceFacadeBean.java @@ -3663,6 +3663,37 @@ public SoftwareCompetition createSoftwareContest(TCSubject tcSubject, SoftwareCo public SoftwareCompetition createSoftwareContest(TCSubject tcSubject, SoftwareCompetition contest, long tcDirectProjectId, Date regEndDate, Date multiRoundEndDate, Date endDate) throws ContestServiceException, PermissionServiceException { + return createSoftwareContest( + tcSubject, contest, tcDirectProjectId, regEndDate, multiRoundEndDate, endDate, false); + } + + /** + *
+ * Creates a new SoftwareCompetition
in the persistence.
+ *
SoftwareCompetition
to create as a
+ * contest
+ * @param tcDirectProjectId the TC direct project id. a long
+ * providing the ID of a client the new competition
+ * belongs to.
+ * @param regEndDate the registration end date
+ * @param multiRoundEndDate the end date for the multiround phase. No multiround
+ * if it's null.
+ * @param endDate the end date for submission phase. Can be null if to
+ * use default.
+ * @param skipForum true if no need to create the forum
+ *
+ * @return the created SoftwareCompetition
as a contest
+ * @throws IllegalArgumentException if the input argument is invalid.
+ * @throws ContestServiceException if an error occurs when interacting with the
+ * service layer.
+ */
+ public SoftwareCompetition createSoftwareContest(TCSubject tcSubject, SoftwareCompetition contest,
+ long tcDirectProjectId, Date regEndDate, Date multiRoundEndDate, Date endDate, boolean skipForum)
+ throws ContestServiceException, PermissionServiceException {
logger.debug("createSoftwareContest with information : [tcSubject = " + tcSubject.getUserId()
+ ", tcDirectProjectId =" + tcDirectProjectId + ", multiRoundEndDate = " + multiRoundEndDate + "]");
@@ -3715,7 +3746,7 @@ public SoftwareCompetition createSoftwareContest(TCSubject tcSubject, SoftwareCo
checkBillingProjectCCA(contest);
// update the AssetDTO and update corresponding properties
- createUpdateAssetDTO(tcSubject, contest);
+ createUpdateAssetDTO(tcSubject, contest, skipForum);
com.topcoder.management.resource.Resource[] contestResources = createContestResources(tcSubject, contest,
billingProjectId, requireApproval);
@@ -4015,10 +4046,11 @@ private boolean shouldAutoCreateBugHuntContest(SoftwareCompetition contest) {
* @param tcSubject TCSubject instance contains the login security info for the
* current user
* @param contest the contest
+ * @param skipForum true if no need to create forum
* @throws EntityNotFoundException if any error occurs
* @throws com.topcoder.catalog.service.PersistenceException if any error occurs
*/
- private void createUpdateAssetDTO(TCSubject tcSubject, SoftwareCompetition contest) throws EntityNotFoundException,
+ private void createUpdateAssetDTO(TCSubject tcSubject, SoftwareCompetition contest, boolean skipForum) throws EntityNotFoundException,
com.topcoder.catalog.service.PersistenceException, DAOException, ConfigManagerException {
// check if it is going to create development contest
boolean isDevContest = isDevContest(contest);
@@ -4055,7 +4087,7 @@ else if (isDevContest) {
}
long forumId = 0;
// create forum
- if (createForum) {
+ if (createForum && !skipForum) {
if (useExistingAsset && assetDTO.getForum() != null) {
forumId = assetDTO.getForum().getJiveCategoryId();
} else {