Search in sources :

Example 1 with PhoneArrivalsAndDeparturesModel

use of org.onebusaway.phone.impl.PhoneArrivalsAndDeparturesModel in project onebusaway-application-modules by camsys.

the class ArrivalsAndDeparturesTemplate method buildTemplate.

@Override
public void buildTemplate(ActionContext context) {
    ValueStack valueStack = context.getValueStack();
    PhoneArrivalsAndDeparturesModel model = (PhoneArrivalsAndDeparturesModel) valueStack.findValue("model");
    StopsWithArrivalsAndDeparturesBean result = model.getResult();
    buildPredictedArrivalsTemplate(result.getArrivalsAndDepartures());
    addMessage(Messages.ARRIVAL_INFO_ON_SPECIFIC_ROUTE);
    AgiActionName byRouteAction = addActionWithParameterFromMatch("1(\\d+)#", "/stop/arrivalsAndDeparturesForRoute", "route", 1);
    byRouteAction.putParam("model", model);
    addMessage(Messages.ARRIVAL_INFO_BOOKMARK_THIS_LOCATION);
    AgiActionName bookmarkAction = addAction("2", "/stop/bookmark");
    bookmarkAction.putParam("stops", result.getStops());
    addMessage(Messages.ARRIVAL_INFO_RETURN_TO_MAIN_MENU);
    addAction("3", "/index");
    addAction("(#|[04-9]|1.*\\*)", "/repeat");
    addMessage(Messages.HOW_TO_GO_BACK);
    addAction("\\*", "/back");
    addMessage(Messages.TO_REPEAT);
}
Also used : ValueStack(com.opensymphony.xwork2.util.ValueStack) StopsWithArrivalsAndDeparturesBean(org.onebusaway.transit_data.model.StopsWithArrivalsAndDeparturesBean) PhoneArrivalsAndDeparturesModel(org.onebusaway.phone.impl.PhoneArrivalsAndDeparturesModel) AgiActionName(org.onebusaway.probablecalls.AgiActionName)

Aggregations

ValueStack (com.opensymphony.xwork2.util.ValueStack)1 PhoneArrivalsAndDeparturesModel (org.onebusaway.phone.impl.PhoneArrivalsAndDeparturesModel)1 AgiActionName (org.onebusaway.probablecalls.AgiActionName)1 StopsWithArrivalsAndDeparturesBean (org.onebusaway.transit_data.model.StopsWithArrivalsAndDeparturesBean)1