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

Commit 1183d70

Browse files
author
jamesdotcom
committed
Merge pull request #115 from appirio-tech/dev
merge from dev - release from 2015/12
2 parents c3f7efc + cdae686 commit 1183d70

File tree

171 files changed

+13275
-574
lines changed

Some content is hidden

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

171 files changed

+13275
-574
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ target/
77
token.properties
88
topcoder_global.properties
99
stacktrace.log
10+
/bin/
11+
.DS_Store
12+
*/.DS_Store

README.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,49 @@
11
direct-app
22
==========
33

4+
## building
5+
To build, download the docker build container that has all of the build dependencies. You can then run the container to build your local source code.
6+
7+
1. Clone the github source directory
8+
2. Rename `token.properties.docker` to `token.properties` in the source directory
9+
3. Rename `topcoder_global.properties.docker` to `topcoder_global.properties`
10+
4. Unzip [jboss-4.2.3.zip](http://downloads.sourceforge.net/project/jboss/JBoss/JBoss-4.2.3.GA/jboss-4.2.3.GA.zip?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fjboss%2Ffiles%2FJBoss%2FJBoss-4.2.3.GA%2F) in your root source directory. The build will place jboss deployment files here. It also needs some of its libraries for the build itself.
11+
5. Run the docker container to execute a build. The format of the command is `docker run --rm=true -v <source dir>:/data -t appiriodevops/tc-direct-app-build <ant target(s)>`.
12+
13+
For example, `docker run --rm=true -v /Users/james/dev/topcoder/direct-app:/data -t appiriodevops/tc-direct-app-build clean package-direct deploy-prod`
14+
15+
> NOTE: the source directory should be writeable to Docker so use a directory under `/Users/<username>`
16+
17+
## running locally
18+
In this configuration, we'll run the direct app in a docker container locally but it unfortunately requires many dependencies so we'll need to run several containers and connect to the dev database. To run, follow these steps.
19+
20+
> NOTE: it is assumed you are running with the latest Docker toolbox and Docker compose (1.5+)
21+
22+
1. Add this entry to your local /etc/hosts file: `<docker ip> docker.topcoder-dev.com`. This is needed for auth integration that requires the same top level domain. You can get the docker ip with the command `docker-machine ip default`
23+
2. Set the following environment variables:
24+
* TC_DEV_NAT_DIR : Local directory containing the pem file for accessing the dev NAT instance (used to create a tunnel to the dev informix instances)
25+
* TC_DIRECT_SRC_HOME : Local directory for the root direct-app directory
26+
* ASP_API_URL : Base URL for the ASP API (e.g., https://api.topcoder-dev.com)
27+
3. Run `docker-compose up` from the `docker` subdirectory containing the `docker-compose.yml` file
28+
29+
30+
This will start the app with an endpoint available on port 443. You can now go to https://docker.topcoder-dev.com/direct/enterpriseDashboard/activeContests.action
31+
32+
> NOTE: the SSL certificate is self-signed as will generate a warning/error when you access the site for the first time. Just accept it and continue.
33+
34+
---
35+
36+
37+
## **old** instructions
38+
439
Setup on VM:
540
* Once you get your VM, login into the VM with your private key and account 'direct'
641
* Back up token.properties and topcoder_global.properties in /home/direct/direct somewhere
742
* Delete the whole directory /home/direct/direct
843
* Git Clone the direct-app repo into folder /home/direct/direct.
944
* Copy the back up *.properties files back to /home/direct/direct
1045
* Among the *.properties, update topcoder_global.properties, add line 'direct_service_libdir=${libdir}/tcs/ejb' after tcs_libdir property
11-
* Make sure JDK7 is used: run
46+
* Make sure JDK7 is used: run
1247
* + export JAVA_HOME=/opt/jdk1.7.0_17
1348
* + export PATH=/opt/jdk1.7.0_17/bin:$PATH
1449

build-dependencies.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,11 +401,13 @@
401401
<property name="jai_codec-1.1.3.jar" value="${ext_libdir}/jai/jai_codec-1.1.3.jar"/>
402402
<property name="jai_core-1.1.3.jar" value="${ext_libdir}/jai/jai_core-1.1.3.jar"/>
403403

404+
<!--
404405
<property name="cxf.jar" value="${ext_libdir}/cxf/cxf-2.6.4.jar"/>
405406
<property name="aopalliance-1.0.jar" value="${ext_libdir}/cxf/aopalliance-1.0.jar"/>
406407
<property name="geronimo-jaxws_2.2_spec-1.1.jar" value="${ext_libdir}/cxf/geronimo-jaxws_2.2_spec-1.1.jar"/>
407408
<property name="geronimo-annotation_1.0_spec-1.1.1.jar" value="${ext_libdir}/cxf/geronimo-annotation_1.0_spec-1.1.1.jar"/>
408409
<property name="neethi-3.0.1.jar" value="${ext_libdir}/cxf/neethi-3.0.1.jar"/>
410+
-->
409411

410412
<!-- Struts 2 libs -->
411413
<property name="struts2_libdir" value="${ext_libdir}/struts"/>
@@ -472,6 +474,8 @@
472474
<!-- slf4j -->
473475
<property name="slf4j.jar" value="${ext_libdir}/mime-util/slf4j-api-1.5.11.jar"/>
474476

477+
<property name="asp-client.jar" value="${ext_libdir}/aspclient/asp-client.jar"/>
478+
475479

476480
<!-- EJB/Persistence libraries -->
477481
<path id="ejb.libs">
@@ -622,6 +626,10 @@
622626
<pathelement location="${scorecard_management.jar}"/>
623627
</path>
624628

629+
<path id="aspclient.libs">
630+
<fileset dir="${ext_libdir}/aspclient" includes="*.jar"/>
631+
</path>
632+
625633
<path id="component.3rdParty-dependencies">
626634
<path refid="struts.libs"/>
627635
<path refid="spring.libs"/>
@@ -648,9 +656,12 @@
648656
<pathelement location="${jackson-core-2.3.2.jar}"/>
649657
<pathelement location="${jackson-databind-2.3.2.jar}"/>
650658
<pathelement location="${scribe.jar}"/>
659+
<!--
651660
<pathelement location="${jsr311.jar}"/>
652661
<pathelement location="${cxf.jar}"/>
662+
-->
653663
<pathelement location="${java-jwt-1.0.0.jar}"/>
664+
<pathelement location="${asp-client.jar}"/>
654665
</path>
655666

656667
</project>

build.xml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
<!-- Override these in ../topcoder_global.properties -->
77
<property name="javadoc.locale" value="en_US"/>
88
<property name="javac.encoding" value="UTF-8"/>
9+
<property name="javac.source.ver" value="1.6"/>
10+
<property name="javac.target.ver" value="1.6"/>
911
<property name="debug" value="off"/>
1012
<property name="verbose" value="no"/>
1113
<available file="topcoder_global.properties" property="properties.exists"/>
@@ -119,15 +121,17 @@
119121
<target name="compile" description="compile the source code">
120122
<mkdir dir="${build_classdir}"/>
121123
<javac srcdir="${javamain}" destdir="${build_classdir}" includes="${packagedir}/**" debug="true"
122-
verbose="${verbose}" includeAntRuntime="no" encoding="${javac.encoding}">
124+
verbose="${verbose}" includeAntRuntime="no" encoding="${javac.encoding}"
125+
source="${javac.source.ver}" target="${javac.target.ver}">
123126
<classpath refid="buildlibs"/>
124127
</javac>
125128
</target>
126129

127130
<target name="marathonmatch_compile" description="compile the marathon match source code">
128131
<mkdir dir="${build_classdir}"/>
129132
<javac srcdir="${javamain}" destdir="${build_classdir}" includes="com/topcoder/marathonmatch/**" debug="true"
130-
verbose="${verbose}" includeantruntime="no" encoding="${javac.encoding}">
133+
verbose="${verbose}" includeantruntime="no" encoding="${javac.encoding}"
134+
source="${javac.source.ver}" target="${javac.target.ver}">
131135
<classpath refid="buildlibs" />
132136
</javac>
133137
</target>
@@ -287,12 +291,20 @@
287291
<copy file="${log4j.jar}" todir="${ear_shared_libdir}" overwrite="true"/>
288292
<copy file="${slf4j.jar}" todir="${ear_shared_libdir}" overwrite="true"/>
289293
<copy file="${scribe.jar}" todir="${ear_shared_libdir}" overwrite="true" />
294+
<!--
290295
<copy file="${jsr311.jar}" todir="${ear_shared_libdir}" overwrite="true"/>
291296
<copy file="${cxf.jar}" todir="${ear_shared_libdir}" overwrite="true"/>
297+
-->
298+
<copy file="${asp-client.jar}" todir="${ear_shared_libdir}" overwrite="true"/>
299+
<copy todir="${ear_shared_libdir}" overwrite="true">
300+
<fileset dir="${ext_libdir}/aspclient" includes="*.jar"/>
301+
</copy>
302+
<!--
292303
<copy file="${aopalliance-1.0.jar}" todir="${ear_shared_libdir}" overwrite="true"/>
293304
<copy file="${geronimo-jaxws_2.2_spec-1.1.jar}" todir="${ear_shared_libdir}" overwrite="true"/>
294305
<copy file="${geronimo-annotation_1.0_spec-1.1.1.jar}" todir="${ear_shared_libdir}" overwrite="true"/>
295306
<copy file="${neethi-3.0.1.jar}" todir="${ear_shared_libdir}" overwrite="true"/>
307+
-->
296308
<copy todir="${ear_shared_libdir}" overwrite="true">
297309
<fileset dir="${httpclient_libdir}">
298310
<include name="commons-codec-1.6.jar"/>

components/copilot_pool_and_profiles_services/conf/META-INF/mapping.hbm.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,12 @@
6464

6565
<class name="CopilotProject" table="copilot_project">
6666
<id name="id" column="copilot_project_id" type="long">
67+
<!-- use a sequence b/c rows are inserted by other processes too
6768
<generator class="increment"/>
69+
-->
70+
<generator class="sequence">
71+
<param name="sequence">copilot_project_sequence</param>
72+
</generator>
6873
</id>
6974
<property name="createDate" column="create_date" type="timestamp" update="false"/>
7075
<property name="createUser" column="create_user" type="string" update="false"/>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ public abstract class AbstractInformixProjectPersistence implements ProjectPersi
459459
*
460460
* @since 1.1.2
461461
*/
462-
public static final long PUBLIC_SUBMITTER_TERMS_ID = 21173;
462+
public static final long PUBLIC_SUBMITTER_TERMS_ID = 21193; // 21173
463463

464464
/**
465465
* <p>

conf/ear/META-INF/application.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@
9696
<java>conf</java>
9797
</module>
9898

99-
<module>
100-
<web>
101-
<web-uri>scorecard.war</web-uri>
102-
<context-root>/direct/scorecard</context-root>
103-
</web>
99+
<module>
100+
<web>
101+
<web-uri>scorecard.war</web-uri>
102+
<context-root>/direct/scorecard</context-root>
103+
</web>
104104
</module>
105105
<module>
106106
<web>

conf/web/WEB-INF/applicationContext.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,13 @@
294294
<property name="permissionServiceFacade" ref="permissionServiceFacade"/>
295295
</bean>
296296

297+
<bean id="projectWorkManagementAction"
298+
class="com.topcoder.direct.services.view.action.project.ProjectWorkManagementAction" scope="prototype" parent="baseDirectStrutsAction">
299+
<property name="studioSubmissionBase" value="@studio.submission.base@"/>
300+
<property name="softwareSubmissionBase" value="@file_storage_location@"/>
301+
<property name="mimeTypeRetriever" ref="mimeTypeRetriever"/>
302+
</bean>
303+
297304
<bean id="getProjectVMInstancesAction"
298305
class="com.topcoder.direct.services.view.action.project.GetProjectVMInstancesAction" scope="prototype">
299306
<property name="cloudVMService" ref="cloudVMService"/>
@@ -492,14 +499,18 @@
492499
parent="contestAction" scope="prototype">
493500
<property name="type" value="CONTEST" />
494501
<property name="timelineInterval" value="1"/>
502+
<!--
495503
<property name="marathonMatchAnalyticsService" ref="marathonMatchAnalyticsService"/>
504+
-->
496505
</bean>
497506

498507
<bean id="contestDetailJSONAction" class="com.topcoder.direct.services.view.action.contest.launch.GetContestAction"
499508
parent="contestAction" scope="prototype">
500509
<property name="type" value="CONTEST_JSON" />
501510
<property name="timelineInterval" value="1"/>
511+
<!--
502512
<property name="marathonMatchAnalyticsService" ref="marathonMatchAnalyticsService"/>
513+
-->
503514
</bean>
504515

505516
<!-- we need this type to avoid to store session value -->
@@ -1528,7 +1539,9 @@
15281539
<bean id="marathonMatchViewAction"
15291540
class="com.topcoder.direct.services.view.action.analytics.longcontest.MarathonMatchViewAction"
15301541
scope="prototype">
1542+
<!--
15311543
<property name="marathonMatchAnalyticsService" ref="marathonMatchAnalyticsService"/>
1544+
-->
15321545
<property name="contestServiceFacade" ref="contestServiceFacade"/>
15331546
<property name="timelineInterval" value="1"/>
15341547
<property name="submissionHistoryInterval" value="20"/>
@@ -1537,13 +1550,16 @@
15371550
<bean id="marathonMatchResultsViewAction"
15381551
class="com.topcoder.direct.services.view.action.analytics.longcontest.MarathonMatchResultsViewAction"
15391552
scope="prototype">
1553+
<!--
15401554
<property name="marathonMatchAnalyticsService" ref="marathonMatchAnalyticsService"/>
1555+
-->
15411556
<property name="contestServiceFacade" ref="contestServiceFacade"/>
15421557
<property name="timelineInterval" value="1"/>
15431558
</bean>
15441559

15451560
<bean id="marathonMatchRoundIdAction" class="com.topcoder.direct.services.view.action.analytics.longcontest.MarathonMatchRoundIdAction" scope="prototype"/>
15461561

1562+
<!--
15471563
<bean id="marathonMatchAnalyticsService"
15481564
class="com.topcoder.direct.services.view.action.analytics.longcontest.services.impl.MarathonMatchAnalyticsServiceImpl"
15491565
init-method="checkInit">
@@ -1559,6 +1575,7 @@
15591575
<property name="clientSecret" value="@clientSecret@"/>
15601576
<property name="apiKey" value="@apiKey@"/>
15611577
</bean>
1578+
-->
15621579

15631580
<bean id="needFinalFixAction"
15641581
class="com.topcoder.direct.services.view.action.contest.studio.NeedFinalFixAction"

conf/web/WEB-INF/struts.xml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,41 @@
778778
<result name="success">/WEB-INF/project-vm-management.jsp</result>
779779
</action>
780780

781+
<action name="projectWorkManager" class="projectWorkManagementAction">
782+
<interceptor-ref name="securedProjectPreProcessorStack"/>
783+
<result name="success">/WEB-INF/project-work-management.jsp</result>
784+
</action>
785+
786+
<action name="getProjectWorkSteps" method="getDirectProjectWorkSteps" class="projectWorkManagementAction">
787+
<interceptor-ref name="securedProjectPreProcessorStack"/>
788+
<result name="success" type="json"/>
789+
<result name="error" type="json"/>
790+
</action>
791+
792+
<action name="getWorkStepChallenges" method="getChallengesForWorkStepAndProject" class="projectWorkManagementAction">
793+
<interceptor-ref name="securedProjectPreProcessorStack"/>
794+
<result name="success" type="json"/>
795+
<result name="error" type="json"/>
796+
</action>
797+
798+
<action name="getContestPhasesForWorkStep" method="getContestPhasesForWorkStep" class="projectWorkManagementAction">
799+
<interceptor-ref name="securedProjectPreProcessorStack"/>
800+
<result name="success" type="json"/>
801+
<result name="error" type="json"/>
802+
</action>
803+
804+
<action name="getSubmissionDataForPhase" method="getSubmissionDataForPhase" class="projectWorkManagementAction">
805+
<interceptor-ref name="securedProjectPreProcessorStack"/>
806+
<result name="success" type="json"/>
807+
<result name="error" type="json"/>
808+
</action>
809+
810+
<action name="pushSubmissions" method="pushSubmissions" class="projectWorkManagementAction">
811+
<interceptor-ref name="securedProjectPreProcessorStack"/>
812+
<result name="success" type="json"/>
813+
<result name="error" type="json"/>
814+
</action>
815+
781816
<action name="getProjectVMInstances" class="getProjectVMInstancesAction">
782817
<interceptor-ref name="authnInterceptor"/>
783818
<result name="success" type="json"/>

conf/web/WEB-INF/tld/tcdirect-functions.tld

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,18 @@
165165
<function-class>com.topcoder.direct.services.view.util.JSPHelper</function-class>
166166
<function-signature>boolean hasWriteProjectPermission(long)</function-signature>
167167
</function>
168+
169+
<function>
170+
<name>hasPermissionToAccessWorkManager</name>
171+
<function-class>com.topcoder.direct.services.view.util.JSPHelper</function-class>
172+
<function-signature>boolean hasPermissionToAccessWorkManager(long)</function-signature>
173+
</function>
174+
175+
<function>
176+
<name>getDemandWorkId</name>
177+
<function-class>com.topcoder.direct.services.view.util.JSPHelper</function-class>
178+
<function-signature>java.lang.String getDirectProjectDemandWorkId(long)</function-signature>
179+
</function>
168180

169181
<function>
170182
<name>maxLong</name>

docker/direct-app-build/Dockerfile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
FROM centos:6
2+
3+
RUN yum install -y \
4+
java-1.6.0-openjdk-devel.x86_64 \
5+
unzip \
6+
tar
7+
8+
COPY grails-1.3.7.zip /root/
9+
COPY apache-ant-1.7.1-bin.tar.gz /root/
10+
COPY ant-libs.tgz /root/
11+
12+
RUN unzip -d /root /root/grails-1.3.7.zip && tar --directory=/root -xzf /root/apache-ant-1.7.1-bin.tar.gz && tar --directory=/root/apache-ant-1.7.1/lib -xzvf /root/ant-libs.tgz
13+
14+
# need to copy because dynamic download from repo fails
15+
COPY json-rest-api-1.0.8.zip /root/grails-1.3.7/plugins/grails-json-rest-api-1.0.8.zip
16+
17+
ENV JAVA_HOME /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.35.x86_64
18+
ENV GRAILS_HOME /root/grails-1.3.7
19+
ENV ANT_HOME /root/apache-ant-1.7.1
20+
ENV PATH $JAVA_HOME/bin:$GRAILS_HOME/bin:$ANT_HOME/bin:$PATH
21+
22+
VOLUME /data
23+
24+
WORKDIR /data
25+
26+
# ant dist-backend
27+
ENTRYPOINT ["/root/apache-ant-1.7.1/bin/ant"]
28+
Binary file not shown.

docker/direct-app-build/ant-libs.tgz

1.61 MB
Binary file not shown.
Binary file not shown.
Binary file not shown.
46.2 MB
Binary file not shown.
10.4 KB
Binary file not shown.

docker/direct-app/Dockerfile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
FROM centos:6
2+
3+
RUN yum install -y \
4+
java-1.7.0-openjdk-devel.x86_64 \
5+
unzip \
6+
tar \
7+
wget
8+
9+
#RUN mkdir /data
10+
11+
WORKDIR /data
12+
13+
RUN ["wget", "-O", "/data/jboss-4.2.3.zip", "http://downloads.sourceforge.net/project/jboss/JBoss/JBoss-4.2.3.GA/jboss-4.2.3.GA.zip?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fjboss%2Ffiles%2FJBoss%2FJBoss-4.2.3.GA"]
14+
15+
RUN ["unzip", "/data/jboss-4.2.3.zip"]
16+
17+
ENV JAVA_HOME /usr/lib/jvm/jre-1.7.0-openjdk.x86_64
18+
ENV JBOSS_HOME /data/jboss-4.2.3.GA
19+
20+
COPY start-jboss.sh /data/jboss-4.2.3.GA/bin/
21+
COPY TC.prod.ldap.keystore /data/jboss-4.2.3.GA/bin/
22+
23+
#VOLUME /data/jboss-4.2.3.GA/server/direct
24+
25+
RUN mkdir /data/temp_files
26+
RUN rm /data/jboss-4.2.3.zip
27+
28+
CMD ["/data/jboss-4.2.3.GA/bin/start-jboss.sh"]
29+
30+
#EXPOSE 8080
51.1 KB
Binary file not shown.

docker/direct-app/start-jboss.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
echo "ASP API=${ASP_API_URL}"
4+
5+
$JAVA_HOME/bin/java -Dasp.api-base-url=${ASP_API_URL} -server -Dsun.rmi.dgc.client.gcInterval=600000 -Dsun.rmi.dgc.server.gcInterval=600000 -Djavax.net.ssl.trustStore=/data/jboss-4.2.3.GA/bin/TC.prod.ldap.keystore -XX:+UseParallelGC -XX:ParallelGCThreads=8 -Djboss.remoting.pre_2_0_compatible=true -XX:PermSize=512m -XX:MaxPermSize=1024m -XX:+CMSPermGenSweepingEnabled -XX:+CMSClassUnloadingEnabled -Dlog4j.debug -Djava.net.preferIPv4Stack=true -Djboss.remoting.pre_2_0_compatible=true -Djava.endorsed.dirs=$JBOSS_HOME/lib/endorsed -classpath $JBOSS_HOME/bin/run.jar:$JAVA_HOME/lib/tools.jar org.jboss.Main -c direct -b 0.0.0.0

0 commit comments

Comments
 (0)