BrightSide Workbench Full Report + Source Code
org.turro.elephant.web.context.WebContext Class Reference

Public Member Functions

boolean isShowInNavigators ()
 
void setShowInNavigators (boolean showInNavigators)
 
boolean isShowAlways ()
 
void setShowAlways (boolean showAlways)
 
boolean isTraversalNavigation ()
 
void setTraversalNavigation (boolean traversalNavigation)
 
boolean isNoIndex ()
 
void setNoIndex (boolean noIndex)
 
boolean isNoFollow ()
 
void setNoFollow (boolean noFollow)
 
boolean isPrintContext ()
 
void setPrintContext (boolean printContext)
 
boolean isPrintVersion ()
 
void setPrintVersion (boolean printVersion)
 
boolean isControlVersion ()
 
void setControlVersion (boolean controlVersion)
 
boolean isIcon ()
 
void setIcon (boolean icon)
 
Set< String > getLangs ()
 
void setLangs (Set< String > langs)
 
String getName ()
 
Map< String, String > getNames ()
 
void setNames (Map< String, String > names)
 
String getI18nKey ()
 
void setI18nKey (String i18nKey)
 
String getOrder ()
 
void setOrder (String order)
 
String getRole ()
 
void setRole (String role)
 
String getRedirect ()
 
void setRedirect (String redirect)
 
String getTarget ()
 
void setTarget (String target)
 
String getImage ()
 
void setImage (String image)
 
String getWebTag ()
 
void setWebTag (String webTag)
 
WebLayout getLayout ()
 
void setLayout (WebLayout layout)
 
WebElement getElement ()
 
void setElement (WebElement element)
 
IElement getElementInstance ()
 
WebPage getPage ()
 
void setPage (WebPage page)
 
String getLangsStr ()
 
void setLangsStr (String langs)
 
boolean isWikiPage ()
 
boolean isDynamic ()
 
void setDynamic (boolean dynamic)
 

Static Public Member Functions

static WebContext inheritFrom (WebContext webContext)
 
static String relativeRepository ()
 
static Path repository (Path path)
 
static boolean existsConf (Path path)
 
static boolean removeFrom (Path path)
 
static WebContext loadFrom (Path path)
 
static void saveTo (Path path, WebContext context)
 
static boolean createFolders (Path relativePath)
 

Static Public Attributes

static final String CONTEXT_FOLDER = "_internal"
 

Detailed Description

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

Definition at line 44 of file WebContext.java.

Member Function Documentation

◆ createFolders()

static boolean org.turro.elephant.web.context.WebContext.createFolders ( Path  relativePath)
static

Definition at line 350 of file WebContext.java.

350  {
351  File folder = Path.of(ElephantContext.getRealPath("/"), relativePath.toString()).toFile();
352  if(!folder.exists()) {
353  folder.mkdir();
354  folder.toPath().resolve(CONTEXT_FOLDER).resolve(CONTEXT_REPOSITORY).toFile().mkdirs();
355  return true;
356  } else {
357  return false;
358  }
359  }
Here is the call graph for this function:

◆ existsConf()

static boolean org.turro.elephant.web.context.WebContext.existsConf ( Path  path)
static

Definition at line 316 of file WebContext.java.

316  {
317  Path real = Path.of(ElephantContext.getRealPath(path.toString()),
318  CONTEXT_FOLDER, CONTEXT_FILE);
319  return real.toFile().exists();
320  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getElement()

WebElement org.turro.elephant.web.context.WebContext.getElement ( )

Definition at line 230 of file WebContext.java.

230  {
231  return element;
232  }
Here is the caller graph for this function:

◆ getElementInstance()

IElement org.turro.elephant.web.context.WebContext.getElementInstance ( )

Definition at line 238 of file WebContext.java.

238  {
239  return getElement().getInstance(this);
240  }
IElement getInstance(WebContext context)
Definition: WebElement.java:72
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getI18nKey()

String org.turro.elephant.web.context.WebContext.getI18nKey ( )

Definition at line 164 of file WebContext.java.

164  {
165  return i18nKey;
166  }

◆ getImage()

String org.turro.elephant.web.context.WebContext.getImage ( )

Definition at line 204 of file WebContext.java.

204  {
205  return image;
206  }
Here is the caller graph for this function:

◆ getLangs()

Set<String> org.turro.elephant.web.context.WebContext.getLangs ( )

Definition at line 136 of file WebContext.java.

136  {
137  return langs;
138  }
Here is the caller graph for this function:

◆ getLangsStr()

String org.turro.elephant.web.context.WebContext.getLangsStr ( )

Definition at line 254 of file WebContext.java.

254  {
255  return Strings.listToCvs(getLangs());
256  }
Here is the call graph for this function:

◆ getLayout()

WebLayout org.turro.elephant.web.context.WebContext.getLayout ( )

Definition at line 220 of file WebContext.java.

220  {
221  return layout;
222  }
Here is the caller graph for this function:

◆ getName()

String org.turro.elephant.web.context.WebContext.getName ( )

Definition at line 144 of file WebContext.java.

144  {
145  if(!Strings.isBlank(i18nKey)) {
146  return I_.get(i18nKey);
147  }
148  if(!getNames().isEmpty()) {
149  return getNames().getOrDefault(
150  "_" + I_.api().used().getLanguage(),
151  getNames().values().iterator().next());
152  }
153  return null;
154  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getNames()

Map<String, String> org.turro.elephant.web.context.WebContext.getNames ( )

Definition at line 156 of file WebContext.java.

156  {
157  return names;
158  }
Here is the caller graph for this function:

◆ getOrder()

String org.turro.elephant.web.context.WebContext.getOrder ( )

Definition at line 172 of file WebContext.java.

172  {
173  return order;
174  }
Here is the caller graph for this function:

◆ getPage()

WebPage org.turro.elephant.web.context.WebContext.getPage ( )

Definition at line 244 of file WebContext.java.

244  {
245  return page;
246  }
Here is the caller graph for this function:

◆ getRedirect()

String org.turro.elephant.web.context.WebContext.getRedirect ( )

Definition at line 188 of file WebContext.java.

188  {
189  return redirect;
190  }
Here is the caller graph for this function:

◆ getRole()

String org.turro.elephant.web.context.WebContext.getRole ( )

Definition at line 180 of file WebContext.java.

180  {
181  return role;
182  }
Here is the caller graph for this function:

◆ getTarget()

String org.turro.elephant.web.context.WebContext.getTarget ( )

Definition at line 196 of file WebContext.java.

196  {
197  return target;
198  }
Here is the caller graph for this function:

◆ getWebTag()

String org.turro.elephant.web.context.WebContext.getWebTag ( )

Definition at line 212 of file WebContext.java.

212  {
213  return webTag;
214  }
Here is the caller graph for this function:

◆ inheritFrom()

static WebContext org.turro.elephant.web.context.WebContext.inheritFrom ( WebContext  webContext)
static

Definition at line 294 of file WebContext.java.

294  {
295  WebContext wc = new WebContext();
296  wc.setShowInNavigators(webContext.isShowInNavigators());
297  wc.setPrintContext(webContext.isPrintContext());
298  wc.setRole(webContext.getRole());
299  wc.setOrder("000");
300  wc.setNoIndex(webContext.isNoIndex());
301  wc.setNoFollow(webContext.isNoFollow());
302  wc.setPrintVersion(webContext.isPrintVersion());
303  wc.setControlVersion(webContext.isControlVersion());
304  wc.setTraversalNavigation(webContext.isTraversalNavigation());
305  return wc;
306  }
Here is the call graph for this function:

◆ isControlVersion()

boolean org.turro.elephant.web.context.WebContext.isControlVersion ( )

Definition at line 120 of file WebContext.java.

120  {
121  return controlVersion;
122  }
Here is the caller graph for this function:

◆ isDynamic()

boolean org.turro.elephant.web.context.WebContext.isDynamic ( )

Definition at line 279 of file WebContext.java.

279  {
280  return dynamic;
281  }

◆ isIcon()

boolean org.turro.elephant.web.context.WebContext.isIcon ( )

Definition at line 128 of file WebContext.java.

128  {
129  return icon;
130  }

◆ isNoFollow()

boolean org.turro.elephant.web.context.WebContext.isNoFollow ( )

Definition at line 96 of file WebContext.java.

96  {
97  return noFollow;
98  }
Here is the caller graph for this function:

◆ isNoIndex()

boolean org.turro.elephant.web.context.WebContext.isNoIndex ( )

Definition at line 88 of file WebContext.java.

88  {
89  return noIndex;
90  }
Here is the caller graph for this function:

◆ isPrintContext()

boolean org.turro.elephant.web.context.WebContext.isPrintContext ( )

Definition at line 104 of file WebContext.java.

104  {
105  return printContext;
106  }
Here is the caller graph for this function:

◆ isPrintVersion()

boolean org.turro.elephant.web.context.WebContext.isPrintVersion ( )

Definition at line 112 of file WebContext.java.

112  {
113  return printVersion;
114  }
Here is the caller graph for this function:

◆ isShowAlways()

boolean org.turro.elephant.web.context.WebContext.isShowAlways ( )

Definition at line 72 of file WebContext.java.

72  {
73  return showAlways;
74  }
Here is the caller graph for this function:

◆ isShowInNavigators()

boolean org.turro.elephant.web.context.WebContext.isShowInNavigators ( )

Definition at line 64 of file WebContext.java.

64  {
65  return showInNavigators;
66  }
Here is the caller graph for this function:

◆ isTraversalNavigation()

boolean org.turro.elephant.web.context.WebContext.isTraversalNavigation ( )

Definition at line 80 of file WebContext.java.

80  {
81  return traversalNavigation;
82  }
Here is the caller graph for this function:

◆ isWikiPage()

boolean org.turro.elephant.web.context.WebContext.isWikiPage ( )

Definition at line 263 of file WebContext.java.

263  {
264  return Strings.isBlank(redirect) && getElement().isEmpty();
265  }
Here is the call graph for this function:

◆ loadFrom()

static WebContext org.turro.elephant.web.context.WebContext.loadFrom ( Path  path)
static

Definition at line 328 of file WebContext.java.

328  {
329  Path real = Path.of(ElephantContext.getRealPath(path.toString()),
330  CONTEXT_FOLDER, CONTEXT_FILE);
331  try(Reader reader = new FileReader(real.toFile())) {
332  return JsonConfiguration.read(reader, WebContext.class);
333  } catch (IOException ex) {
334  Logger.getLogger(WebContext.class.getName()).log(Level.SEVERE, null, ex);
335  return null;
336  }
337  }
Here is the call graph for this function:

◆ relativeRepository()

static String org.turro.elephant.web.context.WebContext.relativeRepository ( )
static

Definition at line 308 of file WebContext.java.

308  {
309  return Path.of("/", CONTEXT_FOLDER, CONTEXT_REPOSITORY).toString();
310  }
Here is the caller graph for this function:

◆ removeFrom()

static boolean org.turro.elephant.web.context.WebContext.removeFrom ( Path  path)
static

Definition at line 322 of file WebContext.java.

322  {
323  Path real = Path.of(ElephantContext.getRealPath(path.toString()),
324  CONTEXT_FOLDER, CONTEXT_FILE);
325  return real.toFile().delete();
326  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ repository()

static Path org.turro.elephant.web.context.WebContext.repository ( Path  path)
static

Definition at line 312 of file WebContext.java.

312  {
313  return Path.of(path.toString(), relativeRepository());
314  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ saveTo()

static void org.turro.elephant.web.context.WebContext.saveTo ( Path  path,
WebContext  context 
)
static

Definition at line 339 of file WebContext.java.

339  {
340  Path real = Path.of(ElephantContext.getRealPath(path.toString()),
341  CONTEXT_FOLDER, CONTEXT_FILE);
342  try(Writer writer = new FileWriter(real.toFile())) {
343  context.prepareSaving();
344  JsonConfiguration.write(writer, context);
345  } catch (IOException ex) {
346  Logger.getLogger(WebContext.class.getName()).log(Level.SEVERE, null, ex);
347  }
348  }
Here is the call graph for this function:

◆ setControlVersion()

void org.turro.elephant.web.context.WebContext.setControlVersion ( boolean  controlVersion)

Definition at line 124 of file WebContext.java.

124  {
125  this.controlVersion = controlVersion;
126  }
Here is the caller graph for this function:

◆ setDynamic()

void org.turro.elephant.web.context.WebContext.setDynamic ( boolean  dynamic)

Definition at line 283 of file WebContext.java.

283  {
284  this.dynamic = dynamic;
285  }

◆ setElement()

void org.turro.elephant.web.context.WebContext.setElement ( WebElement  element)

Definition at line 234 of file WebContext.java.

234  {
235  this.element = element;
236  }

◆ setI18nKey()

void org.turro.elephant.web.context.WebContext.setI18nKey ( String  i18nKey)

Definition at line 168 of file WebContext.java.

168  {
169  this.i18nKey = i18nKey;
170  }

◆ setIcon()

void org.turro.elephant.web.context.WebContext.setIcon ( boolean  icon)

Definition at line 132 of file WebContext.java.

132  {
133  this.icon = icon;
134  }

◆ setImage()

void org.turro.elephant.web.context.WebContext.setImage ( String  image)

Definition at line 208 of file WebContext.java.

208  {
209  this.image = image;
210  }

◆ setLangs()

void org.turro.elephant.web.context.WebContext.setLangs ( Set< String >  langs)

Definition at line 140 of file WebContext.java.

140  {
141  this.langs = langs;
142  }

◆ setLangsStr()

void org.turro.elephant.web.context.WebContext.setLangsStr ( String  langs)

Definition at line 258 of file WebContext.java.

258  {
259  this.langs.clear();
260  this.langs.addAll(Strings.csvToList(langs));
261  }

◆ setLayout()

void org.turro.elephant.web.context.WebContext.setLayout ( WebLayout  layout)

Definition at line 224 of file WebContext.java.

224  {
225  this.layout = layout;
226  }

◆ setNames()

void org.turro.elephant.web.context.WebContext.setNames ( Map< String, String >  names)

Definition at line 160 of file WebContext.java.

160  {
161  this.names = names;
162  }

◆ setNoFollow()

void org.turro.elephant.web.context.WebContext.setNoFollow ( boolean  noFollow)

Definition at line 100 of file WebContext.java.

100  {
101  this.noFollow = noFollow;
102  }
Here is the caller graph for this function:

◆ setNoIndex()

void org.turro.elephant.web.context.WebContext.setNoIndex ( boolean  noIndex)

Definition at line 92 of file WebContext.java.

92  {
93  this.noIndex = noIndex;
94  }
Here is the caller graph for this function:

◆ setOrder()

void org.turro.elephant.web.context.WebContext.setOrder ( String  order)

Definition at line 176 of file WebContext.java.

176  {
177  this.order = order;
178  }
Here is the caller graph for this function:

◆ setPage()

void org.turro.elephant.web.context.WebContext.setPage ( WebPage  page)

Definition at line 248 of file WebContext.java.

248  {
249  this.page = page;
250  }

◆ setPrintContext()

void org.turro.elephant.web.context.WebContext.setPrintContext ( boolean  printContext)

Definition at line 108 of file WebContext.java.

108  {
109  this.printContext = printContext;
110  }
Here is the caller graph for this function:

◆ setPrintVersion()

void org.turro.elephant.web.context.WebContext.setPrintVersion ( boolean  printVersion)

Definition at line 116 of file WebContext.java.

116  {
117  this.printVersion = printVersion;
118  }
Here is the caller graph for this function:

◆ setRedirect()

void org.turro.elephant.web.context.WebContext.setRedirect ( String  redirect)

Definition at line 192 of file WebContext.java.

192  {
193  this.redirect = redirect;
194  }

◆ setRole()

void org.turro.elephant.web.context.WebContext.setRole ( String  role)

Definition at line 184 of file WebContext.java.

184  {
185  this.role = role;
186  }
Here is the caller graph for this function:

◆ setShowAlways()

void org.turro.elephant.web.context.WebContext.setShowAlways ( boolean  showAlways)

Definition at line 76 of file WebContext.java.

76  {
77  this.showAlways = showAlways;
78  }

◆ setShowInNavigators()

void org.turro.elephant.web.context.WebContext.setShowInNavigators ( boolean  showInNavigators)

Definition at line 68 of file WebContext.java.

68  {
69  this.showInNavigators = showInNavigators;
70  }
Here is the caller graph for this function:

◆ setTarget()

void org.turro.elephant.web.context.WebContext.setTarget ( String  target)

Definition at line 200 of file WebContext.java.

200  {
201  this.target = target;
202  }

◆ setTraversalNavigation()

void org.turro.elephant.web.context.WebContext.setTraversalNavigation ( boolean  traversalNavigation)

Definition at line 84 of file WebContext.java.

84  {
85  this.traversalNavigation = traversalNavigation;
86  }
Here is the caller graph for this function:

◆ setWebTag()

void org.turro.elephant.web.context.WebContext.setWebTag ( String  webTag)

Definition at line 216 of file WebContext.java.

216  {
217  this.webTag = webTag;
218  }

Member Data Documentation

◆ CONTEXT_FOLDER

final String org.turro.elephant.web.context.WebContext.CONTEXT_FOLDER = "_internal"
static

Definition at line 290 of file WebContext.java.


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