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

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 50 of file ContactsEntityInfo.java.

Member Function Documentation

◆ linkForPath()

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

Definition at line 101 of file ContactsEntityInfo.java.

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

◆ resolveLink()

String org.turro.contacts.command.ContactsEntityInfo.resolveLink ( String  type)

Implements org.turro.action.IEntityInfo.

Definition at line 95 of file ContactsEntityInfo.java.

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

◆ writeEntityInfo()

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

Implements org.turro.action.IEntityInfo.

Definition at line 55 of file ContactsEntityInfo.java.

55  {
56  this.path = path;
57  if("convocation".equals(path.getRoot())) {
58  try {
59  Convocation convocation = new ContactsPU().find(Convocation.class, path.getNode(1));
60  HashMap<String, Object> args = new HashMap<>();
61  args.put("entityPath", path.getPath());
62  args.put("resolver", this);
63  out.write(EntitiesInfo.getString(convocation, new ConvocationWrapper(convocation), "convocation", type, link, args));
64  return true;
65  } catch (IOException ex) {
66  Logger.getLogger(ContactsEntityInfo.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
67  }
68  } else if("service".equals(path.getRoot())) {
69  try {
70  ContactService service = new ContactsPU().find(ContactService.class, path.getNode(1));
71  HashMap<String, Object> args = new HashMap<>();
72  args.put("entityPath", path.getPath());
73  args.put("resolver", this);
74  out.write(EntitiesInfo.getString(service, new ContactServiceWrapper(service), "service", type, link, args));
75  return true;
76  } catch (IOException ex) {
77  Logger.getLogger(ContactsEntityInfo.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
78  }
79  } else if("contact".equals(path.getRoot())) {
80  try {
81  Contact contact = new ContactsPU().find(Contact.class, path.getNode(1));
82  HashMap<String, Object> args = new HashMap<>();
83  args.put("entityPath", path.getPath());
84  args.put("resolver", this);
85  out.write(EntitiesInfo.getString(contact, new ContactWrapper(contact), "contact", type, link, args));
86  return true;
87  } catch (IOException ex) {
88  Logger.getLogger(ContactsEntityInfo.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
89  }
90  }
91  return false;
92  }
Here is the call graph for this function:

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