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

Public Member Functions

 AllianceEntities ()
 
 AllianceEntities (String entityPath)
 
 AllianceEntities (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)
 
Collection getEntitites (String search, int maxResults, KeyValueMap kvm)
 
Collection getEntitites (String root, String search, int maxResults, KeyValueMap kvm)
 
Object configureCtrl (Object ctrl, IContact contact)
 
boolean canShowInContext (IContact contact, Object relatedEntity)
 
String getExtendedWebPath ()
 
String getUserContext ()
 
Collection< String > getAllowedRoots ()
 
- 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 getEntityUrl (LinkType type, String contextPath)
 
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 48 of file AllianceEntities.java.

Constructor & Destructor Documentation

◆ AllianceEntities() [1/3]

org.turro.entities.AllianceEntities.AllianceEntities ( )

Definition at line 50 of file AllianceEntities.java.

50  {
51  }
Here is the caller graph for this function:

◆ AllianceEntities() [2/3]

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

Definition at line 53 of file AllianceEntities.java.

◆ AllianceEntities() [3/3]

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

Definition at line 57 of file AllianceEntities.java.

57  {
58  super(entity);
59  }

Member Function Documentation

◆ canEdit()

boolean org.turro.entities.AllianceEntities.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 225 of file AllianceEntities.java.

225  {
226  return false;
227  }

◆ canPublish()

boolean org.turro.entities.AllianceEntities.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 230 of file AllianceEntities.java.

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

◆ canShowInContext()

boolean org.turro.entities.AllianceEntities.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 278 of file AllianceEntities.java.

278  {
279  return true;
280  }

◆ configureCtrl()

Object org.turro.entities.AllianceEntities.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 273 of file AllianceEntities.java.

273  {
274  return ctrl;
275  }

◆ createDao()

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

Reimplemented from org.turro.entities.DefaultElephantEntity.

Definition at line 304 of file AllianceEntities.java.

304  {
305  return new AlliancePU();
306  }

◆ createInstance() [1/2]

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

Reimplemented from org.turro.entities.DefaultElephantEntity.

Definition at line 326 of file AllianceEntities.java.

326  {
327  return new AllianceEntities(entity);
328  }
Here is the call graph for this function:

◆ createInstance() [2/2]

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

Reimplemented from org.turro.entities.DefaultElephantEntity.

Definition at line 321 of file AllianceEntities.java.

321  {
322  return new AllianceEntities(entityPath);
323  }
Here is the call graph for this function:

◆ createPath()

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

Reimplemented from org.turro.entities.DefaultElephantEntity.

Definition at line 331 of file AllianceEntities.java.

331  {
332  return new Path(AlliancePU.getObjectPath(entity));
333  }
Here is the call graph for this function:

◆ getAllowedRoots()

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

Implements org.turro.entities.IElephantEntity.

Definition at line 316 of file AllianceEntities.java.

316  {
317  return Arrays.asList("axproject", "axcontact", "axproject-grant", "axstudent", "axcenter");
318  }

◆ getChildren()

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

Gets the children for this entity.

Returns
the children controllers.

Implements org.turro.entities.IElephantEntity.

Definition at line 192 of file AllianceEntities.java.

192  {
193  if(getEntity() != null) {
194  if(entity instanceof AxProject) {
195  } else if(entity instanceof AxContact) {
196  } else if(entity instanceof AxProjectGrant) {
197  } else if(entity instanceof AxStudent) {
198  } else if(entity instanceof AxCenter) {
199  }
200  }
201  return Collections.EMPTY_LIST;
202  }
Here is the call graph for this function:

◆ getDescription()

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

Gets the entity description.

Returns
the description string.

Implements org.turro.entities.IElephantEntity.

Definition at line 132 of file AllianceEntities.java.

132  {
133  return null;
134  }

◆ getEntitites() [1/2]

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

Implements org.turro.entities.IElephantEntity.

Definition at line 248 of file AllianceEntities.java.

248  {
249  ArrayList<Object> list = new ArrayList<>();
250  if(null != root) switch (root) {
251  case "axproject":
252  list.addAll(searchProjects(search, maxResults, kvm));
253  break;
254  case "axcontact":
255  list.addAll(searchContacts(search, maxResults, kvm));
256  break;
257  case "axproject-grant":
258  list.addAll(searchProjectGrants(search, maxResults, kvm));
259  break;
260  case "axstudent":
261  list.addAll(searchStudents(search, maxResults, kvm));
262  break;
263  case "axcenter":
264  list.addAll(searchCenters(search, maxResults, kvm));
265  break;
266  default:
267  break;
268  }
269  return list;
270  }

◆ getEntitites() [2/2]

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

Implements org.turro.entities.IElephantEntity.

Definition at line 237 of file AllianceEntities.java.

237  {
238  ArrayList<Object> list = new ArrayList<>();
239  list.addAll(searchProjects(search, maxResults, kvm));
240  list.addAll(searchContacts(search, maxResults, kvm));
241  list.addAll(searchProjectGrants(search, maxResults, kvm));
242  list.addAll(searchStudents(search, maxResults, kvm));
243  list.addAll(searchCenters(search, maxResults, kvm));
244  return list;
245  }

◆ getEntity()

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

Returns the entity for this controller.

Returns
the entity's object.

Implements org.turro.entities.IElephantEntity.

Definition at line 62 of file AllianceEntities.java.

62  {
63  if(entity == null) {
64  if(getPath() != null) {
65  if(path.getSize() == 2) {
66  if(null != path.getRoot()) switch (path.getRoot()) {
67  case "axproject":
68  entity = getDao().find(AxProject.class, ProcedenceId.from(path.getNode(1)));
69  break;
70  case "axcontact":
71  entity = getDao().find(AxContact.class, ProcedenceId.from(path.getNode(1)));
72  break;
73  case "axproject-grant":
74  entity = getDao().find(AxProjectGrant.class, ProcedenceId.from(path.getNode(1)));
75  break;
76  case "axstudent":
77  entity = getDao().find(AxStudent.class, ProcedenceId.from(path.getNode(1)));
78  break;
79  case "axcenter":
80  entity = getDao().find(AxCenter.class, ProcedenceId.from(path.getNode(1)));
81  break;
82  default:
83  break;
84  }
85  }
86  }
87  }
88  return entity;
89  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getExtendedPath()

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

Gets the extended path for this entity.

Returns
the extended path string.

Implements org.turro.entities.IElephantEntity.

Definition at line 205 of file AllianceEntities.java.

205  {
206  return null;
207  }

◆ getExtendedWebPath()

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

Returns a unique path for the entity.

Returns
the path string.

Implements org.turro.entities.IElephantEntity.

Definition at line 283 of file AllianceEntities.java.

283  {
284  if(getEntity() != null) {
285  }
286  return null;
287  }
Here is the call graph for this function:

◆ getFile()

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

Gets the file represented by the entity.

Returns
the entity file.

Implements org.turro.entities.IElephantEntity.

Definition at line 210 of file AllianceEntities.java.

210  {
211  return null;
212  }

◆ getHierarchicalPath()

String org.turro.entities.AllianceEntities.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 167 of file AllianceEntities.java.

167  {
168  if(getEntity() != null) {
169  }
170  return getPath();
171  }
Here is the call graph for this function:

◆ getImage()

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

Gets the entity image based on its root.

Returns
the string image location.

Implements org.turro.entities.IElephantEntity.

Definition at line 145 of file AllianceEntities.java.

145  {
146  if(getPath() != null) {
147  String root = path.getRoot();
148  if(null != root) switch (root) {
149  case "axproject":
150  return "/_zul/images/project.png";
151  case "axcontact":
152  return "/_zul/images/contact.png";
153  case "axproject-grant":
154  return "/_zul/images/handshelp.png";
155  case "axstudent":
156  return "/_zul/images/student.png";
157  case "axcenter":
158  return "/_zul/images/university.png";
159  default:
160  break;
161  }
162  }
163  return null;
164  }
Here is the call graph for this function:

◆ getLabel()

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

Gets the entity label, based on its root.

Returns
the entity string label.

Implements org.turro.entities.IElephantEntity.

Definition at line 110 of file AllianceEntities.java.

110  {
111  if(getPath() != null) {
112  String root = path.getRoot();
113  if(null != root) switch (root) {
114  case "axproject":
115  return I_.get("Project");
116  case "axcontact":
117  return I_.get("Contact");
118  case "axproject-grant":
119  return I_.get("Project grant");
120  case "axstudent":
121  return I_.get("Student");
122  case "axcenter":
123  return I_.get("Learning center");
124  default:
125  break;
126  }
127  }
128  return null;
129  }
Here is the call graph for this function:

◆ getLabelCtrl()

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

Gets the label control, usually a clickable LabelControl class.

Returns
a clickable label control.

Implements org.turro.entities.IElephantEntity.

Definition at line 137 of file AllianceEntities.java.

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

◆ getName()

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

Gets the entity name.

Returns
the string name.

Implements org.turro.entities.IElephantEntity.

Definition at line 92 of file AllianceEntities.java.

92  {
93  if(getEntity() != null) {
94  if(entity instanceof AxProject) {
95  return ((AxProject) entity).getFriendlyName();
96  } else if(entity instanceof AxContact) {
97  return ((AxContact) entity).getName();
98  } else if(entity instanceof AxProjectGrant) {
99  return ((AxProjectGrant) entity).getName();
100  } else if(entity instanceof AxStudent) {
101  return ((AxStudent) entity).getName();
102  } else if(entity instanceof AxCenter) {
103  return ((AxCenter) entity).getName();
104  }
105  }
106  return null;
107  }
Here is the call graph for this function:

◆ getParent()

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

Gets the parent for this entity.

Returns
the parent controller.

Implements org.turro.entities.IElephantEntity.

Definition at line 174 of file AllianceEntities.java.

174  {
175  if(getEntity() != null) {
176  if(entity instanceof AxProject) {
177  return null;
178  } else if(entity instanceof AxContact) {
179  return null;
180  } else if(entity instanceof AxProjectGrant) {
181  return null;
182  } else if(entity instanceof AxStudent) {
183  return null;
184  } else if(entity instanceof AxCenter) {
185  return null;
186  }
187  }
188  return null;
189  }
Here is the call graph for this function:

◆ getUserContext()

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

Returns the user context for this type of entity

Returns
the path string;

Implements org.turro.entities.IElephantEntity.

Definition at line 290 of file AllianceEntities.java.

290  {
291  if(getPath() != null) {
292  String root = path.getRoot();
293  if(null != root) switch (root) {
294  case "axproject":
295  return "/user/alliance/projects";
296  default:
297  break;
298  }
299  }
300  return null;
301  }
Here is the call graph for this function:

◆ itsMine()

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

Reimplemented from org.turro.entities.DefaultElephantEntity.

Definition at line 309 of file AllianceEntities.java.

309  {
310  return (entity instanceof AxProject) || (entity instanceof AxContact) ||
311  (entity instanceof AxProjectGrant) || (entity instanceof AxStudent) ||
312  (entity instanceof AxCenter);
313  }

◆ showEntity()

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

Shows the view for the entity.

Returns
true when a view is shown.

Implements org.turro.entities.IElephantEntity.

Definition at line 220 of file AllianceEntities.java.

220  {
221  return false;
222  }

◆ showPath()

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

Shows the view for this path.

Returns
true when a view is shown.

Implements org.turro.entities.IElephantEntity.

Definition at line 215 of file AllianceEntities.java.

215  {
216  return false;
217  }

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