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

Public Member Functions

 WebResourceParts (File file)
 
String getBase ()
 
String getLocale ()
 
String getExtension ()
 
String getAuthor ()
 
String getModified ()
 
Date getModifiedDate ()
 
boolean isEmpty ()
 
boolean isResource ()
 
boolean isEditable ()
 
String nameAsResource ()
 
String nameAsEditable (IContact contact)
 
File getEditableFile (Path folder, IContact contact)
 
File getResourceFile (Path folder)
 
IContact getUser ()
 

Static Public Member Functions

static WebResourceParts editable (IContact contact, String base, String locale)
 

Detailed Description

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

Definition at line 34 of file WebResourceParts.java.

Constructor & Destructor Documentation

◆ WebResourceParts()

org.turro.elephant.web.context.WebResourceParts.WebResourceParts ( File  file)

Definition at line 50 of file WebResourceParts.java.

50  {
51  matchFile(file);
52  }
Here is the caller graph for this function:

Member Function Documentation

◆ editable()

static WebResourceParts org.turro.elephant.web.context.WebResourceParts.editable ( IContact  contact,
String  base,
String  locale 
)
static

Definition at line 112 of file WebResourceParts.java.

112  {
113  WebResourceParts wrp = new WebResourceParts(null);
114  if(Strings.isBlank(base)) {
115  wrp.base = "000" + ObjectString.formatObject(new Date(),
116  ObjectString.COMPRESSED_DATE_PATTERN, false);
117  } else {
118  wrp.base = base;
119  }
120  wrp.modified = ObjectString.formatObject(new Date(),
121  ObjectString.COMPRESSED_DATE_PATTERN, false);
122  wrp.author = contact.getId();
123  wrp.locale = locale;
124  wrp.extension = "wiki";
125  return wrp;
126  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAuthor()

String org.turro.elephant.web.context.WebResourceParts.getAuthor ( )

Definition at line 66 of file WebResourceParts.java.

66  {
67  return author;
68  }

◆ getBase()

String org.turro.elephant.web.context.WebResourceParts.getBase ( )

Definition at line 54 of file WebResourceParts.java.

54  {
55  return base;
56  }

◆ getEditableFile()

File org.turro.elephant.web.context.WebResourceParts.getEditableFile ( Path  folder,
IContact  contact 
)

Definition at line 100 of file WebResourceParts.java.

100  {
101  return Path.of(folder.toString(), nameAsEditable(contact)).toFile();
102  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getExtension()

String org.turro.elephant.web.context.WebResourceParts.getExtension ( )

Definition at line 62 of file WebResourceParts.java.

62  {
63  return extension;
64  }

◆ getLocale()

String org.turro.elephant.web.context.WebResourceParts.getLocale ( )

Definition at line 58 of file WebResourceParts.java.

58  {
59  return locale;
60  }

◆ getModified()

String org.turro.elephant.web.context.WebResourceParts.getModified ( )

Definition at line 70 of file WebResourceParts.java.

70  {
71  return modified;
72  }
Here is the caller graph for this function:

◆ getModifiedDate()

Date org.turro.elephant.web.context.WebResourceParts.getModifiedDate ( )

Definition at line 74 of file WebResourceParts.java.

74  {
75  return modifiedDate;
76  }

◆ getResourceFile()

File org.turro.elephant.web.context.WebResourceParts.getResourceFile ( Path  folder)

Definition at line 104 of file WebResourceParts.java.

104  {
105  return Path.of(folder.toString(), nameAsResource()).toFile();
106  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getUser()

IContact org.turro.elephant.web.context.WebResourceParts.getUser ( )

Definition at line 108 of file WebResourceParts.java.

108  {
109  return Contacts.getContactById(author);
110  }
Here is the call graph for this function:

◆ isEditable()

boolean org.turro.elephant.web.context.WebResourceParts.isEditable ( )

Definition at line 88 of file WebResourceParts.java.

88  {
89  return !isEmpty() && !Strings.isBlank(modified);
90  }
Here is the call graph for this function:

◆ isEmpty()

boolean org.turro.elephant.web.context.WebResourceParts.isEmpty ( )

Definition at line 80 of file WebResourceParts.java.

80  {
81  return Strings.isBlank(base);
82  }
Here is the caller graph for this function:

◆ isResource()

boolean org.turro.elephant.web.context.WebResourceParts.isResource ( )

Definition at line 84 of file WebResourceParts.java.

84  {
85  return !isEmpty() && Strings.isBlank(modified);
86  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ nameAsEditable()

String org.turro.elephant.web.context.WebResourceParts.nameAsEditable ( IContact  contact)

Definition at line 96 of file WebResourceParts.java.

96  {
97  return base + "." + modified + "." + contact.getId() + locale + ".wiki";
98  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ nameAsResource()

String org.turro.elephant.web.context.WebResourceParts.nameAsResource ( )

Definition at line 92 of file WebResourceParts.java.

92  {
93  return base + locale + ".html";
94  }
Here is the caller graph for this function:

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