roy_sanu
asked on
Issue on the DTO(Data Transfer object)
why getAllLookupData method of the below two has to map . i got this code from internet as i have to look at it as there is some issue in it and can be used in my college project.
any help sir ?
any help sir ?
@GetMapping
public ResponseEntity<?> fetch(@RequestHeader("userinfo") String userinfo,PageAttributes pageAttributes) throws AdminServiceException {
HashMap<String, String> map=HeaderInfoUtility.getCredentials(userinfo);
LOGGER.info("-----username--------{}--",map.get(USERNAME));
LOGGER.info("------password-----{}---",map.get(PASSWORD));
LOGGER.info("------passwordEncrypted-----{}---",map.get(ENCRYPTEDPASSWORD));
UserContext userContext=new UserContext();
userContext.setPassword(map.get(ENCRYPTEDPASSWORD));
userContext.setUsername(map.get(USERNAME));
AdminDTO adminDto = lookupActionsService.getAllLookupData(pageAttributes.getPageNumber(),
pageAttributes.getPageSize(), pageAttributes.getSortType(), pageAttributes.getSortFields(),
pageAttributes.getLocale(), userContext);
return new ResponseEntity<>(adminDto, HttpStatus.OK);
}
@Override
public AdminDTO getAllLookupData(int pageNumber, int pageSize, String sortType, List<String> sortFields,
String locale, UserContext userContext) {
AdminDTO adminDto = null;
String repositoryType = getRepositoryType();
try {
adminDto = adminFactory.getAdminFactory(repositoryType).
getAllActionsLookupData(pageNumber, pageSize, sortType, sortFields, locale, userContext);
} catch (CmsRevampFactoryException ce) {
LOGGER.error(
"Error occurred while retrieving actions lookup :getAllLookupData() {}",
ce.fillInStackTrace());
throw new AdminServiceException(
"Exception occured while retrieving actions lookup ");
}
return adminDto;
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
No probs Ste5an it was a good info for me. next time i will set it as private as i am not aware of the sensitivity of the world.
Ouch ha!!!
Ouch ha!!!
ASKER
Thanks R.