BrightSide Workbench Full Report + Source Code
IElephantEntity.java
Go to the documentation of this file.
1 /*
2  * TurrĂ³ i Cutiller Foundation. License notice.
3  * Copyright (C) 2017 Lluis TurrĂ³ Cutiller <http://www.turro.org/>
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Affero General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Affero General Public License for more details.
14  *
15  * You should have received a copy of the GNU Affero General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 package org.turro.entities;
20 
21 import java.io.File;
22 import java.util.Collection;
23 import java.util.List;
24 import org.turro.action.IElephantSendable;
25 import org.turro.action.LinkType;
26 import org.turro.collections.KeyValueMap;
27 import org.turro.elephant.context.IConstructor;
28 import org.turro.file.Folder;
29 import org.turro.participation.ParticipationReason;
30 import org.turro.path.Path;
31 import org.turro.plugin.contacts.IContact;
32 import org.turro.script.Script;
33 import org.turro.security.ConceptPermission;
34 
39 public interface IElephantEntity {
40 
41  public static final String
42  EMPTY_ID = "#",
44 
50  public IElephantEntity getController(String entityPath);
51 
57  public IElephantEntity getController(Object entity);
58 
63  public boolean isEmpty();
64 
70  public String getTreeLabel();
71 
76  public String getStringId();
77 
82  public Object getEntity();
83 
88  public String getName();
89 
94  public String getLabel();
95 
100  public String getNameOrLabel();
101 
106  public String getDescription();
107 
112  public Object getLabelCtrl();
113 
118  public String getImage();
119 
124  public String getRoot();
125 
130  public String getPath();
131 
137  public String getHierarchicalPath();
138 
144 
149  public List<IElephantEntity> getChildren();
150 
155  @Deprecated
156  public String getExtendedPath();
157 
162  @Deprecated
163  public File getFile();
164 
169  public boolean showPath();
170 
175  public boolean showEntity();
176 
182  public boolean canEdit(IContact contact);
183 
189  public boolean canPublish(IContact contact);
190 
191  /* Search */
192 
193  public Collection getEntitites(String search, int maxResults);
194  public Collection getEntitites(String root, String search, int maxResults);
195 
196  public Collection getEntitites(String search, int maxResults, KeyValueMap kvm);
197  public Collection getEntitites(String root, String search, int maxResults, KeyValueMap kvm);
198 
199  /* Roots */
200 
201  public Collection<String> getAllowedRoots();
202 
203  /* Sendable */
204 
210 
211  /* Controls */
212 
219  public Object configureCtrl(Object ctrl, IContact contact);
220 
227  public boolean canShowInContext(IContact contact, Object relatedEntity);
228 
229  /* Roles */
230 
237  public Collection<Object> getRelatedByRole(EntityRole role, IContact contact);
238 
245  public boolean hasRelatedRole(EntityRole role, IContact contact);
246 
247  /* Web */
248 
253  public String getExtendedWebPath();
254 
259  public String getEntityUrl();
260 
265  public String getMemberUrl();
266 
271  public String getAppUrl();
272 
279  public String getEntityUrl(LinkType type, String contextPath);
280 
287  public String getReadAllUrl(LinkType type, String contextPath);
288 
293  public String getLinkRoot();
294 
299  public String getUserContext();
300 
307  public Object getControl(String name, IConstructor constructor, IContact contact);
308  public Object getControl(String name, String entityPath, IContact contact);
309  public Object getControl(String name, IContact contact);
310  public Object getParticipationControl(IConstructor constructor, ParticipationReason reason);
311  public Object getParticipationControl(IConstructor constructor, IContact contact, ParticipationReason reason);
312 
313  /* Specialized participations */
314 
315  public String parseSpamCtrl(IConstructor constructor);
316  public String parseFollowCtrl(IConstructor constructor);
317 
318  /* Children helpers */
319 
321 
322  /* Actors */
323 
324  public Script getActorScript();
325  public boolean isActor(String actor);
326  public boolean isActor(IContact contact, String actor);
327 
328  /* Concept permissions */
329 
331 
332  /* Deliverables */
333 
334  public Folder getDeliverables();
335 
336  /* Simple objects */
337 
338  public Object getObject(Path entityPath);
339  public IElephantEntity getMain(Object entity);
340 }
String parseSpamCtrl(IConstructor constructor)
boolean canShowInContext(IContact contact, Object relatedEntity)
Collection getEntitites(String search, int maxResults)
IElephantSendable getSendable()
String parseFollowCtrl(IConstructor constructor)
Object getParticipationControl(IConstructor constructor, ParticipationReason reason)
Collection< String > getAllowedRoots()
Object getControl(String name, IContact contact)
Collection getEntitites(String search, int maxResults, KeyValueMap kvm)
Object getParticipationControl(IConstructor constructor, IContact contact, ParticipationReason reason)
IElephantEntity getController(String entityPath)
boolean canEdit(IContact contact)
boolean isActor(String actor)
ConceptPermission getConceptPermission(String name)
Object getControl(String name, String entityPath, IContact contact)
Object getObject(Path entityPath)
Collection getEntitites(String root, String search, int maxResults, KeyValueMap kvm)
List< IElephantEntity > getChildren()
Collection getEntitites(String root, String search, int maxResults)
boolean hasRelatedRole(EntityRole role, IContact contact)
String getReadAllUrl(LinkType type, String contextPath)
boolean canPublish(IContact contact)
boolean isActor(IContact contact, String actor)
Object configureCtrl(Object ctrl, IContact contact)
String getEntityUrl(LinkType type, String contextPath)
Object getControl(String name, IConstructor constructor, IContact contact)
IElephantEntity getMain(Object entity)
IElephantEntity getController(Object entity)
Collection< Object > getRelatedByRole(EntityRole role, IContact contact)