BrightSide Workbench Full Report + Source Code
org.turro.help.HelpContext Class Reference

Static Public Member Functions

static String helpLink (String current)
 
static String helpLink (ElContext current)
 
static ElContext help (String path)
 
static ElContext help (ElContext current)
 
static boolean exists (ElContext current)
 
static String getHelpContextAttribute (String attribute, String defaultValue)
 

Detailed Description

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

Definition at line 38 of file HelpContext.java.

Member Function Documentation

◆ exists()

static boolean org.turro.help.HelpContext.exists ( ElContext  current)
static

Definition at line 71 of file HelpContext.java.

71  {
72  return help(current)!= null;
73  }
static ElContext help(String path)
Here is the call graph for this function:

◆ getHelpContextAttribute()

static String org.turro.help.HelpContext.getHelpContextAttribute ( String  attribute,
String  defaultValue 
)
static

Definition at line 79 of file HelpContext.java.

79  {
80  return ElephantProperties.getContextProperty(HELP_CONTEXT, attribute, defaultValue);
81  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ help() [1/2]

static ElContext org.turro.help.HelpContext.help ( ElContext  current)
static

Definition at line 67 of file HelpContext.java.

67  {
68  return current != null ? ElContextMap.getContext(getHelpContextAttribute("root", "/docs/contextual") + current.getPath()) : null;
69  }
static String getHelpContextAttribute(String attribute, String defaultValue)
Here is the call graph for this function:

◆ help() [2/2]

static ElContext org.turro.help.HelpContext.help ( String  path)
static

Definition at line 63 of file HelpContext.java.

63  {
64  return !Strings.isBlank(path) ? ElContextMap.getContext(getHelpContextAttribute("root", "/docs/contextual") + path) : null;
65  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ helpLink() [1/2]

static String org.turro.help.HelpContext.helpLink ( ElContext  current)
static

Definition at line 59 of file HelpContext.java.

59  {
60  return current != null ? helpLink(current.getPath()) : null;
61  }
static String helpLink(String current)
Here is the call graph for this function:

◆ helpLink() [2/2]

static String org.turro.help.HelpContext.helpLink ( String  current)
static

Definition at line 40 of file HelpContext.java.

40  {
41  ElContext ctx = help(current);
42  if(ctx != null && ctx.getFile().exists()) {
43  String webPath = ctx.getWebPath();
44  if(webPath.startsWith("/")) {
45  try(DirectoryStream<Path> stream = Files.newDirectoryStream(Paths.get(ElephantContext.getRealPath(ctx.getPath())), "*.html")) {
46  if(stream.iterator().hasNext()) {
47  return webPath;
48  }
49  } catch (IOException ex) {
50  Logger.getLogger(HelpContext.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(current), ex);
51  }
52  } else {
53  return webPath;
54  }
55  }
56  return null;
57  }
Here is the call graph for this function:
Here is the caller graph for this function:

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