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

Commit 6f07486

Browse files
authored
Merge pull request #263 from appirio-tech/support_challenge_group
Support challenge group
2 parents 4acf5f5 + d4eeadf commit 6f07486

File tree

35 files changed

+2623
-150
lines changed

35 files changed

+2623
-150
lines changed

components/project_management/src/java/main/com/topcoder/management/project/Project.java

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2006 - 2014 TopCoder Inc., All Rights Reserved.
2+
* Copyright (C) 2006 - 2017 TopCoder Inc., All Rights Reserved.
33
*/
44
package com.topcoder.management.project;
55

@@ -74,16 +74,22 @@
7474
* <li>Added property {@link #autoAssignReviewerId}</li>
7575
* </ul>
7676
* </p>
77-
*
77+
*
78+
* <p>
79+
* Version 1.10 (TOPCODER - SUPPORT GROUPS CONCEPT FOR CHALLENGES):
80+
* <ul>
81+
* <li>Added {@link #groups}</li>
82+
* </ul>
83+
* </p>
7884
* <p>
7985
* This class implements Serializable interface to support serialization.
8086
* </p>
8187
* <p>
8288
* Thread safety: This class is not thread safe.
8389
* </p>
8490
*
85-
* @author tuenm, iamajia, duxiaoyang, bugbuka, GreatKevin
86-
* @version 1.9
91+
* @author tuenm, iamajia, duxiaoyang, bugbuka, GreatKevin, TCSCODER
92+
* @version 1.10
8793
* @since 1.0
8894
*/
8995
@XmlType(name = "project", namespace = "com.topcoder.management.project")
@@ -280,6 +286,13 @@ public long getIterativeReviewScorecardId() {
280286
*/
281287
private List<CopilotContestExtraInfo> copilotContestExtraInfos;
282288

289+
/**
290+
* Represents list of groups of the challenge
291+
*
292+
* @since 1.10
293+
*/
294+
private List<ProjectGroup> groups;
295+
283296
/**
284297
* <p>
285298
* Create a new Project instance with the given project type and project
@@ -843,4 +856,33 @@ public String getCreator() {
843856
public void setCreator(String creator) {
844857
this.creator = creator;
845858
}
859+
860+
/**
861+
* Getter for {@link #groups}
862+
*
863+
* @return groups
864+
* @since 1.10
865+
*/
866+
public List<ProjectGroup> getGroups() {
867+
if (groups == null) {
868+
groups = new ArrayList<ProjectGroup>();
869+
}
870+
return groups;
871+
}
872+
873+
/**
874+
* Setter for {@link #groups}
875+
*
876+
* @param groups list of ProjectGroup
877+
* @since 1.10
878+
*/
879+
public void setGroups(List<ProjectGroup> groups) {
880+
if (groups != null) {
881+
if (groups.contains(null)) {
882+
throw new IllegalArgumentException("The project groups can not contain null.");
883+
}
884+
}
885+
886+
this.groups = groups;
887+
}
846888
}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
/*
2+
* Copyright (C) 2017 TopCoder Inc., All Rights Reserved.
3+
*/
4+
package com.topcoder.management.project;
5+
6+
import java.io.Serializable;
7+
8+
/**
9+
* <p>
10+
* This is a ProjectGroup entity which represents the project_group_lu.
11+
* </p>
12+
*
13+
* <p>
14+
* Thread safety: This class is not thread safe.
15+
* </p>
16+
*
17+
* @author TCSCODER
18+
* @version 1.0
19+
*/
20+
public class ProjectGroup implements Serializable {
21+
/**
22+
* Represents group id
23+
*/
24+
private long id;
25+
26+
/**
27+
* Represents group name
28+
*/
29+
private String name;
30+
31+
/**
32+
* Constructor
33+
*/
34+
public ProjectGroup() {
35+
}
36+
37+
/**
38+
* Constructor
39+
*
40+
* @param id group id
41+
* @param name group name
42+
*/
43+
public ProjectGroup(long id, String name) {
44+
this.id = id;
45+
this.name = name;
46+
}
47+
48+
/**
49+
* Getter for {@link #id}
50+
* @return id
51+
*/
52+
public long getId() {
53+
return id;
54+
}
55+
56+
/**
57+
* Setter for {@link #id}
58+
* @param id the group id
59+
*/
60+
public void setId(long id) {
61+
this.id = id;
62+
}
63+
64+
/**
65+
* Getter for {@link #name}
66+
* @return name
67+
*/
68+
public String getName() {
69+
return name;
70+
}
71+
72+
/**
73+
* Setter for {@link #name}
74+
* @param name the name of group
75+
*/
76+
public void setName(String name) {
77+
this.name = name;
78+
}
79+
}

components/project_management/src/java/main/com/topcoder/management/project/ProjectManager.java

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2006 - 2013 TopCoder Inc., All Rights Reserved.
2+
* Copyright (C) 2006 - 2017 TopCoder Inc., All Rights Reserved.
33
*/
44
package com.topcoder.management.project;
55

@@ -106,12 +106,19 @@
106106
* </p>
107107
*
108108
* <p>
109+
* Version 1.6 (TOPCODER - SUPPORT GROUPS CONCEPT FOR CHALLENGES):
110+
* <ul>
111+
* <li>Added {@link #getAllProjectGroups()}</li>
112+
* </ul>
113+
* </p>
114+
*
115+
* <p>
109116
* Thread safety: The implementations of this interface do not have to be thread
110117
* safe.
111118
* </p>
112119
*
113-
* @author tuenm, iamajia, pulky, murphydog, bugbuka, GreatKevin
114-
* @version 1.5
120+
* @author tuenm, iamajia, pulky, murphydog, bugbuka, GreatKevin, TCSCODER
121+
* @version 1.6
115122
*/
116123
public interface ProjectManager {
117124
/**
@@ -1140,4 +1147,13 @@ public void saveSoftwareCheckpointSubmissionsGeneralFeedback(long contestId, Str
11401147
* @since 1.2.5
11411148
*/
11421149
public boolean[] requireBillingProjectsCCA(long[] billingProjectIds) throws PersistenceException;
1150+
1151+
/**
1152+
* Get all project groups
1153+
*
1154+
* @return array of all project group
1155+
* @throws PersistenceException if any database related exception occur
1156+
* @since 1.6
1157+
*/
1158+
public ProjectGroup[] getAllProjectGroups() throws PersistenceException;
11431159
}

components/project_management/src/java/main/com/topcoder/management/project/ProjectManagerImpl.java

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2006 - 2013 TopCoder Inc., All Rights Reserved.
2+
* Copyright (C) 2006 - 2017 TopCoder Inc., All Rights Reserved.
33
*/
44
package com.topcoder.management.project;
55

@@ -122,15 +122,22 @@
122122
* <li>Added method {@link #getAllProjectPlatforms()}</li>
123123
* </ul>
124124
* </p>
125-
*
125+
*
126+
* <p>
127+
* Version 1.6 (TOPCODER - SUPPORT GROUPS CONCEPT FOR CHALLENGES):
128+
* <ul>
129+
* <li>Added {@link #getAllProjectGroups()}</li>
130+
* </ul>
131+
* </p>
132+
*
126133
* <p>
127134
* Thread Safety: The implementation is not thread safe in that two threads
128135
* running the same method will use the same statement and could overwrite each
129136
* other's work.
130137
* </p>
131138
*
132-
* @author tuenm, iamajia, pulky, murphydog, bugbuka, GreatKevin
133-
* @version 1.5
139+
* @author tuenm, iamajia, pulky, murphydog, bugbuka, GreatKevin, TCSCODER
140+
* @version 1.6
134141
*/
135142
public class ProjectManagerImpl implements ProjectManager {
136143
/**
@@ -1615,4 +1622,15 @@ public boolean[] requireBillingProjectsCCA(long[] billingProjectIds) throws Pers
16151622

16161623
return requiredCCAs;
16171624
}
1625+
1626+
/**
1627+
* Get all project groups
1628+
*
1629+
* @return array of all project group
1630+
* @throws PersistenceException if any database related exception occur
1631+
* @since 1.6
1632+
*/
1633+
public ProjectGroup[] getAllProjectGroups() throws PersistenceException {
1634+
return persistence.getAllProjectGroups();
1635+
}
16181636
}

components/project_management/src/java/main/com/topcoder/management/project/ProjectPersistence.java

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2006 - 2013 TopCoder Inc., All Rights Reserved.
2+
* Copyright (C) 2006 - 2017 TopCoder Inc., All Rights Reserved.
33
*/
44
package com.topcoder.management.project;
55

@@ -88,14 +88,21 @@
8888
* <li>Added method {@link #getAllProjectPlatforms()}</li>
8989
* </ul>
9090
* </p>
91-
*
91+
*
92+
* <p>
93+
* Version 1.6 (TOPCODER - SUPPORT GROUPS CONCEPT FOR CHALLENGES):
94+
* <ul>
95+
* <li>Added {@link #getAllProjectGroups()}</li>
96+
* </ul>
97+
* </p>
98+
*
9299
* <p>
93100
* Thread safety: The implementations of this interface do not have to be thread
94101
* safe.
95102
* </p>
96103
*
97-
* @author tuenm, iamajia, pulky, murphydog, bugbuka, GreatKevin
98-
* @version 1.5
104+
* @author tuenm, iamajia, pulky, murphydog, bugbuka, GreatKevin, TCSCODER
105+
* @version 1.6
99106
*/
100107
public interface ProjectPersistence {
101108
/**
@@ -1019,4 +1026,13 @@ public List<SimplePipelineData> getSimplePipelineData(long userId, Date startDat
10191026
*/
10201027
public void saveSoftwareCheckpointSubmissionsGeneralFeedback(long contestId, String feedback)
10211028
throws PersistenceException;
1029+
1030+
/**
1031+
* Get all project groups
1032+
*
1033+
* @return array of all project group
1034+
* @throws PersistenceException if any database related exception occur
1035+
* @since 1.6
1036+
*/
1037+
public ProjectGroup[] getAllProjectGroups() throws PersistenceException;
10221038
}

0 commit comments

Comments
 (0)