BrightSide Workbench Full Report + Source Code
org.turro.timetracker.TimeTrackerCtrl Class Reference
Inheritance diagram for org.turro.timetracker.TimeTrackerCtrl:
Collaboration diagram for org.turro.timetracker.TimeTrackerCtrl:

Public Member Functions

 TimeTrackerCtrl ()
 
void render (IConstructor constructor)
 
String getActionLink (IConstructor constructor, TimeTrackerType type)
 
- Public Member Functions inherited from org.turro.elephant.direct.AbstractDirectContentCtrl
 AbstractDirectContentCtrl (String tmplRoot)
 
String createFormAction ()
 
String createPOST (String values)
 
String getAjaxSubmitUrl (String containerId)
 
String getAjaxUrl (String containerId, String values)
 
String getAjaxUrl (String containerId, KeyValueMap values)
 
String getAjaxEvalUrl (KeyValueMap values)
 
String createRightNowURL (String values)
 
String createRightNowURL (KeyValueMap values)
 
String createLinkTo (String link, KeyValueMap values)
 
String createURL ()
 
String createURL (IConstructor constructor, String values)
 
String createURL (IConstructor constructor, String values, int daysValid)
 
String createURL (IConstructor constructor, String values, int daysValid, boolean withDomain)
 
String createURL (IConstructor constructor, IContact recipe, String values, int daysValid, boolean withDomain)
 
String createURL (IConstructor constructor, IContact recipe, KeyValueMap values, int daysValid, boolean withDomain)
 
void setTemplate (String template)
 
String parse (IConstructor constructor)
 
boolean itsMe (String id)
 
boolean myTurn (HttpServletRequest request)
 
void execute (ServletContext context, HttpServletRequest request, HttpServletResponse response)
 
void execute (IConstructor constructor)
 

Protected Member Functions

void prepareCleanMarker (ElephantMarker em, KeyValueMap kvm)
 
void prepareMarker (ElephantMarker marker)
 
String getIdentifier ()
 
void doExecute (IConstructor constructor, KeyValueMap map)
 
- Protected Member Functions inherited from org.turro.elephant.direct.AbstractDirectContentCtrl
String getRedirContext (IConstructor constructor, boolean withDomain)
 
ElephantMarker getMarker (IConstructor constructor)
 
ElephantMarker getCleanMarkerFrom (IConstructor constructor)
 
void addContainerId (ElephantMarker marker, boolean container)
 
String getTmplRoot ()
 
String getTemplate ()
 
void writeMarkerToResponse (IConstructor constructor, KeyValueMap map)
 
void writeMarkerToResponse (IConstructor constructor, KeyValueMap map, Map extra)
 
void setNeedsUser (boolean needsUser)
 

Additional Inherited Members

- Protected Attributes inherited from org.turro.elephant.direct.AbstractDirectContentCtrl
String template = "full"
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 42 of file TimeTrackerCtrl.java.

Constructor & Destructor Documentation

◆ TimeTrackerCtrl()

org.turro.timetracker.TimeTrackerCtrl.TimeTrackerCtrl ( )

Definition at line 46 of file TimeTrackerCtrl.java.

46  {
47  super("timetracker");
48  setTemplate("track");
49  }

Member Function Documentation

◆ doExecute()

void org.turro.timetracker.TimeTrackerCtrl.doExecute ( IConstructor  constructor,
KeyValueMap  map 
)
protected

Reimplemented from org.turro.elephant.direct.AbstractDirectContentCtrl.

Definition at line 79 of file TimeTrackerCtrl.java.

79  {
80  String entityPath = (String) constructor.getSessionAttribute(TTCONTEXT);
81  String type = map.get("type");
82  if("track".equals(type)) {
83  if(map.containsKey("trackdelete")) {
84  getQueue((String) constructor.getSessionAttribute(TTCONTEXT), true).deleteLastTrack();
85  } else if(map.containsKey("tracktype")) {
86  CheckDate dateTrack = new CheckDate(
87  map.get(Integer.class, "year"),
88  map.get(Integer.class, "month"),
89  map.get(Integer.class, "day"),
90  map.get(Integer.class, "hour"),
91  map.get(Integer.class, "minute"),
92  -1);
93  if(getQueue(entityPath, true).correctDate(dateTrack)) {
94  getQueue(entityPath, false).addTrack(TimeTrackerType.valueOf(map.get("tracktype")), dateTrack.getDate());
95  constructor.removeSessionAttribute(TTCONTEXT);
96  }
97  } else {
98  constructor.removeSessionAttribute(TTCONTEXT);
99  }
100  } else if("entity".equals(type)) {
101  constructor.setSessionAttribute(TTCONTEXT, map.get("entityPath"));
102  }
103  }
TimeTracker addTrack(TimeTrackerType type, Date dateTrack)
Here is the call graph for this function:

◆ getActionLink()

String org.turro.timetracker.TimeTrackerCtrl.getActionLink ( IConstructor  constructor,
TimeTrackerType  type 
)

Definition at line 129 of file TimeTrackerCtrl.java.

129  {
130  return createRightNowURL("type=track;tracktype=" + type.toString());
131  }

◆ getIdentifier()

String org.turro.timetracker.TimeTrackerCtrl.getIdentifier ( )
protected

Reimplemented from org.turro.elephant.direct.AbstractDirectContentCtrl.

Definition at line 74 of file TimeTrackerCtrl.java.

74  {
75  return TimeTrackerCtrl.class.getAnnotation(DirectContent.class).identifier();
76  }

◆ prepareCleanMarker()

void org.turro.timetracker.TimeTrackerCtrl.prepareCleanMarker ( ElephantMarker  em,
KeyValueMap  kvm 
)
protected

Reimplemented from org.turro.elephant.direct.AbstractDirectContentCtrl.

Definition at line 52 of file TimeTrackerCtrl.java.

52  {
53  throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
54  }

◆ prepareMarker()

void org.turro.timetracker.TimeTrackerCtrl.prepareMarker ( ElephantMarker  marker)
protected

Reimplemented from org.turro.elephant.direct.AbstractDirectContentCtrl.

Definition at line 57 of file TimeTrackerCtrl.java.

57  {
58  String entityPath = (String) marker.getConstructor().getSessionAttribute(TTCONTEXT);
59  marker.put("entityPath", entityPath);
60  marker.put("iee", Entities.getController(entityPath));
61  marker.put("queue", getQueue(entityPath, false));
62  marker.put("valids", getQueue(entityPath, false).getNextValids());
63  CheckDate dateTrack = new CheckDate();
64  marker.put("year", dateTrack.getYear());
65  marker.put("month", dateTrack.getMonth());
66  marker.put("day", dateTrack.getDay());
67  marker.put("hour", dateTrack.getHour());
68  marker.put("minute", dateTrack.getMinute());
69  }
Here is the call graph for this function:

◆ render()

void org.turro.timetracker.TimeTrackerCtrl.render ( IConstructor  constructor)

Reimplemented from org.turro.elephant.direct.AbstractDirectContentCtrl.

Definition at line 108 of file TimeTrackerCtrl.java.

108  {
109  String entityPath = (String) constructor.getSessionAttribute(TTCONTEXT);
110  if(!Strings.isBlank(entityPath) && (getQueue(entityPath, true) != null)) {
111  super.render(constructor);
112  } else {
113  ElephantMarker marker = new ElephantMarker(constructor);
114  marker.put("actions", this);
115  IContact contact = Authentication.getIContact();
116  if(contact.getSyndications().contains("employee") ||
117  contact.getSyndications().contains("manager") ||
118  contact.getSyndications().contains("financials_admin")) {
119  Map<String, Object> args = Plugins.execute("CurrentCompany", null);
120  marker.put("stores", args.get("departmentStores"));
121  }
122  if(!Strings.isBlank(entityPath)) {
123  marker.put("openTracks", getQueue(entityPath, false).getActiveTracks());
124  }
125  marker.process("timetracker", "selectEntity");
126  }
127  }
Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: