Revision 58041
Added by Konstantina Galouni about 4 years ago
DivIdService.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.uoaadmintoolslibrary.services; |
2 | 2 |
|
3 |
import eu.dnetlib.uoaadmintoolslibrary.controllers.DivHelpContentController; |
|
4 | 3 |
import eu.dnetlib.uoaadmintoolslibrary.dao.DivIdDAO; |
5 | 4 |
import eu.dnetlib.uoaadmintoolslibrary.entities.DivId; |
6 | 5 |
import eu.dnetlib.uoaadmintoolslibrary.entities.Page; |
... | ... | |
28 | 27 |
private PortalService portalService; |
29 | 28 |
|
30 | 29 |
@Autowired |
31 |
private DivHelpContentController divHelpContentController;
|
|
30 |
private DivHelpContentService divHelpContentService;
|
|
32 | 31 |
|
33 | 32 |
public List<DivId> getDivIds(String page, String name, String pid) { |
34 | 33 |
Portal portal = portalService.getPortal(pid); |
... | ... | |
113 | 112 |
divIdDAO.deleteAll(); |
114 | 113 |
} |
115 | 114 |
|
115 |
public DivId insertOrUpdateDivId(DivId divId) { |
|
116 |
return divIdDAO.save(divId); |
|
117 |
} |
|
118 |
|
|
116 | 119 |
public DivIdResponse insertDivId(DivIdResponse divIdResponse) { |
117 | 120 |
DivId divId = this.getDivIdByDivIdResponse(divIdResponse); |
118 | 121 |
|
... | ... | |
150 | 153 |
// List<Portal> communities = communityController.getAllPortals(); |
151 | 154 |
// for( Portal community : communities ) { |
152 | 155 |
// if(!community.getPid().equals("openaire") && !community.getPid().equals("connect")) { |
153 |
// divHelpContentController.addDivHelpContentsInPortal(community.getPid(), community.getId(), divId.getName());
|
|
156 |
// divHelpContentService.addDivHelpContentsInPortal(community.getPid(), community.getId(), divId.getName());
|
|
154 | 157 |
// } |
155 | 158 |
// } |
156 | 159 |
// } |
157 | 160 |
// if(openaireEnabled && !divIdOld.getOpenaire()) { |
158 | 161 |
// Portal community = communityController.getPortal("openaire"); |
159 |
// divHelpContentController.addDivHelpContentsInPortal(community.getPid(), community.getId(), divId.getName());
|
|
162 |
// divHelpContentService.addDivHelpContentsInPortal(community.getPid(), community.getId(), divId.getName());
|
|
160 | 163 |
// } |
161 | 164 |
// |
162 | 165 |
// if(connectEnabled && !divIdOld.getConnect()) { |
163 | 166 |
// Portal community = communityController.getPortal("connect"); |
164 |
// divHelpContentController.addDivHelpContentsInPortal(community.getPid(), community.getId(), divId.getName());
|
|
167 |
// divHelpContentService.addDivHelpContentsInPortal(community.getPid(), community.getId(), divId.getName());
|
|
165 | 168 |
// } |
166 | 169 |
// |
167 | 170 |
// if(!divId.getCommunities()) { |
... | ... | |
169 | 172 |
// for( Portal community : communities ) { |
170 | 173 |
// if(!community.getPid().equals("openaire") && !community.getPid().equals("connect")) { |
171 | 174 |
// // delete div contents related to this divId |
172 |
// List<DivHelpContentResponse> divHelpContentResponses = divHelpContentController.getDivHelpContents(community.getPid(), null, divId.getName(), null);
|
|
175 |
// List<DivHelpContentResponse> divHelpContentResponses = divHelpContentService.getDivHelpContents(community.getPid(), null, divId.getName(), null);
|
|
173 | 176 |
// for(DivHelpContentResponse divHelpContentResponse : divHelpContentResponses) { |
174 |
// divHelpContentController.deleteDivHelpContent(divHelpContentResponse.getId());
|
|
177 |
// divHelpContentService.deleteDivHelpContent(divHelpContentResponse.getId());
|
|
175 | 178 |
// } |
176 | 179 |
// } |
177 | 180 |
// } |
... | ... | |
181 | 184 |
// Portal community = communityController.getPortal("openaire"); |
182 | 185 |
// |
183 | 186 |
// // delete div contents related to this divId |
184 |
// List<DivHelpContentResponse> divHelpContentResponses = divHelpContentController.getDivHelpContents("openaire", null, divId.getName(), null);
|
|
187 |
// List<DivHelpContentResponse> divHelpContentResponses = divHelpContentService.getDivHelpContents("openaire", null, divId.getName(), null);
|
|
185 | 188 |
// for(DivHelpContentResponse divHelpContentResponse : divHelpContentResponses) { |
186 |
// divHelpContentController.deleteDivHelpContent(divHelpContentResponse.getId());
|
|
189 |
// divHelpContentService.deleteDivHelpContent(divHelpContentResponse.getId());
|
|
187 | 190 |
// } |
188 | 191 |
// } |
189 | 192 |
// |
... | ... | |
191 | 194 |
// Portal community = communityController.getPortal("connect"); |
192 | 195 |
// |
193 | 196 |
// // delete div contents related to this divId |
194 |
// List<DivHelpContentResponse> divHelpContentResponses = divHelpContentController.getDivHelpContents("connect", null, divId.getName(), null);
|
|
197 |
// List<DivHelpContentResponse> divHelpContentResponses = divHelpContentService.getDivHelpContents("connect", null, divId.getName(), null);
|
|
195 | 198 |
// for(DivHelpContentResponse divHelpContentResponse : divHelpContentResponses) { |
196 |
// divHelpContentController.deleteDivHelpContent(divHelpContentResponse.getId());
|
|
199 |
// divHelpContentService.deleteDivHelpContent(divHelpContentResponse.getId());
|
|
197 | 200 |
// } |
198 | 201 |
// } |
199 | 202 |
|
... | ... | |
208 | 211 |
DivId divId = divIdDAO.findById(id); |
209 | 212 |
|
210 | 213 |
// delete div contents related to this divId |
211 |
List<DivHelpContentResponse> divHelpContentResponses = divHelpContentController.getDivHelpContents(null, null, divId.getName(), null);
|
|
214 |
List<DivHelpContentResponse> divHelpContentResponses = divHelpContentService.getDivHelpContents(null, null, divId.getName(), null);
|
|
212 | 215 |
for(DivHelpContentResponse divHelpContentResponse : divHelpContentResponses) { |
213 |
divHelpContentController.deleteDivHelpContent(divHelpContentResponse.getId());
|
|
216 |
divHelpContentService.deleteDivHelpContent(divHelpContentResponse.getId());
|
|
214 | 217 |
} |
215 | 218 |
|
216 | 219 |
divIdDAO.delete(id); |
Also available in: Unified diff
[Trunk - Admin tools library Service]: Commit r58031 was not completed.
DivIdService.java, PageService.java: In all controllers/services use methods only from services (except for entity's DAO).