Access to add and change pages is restricted. See: https://cwiki.apache.org/confluence/display/OFBIZ/Wiki+access

Objective : Implement Stop Watch functionality by which contributor could record his real hours are spent to complete the task.

JIRA Task: Please find the patch here : https://issues.apache.org/jira/browse/OFBIZ-2474

Functional Overview:

  • Problem Description:
    In present system there isn't any feature that allows to contributor to records time worked on the task after each work session (on a daily basis at least).
  • Gap:
    No, OOTB implementation is available for this functionality.
  • Need New Code:
    Y

Solution Overview:

  • Suggested Solution
    Stop Watch do following functioning :
    1. Start.
    2. Pause.
    3. Resume.
    4. Reset
    5. Stop.

And on each fuctioning it would return the time being recored by Stop Watch, when contributor is clicked on any above mentioned button. This functionality is available on task summary page so that contributor can easly operate it. To start the watch click on start button. Once the clock is started then start button will be disabaled until the contributor is stop it, but he could pause the watch when he is not at his workstation and again resume the clock. It means that time is not recoreded by the watch when contributor is not working on that task. Reset is use to reset the clock.

  • UI Changes: (new)
    Screen : Add a new screen named "MyWatch" in right half of TaskView screen under the following location.(component://projectmgr/widget/TaskScreens.xml)
    Ftl        : Add a new template named "MyWatch.ftl" under the following location.(component://projectmgr/webapp/projectmgr/project/summary) this ftl contains following hyperlinks : Start, Stop, Pause, Resume and GetTime.
  • Entity Model Changes:
    N
  • Service Changes:
    Y
    Following implementation steps would be use to implement the designed functionality :
    1. Import org.apache.commons.lang.time.StopWatch package in your java class.
    2. Create a new instance of StopWatch by calling its constructor.
    3. Write a simple/java method which take one string parameter passed from the ftl (it would be start, stop, pause, resume, getTime) and retuns the time in string format. Signature of method should be like this public Sting MyStopWatch (String).
    4. On the basis of input string parameter call the following methods along with one more method would be called that is stopWatch.getTime() this method returns the time recorded by the stop watch.
    5. stopWatch.start();
    6. stopWatch.suspend();
    7. stopWatch.resume();
    8. stopWatch.stop();
  • Reference API : http://commons.apache.org/lang/api/org/apache/commons/lang/time/StopWatch.html
  • Note :
    1. start() method can not be called twice without calling reset().
    2. resume() may be called if the watch has been suspand().
    3. suspend() and stop() can not be invoked twice.
  • No labels