|
| WebResources (Path folder) |
|
List< String > | globalResourceNames () |
|
List< String > | resourceNamesForLang (String lang) |
|
Set< String > | getBaseNames () |
|
Set< String > | getLangs () |
|
File | getResource (String base, String lang) |
|
Set< String > | getVersions (String base, String lang) |
|
File | getEditable (String base, String lang, String version) |
|
WebLocaleResource | addWebLocaleResource (String base, WebLocaleResource resource) |
|
void | saveContent (Path folder, IContact contact, String base, String lang, String wiki, String html, boolean autoremove) |
|
- Author
- Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g
Definition at line 43 of file WebResources.java.
◆ WebResources()
org.turro.elephant.web.context.WebResources.WebResources |
( |
Path |
folder | ) |
|
◆ addWebLocaleResource()
Definition at line 96 of file WebResources.java.
97 resources.putIfAbsent(base, resource);
98 return resources.get(base);
◆ getBaseNames()
Set<String> org.turro.elephant.web.context.WebResources.getBaseNames |
( |
| ) |
|
◆ getEditable()
File org.turro.elephant.web.context.WebResources.getEditable |
( |
String |
base, |
|
|
String |
lang, |
|
|
String |
version |
|
) |
| |
Definition at line 88 of file WebResources.java.
89 if(!Strings.isBlank(version)) {
90 WebResource wr = webResource(base, lang);
91 return wr !=
null ? wr.getEditables().get(version) :
null;
◆ getLangs()
Set<String> org.turro.elephant.web.context.WebResources.getLangs |
( |
| ) |
|
Definition at line 72 of file WebResources.java.
73 Set<String> langs =
new TreeSet<>();
74 resources.values().forEach(v -> langs.addAll(v.getLangs()));
◆ getResource()
File org.turro.elephant.web.context.WebResources.getResource |
( |
String |
base, |
|
|
String |
lang |
|
) |
| |
Definition at line 78 of file WebResources.java.
79 WebResource wr = webResource(base, lang);
80 return wr !=
null ? wr.getResource() :
null;
◆ getVersions()
Set<String> org.turro.elephant.web.context.WebResources.getVersions |
( |
String |
base, |
|
|
String |
lang |
|
) |
| |
Definition at line 83 of file WebResources.java.
84 WebResource wr = webResource(base, lang);
85 return wr !=
null ?
new TreeSet(wr.getEditables().keySet()).descendingSet() : Collections.EMPTY_SET;
◆ globalResourceNames()
List<String> org.turro.elephant.web.context.WebResources.globalResourceNames |
( |
| ) |
|
Definition at line 55 of file WebResources.java.
List< String > resourceNamesForLang(String lang)
◆ resourceNamesForLang()
List<String> org.turro.elephant.web.context.WebResources.resourceNamesForLang |
( |
String |
lang | ) |
|
Definition at line 59 of file WebResources.java.
60 List<String> names =
new ArrayList<>();
61 resources.values().forEach(wlr -> {
62 String name = wlr.resourceNameForLang(lang);
63 if(!Strings.isBlank(name)) names.add(name);
◆ saveContent()
void org.turro.elephant.web.context.WebResources.saveContent |
( |
Path |
folder, |
|
|
IContact |
contact, |
|
|
String |
base, |
|
|
String |
lang, |
|
|
String |
wiki, |
|
|
String |
html, |
|
|
boolean |
autoremove |
|
) |
| |
Definition at line 101 of file WebResources.java.
103 WebResourceParts wrp = WebResourceParts.editable(contact, base, lang);
104 File editable = wrp.getEditableFile(folder, contact);
105 File resource = wrp.getResourceFile(folder);
106 FileUtil.setContent(editable, wiki);
107 FileUtil.setContent(resource, html);
109 WebResource wr = webResource(base, lang);
110 if(wr !=
null) wr.cleanEditables(wrp.getModified());
112 }
catch (IOException ex) {
113 Logger.getLogger(
WebResources.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
WebResources(Path folder)
The documentation for this class was generated from the following file: