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

Public Member Functions

 ResourceWrapper (Resource entity)
 
Resource save ()
 
void delete (final boolean close)
 
boolean canDelete ()
 
void addAptitude ()
 
void deleteAptitude (AptitudeDegree aptitudeDegree)
 
- Public Member Functions inherited from org.turro.erp.resource.ResourceWrapper
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.erp.resource.ResourceWrapper
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

◆ ResourceWrapper()

org.turro.erp.resource.logic.ResourceWrapper.ResourceWrapper ( Resource  entity)

Member Function Documentation

◆ addAptitude()

void org.turro.erp.resource.logic.ResourceWrapper.addAptitude ( )

Definition at line 85 of file bserp-www/src/main/java/org/turro/erp/resource/logic/ResourceWrapper.java.

85  {
86  InputDialog.getInput(
87  Framework.getCurrent().getPage(),
88  Application.getString("lAptitudes"),
89  new InputField[] {
90  new InputField("lAptitude", null, null, 0) {
91  @Override
92  protected HtmlBasedComponent createEditor() {
93  return new AptitudeDegreeCombobox();
94  }
95  }
96  }, new Command() {
97  @Override
98  public Object execute(Context context) {
99  InputField[] fields = (InputField[]) context.get("fields");
100  if(fields.length > 0) {
101  for(InputField f : fields) {
102  if(f.getValue() != null && "lAptitude".equals(f.getLabel())) {
103  AptitudeDegree od = (AptitudeDegree) f.getValue();
104  entity.getAptitudeDegrees().add(od);
105  }
106  }
107  }
108  return null;
109  }
110  });
111  }
Here is the call graph for this function:

◆ canDelete()

boolean org.turro.erp.resource.logic.ResourceWrapper.canDelete ( )

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

Definition at line 68 of file bserp-www/src/main/java/org/turro/erp/resource/logic/ResourceWrapper.java.

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

◆ delete()

void org.turro.erp.resource.logic.ResourceWrapper.delete ( final boolean  close)

Definition at line 52 of file bserp-www/src/main/java/org/turro/erp/resource/logic/ResourceWrapper.java.

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

◆ deleteAptitude()

void org.turro.erp.resource.logic.ResourceWrapper.deleteAptitude ( AptitudeDegree  aptitudeDegree)

Definition at line 113 of file bserp-www/src/main/java/org/turro/erp/resource/logic/ResourceWrapper.java.

113  {
114  if(aptitudeDegree != null) {
115  EntityCollectionUtil.remove(entity.getAptitudeDegrees(), aptitudeDegree);
116  }
117  }

◆ logEntity()

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

Definition at line 120 of file bserp-www/src/main/java/org/turro/erp/resource/logic/ResourceWrapper.java.

120  {
121  Authentication.log(logType, path, action, data);
122  }

◆ save()

Resource org.turro.erp.resource.logic.ResourceWrapper.save ( )

Reimplemented from org.turro.erp.resource.ResourceWrapper.

Definition at line 47 of file bserp-www/src/main/java/org/turro/erp/resource/logic/ResourceWrapper.java.

47  {
48  super.save();
49  return entity;
50  }

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