BrightSide Workbench Full Report + Source Code
org.turro.elephant.impl.context.action.ContextAction Class Reference
Inheritance diagram for org.turro.elephant.impl.context.action.ContextAction:
Collaboration diagram for org.turro.elephant.impl.context.action.ContextAction:

Public Member Functions

 ContextAction ()
 
int execute () throws Exception
 
- Public Member Functions inherited from org.turro.elephant.impl.abstracts.AbstractAction
 AbstractAction ()
 
void setConstructor (IConstructor constructor)
 
IConstructor getConstructor ()
 
String getContextParameter ()
 
String getIdelParameter ()
 
String getActionParameter ()
 
String getParameter (String param)
 
String getParameter (String param, boolean encode)
 
String getStringParameter (String param)
 
String getValueParameter (String param)
 
boolean getBooleanParameter (String param)
 
int getIntParameter (String param, int defaultValue)
 
double getDoubleParameter (String param, double defaultValue)
 
Date getDateParameter (String param, Date defaultValue)
 

Additional Inherited Members

- Static Public Member Functions inherited from org.turro.elephant.impl.abstracts.AbstractAction
static String makeDateParameter (Date date)
 
static String makeDateParameter (Timestamp date)
 
static String getValuePortion (String key, String value)
 
- Static Public Attributes inherited from org.turro.elephant.context.IAction
static final int DONE = 0
 
static final int NO_DATA = 1
 
static final int ERROR = 2
 
- Protected Attributes inherited from org.turro.elephant.impl.abstracts.AbstractAction
IConstructor constructor
 

Detailed Description

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

Definition at line 38 of file ContextAction.java.

Constructor & Destructor Documentation

◆ ContextAction()

org.turro.elephant.impl.context.action.ContextAction.ContextAction ( )

Definition at line 40 of file ContextAction.java.

40  {
41  }

Member Function Documentation

◆ execute()

int org.turro.elephant.impl.context.action.ContextAction.execute ( ) throws Exception

Called by constructor in request for one action.

Exceptions
java.lang.Exception
Returns
Action's result.

Implements org.turro.elephant.context.IAction.

Definition at line 44 of file ContextAction.java.

44  {
45  String ctx = getParameter("context"),
46  action = getActionParameter(),
47  ctx_x = "";
48 
49  boolean isAJAX = false;
50 
51  ElContext context = ElContextMap.getContext(ctx);
52 
53  if(context != null) {
54  if ("print".equals(action)) {
55  //ensures loading metas & headers
58  printContext(context, getIntParameter("level", 10), !"false".equals(getParameter("title")));
61  // not true but prevents from redirecting
62  isAJAX = true;
63  } else if ("read".equals(action)) {
65  constructor.getResponse().setContentType("text/html");
66  constructor.getResponse().setCharacterEncoding(ElephantContext.getEncoding());
67  constructor.setStopper(getBooleanParameter("stopper") ? "<end/>" : null);
68  printContext(context, 1, false);
70  // not true but prevents from redirecting
71  isAJAX = true;
72  } else if ("rss".equals(action)) {
73  rssContext(context);
75  // not true but prevents from redirecting
76  isAJAX = true;
77  }
78  }
79 
80  if (!isAJAX) {
81  constructor.redirect(ctx + ctx_x);
82  }
83 
84  return IAction.DONE;
85  }
String getParameter(String param)
void setRenderingContext(ElContext context)
void forceIsAContext(ElContext context)
Here is the call graph for this function:

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