Example usage for org.apache.wicket RestartResponseAtInterceptPageException RestartResponseAtInterceptPageException

List of usage examples for org.apache.wicket RestartResponseAtInterceptPageException RestartResponseAtInterceptPageException

Introduction

In this page you can find the example usage for org.apache.wicket RestartResponseAtInterceptPageException RestartResponseAtInterceptPageException.

Prototype

public RestartResponseAtInterceptPageException(Class<? extends Page> interceptPageClass) 

Source Link

Document

Redirects to the specified intercept page, this will result in a bookmarkable redirect.

Usage

From source file:cz.zcu.kiv.eegdatabase.wui.ui.lists.form.FileMetadataFormPage.java

License:Apache License

public FileMetadataFormPage(PageParameters parameters) {

    StringValue groupParam = parameters.get(PageParametersUtils.GROUP_PARAM);
    StringValue fileMetadataParam = parameters.get(DEFAULT_PARAM_ID);

    if (groupParam.isNull() || groupParam.isEmpty())
        throw new RestartResponseAtInterceptPageException(ListFileMetadataPage.class);

    add(new ButtonPageMenu("leftMenu", ListsLeftPageMenu.values()));

    if (fileMetadataParam.isNull() || fileMetadataParam.isEmpty())
        setupAddComponents(groupParam.toInt());
    else/* www.jav  a 2  s .co  m*/
        setupEditComponents(groupParam.toInt(), fileMetadataParam.toInt());
}

From source file:cz.zcu.kiv.eegdatabase.wui.ui.lists.form.HardwareFormPage.java

License:Apache License

public HardwareFormPage(PageParameters parameters) {

    StringValue groupParam = parameters.get(PageParametersUtils.GROUP_PARAM);
    StringValue hardwareParam = parameters.get(DEFAULT_PARAM_ID);

    if (groupParam.isNull() || groupParam.isEmpty())
        throw new RestartResponseAtInterceptPageException(ListHardwareDefinitionsPage.class);

    add(new ButtonPageMenu("leftMenu", ListsLeftPageMenu.values()));

    if (hardwareParam.isNull() || hardwareParam.isEmpty())
        setupAddComponents(groupParam.toInt());
    else/*from   w  w w.j a  va2  s  .  c o m*/
        setupEditComponents(groupParam.toInt(), hardwareParam.toInt());
}

From source file:cz.zcu.kiv.eegdatabase.wui.ui.lists.form.PersonOptParamFormPage.java

License:Apache License

public PersonOptParamFormPage(PageParameters parameters) {

    StringValue groupParam = parameters.get(PageParametersUtils.GROUP_PARAM);
    StringValue personParam = parameters.get(DEFAULT_PARAM_ID);

    if (groupParam.isNull() || groupParam.isEmpty())
        throw new RestartResponseAtInterceptPageException(ListPersonOptParamPage.class);

    add(new ButtonPageMenu("leftMenu", ListsLeftPageMenu.values()));

    if (personParam.isNull() || personParam.isEmpty())
        setupAddComponents(groupParam.toInt());
    else//from w w w .  ja  v a 2s  . co m
        setupEditComponents(groupParam.toInt(), personParam.toInt());
}

From source file:cz.zcu.kiv.eegdatabase.wui.ui.lists.form.SoftwareFormPage.java

License:Apache License

public SoftwareFormPage(PageParameters parameters) {

    StringValue groupParam = parameters.get(PageParametersUtils.GROUP_PARAM);
    StringValue softwareParam = parameters.get(DEFAULT_PARAM_ID);

    if (groupParam.isNull() || groupParam.isEmpty())
        throw new RestartResponseAtInterceptPageException(ListSoftwareDefinitionsPage.class);

    add(new ButtonPageMenu("leftMenu", ListsLeftPageMenu.values()));

    if (softwareParam.isNull() || softwareParam.isEmpty())
        setupAddComponents(groupParam.toInt());
    else/*  w w w . j  a  v a 2s.com*/
        setupEditComponents(groupParam.toInt(), softwareParam.toInt());
}

From source file:cz.zcu.kiv.eegdatabase.wui.ui.lists.form.WeatherFormPage.java

License:Apache License

public WeatherFormPage(PageParameters parameters) {

    StringValue groupParam = parameters.get(PageParametersUtils.GROUP_PARAM);
    StringValue weatherParam = parameters.get(DEFAULT_PARAM_ID);

    if (groupParam.isNull() || groupParam.isEmpty())
        throw new RestartResponseAtInterceptPageException(ListWeatherDefinitiosPage.class);

    add(new ButtonPageMenu("leftMenu", ListsLeftPageMenu.values()));

    if (weatherParam.isNull() || weatherParam.isEmpty())
        setupAddComponents(groupParam.toInt());
    else//w  ww. j av a2 s  .  com
        setupEditComponents(groupParam.toInt(), weatherParam.toInt());
}

From source file:cz.zcu.kiv.eegdatabase.wui.ui.order.ListOrderPage.java

License:Apache License

public ListOrderPage(PageParameters parameters) {

    StringValue personIdParam = parameters.get(DEFAULT_PARAM_ID);

    if (personIdParam.isEmpty() || personIdParam.isNull()) {

        throw new RestartResponseAtInterceptPageException(HomePage.class);

    } else {// w ww.j ava 2  s.  c  o m

        int personId = personIdParam.toInt();
        setupComponents(personId, false);
    }

}

From source file:cz.zcu.kiv.eegdatabase.wui.ui.order.ListOrderPage.java

License:Apache License

private void setupComponents(int personId, boolean myOrders) {

    IModel<String> title;/*from  w w w .  java2 s.  c o m*/
    if (myOrders) {
        title = ResourceUtils.getModel("pageTitle.order.myOrders");
    } else {
        Person person = personFacade.read(personId);
        if (person == null)
            throw new RestartResponseAtInterceptPageException(HomePage.class);

        title = ResourceUtils.getModel("pageTitle.order.userOrders", person.getUsername());
    }

    add(new Label("title", title));
    setPageTitle(title);
    add(new ButtonPageMenu("leftMenu", ShoppingCartPageLeftMenu.values()));

    DefaultDataTable<Order, String> orders = new DefaultDataTable<Order, String>("orders", createListColumns(),
            new OrderDataProvider(orderFacade, personId), ITEMS_PER_PAGE);
    add(orders);

}

From source file:cz.zcu.kiv.eegdatabase.wui.ui.order.OrderDetailPage.java

License:Apache License

public OrderDetailPage(PageParameters parameters) {

    StringValue orderIdParam = parameters.get(DEFAULT_PARAM_ID);

    if (orderIdParam.isEmpty() || orderIdParam.isNull()) {

        throw new RestartResponseAtInterceptPageException(HomePage.class);

    } else {//ww w .  j  a  v  a2 s .c om

        int orderId = orderIdParam.toInt();
        setupComponents(orderId);
    }
}

From source file:cz.zcu.kiv.eegdatabase.wui.ui.people.form.PersonAddParamFormPage.java

License:Apache License

public PersonAddParamFormPage(PageParameters parameters) {

    StringValue paramId = parameters.get(DEFAULT_PARAM_ID);

    if (paramId.isNull() || paramId.isEmpty())
        throw new RestartResponseAtInterceptPageException(ListPersonPage.class);

    setPageTitle(ResourceUtils.getModel("pageTitle.addPersonOptionalParameter"));

    add(new ButtonPageMenu("leftMenu", PersonPageLeftMenu.values()));

    PersonOptParamVal param = new PersonOptParamVal();
    param.setPerson(personFacade.getPersonForDetail(paramId.toInt()));

    add(new PersonAddParamForm("form", new Model<PersonOptParamVal>(param), facade, getFeedback()));
}

From source file:cz.zcu.kiv.eegdatabase.wui.ui.people.form.PersonFormPage.java

License:Apache License

public PersonFormPage(PageParameters parameters) throws IOException {

    StringValue paramId = parameters.get(DEFAULT_PARAM_ID);

    if (paramId.isNull() || paramId.isEmpty())
        throw new RestartResponseAtInterceptPageException(ListPersonPage.class);

    setPageTitle(ResourceUtils.getModel("pageTitle.editPerson"));
    add(new Label("title", ResourceUtils.getModel("pageTitle.editPerson")));

    add(new ButtonPageMenu("leftMenu", PersonPageLeftMenu.values()));

    Person person = facade.getPersonForDetail(paramId.toInt());

    if (!securityFacade.userCanEditPerson(person.getPersonId()))
        throw new RestartResponseAtInterceptPageException(PersonDetailPage.class,
                PageParametersUtils.getDefaultPageParameters(person.getPersonId()));

    add(new PersonForm("form", new Model<Person>(person), educationFacade, facade, getFeedback()));
}