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

Commit c1e5d29

Browse files
author
ykohata
committed
Merge branch 'technology-2015-01-08'
2 parents 90be7c4 + 3c44910 commit c1e5d29

Some content is hidden

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

53 files changed

+2262
-1015
lines changed

build-dependencies.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@
446446
<property name="dom4j-1.6.1.jar" value="${poi_libdir}/ooxml-lib/dom4j-1.6.1.jar"/>
447447
<property name="xmlbeans-2.3.0.jar" value="${poi_libdir}/ooxml-lib/xmlbeans-2.3.0.jar"/>
448448

449-
<property name="java-jwt-0.2.jar" value="${ext_libdir}/jwt/java-jwt-0.2.jar"/>
449+
<property name="java-jwt-1.0.0.jar" value="${ext_libdir}/jwt/java-jwt-1.0.0.jar"/>
450450

451451
<!-- Http Client libs -->
452452
<property name="httpclient_libdir" value="${ext_libdir}/httpclient"/>
@@ -650,7 +650,7 @@
650650
<pathelement location="${scribe.jar}"/>
651651
<pathelement location="${jsr311.jar}"/>
652652
<pathelement location="${cxf.jar}"/>
653-
<pathelement location="${java-jwt-0.2.jar}"/>
653+
<pathelement location="${java-jwt-1.0.0.jar}"/>
654654
</path>
655655

656656
</project>

build.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@
316316
<copy file="${jackson-databind-2.3.2.jar}" todir="${ear_shared_libdir}" overwrite="true"/>
317317

318318
<copy file="${yuicompressor.jar}" todir="${ear_shared_libdir}" overwrite="true"/>
319-
<copy file="${java-jwt-0.2.jar}" todir="${ear_shared_libdir}" overwrite="true"/>
319+
<copy file="${java-jwt-1.0.0.jar}" todir="${ear_shared_libdir}" overwrite="true"/>
320320

321321
<!-- EJB components -->
322322
<copy file="${catalog_services_id_generator.jar}" todir="${build_distdir}/ejb" overwrite="true"/>

conf/Direct.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ CONTEST_SERVICE_FACADE_PROVIDER_URL=@CONTEST_SERVICE_PROVIDER_URL@
1313
DOMAIN_AUTH0 = @DOMAIN_AUTH0@
1414
CLIENT_ID_AUTH0 = @CLIENT_ID_AUTH0@
1515
CLIENT_SECRET_AUTH0 = @CLIENT_SECRET_AUTH0@
16+
JWT_EXPIRATION_SECONDS = @JWT_EXPIRATION_SECONDS@
1617
LDAP_AUTH0_CONNECTION_NAME = @LDAP_AUTH0_CONNECTION_NAME@
1718
REDIRECT_URL_AUTH0 = /reg2/callback.action
1819
REG_SERVER_NAME= @REG_SERVER_NAME@

conf/token.properties

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,3 +227,78 @@ j#######################################################
227227
@projectCreationEmailCCAddresses@=testuser3@topcoder.com;testuser4@topcoder.com
228228
@projectCreationEmailTemplatePath@=email_templates/direct_project_creation_email_template.txt
229229
@projectCreationEmailFromAddress@=service@topcoder.com
230+
231+
#######################################
232+
# Payment Dashboard #
233+
#######################################
234+
@paypal.baseUrl@=https://api-3t.sandbox.paypal.com/nvp
235+
@paypal.username@=
236+
@paypal.password@=
237+
@paypal.signature@=
238+
@payoneer.baseApiUrl@=
239+
@payoneer.username@=
240+
@payoneer.password@=
241+
@payoneer.partnerId@=
242+
@paymemtStatsService.resultLimit@=10
243+
@paymentsService.paymentMethodID@=2
244+
#@payoneerService@=com.topcoder.direct.services.payments.impl.PayoneerServiceImpl
245+
@payoneerService@=com.topcoder.direct.services.payments.impl.MockPayoneerServiceImpl
246+
@westernUnionBalanceFileName@=/mnt/shared/western.txt
247+
@paymentsByStatusByDays@=30,60,120
248+
249+
#######################################
250+
# Wireframe Submissions Configuration #
251+
#######################################
252+
@wireframeDirectory@=/home/direct/wireframeDirectory
253+
@wireframeIndexPage@=submission/index.html
254+
@trustedIPs@=192.168.150.250;202.120.2.101
255+
@watermarkImageMapping@=/viewWireframePage/;/css/direct/WatermarkTcRepeat.css
256+
257+
#########################
258+
# Assets configuration #
259+
#########################
260+
@assetUploadBasePath@=/tmp/assetupload
261+
@assetUploadTempFileRoot@=/tmp/assetuploadtemp
262+
263+
##################
264+
# Project Tasks #
265+
##################
266+
@taskEmailSender@=donotreply@topcoder.com
267+
@taskCreationEmailSubjectTemplateText@=(%PROJECT_NAME%) Task created and assigned to you\\: %TASK_NAME%
268+
@taskCreationEmailBodyTemplatePath@=email_templates/create_task_email_template.txt
269+
@taskStatusChangeEmailSubjectTemplateText@=(%PROJECT_NAME%) Task status changed to %UPDATED_TASK_STATUS%\\: %TASK_NAME%
270+
@taskStatusChangeEmailBodyTemplatePath@=email_templates/update_task_status_email_template.txt
271+
272+
#OAuth settings.
273+
@oauth.authorizationURL@=https://api.login.yahoo.com/oauth/v2/request_auth?oauth_token=%s
274+
@oauth.callBackActionUrl@=https://cockpit.cloud.topcoder.com/direct/marathonmatch/callBack.action
275+
@oauth.consumerKey@=--
276+
@oauth.consumerSecret@=
277+
@oauth.providerClass@=org.scribe.builder.api.YahooApi
278+
279+
##################################################
280+
# Marathon Match Analytics Service Configuration #
281+
##################################################
282+
@api_server_domain@=
283+
@apiKey@=
284+
@clientId@=test
285+
@clientSecret@=test
286+
287+
#######################################
288+
# Contest Creation SNS Configuration #
289+
#######################################
290+
@amazonSNSAccessKey@=
291+
@amazonSNSSecretKey@=
292+
@contestCreationArn@=
293+
@contestCreationSubject@=cmc challenge contest creation
294+
@contestUpdateSubject@=cmc challenge contest update
295+
@contestCreationMessageTemplatePath@=contest_creation_sns_message.txt
296+
@contestUpdateMessageTemplatePath@=contest_update_sns_message.txt
297+
298+
299+
@DOMAIN_AUTH0@=
300+
@CLIENT_ID_AUTH0@=
301+
@CLIENT_SECRET_AUTH0@=
302+
@JWT_EXPIRATION_SECONDS@=36000000
303+
@REG_SERVER_NAME@=tc.cloud.topcoder.com
304+
@LDAP_AUTH0_CONNECTION_NAME@=vm-ldap-connection

conf/web/WEB-INF/applicationContext.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,11 @@
583583
<property name="milestoneService" ref="milestoneService"/>
584584
</bean>
585585

586+
<bean id="saveChallengeConfirmation"
587+
class="com.topcoder.direct.services.view.action.setting.ChallengeConfirmationPreferenceAction"
588+
scope="prototype" parent="baseDirectStrutsAction">
589+
</bean>
590+
586591
<bean id="contestSubmissionsAction"
587592
class="com.topcoder.direct.services.view.action.contest.ContestSubmissionsAction"
588593
scope="prototype" parent="baseDirectStrutsAction">

conf/web/WEB-INF/struts.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1666,6 +1666,12 @@
16661666
<result name="error" type="json"/>
16671667
</action>
16681668

1669+
<action name="saveChallengeConfirmation" method="updateChallengeConfirmationPreference" class="saveChallengeConfirmation">
1670+
<interceptor-ref name="securedDefaultStack"/>
1671+
<result name="success" type="json"/>
1672+
<result name="error" type="json"/>
1673+
</action>
1674+
16691675
</package>
16701676

16711677
<package name="my" namespace="/my" extends="base">
1.17 MB
Binary file not shown.

src/java/main/com/topcoder/direct/services/view/action/contest/launch/GetContestAction.java

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import com.topcoder.direct.services.project.milestone.model.SortOrder;
1111
import com.topcoder.direct.services.view.action.analytics.longcontest.MarathonMatchHelper;
1212
import com.topcoder.direct.services.view.action.analytics.longcontest.services.MarathonMatchAnalyticsService;
13+
import com.topcoder.direct.services.view.action.setting.ChallengeConfirmationPreferenceAction;
1314
import com.topcoder.direct.services.view.dto.cloudvm.VMInstanceData;
1415
import com.topcoder.direct.services.view.dto.cloudvm.VMInstanceStatus;
1516
import com.topcoder.direct.services.view.dto.contest.ContestCopilotDTO;
@@ -30,6 +31,9 @@
3031
import com.topcoder.service.project.CompetionType;
3132
import com.topcoder.service.project.ProjectData;
3233
import com.topcoder.service.project.SoftwareCompetition;
34+
import com.topcoder.shared.util.DBMS;
35+
import com.topcoder.web.common.RowNotFoundException;
36+
import com.topcoder.web.ejb.user.UserPreference;
3337
import org.apache.struts2.ServletActionContext;
3438

3539
import org.apache.commons.lang.math.NumberUtils;
@@ -242,8 +246,16 @@
242246
* load these data via ajax instead after the page finishes loading.
243247
* </p>
244248
*
245-
* @author fabrizyo, FireIce, isv, morehappiness, GreatKevin, minhu, Veve, Ghost_141, GreatKevin, Veve
246-
* @version 3.0
249+
* <p>
250+
* Version 3.1 (TopCoder Direct - Draft Challenge Creation/Saving Prompt)
251+
* <ul>
252+
* <li>Adds the {@link #showSaveChallengeConfirmation} and its getter</li>
253+
* <li>Updates {@link #executeAction()} to populate the {@link #showSaveChallengeConfirmation}</li>
254+
* </ul>
255+
* </p>
256+
*
257+
* @author fabrizyo, FireIce, isv, morehappiness, GreatKevin, minhu, Veve, Ghost_141, GreatKevin, Veve, GreatKevin
258+
* @version 3.1
247259
*/
248260
public class GetContestAction extends ContestAction {
249261
/**
@@ -359,6 +371,13 @@ public class GetContestAction extends ContestAction {
359371
*/
360372
private int timelineInterval;
361373

374+
/**
375+
* The preference value of whether to show the save challenge confirmation.
376+
*
377+
* @since 3.1
378+
*/
379+
private boolean showSaveChallengeConfirmation;
380+
362381
/**
363382
* <p>
364383
* Creates a <code>GetContestAction</code> instance.
@@ -524,6 +543,17 @@ protected void executeAction() throws Exception {
524543
billingAccountsForProject.add(billingAccount);
525544
}
526545

546+
UserPreference userPreference = this.getUserPreferenceHome().create();
547+
548+
try {
549+
String value = userPreference.getValue(DirectUtils.getTCSubjectFromSession().getUserId(),
550+
ChallengeConfirmationPreferenceAction.CHALLENGE_CONFIRMATION_PREFERENCE_ID,
551+
DBMS.COMMON_OLTP_DATASOURCE_NAME);
552+
this.showSaveChallengeConfirmation = Boolean.valueOf(value);
553+
} catch (RowNotFoundException rfe) {
554+
this.showSaveChallengeConfirmation = true;
555+
}
556+
527557
// Set current project context based on selected contest
528558
getSessionData().setCurrentProjectContext(contestStats.getContest().getProject());
529559
getSessionData().setCurrentSelectDirectProjectID(contestStats.getContest().getProject().getId());
@@ -968,4 +998,14 @@ public static enum TYPE {
968998
COPILOT_CONTEST, CONTEST, CONTEST_JSON
969999
}
9701000

1001+
/**
1002+
* Gets whether to show the save challenge confirmation.
1003+
*
1004+
* @return true if show, false otherwise.
1005+
* @since 3.1
1006+
*/
1007+
public boolean isShowSaveChallengeConfirmation() {
1008+
return showSaveChallengeConfirmation;
1009+
}
1010+
9711011
}

src/java/main/com/topcoder/direct/services/view/action/contest/launch/LaunchContestAction.java

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,17 @@
66
import com.topcoder.direct.services.project.milestone.model.Milestone;
77
import com.topcoder.direct.services.project.milestone.model.MilestoneStatus;
88
import com.topcoder.direct.services.project.milestone.model.SortOrder;
9+
import com.topcoder.direct.services.view.action.setting.ChallengeConfirmationPreferenceAction;
910
import com.topcoder.direct.services.view.dto.CommonDTO;
1011
import com.topcoder.direct.services.view.dto.IdNamePair;
1112
import com.topcoder.direct.services.view.dto.contest.ContestCopilotDTO;
1213
import com.topcoder.direct.services.view.util.DataProvider;
1314
import com.topcoder.direct.services.view.util.DirectUtils;
1415
import com.topcoder.direct.services.view.util.SessionData;
1516
import com.topcoder.security.TCSubject;
17+
import com.topcoder.shared.util.DBMS;
18+
import com.topcoder.web.common.RowNotFoundException;
19+
import com.topcoder.web.ejb.user.UserPreference;
1620
import org.apache.struts2.ServletActionContext;
1721

1822
import javax.servlet.http.HttpServletRequest;
@@ -67,8 +71,16 @@
6771
* load these data via ajax instead after the page finishes loading.
6872
* </p>
6973
*
70-
* @author BeBetter, duxiaoyang, GreatKevin, Veve, Veve
71-
* @version 1.5
74+
* <p>
75+
* Version 1.6 (TopCoder Direct - Draft Challenge Creation/Saving Prompt)
76+
* <ul>
77+
* <li>Adds the {@link #showSaveChallengeConfirmation} and its getter</li>
78+
* <li>Updates {@link #executeAction()} to populate the {@link #showSaveChallengeConfirmation}</li>
79+
* </ul>
80+
* </p>
81+
*
82+
* @author BeBetter, duxiaoyang, GreatKevin, Veve, Veve, GreatKevin
83+
* @version 1.6
7284
*/
7385
public class LaunchContestAction extends ContestAction {
7486
private CommonDTO viewData = new CommonDTO();
@@ -94,6 +106,13 @@ public class LaunchContestAction extends ContestAction {
94106
*/
95107
private IdNamePair cmcBillingAccount;
96108

109+
/**
110+
* The preference value of whether to show the save challenge confirmation.
111+
*
112+
* @since 1.6
113+
*/
114+
private boolean showSaveChallengeConfirmation;
115+
97116
/**
98117
* <p>
99118
* Executes the action. Does nothing for now.
@@ -116,6 +135,18 @@ protected void executeAction() throws Exception {
116135
if(getCmcAccountId() != null && getCmcAccountId().trim().length() > 0) {
117136
setCmcBillingAccount(DataProvider.getBillingAccountFromCMCAccountID(getCmcAccountId()));
118137
}
138+
139+
UserPreference userPreference = this.getUserPreferenceHome().create();
140+
141+
try {
142+
String value = userPreference.getValue(DirectUtils.getTCSubjectFromSession().getUserId(),
143+
ChallengeConfirmationPreferenceAction.CHALLENGE_CONFIRMATION_PREFERENCE_ID,
144+
DBMS.COMMON_OLTP_DATASOURCE_NAME);
145+
this.showSaveChallengeConfirmation = Boolean.valueOf(value);
146+
} catch (RowNotFoundException rfe) {
147+
this.showSaveChallengeConfirmation = true;
148+
}
149+
119150
}
120151

121152
public CommonDTO getViewData() {
@@ -253,4 +284,14 @@ public IdNamePair getCmcBillingAccount() {
253284
public void setCmcBillingAccount(IdNamePair cmcBillingAccount) {
254285
this.cmcBillingAccount = cmcBillingAccount;
255286
}
287+
288+
/**
289+
* Gets whether to show the save challenge confirmation.
290+
*
291+
* @return true if show, false otherwise.
292+
* @since 1.6
293+
*/
294+
public boolean isShowSaveChallengeConfirmation() {
295+
return showSaveChallengeConfirmation;
296+
}
256297
}

0 commit comments

Comments
 (0)