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

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 46 of file StudentsEntityInfo.java.

Member Function Documentation

◆ linkForPath()

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

Definition at line 80 of file StudentsEntityInfo.java.

80  {
81  if(LinkType.INTERNAL.equals(type)) {
82  if(contact.isWebapp()) {
83  return "/app/frame?" + Interceptors.parameters(path.getRoot(), path.getNode(1)).encoded();
84  } else {
85  return "/user/" + path.getRoot() + "s?item=" + path.getNode(1);
86  }
87  } else if(LinkType.WEB_INTERNAL.equals(type)) {
88  return "/user/" + path.getRoot() + "s?item=" + path.getNode(1);
89  } else if(LinkType.WEB.equals(type)) {
90  String context = ElephantContext.getEntityWebContext(path);
91  return !Strings.isBlank(context) ? context + "?item=" + path.getNode(1) : linkForPath(path, contact, LinkType.WEB_INTERNAL);
92  }
93  return null;
94  }
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.students.command.StudentsEntityInfo.resolveLink ( String  type)

Implements org.turro.action.IEntityInfo.

Definition at line 74 of file StudentsEntityInfo.java.

74  {
75  LinkType link = LinkType.valueOf(type);
76  IContact contact = Authentication.getIContact();
77  return linkForPath(path, contact, link);
78  }
Here is the call graph for this function:

◆ writeEntityInfo()

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

Implements org.turro.action.IEntityInfo.

Definition at line 51 of file StudentsEntityInfo.java.

51  {
52  this.path = path;
53  if(null != path.getRoot()) switch (path.getRoot()) {
54  case "challenge":
55  try {
56  Challenge challenge = new StudentsPU().find(Challenge.class, Long.valueOf(path.getNode(1)));
57  DescribeItCtrl dic = new DescribeItCtrl(Application.getApplication().getConstructor());
58  dic.setEntityPath(path.getPath());
59  HashMap<String, Object> args = new HashMap<>();
60  args.put("dic", dic);
61  args.put("entityPath", path.getPath());
62  args.put("resolver", this);
63  out.write(EntitiesInfo.getString(challenge, new ChallengeWrapper(challenge), "challenge", type, link, args));
64  return true;
65  } catch (IOException ex) {
66  Logger.getLogger(StudentsEntityInfo.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
67  }
68 
69  }
70  return false;
71  }
Here is the call graph for this function:

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