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

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 createPopup (EntityInfoType type, LinkType link, String path)
 
static String createURL (EntityInfoType type, LinkType link)
 
static String createURL (String path, EntityInfoType type, LinkType link)
 
static String getIdentifier ()
 

Detailed Description

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

Definition at line 38 of file EntityInfoContent.java.

Member Function Documentation

◆ createPopup()

static String org.turro.action.EntityInfoContent.createPopup ( EntityInfoType  type,
LinkType  link,
String  path 
)
static

Definition at line 40 of file EntityInfoContent.java.

40  {
41  return "popupInfo('+Info', '" +
42  createURL(type, link) + "&path=" + path +
43  "')";
44  }
static String createURL(EntityInfoType type, LinkType link)
Here is the caller graph for this function:

◆ createURL() [1/2]

static String org.turro.action.EntityInfoContent.createURL ( EntityInfoType  type,
LinkType  link 
)
static

Definition at line 46 of file EntityInfoContent.java.

46  {
47  if(type == null) {
48  type = EntityInfoType.SUMMARY;
49  }
50  if(link == null) {
51  link = LinkType.WEB;
52  }
53  return ElephantContext.getRootWebPath() + DirectContents.DIRECT_CONTENT_PATH +
54  getIdentifier() + "?type=" + type.toString() + "&link=" + link.toString();
55  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createURL() [2/2]

static String org.turro.action.EntityInfoContent.createURL ( String  path,
EntityInfoType  type,
LinkType  link 
)
static

Definition at line 57 of file EntityInfoContent.java.

57  {
58  return createURL(type, link) + "&path=" + path;
59  }

◆ execute()

void org.turro.action.EntityInfoContent.execute ( ServletContext  context,
HttpServletRequest  request,
HttpServletResponse  response 
)

Implements org.turro.elephant.direct.IDirectContent.

Definition at line 76 of file EntityInfoContent.java.

76  {
77  try {
78  Map<String, String[]> pars = request.getParameterMap();
79  EntityInfoType type = pars.containsKey("type") ? EntityInfoType.valueOf(pars.get("type")[0]) : null;
80  LinkType link = pars.containsKey("link") ? LinkType.valueOf(pars.get("link")[0]) : null;
81  response.setContentType("text/html;charset=" + ElephantContext.getEncoding());
82  EntitiesInfo.writeEntityInfo(response.getWriter(), pars.get("path")[0], type, link);
83  } catch (IOException ex) {
84  Logger.getLogger(EntityInfoContent.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
85  }
86  }
Here is the call graph for this function:

◆ getIdentifier()

static String org.turro.action.EntityInfoContent.getIdentifier ( )
static

Definition at line 61 of file EntityInfoContent.java.

61  {
62  return EntityInfoContent.class.getAnnotation(DirectContent.class).identifier();
63  }

◆ itsMe()

boolean org.turro.action.EntityInfoContent.itsMe ( String  id)

Implements org.turro.elephant.direct.IDirectContent.

Definition at line 66 of file EntityInfoContent.java.

66  {
67  return getIdentifier().equals(id);
68  }

◆ myTurn()

boolean org.turro.action.EntityInfoContent.myTurn ( HttpServletRequest  request)

Implements org.turro.elephant.direct.IDirectContent.

Definition at line 71 of file EntityInfoContent.java.

71  {
72  return DirectContents.isYourTurn(request, getIdentifier());
73  }
Here is the call graph for this function:

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