package com.aem;
import org.apache.sling.api.SlingHttpServletRequest;
import com.day.cq.wcm.api.Page;
import java.util.HashMap;
import java.util.Map;
import com.adobe.cq.sightly.WCMUse;
public class VehicleService extends WCMUse {
private Map<String, String> map;
@Override
public void activate() throws Exception {
SlingHttpServletRequest request = getRequest();
Page currentPage = getCurrentPage();
createVehicleDetails(request, currentPage);
}
/**
* This will Create vehicle map
*
* @return
*/
private void createVehicleDetails(SlingHttpServletRequest request, Page currentPage) {
map = new HashMap<String, String>();
map.put("name", "NewVehicle");
map.put("price", "1000");
}
/**
* This will return vehicle
*
* @return vehicle map
*/
Map<String,String> getVehicleDetails() {
return map;
}
}
No comments:
Post a Comment
If you have any doubts or questions, please let us know.