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

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 addInformation (String issueId, String link, String template)
 
static String addInformation (IssueWrapper wrapper, String link)
 
static String addInformation (IssueWrapper wrapper, String link, String template)
 
static String getIdentifier ()
 

Detailed Description

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

Definition at line 76 of file AddInformationCtrl.java.

Member Function Documentation

◆ addInformation() [1/3]

static String org.turro.dossier.www.AddInformationCtrl.addInformation ( IssueWrapper  wrapper,
String  link 
)
static

Definition at line 84 of file AddInformationCtrl.java.

84  {
85  return addInformation(wrapper, link, null);
86  }
static String addInformation(String issueId, String link, String template)

◆ addInformation() [2/3]

static String org.turro.dossier.www.AddInformationCtrl.addInformation ( IssueWrapper  wrapper,
String  link,
String  template 
)
static

Definition at line 88 of file AddInformationCtrl.java.

88  {
89  IConstructor constructor = Application.getApplication().getConstructor();
90  if(constructor.isInRole("issue:edit")) {
91  ElephantMarker marker = new ElephantMarker(constructor);
92  marker.put("projectContext", new ProjectContext());
93  marker.put("action", DirectContents.createRelativeURL(getIdentifier()));
94  marker.put("wrapper", wrapper);
95  marker.put("issue", wrapper.getIssue());
96  marker.put("redirect", link);
97  if(constructor.isInRole("issue:dossier")) {
98  List<Dossier> dossiers = new DossierResults().getDossierList();
99  if(dossiers.stream().anyMatch(d -> d.getId().equals(wrapper.getIssue().getId()))) {
100  marker.put("dossiers", dossiers);
101  }
102  }
103  //marker.put("responsibles", Contacts.getWebUsers(Contacts.getByRole("issue:edit")));
104  return marker.parse("issue", Strings.isBlank(template) ? "addinfo" : template);
105  }
106  return "";
107  }
Here is the call graph for this function:

◆ addInformation() [3/3]

static String org.turro.dossier.www.AddInformationCtrl.addInformation ( String  issueId,
String  link,
String  template 
)
static

Definition at line 78 of file AddInformationCtrl.java.

78  {
79  Long id = Long.valueOf(issueId);
80  Issue issue = new DossierPU().find(Issue.class, id);
81  return addInformation(new IssueWrapper(issue), link, template);
82  }
Here is the caller graph for this function:

◆ execute()

void org.turro.dossier.www.AddInformationCtrl.execute ( ServletContext  context,
HttpServletRequest  request,
HttpServletResponse  response 
)

Implements org.turro.elephant.direct.IDirectContent.

Definition at line 124 of file AddInformationCtrl.java.

124  {
125  if(ServletFileUpload.isMultipartContent(request)) {
126  try {
127  processInformation(request, response);
128  } catch (FileUploadException | IOException ex) {
129  Logger.getLogger(AddInformationCtrl.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
130  }
131  }
132  }
Here is the call graph for this function:

◆ getIdentifier()

static String org.turro.dossier.www.AddInformationCtrl.getIdentifier ( )
static

Definition at line 109 of file AddInformationCtrl.java.

109  {
110  return AddInformationCtrl.class.getAnnotation(DirectContent.class).identifier();
111  }

◆ itsMe()

boolean org.turro.dossier.www.AddInformationCtrl.itsMe ( String  id)

Implements org.turro.elephant.direct.IDirectContent.

Definition at line 114 of file AddInformationCtrl.java.

114  {
115  return getIdentifier().equals(id);
116  }

◆ myTurn()

boolean org.turro.dossier.www.AddInformationCtrl.myTurn ( HttpServletRequest  request)

Implements org.turro.elephant.direct.IDirectContent.

Definition at line 119 of file AddInformationCtrl.java.

119  {
120  return DirectContents.isYourTurn(request, getIdentifier());
121  }
Here is the call graph for this function:

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