BrightSide Workbench Full Report + Source Code
org.turro.elephant.web.tags.TagsServlet Class Reference
Inheritance diagram for org.turro.elephant.web.tags.TagsServlet:
Collaboration diagram for org.turro.elephant.web.tags.TagsServlet:

Public Member Functions

String getServletInfo ()
 

Static Public Member Functions

static String navigateFromTo (String fromTag, String toTag)
 
static String navigateAndSet (String fromTag, String path)
 
static String navigateBack (IConstructor constructor, String path)
 

Protected Member Functions

void processRequest (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
 
void doGet (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
 
void doPost (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
 

Detailed Description

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

Definition at line 41 of file TagsServlet.java.

Member Function Documentation

◆ doGet()

void org.turro.elephant.web.tags.TagsServlet.doGet ( HttpServletRequest  request,
HttpServletResponse  response 
) throws ServletException, IOException
protected

Definition at line 87 of file TagsServlet.java.

87  {
88  processRequest(request, response);
89  }
void processRequest(HttpServletRequest request, HttpServletResponse response)

◆ doPost()

void org.turro.elephant.web.tags.TagsServlet.doPost ( HttpServletRequest  request,
HttpServletResponse  response 
) throws ServletException, IOException
protected

Definition at line 92 of file TagsServlet.java.

92  {
93  processRequest(request, response);
94  }

◆ getServletInfo()

String org.turro.elephant.web.tags.TagsServlet.getServletInfo ( )

Definition at line 97 of file TagsServlet.java.

97  {
98  return "WebTags for Elephant";
99  }

◆ navigateAndSet()

static String org.turro.elephant.web.tags.TagsServlet.navigateAndSet ( String  fromTag,
String  path 
)
static

Definition at line 49 of file TagsServlet.java.

49  {
50  return ElephantContext.getRootWebPath() + "/tag_/" + CONTEXT_TO + "?" +
51  MarkerHelper.setObfuscatedPars("tag=" + fromTag + ";path=" + path);
52  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ navigateBack()

static String org.turro.elephant.web.tags.TagsServlet.navigateBack ( IConstructor  constructor,
String  path 
)
static

Definition at line 54 of file TagsServlet.java.

54  {
55  if(Strings.isBlank(path)) {
56  String backTag = SessionTags.get(constructor).previous();
57  if(!Strings.isBlank(backTag)) {
58  return ElephantContext.getRootWebPath() + "/tag_/" + backTag + "?" +
59  MarkerHelper.setObfuscatedPars("back=true");
60  }
61  } else {
62  return ElephantContext.getRootWebPath() + "/tag_/" + CONTEXT_TO + "?" +
63  MarkerHelper.setObfuscatedPars("back=true;path=" + path);
64  }
65  return null;
66  }
Here is the call graph for this function:

◆ navigateFromTo()

static String org.turro.elephant.web.tags.TagsServlet.navigateFromTo ( String  fromTag,
String  toTag 
)
static

Definition at line 45 of file TagsServlet.java.

45  {
46  return ElephantContext.getRootWebPath() + "/tag_/" + toTag + "?" + MarkerHelper.setObfuscatedPars("tag=" + fromTag);
47  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ processRequest()

void org.turro.elephant.web.tags.TagsServlet.processRequest ( HttpServletRequest  request,
HttpServletResponse  response 
) throws ServletException, IOException
protected

Definition at line 68 of file TagsServlet.java.

68  {
69  KeyValueMap kvm = MarkerHelper.getObfuscatedParameters(request);
70  if(kvm != null) {
71  if(kvm.containsKey("tag")) SessionTags.get(request, response).add(kvm.get("tag"));
72  if(kvm.containsKey("back")) SessionTags.get(request, response).removeLast();
73  if(kvm.containsKey("path")) {
74  response.sendRedirect(request.getContextPath() + kvm.get("path"));
75  return;
76  }
77  }
78  Path path = Path.pathFrom(request.getPathInfo());
79  ElContext context = ElContextMap.getContextFromWebTag(path.getRoot());
80  if(context != null) {
81  response.setStatus(HttpServletResponse.SC_FOUND);
82  response.sendRedirect(request.getContextPath() + context.getPath());
83  }
84  }
Here is the call graph for this function:

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