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

Public Member Functions

String getPolicy (String element, ProfileRelation relation)
 
void setPolicy (@BindingParam("type") String type, @BindingParam("element") String element, @BindingParam("relation") ProfileRelation relation)
 
Contact getContact ()
 
Profile getProfile ()
 
long getMaxDocuments ()
 
String getNewLink (String element)
 
String getEditLink (ProfileRelation relation)
 
String getCompanyLink (ProfileRelation relation)
 
String getEditLink ()
 
String getSkillsLink ()
 

Detailed Description

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

Definition at line 36 of file ProfileVM.java.

Member Function Documentation

◆ getCompanyLink()

String org.turro.contacts.profile.ProfileVM.getCompanyLink ( ProfileRelation  relation)

Definition at line 101 of file ProfileVM.java.

101  {
102  KeyValueMap kvm = new KeyValueMap();
103  kvm.put("contact", relation.getRelation().getBusiness().getId());
104  return "/user/profile/editc?" + Actions.createRightNowAction(kvm);
105  }
Here is the call graph for this function:

◆ getContact()

Contact org.turro.contacts.profile.ProfileVM.getContact ( )

Definition at line 58 of file ProfileVM.java.

58  {
59  if(contact == null) {
60  contact = (Contact) Authentication.reloadIContact().getContact();
61  }
62  return contact;
63  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getEditLink() [1/2]

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

Definition at line 107 of file ProfileVM.java.

107  {
108  KeyValueMap kvm = new KeyValueMap();
109  kvm.put("contact", contact.getId());
110  return "/user/profile/edit?" + Actions.createRightNowAction(kvm);
111  }
Here is the call graph for this function:

◆ getEditLink() [2/2]

String org.turro.contacts.profile.ProfileVM.getEditLink ( ProfileRelation  relation)

Definition at line 88 of file ProfileVM.java.

88  {
89  KeyValueMap kvm = new KeyValueMap();
90  kvm.put("contact", contact.getId());
91  kvm.put("relation", relation.getRelation().getId());
92  switch(relation.getRelation().getBusiness().getType()) {
93  case CONTACT_COMPANY:
94  return "/user/profile/editrb?" + Actions.createRightNowAction(kvm);
95  case CONTACT_LEARNINGCENTER:
96  return "/user/profile/editrc?" + Actions.createRightNowAction(kvm);
97  }
98  return "#";
99  }
Here is the call graph for this function:

◆ getMaxDocuments()

long org.turro.contacts.profile.ProfileVM.getMaxDocuments ( )

Definition at line 69 of file ProfileVM.java.

69  {
70  return Configurator.instance().asLong("Profile.Documents.Maximum");
71  }

◆ getNewLink()

String org.turro.contacts.profile.ProfileVM.getNewLink ( String  element)

Definition at line 75 of file ProfileVM.java.

75  {
76  KeyValueMap kvm = new KeyValueMap();
77  kvm.put("contact", contact.getId());
78  kvm.put("element", element);
79  switch(element) {
80  case "company":
81  return "/user/profile/editrb?" + Actions.createRightNowAction(kvm);
82  case "center":
83  return "/user/profile/editrc?" + Actions.createRightNowAction(kvm);
84  }
85  return "#";
86  }
Here is the call graph for this function:

◆ getPolicy()

String org.turro.contacts.profile.ProfileVM.getPolicy ( String  element,
ProfileRelation  relation 
)

Definition at line 40 of file ProfileVM.java.

40  {
41  ProfilePolicies pp = new ProfilePolicies(getContact());
42  return pp.getPolicy(relation, element).toString();
43  }
Here is the call graph for this function:

◆ getProfile()

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

Definition at line 65 of file ProfileVM.java.

65  {
66  return getContact().getEditProfile();
67  }
Here is the call graph for this function:

◆ getSkillsLink()

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

Definition at line 113 of file ProfileVM.java.

113  {
114  KeyValueMap kvm = new KeyValueMap();
115  kvm.put("entityPath", ContactsPU.getObjectPath(contact));
116  return "/user/profile/editsk?" + Actions.createRightNowAction(kvm);
117  }
Here is the call graph for this function:

◆ setPolicy()

void org.turro.contacts.profile.ProfileVM.setPolicy ( @BindingParam("type") String  type,
@BindingParam("element") String  element,
@BindingParam("relation") ProfileRelation  relation 
)

Definition at line 46 of file ProfileVM.java.

47  {
48  ProfilePolicies pp = new ProfilePolicies(getContact());
49  PublishPolicy policy = PublishPolicy.valueOf(type);
50  pp.setPolicy(relation == null ? getContact() : relation.getRelation(), element, policy);
51  pp.save();
52  }
Here is the call graph for this function:

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