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

Commit 86572cd

Browse files
committed
Merge branch 'technology-2014-10-23'
2 parents 6dba7c8 + dabde07 commit 86572cd

File tree

78 files changed

+1786
-446
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+1786
-446
lines changed

build-dependencies.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@
408408
<property name="commons-fileupload-1.3.jar" value="${struts2_libdir}/commons-fileupload-1.3.jar"/>
409409
<property name="commons-io-2.0.1.jar" value="${struts2_libdir}/commons-io-2.0.1.jar"/>
410410
<property name="commons-lang-2.4.jar" value="${struts2_libdir}/commons-lang-2.4.jar"/>
411-
<property name="commons-lang3-3.1.jar" value="${struts2_libdir}/commons-lang3-3.1.jar"/>
411+
<property name="commons-lang3-3.3.2.jar" value="${struts2_libdir}/commons-lang3-3.3.2.jar"/>
412412
<property name="commons-logging-1.1.3.jar" value="${struts2_libdir}/commons-logging-1.1.3.jar"/>
413413
<property name="ezmorph-1.0.6.jar" value="${struts2_libdir}/ezmorph-1.0.6.jar"/>
414414
<property name="freemarker-2.3.19.jar" value="${struts2_libdir}/freemarker-2.3.19.jar"/>
@@ -478,7 +478,7 @@
478478
<pathelement location="${commons-fileupload-1.3.jar}"/>
479479
<pathelement location="${commons-io-2.0.1.jar}"/>
480480
<pathelement location="${commons-lang-2.4.jar}"/>
481-
<pathelement location="${commons-lang3-3.1.jar}"/>
481+
<pathelement location="${commons-lang3-3.3.2.jar}"/>
482482
<pathelement location="${commons-logging-1.1.3.jar}"/>
483483
<pathelement location="${ezmorph-1.0.6.jar}"/>
484484
<pathelement location="${freemarker-2.3.19.jar}"/>

build.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@
254254
<copy file="${commons-fileupload-1.3.jar}" todir="${ear_shared_libdir}" overwrite="true"/>
255255
<copy file="${commons-io-2.0.1.jar}" todir="${ear_shared_libdir}" overwrite="true"/>
256256
<copy file="${commons-lang-2.4.jar}" todir="${ear_shared_libdir}" overwrite="true"/>
257-
<copy file="${commons-lang3-3.1.jar}" todir="${ear_shared_libdir}" overwrite="true"/>
257+
<copy file="${commons-lang3-3.3.2.jar}" todir="${ear_shared_libdir}" overwrite="true"/>
258258
<copy file="${commons-logging-1.1.3.jar}" todir="${ear_shared_libdir}" overwrite="true"/>
259259
<copy file="${ezmorph-1.0.6.jar}" todir="${ear_shared_libdir}" overwrite="true"/>
260260
<copy file="${freemarker-2.3.19.jar}" todir="${ear_shared_libdir}" overwrite="true"/>

conf/web/WEB-INF/struts.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -892,6 +892,13 @@
892892
<result name="error" type="json"/>
893893
</action>
894894

895+
<action name="saveAppirioManagers" class="saveCockpitProjectSettingAction"
896+
method="saveAppirioManagers">
897+
<interceptor-ref name="securedProjectPreProcessorStack"/>
898+
<result name="success" type="json"/>
899+
<result name="error" type="json"/>
900+
</action>
901+
895902
<action name="addNewCustomMetadataKey" class="saveCockpitProjectSettingAction"
896903
method="addNewCustomMetadataKey">
897904
<interceptor-ref name="securedProjectPreProcessorStack"/>
-308 KB
Binary file not shown.
403 KB
Binary file not shown.

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

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -839,9 +839,17 @@
839839
* </ul>
840840
* </p>
841841
*
842+
* <p>
843+
* Version 3.2 (TopCoder Direct - Add Appirio Manager)
844+
* <ul>
845+
* <li>Updated {@link #createContestResources(com.topcoder.security.TCSubject, com.topcoder.service.project.SoftwareCompetition, long, boolean)}
846+
* to add Appirio Manager as manager resource if it's in the passed-in competition object</li>
847+
* </ul>
848+
* </p>
849+
*
842850
* @author snow01, pulky, murphydog, waits, BeBetter, hohosky, isv, tangzx, GreatKevin, lmmortal, minhu, GreatKevin, tangzx
843-
* @author isv, GreatKevin
844-
* @version 3.1
851+
* @author isv, GreatKevin, Veve
852+
* @version 3.2
845853
*/
846854
@Stateless
847855
@TransactionManagement(TransactionManagementType.CONTAINER)
@@ -3802,18 +3810,31 @@ private com.topcoder.management.resource.Resource[] createContestResources(TCSub
38023810
// check if contest contains copilot resource
38033811
com.topcoder.management.resource.Resource[] contestResources = contest.getResources();
38043812
com.topcoder.management.resource.Resource copilot = null;
3813+
com.topcoder.management.resource.Resource appirioManager = null;
38053814

38063815
// flag indicates whether current user is set as the copilot
38073816
boolean isCopilotCurrentUser = false;
3817+
boolean isAppirioManagerCurrentUser = false;
38083818

38093819
if (contestResources.length > 1) {
3810-
// contains copilot resource
3811-
copilot = contestResources[1];
3820+
for (int i = 1; i < contestResources.length; ++i) {
38123821

3813-
if(copilot.getProperty(RESOURCE_INFO_EXTERNAL_REFERENCE_ID).equals(String.valueOf(tcSubject.getUserId()))) {
3814-
isCopilotCurrentUser = true;
3815-
}
3822+
if (contestResources[i].getResourceRole().getId() == ResourceRole.RESOURCE_ROLE_COPILOT_ID) {
3823+
// contains copilot resource
3824+
copilot = contestResources[1];
38163825

3826+
if (copilot.getProperty(RESOURCE_INFO_EXTERNAL_REFERENCE_ID).equals(
3827+
String.valueOf(tcSubject.getUserId()))) {
3828+
isCopilotCurrentUser = true;
3829+
}
3830+
} else if (contestResources[i].getResourceRole().getId() == ResourceRole.RESOURCE_ROLE_MANAGER_ID) {
3831+
appirioManager = contestResources[i];
3832+
if (appirioManager.getProperty(RESOURCE_INFO_EXTERNAL_REFERENCE_ID).equals(
3833+
String.valueOf(tcSubject.getUserId()))) {
3834+
isAppirioManagerCurrentUser = true;
3835+
}
3836+
}
3837+
}
38173838
}
38183839

38193840
// create an array to store the resources, if copilot exists and copilot is not current user, we create
@@ -3850,8 +3871,9 @@ private com.topcoder.management.resource.Resource[] createContestResources(TCSub
38503871
boolean tcstaff = isRole(tcSubject, TC_STAFF_ROLE);
38513872
boolean isObserverCopilot = false;
38523873

3853-
// tc staff add as manager, other as observer
3854-
if (tcstaff) {
3874+
if (appirioManager != null) {
3875+
resources[0] = appirioManager;
3876+
} else if (tcstaff) {
38553877
resources[0].setResourceRole(managerRole);
38563878
} else if (contest.getProjectHeader().getSecurityGroupId() > 0) {
38573879
resources[0].setResourceRole(managerRole);
@@ -3865,7 +3887,7 @@ private com.topcoder.management.resource.Resource[] createContestResources(TCSub
38653887
}
38663888
}
38673889

3868-
if (!isObserverCopilot) {
3890+
if (!isObserverCopilot && appirioManager == null) {
38693891
// we don't override the copilot properties if the observer is the copilot
38703892
resources[0].setProperty(RESOURCE_INFO_EXTERNAL_REFERENCE_ID, String.valueOf(tcSubject.getUserId()));
38713893
resources[0].setProperty(RESOURCE_INFO_HANDLE, getUserName(tcSubject));
@@ -3937,6 +3959,11 @@ private com.topcoder.management.resource.Resource[] createContestResources(TCSub
39373959
existingResourceIds.add(Long.valueOf(r.getProperty(RESOURCE_INFO_EXTERNAL_REFERENCE_ID)));
39383960
}
39393961

3962+
if (appirioManager != null) {
3963+
allResources.add(appirioManager);
3964+
existingResourceIds.add(appirioManager.getUserId());
3965+
}
3966+
39403967
for (Permission p : permissions) {
39413968
if (!existingResourceIds.contains(p.getUserId())) {
39423969
com.topcoder.management.resource.Resource r = new com.topcoder.management.resource.Resource();

0 commit comments

Comments
 (0)