BrightSide Workbench Full Report + Source Code
org.turro.elephant.direct.DirectContents Class Reference

Static Public Member Functions

static String getIdentifier (Class<? extends IDirectContent > control)
 
static String createURL (String server, String id)
 
static String createRelativeURL (String id)
 
static boolean isDirectContent (HttpServletRequest request)
 
static boolean getContent (ServletContext context, HttpServletRequest request, HttpServletResponse response)
 
static boolean isYourTurn (HttpServletRequest request, String path)
 
static String doCreatePOST (String id, String values)
 
static String doCreatePOST (String id, String domId, String values)
 
static String doCreateURL (String id, String values)
 
static String doCreateParameter (String id, String parameter, Map< String, String > values)
 
static KeyValueMap getParameters (HttpServletRequest request, HttpServletResponse response)
 
static synchronized boolean executeDirectContents (ServletContext context, HttpServletRequest request, HttpServletResponse response)
 
static IDirectContent getDirectContent (String id)
 

Static Public Attributes

static final String DIRECT_CONTENT_PATH = "/_reqxdc_/"
 

Detailed Description

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

Definition at line 39 of file DirectContents.java.

Member Function Documentation

◆ createRelativeURL()

static String org.turro.elephant.direct.DirectContents.createRelativeURL ( String  id)
static

Definition at line 56 of file DirectContents.java.

56  {
57  return ElephantContext.getRootWebPath() + DIRECT_CONTENT_PATH + id;
58  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createURL()

static String org.turro.elephant.direct.DirectContents.createURL ( String  server,
String  id 
)
static

Definition at line 48 of file DirectContents.java.

48  {
49  String url = URLUtil.checkAppServer(server, ElephantContext.getUseSSL());
50  if(!Strings.isBlank(url)) {
51  return url + DIRECT_CONTENT_PATH + id;
52  }
53  return null;
54  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ doCreateParameter()

static String org.turro.elephant.direct.DirectContents.doCreateParameter ( String  id,
String  parameter,
Map< String, String >  values 
)
static

Definition at line 103 of file DirectContents.java.

103  {
104  IDirectContent dc = DirectContents.getDirectContent(id);
105  if(dc != null) {
106  try {
107  return ElephantContext.getRootWebPath() + DirectContents.DIRECT_CONTENT_PATH + id +
108  "?" + parameter + "=" + Actions.createParameter(values);
109  } catch (Exception ex) {
110  Logger.getLogger(DirectContents.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
111  }
112  }
113  return null;
114  }

◆ doCreatePOST() [1/2]

static String org.turro.elephant.direct.DirectContents.doCreatePOST ( String  id,
String  domId,
String  values 
)
static

Definition at line 83 of file DirectContents.java.

83  {
84  IDirectContent dc = DirectContents.getDirectContent(id);
85  if(dc != null) {
86  return "$.post(\"" + ElephantContext.getRootWebPath() + DirectContents.DIRECT_CONTENT_PATH + id + "\"," +
87  "{ exrino : \"" + Actions.createRightNowParameter(values) + "\", domid: \"" + domId + "\" })" +
88  ".done(function(data) { $(\"#" + domId + "\").html(data); });";
89  }
90  return null;
91  }

◆ doCreatePOST() [2/2]

static String org.turro.elephant.direct.DirectContents.doCreatePOST ( String  id,
String  values 
)
static

Definition at line 74 of file DirectContents.java.

74  {
75  IDirectContent dc = DirectContents.getDirectContent(id);
76  if(dc != null) {
77  return "$.post(\"" + ElephantContext.getRootWebPath() + DirectContents.DIRECT_CONTENT_PATH + id + "\"," +
78  "{ exrino : \"" + Actions.createRightNowParameter(values) + "\" })";
79  }
80  return null;
81  }
Here is the caller graph for this function:

◆ doCreateURL()

static String org.turro.elephant.direct.DirectContents.doCreateURL ( String  id,
String  values 
)
static

Definition at line 93 of file DirectContents.java.

93  {
94  IDirectContent dc = DirectContents.getDirectContent(id);
95  if(dc != null) {
96  String exrino = Actions.createRightNowAction(values);
97  return ElephantContext.getRootWebPath() + DirectContents.DIRECT_CONTENT_PATH + id +
98  "?" + exrino;
99  }
100  return null;
101  }

◆ executeDirectContents()

static synchronized boolean org.turro.elephant.direct.DirectContents.executeDirectContents ( ServletContext  context,
HttpServletRequest  request,
HttpServletResponse  response 
)
static

Definition at line 123 of file DirectContents.java.

123  {
124  for(IDirectContent iDirect : Instances.cached().byAnnotation(DirectContent.class, IDirectContent.class)) {
125  if(iDirect.myTurn(request)) {
126  iDirect.execute(context, request, response);
127  return true;
128  }
129  }
130  return false;
131  }
Here is the caller graph for this function:

◆ getContent()

static boolean org.turro.elephant.direct.DirectContents.getContent ( ServletContext  context,
HttpServletRequest  request,
HttpServletResponse  response 
)
static

Definition at line 64 of file DirectContents.java.

64  {
65  return executeDirectContents(context, request, response);
66  }
static synchronized boolean executeDirectContents(ServletContext context, HttpServletRequest request, HttpServletResponse response)
Here is the call graph for this function:

◆ getDirectContent()

static IDirectContent org.turro.elephant.direct.DirectContents.getDirectContent ( String  id)
static

Definition at line 133 of file DirectContents.java.

133  {
134  for(IDirectContent iDirect : Instances.cached().byAnnotation(DirectContent.class, IDirectContent.class)) {
135  if(iDirect.itsMe(id)) {
136  return iDirect;
137  }
138  }
139  return null;
140  }
Here is the caller graph for this function:

◆ getIdentifier()

static String org.turro.elephant.direct.DirectContents.getIdentifier ( Class<? extends IDirectContent control)
static

Definition at line 44 of file DirectContents.java.

44  {
45  return control.getAnnotation(DirectContent.class).identifier();
46  }
Here is the caller graph for this function:

◆ getParameters()

static KeyValueMap org.turro.elephant.direct.DirectContents.getParameters ( HttpServletRequest  request,
HttpServletResponse  response 
)
static

Definition at line 116 of file DirectContents.java.

116  {
117  IConstructor constructor = ElephantContext.getConstructor(request, response);
118  return Actions.getRightNowAction(constructor);
119  }
Here is the call graph for this function:

◆ isDirectContent()

static boolean org.turro.elephant.direct.DirectContents.isDirectContent ( HttpServletRequest  request)
static

Definition at line 60 of file DirectContents.java.

60  {
61  return request.getServletPath().startsWith(DIRECT_CONTENT_PATH);
62  }
Here is the caller graph for this function:

◆ isYourTurn()

static boolean org.turro.elephant.direct.DirectContents.isYourTurn ( HttpServletRequest  request,
String  path 
)
static

Definition at line 68 of file DirectContents.java.

68  {
69  return request.getServletPath().startsWith(DIRECT_CONTENT_PATH + path);
70  }
Here is the caller graph for this function:

Member Data Documentation

◆ DIRECT_CONTENT_PATH

final String org.turro.elephant.direct.DirectContents.DIRECT_CONTENT_PATH = "/_reqxdc_/"
static

Definition at line 42 of file DirectContents.java.


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