diff --git a/services/contest_service_facade/src/java/main/com/topcoder/service/facade/contest/ContestServiceFacade.java b/services/contest_service_facade/src/java/main/com/topcoder/service/facade/contest/ContestServiceFacade.java index 665baec2e..6002cbbf4 100644 --- a/services/contest_service_facade/src/java/main/com/topcoder/service/facade/contest/ContestServiceFacade.java +++ b/services/contest_service_facade/src/java/main/com/topcoder/service/facade/contest/ContestServiceFacade.java @@ -595,7 +595,33 @@ public SoftwareCompetition createSoftwareContest(TCSubject tcSubject,SoftwareCom */ public SoftwareCompetition createSoftwareContest(TCSubject tcSubject, SoftwareCompetition contest, long tcDirectProjectId, Date multiRoundEndDate, Date endDate) throws ContestServiceException, PermissionServiceException; - + + /** + *

+ * Creates a new SoftwareCompetition in the persistence. + *

+ * Updated for Version 1.0.1 - BUGR-2185: For development contests, if asset (or component) exists from design + * contests then that is used to create a new contest. Otherwise a new asset is also created. Updated for Version1.5 + * the code is refactored by the logic: 1. check the permission 2. update or create the asset 3. set default + * resources 4. create project 5. prepare the return value 6. persist the eligility + *

+ * Update in v1.5.1: add parameter TCSubject which contains the security info for current user. + *

+ * @param tcSubject TCSubject instance contains the login security info for the current user + * @param contest the 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 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 skip forum creation + * @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. + * @since 1.6.4 + */ + public SoftwareCompetition createSoftwareContest(TCSubject tcSubject, SoftwareCompetition contest, + long tcDirectProjectId, Date multiRoundEndDate, Date endDate, boolean skipForum) throws ContestServiceException, PermissionServiceException; + /** *

* Creates a new SoftwareCompetition in the persistence. @@ -627,7 +653,7 @@ public SoftwareCompetition createSoftwareContest(TCSubject tcSubject, SoftwareCo * @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 skip forum creation + * @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. @@ -635,6 +661,7 @@ public SoftwareCompetition createSoftwareContest(TCSubject tcSubject, SoftwareCo public SoftwareCompetition createSoftwareContest(TCSubject tcSubject, SoftwareCompetition contest, long tcDirectProjectId, Date regEndDate, Date multiRoundEndDate, Date endDate, boolean skipForum) throws ContestServiceException, PermissionServiceException; + /** *

* BURG-1716: We need to add a method to get software contest by project id, @@ -705,7 +732,7 @@ public SoftwareCompetition updateSoftwareContest(TCSubject tcSubject, */ public SoftwareCompetition updateSoftwareContest(TCSubject tcSubject, SoftwareCompetition contest, long tcDirectProjectId, Date multiRoundEndDate, Date endDate) throws ContestServiceException, PermissionServiceException; - + /** *

* Updates a SoftwareCompetition in the persistence. 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 8a99c9b59..3be7205db 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 @@ -3635,7 +3635,56 @@ private void checkContestBillingAccount(long billingAccountId, long directProjec public SoftwareCompetition createSoftwareContest(TCSubject tcSubject, SoftwareCompetition contest, long tcDirectProjectId, Date multiRoundEndDate, Date endDate) throws ContestServiceException, PermissionServiceException { - return createSoftwareContest(tcSubject, contest, tcDirectProjectId, null, null, null); + return createSoftwareContest(tcSubject, contest, tcDirectProjectId, null, null, false); + } + + /** + *

+ * Creates a new SoftwareCompetition in the persistence. + *

+ * Updated for Version 1.0.1 - BUGR-2185: For development contests, if asset (or + * component) exists from design contests then that is used to create a new + * contest. Otherwise a new asset is also created. Updated for Version1.5 the + * code is refactored by the logic: 1. check the permission 2. update or create + * the asset 3. set default resources 4. create project 5. prepare the return + * value 6. persist the eligility + *

+ * Update in v1.5.1: add parameter TCSubject which contains the security info + * for current user. + *

+ * + *

+ * Update in v1.8.3: Add handling of auto creation of bug hunt for assembly + * competition. If the assembly contest has bugHuntProjectHeader set and the + * properties not empty in bugHuntProjectHeader. A bug hunt contest is + * automatically created. The bug hunt contest will - have copilot inserted as + * reviewer (if exists) - use the start date of approval date as the start date + * and producation date of bug hunt contest. - add a "Bug Race For" link between + * the bug race contest and assembly contest + *

+ * + * @param tcSubject TCSubject instance contains the login security info + * for the current user + * @param contest the 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 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. + * @since 1.6.6 + */ + public SoftwareCompetition createSoftwareContest(TCSubject tcSubject, SoftwareCompetition contest, + long tcDirectProjectId, Date multiRoundEndDate, Date endDate, boolean skipForum) + throws ContestServiceException, PermissionServiceException { + return createSoftwareContest(tcSubject, contest, tcDirectProjectId, null, null, null, skipForum); } /**