BrightSide Workbench Full Report + Source Code
org.turro.entities.StudentsEntities Class Reference
Inheritance diagram for org.turro.entities.StudentsEntities:
Collaboration diagram for org.turro.entities.StudentsEntities:

Public Member Functions

 StudentsEntities ()
 
 StudentsEntities (String entityPath)
 
 StudentsEntities (Object entity)
 
Object getEntity ()
 
String getName ()
 
String getLabel ()
 
String getDescription ()
 
Object getLabelCtrl ()
 
String getImage ()
 
String getHierarchicalPath ()
 
IElephantEntity getParent ()
 
List< IElephantEntitygetChildren ()
 
String getExtendedPath ()
 
File getFile ()
 
boolean showPath ()
 
boolean showEntity ()
 
boolean canEdit (IContact contact)
 
boolean canPublish (IContact contact)
 
boolean canShowInContext (IContact contact, Object relatedEntity)
 
Collection getEntitites (String search, int maxResults, KeyValueMap kvm)
 
Collection getEntitites (String root, String search, int maxResults, KeyValueMap kvm)
 
Object configureCtrl (Object ctrl, IContact contact)
 
String getExtendedWebPath ()
 
String getUserContext ()
 
Collection< String > getAllowedRoots ()
 
String getEntityUrl (LinkType type, String contextPath)
 
- Public Member Functions inherited from org.turro.entities.DefaultElephantEntity
 DefaultElephantEntity ()
 
 DefaultElephantEntity (String entityPath)
 
 DefaultElephantEntity (Object entity)
 
IElephantEntity getController (String entityPath)
 
IElephantEntity getController (Object entity)
 
boolean isEmpty ()
 
String getStringId ()
 
String getNameOrLabel ()
 
String getRoot ()
 
String getPath ()
 
String getTreeLabel ()
 
Collection getEntitites (String search, int maxResults)
 
Collection getEntitites (String root, String search, int maxResults)
 
IElephantSendable getSendable ()
 
Collection< Object > getRelatedByRole (EntityRole role, IContact contact)
 
boolean hasRelatedRole (EntityRole role, IContact contact)
 
String getLinkRoot ()
 
String getEntityUrl ()
 
String getMemberUrl ()
 
String getAppUrl ()
 
String getReadAllUrl (LinkType type, String contextPath)
 
Object getControl (String name, IContact contact)
 
Object getControl (String name, IConstructor constructor, IContact contact)
 
Object getControl (String name, String entityPath, IContact contact)
 
Object getParticipationControl (IConstructor constructor, ParticipationReason reason)
 
Object getParticipationControl (IConstructor constructor, IContact contact, ParticipationReason reason)
 
String parseSpamCtrl (IConstructor constructor)
 
String parseFollowCtrl (IConstructor constructor)
 
EntitySet getAllChildren ()
 
Script getActorScript ()
 
boolean isActor (String actor)
 
boolean isActor (IContact contact, String actor)
 
ConceptPermission getConceptPermission (String name)
 
Folder getDeliverables ()
 
Object getObject (Path entityPath)
 
IElephantEntity getMain (Object entity)
 
int hashCode ()
 
boolean equals (Object obj)
 

Protected Member Functions

Dao createDao ()
 
boolean itsMine (Object entity)
 
IElephantEntity createInstance (String entityPath)
 
IElephantEntity createInstance (Object entity)
 
Path createPath ()
 
- Protected Member Functions inherited from org.turro.entities.DefaultElephantEntity
boolean itsMine (String rootPath)
 
boolean isValidLongEntity ()
 
Dao getDao ()
 

Additional Inherited Members

- Static Public Attributes inherited from org.turro.entities.IElephantEntity
static final String EMPTY_ID = "#"
 
static final String PATH_SEPARATOR = ";"
 
- Protected Attributes inherited from org.turro.entities.DefaultElephantEntity
String entityPath
 
Path path
 
Object entity
 

Detailed Description

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

Definition at line 56 of file StudentsEntities.java.

Constructor & Destructor Documentation

◆ StudentsEntities() [1/3]

org.turro.entities.StudentsEntities.StudentsEntities ( )

Definition at line 58 of file StudentsEntities.java.

58  {
59  }
Here is the caller graph for this function:

◆ StudentsEntities() [2/3]

org.turro.entities.StudentsEntities.StudentsEntities ( String  entityPath)

Definition at line 61 of file StudentsEntities.java.

◆ StudentsEntities() [3/3]

org.turro.entities.StudentsEntities.StudentsEntities ( Object  entity)

Definition at line 65 of file StudentsEntities.java.

65  {
66  super(entity);
67  }

Member Function Documentation

◆ canEdit()

boolean org.turro.entities.StudentsEntities.canEdit ( IContact  contact)

Checks when contact has permissions to edit the entity.

Parameters
contactthe contact checked.
Returns
true when the contact can edit.

Implements org.turro.entities.IElephantEntity.

Definition at line 222 of file StudentsEntities.java.

222  {
223  if(getEntity() != null) {
224  }
225  return false;
226  }
Here is the call graph for this function:

◆ canPublish()

boolean org.turro.entities.StudentsEntities.canPublish ( IContact  contact)

Checks when contact has permissions to see the entity.

Parameters
contactthe contact checked.
Returns
true when the contact can see.

Implements org.turro.entities.IElephantEntity.

Definition at line 229 of file StudentsEntities.java.

229  {
230  if(getEntity() != null) {
231  return true;
232  }
233  return false;
234  }
Here is the call graph for this function:

◆ canShowInContext()

boolean org.turro.entities.StudentsEntities.canShowInContext ( IContact  contact,
Object  relatedEntity 
)

Checks whether the related entity can be shown to the given contact.

Parameters
contactthe contact to be checked against.
relatedEntitythe related entity to be shown.
Returns
true if can be shown.

Implements org.turro.entities.IElephantEntity.

Definition at line 237 of file StudentsEntities.java.

237  {
238  return true;
239  }

◆ configureCtrl()

Object org.turro.entities.StudentsEntities.configureCtrl ( Object  ctrl,
IContact  contact 
)

Configures specific entity related controls for the given contact.

Parameters
ctrlthe control to configure.
contactthe contact who receive the control.
Returns
the configured control.

Implements org.turro.entities.IElephantEntity.

Definition at line 266 of file StudentsEntities.java.

266  {
267  if(ctrl instanceof VoteItCtrl) {
268  VoteItCtrl ictrl = (VoteItCtrl) ctrl;
269  ictrl.setEntityPath(getPath());
270  return ictrl;
271  } else if(ctrl instanceof StarItCtrl) {
272  StarItCtrl ictrl = (StarItCtrl) ctrl;
273  ictrl.setEntityPath(getPath());
274  return ictrl;
275  } else if(ctrl instanceof CommentItCtrl) {
276  CommentItCtrl ictrl = (CommentItCtrl) ctrl;
277  ictrl.setEntityPath(getPath());
278  return ictrl;
279  } else if(ctrl instanceof AttachCtrl) {
280  AttachCtrl ictrl = (AttachCtrl) ctrl;
281  ictrl.setEntityPath(getPath());
282  ictrl.setPublicOnly(true);
283  return ictrl;
284  } else if(ctrl instanceof FileAttach) {
285  FileAttach ictrl = (FileAttach) ctrl;
286  return ictrl;
287  } else if(ctrl instanceof DescribeItCtrl) {
288  DescribeItCtrl ictrl = (DescribeItCtrl) ctrl;
289  ictrl.setEntityPath(getPath());
290  return ictrl;
291  } else if(ctrl instanceof PollsCtrl) {
292  PollsCtrl ictrl = (PollsCtrl) ctrl;
293  ictrl.setEntityPath(getPath());
294  return ictrl;
295  } else if(ctrl instanceof IEntityCtrl) {
296  IEntityCtrl ictrl = (IEntityCtrl) ctrl;
297  ictrl.setEntityPath(getPath());
298  return ictrl;
299  }
300  return ctrl;
301  }
Here is the call graph for this function:

◆ createDao()

Dao org.turro.entities.StudentsEntities.createDao ( )
protected

Reimplemented from org.turro.entities.DefaultElephantEntity.

Definition at line 316 of file StudentsEntities.java.

316  {
317  return new StudentsPU();
318  }

◆ createInstance() [1/2]

IElephantEntity org.turro.entities.StudentsEntities.createInstance ( Object  entity)
protected

Reimplemented from org.turro.entities.DefaultElephantEntity.

Definition at line 337 of file StudentsEntities.java.

337  {
338  return new StudentsEntities(entity);
339  }
Here is the call graph for this function:

◆ createInstance() [2/2]

IElephantEntity org.turro.entities.StudentsEntities.createInstance ( String  entityPath)
protected

Reimplemented from org.turro.entities.DefaultElephantEntity.

Definition at line 332 of file StudentsEntities.java.

332  {
333  return new StudentsEntities(entityPath);
334  }
Here is the call graph for this function:

◆ createPath()

Path org.turro.entities.StudentsEntities.createPath ( )
protected

Reimplemented from org.turro.entities.DefaultElephantEntity.

Definition at line 342 of file StudentsEntities.java.

342  {
343  return new Path(StudentsPU.getObjectPath(entity));
344  }
Here is the call graph for this function:

◆ getAllowedRoots()

Collection<String> org.turro.entities.StudentsEntities.getAllowedRoots ( )

Implements org.turro.entities.IElephantEntity.

Definition at line 327 of file StudentsEntities.java.

327  {
328  return Arrays.asList("challenge", "response", "practicalwork", "talent-category");
329  }

◆ getChildren()

List<IElephantEntity> org.turro.entities.StudentsEntities.getChildren ( )

Gets the children for this entity.

Returns
the children controllers.

Implements org.turro.entities.IElephantEntity.

Definition at line 183 of file StudentsEntities.java.

183  {
184  if(getEntity() != null) {
185  if(entity instanceof Challenge) {
186  return new EntityListAdapter(((Challenge) entity).getResponses());
187  }
188  }
189  return Collections.EMPTY_LIST;
190  }
Here is the call graph for this function:

◆ getDescription()

String org.turro.entities.StudentsEntities.getDescription ( )

Gets the entity description.

Returns
the description string.

Implements org.turro.entities.IElephantEntity.

Definition at line 133 of file StudentsEntities.java.

133  {
134  return null;
135  }

◆ getEntitites() [1/2]

Collection org.turro.entities.StudentsEntities.getEntitites ( String  root,
String  search,
int  maxResults,
KeyValueMap  kvm 
)

Implements org.turro.entities.IElephantEntity.

Definition at line 250 of file StudentsEntities.java.

250  {
251  ArrayList<Object> list = new ArrayList<>();
252  if(null != root) switch (root) {
253  case "challenge":
254  list.addAll(searchChallenges(search, maxResults, kvm));
255  break;
256  case "talent-category":
257  list.addAll(searchCategories(search, maxResults, kvm));
258  break;
259  default:
260  break;
261  }
262  return list;
263  }

◆ getEntitites() [2/2]

Collection org.turro.entities.StudentsEntities.getEntitites ( String  search,
int  maxResults,
KeyValueMap  kvm 
)

Implements org.turro.entities.IElephantEntity.

Definition at line 242 of file StudentsEntities.java.

242  {
243  ArrayList<Object> list = new ArrayList<>();
244  list.addAll(searchChallenges(search, maxResults, kvm));
245  list.addAll(searchCategories(search, maxResults, kvm));
246  return list;
247  }

◆ getEntity()

Object org.turro.entities.StudentsEntities.getEntity ( )

Returns the entity for this controller.

Returns
the entity's object.

Implements org.turro.entities.IElephantEntity.

Definition at line 70 of file StudentsEntities.java.

70  {
71  if(entity == null) {
72  if(getPath() != null) {
73  if(isValidLongEntity()) {
74  if(null != path.getRoot()) switch (path.getRoot()) {
75  case "challenge":
76  entity = getDao().find(Challenge.class, path.getNodeAs(1, Long.class));
77  break;
78  case "response":
79  entity = getDao().find(Response.class, path.getNodeAs(1, Long.class));
80  break;
81  case "practicalwork":
82  entity = getDao().find(PracticalWork.class, path.getNodeAs(1, Long.class));
83  break;
84  case "talent-category":
85  entity = getDao().find(TalentCategory.class, path.getNodeAs(1, Long.class));
86  break;
87  default:
88  break;
89  }
90  }
91  }
92  }
93  return entity;
94  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getEntityUrl()

String org.turro.entities.StudentsEntities.getEntityUrl ( LinkType  type,
String  contextPath 
)

Returns the web link for this entity.

Parameters
typeweb, member or app.
contextPathif specified, will be used instead of defaults.
Returns
the path string.

Reimplemented from org.turro.entities.DefaultElephantEntity.

Definition at line 365 of file StudentsEntities.java.

365  {
366  if("response".equals(getRoot())) {
367  return getParent().getEntityUrl(type, contextPath);
368  }
369  return super.getEntityUrl(type, contextPath);
370  }
Here is the call graph for this function:

◆ getExtendedPath()

String org.turro.entities.StudentsEntities.getExtendedPath ( )

Gets the extended path for this entity.

Returns
the extended path string.

Implements org.turro.entities.IElephantEntity.

Definition at line 193 of file StudentsEntities.java.

193  {
194  return StudentsPU.getObjectExtendedPath(getEntity());
195  }
Here is the call graph for this function:

◆ getExtendedWebPath()

String org.turro.entities.StudentsEntities.getExtendedWebPath ( )

Returns a unique path for the entity.

Returns
the path string.

Implements org.turro.entities.IElephantEntity.

Definition at line 304 of file StudentsEntities.java.

304  {
305  return null;
306  }

◆ getFile()

File org.turro.entities.StudentsEntities.getFile ( )

Gets the file represented by the entity.

Returns
the entity file.

Implements org.turro.entities.IElephantEntity.

Definition at line 198 of file StudentsEntities.java.

198  {
199  return null;
200  }

◆ getHierarchicalPath()

String org.turro.entities.StudentsEntities.getHierarchicalPath ( )

Gets the hierarchical path for this entity. Mostly used for sorting purposes.

Returns
the hierarchical path string.

Implements org.turro.entities.IElephantEntity.

Definition at line 166 of file StudentsEntities.java.

166  {
167  return getPath();
168  }
Here is the call graph for this function:

◆ getImage()

String org.turro.entities.StudentsEntities.getImage ( )

Gets the entity image based on its root.

Returns
the string image location.

Implements org.turro.entities.IElephantEntity.

Definition at line 146 of file StudentsEntities.java.

146  {
147  if(getPath() != null) {
148  String root = path.getRoot();
149  if(null != root) switch (root) {
150  case "challenge":
151  return "/_zul/images/challenge.png";
152  case "response":
153  return "/_zul/images/response.png";
154  case "practicalwork":
155  return "/_zul/images/operator.png";
156  case "talent-category":
157  return "/_zul/images/group.png";
158  default:
159  break;
160  }
161  }
162  return null;
163  }
Here is the call graph for this function:

◆ getLabel()

String org.turro.entities.StudentsEntities.getLabel ( )

Gets the entity label, based on its root.

Returns
the entity string label.

Implements org.turro.entities.IElephantEntity.

Definition at line 113 of file StudentsEntities.java.

113  {
114  if(getPath() != null) {
115  String root = path.getRoot();
116  if(null != root) switch (root) {
117  case "challenge":
118  return I_.get("Challenge");
119  case "response":
120  return I_.get("Answer");
121  case "practicalwork":
122  return I_.get("Practical work");
123  case "talent-category":
124  return I_.get("Talent category");
125  default:
126  break;
127  }
128  }
129  return null;
130  }
Here is the call graph for this function:

◆ getLabelCtrl()

Object org.turro.entities.StudentsEntities.getLabelCtrl ( )

Gets the label control, usually a clickable LabelControl class.

Returns
a clickable label control.

Implements org.turro.entities.IElephantEntity.

Definition at line 138 of file StudentsEntities.java.

138  {
139  if(getEntity() != null && !(entity instanceof TalentCategory)) {
140  return new LabelControl(getEntity());
141  }
142  return null;
143  }
Here is the call graph for this function:

◆ getName()

String org.turro.entities.StudentsEntities.getName ( )

Gets the entity name.

Returns
the string name.

Implements org.turro.entities.IElephantEntity.

Definition at line 97 of file StudentsEntities.java.

97  {
98  if(getEntity() != null) {
99  if(entity instanceof Challenge) {
100  return ((Challenge) entity).getQuestion();
101  } else if(entity instanceof Response) {
102  return ((Response) entity).getChallenge().getQuestion();
103  } else if(entity instanceof PracticalWork) {
104  return ((PracticalWork) entity).getTitle();
105  } else if(entity instanceof TalentCategory) {
106  return ((TalentCategory) entity).getName();
107  }
108  }
109  return null;
110  }
Here is the call graph for this function:

◆ getParent()

IElephantEntity org.turro.entities.StudentsEntities.getParent ( )

Gets the parent for this entity.

Returns
the parent controller.

Implements org.turro.entities.IElephantEntity.

Definition at line 171 of file StudentsEntities.java.

171  {
172  if(getEntity() != null) {
173  if(entity instanceof Challenge) {
174  return ((Challenge) entity).getEntity();
175  } else if(entity instanceof Response) {
176  return Entities.getController(((Response) entity).getChallenge());
177  }
178  }
179  return null;
180  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getUserContext()

String org.turro.entities.StudentsEntities.getUserContext ( )

Returns the user context for this type of entity

Returns
the path string;

Implements org.turro.entities.IElephantEntity.

Definition at line 309 of file StudentsEntities.java.

309  {
310  return "challenge".equals(getRoot()) ?
311  "/user/" + getLinkRoot() + "s" :
312  "/user/my" + getLinkRoot() + "s";
313  }
Here is the call graph for this function:

◆ itsMine()

boolean org.turro.entities.StudentsEntities.itsMine ( Object  entity)
protected

Reimplemented from org.turro.entities.DefaultElephantEntity.

Definition at line 321 of file StudentsEntities.java.

321  {
322  return (entity instanceof Challenge) || (entity instanceof Response) ||
323  (entity instanceof PracticalWork) || (entity instanceof TalentCategory);
324  }

◆ showEntity()

boolean org.turro.entities.StudentsEntities.showEntity ( )

Shows the view for the entity.

Returns
true when a view is shown.

Implements org.turro.entities.IElephantEntity.

Definition at line 211 of file StudentsEntities.java.

211  {
212  if(getEntity() != null) {
213  if(entity instanceof Challenge) {
214  StudentsMenu.showChallenge(((Challenge) entity).getId());
215  return true;
216  }
217  }
218  return false;
219  }
Here is the call graph for this function:

◆ showPath()

boolean org.turro.entities.StudentsEntities.showPath ( )

Shows the view for this path.

Returns
true when a view is shown.

Implements org.turro.entities.IElephantEntity.

Definition at line 203 of file StudentsEntities.java.

203  {
204  if(getPath() != null) {
205  String root = path.getRoot();
206  }
207  return false;
208  }
Here is the call graph for this function:

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