|
874 | 874 | * <li>Add {@link #getAllProjectGroups()}to get all project groups</li>
|
875 | 875 | * </ul>
|
876 | 876 | *
|
| 877 | + * Version 3.8 (Topcoder - Ability To Set End Date For Registration Phase and Submission Phase) |
| 878 | + * <ul> |
| 879 | + * <li>Added new createSoftwareContest and updateSoftwareContest methods to take an extra regEndDate argument</li> |
| 880 | + * <li>Updated the other methods to call the two methods above</li> |
| 881 | + * </ul> |
| 882 | + * |
877 | 883 | * @author snow01, pulky, murphydog, waits, BeBetter, hohosky, isv, tangzx, GreatKevin, lmmortal, minhu, GreatKevin, tangzx
|
878 | 884 | * @author isv, GreatKevin, Veve, deedee, TCSCODER, TCSASSEMBLER
|
879 |
| - * @version 3.7 |
| 885 | + * @version 3.8 |
880 | 886 | */
|
881 | 887 | @Stateless
|
882 | 888 | @TransactionManagement(TransactionManagementType.CONTAINER)
|
@@ -2303,13 +2309,13 @@ private SoftwareContestPaymentResult processContestSaleInternal(TCSubject tcSubj
|
2303 | 2309 |
|
2304 | 2310 | if (tobeUpdatedCompetition == null) {
|
2305 | 2311 | tobeUpdatedCompetition =
|
2306 |
| - createSoftwareContest(tcSubject, competition, competition.getProjectHeader().getTcDirectProjectId(), multiRoundEndDate, endDate); |
| 2312 | + createSoftwareContest(tcSubject, competition, competition.getProjectHeader().getTcDirectProjectId(), null, multiRoundEndDate, endDate); |
2307 | 2313 | competition.getProjectHeader().setProjectStatus(ProjectStatus.ACTIVE);
|
2308 | 2314 | } else {
|
2309 | 2315 | competition.setProjectHeaderReason("User Update");
|
2310 | 2316 | competition.getProjectHeader().setProjectStatus(ProjectStatus.ACTIVE);
|
2311 | 2317 | tobeUpdatedCompetition =
|
2312 |
| - updateSoftwareContest(tcSubject, competition, competition.getProjectHeader().getTcDirectProjectId(), multiRoundEndDate, endDate); |
| 2318 | + updateSoftwareContest(tcSubject, competition, competition.getProjectHeader().getTcDirectProjectId(), null, multiRoundEndDate, endDate); |
2313 | 2319 | }
|
2314 | 2320 |
|
2315 | 2321 | Project contest = tobeUpdatedCompetition.getProjectHeader();
|
@@ -3098,7 +3104,7 @@ private boolean isStudio(SoftwareCompetition contest) {
|
3098 | 3104 | */
|
3099 | 3105 | public SoftwareCompetition createSoftwareContest(TCSubject tcSubject, SoftwareCompetition contest,
|
3100 | 3106 | long tcDirectProjectId) throws ContestServiceException, PermissionServiceException {
|
3101 |
| - return createSoftwareContest(tcSubject, contest, tcDirectProjectId, null, null); |
| 3107 | + return createSoftwareContest(tcSubject, contest, tcDirectProjectId, null, null, null); |
3102 | 3108 | }
|
3103 | 3109 |
|
3104 | 3110 | /**
|
@@ -3166,6 +3172,27 @@ private void checkContestBillingAccount(long billingAccountId, long directProjec
|
3166 | 3172 | */
|
3167 | 3173 | public SoftwareCompetition createSoftwareContest(TCSubject tcSubject, SoftwareCompetition contest,
|
3168 | 3174 | long tcDirectProjectId, Date multiRoundEndDate, Date endDate) throws ContestServiceException, PermissionServiceException {
|
| 3175 | + return createSoftwareContest(tcSubject, contest, tcDirectProjectId, null, null, null); |
| 3176 | + } |
| 3177 | + |
| 3178 | + /** |
| 3179 | + * <p> |
| 3180 | + * Creates a new <code>SoftwareCompetition</code> in the persistence. |
| 3181 | + * </p> |
| 3182 | + * |
| 3183 | + * @param tcSubject TCSubject instance contains the login security info for the current user |
| 3184 | + * @param contest the <code>SoftwareCompetition</code> to create as a contest |
| 3185 | + * @param tcDirectProjectId the TC direct project id. a <code>long</code> providing the ID of a client the new |
| 3186 | + * competition belongs to. |
| 3187 | + * @param regEndDate the registration end date |
| 3188 | + * @param multiRoundEndDate the end date for the multiround phase. No multiround if it's null. |
| 3189 | + * @param endDate the end date for submission phase. Can be null if to use default. |
| 3190 | + * @return the created <code>SoftwareCompetition</code> as a contest |
| 3191 | + * @throws IllegalArgumentException if the input argument is invalid. |
| 3192 | + * @throws ContestServiceException if an error occurs when interacting with the service layer. |
| 3193 | + */ |
| 3194 | + public SoftwareCompetition createSoftwareContest(TCSubject tcSubject, SoftwareCompetition contest, |
| 3195 | + long tcDirectProjectId, Date regEndDate, Date multiRoundEndDate, Date endDate) throws ContestServiceException, PermissionServiceException { |
3169 | 3196 | logger.debug("createSoftwareContest with information : [tcSubject = " + tcSubject.getUserId() + ", tcDirectProjectId ="
|
3170 | 3197 | + tcDirectProjectId + ", multiRoundEndDate = " + multiRoundEndDate + "]");
|
3171 | 3198 |
|
@@ -3232,7 +3259,7 @@ public SoftwareCompetition createSoftwareContest(TCSubject tcSubject, SoftwareCo
|
3232 | 3259 |
|
3233 | 3260 | //create project now
|
3234 | 3261 | FullProjectData projectData = projectServices.createProjectWithTemplate(contest.getProjectHeader(),
|
3235 |
| - contest.getProjectPhases(), contest.getProjectResources(), multiRoundEndDate, endDate, |
| 3262 | + contest.getProjectPhases(), contest.getProjectResources(), regEndDate, multiRoundEndDate, endDate, |
3236 | 3263 | String.valueOf(tcSubject.getUserId()));
|
3237 | 3264 |
|
3238 | 3265 | if (contest.getProjectHeader().getProjectCategory().getId() == ProjectCategory.DEVELOPMENT.getId()) {
|
@@ -4343,7 +4370,7 @@ public List<SoftwareCompetition> batchUpdateDraftSoftwareContests(TCSubject tcSu
|
4343 | 4370 | */
|
4344 | 4371 | public SoftwareCompetition updateSoftwareContest(TCSubject tcSubject, SoftwareCompetition contest,
|
4345 | 4372 | long tcDirectProjectId) throws ContestServiceException, PermissionServiceException {
|
4346 |
| - return updateSoftwareContest(tcSubject, contest, tcDirectProjectId, null, null); |
| 4373 | + return updateSoftwareContest(tcSubject, contest, tcDirectProjectId, null, null, null); |
4347 | 4374 | }
|
4348 | 4375 |
|
4349 | 4376 | /**
|
@@ -4372,6 +4399,26 @@ public SoftwareCompetition updateSoftwareContest(TCSubject tcSubject, SoftwareCo
|
4372 | 4399 | */
|
4373 | 4400 | public SoftwareCompetition updateSoftwareContest(TCSubject tcSubject, SoftwareCompetition contest,
|
4374 | 4401 | long tcDirectProjectId, Date multiRoundEndDate, Date endDate) throws ContestServiceException, PermissionServiceException {
|
| 4402 | + |
| 4403 | + return updateSoftwareContest(tcSubject, contest, tcDirectProjectId, null, null, null); |
| 4404 | + } |
| 4405 | + |
| 4406 | + /** |
| 4407 | + * <p> |
| 4408 | + * Updates a <code>SoftwareCompetition</code> in the persistence. |
| 4409 | + * </p> |
| 4410 | + * |
| 4411 | + * @param tcSubject TCSubject instance contains the login security info for the current user |
| 4412 | + * @param contest the <code>SoftwareCompetition</code> to update as a contest |
| 4413 | + * @param tcDirectProjectId the TC direct project id. |
| 4414 | + * @param regEndDate the registration end date |
| 4415 | + * @param multiRoundEndDate the end date for the multiround phase. No multiround if it's null. |
| 4416 | + * @param endDate the end date for submission phase. Can be null if to use default. |
| 4417 | + * @throws IllegalArgumentException if the input argument is invalid. |
| 4418 | + * @throws ContestServiceException if an error occurs when interacting with the service layer. |
| 4419 | + */ |
| 4420 | + public SoftwareCompetition updateSoftwareContest(TCSubject tcSubject, SoftwareCompetition contest, |
| 4421 | + long tcDirectProjectId, Date regEndDate, Date multiRoundEndDate, Date endDate) throws ContestServiceException, PermissionServiceException { |
4375 | 4422 | logger.debug("updateSoftwareContest");
|
4376 | 4423 |
|
4377 | 4424 | try {
|
@@ -4650,6 +4697,7 @@ public SoftwareCompetition updateSoftwareContest(TCSubject tcSubject, SoftwareCo
|
4650 | 4697 | contest.getProjectPhases(),
|
4651 | 4698 | updatedResources.toArray(
|
4652 | 4699 | new com.topcoder.management.resource.Resource[updatedResources.size()]),
|
| 4700 | + regEndDate, |
4653 | 4701 | multiRoundEndDate,
|
4654 | 4702 | endDate,
|
4655 | 4703 | String.valueOf(tcSubject.getUserId()));
|
|
0 commit comments