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

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 PublicationEntityInfo.java.

Member Function Documentation

◆ linkForPath()

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

Definition at line 75 of file PublicationEntityInfo.java.

75  {
76  if(LinkType.INTERNAL.equals(type) && contact.isWebapp()) {
77  return "/app/frame?" + Interceptors.parameters(path.getRoot(), path.getNode(1)).encoded();
78  } else if(LinkType.WEB.equals(type)) {
79  String context = ElephantContext.getEntityWebContext(path);
80  return !Strings.isBlank(context) ? context + "?item=" + path.getNode(1) : null;
81  }
82  return null;
83  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ resolveLink()

String org.turro.publication.command.PublicationEntityInfo.resolveLink ( String  type)

Implements org.turro.action.IEntityInfo.

Definition at line 69 of file PublicationEntityInfo.java.

69  {
70  LinkType link = LinkType.valueOf(type);
71  IContact contact = Authentication.getIContact();
72  return linkForPath(path, contact, link);
73  }
static String linkForPath(Path path, IContact contact, LinkType type)
Here is the call graph for this function:

◆ writeEntityInfo()

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

Implements org.turro.action.IEntityInfo.

Definition at line 51 of file PublicationEntityInfo.java.

51  {
52  this.path = path;
53  if("publication".equals(path.getRoot())) {
54  try {
55  Publication publication = new PublicationPU().find(Publication.class, Long.valueOf(path.getNode(1)));
56  HashMap<String, Object> args = new HashMap<>();
57  args.put("entityPath", path.getPath());
58  args.put("resolver", this);
59  out.write(EntitiesInfo.getString(publication, new PublicationWrapper(publication), "publication", type, link, args));
60  return true;
61  } catch (IOException ex) {
62  Logger.getLogger(PublicationEntityInfo.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
63  }
64  }
65  return false;
66  }
Here is the call graph for this function:

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