BrightSide Workbench Full Report + Source Code
org.turro.elephant.impl.abstracts.AbstractElement Class Referenceabstract
Inheritance diagram for org.turro.elephant.impl.abstracts.AbstractElement:
Collaboration diagram for org.turro.elephant.impl.abstracts.AbstractElement:

Public Member Functions

 AbstractElement ()
 
String getId ()
 
String getType ()
 
String getTitle ()
 
void setTitle (String title)
 
Collection< String > getMetas ()
 
void setMetas (Collection< String > metas)
 
ElContext getContext ()
 
IConstructor getConstructor ()
 
void loadData () throws ServletException, IOException
 
abstract void startConstruction () throws ServletException, IOException
 
void setConfiguration (IConstructor constructor, ElContext context)
 
String getStart ()
 
String getEnd ()
 
String getStartTitle ()
 
String getEndTitle ()
 
String getStartBody ()
 
String getEndBody ()
 
String getStartFooter ()
 
String getEndFooter ()
 
String getStartOption ()
 
String getEndOption ()
 
boolean canDisplay ()
 
boolean isSelectable ()
 
boolean isInRole ()
 
boolean canPrint ()
 
String getElementFolder ()
 
boolean isOriginalContext ()
 
void setRootCategories (ElContext root)
 
String getTypeName ()
 
AttributeSupport getAttributes ()
 
void applyChanges ()
 
void populateFromParent ()
 
void setDefaultMetas ()
 
void setConfiguration (Element conf, Element factory)
 

Protected Attributes

IConstructor constructor
 
ElContext context
 
AttributeSupport attrSupport
 
Element conf = null
 
String[] types
 
String title
 
Collection< String > metas
 

Detailed Description

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

Definition at line 46 of file AbstractElement.java.

Constructor & Destructor Documentation

◆ AbstractElement()

org.turro.elephant.impl.abstracts.AbstractElement.AbstractElement ( )

Member Function Documentation

◆ applyChanges()

void org.turro.elephant.impl.abstracts.AbstractElement.applyChanges ( )

Implements org.turro.elephant.layout.IManageable.

Definition at line 223 of file AbstractElement.java.

223  {
224  }

◆ canDisplay()

boolean org.turro.elephant.impl.abstracts.AbstractElement.canDisplay ( )

This method is queried within startConstruction().

Returns
True is element can display.

Implements org.turro.elephant.security.IDefendable.

Definition at line 174 of file AbstractElement.java.

174  {
175  return isSelectable();
176  }
Here is the call graph for this function:

◆ canPrint()

boolean org.turro.elephant.impl.abstracts.AbstractElement.canPrint ( )

This method is queried when a print version is being called.

Returns
True is element can print.

Implements org.turro.elephant.security.IDefendable.

Definition at line 192 of file AbstractElement.java.

192  {
193  return true;
194  }

◆ getAttributes()

AttributeSupport org.turro.elephant.impl.abstracts.AbstractElement.getAttributes ( )
Returns
The attributes of this element.

Implements org.turro.elephant.layout.IManageable.

Definition at line 218 of file AbstractElement.java.

218  {
219  return attrSupport;
220  }
Here is the caller graph for this function:

◆ getConstructor()

IConstructor org.turro.elephant.impl.abstracts.AbstractElement.getConstructor ( )
Returns
Returns current IConstructor.

Implements org.turro.elephant.context.IElement.

Definition at line 97 of file AbstractElement.java.

97  {
98  return constructor;
99  }
Here is the caller graph for this function:

◆ getContext()

ElContext org.turro.elephant.impl.abstracts.AbstractElement.getContext ( )
Returns
The ElContext owning the element.

Implements org.turro.elephant.context.IElement.

Definition at line 92 of file AbstractElement.java.

92  {
93  return context;
94  }
Here is the caller graph for this function:

◆ getElementFolder()

String org.turro.elephant.impl.abstracts.AbstractElement.getElementFolder ( )

IElement implementations must ensure this folder is unique within the web application.

Returns
Element's folder.

Implements org.turro.elephant.context.IElement.

Definition at line 197 of file AbstractElement.java.

197  {
198  return context.getPath();
199  }
Here is the call graph for this function:

◆ getEnd()

◆ getEndBody()

String org.turro.elephant.impl.abstracts.AbstractElement.getEndBody ( )

Implements org.turro.elephant.layout.IRenderable.

Definition at line 145 of file AbstractElement.java.

145  {
146  String result = "";
147  for(int i = 0; types != null && i < types.length; i++) {
148  result += "</div>";
149  }
150  return result;
151  }
Here is the caller graph for this function:

◆ getEndFooter()

String org.turro.elephant.impl.abstracts.AbstractElement.getEndFooter ( )

Implements org.turro.elephant.layout.IRenderable.

Definition at line 159 of file AbstractElement.java.

159  {
160  return "";
161  }

◆ getEndOption()

String org.turro.elephant.impl.abstracts.AbstractElement.getEndOption ( )

Implements org.turro.elephant.layout.IRenderable.

Definition at line 169 of file AbstractElement.java.

169  {
170  return "";
171  }

◆ getEndTitle()

String org.turro.elephant.impl.abstracts.AbstractElement.getEndTitle ( )

Implements org.turro.elephant.layout.IRenderable.

Definition at line 130 of file AbstractElement.java.

130  {
131  return "";
132  }

◆ getId()

String org.turro.elephant.impl.abstracts.AbstractElement.getId ( )
Returns
Element's identifier.

Implements org.turro.elephant.context.IElement.

Definition at line 62 of file AbstractElement.java.

62  {
63  return (this instanceof DefaultElement) ? null : this.getClass().getSimpleName();
64  }
Here is the caller graph for this function:

◆ getMetas()

Collection<String> org.turro.elephant.impl.abstracts.AbstractElement.getMetas ( )

Implements org.turro.elephant.context.IElement.

Definition at line 82 of file AbstractElement.java.

82  {
83  return metas == null ? Collections.EMPTY_LIST : metas;
84  }

◆ getStart()

◆ getStartBody()

String org.turro.elephant.impl.abstracts.AbstractElement.getStartBody ( )

Implements org.turro.elephant.layout.IRenderable.

Definition at line 135 of file AbstractElement.java.

135  {
136  initTypes();
137  String result = "";
138  for(int i = 0; types != null && i < types.length; i++) {
139  result += "<div class='" + types[i] + "'>";
140  }
141  return result;
142  }
Here is the caller graph for this function:

◆ getStartFooter()

String org.turro.elephant.impl.abstracts.AbstractElement.getStartFooter ( )

Implements org.turro.elephant.layout.IRenderable.

Definition at line 154 of file AbstractElement.java.

154  {
155  return "";
156  }

◆ getStartOption()

String org.turro.elephant.impl.abstracts.AbstractElement.getStartOption ( )

Implements org.turro.elephant.layout.IRenderable.

Definition at line 164 of file AbstractElement.java.

164  {
165  return "";
166  }

◆ getStartTitle()

String org.turro.elephant.impl.abstracts.AbstractElement.getStartTitle ( )

Implements org.turro.elephant.layout.IRenderable.

Definition at line 125 of file AbstractElement.java.

125  {
126  return "";
127  }

◆ getTitle()

String org.turro.elephant.impl.abstracts.AbstractElement.getTitle ( )

Implements org.turro.elephant.context.IElement.

Definition at line 72 of file AbstractElement.java.

◆ getType()

String org.turro.elephant.impl.abstracts.AbstractElement.getType ( )

Implements org.turro.elephant.context.IElement.

Definition at line 67 of file AbstractElement.java.

67  {
68  return attrSupport.getAttributeValue("type", "default-element");
69  }
String getAttributeValue(String name, String defaultValue)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTypeName()

String org.turro.elephant.impl.abstracts.AbstractElement.getTypeName ( )
Returns
Element type name.

Implements org.turro.elephant.layout.IManageable.

Definition at line 213 of file AbstractElement.java.

213  {
214  return I_.get("element." + getType());
215  }
static String get(String msg)
Definition: I_.java:41
Here is the call graph for this function:

◆ isInRole()

boolean org.turro.elephant.impl.abstracts.AbstractElement.isInRole ( )

This method points to an specific role, know at configuration time. To achieve more control on roles use constructor's, which takes a parameter with a role.

Returns
True when the element is in role.

Implements org.turro.elephant.security.IDefendable.

Definition at line 184 of file AbstractElement.java.

184  {
185  if(Strings.isBlank(context.getWebContext().getElement().getRole())) {
186  return true;
187  }
189  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isOriginalContext()

boolean org.turro.elephant.impl.abstracts.AbstractElement.isOriginalContext ( )
Returns
True if current context is the original context where this element was created.

Implements org.turro.elephant.context.IElement.

Definition at line 202 of file AbstractElement.java.

202  {
203  return getConstructor().isOriginal();
204  //return context.getPath().equals(getConstructor().getCurrentContext().getPath());
205  }
Here is the call graph for this function:

◆ isSelectable()

boolean org.turro.elephant.impl.abstracts.AbstractElement.isSelectable ( )

Selectable elements may respond to user input.

Returns
True when the element is selectable.

Implements org.turro.elephant.security.IDefendable.

Definition at line 179 of file AbstractElement.java.

179  {
180  return isInRole();
181  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadData()

◆ populateFromParent()

void org.turro.elephant.impl.abstracts.AbstractElement.populateFromParent ( )

Implements org.turro.elephant.layout.IManageable.

Definition at line 227 of file AbstractElement.java.

227  {
228  }

◆ setConfiguration() [1/2]

void org.turro.elephant.impl.abstracts.AbstractElement.setConfiguration ( Element  conf,
Element  factory 
)

Definition at line 251 of file AbstractElement.java.

251  {
252  this.conf = conf;
253  this.factory = factory;
255  (conf != null ? conf.getAttributeValue("type") : null), AttributeItem.STRING_ATTR, "default-body"));
256  if(conf != null) {
257  List attribs = conf.getChildren("attrib");
258  Iterator it = attribs.iterator();
259  Element tmp;
260  while(it.hasNext()) {
261  tmp = (Element)it.next();
263  "attrib:" + tmp.getAttributeValue("name"),
264  tmp.getAttributeValue("value"),
266  null));
267  }
268  }
269  }
Here is the call graph for this function:

◆ setConfiguration() [2/2]

void org.turro.elephant.impl.abstracts.AbstractElement.setConfiguration ( IConstructor  constructor,
ElContext  context 
)

Implements org.turro.elephant.context.IElement.

Definition at line 109 of file AbstractElement.java.

109  {
110  this.constructor = constructor;
111  this.context = context;
112  }

◆ setDefaultMetas()

void org.turro.elephant.impl.abstracts.AbstractElement.setDefaultMetas ( )

Definition at line 230 of file AbstractElement.java.

230  {
231  ArrayList<RepositoryFile> files = new ArrayList<>();
232  //ElContext elContext = ElContextMap.getContext(context);
233  if(context != null) {
234  if(!SocialImageMap.hasImage(context.getWebPath())) {
235  Repository repository = context.getRepository();
236  files.addAll(repository.getRepositoryFiles("*_social.png,*_social.jpg"));
237  files.addAll(repository.getRepositoryFiles("*.png,*.jpg"));
238  }
239  setMetas(new SocialNet(context.getWebPath(), context.getName(), null, files).getMetas());
240  }
241  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setMetas()

void org.turro.elephant.impl.abstracts.AbstractElement.setMetas ( Collection< String >  metas)

Implements org.turro.elephant.context.IElement.

Definition at line 87 of file AbstractElement.java.

87  {
88  this.metas = metas;
89  }
Here is the caller graph for this function:

◆ setRootCategories()

void org.turro.elephant.impl.abstracts.AbstractElement.setRootCategories ( ElContext  root)
Parameters
rootCategories root Calls

Implements org.turro.elephant.context.IElement.

Reimplemented in org.turro.publication.www.PublicationWeb, and org.turro.dossier.www.DossierDashboard.

Definition at line 208 of file AbstractElement.java.

208  {
209  // do nothing
210  }

◆ setTitle()

void org.turro.elephant.impl.abstracts.AbstractElement.setTitle ( String  title)

Implements org.turro.elephant.context.IElement.

Definition at line 77 of file AbstractElement.java.

77  {
78  this.title = title;
79  }
Here is the caller graph for this function:

◆ startConstruction()

Member Data Documentation

◆ attrSupport

AttributeSupport org.turro.elephant.impl.abstracts.AbstractElement.attrSupport
protected

Definition at line 50 of file AbstractElement.java.

◆ conf

Element org.turro.elephant.impl.abstracts.AbstractElement.conf = null
protected

Definition at line 51 of file AbstractElement.java.

◆ constructor

IConstructor org.turro.elephant.impl.abstracts.AbstractElement.constructor
protected

Definition at line 48 of file AbstractElement.java.

◆ context

ElContext org.turro.elephant.impl.abstracts.AbstractElement.context
protected

Definition at line 49 of file AbstractElement.java.

◆ metas

Collection<String> org.turro.elephant.impl.abstracts.AbstractElement.metas
protected

Definition at line 54 of file AbstractElement.java.

◆ title

String org.turro.elephant.impl.abstracts.AbstractElement.title
protected

Definition at line 53 of file AbstractElement.java.

◆ types

String [] org.turro.elephant.impl.abstracts.AbstractElement.types
protected

Definition at line 52 of file AbstractElement.java.


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