BrightSide Workbench Full Report + Source Code
org.turro.erp.humanres.logic.HumanResourceWrapper Class Reference
Inheritance diagram for org.turro.erp.humanres.logic.HumanResourceWrapper:
Collaboration diagram for org.turro.erp.humanres.logic.HumanResourceWrapper:

Public Member Functions

 HumanResourceWrapper (HumanResource entity)
 
void delete (final boolean close)
 
boolean canDelete ()
 
void addAptitude ()
 
void deleteAptitude (OwnedAptitude aptitude)
 
- Public Member Functions inherited from org.turro.hr.humanres.HumanResourceWrapper
HumanResource save ()
 
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)
 
boolean delete ()
 
ID getId ()
 
List< String > getMessages ()
 
boolean canSave ()
 
boolean equals (Object obj)
 
int hashCode ()
 

Protected Member Functions

void logEntity (LogType logType, String path, String action, String data)
 
- Protected Member Functions inherited from org.turro.hr.humanres.HumanResourceWrapper
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

Constructor & Destructor Documentation

◆ HumanResourceWrapper()

org.turro.erp.humanres.logic.HumanResourceWrapper.HumanResourceWrapper ( HumanResource  entity)

Member Function Documentation

◆ addAptitude()

void org.turro.erp.humanres.logic.HumanResourceWrapper.addAptitude ( )

Definition at line 82 of file bserp-www/src/main/java/org/turro/erp/humanres/logic/HumanResourceWrapper.java.

82  {
83  InputDialog.getInput(
84  Framework.getCurrent().getPage(),
85  Application.getString("lAptitudes"),
86  new InputField[] {
87  new InputField("lFrom", null, null, 0) {
88  @Override
89  protected HtmlBasedComponent createEditor() {
90  return new DateboxShort(new Date());
91  }
92  },
93  new InputField("lTo", null, null, 0) {
94  @Override
95  protected HtmlBasedComponent createEditor() {
96  return new DateboxShort(null);
97  }
98  },
99  new InputField("lAptitude", null, null, 0) {
100  @Override
101  protected HtmlBasedComponent createEditor() {
102  return new AptitudeDegreeCombobox();
103  }
104  }
105  }, new Command() {
106 
107  @Override
108  public Object execute(Context context) {
109  InputField[] fields = (InputField[]) context.get("fields");
110  if(fields.length > 0) {
111  Date from = null, to = null;
112  AptitudeDegree o = null;
113  Integer d = 0;
114  for(InputField f : fields) {
115  if("lAptitude".equals(f.getLabel())) {
116  o = (AptitudeDegree) f.getValue();
117  } else if("lFrom".equals(f.getLabel())) {
118  from = (Date) f.getValue();
119  } else if("lTo".equals(f.getLabel())) {
120  to = (Date) f.getValue();
121  }
122  }
123  if(o != null) {
124  OwnedAptitude oo = new OwnedAptitude();
125  oo.setAptitudeDegree(o);
126  oo.setInitialDate(from);
127  oo.setFinalDate(to);
128  oo.setDefaultDegree(false);
129  oo.setHumanResource(entity);
130  entity.getOwnedAptitudes().add(oo);
131  }
132  }
133  return null;
134  }
135  });
136  }
boolean equals(Object obj)
Definition: DaoEntity.java:154
Here is the call graph for this function:

◆ canDelete()

boolean org.turro.erp.humanres.logic.HumanResourceWrapper.canDelete ( )

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

Definition at line 65 of file bserp-www/src/main/java/org/turro/erp/humanres/logic/HumanResourceWrapper.java.

65  {
66  if(entity.getId() == 0) return false;
67  Dao dao = getDao();
68 // Long count = (Long) dao.getSingleResult(
69 // "select count(*) from Document " +
70 // "where contract = ?",
71 // new Object[] { contract });
72 // if(count == 0) {
73 // count = (Long) dao.getSingleResult(
74 // "select count(*) from DocumentLine " +
75 // "where store = ?",
76 // new Object[] { contract });
77 // }
78 // return count == 0;
79  return true;
80  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ delete()

void org.turro.erp.humanres.logic.HumanResourceWrapper.delete ( final boolean  close)

Definition at line 49 of file bserp-www/src/main/java/org/turro/erp/humanres/logic/HumanResourceWrapper.java.

49  {
50  // Check if possible and notify
51  if(canDelete()) {
52  ZkossUtils.confirmDeletion(null, new Command() {
53  @Override
54  public Object execute(Context context) {
55  if(HumanResourceWrapper.super.delete()) {
56  if(close) Framework.getCurrent().closeSelected();
57  }
58  return null;
59  }
60  });
61  }
62  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ deleteAptitude()

void org.turro.erp.humanres.logic.HumanResourceWrapper.deleteAptitude ( OwnedAptitude  aptitude)

Definition at line 138 of file bserp-www/src/main/java/org/turro/erp/humanres/logic/HumanResourceWrapper.java.

138  {
139  if(aptitude != null) {
140  EntityCollectionUtil.remove(entity.getOwnedAptitudes(), aptitude);
141  }
142  }

◆ logEntity()

void org.turro.erp.humanres.logic.HumanResourceWrapper.logEntity ( LogType  logType,
String  path,
String  action,
String  data 
)
protected

Definition at line 145 of file bserp-www/src/main/java/org/turro/erp/humanres/logic/HumanResourceWrapper.java.

145  {
146  Authentication.log(logType, path, action, data);
147  }

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