MyFaces CODI
  1. MyFaces CODI
  2. EXTCDI-125

pagebeans as package based inline view-configs

    Details

      Description

      it should be possible to use @Page directly at page-beans.

      rules:

      • if @Page is used at a class which also hosts @Named or @ManagedBean, there shouldn't be a veto
      • instead of nested classes btw. interfaces one part of the package info should be used
      • in the root package there has to be a marker class with the annotation @InlineViewConfigRoot(optionally an explicit basePath should be possible)
      • the page-bean class is automatically used as view-controller

      known restrictions:

      • only use it for simple apps - the concept itself doesn't support a page-bean for multiple pages, however, if needed it's possible to use it side by side with the normal view-config approach

      example 1:

      package my.package.pages;

      @InlineViewConfigRoot
      public final class Pages
      {
      }

      package my.package.pages.registration;
      //...

      @Named
      @RequestScoped
      @Page
      public class RegistrationStep1 implements ViewConfig
      {
      public Class<? extends ViewConfig> confirm()

      { //... return RegistrationStep2Page.class; }

      }

      //will be interpreted as /pages/registration/registrationStep1.xhtml

      example 2:

      package my.package.pages;

      @InlineViewConfigRoot(basePath = "/pages/", pageBeanPostfix = "Page")
      public final class Pages
      {
      }

      package my.package.pages.registration;
      //...

      @Named
      @RequestScoped
      @Page
      public class RegistrationStep2Page implements ViewConfig

      { //... }

      //will be interpreted as /pages/registrationStep2.xhtml

      example 3:

      package my.package.pages;

      @InlineViewConfigRoot(basePath = "/*", pageBeanPostfix = "Page")
      public final class Pages
      {
      }

      package my.package.pages.registration;
      //...

      @Named
      @RequestScoped
      @Page
      public class RegistrationStep3Page implements ViewConfig{ //... }

      //will be interpreted as /registration/registrationStep3.xhtml

      example 4:

      package my.package.pages;

      @InlineViewConfigRoot(basePath = "/views/*")
      public final class Pages
      {
      }

      package my.package.pages.registration;
      //...

      @Named
      @RequestScoped
      @Page
      public class RegistrationStep4 implements ViewConfig

      { //... }

      //will be interpreted as /views/registration/registrationStep4.xhtml

        Activity

        Gerhard Petracek created issue -
        Gerhard Petracek made changes -
        Field Original Value New Value
        Description it should be possible to use @Page directly at page-beans.

        rules:
         * if @Page is used at a class which also hosts @Named or @ManagedBean, there shouldn't be a veto
         * instead of nested classes btw. interfaces one part of the package info should be used
         * in the root package there has to be a marker class with the annotation @PageRoot (optionally an explicit basePath should be possible)
         * the page-bean class is automatically used as view-controller

        example:

        package my.package.pages;

        @PageRoot
        public final class Pages
        {
        }

        package my.package.pages.registration;
        //...

        @Named
        @RequestScoped
        @Page
        public class RegistrationStep1 implements ViewConfig
        {
          public Class<? extends ViewConfig> confirm()
          {
            //...
            return RegistrationStep2.class;
          }
        }

        //will be interpreted as /pages/registration/registrationStep1.xhtml

        package my.package.pages.registration;
        //...

        @Named
        @RequestScoped
        @Page
        public class RegistrationStep2 implements ViewConfig
        {
          //...
        }

        //will be interpreted as /pages/registration/registrationStep2.xhtml
        it should be possible to use @Page directly at page-beans.

        rules:
         * if @Page is used at a class which also hosts @Named or @ManagedBean, there shouldn't be a veto
         * instead of nested classes btw. interfaces one part of the package info should be used
         * in the root package there has to be a marker class with the annotation @PageRoot (optionally an explicit basePath should be possible)
         * the page-bean class is automatically used as view-controller

        example:

        package my.package.pages;

        @ViewConfigRoot
        public final class Pages
        {
        }

        package my.package.pages.registration;
        //...

        @Named
        @RequestScoped
        @Page
        public class RegistrationStep1 implements ViewConfig
        {
          public Class<? extends ViewConfig> confirm()
          {
            //...
            return RegistrationStep2.class;
          }
        }

        //will be interpreted as /pages/registration/registrationStep1.xhtml

        @ViewConfigRoot(pageBeanPostfix = "Page")
        public final class Pages
        {
        }

        package my.package.pages.registration;
        //...

        @Named
        @RequestScoped
        @Page
        public class RegistrationStep2Page implements ViewConfig
        {
          //...
        }

        //will be interpreted as /pages/registration/registrationStep2.xhtml
        Gerhard Petracek made changes -
        Description it should be possible to use @Page directly at page-beans.

        rules:
         * if @Page is used at a class which also hosts @Named or @ManagedBean, there shouldn't be a veto
         * instead of nested classes btw. interfaces one part of the package info should be used
         * in the root package there has to be a marker class with the annotation @PageRoot (optionally an explicit basePath should be possible)
         * the page-bean class is automatically used as view-controller

        example:

        package my.package.pages;

        @ViewConfigRoot
        public final class Pages
        {
        }

        package my.package.pages.registration;
        //...

        @Named
        @RequestScoped
        @Page
        public class RegistrationStep1 implements ViewConfig
        {
          public Class<? extends ViewConfig> confirm()
          {
            //...
            return RegistrationStep2.class;
          }
        }

        //will be interpreted as /pages/registration/registrationStep1.xhtml

        @ViewConfigRoot(pageBeanPostfix = "Page")
        public final class Pages
        {
        }

        package my.package.pages.registration;
        //...

        @Named
        @RequestScoped
        @Page
        public class RegistrationStep2Page implements ViewConfig
        {
          //...
        }

        //will be interpreted as /pages/registration/registrationStep2.xhtml
        it should be possible to use @Page directly at page-beans.

        rules:
         * if @Page is used at a class which also hosts @Named or @ManagedBean, there shouldn't be a veto
         * instead of nested classes btw. interfaces one part of the package info should be used
         * in the root package there has to be a marker class with the annotation @InlineViewConfigRoot(optionally an explicit basePath should be possible)
         * the page-bean class is automatically used as view-controller

        example:

        package my.package.pages;

        @InlineViewConfigRoot
        public final class Pages
        {
        }

        package my.package.pages.registration;
        //...

        @Named
        @RequestScoped
        @Page
        public class RegistrationStep1 implements ViewConfig
        {
          public Class<? extends ViewConfig> confirm()
          {
            //...
            return RegistrationStep2.class;
          }
        }

        //will be interpreted as /pages/registration/registrationStep1.xhtml

        @InlineViewConfigRoot(pageBeanPostfix = "Page")
        public final class Pages
        {
        }

        package my.package.pages.registration;
        //...

        @Named
        @RequestScoped
        @Page
        public class RegistrationStep2Page implements ViewConfig
        {
          //...
        }

        //will be interpreted as /pages/registration/registrationStep2.xhtml
        Gerhard Petracek made changes -
        Description it should be possible to use @Page directly at page-beans.

        rules:
         * if @Page is used at a class which also hosts @Named or @ManagedBean, there shouldn't be a veto
         * instead of nested classes btw. interfaces one part of the package info should be used
         * in the root package there has to be a marker class with the annotation @InlineViewConfigRoot(optionally an explicit basePath should be possible)
         * the page-bean class is automatically used as view-controller

        example:

        package my.package.pages;

        @InlineViewConfigRoot
        public final class Pages
        {
        }

        package my.package.pages.registration;
        //...

        @Named
        @RequestScoped
        @Page
        public class RegistrationStep1 implements ViewConfig
        {
          public Class<? extends ViewConfig> confirm()
          {
            //...
            return RegistrationStep2.class;
          }
        }

        //will be interpreted as /pages/registration/registrationStep1.xhtml

        @InlineViewConfigRoot(pageBeanPostfix = "Page")
        public final class Pages
        {
        }

        package my.package.pages.registration;
        //...

        @Named
        @RequestScoped
        @Page
        public class RegistrationStep2Page implements ViewConfig
        {
          //...
        }

        //will be interpreted as /pages/registration/registrationStep2.xhtml
        it should be possible to use @Page directly at page-beans.

        rules:
         * if @Page is used at a class which also hosts @Named or @ManagedBean, there shouldn't be a veto
         * instead of nested classes btw. interfaces one part of the package info should be used
         * in the root package there has to be a marker class with the annotation @InlineViewConfigRoot(optionally an explicit basePath should be possible)
         * the page-bean class is automatically used as view-controller

        example 1:

        package my.package.pages;

        @InlineViewConfigRoot
        public final class Pages
        {
        }

        package my.package.pages.registration;
        //...

        @Named
        @RequestScoped
        @Page
        public class RegistrationStep1 implements ViewConfig
        {
          public Class<? extends ViewConfig> confirm()
          {
            //...
            return RegistrationStep2.class;
          }
        }

        //will be interpreted as /pages/registration/registrationStep1.xhtml

        example 2:

        package my.package.pages;

        @InlineViewConfigRoot(basePath = "/pages/", pageBeanPostfix = "Page")
        public final class Pages
        {
        }

        package my.package.pages.registration;
        //...

        @Named
        @RequestScoped
        @Page
        public class RegistrationStep2Page implements ViewConfig
        {
          //...
        }

        //will be interpreted as /pages/registrationStep2.xhtml

        example 3:

        package my.package.pages;

        @InlineViewConfigRoot(basePath = "/*", pageBeanPostfix = "Page")
        public final class Pages
        {
        }

        package my.package.pages.registration;
        //...

        @Named
        @RequestScoped
        @Page
        public class RegistrationStep3Page implements ViewConfig
        {
          //...
        }

        //will be interpreted as /registration/registrationStep3.xhtml

        example 4:

        package my.package.pages;

        @InlineViewConfigRoot(basePath = "/views/*")
        public final class Pages
        {
        }

        package my.package.pages.registration;
        //...

        @Named
        @RequestScoped
        @Page
        public class RegistrationStep4 implements ViewConfig
        {
          //...
        }

        //will be interpreted as /views/registration/registrationStep4.xhtml
        Gerhard Petracek made changes -
        Description it should be possible to use @Page directly at page-beans.

        rules:
         * if @Page is used at a class which also hosts @Named or @ManagedBean, there shouldn't be a veto
         * instead of nested classes btw. interfaces one part of the package info should be used
         * in the root package there has to be a marker class with the annotation @InlineViewConfigRoot(optionally an explicit basePath should be possible)
         * the page-bean class is automatically used as view-controller

        example 1:

        package my.package.pages;

        @InlineViewConfigRoot
        public final class Pages
        {
        }

        package my.package.pages.registration;
        //...

        @Named
        @RequestScoped
        @Page
        public class RegistrationStep1 implements ViewConfig
        {
          public Class<? extends ViewConfig> confirm()
          {
            //...
            return RegistrationStep2.class;
          }
        }

        //will be interpreted as /pages/registration/registrationStep1.xhtml

        example 2:

        package my.package.pages;

        @InlineViewConfigRoot(basePath = "/pages/", pageBeanPostfix = "Page")
        public final class Pages
        {
        }

        package my.package.pages.registration;
        //...

        @Named
        @RequestScoped
        @Page
        public class RegistrationStep2Page implements ViewConfig
        {
          //...
        }

        //will be interpreted as /pages/registrationStep2.xhtml

        example 3:

        package my.package.pages;

        @InlineViewConfigRoot(basePath = "/*", pageBeanPostfix = "Page")
        public final class Pages
        {
        }

        package my.package.pages.registration;
        //...

        @Named
        @RequestScoped
        @Page
        public class RegistrationStep3Page implements ViewConfig
        {
          //...
        }

        //will be interpreted as /registration/registrationStep3.xhtml

        example 4:

        package my.package.pages;

        @InlineViewConfigRoot(basePath = "/views/*")
        public final class Pages
        {
        }

        package my.package.pages.registration;
        //...

        @Named
        @RequestScoped
        @Page
        public class RegistrationStep4 implements ViewConfig
        {
          //...
        }

        //will be interpreted as /views/registration/registrationStep4.xhtml
        it should be possible to use @Page directly at page-beans.

        rules:
         * if @Page is used at a class which also hosts @Named or @ManagedBean, there shouldn't be a veto
         * instead of nested classes btw. interfaces one part of the package info should be used
         * in the root package there has to be a marker class with the annotation @InlineViewConfigRoot(optionally an explicit basePath should be possible)
         * the page-bean class is automatically used as view-controller

        example 1:

        package my.package.pages;

        @InlineViewConfigRoot
        public final class Pages
        {
        }

        package my.package.pages.registration;
        //...

        @Named
        @RequestScoped
        @Page
        public class RegistrationStep1 implements ViewConfig
        {
          public Class<? extends ViewConfig> confirm()
          {
            //...
            return RegistrationStep2Page.class;
          }
        }

        //will be interpreted as /pages/registration/registrationStep1.xhtml

        example 2:

        package my.package.pages;

        @InlineViewConfigRoot(basePath = "/pages/", pageBeanPostfix = "Page")
        public final class Pages
        {
        }

        package my.package.pages.registration;
        //...

        @Named
        @RequestScoped
        @Page
        public class RegistrationStep2Page implements ViewConfig
        {
          //...
        }

        //will be interpreted as /pages/registrationStep2.xhtml

        example 3:

        package my.package.pages;

        @InlineViewConfigRoot(basePath = "/*", pageBeanPostfix = "Page")
        public final class Pages
        {
        }

        package my.package.pages.registration;
        //...

        @Named
        @RequestScoped
        @Page
        public class RegistrationStep3Page implements ViewConfig
        {
          //...
        }

        //will be interpreted as /registration/registrationStep3.xhtml

        example 4:

        package my.package.pages;

        @InlineViewConfigRoot(basePath = "/views/*")
        public final class Pages
        {
        }

        package my.package.pages.registration;
        //...

        @Named
        @RequestScoped
        @Page
        public class RegistrationStep4 implements ViewConfig
        {
          //...
        }

        //will be interpreted as /views/registration/registrationStep4.xhtml
        Gerhard Petracek made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 0.9.3 [ 12316038 ]
        Resolution Fixed [ 1 ]
        Gerhard Petracek made changes -
        Description it should be possible to use @Page directly at page-beans.

        rules:
         * if @Page is used at a class which also hosts @Named or @ManagedBean, there shouldn't be a veto
         * instead of nested classes btw. interfaces one part of the package info should be used
         * in the root package there has to be a marker class with the annotation @InlineViewConfigRoot(optionally an explicit basePath should be possible)
         * the page-bean class is automatically used as view-controller

        example 1:

        package my.package.pages;

        @InlineViewConfigRoot
        public final class Pages
        {
        }

        package my.package.pages.registration;
        //...

        @Named
        @RequestScoped
        @Page
        public class RegistrationStep1 implements ViewConfig
        {
          public Class<? extends ViewConfig> confirm()
          {
            //...
            return RegistrationStep2Page.class;
          }
        }

        //will be interpreted as /pages/registration/registrationStep1.xhtml

        example 2:

        package my.package.pages;

        @InlineViewConfigRoot(basePath = "/pages/", pageBeanPostfix = "Page")
        public final class Pages
        {
        }

        package my.package.pages.registration;
        //...

        @Named
        @RequestScoped
        @Page
        public class RegistrationStep2Page implements ViewConfig
        {
          //...
        }

        //will be interpreted as /pages/registrationStep2.xhtml

        example 3:

        package my.package.pages;

        @InlineViewConfigRoot(basePath = "/*", pageBeanPostfix = "Page")
        public final class Pages
        {
        }

        package my.package.pages.registration;
        //...

        @Named
        @RequestScoped
        @Page
        public class RegistrationStep3Page implements ViewConfig
        {
          //...
        }

        //will be interpreted as /registration/registrationStep3.xhtml

        example 4:

        package my.package.pages;

        @InlineViewConfigRoot(basePath = "/views/*")
        public final class Pages
        {
        }

        package my.package.pages.registration;
        //...

        @Named
        @RequestScoped
        @Page
        public class RegistrationStep4 implements ViewConfig
        {
          //...
        }

        //will be interpreted as /views/registration/registrationStep4.xhtml
        it should be possible to use @Page directly at page-beans.

        rules:
         * if @Page is used at a class which also hosts @Named or @ManagedBean, there shouldn't be a veto
         * instead of nested classes btw. interfaces one part of the package info should be used
         * in the root package there has to be a marker class with the annotation @InlineViewConfigRoot(optionally an explicit basePath should be possible)
         * the page-bean class is automatically used as view-controller

        known restrictions:
         * only use it for simple apps - the concept itself doesn't support a page-bean for multiple pages, however, if needed it's possible to use it side by side with the normal view-config approach

        example 1:

        package my.package.pages;

        @InlineViewConfigRoot
        public final class Pages
        {
        }

        package my.package.pages.registration;
        //...

        @Named
        @RequestScoped
        @Page
        public class RegistrationStep1 implements ViewConfig
        {
          public Class<? extends ViewConfig> confirm()
          {
            //...
            return RegistrationStep2Page.class;
          }
        }

        //will be interpreted as /pages/registration/registrationStep1.xhtml

        example 2:

        package my.package.pages;

        @InlineViewConfigRoot(basePath = "/pages/", pageBeanPostfix = "Page")
        public final class Pages
        {
        }

        package my.package.pages.registration;
        //...

        @Named
        @RequestScoped
        @Page
        public class RegistrationStep2Page implements ViewConfig
        {
          //...
        }

        //will be interpreted as /pages/registrationStep2.xhtml

        example 3:

        package my.package.pages;

        @InlineViewConfigRoot(basePath = "/*", pageBeanPostfix = "Page")
        public final class Pages
        {
        }

        package my.package.pages.registration;
        //...

        @Named
        @RequestScoped
        @Page
        public class RegistrationStep3Page implements ViewConfig
        {
          //...
        }

        //will be interpreted as /registration/registrationStep3.xhtml

        example 4:

        package my.package.pages;

        @InlineViewConfigRoot(basePath = "/views/*")
        public final class Pages
        {
        }

        package my.package.pages.registration;
        //...

        @Named
        @RequestScoped
        @Page
        public class RegistrationStep4 implements ViewConfig
        {
          //...
        }

        //will be interpreted as /views/registration/registrationStep4.xhtml
        Gerhard Petracek made changes -
        Assignee Gerhard Petracek [ gpetracek ]
        Gerhard Petracek made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Gerhard Petracek
            Reporter:
            Gerhard Petracek
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development