Challenge Overview

 

1.     Project Overview

1.1     System Description

When a user is created in Google Apps in an organizational unit with Gmail enabled or moved into an organizational unit with Gmail enabled for the first time several messages are automatically generated in the user’s mailbox. The Welcome Message Removal Tool (WMR Tool) will permanently delete these messages as soon as possible from the user’s Gmail inbox.

1.2     Competition Task Overview

A complete list of deliverables can be found in the TopCoder Assembly competition Tutorial at:

http://apps.topcoder.com/wiki/display/tc/Assembly+Competition+Tutorials

Note: Please read the whole Application Design Specification first. All the details not mentioned in this specification are provided in that document.

The previous approach of using the admin.directory.users.watch method with the event trigger set to update has not worked as expected.  The alternative approach will use the admin.reports.activities.watch method with the filters configured to watch for only newly created users or users moved between OUs.

  1. Watcher for the events is created. (Reference)
    • Watcher for newly created users:
      • applicationName will be admin
      • eventName will be CREATE_USER
    • Watcher(s) for users moved between OUs:
      • ���������applicationName will be admin
      • eventName will be MOVE_USER_TO_ORG_UNIT
  2. Review newly created users to determine if they were created as part of the OU hierarchy we are watching.

  3. Review users moved between OU to determine if they were moved to an OU that is part of the OU hierarchy we are watching.

1.2.1     Scope

This assembly is responsible for the following:

  • User Watcher Controller
  • System Log Controller
  • Search Result Exporting
  • Relevant JSP pages and JavaScript for the logs related functions

Implementation details for Spring MVC Controllers, interceptor and exception resolvers are provided at TCUML method documentations.

Calls to delete messages should be run using Google Task Queue to avoid timouts and system resource and scalability issues. 

1.2.2     Performance

In another project (Gmail SAD tool) which uses the similar architecture of this project we find critical performance issue.

Memory error occurrs while processing large amount of users at same time.

So it's highly recommended to use Task Queue (https://cloud.google.com/appengine/docs/java/taskqueue/) in this assembly.

The submission must meet following requirements, the develop domain provided to developers don't have so many users but we would consider the performance in review phase and the winner will get an account of another domain which have many users to make sure the final winning submission could meet following requirements:

  • Newly created users that need messages to be deleted at one time may include as many as 5000-8000 users
  • Users moved from various OUs at one time may include as many as 5000-8000 users
  • Current use case is to delete the 3 welcome emails meaning 8000*3+8000*3 = 48000 calls to the Gmail APIs
  • Code must not exceed 24 hours to complete such a load.
  • Ideally if 16000 users need emails to be deleted the tool can finish this within a couple hours.

1.2.3 Exporting

Current implementation of exporting is for exporting all deleted messages per query. But the client actually wanted the feature to export each deleted message individually. So roughly the following changes are needed:

1. At backend, add EmailMessageService#export(String messageId, ExportFormat format, OutputStream outputStream) method, which fetches a single EmailMessage stored in the database, and write to PDF, CSV or Google Sheet (you can refer to the SystemLogServiceImpl#export method as guidance for writing PDF, CSV and Google Sheet). 

Add frontend controller method SystemLogController#exportEmailMessage which delegate to SystemLogServiceImpl#export for exporting an email message.

2. At frontend, for each deleted message in the system log messages list, an export button/icon should send request to SystemLogController#exportEmailMessage for exporting the email message.

1.2.4     Spring MVC Controllers, Interceptors, Exception Resolvers

Implementation details for Spring MVC Controllers, interceptor and exception resolvers are provided at TCUML method documentations.

1.2.5     AJAX

This application makes extensive use of AJAX technique to avoid full-page refreshes.

The following is a general guideline for working with AJAX in this application:

$.ajax({

    url : "/search/auditRecords",

    type : "GET",

    success : function() {

        // Perform logic after success

        ...

    },

    error : function(request, status, error) {

        ...

    }

});

AJAX operations in specific JSPs are only explained with the URL to request, HTTP method, request data and operations to do after successful AJAX request.

1.2.6     JSP Pages

1.2.6.1     listSystemLogs.jsp

This is the JSP that is used to list system logs. This is the JSP view for SystemLogController#list.

Implementation Notes:

  • The JSP will make AJAX request to "/search/systemLogs" (SystemLogController#search) in the HTML document's "onload" event handler with an empty search criteria, and upon receiving success response update the users table with the search result in the AJAX response.
  • Filter change, page index change, page size change and sorting will make AJAX request to "/search/systemLogs" (SystemLogController#search) with a search criteria constructed from the user entered criteria, and upon receiving success response update the users table with the search result in the AJAX response.
  • "Export" button will make GET request to "/export/systemLogs?format=<format>" (with the search criteria collected on the page). The <format> should be "PDF", "CSV" or "GOOGLE_SHEET" according to export format chosen by user.

1.3     Technology overview



Final Submission Guidelines

Deliverables

  • Source code and configuration files.
  • Deployment guide to configure and verify the application.

ELIGIBLE EVENTS:

2015 topcoder Open

Review style

Final Review

Community Review Board

Approval

User Sign-Off

ID: 30049022