BrightSide Workbench Full Report + Source Code
org.turro.contacts.profile.ProfileCompletion Class Reference

Public Member Functions

 ProfileCompletion (Profile profile)
 
double getPercent ()
 
Profile getProfile ()
 
boolean isImage ()
 
boolean isSkills ()
 
boolean isRelation ()
 
boolean isDocuments ()
 
boolean isCompany ()
 
String getCompanyType ()
 
String getEditLink ()
 
String getSkillsLink ()
 
String getDocumentsLink ()
 

Detailed Description

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

Definition at line 34 of file ProfileCompletion.java.

Constructor & Destructor Documentation

◆ ProfileCompletion()

org.turro.contacts.profile.ProfileCompletion.ProfileCompletion ( Profile  profile)

Definition at line 38 of file ProfileCompletion.java.

38  {
39  this.profile = profile;
40  readSettings();
41  }

Member Function Documentation

◆ getCompanyType()

String org.turro.contacts.profile.ProfileCompletion.getCompanyType ( )

Definition at line 92 of file ProfileCompletion.java.

92  {
93  return companyType;
94  }

◆ getDocumentsLink()

String org.turro.contacts.profile.ProfileCompletion.getDocumentsLink ( )

Definition at line 140 of file ProfileCompletion.java.

140  {
141  KeyValueMap kvm = new KeyValueMap();
142  kvm.put("entityPath", ContactsPU.getObjectPath(profile.getContact().getContact()));
143  return "/user/profile/pubs";
144  }
Here is the call graph for this function:

◆ getEditLink()

String org.turro.contacts.profile.ProfileCompletion.getEditLink ( )

Definition at line 128 of file ProfileCompletion.java.

128  {
129  KeyValueMap kvm = new KeyValueMap();
130  kvm.put("contact", profile.getContact().getId());
131  return "/user/profile/edit?" + Actions.createRightNowAction(kvm);
132  }
Here is the call graph for this function:

◆ getPercent()

double org.turro.contacts.profile.ProfileCompletion.getPercent ( )

Definition at line 43 of file ProfileCompletion.java.

43  {
44  double should = 0, have = 0;
45  Configurator settings = Configurator.instance();
46  if(settings.asBoolean("Profile.Suggest.Image")) {
47  should++; have += !image ? 1 : 0;
48  }
49  if(settings.asBoolean("Profile.Suggest.Skills")) {
50  should++; have += !skills ? 1 : 0;
51  }
52  if(settings.asBoolean("Profile.Suggest.Relation")) {
53  should++; have += !relation ? 1 : 0;
54  }
55  if(settings.asBoolean("Profile.Suggest.Company")) {
56  should++; have += !company ? 1 : 0;
57  }
58  if(settings.asBoolean("Profile.Suggest.Professional.Documents") && profile.isWorker()) {
59  should++; have += !documents ? 1 : 0;
60  } else if(settings.asBoolean("Profile.Suggest.Student.Documents") && profile.isStudent()) {
61  should++; have += !documents ? 1 : 0;
62  }
63  return should == 0 ? 100.0 : (have / should) * 100.0;
64  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getProfile()

Profile org.turro.contacts.profile.ProfileCompletion.getProfile ( )

Definition at line 68 of file ProfileCompletion.java.

68  {
69  return profile;
70  }

◆ getSkillsLink()

String org.turro.contacts.profile.ProfileCompletion.getSkillsLink ( )

Definition at line 134 of file ProfileCompletion.java.

134  {
135  KeyValueMap kvm = new KeyValueMap();
136  kvm.put("entityPath", ContactsPU.getObjectPath(profile.getContact().getContact()));
137  return "/user/profile/editsk?" + Actions.createRightNowAction(kvm);
138  }
Here is the call graph for this function:

◆ isCompany()

boolean org.turro.contacts.profile.ProfileCompletion.isCompany ( )

Definition at line 88 of file ProfileCompletion.java.

88  {
89  return company;
90  }

◆ isDocuments()

boolean org.turro.contacts.profile.ProfileCompletion.isDocuments ( )

Definition at line 84 of file ProfileCompletion.java.

84  {
85  return documents;
86  }

◆ isImage()

boolean org.turro.contacts.profile.ProfileCompletion.isImage ( )

Definition at line 72 of file ProfileCompletion.java.

72  {
73  return image;
74  }

◆ isRelation()

boolean org.turro.contacts.profile.ProfileCompletion.isRelation ( )

Definition at line 80 of file ProfileCompletion.java.

80  {
81  return relation;
82  }

◆ isSkills()

boolean org.turro.contacts.profile.ProfileCompletion.isSkills ( )

Definition at line 76 of file ProfileCompletion.java.

76  {
77  return skills;
78  }

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