Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Commit 2285703

Browse files
authored
Merge pull request #555 from appirio-tech/issue-551-skip-forum
Update contest service facade
2 parents 3bfd24d + a75046f commit 2285703

File tree

2 files changed

+80
-4
lines changed

2 files changed

+80
-4
lines changed

services/contest_service_facade/src/java/main/com/topcoder/service/facade/contest/ContestServiceFacade.java

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,33 @@ public SoftwareCompetition createSoftwareContest(TCSubject tcSubject,SoftwareCom
595595
*/
596596
public SoftwareCompetition createSoftwareContest(TCSubject tcSubject, SoftwareCompetition contest,
597597
long tcDirectProjectId, Date multiRoundEndDate, Date endDate) throws ContestServiceException, PermissionServiceException;
598-
598+
599+
/**
600+
* <p>
601+
* Creates a new <code>SoftwareCompetition</code> in the persistence.
602+
* </p>
603+
* Updated for Version 1.0.1 - BUGR-2185: For development contests, if asset (or component) exists from design
604+
* contests then that is used to create a new contest. Otherwise a new asset is also created. Updated for Version1.5
605+
* the code is refactored by the logic: 1. check the permission 2. update or create the asset 3. set default
606+
* resources 4. create project 5. prepare the return value 6. persist the eligility
607+
* <p>
608+
* Update in v1.5.1: add parameter TCSubject which contains the security info for current user.
609+
* </p>
610+
* @param tcSubject TCSubject instance contains the login security info for the current user
611+
* @param contest the <code>SoftwareCompetition</code> to create as a contest
612+
* @param tcDirectProjectId the TC direct project id. a <code>long</code> providing the ID of a client the new
613+
* competition belongs to.
614+
* @param multiRoundEndDate the end date for the multiround phase. No multiround if it's null.
615+
* @param endDate the end date for submission phase. Can be null if to use default.
616+
* @param skipForum true if skip forum creation
617+
* @return the created <code>SoftwareCompetition</code> as a contest
618+
* @throws IllegalArgumentException if the input argument is invalid.
619+
* @throws ContestServiceException if an error occurs when interacting with the service layer.
620+
* @since 1.6.4
621+
*/
622+
public SoftwareCompetition createSoftwareContest(TCSubject tcSubject, SoftwareCompetition contest,
623+
long tcDirectProjectId, Date multiRoundEndDate, Date endDate, boolean skipForum) throws ContestServiceException, PermissionServiceException;
624+
599625
/**
600626
* <p>
601627
* Creates a new <code>SoftwareCompetition</code> in the persistence.
@@ -627,14 +653,15 @@ public SoftwareCompetition createSoftwareContest(TCSubject tcSubject, SoftwareCo
627653
* @param regEndDate the registration end date
628654
* @param multiRoundEndDate the end date for the multiround phase. No multiround if it's null.
629655
* @param endDate the end date for submission phase. Can be null if to use default.
630-
* @param skipForum true if skip forum creation
656+
* @param skipForum true if no need to create the forum
631657
* @return the created <code>SoftwareCompetition</code> as a contest
632658
* @throws IllegalArgumentException if the input argument is invalid.
633659
* @throws ContestServiceException if an error occurs when interacting with the service layer.
634660
*/
635661
public SoftwareCompetition createSoftwareContest(TCSubject tcSubject, SoftwareCompetition contest,
636662
long tcDirectProjectId, Date regEndDate, Date multiRoundEndDate, Date endDate, boolean skipForum) throws ContestServiceException, PermissionServiceException;
637663

664+
638665
/**
639666
* <p>
640667
* BURG-1716: We need to add a method to get software contest by project id,
@@ -705,7 +732,7 @@ public SoftwareCompetition updateSoftwareContest(TCSubject tcSubject,
705732
*/
706733
public SoftwareCompetition updateSoftwareContest(TCSubject tcSubject, SoftwareCompetition contest,
707734
long tcDirectProjectId, Date multiRoundEndDate, Date endDate) throws ContestServiceException, PermissionServiceException;
708-
735+
709736
/**
710737
* <p>
711738
* Updates a <code>SoftwareCompetition</code> in the persistence.

services/contest_service_facade/src/java/main/com/topcoder/service/facade/contest/ejb/ContestServiceFacadeBean.java

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3635,7 +3635,56 @@ private void checkContestBillingAccount(long billingAccountId, long directProjec
36353635
public SoftwareCompetition createSoftwareContest(TCSubject tcSubject, SoftwareCompetition contest,
36363636
long tcDirectProjectId, Date multiRoundEndDate, Date endDate)
36373637
throws ContestServiceException, PermissionServiceException {
3638-
return createSoftwareContest(tcSubject, contest, tcDirectProjectId, null, null, null);
3638+
return createSoftwareContest(tcSubject, contest, tcDirectProjectId, null, null, false);
3639+
}
3640+
3641+
/**
3642+
* <p>
3643+
* Creates a new <code>SoftwareCompetition</code> in the persistence.
3644+
* </p>
3645+
* Updated for Version 1.0.1 - BUGR-2185: For development contests, if asset (or
3646+
* component) exists from design contests then that is used to create a new
3647+
* contest. Otherwise a new asset is also created. Updated for Version1.5 the
3648+
* code is refactored by the logic: 1. check the permission 2. update or create
3649+
* the asset 3. set default resources 4. create project 5. prepare the return
3650+
* value 6. persist the eligility
3651+
* <p>
3652+
* Update in v1.5.1: add parameter TCSubject which contains the security info
3653+
* for current user.
3654+
* </p>
3655+
*
3656+
* <p>
3657+
* Update in v1.8.3: Add handling of auto creation of bug hunt for assembly
3658+
* competition. If the assembly contest has bugHuntProjectHeader set and the
3659+
* properties not empty in bugHuntProjectHeader. A bug hunt contest is
3660+
* automatically created. The bug hunt contest will - have copilot inserted as
3661+
* reviewer (if exists) - use the start date of approval date as the start date
3662+
* and producation date of bug hunt contest. - add a "Bug Race For" link between
3663+
* the bug race contest and assembly contest
3664+
* </p>
3665+
*
3666+
* @param tcSubject TCSubject instance contains the login security info
3667+
* for the current user
3668+
* @param contest the <code>SoftwareCompetition</code> to create as a
3669+
* contest
3670+
* @param tcDirectProjectId the TC direct project id. a <code>long</code>
3671+
* providing the ID of a client the new competition
3672+
* belongs to.
3673+
* @param multiRoundEndDate the end date for the multiround phase. No multiround
3674+
* if it's null.
3675+
* @param endDate the end date for submission phase. Can be null if to
3676+
* use default.
3677+
* @param skipForum true if no need to create the forum
3678+
* @return the created <code>SoftwareCompetition</code> as a contest
3679+
* @throws IllegalArgumentException if the input argument is invalid.
3680+
* @throws ContestServiceException if an error occurs when interacting with the
3681+
* service layer.
3682+
* @since 1.6.6
3683+
*/
3684+
public SoftwareCompetition createSoftwareContest(TCSubject tcSubject, SoftwareCompetition contest,
3685+
long tcDirectProjectId, Date multiRoundEndDate, Date endDate, boolean skipForum)
3686+
throws ContestServiceException, PermissionServiceException {
3687+
return createSoftwareContest(tcSubject, contest, tcDirectProjectId, null, null, null, skipForum);
36393688
}
36403689

36413690
/**

0 commit comments

Comments
 (0)