7 Replies Latest reply on Jul 9, 2003 8:22 AM by julien1

    Block Module, need help

    noel.rocher

      Hi all,

      I need some help to edit block's properties (the specific ones not weight, side ...).

      Julien told me to look at the org.jboss.system.ServiceConfigurator class but I really don't know where to start.

      Here is where I am today : we can (only ;o) graphically change side and weigth properties.

      I give a zip file for those who want to try it.

      Take care, I developped it one month ago.


      Noel

        • 1. Re: Block Module, need help
          noel.rocher

          Attachement didn't work

          • 2. Re: Block Module, need help

            ok so what you want to do is to discover block properties dynamicly ?

            julien

            • 3. Re: Block Module, need help
              noel.rocher

              Hi Julien,

              Discovering properties is easy with reflection, the problem is to provide a way to only select the one that can be exposed and , for example, a way to know if a string property require a simple line or a textarea.

              Is it reasonable to think that blocks should come with a helper class that allow property settings and a render method ?

              Noel

              • 4. Re: Block Module, need help

                yeah right.t his already exist in some kind.
                jboss make use of javabean property editors to make the conversion between strint<->data

                look at the nukes JMX module that is doing that.

                on the other side, PN original block allow them to dispkay HTML for configuration and handle the changes.

                maybe we can found a neat way to do that, what do you think ?

                • 5. Re: Block Module, need help
                  noel.rocher

                  It is a good thing to let blocks controlling what can be manipulated. However, block module is the right place to execute the changes.

                  Helper classes or directly in blocks ?
                  Helper classes is clearer but directly in blocks is simpler.

                  • 6. Re: Block Module, need help
                    noel.rocher

                    BTW,

                    Try it, it's funny to see blocks moving in live.

                    • 7. Re: Block Module, need help

                      I agree... a block should be asked to display a part of its configuration data.

                      it was part of the first block commit I did actually, I remember :

                      public final void edit(Page page) { } is supposed to be called by the Block module to include the custom config of the block instance.

                      public final void update(Page page) { } is supposed to be called by the Block module to give a chance to the block instance to update its state.

                      you should put them again in BlockSupport class and use them.

                      julien