Key Information

Register
Submit
The challenge is finished.

Challenge Overview

Challenge Overview

We want to create a small web application which used by TopCoder Internal team to do suppor tasks. The small web application will mostly based on the structure of our direct application - https://github.com/cloudspokes/direct-app

The technology stack is:

  • Jboss 4.2.3
  • JDK 7
  • Informix 11.50
  • Spring 3.1.2
  • Struts 2
  • Ant

Challenge Requirements Details

For the front end, we will use bootstrap as the UI lib to make the page resposive, and use jquery as the javascript framework. It's up to you to define the UI to do the required suppor tasks. It can just just black/white screens (no need to be fancy).

For the backend, we want to wrap all the business logics into the spring POJO services and let the struts2 action call the spring POJO services.

The authentication should be basic authentication with username / password - the same as the AdminLogin in direct-app. Only the user with role "TC Staff" can access this app. All the tasks should be protected with this logic.

The following support tasks need to be built in this challenge:

1. Request to become a Copilot (add and remove copilot )

-Create a page with a heading called “Add / Remove Copilot” and a description of “This function is used to member to the copilot pool.

-add text box for “username” and button for  “Add Copilot” -

-add checkboxes for “Is Studio” and “Is Software”

-The user name can be used below to retrieve the “User Id” for the query

-if successful, show a green message “Copilot has been added.”

-If unsuccessful, show a red error message to the user.  “Error, action not completed.”   and show the error/exception if possible.

-Add duplicate validation if possible unless the database restricts and will throw an exception if the person already exists.

//get USER ID based on username

select user_id from common_oltp:user where handle = 'HANDLE'

INSERT INTO copilot_profile (copilot_profile_id,user_id,copilot_profile_status_id,suspension_count,reliability,activation_date,show_copilot_earnings,create_user, create_date, update_user, update_date, is_software_copilot, is_studio_copilot)

VALUES ((select max(copilot_profile_id)+1 from copilot_profile), <user_id> ,1,0,100.00,current,'t',<operator_user_id>, current, <operator_user_id>, current, <is_software_checkbox>, <is_studio_checkbox>);

            - add the textbox for "username" and the button for "Remove Copilot". This should simply remove the copilot 
 

2. Create Topcoder Admin

-create a page with a heading of “Create Admin” and and a description of “This function is to make an internal employee an Admin”   

-add textbox for  “username” and a button called “Create Admin”

-the username can be used to retrieve the “User Id” needed below.

-if successful, show a green message “Admin has been added”

-if unsuccessful, show a RED message  “Error, no action completed” - Bubble up the error/exception to the screen

-Add duplicate validation if possible unless the database restricts and will throw an exception if the person already exists.

--INSTRUCTIONS TO KNIGHT A USER:

-- 1. Get the user_id of the user:

select user_id from common_oltp:user where handle = 'HANDLE'

 

-- 2. Get the USER_GROUP_ID for step 3

select max(user_group_id)+1 from user_group_xref

where user_group_id < 400

 

-- 3. Using the values from steps 1 and 2 replace them where appropriate in this query

insert into common_oltp:user_group_xref values (USER_GROUP_ID, CODER_ID, 2000115, 150148, 1,current);

update informixoltp:rating set rating =-1 where coder_id = CODER_ID;

 

-- 4. Get the resource_id to use in the next two queries

select max(resource_id)+1

from tcs_catalog:resource where resource_id <5000

 

-- 5. Using the value from step 4, replace RESOURCE_ID

INSERT INTO tcs_catalog:resource (resource_id, resource_role_id, user_id, create_user, create_date, modify_user, modify_date)

VALUES(RESOURCE_ID,13,CODER_ID,'YOUR_USER_ID',current,'YOUR_USER_ID', current);  

 

INSERT INTO tcs_catalog:resource_info (resource_id, resource_info_type_id, value, create_user, create_date, modify_user, modify_date)

VALUES(RESOURCE_ID,1,CODER_ID,'YOUR_USER_ID',current,'YOUR_USER_ID', current);

 

-- 6. Need to add Cockpit admin role add user to user_role_xref (role id 2087)

                      insert into user_role_xref  values (<min(user_role_id) - 1>, <user_id>, 2087, <operator_user_id>, 1)

                  Note that we use the negative value for manually inserted user_role_id here.

 

3. Add member to review board

-create a page with heading of Add Review Board Member”, with a description “This function is to add a member to the review board

-add a text box for “username” and drop down for CategoryID with button “Add Reviewer”

-The username will be used to retrieve the “User Id”

-category comes from select * from project_category_lu and presented to user as a dropdown with project category name.

-If successful, show a green message “Reviewer has been added”

-if unsuccessful, show a RED message “Error, no action completed” - Bubble up the error/exception to the screen

-Add duplicate validation if possible unless the database restricts and will throw an exception if the person already exists.

           STEPS:

//get user_id by username

select user_id from common_oltp:user where handle = 'HANDLE'

To actually add member to the review pool, run this in tcs_catalog DB (replace <user_id> with actual user ID, <project_category_id> with the actual category ID and <immunity_ind> is 1 for Studio and Code/F2F and 0 otherwise ):

INSERT INTO rboard_user VALUES (<user_id>, <project_category_id>, 4, 100, <immunity_ind>);

If you do not know the project category ID, you can look it up in project_category_lu table.


Example video: http://screencast.com/t/nzEXh8GGRC

Security

The authentication should be basic authentication with username / password - the same as the AdminLogin in direct-app. Only the user with role "TC Staff" can access this app. All the tasks should be protected with this logic.

Transaction (Important)

All the single task mentioned above should be done in one transaction. This is very important.



Final Submission Guidelines

  • The whole package of the standaone app including sources, static files, libraries, config files etc.
  • A detailed deployment guide.

ELIGIBLE EVENTS:

2015 topcoder Open

REVIEW STYLE:

Final Review:

Community Review Board

Approval:

User Sign-Off

SHARE:

ID: 30048816