BrightSide Workbench Full Report + Source Code
org.turro.financials.model.document.contract.DocumentPDF Class Reference
Inheritance diagram for org.turro.financials.model.document.contract.DocumentPDF:
Collaboration diagram for org.turro.financials.model.document.contract.DocumentPDF:

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 createURL (IConstructor constructor, Document document) throws UnsupportedEncodingException, Exception
 
static String getIdentifier ()
 

Detailed Description

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

Definition at line 46 of file DocumentPDF.java.

Member Function Documentation

◆ createURL()

static String org.turro.financials.model.document.contract.DocumentPDF.createURL ( IConstructor  constructor,
Document  document 
) throws UnsupportedEncodingException, Exception
static

Definition at line 48 of file DocumentPDF.java.

48  {
49  IContact contact = Authentication.getIContact();
50  if(contact != null && contact.isWebUser()) {
51  HashMap<String, String> values = new HashMap<>();
52  values.put(Actions.USER_PAR, contact.getConnector(IUser.CONNECTOR_EMAIL));
53  values.put("documentId", ObjectString.formatNativeObject(document.getId(), false));
54  return ElephantContext.getRootWebPath() +
55  DirectContents.DIRECT_CONTENT_PATH + getIdentifier() +
56  "?" + Actions.createAction(values, 7, false);
57  } else {
58  return "";
59  }
60  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ execute()

void org.turro.financials.model.document.contract.DocumentPDF.execute ( ServletContext  context,
HttpServletRequest  request,
HttpServletResponse  response 
)

Implements org.turro.elephant.direct.IDirectContent.

Definition at line 77 of file DocumentPDF.java.

77  {
78  IConstructor constructor = ElephantContext.getConstructor(request, response);
79  KeyValueMap map = Actions.getAction(constructor);
80  if(Actions.prepareActions(constructor, map)) {
81  Document document = new FinancialsPU().find(Document.class, Long.valueOf(map.get("documentId")));
82  GenerateDocument gd = new GenerateDocument();
83  gd.outputDocument(document, true, response);
84  }
85  }
Here is the call graph for this function:

◆ getIdentifier()

static String org.turro.financials.model.document.contract.DocumentPDF.getIdentifier ( )
static

Definition at line 62 of file DocumentPDF.java.

62  {
63  return DocumentPDF.class.getAnnotation(DirectContent.class).identifier();
64  }

◆ itsMe()

boolean org.turro.financials.model.document.contract.DocumentPDF.itsMe ( String  id)

Implements org.turro.elephant.direct.IDirectContent.

Definition at line 67 of file DocumentPDF.java.

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

◆ myTurn()

boolean org.turro.financials.model.document.contract.DocumentPDF.myTurn ( HttpServletRequest  request)

Implements org.turro.elephant.direct.IDirectContent.

Definition at line 72 of file DocumentPDF.java.

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

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