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

Commit a4e274d

Browse files
committed
Merge pull request #46 from cloudspokes/technology-2014-11-06
Technology 2014 11 06
2 parents 86572cd + 3159cf1 commit a4e274d

File tree

93 files changed

+370
-274
lines changed

Some content is hidden

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

93 files changed

+370
-274
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,23 @@
11
direct-app
22
==========
3+
4+
Setup on VM:
5+
* Once you get your VM, login into the VM with your private key and account 'direct'
6+
* Back up token.properties and topcoder_global.properties in /home/direct/direct somewhere
7+
* Delete the whole directory /home/direct/direct
8+
* Git Clone the direct-app repo into folder /home/direct/direct.
9+
* Copy the back up *.properties files back to /home/direct/direct
10+
11+
Setup on Local env - Refer to http://apps.topcoder.com/wiki/display/docs/TC+Direct+Setup+Guide
12+
* Instead of using SVN, you will use the codes from this git repo
13+
14+
VM Info:
15+
* http://apps.topcoder.com/wiki/display/projects/Direct+VM
16+
* http://apps.topcoder.com/wiki/display/docs/VM+Image+2.5
17+
18+
Build/Compile
19+
* run 'ant'
20+
21+
Deploy:
22+
* simply run 'ant deploy' to build all the components and the direct and deploy the direct to jboss
23+

build-components.xml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,28 @@
22

33
<property name="buildroot" value="../../build"/>
44

5+
<property name="builddir" value="${buildroot}/${distfilename}"/>
6+
57
<property name="builddir" value="${buildroot}/${distfilename}"/>
68

79
<property name="component.jar" value="${buildroot}/${distfilename}.jar"/>
810

9-
<target name="check_meata_file">
11+
<target name="check_metafile">
1012
<available file="${configdir}/META-INF/" property="meta_config_exists" type="dir"/>
1113
</target>
1214

13-
<target name="dist_direct_meata_file" depends="clean, compile" if="meta_config_exists">
15+
<target name="dist_direct_metafile" depends="clean, compile" if="meta_config_exists">
1416
<jar jarfile="${buildroot}/${distfilename}.jar" basedir="${build_classdir}">
1517
<metainf dir="${configdir}/META-INF/" includes="**"/>
1618
</jar>
1719
</target>
1820

19-
<target name="dist_direct_no_meata_file" depends="clean, compile" unless="meta_config_exists">
21+
<target name="dist_direct_no_metafile" depends="clean, compile" unless="meta_config_exists">
2022
<jar jarfile="${buildroot}/${distfilename}.jar" basedir="${build_classdir}">
2123
</jar>
2224
</target>
2325

24-
<target name="dist_direct" depends="check_meata_file, dist_direct_meata_file, dist_direct_no_meata_file">
26+
<target name="dist_direct" depends="check_metafile, dist_direct_metafile, dist_direct_no_metafile">
2527
<if>
2628
<equals arg1="${needTokenize}" arg2="true"/>
2729
<then>
@@ -34,4 +36,4 @@
3436

3537
</target>
3638

37-
</project>
39+
</project>

build-dependencies.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636

3737
<property name="client_invoice_entities_dao.jar" value="${tcs_libdir}/client_invoice_entities_dao.jar"/>
3838

39+
40+
<!-- EJB services -->
41+
3942
<property name="client_project_entities_dao.jar" value="${direct_service_libdir}/client_project_entities_dao.jar"/>
4043

4144
<property name="user_service.jar" value="${direct_service_libdir}/user_service.jar"/>

build-master-targets.xml

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -543,45 +543,11 @@
543543
</target>
544544

545545
<target name="update-single-revision-number-for-css" description="update revision number for each CSS file">
546-
<pathconvert property="pathInPage" pathsep="/" dirsep="/">
547-
<path location="${file}"/>
548-
<map from="${basedir}/src/web" to="" />
549-
</pathconvert>
550-
551-
<svnex>
552-
<status path="${file}" lastChangedRevisionProperty="svn.info.lastRev" />
553-
</svnex>
554-
555-
<basename property="filename" file="${pathInPage}" suffix=".css"/>
556-
557-
<replaceregexp byline="true">
558-
<regexp pattern='([href|src])="(.*${filename})(\.svn\d+)?\.css(\?v=\d+)?"'/>
559-
<substitution expression='\1="\2\.svn${svn.info.lastRev}\.css"'/>
560-
<fileset dir="${build_distdir}/direct.war">
561-
<include name="**/*.jsp"/>
562-
</fileset>
563-
</replaceregexp>
546+
<update-single-revision-number file="${file}" type="css"/>
564547
</target>
565548

566549
<target name="update-single-revision-number-for-js" description="update revision number for each javascript file">
567-
<pathconvert property="pathInPage" pathsep="/" dirsep="/">
568-
<path location="${file}"/>
569-
<map from="${basedir}/src/web" to="" />
570-
</pathconvert>
571-
572-
<svnex>
573-
<status path="${file}" lastChangedRevisionProperty="svn.info.lastRev" />
574-
</svnex>
575-
576-
<basename property="filename" file="${pathInPage}" suffix=".js"/>
577-
578-
<replaceregexp byline="true">
579-
<regexp pattern='([href|src])="(.*${filename})(\.svn\d+)?\.js(\?v=\d+)?"'/>
580-
<substitution expression='\1="\2\.svn${svn.info.lastRev}\.js"'/>
581-
<fileset dir="${build_distdir}/direct.war">
582-
<include name="**/*.jsp"/>
583-
</fileset>
584-
</replaceregexp>
550+
<update-single-revision-number file="${file}" type="js"/>
585551
</target>
586552

587553
<target name="update-revision-numbers" description="update revision number for static files">

build-master-tasks.xml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,4 +156,60 @@
156156
}
157157
]]>
158158
</scriptdef>
159+
160+
<macrodef name="update-single-revision-number" description="Update revision number for a file.">
161+
<attribute name="file" />
162+
<attribute name="type" />
163+
164+
<sequential>
165+
<taskdef name="groovy"
166+
classname="org.codehaus.groovy.ant.Groovy"
167+
classpathref="script.path"/>
168+
169+
<pathconvert property="pathInPage" pathsep="/" dirsep="/">
170+
<path location="@{file}"/>
171+
<map from="${basedir}/src/web" to="" />
172+
</pathconvert>
173+
174+
<exec executable="git" outputproperty="git.log.lastMod">
175+
<arg value="log"/>
176+
<arg value="-1"/>
177+
<arg value="--pretty=format:%ct"/>
178+
<arg value="@{file}"/>
179+
</exec>
180+
181+
<groovy>
182+
<![CDATA[
183+
import java.util.*
184+
185+
def calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"))
186+
calendar.setTimeInMillis(Long.parseLong(properties["git.log.lastMod"]) * 1000)
187+
188+
properties["lastModYear"] = "" + calendar.get(Calendar.YEAR)
189+
def month = calendar.get(Calendar.MONTH) + 1
190+
if (month < 10) {
191+
properties["lastModMonth"] = "0" + month
192+
} else {
193+
properties["lastModMonth"] = "" + month
194+
}
195+
def day = calendar.get(Calendar.DAY_OF_MONTH)
196+
if (day < 10) {
197+
properties["lastModDate"] = "0" + day
198+
} else {
199+
properties["lastModDate"] = "" + day
200+
}
201+
]]>
202+
</groovy>
203+
204+
<basename property="filename" file="${pathInPage}" suffix=".@{type}"/>
205+
206+
<replaceregexp byline="true">
207+
<regexp pattern='([href|src])="(.*${filename})(\.git\d+)?\.@{type}(\?v=\d+)?"'/>
208+
<substitution expression='\1="\2\.git${lastModYear}${lastModMonth}${lastModDate}\.@{type}"'/>
209+
<fileset dir="${build_distdir}/direct.war">
210+
<include name="**/*.jsp"/>
211+
</fileset>
212+
</replaceregexp>
213+
</sequential>
214+
</macrodef>
159215
</project>

build-services.xml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,22 @@
66

77
<property name="component.jar" value="${buildroot}/${distfilename}.jar"/>
88

9-
<target name="check_meata_file">
9+
<target name="check_metafile">
1010
<available file="${configdir}/META-INF/" property="meta_config_exists" type="dir"/>
1111
</target>
1212

13-
<target name="dist_direct_meata_file" depends="clean, compile" if="meta_config_exists">
13+
<target name="dist_direct_metafile" depends="clean, compile" if="meta_config_exists">
1414
<jar jarfile="${buildroot}/${distfilename}.jar" basedir="${build_classdir}">
1515
<metainf dir="${configdir}/META-INF/" includes="**"/>
1616
</jar>
1717
</target>
1818

19-
<target name="dist_direct_no_meata_file" depends="clean, compile" unless="meta_config_exists">
19+
<target name="dist_direct_no_metafile" depends="clean, compile" unless="meta_config_exists">
2020
<jar jarfile="${buildroot}/${distfilename}.jar" basedir="${build_classdir}">
2121
</jar>
2222
</target>
2323

24-
<target name="dist_direct" depends="check_meata_file, dist_direct_meata_file, dist_direct_no_meata_file">
24+
<target name="dist_direct" depends="check_metafile, dist_direct_metafile, dist_direct_no_metafile">
2525
<if>
2626
<equals arg1="${needTokenize}" arg2="true"/>
2727
<then>
@@ -31,7 +31,6 @@
3131
</if>
3232

3333
<copy file="${buildroot}/${distfilename}.jar" todir="${direct_service_libdir}/"/>
34-
3534
</target>
3635

37-
</project>
36+
</project>

build.xml

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -314,30 +314,31 @@
314314
<copy file="${yuicompressor.jar}" todir="${ear_shared_libdir}" overwrite="true"/>
315315

316316
<!-- EJB components -->
317-
<copy file="${catalog_services_id_generator.jar}" todir="${build_distdir}" overwrite="true"/> <copy file="${catalog_services.jar}" todir="${build_distdir}" overwrite="true"/>
318-
<copy file="${client_project_entities_dao.jar}" todir="${build_distdir}" overwrite="true"/>
319-
<copy file="${cloud_vm_service.jar}" todir="${build_distdir}" overwrite="true"/>
320-
<copy file="${user_service.jar}" todir="${build_distdir}" overwrite="true"/>
321-
<copy file="${project_service.jar}" todir="${build_distdir}" overwrite="true"/>
322-
<copy file="${game_plan_service.jar}" todir="${build_distdir}" overwrite="true"/>
323-
<copy file="${contest_eligibility_persistence.jar}" todir="${build_distdir}" overwrite="true"/>
324-
<copy file="${contest_eligibility_validation.jar}" todir="${build_distdir}" overwrite="true"/>
325-
<copy file="${project_services.jar}" todir="${build_distdir}" overwrite="true"/>
326-
<copy file="${specification_review_service.jar}" todir="${build_distdir}" overwrite="true"/>
327-
<copy file="${specification_review_comment_service.jar}" todir="${build_distdir}" overwrite="true"/>
328-
<copy file="${contest_service_facade.jar}" todir="${build_distdir}" overwrite="true"/>
329-
<copy file="${permission_service_facade.jar}" todir="${build_distdir}" overwrite="true"/>
330-
<copy file="${user_service_facade.jar}" todir="${build_distdir}" overwrite="true"/>
331-
<copy file="${project_service_facade.jar}" todir="${build_distdir}" overwrite="true"/>
332-
<copy file="${admin_service_facade.jar}" todir="${build_distdir}" overwrite="true"/>
333-
<copy file="${pipeline_service.jar}" todir="${build_distdir}" overwrite="true"/>
334-
<copy file="${pipeline_service_facade.jar}" todir="${build_distdir}" overwrite="true"/>
335-
<copy file="${project.jar}" todir="${build_distdir}" overwrite="true"/>
336-
<copy file="${user.jar}" todir="${build_distdir}" overwrite="true"/>
337-
<copy file="${ldap_sdk_interface.jar}" todir="${build_distdir}" overwrite="true"/>
317+
<copy file="${catalog_services_id_generator.jar}" todir="${build_distdir}/ejb" overwrite="true"/>
318+
<copy file="${catalog_services.jar}" todir="${build_distdir}/ejb" overwrite="true"/>
319+
<copy file="${client_project_entities_dao.jar}" todir="${build_distdir}/ejb" overwrite="true"/>
320+
<copy file="${cloud_vm_service.jar}" todir="${build_distdir}/ejb" overwrite="true"/>
321+
<copy file="${user_service.jar}" todir="${build_distdir}/ejb" overwrite="true"/>
322+
<copy file="${project_service.jar}" todir="${build_distdir}/ejb" overwrite="true"/>
323+
<copy file="${game_plan_service.jar}" todir="${build_distdir}/ejb" overwrite="true"/>
324+
<copy file="${contest_eligibility_persistence.jar}" todir="${build_distdir}/ejb" overwrite="true"/>
325+
<copy file="${contest_eligibility_validation.jar}" todir="${build_distdir}/ejb" overwrite="true"/>
326+
<copy file="${project_services.jar}" todir="${build_distdir}/ejb" overwrite="true"/>
327+
<copy file="${specification_review_service.jar}" todir="${build_distdir}/ejb" overwrite="true"/>
328+
<copy file="${specification_review_comment_service.jar}" todir="${build_distdir}/ejb" overwrite="true"/>
329+
<copy file="${contest_service_facade.jar}" todir="${build_distdir}/ejb" overwrite="true"/>
330+
<copy file="${permission_service_facade.jar}" todir="${build_distdir}/ejb" overwrite="true"/>
331+
<copy file="${user_service_facade.jar}" todir="${build_distdir}/ejb" overwrite="true"/>
332+
<copy file="${project_service_facade.jar}" todir="${build_distdir}/ejb" overwrite="true"/>
333+
<copy file="${admin_service_facade.jar}" todir="${build_distdir}/ejb" overwrite="true"/>
334+
<copy file="${pipeline_service.jar}" todir="${build_distdir}/ejb" overwrite="true"/>
335+
<copy file="${pipeline_service_facade.jar}" todir="${build_distdir}/ejb" overwrite="true"/>
336+
<copy file="${project.jar}" todir="${build_distdir}/ejb" overwrite="true"/>
337+
<copy file="${user.jar}" todir="${build_distdir}/ejb" overwrite="true"/>
338+
<copy file="${ldap_sdk_interface.jar}" todir="${build_distdir}/ejb" overwrite="true"/>
338339

339340
<!-- Copy configuration files -->
340-
<copy todir="${build_distdir}">
341+
<copy todir="${build_distdir}/conf">
341342
<fileset dir="${tokenized_conf}">
342343
<include name="tc_login_bean.properties" />
343344
<include name="email_templates/**/*.txt" />

components/deliverable_management/src/java/main/com/topcoder/management/deliverable/persistence/UploadPersistence.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
/**
1818
* <p>
1919
* The UploadPersistence interface defines the methods for persisting and retrieving the object model in this
20-
* component. This interface handles the persistence of the upload related classes that make up the object model ¨C
20+
* component. This interface handles the persistence of the upload related classes that make up the object model
2121
* Uploads, Submissions, UploadTypes, UploadStatuses, SubmissionStatuses. This interface is not responsible for
2222
* searching the persistence for the various entities. This is instead handled by an UploadManager implementation.
2323
* </p>

components/phase_management/src/java/main/com/topcoder/management/phase/PhaseOperationEnum.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* operations of "start", "end", and "cancel". This is provided as a utility to the user when they need to identify
1111
* the phase operation when registering a phase handler with a manager. This is used when creating
1212
* HandlerRegistryInfo instances for handler registrations (used as keys to id handlers), which need to know what
13-
* operation the handler will handle (as well as which phase status it will deal with which is covered by
13+
* operation the handler will handle (as well as which phase status it will deal with - which is covered by
1414
* PhaseStatusEnum).</p>
1515
*
1616
* <p>PhaseOperation is an Enum and thus poses no thread-safety issues.</p>

components/project_phases/src/java/main/com/topcoder/project/phases/template/converter/ConverterUtility.java

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -51,46 +51,6 @@
5151
* If the user passes "auto" as the command line argument, the utility automatically executes all generated
5252
* SQL queries.
5353
* </p>
54-
* <p>
55-
* Accepted command line arguments:
56-
* <ul>
57-
* <li>"-inamespace" flag followed by XmlPhaseTemplatePersistence configuration namespace. Only this argument
58-
* is required.</li>
59-
* <li>"-onamespace" flag followed by DBPhaseTemplatePersistence configuration namespace.</li>
60-
* <li>"-ifile" flag followed by name of additional config file for xml persistence namespace that the
61-
* ConfigManager to load.</li>
62-
* <li>"-oifile" flag followed by name of additional config file for db persistence namespace that the
63-
* ConfigManager to load.</li>
64-
* <li>"-auto" flag that indicates whether to executes the generated SQL queries automatically.</li>
65-
* </ul>
66-
* </p>
67-
* The method
68-
* utilizes Command Line Utility component to facilitate parameters parsing and handling.
69-
* <p>
70-
* <p>
71-
* Sample usage of this command line tools:<br/>
72-
* The following command line can be used to output SQL queries those are intended for fulfilling an empty
73-
* database:<br/>
74-
* java ConverterUtility.class –inamespace xml_phase_template_namespace<br/>
75-
* <br/>
76-
* The following command line can be used to output SQL queries those are intended for adding templates to
77-
* non-empty database:<br/>
78-
* java ConverterUtility.class –inamespace xml_phase_template_namespace –onamespace
79-
* db_phase_template_namespace <br/>
80-
* <br/>
81-
* The following command line can be used to fulfill a database (queries are executed automatically):<br/>
82-
* java ConverterUtility.class –inamespace xml_phase_template_namespace –onamespace
83-
* db_phase_template_namespace –auto <br/>
84-
* <br/>
85-
* If users want to specify the config files in the command line instead of ConfigManager.properties, they can
86-
* use the following command line(suppose the xml_phase_template_namespace is in file "xml_config.xml", and
87-
* db_phase_template_namespace is in "db_config.xml"):<br/>
88-
* java ConverterUtility.class –inamespace xml_phase_template_namespace –onamespace
89-
* db_phase_template_namespace –ifile xml_config.xml –ofile db_config.xml –auto
90-
* </p>
91-
* <strong>Thread-safety:</strong> This class is not thread safe. But it is not required, because
92-
* only one instance of it is used in converter application.
93-
* </p>
9454
*
9555
* @author saarixx, TCSDEVELOPER
9656
* @version 1.1
@@ -145,7 +105,7 @@ public class ConverterUtility {
145105
* </p>
146106
*/
147107
private static final String HELP_MSG = "Sample usage: java jarname"
148-
+ " ¨Cinamespace Xml_Persistence_NamSpace ¨Conamespace DB_Persistence_Namespace -auto"
108+
+ " Cinamespace Xml_Persistence_NamSpace Conamespace DB_Persistence_Namespace -auto"
149109
+ "(-onamespace and -auto is optional)";
150110

151111
/**

0 commit comments

Comments
 (0)