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

Commit ec78678

Browse files
authored
Merge pull request #195 from appirio-tech/dev
Close Tasks and API fix
2 parents adebe31 + 1afbc25 commit ec78678

File tree

21 files changed

+679
-94
lines changed

21 files changed

+679
-94
lines changed

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,8 @@ stacktrace.log
99
/bin/
1010
.DS_Store
1111
*/.DS_Store
12+
*.iml
13+
*.rej
14+
*.diff
15+
.idea
16+

conf/web/WEB-INF/struts.xml

+14-1
Original file line numberDiff line numberDiff line change
@@ -2080,7 +2080,20 @@
20802080
<interceptor-ref name="securedContestStack"/>
20812081
<result name="success">/WEB-INF/studio-final-fixes.jsp</result>
20822082
</action>
2083-
2083+
<action name="close" class="com.topcoder.direct.services.view.action.contest.CloseContestAction">
2084+
<interceptor-ref name="token"/>
2085+
<interceptor-ref name="securedContestStack"/>
2086+
<result name="success" type="json"/>
2087+
<result name="error" type="json"/>
2088+
<result name="invalid.token" type="json"/>
2089+
</action>
2090+
<action name="cancel" class="com.topcoder.direct.services.view.action.contest.CancelContestAction">
2091+
<interceptor-ref name="token"/>
2092+
<interceptor-ref name="securedContestStack"/>
2093+
<result name="success" type="json"/>
2094+
<result name="error" type="json"/>
2095+
<result name="invalid.token" type="json"/>
2096+
</action>
20842097
</package>
20852098

20862099
<package name="ajax" namespace="/ajax" extends="base">

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

+50-3
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,13 @@
255255
* </ul>
256256
* </p>
257257
*
258-
* @author pulky, murphydog, waits, BeBetter, hohosky, isv, lmmortal, Veve, GreatKevin
259-
* @version 1.8.4
258+
* Version 1.8.5 (TOPCODER DIRECT - CLOSE PRIVATE CHALLENGE IMMEDIATELY)
259+
* <ul>
260+
* <li>Add {@link #closeSoftwareContest(TCSubject, long, long)}</li>
261+
* <li>Add {@link #cancelSoftwareContestByUser(TCSubject, long)}</li>
262+
* </ul>
263+
* @author pulky, murphydog, waits, BeBetter, hohosky, isv, lmmortal, Veve, GreatKevin, deedee, TCSASSEMBLER
264+
* @version 1.8.5
260265
*/
261266
public interface ContestServiceFacade {
262267

@@ -748,7 +753,28 @@ public SoftwareCompetition getFullProjectData(TCSubject tcSubject,long projectId
748753
* @since TopCoder Service Layer Integration 3 Assembly
749754
*/
750755
public long uploadSubmission(TCSubject tcSubject,long projectId, String filename,
751-
DataHandler submission) throws ContestServiceException;
756+
DataHandler submission) throws ContestServiceException;
757+
758+
/**
759+
* <p>
760+
* Adds a new submission for an user in a particular project.
761+
* </p>
762+
* <p>
763+
* If the project allows multiple submissions for users, it will add the new submission and return. If multiple
764+
* submission are not allowed for the project, firstly it will add the new submission, secondly mark previous
765+
* submissions as deleted and then return.
766+
* </p>
767+
*
768+
* @param userId user Id
769+
* @param projectId project Id
770+
* @param filename filename
771+
* @param submission submission data
772+
* @return
773+
* @throws ContestServiceException
774+
* @since 3.5
775+
*/
776+
public long uploadSubmission(long userId, long projectId, String filename,
777+
DataHandler submission) throws ContestServiceException;
752778

753779
/**
754780
* <p>
@@ -1511,4 +1537,25 @@ public List<SoftwareCompetition> batchUpdateDraftSoftwareContests(TCSubject tcSu
15111537
*/
15121538
Set<Long> updatePreRegister(TCSubject tcSubject, SoftwareCompetition contest,
15131539
Set<Long> preRegisterMembers) throws ContestServiceException;
1540+
1541+
/**
1542+
* Close project immediately and pick winner
1543+
*
1544+
* @param tcSubject TCSubject
1545+
* @param projectId project id
1546+
* @param winnerId user id of choosen winner
1547+
* @throws ContestServiceException
1548+
* @since 1.8.5
1549+
*/
1550+
void closeSoftwareContest(TCSubject tcSubject, long projectId, long winnerId) throws ContestServiceException;
1551+
1552+
/**
1553+
* Cancel project
1554+
*
1555+
* @param tcSubject TCSubject
1556+
* @param projectId project id
1557+
* @throws ContestServiceException
1558+
* @since 1.8.5
1559+
*/
1560+
void cancelSoftwareContestByUser(TCSubject tcSubject, long projectId) throws ContestServiceException;
15141561
}

0 commit comments

Comments
 (0)