Search in sources :

Example 6 with ViewConfigDescriptor

use of org.apache.deltaspike.core.api.config.view.metadata.ViewConfigDescriptor in project deltaspike by apache.

the class ViewConfigPathTest method testNamesWizard6.

@Test
public void testNamesWizard6() {
    this.viewConfigExtension.addPageDefinition(Pages.Wizard6.Step1.class);
    ViewConfigResolver viewConfigResolver = this.viewConfigResolverProducer.createViewConfigResolver();
    ViewConfigDescriptor viewConfigDescriptor;
    viewConfigDescriptor = viewConfigResolver.getViewConfigDescriptor(Pages.Wizard6.Step1.class);
    Assert.assertNotNull(viewConfigDescriptor);
    Assert.assertEquals("/pages/wizard6/step1.xhtml", viewConfigDescriptor.getViewId());
}
Also used : ViewConfigDescriptor(org.apache.deltaspike.core.api.config.view.metadata.ViewConfigDescriptor) ViewConfigResolver(org.apache.deltaspike.core.api.config.view.metadata.ViewConfigResolver) Test(org.junit.Test)

Example 7 with ViewConfigDescriptor

use of org.apache.deltaspike.core.api.config.view.metadata.ViewConfigDescriptor in project deltaspike by apache.

the class ViewConfigPathTest method testNamesWizard4.

@Test
public void testNamesWizard4() {
    this.viewConfigExtension.addPageDefinition(Pages.Wizard4.Step1.class);
    this.viewConfigExtension.addPageDefinition(Pages.Wizard4.Step2.class);
    ViewConfigResolver viewConfigResolver = this.viewConfigResolverProducer.createViewConfigResolver();
    ViewConfigDescriptor viewConfigDescriptor;
    viewConfigDescriptor = viewConfigResolver.getViewConfigDescriptor(Pages.Wizard4.Step1.class);
    Assert.assertNotNull(viewConfigDescriptor);
    Assert.assertEquals("/pages/wizard4/step1.xhtml", viewConfigDescriptor.getViewId());
    viewConfigDescriptor = viewConfigResolver.getViewConfigDescriptor(Pages.Wizard4.Step2.class);
    Assert.assertNotNull(viewConfigDescriptor);
    Assert.assertEquals("/step2.xhtml", viewConfigDescriptor.getViewId());
}
Also used : ViewConfigDescriptor(org.apache.deltaspike.core.api.config.view.metadata.ViewConfigDescriptor) ViewConfigResolver(org.apache.deltaspike.core.api.config.view.metadata.ViewConfigResolver) Test(org.junit.Test)

Example 8 with ViewConfigDescriptor

use of org.apache.deltaspike.core.api.config.view.metadata.ViewConfigDescriptor in project deltaspike by apache.

the class ViewConfigPathTest method testNamesWizard11.

@Test
public void testNamesWizard11() {
    this.viewConfigExtension.addPageDefinition(Pages.Wizard11.Step1.class);
    this.viewConfigExtension.addPageDefinition(Pages.Wizard11.Step2.class);
    this.viewConfigExtension.addPageDefinition(Pages.Wizard11.Step3.class);
    this.viewConfigExtension.addPageDefinition(Pages.Wizard11.Step4.class);
    this.viewConfigExtension.addPageDefinition(Pages.Wizard11.Step5.class);
    this.viewConfigExtension.addPageDefinition(Pages.Wizard11.Step6.class);
    this.viewConfigExtension.addPageDefinition(Pages.Wizard11.Step7.class);
    ViewConfigResolver viewConfigResolver = this.viewConfigResolverProducer.createViewConfigResolver();
    ViewConfigDescriptor viewConfigDescriptor;
    viewConfigDescriptor = viewConfigResolver.getViewConfigDescriptor(Pages.Wizard11.Step1.class);
    Assert.assertNotNull(viewConfigDescriptor);
    Assert.assertEquals("/pages/w11/step1.xhtml", viewConfigDescriptor.getViewId());
    viewConfigDescriptor = viewConfigResolver.getViewConfigDescriptor(Pages.Wizard11.Step2.class);
    Assert.assertNotNull(viewConfigDescriptor);
    Assert.assertEquals("/step2.xhtml", viewConfigDescriptor.getViewId());
    viewConfigDescriptor = viewConfigResolver.getViewConfigDescriptor(Pages.Wizard11.Step3.class);
    Assert.assertNotNull(viewConfigDescriptor);
    Assert.assertEquals("/pages/w11/step3.xhtml", viewConfigDescriptor.getViewId());
    viewConfigDescriptor = viewConfigResolver.getViewConfigDescriptor(Pages.Wizard11.Step4.class);
    Assert.assertNotNull(viewConfigDescriptor);
    Assert.assertEquals("/pages/w11/w11b/step4.xhtml", viewConfigDescriptor.getViewId());
    viewConfigDescriptor = viewConfigResolver.getViewConfigDescriptor(Pages.Wizard11.Step5.class);
    Assert.assertNotNull(viewConfigDescriptor);
    Assert.assertEquals("/w11b/step5.xhtml", viewConfigDescriptor.getViewId());
    viewConfigDescriptor = viewConfigResolver.getViewConfigDescriptor(Pages.Wizard11.Step6.class);
    Assert.assertNotNull(viewConfigDescriptor);
    Assert.assertEquals("/pages/w11/w11b/step6.xhtml", viewConfigDescriptor.getViewId());
    viewConfigDescriptor = viewConfigResolver.getViewConfigDescriptor(Pages.Wizard11.Step7.class);
    Assert.assertNotNull(viewConfigDescriptor);
    Assert.assertEquals("/pages/w11/w11b/step7.xhtml", viewConfigDescriptor.getViewId());
}
Also used : ViewConfigDescriptor(org.apache.deltaspike.core.api.config.view.metadata.ViewConfigDescriptor) ViewConfigResolver(org.apache.deltaspike.core.api.config.view.metadata.ViewConfigResolver) Test(org.junit.Test)

Example 9 with ViewConfigDescriptor

use of org.apache.deltaspike.core.api.config.view.metadata.ViewConfigDescriptor in project deltaspike by apache.

the class ViewConfigPathTest method testNamesWizard10.

@Test
public void testNamesWizard10() {
    this.viewConfigExtension.addPageDefinition(Pages.Wizard10.Step1.class);
    ViewConfigResolver viewConfigResolver = this.viewConfigResolverProducer.createViewConfigResolver();
    ViewConfigDescriptor viewConfigDescriptor;
    viewConfigDescriptor = viewConfigResolver.getViewConfigDescriptor(Pages.Wizard10.Step1.class);
    Assert.assertNotNull(viewConfigDescriptor);
    Assert.assertEquals("/pages/w10a/step1.xhtml", viewConfigDescriptor.getViewId());
}
Also used : ViewConfigDescriptor(org.apache.deltaspike.core.api.config.view.metadata.ViewConfigDescriptor) ViewConfigResolver(org.apache.deltaspike.core.api.config.view.metadata.ViewConfigResolver) Test(org.junit.Test)

Example 10 with ViewConfigDescriptor

use of org.apache.deltaspike.core.api.config.view.metadata.ViewConfigDescriptor in project deltaspike by apache.

the class DeltaSpikePhaseListener method processPreRenderView.

private void processPreRenderView(FacesContext facesContext) {
    UIViewRoot uiViewRoot = facesContext.getViewRoot();
    if (uiViewRoot != null) {
        ViewConfigDescriptor viewDefinitionEntry = this.viewConfigResolver.getViewConfigDescriptor(uiViewRoot.getViewId());
        ViewControllerUtils.executeViewControllerCallback(viewDefinitionEntry, PreRenderView.class);
    }
}
Also used : ViewConfigDescriptor(org.apache.deltaspike.core.api.config.view.metadata.ViewConfigDescriptor) UIViewRoot(javax.faces.component.UIViewRoot)

Aggregations

ViewConfigDescriptor (org.apache.deltaspike.core.api.config.view.metadata.ViewConfigDescriptor)44 ViewConfigResolver (org.apache.deltaspike.core.api.config.view.metadata.ViewConfigResolver)37 Test (org.junit.Test)31 View (org.apache.deltaspike.jsf.api.config.view.View)5 Method (java.lang.reflect.Method)3 UIViewRoot (javax.faces.component.UIViewRoot)3 DefaultErrorView (org.apache.deltaspike.core.api.config.view.DefaultErrorView)3 ViewControllerRef (org.apache.deltaspike.core.api.config.view.controller.ViewControllerRef)3 ConfigDescriptor (org.apache.deltaspike.core.api.config.view.metadata.ConfigDescriptor)3 HashSet (java.util.HashSet)2 Set (java.util.Set)2 ConfigurableNavigationHandler (javax.faces.application.ConfigurableNavigationHandler)2 NavigationCase (javax.faces.application.NavigationCase)2 ViewConfig (org.apache.deltaspike.core.api.config.view.ViewConfig)2 PreRenderView (org.apache.deltaspike.core.api.config.view.controller.PreRenderView)2 PreViewConfigNavigateEvent (org.apache.deltaspike.core.api.config.view.navigation.event.PreViewConfigNavigateEvent)2 ErrorViewAwareAccessDeniedException (org.apache.deltaspike.security.api.authorization.ErrorViewAwareAccessDeniedException)2 MalformedURLException (java.net.MalformedURLException)1 HashMap (java.util.HashMap)1 List (java.util.List)1