BrightSide Workbench Full Report + Source Code
org.turro.importer.ImportFromMembers Class Reference

Public Member Functions

void importContactsFromJson (WsMember member, Jsons json)
 
void importProjectsFromJson (WsMember member, Jsons json)
 
void importProjectGrantsFromJson (WsMember member, Jsons json)
 
void importCentersFromJson (WsMember member, Jsons json)
 
void importStudentsFromJson (WsMember member, Jsons json)
 
void importChallengesFromJson (WsMember member, Jsons json)
 
void importTagsFromJson (WsMember member, Jsons json)
 
void importContactsFromRegister (WsMember member, List< ImporterRegister > data)
 
void importProjectsFromRegister (WsMember member, List< ImporterRegister > data)
 
void importParticipationsFromRegister (WsMember member, List< ImporterRegister > data)
 
void importTagsFromRegister (WsMember member, List< ImporterRegister > data)
 
void removeContactsFromMember (WsMember member)
 
void removeProjectsFromMember (WsMember member)
 
void removeParticipationsFromMember (WsMember member)
 
void removeDescriptorsFromMember (WsMember member)
 
void removeProjectGrantsFromMember (WsMember member)
 
void removeCentersFromMember (WsMember member)
 
void removeStudentsFromMember (WsMember member)
 
void removeChallengesFromMember (WsMember member)
 
void removeTagsFromMember (WsMember member)
 

Static Public Member Functions

static void connect ()
 
static void connect (WsMember member)
 

Detailed Description

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

Definition at line 49 of file ImportFromMembers.java.

Member Function Documentation

◆ connect() [1/2]

static void org.turro.importer.ImportFromMembers.connect ( )
static

Definition at line 51 of file ImportFromMembers.java.

51  {
52  Clients.getMembers(AxClient.CLIENT_SERVICE).forEach(member -> {
53  if(Clients.checkClientService(member.getMemberDomain(), member.getService())) {
54  connect(member);
55  }
56  });
57  }
Here is the caller graph for this function:

◆ connect() [2/2]

static void org.turro.importer.ImportFromMembers.connect ( WsMember  member)
static

Definition at line 59 of file ImportFromMembers.java.

59  {
60  try {
61  ImportFromMembers ifm = new ImportFromMembers();
62  ifm.removeContactsFromMember(member);
63  ifm.importContactsFromJson(member, Clients.getData(member, AxConstants.USERS));
64  ifm.removeProjectsFromMember(member);
65  ifm.removeParticipationsFromMember(member);
66  ifm.removeDescriptorsFromMember(member);
67  ifm.importProjectsFromJson(member, Clients.getData(member, AxConstants.PROJECTS));
68  ifm.removeProjectGrantsFromMember(member);
69  ifm.importProjectGrantsFromJson(member, Clients.getData(member, AxConstants.PROJECT_GRANTS));
70  ifm.removeCentersFromMember(member);
71  ifm.importCentersFromJson(member, Clients.getData(member, AxConstants.CENTERS));
72  ifm.removeStudentsFromMember(member);
73  ifm.importStudentsFromJson(member, Clients.getData(member, AxConstants.STUDENTS));
74  ifm.removeChallengesFromMember(member);
75  ifm.importChallengesFromJson(member, Clients.getData(member, AxConstants.CHALLENGES));
76  ifm.removeTagsFromMember(member);
77  ifm.importTagsFromJson(member, Clients.getData(member, AxConstants.TAGS));
78  } catch(Exception ex) {
79  WebLoggers.severe(ImportFromMembers.class).message(member.getMemberDomain()).exception(ex).log();
80  }
81  }
Here is the call graph for this function:

◆ importCentersFromJson()

void org.turro.importer.ImportFromMembers.importCentersFromJson ( WsMember  member,
Jsons  json 
)

Definition at line 109 of file ImportFromMembers.java.

109  {
110  json.getStructure().asArray().forEach(center -> {
111  AxCenter tmp = AxCenter.fromJson(center);
112  getDao().saveEntity(tmp);
113  });
114  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ importChallengesFromJson()

void org.turro.importer.ImportFromMembers.importChallengesFromJson ( WsMember  member,
Jsons  json 
)

Definition at line 123 of file ImportFromMembers.java.

123  {
124  json.getStructure().asArray().forEach(challenge -> {
125  AxChallenge tmp = AxChallenge.fromJson(challenge);
126  Set<AxResponse> responses = new HashSet<>();
127  responses.addAll(tmp.getResponses());
128  tmp.setResponses(null);
129  getDao().saveEntity(tmp);
130  for(AxResponse response : responses) {
131  getDao().persistObject(response);
132  }
133  });
134  }
void persistObject(Object obj)
Definition: Dao.java:127
Here is the call graph for this function:
Here is the caller graph for this function:

◆ importContactsFromJson()

void org.turro.importer.ImportFromMembers.importContactsFromJson ( WsMember  member,
Jsons  json 
)

Definition at line 83 of file ImportFromMembers.java.

83  {
84  json.getStructure().asArray().forEach(contact -> {
85  getDao().saveEntity(AxContact.fromJson(contact));
86  });
87  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ importContactsFromRegister()

void org.turro.importer.ImportFromMembers.importContactsFromRegister ( WsMember  member,
List< ImporterRegister >  data 
)

Definition at line 143 of file ImportFromMembers.java.

143  {
144  for(ImporterRegister register : data) {
145  getDao().saveEntity(AxContact.from(member.getMemberId(), register));
146  }
147  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ importParticipationsFromRegister()

void org.turro.importer.ImportFromMembers.importParticipationsFromRegister ( WsMember  member,
List< ImporterRegister >  data 
)

Definition at line 155 of file ImportFromMembers.java.

155  {
156  for(ImporterRegister register : data) {
157  getDao().saveEntity(AxParticipation.from(member.getMemberId(), register));
158  }
159  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ importProjectGrantsFromJson()

void org.turro.importer.ImportFromMembers.importProjectGrantsFromJson ( WsMember  member,
Jsons  json 
)

Definition at line 102 of file ImportFromMembers.java.

102  {
103  json.getStructure().asArray().forEach(projectGrant -> {
104  AxProjectGrant tmp = AxProjectGrant.fromJson(projectGrant);
105  getDao().saveEntity(tmp);
106  });
107  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ importProjectsFromJson()

void org.turro.importer.ImportFromMembers.importProjectsFromJson ( WsMember  member,
Jsons  json 
)

Definition at line 89 of file ImportFromMembers.java.

89  {
90  json.getStructure().asArray().forEach(project -> {
91  AxProject tmp = AxProject.fromJson(project);
92  Set<AxDescriptor> descriptors = new HashSet<>();
93  descriptors.addAll(tmp.getDescriptors());
94  tmp.setDescriptors(null);
95  getDao().saveEntity(tmp);
96  for(AxDescriptor descriptor : descriptors) {
97  getDao().persistObject(descriptor);
98  }
99  });
100  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ importProjectsFromRegister()

void org.turro.importer.ImportFromMembers.importProjectsFromRegister ( WsMember  member,
List< ImporterRegister >  data 
)

Definition at line 149 of file ImportFromMembers.java.

149  {
150  for(ImporterRegister register : data) {
151  getDao().saveEntity(AxProject.from(member.getMemberId(), register));
152  }
153  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ importStudentsFromJson()

void org.turro.importer.ImportFromMembers.importStudentsFromJson ( WsMember  member,
Jsons  json 
)

Definition at line 116 of file ImportFromMembers.java.

116  {
117  json.getStructure().asArray().forEach(student -> {
118  AxStudent tmp = AxStudent.fromJson(student);
119  getDao().saveEntity(tmp);
120  });
121  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ importTagsFromJson()

void org.turro.importer.ImportFromMembers.importTagsFromJson ( WsMember  member,
Jsons  json 
)

Definition at line 136 of file ImportFromMembers.java.

136  {
137  json.getStructure().asArray().forEach(tag -> {
138  AxTag axt = AxTag.fromJson(tag);
139  Tags.addTag(axt.getEntityRoot() + axt.stringifyId(), axt.getTagName());
140  });
141  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ importTagsFromRegister()

void org.turro.importer.ImportFromMembers.importTagsFromRegister ( WsMember  member,
List< ImporterRegister >  data 
)

Definition at line 161 of file ImportFromMembers.java.

161  {
162  for(ImporterRegister register : data) {
163  AxTag axt = AxTag.from(member.getMemberId(), register);
164  Tags.addTag(axt.getEntityRoot() + axt.stringifyId(), axt.getTagName());
165  }
166  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeCentersFromMember()

void org.turro.importer.ImportFromMembers.removeCentersFromMember ( WsMember  member)

Definition at line 204 of file ImportFromMembers.java.

204  {
205  SqlClause.delete("AxCenter")
206  .where().equal("centerId.memberId", member.getMemberId())
207  .dao(getDao())
208  .execute();
209  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeChallengesFromMember()

void org.turro.importer.ImportFromMembers.removeChallengesFromMember ( WsMember  member)

Definition at line 218 of file ImportFromMembers.java.

218  {
219  SqlClause.delete("AxChallenge")
220  .where().equal("challengeId.memberId", member.getMemberId())
221  .dao(getDao())
222  .execute();
223  SqlClause.delete("AxResponse")
224  .where().equal("relation.mainMemberId", member.getMemberId())
225  .or().equal("relation.relatedMemberId", member.getMemberId())
226  .dao(getDao())
227  .execute();
228  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeContactsFromMember()

void org.turro.importer.ImportFromMembers.removeContactsFromMember ( WsMember  member)

Definition at line 168 of file ImportFromMembers.java.

168  {
169  SqlClause.delete("AxContact")
170  .where().equal("contactId.memberId", member.getMemberId())
171  .dao(getDao())
172  .execute();
173  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeDescriptorsFromMember()

void org.turro.importer.ImportFromMembers.removeDescriptorsFromMember ( WsMember  member)

Definition at line 190 of file ImportFromMembers.java.

190  {
191  SqlClause.delete("AxDescriptor")
192  .where().equal("memberId", member.getMemberId())
193  .dao(getDao())
194  .execute();
195  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeParticipationsFromMember()

void org.turro.importer.ImportFromMembers.removeParticipationsFromMember ( WsMember  member)

Definition at line 182 of file ImportFromMembers.java.

182  {
183  SqlClause.delete("AxParticipation")
184  .where().equal("relation.mainMemberId", member.getMemberId())
185  .or().equal("relation.relatedMemberId", member.getMemberId())
186  .dao(getDao())
187  .execute();
188  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeProjectGrantsFromMember()

void org.turro.importer.ImportFromMembers.removeProjectGrantsFromMember ( WsMember  member)

Definition at line 197 of file ImportFromMembers.java.

197  {
198  SqlClause.delete("AxProjectGrant")
199  .where().equal("projectGrantId.memberId", member.getMemberId())
200  .dao(getDao())
201  .execute();
202  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeProjectsFromMember()

void org.turro.importer.ImportFromMembers.removeProjectsFromMember ( WsMember  member)

Definition at line 175 of file ImportFromMembers.java.

175  {
176  SqlClause.delete("AxProject")
177  .where().equal("projectId.memberId", member.getMemberId())
178  .dao(getDao())
179  .execute();
180  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeStudentsFromMember()

void org.turro.importer.ImportFromMembers.removeStudentsFromMember ( WsMember  member)

Definition at line 211 of file ImportFromMembers.java.

211  {
212  SqlClause.delete("AxStudent")
213  .where().equal("studentId.memberId", member.getMemberId())
214  .dao(getDao())
215  .execute();
216  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeTagsFromMember()

void org.turro.importer.ImportFromMembers.removeTagsFromMember ( WsMember  member)

Definition at line 230 of file ImportFromMembers.java.

230  {
231  Tags.removeMemberTags(member.getMemberId());
232  }
Here is the call graph for this function:
Here is the caller graph for this function:

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