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

Commit ba5fcee

Browse files
authored
be able to set end date for registration phase and submission phase (#277)
* set registration end date
1 parent 29de821 commit ba5fcee

File tree

16 files changed

+6509
-6071
lines changed

16 files changed

+6509
-6071
lines changed

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

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,14 @@
266266
* <ul>
267267
* <li>Add {@link #getAllProjectGroups()}to get all project groups</li>
268268
* </ul>
269+
*
270+
* Version 1.8.7 (Topcoder - Ability To Set End Date For Registration Phase and Submission Phase)
271+
* <ul>
272+
* <li>Added new createSoftwareContest and updateSoftwareContest methods to take an extra regEndDate argument</li>
273+
* </ul>
274+
*
269275
* @author pulky, murphydog, waits, BeBetter, hohosky, isv, lmmortal, Veve, GreatKevin, deedee, TCSASSEMBLER, TCSCODER
270-
* @version 1.8.6
276+
* @version 1.8.7
271277
*/
272278
public interface ContestServiceFacade {
273279

@@ -512,6 +518,7 @@ public List<Technology> getActiveTechnologies(TCSubject tcSubject)
512518
public SoftwareCompetition createSoftwareContest(TCSubject tcSubject,SoftwareCompetition contest, long tcDirectProjectId)
513519
throws ContestServiceException, PermissionServiceException;
514520

521+
515522
/**
516523
* <p>
517524
* Creates a new <code>SoftwareCompetition</code> in the persistence.
@@ -537,6 +544,25 @@ public SoftwareCompetition createSoftwareContest(TCSubject tcSubject,SoftwareCom
537544
public SoftwareCompetition createSoftwareContest(TCSubject tcSubject, SoftwareCompetition contest,
538545
long tcDirectProjectId, Date multiRoundEndDate, Date endDate) throws ContestServiceException, PermissionServiceException;
539546

547+
/**
548+
* <p>
549+
* Creates a new <code>SoftwareCompetition</code> in the persistence.
550+
* </p>
551+
*
552+
* @param tcSubject TCSubject instance contains the login security info for the current user
553+
* @param contest the <code>SoftwareCompetition</code> to create as a contest
554+
* @param tcDirectProjectId the TC direct project id. a <code>long</code> providing the ID of a client the new
555+
* competition belongs to.
556+
* @param regEndDate the registration end date
557+
* @param multiRoundEndDate the end date for the multiround phase. No multiround if it's null.
558+
* @param endDate the end date for submission phase. Can be null if to use default.
559+
* @return the created <code>SoftwareCompetition</code> as a contest
560+
* @throws IllegalArgumentException if the input argument is invalid.
561+
* @throws ContestServiceException if an error occurs when interacting with the service layer.
562+
*/
563+
public SoftwareCompetition createSoftwareContest(TCSubject tcSubject, SoftwareCompetition contest,
564+
long tcDirectProjectId, Date regEndDate, Date multiRoundEndDate, Date endDate) throws ContestServiceException, PermissionServiceException;
565+
540566
/**
541567
* <p>
542568
* BURG-1716: We need to add a method to get software contest by project id,
@@ -608,6 +634,23 @@ public SoftwareCompetition updateSoftwareContest(TCSubject tcSubject,
608634
public SoftwareCompetition updateSoftwareContest(TCSubject tcSubject, SoftwareCompetition contest,
609635
long tcDirectProjectId, Date multiRoundEndDate, Date endDate) throws ContestServiceException, PermissionServiceException;
610636

637+
/**
638+
* <p>
639+
* Updates a <code>SoftwareCompetition</code> in the persistence.
640+
* </p>
641+
*
642+
* @param tcSubject TCSubject instance contains the login security info for the current user
643+
* @param contest the <code>SoftwareCompetition</code> to update as a contest
644+
* @param tcDirectProjectId the TC direct project id.
645+
* @param regEndDate the registration end date
646+
* @param multiRoundEndDate the end date for the multiround phase. No multiround if it's null.
647+
* @param endDate the end date for submission phase. Can be null if to use default.
648+
* @throws IllegalArgumentException if the input argument is invalid.
649+
* @throws ContestServiceException if an error occurs when interacting with the service layer.
650+
*/
651+
public SoftwareCompetition updateSoftwareContest(TCSubject tcSubject, SoftwareCompetition contest,
652+
long tcDirectProjectId, Date regEndDate, Date multiRoundEndDate, Date endDate) throws ContestServiceException, PermissionServiceException;
653+
611654
/**
612655
* <p>
613656
* Assigns a specified user to a specified <code>assetDTO</code>.

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

Lines changed: 54 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -874,9 +874,15 @@
874874
* <li>Add {@link #getAllProjectGroups()}to get all project groups</li>
875875
* </ul>
876876
*
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+
*
877883
* @author snow01, pulky, murphydog, waits, BeBetter, hohosky, isv, tangzx, GreatKevin, lmmortal, minhu, GreatKevin, tangzx
878884
* @author isv, GreatKevin, Veve, deedee, TCSCODER, TCSASSEMBLER
879-
* @version 3.7
885+
* @version 3.8
880886
*/
881887
@Stateless
882888
@TransactionManagement(TransactionManagementType.CONTAINER)
@@ -2303,13 +2309,13 @@ private SoftwareContestPaymentResult processContestSaleInternal(TCSubject tcSubj
23032309

23042310
if (tobeUpdatedCompetition == null) {
23052311
tobeUpdatedCompetition =
2306-
createSoftwareContest(tcSubject, competition, competition.getProjectHeader().getTcDirectProjectId(), multiRoundEndDate, endDate);
2312+
createSoftwareContest(tcSubject, competition, competition.getProjectHeader().getTcDirectProjectId(), null, multiRoundEndDate, endDate);
23072313
competition.getProjectHeader().setProjectStatus(ProjectStatus.ACTIVE);
23082314
} else {
23092315
competition.setProjectHeaderReason("User Update");
23102316
competition.getProjectHeader().setProjectStatus(ProjectStatus.ACTIVE);
23112317
tobeUpdatedCompetition =
2312-
updateSoftwareContest(tcSubject, competition, competition.getProjectHeader().getTcDirectProjectId(), multiRoundEndDate, endDate);
2318+
updateSoftwareContest(tcSubject, competition, competition.getProjectHeader().getTcDirectProjectId(), null, multiRoundEndDate, endDate);
23132319
}
23142320

23152321
Project contest = tobeUpdatedCompetition.getProjectHeader();
@@ -3098,7 +3104,7 @@ private boolean isStudio(SoftwareCompetition contest) {
30983104
*/
30993105
public SoftwareCompetition createSoftwareContest(TCSubject tcSubject, SoftwareCompetition contest,
31003106
long tcDirectProjectId) throws ContestServiceException, PermissionServiceException {
3101-
return createSoftwareContest(tcSubject, contest, tcDirectProjectId, null, null);
3107+
return createSoftwareContest(tcSubject, contest, tcDirectProjectId, null, null, null);
31023108
}
31033109

31043110
/**
@@ -3166,6 +3172,27 @@ private void checkContestBillingAccount(long billingAccountId, long directProjec
31663172
*/
31673173
public SoftwareCompetition createSoftwareContest(TCSubject tcSubject, SoftwareCompetition contest,
31683174
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 {
31693196
logger.debug("createSoftwareContest with information : [tcSubject = " + tcSubject.getUserId() + ", tcDirectProjectId ="
31703197
+ tcDirectProjectId + ", multiRoundEndDate = " + multiRoundEndDate + "]");
31713198

@@ -3232,7 +3259,7 @@ public SoftwareCompetition createSoftwareContest(TCSubject tcSubject, SoftwareCo
32323259

32333260
//create project now
32343261
FullProjectData projectData = projectServices.createProjectWithTemplate(contest.getProjectHeader(),
3235-
contest.getProjectPhases(), contest.getProjectResources(), multiRoundEndDate, endDate,
3262+
contest.getProjectPhases(), contest.getProjectResources(), regEndDate, multiRoundEndDate, endDate,
32363263
String.valueOf(tcSubject.getUserId()));
32373264

32383265
if (contest.getProjectHeader().getProjectCategory().getId() == ProjectCategory.DEVELOPMENT.getId()) {
@@ -4343,7 +4370,7 @@ public List<SoftwareCompetition> batchUpdateDraftSoftwareContests(TCSubject tcSu
43434370
*/
43444371
public SoftwareCompetition updateSoftwareContest(TCSubject tcSubject, SoftwareCompetition contest,
43454372
long tcDirectProjectId) throws ContestServiceException, PermissionServiceException {
4346-
return updateSoftwareContest(tcSubject, contest, tcDirectProjectId, null, null);
4373+
return updateSoftwareContest(tcSubject, contest, tcDirectProjectId, null, null, null);
43474374
}
43484375

43494376
/**
@@ -4372,6 +4399,26 @@ public SoftwareCompetition updateSoftwareContest(TCSubject tcSubject, SoftwareCo
43724399
*/
43734400
public SoftwareCompetition updateSoftwareContest(TCSubject tcSubject, SoftwareCompetition contest,
43744401
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 {
43754422
logger.debug("updateSoftwareContest");
43764423

43774424
try {
@@ -4650,6 +4697,7 @@ public SoftwareCompetition updateSoftwareContest(TCSubject tcSubject, SoftwareCo
46504697
contest.getProjectPhases(),
46514698
updatedResources.toArray(
46524699
new com.topcoder.management.resource.Resource[updatedResources.size()]),
4700+
regEndDate,
46534701
multiRoundEndDate,
46544702
endDate,
46554703
String.valueOf(tcSubject.getUserId()));

services/project_services/src/java/main/com/topcoder/project/service/ProjectServices.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,11 @@
218218
* <ul>
219219
* <li>Added {@link #getAllProjectGroups()}</li>
220220
* </ul>
221+
*
222+
* Version 1.10 (Topcoder - Ability To Set End Date For Registration Phase and Submission Phase)
223+
* <ul>
224+
* <li>Updated createProjectWithTemplate and updateProject methods to take an extra regEndDate argument</li>
225+
* </ul>
221226
* </p>
222227
*
223228
* <p>
@@ -228,7 +233,7 @@
228233
*
229234
* @author argolite, moonli, pulky
230235
* @author fabrizyo, znyyddf, murphydog, waits, hohosky, isv, GreatKevin, TCSCODER
231-
* @version 1.9
236+
* @version 1.10
232237
*/
233238
public interface ProjectServices {
234239
/**
@@ -557,6 +562,7 @@ public FullProjectData updateProject(Project projectHeader, String projectHeader
557562
* @param projectResources
558563
* the project's resources, can be null or empty, can't contain null values. Null is
559564
* treated like empty.
565+
* @param regEndDate the registration end date
560566
* @param multiRoundEndDate the end date for the multiround phase. No multiround if it's null.
561567
* @param endDate the end date for submission phase.
562568
* @param operator
@@ -584,7 +590,7 @@ public FullProjectData updateProject(Project projectHeader, String projectHeader
584590
* @since 1.4.5
585591
*/
586592
public FullProjectData updateProject(Project projectHeader, String projectHeaderReason,
587-
com.topcoder.project.phases.Project projectPhases, Resource[] projectResources, Date multiRoundEndDate, Date endDate, String operator);
593+
com.topcoder.project.phases.Project projectPhases, Resource[] projectResources, Date regEndDate, Date multiRoundEndDate, Date endDate, String operator);
588594

589595
/**
590596
* <p>
@@ -731,6 +737,7 @@ public FullProjectData createProjectWithTemplate(Project projectHeader, com.topc
731737
* @param projectResources
732738
* the project's resources, can be null or empty, can't contain null values. Null is
733739
* treated like empty.
740+
* @param regEndDate the registration end date
734741
* @param multiRoundEndDate the end date for the multiround phase. No multiround if it's null.
735742
* @param endDate the end date for submission phase.
736743
* @param operator
@@ -752,7 +759,7 @@ public FullProjectData createProjectWithTemplate(Project projectHeader, com.topc
752759
* @since 1.4.4
753760
*/
754761
public FullProjectData createProjectWithTemplate(Project projectHeader, com.topcoder.project.phases.Project projectPhases,
755-
Resource[] projectResources, Date multiRoundEndDate, Date endDate, String operator);
762+
Resource[] projectResources, Date regEndDate, Date multiRoundEndDate, Date endDate, String operator);
756763

757764
/**
758765
* <p>

services/project_services/src/java/main/com/topcoder/project/service/ejb/ProjectServicesBean.java

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -252,10 +252,16 @@
252252
* <ul>
253253
* <li>Added {@link #getAllProjectGroups()}</li>
254254
* </ul>
255+
*
256+
* <p>
257+
* Version 1.10 (Topcoder - Ability To Set End Date For Registration Phase and Submission Phase)
258+
* <ul>
259+
* <li>Updated createProjectWithTemplate and updateProject methods to take an extra regEndDate argument</li>
260+
* </ul>
255261
* </p>
256262
*
257263
* @author fabrizyo, znyyddf, pulky, murphydog, waits, hohosky, isv, GreatKevin, TCSCODER
258-
* @version 1.9
264+
* @version 1.10
259265
* @since 1.0
260266
*/
261267
@Stateless
@@ -838,6 +844,7 @@ public FullProjectData updateProject(Project projectHeader, String projectHeader
838844
* @param projectResources
839845
* the project's resources, can be null or empty, can't contain null values. Null is
840846
* treated like empty.
847+
* @param regEndDate the registration end date
841848
* @param multiRoundEndDate the end date for the multiround phase. No multiround if it's null.
842849
* @param endDate the end date for submission phase.
843850
* @param operator
@@ -865,16 +872,16 @@ public FullProjectData updateProject(Project projectHeader, String projectHeader
865872
* @since 1.4.5
866873
*/
867874
public FullProjectData updateProject(Project projectHeader, String projectHeaderReason,
868-
com.topcoder.project.phases.Project projectPhases, Resource[] projectResources, Date multiRoundEndDate, Date endDate, String operator) {
875+
com.topcoder.project.phases.Project projectPhases, Resource[] projectResources, Date regEndDate, Date multiRoundEndDate, Date endDate, String operator) {
869876
String method = "ProjectServicesBean#updateProject(Project projectHeader,"
870877
+ " String projectHeaderReason, com.topcoder.project.phases.Project projectPhases,"
871-
+ " Resource[] projectResources, Date multiRoundEndDate, Date endDate, String operator) method.";
878+
+ " Resource[] projectResources, Date regEndDate, Date multiRoundEndDate, Date endDate, String operator) method.";
872879

873880
Util.log(logger, Level.INFO, "Enters " + method);
874881

875882
try {
876883
return getProjectServices().updateProject(projectHeader, projectHeaderReason, projectPhases,
877-
projectResources, multiRoundEndDate, endDate, operator);
884+
projectResources, regEndDate, multiRoundEndDate, endDate, operator);
878885
} catch (ProjectServicesException e) {
879886
Util.log(logger, Level.ERROR, "ProjectServicesException occurred in " + method);
880887
throw e;
@@ -1246,6 +1253,7 @@ public FullProjectData createProjectWithTemplate(Project projectHeader, com.topc
12461253
* @param projectResources
12471254
* the project's resources, can be null or empty, can't contain null values. Null is
12481255
* treated like empty.
1256+
* @param regEndDate the registration end date
12491257
* @param multiRoundEndDate the end date for the multiround phase. No multiround if it's null.
12501258
* @param endDate the end date for submission phase.
12511259
* @param operator
@@ -1267,15 +1275,15 @@ public FullProjectData createProjectWithTemplate(Project projectHeader, com.topc
12671275
* @since 1.4.5
12681276
*/
12691277
public FullProjectData createProjectWithTemplate(Project projectHeader, com.topcoder.project.phases.Project projectPhases,
1270-
Resource[] projectResources, Date multiRoundEndDate, Date endDate, String operator) {
1278+
Resource[] projectResources, Date regEndDate, Date multiRoundEndDate, Date endDate, String operator) {
12711279
String method = "ProjectServicesBean#createProjectWithTemplate(Project projectHeader, com.topcoder.project.phases.Project"
1272-
+ " projectPhases, Resource[] projectResources, Date multiRoundEndDate, Date endDate, String operator) method.";
1280+
+ " projectPhases, Resource[] projectResources, Date regEndDate, Date multiRoundEndDate, Date endDate, String operator) method.";
12731281

12741282
Util.log(logger, Level.INFO, "Enters " + method);
12751283

12761284
try {
12771285
return getProjectServices().createProjectWithTemplate(projectHeader, projectPhases, projectResources,
1278-
multiRoundEndDate, endDate, operator);
1286+
regEndDate, multiRoundEndDate, endDate, operator);
12791287
} catch (ProjectServicesException e) {
12801288
Util.log(logger, Level.ERROR, "ProjectServicesException occurred in " + method);
12811289
throw e;

0 commit comments

Comments
 (0)