| 3303 |
rajveer |
1 |
package in.shop2020.serving.mappers;
|
|
|
2 |
|
|
|
3 |
import in.shop2020.serving.services.SpecialPageConfigurer;
|
| 6204 |
rajveer |
4 |
import in.shop2020.serving.utils.Utils;
|
|
|
5 |
|
| 3303 |
rajveer |
6 |
import org.apache.struts2.dispatcher.mapper.ActionMapping;
|
|
|
7 |
import org.apache.struts2.rest.RestActionMapper;
|
|
|
8 |
|
| 3320 |
rajveer |
9 |
/**
|
|
|
10 |
*
|
|
|
11 |
* @author rajveer
|
|
|
12 |
*
|
|
|
13 |
* Saholic mapper will allow us to dynamically map the urls with action. We will be able to create the pages dynamically in cms.
|
|
|
14 |
*/
|
| 3303 |
rajveer |
15 |
public class SaholicMapper extends RestActionMapper{
|
|
|
16 |
|
|
|
17 |
@Override
|
|
|
18 |
public org.apache.struts2.dispatcher.mapper.ActionMapping getMapping(javax.servlet.http.HttpServletRequest request, com.opensymphony.xwork2.config.ConfigurationManager configManager){
|
|
|
19 |
ActionMapping mapping = super.getMapping(request, configManager);
|
| 16849 |
amit.gupta |
20 |
if (mapping == null){
|
|
|
21 |
mapping = new ActionMapping();
|
|
|
22 |
mapping.setName("");
|
|
|
23 |
mapping.setNamespace("/");
|
|
|
24 |
}
|
| 3303 |
rajveer |
25 |
if(SpecialPageConfigurer.isValidSpecialPage(mapping.getName())){
|
|
|
26 |
mapping.setName("special-page");
|
|
|
27 |
}
|
| 6204 |
rajveer |
28 |
if(Utils.getOperatorByUri(mapping.getName()) != null){
|
|
|
29 |
mapping.setName("recharge");
|
|
|
30 |
}
|
| 3303 |
rajveer |
31 |
return mapping;
|
|
|
32 |
}
|
|
|
33 |
}
|