BrightSide Workbench Full Report + Source Code
org.turro.crm.zul.sale.SaleProspectWrapper Class Reference
Inheritance diagram for org.turro.crm.zul.sale.SaleProspectWrapper:
Collaboration diagram for org.turro.crm.zul.sale.SaleProspectWrapper:

Public Member Functions

 SaleProspectWrapper (SaleProspect entity)
 
String getTabLabel ()
 
String getSelfLabel ()
 
boolean delete ()
 
boolean canSave ()
 
boolean canDelete ()
 
IDossier getDossier ()
 
- Public Member Functions inherited from org.turro.jpa.entity.DaoEntity< T extends IDaoEntity, ID extends Serializable >
 DaoEntity ()
 
 DaoEntity (Class< T > persistentClass)
 
 DaoEntity (T entity)
 
Dao getDao ()
 
getEntity ()
 
IElephantEntity getIee ()
 
find (ID id)
 
save ()
 
ID getId ()
 
List< String > getMessages ()
 
boolean equals (Object obj)
 
int hashCode ()
 

Protected Member Functions

Dao createDao ()
 
boolean shouldLog ()
 
- Protected Member Functions inherited from org.turro.jpa.entity.DaoEntity< T extends IDaoEntity, ID extends Serializable >
void logEntity (SystemLogType logType, Object entity, String action, String data)
 
String dataEntity (Object entity)
 
void initOperation ()
 
void addMessage (String message)
 

Additional Inherited Members

- Static Public Member Functions inherited from org.turro.jpa.entity.DaoEntity< T extends IDaoEntity, ID extends Serializable >
static Object getEntityId (Object entity)
 
static boolean isNewId (Object id)
 
- Protected Attributes inherited from org.turro.jpa.entity.DaoEntity< T extends IDaoEntity, ID extends Serializable >
entity
 
ID id
 
List< String > messages = new ArrayList<>()
 

Detailed Description

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

Definition at line 38 of file SaleProspectWrapper.java.

Constructor & Destructor Documentation

◆ SaleProspectWrapper()

org.turro.crm.zul.sale.SaleProspectWrapper.SaleProspectWrapper ( SaleProspect  entity)

Definition at line 40 of file SaleProspectWrapper.java.

40  {
41  super(entity);
42  }

Member Function Documentation

◆ canDelete()

boolean org.turro.crm.zul.sale.SaleProspectWrapper.canDelete ( )

Reimplemented from org.turro.jpa.entity.DaoEntity< T extends IDaoEntity, ID extends Serializable >.

Definition at line 76 of file SaleProspectWrapper.java.

76  {
77  for(VendorProspect vp : entity.getVendorProspects()) {
78  if(!vp.getSaleActions().isEmpty()) {
79  return false;
80  }
81  }
82  return super.canDelete();
83  }

◆ canSave()

boolean org.turro.crm.zul.sale.SaleProspectWrapper.canSave ( )

Reimplemented from org.turro.jpa.entity.DaoEntity< T extends IDaoEntity, ID extends Serializable >.

Definition at line 71 of file SaleProspectWrapper.java.

71  {
72  return !entity.isEmpty();
73  }

◆ createDao()

Dao org.turro.crm.zul.sale.SaleProspectWrapper.createDao ( )
protected

Reimplemented from org.turro.jpa.entity.DaoEntity< T extends IDaoEntity, ID extends Serializable >.

Definition at line 66 of file SaleProspectWrapper.java.

66  {
67  return new CrmPU();
68  }

◆ delete()

boolean org.turro.crm.zul.sale.SaleProspectWrapper.delete ( )

Reimplemented from org.turro.jpa.entity.DaoEntity< T extends IDaoEntity, ID extends Serializable >.

Definition at line 53 of file SaleProspectWrapper.java.

53  {
54  Messages.confirmDeletion().show(() -> {
55  if(entity.getCampaign() != null) {
56  EntityCollections.entities(entity.getCampaign().getSaleProspects()).remove(entity);
57  entity.setCampaign(null);
58  entity = save();
59  }
60  SaleProspectWrapper.super.delete();
61  });
62  return true;
63  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getDossier()

IDossier org.turro.crm.zul.sale.SaleProspectWrapper.getDossier ( )

Definition at line 85 of file SaleProspectWrapper.java.

85  {
86  if(entity.getId() > 0) {
87  IDossier dossier = (IDossier) Plugins.loadImplementation(IDossier.class);//PluginChecker.get("dossier");
88  ICategory cat = dossier.addCategory();
89  cat.setDescription("Customer Relationship");
90  cat.setId(8100);
91  cat = dossier.addCategory();
92  cat.setDescription("Sale Prospects");
93  cat.setId(8101);
94  cat.setParentId(8100);
95  dossier.setDescription(Strings.truncateAndWarn(entity.getDescription(), 50));
96  dossier.setIdCategory(cat.getId());
97  dossier.setPath(CrmPU.getObjectPath(entity));
98  dossier.setSubject(entity.getCustomer().getIContact());
99  return dossier;
100  }
101  return null;
102  }
Here is the call graph for this function:

◆ getSelfLabel()

String org.turro.crm.zul.sale.SaleProspectWrapper.getSelfLabel ( )

Definition at line 48 of file SaleProspectWrapper.java.

48  {
49  return I_.get("Sale prospect");
50  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTabLabel()

String org.turro.crm.zul.sale.SaleProspectWrapper.getTabLabel ( )

Definition at line 44 of file SaleProspectWrapper.java.

44  {
45  return getSelfLabel() + " #" + entity.getId();
46  }
Here is the call graph for this function:

◆ shouldLog()

boolean org.turro.crm.zul.sale.SaleProspectWrapper.shouldLog ( )
protected

Reimplemented from org.turro.jpa.entity.DaoEntity< T extends IDaoEntity, ID extends Serializable >.

Definition at line 105 of file SaleProspectWrapper.java.

105  {
106  return false;
107  }

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