Link to home
Start Free TrialLog in
Avatar of roy_sanu
roy_sanuFlag for India

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 ?

@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);
	}

Open in new window


@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;
	}
	

Open in new window

Avatar of roy_sanu
roy_sanu
Flag of India image

ASKER

Hello expert needs help quickly
Thanks R.
ASKER CERTIFIED SOLUTION
Avatar of ste5an
ste5an
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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!!!