BrightSide Workbench Full Report + Source Code
org.turro.attach.www.AttachAction Class Reference
Inheritance diagram for org.turro.attach.www.AttachAction:
Collaboration diagram for org.turro.attach.www.AttachAction:

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 newAttachment (String entityPath, String link, String template)
 
static String delAttachment (Attachment attachment, String link)
 
static String createURL (IConstructor constructor, String values)
 
static String getIdentifier ()
 

Detailed Description

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

Definition at line 60 of file AttachAction.java.

Member Function Documentation

◆ createURL()

static String org.turro.attach.www.AttachAction.createURL ( IConstructor  constructor,
String  values 
)
static

Definition at line 79 of file AttachAction.java.

79  {
80  String exrino = Actions.createRightNowAction(values);
81  return ElephantContext.getRootWebPath() +
82  DirectContents.DIRECT_CONTENT_PATH + getIdentifier() +
83  "?" + exrino;
84  }

◆ delAttachment()

static String org.turro.attach.www.AttachAction.delAttachment ( Attachment  attachment,
String  link 
)
static

Definition at line 74 of file AttachAction.java.

74  {
75  IConstructor constructor = Application.getApplication().getConstructor();
76  return createURL(constructor, "action=delete;id=" + attachment.getId() + ";redirect=" + HttpUtil.encodeURL(link));
77  }
static String createURL(IConstructor constructor, String values)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ execute()

void org.turro.attach.www.AttachAction.execute ( ServletContext  context,
HttpServletRequest  request,
HttpServletResponse  response 
)

Implements org.turro.elephant.direct.IDirectContent.

Definition at line 101 of file AttachAction.java.

101  {
102  if(ServletFileUpload.isMultipartContent(request)) {
103  try {
104  processUpload(request, response);
105  } catch (FileUploadException | IOException ex) {
106  Logger.getLogger(AttachAction.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
107  }
108  } else {
109  try {
110  processAction(request, response);
111  } catch (IOException ex) {
112  Logger.getLogger(AttachAction.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
113  }
114  }
115  }
Here is the call graph for this function:

◆ getIdentifier()

static String org.turro.attach.www.AttachAction.getIdentifier ( )
static

Definition at line 86 of file AttachAction.java.

86  {
87  return AttachAction.class.getAnnotation(DirectContent.class).identifier();
88  }

◆ itsMe()

boolean org.turro.attach.www.AttachAction.itsMe ( String  id)

Implements org.turro.elephant.direct.IDirectContent.

Definition at line 91 of file AttachAction.java.

91  {
92  return getIdentifier().equals(id);
93  }

◆ myTurn()

boolean org.turro.attach.www.AttachAction.myTurn ( HttpServletRequest  request)

Implements org.turro.elephant.direct.IDirectContent.

Definition at line 96 of file AttachAction.java.

96  {
97  return DirectContents.isYourTurn(request, getIdentifier());
98  }
Here is the call graph for this function:

◆ newAttachment()

static String org.turro.attach.www.AttachAction.newAttachment ( String  entityPath,
String  link,
String  template 
)
static

Definition at line 62 of file AttachAction.java.

62  {
63  IConstructor constructor = Application.getApplication().getConstructor();
64  if(constructor.isInRole("attach:new")) {
65  ElephantMarker marker = new ElephantMarker(constructor);
66  marker.put("action", DirectContents.createRelativeURL(getIdentifier()));
67  marker.put("entityPath", entityPath);
68  marker.put("redirect", link);
69  return marker.parse("attachment", Strings.isBlank(template) ? "newAttachment" : template);
70  }
71  return "";
72  }
Here is the call graph for this function:
Here is the caller graph for this function:

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