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

Public Member Functions

String getPath ()
 
ElContext getContext ()
 
void setContext (ElContext context)
 
WebContext getAttr ()
 
String getSocialImage ()
 
boolean isEditable (String base, String lang)
 
void saveContent (IContact contact, String base, String lang, String wiki, String html, boolean autoremove)
 
void removeVersion (String base, String lang, String version)
 

Detailed Description

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

Definition at line 31 of file EditingContext.java.

Member Function Documentation

◆ getAttr()

WebContext org.turro.elephant.web.EditingContext.getAttr ( )

Definition at line 49 of file EditingContext.java.

49  {
50  return context == null ? new WebContext() : context.getWebContext();
51  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getContext()

ElContext org.turro.elephant.web.EditingContext.getContext ( )

Definition at line 41 of file EditingContext.java.

41  {
42  return context;
43  }
Here is the caller graph for this function:

◆ getPath()

String org.turro.elephant.web.EditingContext.getPath ( )

Definition at line 35 of file EditingContext.java.

35  {
36  String path = context == null ? null : context.getPath();
37  if(Strings.isBlank(path)) path = "/";
38  return path;
39  }
Here is the call graph for this function:

◆ getSocialImage()

String org.turro.elephant.web.EditingContext.getSocialImage ( )

Definition at line 53 of file EditingContext.java.

53  {
54  SocialImage si = context != null ? context.getSocialImage() : null;
55  return si != null ? Images.removeAppContext(si.getUrl()) : null;
56  }
Here is the call graph for this function:

◆ isEditable()

boolean org.turro.elephant.web.EditingContext.isEditable ( String  base,
String  lang 
)

Definition at line 58 of file EditingContext.java.

58  {
59  if(context == null) return false;
60  if(!getAttr().isWikiPage()) return false; // DefaultElement
61  if(!context.getResources().globalResourceNames().isEmpty()) return false; // Normal HTML page
62  if(Strings.isBlank(lang)) return false; // No lang selected
63  return true;
64  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeVersion()

void org.turro.elephant.web.EditingContext.removeVersion ( String  base,
String  lang,
String  version 
)

Definition at line 70 of file EditingContext.java.

70  {
71  File file = context.getResources().getEditable(base, lang, version);
72  if(file != null) {
73  file.delete();
74  }
75  }
File getEditable(String base, String lang, String version)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ saveContent()

void org.turro.elephant.web.EditingContext.saveContent ( IContact  contact,
String  base,
String  lang,
String  wiki,
String  html,
boolean  autoremove 
)

Definition at line 66 of file EditingContext.java.

66  {
67  context.getResources().saveContent(context.getFile().toPath(), contact, base, lang, wiki, html, autoremove);
68  }
void saveContent(Path folder, IContact contact, String base, String lang, String wiki, String html, boolean autoremove)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setContext()

void org.turro.elephant.web.EditingContext.setContext ( ElContext  context)

Definition at line 45 of file EditingContext.java.

45  {
46  this.context = context;
47  }
Here is the caller graph for this function:

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