BrightSide Workbench Full Report + Source Code
org.turro.elephant.calendar.FullCalendarUtil Class Reference
Inheritance diagram for org.turro.elephant.calendar.FullCalendarUtil:
Collaboration diagram for org.turro.elephant.calendar.FullCalendarUtil:

Public Member Functions

boolean itsMe (String id)
 
boolean myTurn (HttpServletRequest request)
 
void execute (ServletContext context, HttpServletRequest request, HttpServletResponse response)
 

Static Public Member Functions

static String getIdentifier ()
 
static String getPublicEvents (Date start, Date end, HashMap< String, String > args)
 

Detailed Description

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

Definition at line 44 of file FullCalendarUtil.java.

Member Function Documentation

◆ execute()

void org.turro.elephant.calendar.FullCalendarUtil.execute ( ServletContext  context,
HttpServletRequest  request,
HttpServletResponse  response 
)

Implements org.turro.elephant.direct.IDirectContent.

Definition at line 61 of file FullCalendarUtil.java.

61  {
62  try {
63  String pstart = request.getParameter("start"),
64  pend = request.getParameter("end");
65  if(!Strings.isBlank(pstart) && !Strings.isBlank(pend)) {
66  Date start = Iso8601DateFormat.getDate(pstart + "T00:00:00");
67  Date end = Iso8601DateFormat.getDate(pend + "T00:00:00");
68  HashMap<String, String> args = new HashMap<>();
69  if(!Strings.isBlank(request.getParameter("webInfo"))) {
70  args.put("webInfo", request.getParameter("webInfo"));
71  }
72  if(!Strings.isBlank(request.getParameter("pubCats"))) {
73  args.put("publicationCategories", request.getParameter("pubCats"));
74  }
75  if(!Strings.isBlank(request.getParameter("pubGroups"))) {
76  args.put("publicationGroups", request.getParameter("pubGroups"));
77  }
78  if(!Strings.isBlank(request.getParameter("dosCats"))) {
79  args.put("dossierCategories", request.getParameter("dosCats"));
80  }
81  if(!Strings.isBlank(request.getParameter("convPaths"))) {
82  args.put("convocationPaths", request.getParameter("convPaths"));
83  }
84  if(!Strings.isBlank(request.getParameter("servTypes"))) {
85  args.put("serviceTypes", request.getParameter("servTypes"));
86  }
87  if(!Strings.isBlank(request.getParameter("required"))) {
88  args.put("required", request.getParameter("required"));
89  }
90  if(!Strings.isBlank(request.getParameter("target"))) {
91  args.put("target", request.getParameter("target"));
92  }
93  response.setContentType("application/json");
94  response.getWriter().write(getPublicEvents(start, end, args));
95  }
96  } catch (IOException ex) {
97  Logger.getLogger(FullCalendarUtil.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
98  }
99  }
static String getPublicEvents(Date start, Date end, HashMap< String, String > args)
Here is the call graph for this function:

◆ getIdentifier()

static String org.turro.elephant.calendar.FullCalendarUtil.getIdentifier ( )
static

Definition at line 46 of file FullCalendarUtil.java.

46  {
47  return FullCalendarUtil.class.getAnnotation(DirectContent.class).identifier();
48  }

◆ getPublicEvents()

static String org.turro.elephant.calendar.FullCalendarUtil.getPublicEvents ( Date  start,
Date  end,
HashMap< String, String >  args 
)
static

Definition at line 101 of file FullCalendarUtil.java.

101  {
102  String url = args.get("webInfo");
103  ArrayList<FullCalendarEvent> fevents = new ArrayList<>();
104  for(ICalendarEvent evt : Events.getPublicEvents(start, end, args)) {
105  FullCalendarEvent fce = new FullCalendarEvent();
106  fce.start = evt.getBeginDate();
107  fce.end = evt.getEndDate();
108  fce.title = evt.getTitle();
109  fce.description = evt.getContent();
110  fce.motive = evt.getMotive();
111  fce.url = Strings.isBlank(url) ? evt.getPath() : url + "?webInfo=" + evt.getPath();
112  fevents.add(fce);
113  }
114  return new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HH:mm:ssX").create().toJson(fevents);
115  }
Here is the call graph for this function:

◆ itsMe()

boolean org.turro.elephant.calendar.FullCalendarUtil.itsMe ( String  id)

Implements org.turro.elephant.direct.IDirectContent.

Definition at line 51 of file FullCalendarUtil.java.

51  {
52  return getIdentifier().equals(id);
53  }

◆ myTurn()

boolean org.turro.elephant.calendar.FullCalendarUtil.myTurn ( HttpServletRequest  request)

Implements org.turro.elephant.direct.IDirectContent.

Definition at line 56 of file FullCalendarUtil.java.

56  {
57  return DirectContents.isYourTurn(request, getIdentifier());
58  }
Here is the call graph for this function:

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