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

Commit 512a26b

Browse files
authored
Merge pull request #335 from appirio-tech/dev
env and code repo attribute support
2 parents dc05048 + 2651cc0 commit 512a26b

File tree

15 files changed

+46
-84
lines changed

15 files changed

+46
-84
lines changed

components/project_management/build.xml

+2
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@
143143
<property name="junit.jar" value="${ext_libdir}/junit/3.8.2/junit.jar"/>
144144
<property name="j2ee.jar" value="${ext_libdir}/j2ee/j2ee.jar"/>
145145
<property name="ifxjdbc.jar" value="${ext_libdir}/informix/ifxjdbc.jar"/>
146+
<property name="encoder-1.2.1.jar" value="${ext_libdir}/owasp/encoder-1.2.1.jar"/>
146147

147148
<!-- Java Locations -->
148149
<property name="java_1_3_bootclasspath" value="c:\program files\JavaSoft\JRE\1.3.1\lib\rt.jar"/>
@@ -160,6 +161,7 @@
160161
<pathelement location="${jaxb-api.jar}"/>
161162
<pathelement location="${j2ee.jar}"/>
162163
<pathelement location="${ifxjdbc.jar}"/>
164+
<pathelement location="${encoder-1.2.1.jar}"/>
163165
<pathelement location="${logging_wrapper.jar}" />
164166
<pathelement location="${typesafe_enum.jar}" />
165167
<pathelement location="${data_validation.jar}" />

components/project_management/src/java/main/com/topcoder/management/project/persistence/AbstractInformixProjectPersistence.java

+7-4
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
import com.topcoder.util.sql.databaseabstraction.CustomResultSet;
6868
import com.topcoder.util.sql.databaseabstraction.InvalidCursorStateException;
6969
import com.topcoder.util.sql.databaseabstraction.NullColumnValueException;
70+
import org.owasp.encoder.Encode;
7071

7172
/**
7273
* <p>
@@ -5985,13 +5986,15 @@ private void createProjectProperties(Long projectId, Project project, Map idValu
59855986
for (Iterator it = idValueMap.entrySet().iterator(); it.hasNext();) {
59865987
Entry entry = (Entry) it.next();
59875988

5989+
Long key = (Long) entry.getKey();
5990+
String value = (String) entry.getValue();
5991+
value = Encode.forHtml(value);
59885992
// insert the project property into database
5989-
Object[] queryArgs = new Object[] {projectId, entry.getKey(),
5990-
entry.getValue(), operator, operator };
5993+
Object[] queryArgs = new Object[] {projectId, key,
5994+
value, operator, operator };
59915995
Helper.doDMLQuery(preparedStatement, queryArgs);
59925996

5993-
auditProjectInfo(conn, projectId, project, AUDIT_CREATE_TYPE, (Long) entry.getKey(),
5994-
(String) entry.getValue());
5997+
auditProjectInfo(conn, projectId, project, AUDIT_CREATE_TYPE, key, value);
59955998
}
59965999

59976000
} catch (SQLException e) {

src/web/WEB-INF/includes/contest/editTab.jsp

-19
Original file line numberDiff line numberDiff line change
@@ -804,19 +804,6 @@
804804
<div class="bottom_spec">
805805
</div>
806806

807-
<div class="hide">
808-
<p class="det_font">
809-
<span class="name"><strong>Environment </strong></span>
810-
<br />
811-
<span class="small_info_spec" id="rswEnvironment"></span>
812-
<br /><br/>
813-
<span class="name"><strong>Code repo </strong> </span>
814-
<br />
815-
<span class="small_info_spec" id="rswRepo"></span>
816-
</p>
817-
<div class="bottom_spec"></div>
818-
</div>
819-
820807
<p class="det_font">
821808
<span class="name"><strong>Final Deliverables</strong></span>
822809
<br />
@@ -883,12 +870,6 @@
883870

884871
</div>
885872
<!-- end .guidelines -->
886-
<div class="envRepo hide">
887-
<h3>Environment</h3>
888-
<input class="environmentEdit" name="environmentEdit" type="text" maxlength="500"/>
889-
<h3>Code Repo</h3>
890-
<input type="text" class="repoEdit" maxlength="500" />
891-
</div>
892873
</div> <!-- end .contestDetail -->
893874
<div class="deliverables">
894875
<h3><span class="icon">Final Deliverables:</span><a href="javascript:;" class="helpIcon"><span class="hide">Help</span></a></h3>

src/web/WEB-INF/includes/contest/editTabMarathon.jsp

+5-3
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@
530530
</div>
531531
</p>
532532
<div class="bottom_spec"></div>
533-
<div class="hide">
533+
<%--
534534
<p class="det_font">
535535
<span class="name"><strong>Environment </strong></span>
536536
<br />
@@ -541,7 +541,7 @@
541541
<span class="small_info_spec" id="rswRepo"></span>
542542
</p>
543543
<div class="bottom_spec"></div>
544-
</div>
544+
--%>
545545
</div><!-- End .detailsContent -->
546546
</div><!-- End .details -->
547547
<!-- END Spec Display -->
@@ -589,12 +589,14 @@
589589

590590
</div>
591591
<!-- end .guidelines -->
592-
<div class="envRepo hide">
592+
<%--
593+
<div class="envRepo">
593594
<h3>Environment</h3>
594595
<input class="environmentEdit" name="environmentEdit" type="text" maxlength="500"/>
595596
<h3>Code Repo</h3>
596597
<input type="text" class="repoEdit" maxlength="500" />
597598
</div>
599+
--%>
598600
</div> <!-- end .contestDetail -->
599601

600602
</div> <!-- End .launchContestOut -->

src/web/WEB-INF/includes/contest/editTabSoftware.jsp

+5-3
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@
840840
</div>
841841
</div>
842842
<!-- End .component -->
843-
<div class="hide">
843+
844844
<p class="det_font">
845845
<span class="name"><strong>Environment </strong></span>
846846
<br />
@@ -851,7 +851,7 @@
851851
<span class="small_info_spec" id="rswRepo"></span>
852852
</p>
853853
<div class="bottom_spec"></div>
854-
</div>
854+
855855
</div><!-- End .detailsContent -->
856856
</div><!-- End .details -->
857857
<!-- END Spec Display -->
@@ -957,12 +957,14 @@
957957
</div> <!-- end of prizesInner_tech -->
958958
</div>
959959
</s:if>
960-
<div class="envRepo hide">
960+
961+
<div class="envRepo">
961962
<h3>Environment</h3>
962963
<input class="environmentEdit" name="environmentEdit" type="text" maxlength="500"/>
963964
<h3>Code Repo</h3>
964965
<input type="text" class="repoEdit" maxlength="500" />
965966
</div>
967+
966968
</div> <!-- end .contestDetail -->
967969
</div> <!-- End .launchContestOut -->
968970

src/web/WEB-INF/includes/launch/overview.jsp

-10
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,7 @@
6868
</div>
6969
</div>
7070
<!-- end round 2 information -->
71-
<!-- Environment -->
72-
<div class="prizes hide">
73-
<h3>Environment :</h3>
74-
<input class="environmentEdit text" name="environmentEdit" type="text" maxlength="500"/>
75-
</div>
7671

77-
<!-- repo -->
78-
<div class="prizes hide">
79-
<h3>Code Repo :</h3>
80-
<input class="repoEdit text" name="repo" type="text" maxlength="500"/>
81-
</div>
8272
<!-- upload -->
8373
<div id="uploadSection">
8474

src/web/WEB-INF/includes/launch/overviewAlgorithm.jsp

+4-2
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,19 @@
4646
</div>
4747
</div>
4848
<!-- end Match Rules -->
49+
<%--
4950
<!-- Environment -->
50-
<div class="prizes hide">
51+
<div class="prizes">
5152
<h3>Environment :</h3>
5253
<input class="environmentEdit text" name="environmentEdit" type="text" maxlength="500"/>
5354
</div>
5455
5556
<!-- repo -->
56-
<div class="prizes hide">
57+
<div class="prizes">
5758
<h3>Code Repo :</h3>
5859
<input class="repoEdit text" name="repo" type="text" maxlength="500"/>
5960
</div>
61+
--%>
6062
<!-- upload -->
6163
<div id="alUploadSection">
6264
<h3>File Upload (20MB maximum):</h3>

src/web/WEB-INF/includes/launch/overviewSoftware.jsp

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,13 @@
110110
</div> <!-- end of prizesInner_tech -->
111111
</div>
112112
<!-- Environment -->
113-
<div class="prizes hide">
113+
<div class="prizes">
114114
<h3>Environment :</h3>
115115
<input class="environmentEdit text" name="environmentEdit" type="text" maxlength="500"/>
116116
</div>
117117

118118
<!-- repo -->
119-
<div class="prizes hide">
119+
<div class="prizes">
120120
<h3>Code Repo :</h3>
121121
<input class="repoEdit text" name="repo" type="text" maxlength="500"/>
122122
</div>

src/web/WEB-INF/includes/launch/review.jsp

-6
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,6 @@
7979

8080
<dt class="rMultiInfo">Round Two Information :</dt>
8181
<dd class="rMultiInfo"><span id="rRound2Info"></span><a href="javascript: showPage('overviewPage');" class="tipLink"><img src="/images/edit-icon.png" alt="Edit"/></a> </dd>
82-
83-
<dt>Environment :</dt>
84-
<dd class="rEnvironment"><a href="javascript: backReview();" class="tipLink"><img src="/images/edit-icon.png" alt="Edit"/></a> </dd>
85-
86-
<dt>Code Repo :</dt>
87-
<dd class="rRepo"><a href="javascript: backReview();" class="tipLink"><img src="/images/edit-icon.png" alt="Edit"/></a> </dd>
8882
</dl>
8983
</div>
9084
<!-- end .contentList -->

src/web/WEB-INF/includes/launch/reviewAlgorithm.jsp

+2-1
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,13 @@
6262

6363
<dt>Match Rules :</dt>
6464
<dd><span id="ralMatchRules"></span><a href="javascript: showPage('overviewAlgorithmPage');" class="tipLink"><img src="/images/edit-icon.png" alt="Edit"/></a> </dd>
65-
65+
<%--
6666
<dt>Environment :</dt>
6767
<dd class="rEnvironment"><a href="javascript: backReview();" class="tipLink"><img src="/images/edit-icon.png" alt="Edit"/></a> </dd>
6868
6969
<dt>Code Repo :</dt>
7070
<dd class="rRepo"><a href="javascript: backReview();" class="tipLink"><img src="/images/edit-icon.png" alt="Edit"/></a> </dd>
71+
--%>
7172
</dl>
7273
</div>
7374
<!-- end .contentList -->

src/web/WEB-INF/includes/launch/reviewSoftware.jsp

+1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989

9090
<dt>Code Repo :</dt>
9191
<dd class="rRepo"><a href="javascript: backReview();" class="tipLink"><img src="/images/edit-icon.png" alt="Edit"/></a> </dd>
92+
9293
</dl>
9394
</div>
9495
<!-- end .contentList -->

src/web/scripts/launch/contestDetailSoftware.js

+9-4
Original file line numberDiff line numberDiff line change
@@ -353,12 +353,16 @@ $(document).ready(function(){
353353

354354
$(mainWidget.softwareCompetition.groups).each(function(i, val){
355355
if (additionGroups.indexOf(val) > -1){
356-
currentData.unshift({id: val, name: mainWidget.softwareCompetition.groupNames[i], disabled: true, selected: true})
356+
currentData.unshift({id: val, name: mainWidget.softwareCompetition.groupNames[i], selected: true})
357357
}
358358
});
359359
groupCancel = true;
360+
if (currentData.length > 0 ){
361+
jQuery_1_11_1("#groups").magicSuggest().enable();
362+
}
360363
jQuery_1_11_1("#groups").magicSuggest().setData(currentData);
361364
jQuery_1_11_1("#groups").magicSuggest().setValue(mainWidget.softwareCompetition.groups);
365+
362366
groupCancel = false;
363367
},
364368
function(errorMessage) {
@@ -2858,9 +2862,10 @@ function saveSpecSection() {
28582862
return;
28592863
}
28602864

2861-
mainWidget.softwareCompetition.projectHeader.properties[ENVIRONMENT] = $(".environmentEdit").val().trim();
2862-
mainWidget.softwareCompetition.projectHeader.properties[CODE_REPO] = $(".repoEdit").val().trim();
2863-
2865+
if (!mainWidget.isStudioContest()){
2866+
mainWidget.softwareCompetition.projectHeader.properties[ENVIRONMENT] = ($(".environmentEdit").val() || "").trim();
2867+
mainWidget.softwareCompetition.projectHeader.properties[CODE_REPO] = ($(".repoEdit").val() || "").trim();
2868+
}
28642869
var saveDraftHandler = function () {
28652870

28662871
//construct request data

src/web/scripts/launch/pages/overview.js

+6-19
Original file line numberDiff line numberDiff line change
@@ -459,17 +459,10 @@ function continueOverview() {
459459
if(!validateFieldsOverview()) {
460460
return;
461461
}
462-
463-
var environmentEdit = $(".environmentEdit:visible").val();
464-
if (environmentEdit) {
465-
mainWidget.softwareCompetition.projectHeader.properties[ENVIRONMENT] = environmentEdit.trim();
466-
}
467-
468-
var repoEdit = $(".repoEdit:visible").val();
469-
if (repoEdit) {
470-
mainWidget.softwareCompetition.projectHeader.properties[CODE_REPO] = repoEdit.trim();
462+
if (!mainWidget.isStudioContest()) {
463+
mainWidget.softwareCompetition.projectHeader.properties[ENVIRONMENT] = ($(".environmentEdit:visible").val() || "").trim();
464+
mainWidget.softwareCompetition.projectHeader.properties[CODE_REPO] = ($(".repoEdit:visible").val() || "").trim();
471465
}
472-
473466
var backLink = '<a href="javascript: backReview();" class="tipLink"><img src="/images/edit-icon.png" alt="Edit"/></a>';
474467
$(".rEnvironment").html(mainWidget.softwareCompetition.projectHeader.properties[ENVIRONMENT] + backLink);
475468
$(".rRepo").html(mainWidget.softwareCompetition.projectHeader.properties[CODE_REPO] + backLink);
@@ -491,16 +484,10 @@ function saveAsDraftOverview() {
491484
return;
492485
}
493486

494-
var environmentEdit = $(".environmentEdit:visible").val();
495-
if (environmentEdit) {
496-
mainWidget.softwareCompetition.projectHeader.properties[ENVIRONMENT] = environmentEdit.trim();
487+
if (!mainWidget.isStudioContest()) {
488+
mainWidget.softwareCompetition.projectHeader.properties[ENVIRONMENT] = ($(".environmentEdit").val() || "").trim();
489+
mainWidget.softwareCompetition.projectHeader.properties[CODE_REPO] = ($(".repoEdit").val() || "").trim();
497490
}
498-
499-
var repoEdit = $(".repoEdit:visible").val();
500-
if (repoEdit) {
501-
mainWidget.softwareCompetition.projectHeader.properties[CODE_REPO] = repoEdit.trim();
502-
}
503-
504491
var saveDraftHandler = function () {
505492
//construct request data
506493
var request = saveAsDraftRequest();

src/web/scripts/launch/pages/selection.js

-3
Original file line numberDiff line numberDiff line change
@@ -501,9 +501,6 @@ function continueContestSelection() {
501501
$(".overviewData .rGroups td span").remove();
502502
$(groupsSpan).insertBefore(".overviewData .rGroups td a");
503503

504-
$(".environmentEdit").val(mainWidget.softwareCompetition.projectHeader.properties[ENVIRONMENT]);
505-
$(".repoEdit").val(mainWidget.softwareCompetition.projectHeader.properties[CODE_REPO]);
506-
507504
if(mainWidget.isSoftwareContest()) {
508505
showPage('overviewSoftwarePage');
509506

src/web/scripts/magicsuggest.js

+3-8
Original file line numberDiff line numberDiff line change
@@ -357,9 +357,7 @@
357357
/**
358358
* type to validate against
359359
*/
360-
vtype: null,
361-
362-
selected: 'selected'
360+
vtype: null
363361
};
364362

365363
var conf = $.extend({},options);
@@ -1042,11 +1040,8 @@
10421040
'class': 'ms-sel-item ' + cfg.selectionCls + validCls,
10431041
html: selectedItemHtml
10441042
}).data('json', value);
1045-
var canDelete = true;
1046-
if (typeof(value[cfg.selected]) !== 'undefined' && value[cfg.selected] === true) {
1047-
canDelete = false;
1048-
}
1049-
if(cfg.disabled === false && canDelete){
1043+
1044+
if(cfg.disabled === false){
10501045
// small cross img
10511046
delItemEl = $('<span/>', {
10521047
'class': 'ms-close-btn'

0 commit comments

Comments
 (0)