001    package com.khubla.pragmatach.plugin.adminapp;
002    
003    import java.util.List;
004    
005    import com.khubla.pragmatach.framework.annotation.Controller;
006    import com.khubla.pragmatach.framework.annotation.Route;
007    import com.khubla.pragmatach.framework.annotation.View;
008    import com.khubla.pragmatach.framework.api.PragmatachException;
009    import com.khubla.pragmatach.framework.api.Response;
010    import com.khubla.pragmatach.framework.application.Application;
011    import com.khubla.pragmatach.framework.router.PragmatachRoute;
012    
013    /**
014     * @author tome
015     */
016    @Controller()
017    @View(view = "pragmatach/admin/exportroutes.html")
018    public class ExportRoutesController extends SecuredAdminController {
019       private List<PragmatachRoute> routes;
020    
021       public Controller getControllerAnnotation(Class<?> clazz) {
022          return clazz.getAnnotation(Controller.class);
023       }
024    
025       public List<PragmatachRoute> getRoutes() {
026          return routes;
027       }
028    
029       @Route(uri = "/pragmatach/admin/exportroutes")
030       public Response render() throws PragmatachException {
031          routes = Application.getRoutes().getAllRoutes();
032          return super.render();
033       }
034    
035       public void setRoutes(List<PragmatachRoute> routes) {
036          this.routes = routes;
037       }
038    }