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

Public Member Functions

boolean writeEntityInfo (Writer out, Path path, EntityInfoType type, LinkType link)
 
String resolveLink (String type)
 

Static Public Member Functions

static String linkForPath (Path path, IContact contact, LinkType type)
 

Detailed Description

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

Definition at line 53 of file DossierEntityInfo.java.

Member Function Documentation

◆ linkForPath()

static String org.turro.dossier.command.DossierEntityInfo.linkForPath ( Path  path,
IContact  contact,
LinkType  type 
)
static

Definition at line 100 of file DossierEntityInfo.java.

100  {
101  if(LinkType.INTERNAL.equals(type)) {
102  if(contact.isWebapp()) {
103  return "/app/frame?" + Interceptors.parameters(path.getRoot(), path.getNode(1)).encoded();
104  } else {
105  return "/user/my" + checkPath(path) + "s?item=" + path.getNode(1);
106  }
107  } else if(LinkType.WEB_INTERNAL.equals(type)) {
108  return "/user/my" + checkPath(path) + "s?item=" + path.getNode(1);
109  } else if(LinkType.WEB.equals(type)) {
110  String context = ElephantContext.getEntityWebContext(path);
111  return !Strings.isBlank(context) ? context + "?item=" + path.getNode(1) : linkForPath(path, contact, LinkType.WEB_INTERNAL);
112  }
113  return null;
114  }
static String linkForPath(Path path, IContact contact, LinkType type)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ resolveLink()

String org.turro.dossier.command.DossierEntityInfo.resolveLink ( String  type)

Implements org.turro.action.IEntityInfo.

Definition at line 94 of file DossierEntityInfo.java.

94  {
95  LinkType link = LinkType.valueOf(type);
96  IContact contact = Authentication.getIContact();
97  return linkForPath(path, contact, link);
98  }
Here is the call graph for this function:

◆ writeEntityInfo()

boolean org.turro.dossier.command.DossierEntityInfo.writeEntityInfo ( Writer  out,
Path  path,
EntityInfoType  type,
LinkType  link 
)

Implements org.turro.action.IEntityInfo.

Definition at line 58 of file DossierEntityInfo.java.

58  {
59  this.path = path;
60  if(null != path.getRoot()) switch (path.getRoot()) {
61  case "dossier":
62  try {
63  Dossier dossier = new DossierPU().find(Dossier.class, Long.valueOf(path.getNode(1)));
64  DescribeItCtrl dic = new DescribeItCtrl(Application.getApplication().getConstructor());
65  dic.setEntityPath(path.getPath());
66  HashMap<String, Object> args = new HashMap<>();
67  args.put("dic", dic);
68  args.put("entityPath", path.getPath());
69  args.put("resolver", this);
70  out.write(EntitiesInfo.getString(dossier, new DossierWrapper(dossier), "dossier", type, link, args));
71  return true;
72  } catch (IOException ex) {
73  Logger.getLogger(DossierEntityInfo.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
74  }
75  case "issue":
76  try {
77  Issue issue = new DossierPU().find(Issue.class, Long.valueOf(path.getNode(1)));
78  DescribeItCtrl dic = new DescribeItCtrl(Application.getApplication().getConstructor());
79  dic.setEntityPath(path.getPath());
80  HashMap<String, Object> args = new HashMap<>();
81  args.put("dic", dic);
82  args.put("entityPath", path.getPath());
83  args.put("resolver", this);
84  out.write(EntitiesInfo.getString(issue, new IssueWrapper(issue), "issue", type, link, args));
85  return true;
86  } catch (IOException ex) {
87  Logger.getLogger(DossierEntityInfo.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
88  }
89  }
90  return false;
91  }
Here is the call graph for this function:

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