Announcement Announcement Module
Collapse
No announcement yet.
CommandGroupFactoryBean Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • CommandGroupFactoryBean

    Hi

    Before i had number CommandGroupFactoryBean bean, which represented menus with sub menus

    Today when I upgraded and deployed all my menus has lost their label so before it was for "File", for the file menu but today it is "commandLabel".

    What has changed?

    Also I remeber there was someone saying that theres a log kept for all changes, a sort of migration guide, where is that located?


    Cheers

    Magnus

  • #2
    Hi

    Is there any one out there who knows what changes has happend to the Command framework. The labels handling has changed I guess.

    <bean id="categoriesTreeView.popupMenu"
    class="org.springframework.richclient.command.Comm andGroupFactoryBean">
    <property name="members">
    <list>
    <ref bean="searchCommand"/>
    <ref bean="deleteCategoryCommand"/>
    <ref bean="preferenceCommand"/>
    <ref bean="helpCommand"/>
    <ref bean="aboutCommand"/>
    <ref bean="newMenu"/>
    </list>
    </property>
    </bean>
    <bean id="newMenu"
    class="org.springframework.richclient.command.Comm andGroupFactoryBean">
    <property name="members">
    <list>
    <ref bean="newRecordCollectionCommand"/>
    </list>
    </property>
    </bean>

    Why isn't the newMenu.label = New being shown in the client but instead "commandLabel".

    Magnus

    Comment


    • #3
      Its a show stopper

      Ok so the command framework must have changed alot. I've checked through the svn logs and nothing is mentioned about this, not in the mailing list either. It would be very good if the author could give us a hint of what to change to get it working. I see theres alot of viewrs on this subject so I guess im not alone on this one.

      Give us a line of what to adjust!!!

      Cheers
      Magnus

      Comment


      • #4
        I'm not aware of any changes in this area. Maybe it's a result of the changes for resolving the spring rcp services through ApplicationServicesLocator. Please check http://spring-rich-c.sourceforge.net...ngTo0.2.x.html.

        Comment


        • #5
          Hi Mathias

          I've tried copying everything thats in the sample application. So my context looks like this.

          <?xml version="1.0" encoding="UTF-8"?>
          <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
          <beans>
          <bean id="application"
          class="org.springframework.richclient.application. Application">
          <constructor-arg index="0" ref="applicationDescriptor"/>
          <constructor-arg index="1" ref="lifecycleAdvisor"/>
          </bean>

          <bean id="serviceLocator" class="org.springframework.richclient.application. ApplicationServicesLocator">
          <property name="applicationServices" ref="applicationServices"/>
          </bean>
          <bean id="applicationServices"
          class="org.springframework.richclient.application. support.DefaultApplicationServices">
          <property name="applicationObjectConfigurerId">
          <idref bean="applicationObjectConfigurer"/>
          </property>
          <property name="applicationWindowFactoryId">
          <idref bean="applicationWindowFactory"/>
          </property>
          <property name="binderSelectionStrategyId">
          <idref bean="binderSelectionStrategy"/>
          </property>
          <property name="formComponentInterceptorFactoryId">
          <idref bean="formComponentInterceptorFactory"/>
          </property>
          <property name="imageSourceId">
          <idref bean="imageSource"/>
          </property>
          <property name="rulesSourceId">
          <idref bean="rulesSource"/>
          </property>
          <property name="componentFactoryId">
          <idref bean="componentFactory"/>
          </property>
          <property name="securityControllerManagerId">
          <idref bean="securityControllerManager"/>
          </property>
          <property name="conversionServiceId">
          <idref bean="conversionService"/>
          </property>
          </bean>
          <bean id="applicationEventMulticaster" class="org.springframework.context.event.SimpleApp licationEventMulticaster"/>
          <bean id="applicationDescriptor"
          class="org.springframework.richclient.application. support.DefaultApplicationDescriptor">
          <property name="version" value="0.1"/>
          <property name="buildId" value="20060408-001"/>
          </bean>
          <bean id="applicationObjectConfigurer" depends-on="serviceLocator"
          class="org.springframework.richclient.application. config.DefaultApplicationObjectConfigurer">
          </bean>
          <bean id="lifecycleAdvisor" class="se.so4it.dam.client.jide.docking.JideLifecy cleAdvisor">
          <property name="windowCommandBarDefinitions" value="spring/HmDamClientCommandContext.xml"/>
          <property name="startingPageId" value="startUpPage"/>
          <property name="statusBar" ref="statusBar"/>
          <property name="registerableExceptionHandler" ref="exceptionHandler"/>
          </bean>
          <bean id="exceptionHandler" class="org.springframework.richclient.exceptionhan dling.DelegatingExceptionHandler">
          <property name="delegateList">
          <list>
          <bean class="org.springframework.richclient.exceptionhan dling.DelegatingExceptionHandlerDelegate">
          <property name="throwableClass">
          <value type="java.lang.Class">java.lang.Throwable</value>
          </property>
          <property name="exceptionHandler">
          <bean class="org.springframework.richclient.exceptionhan dling.MessagesDialogExceptionHandler">
          <property name="logLevel" value="ERROR"/>
          <property name="shutdownPolicy" value="ASK"/>
          <property name="messageSourceAccessor">
          <bean class="org.springframework.context.support.Message SourceAccessor">
          <constructor-arg index="0" ref="messageSource"/>
          </bean>
          </property>
          </bean>
          </property>
          </bean>
          </list>
          </property>
          </bean>
          <bean id="rulesSource" class="se.so4it.dam.client.services.DamClientValid ationRulesSource"/>
          <bean id="userController" class="se.so4it.dam.client.security.DamClientUserR oleSecurityController">
          <property name="authorizingRoles" value="ROLE_USER"/>
          </bean>
          <bean id="adminController" class="se.so4it.dam.client.security.DamClientUserR oleSecurityController">
          <property name="authorizingRoles" value="ROLE_ADMIN"/>
          </bean>
          <bean id="securityControllerManager"
          class="org.springframework.richclient.security.sup port.DefaultSecurityControllerManager">
          <property name="securityControllerMap">
          <map>
          <entry key="categoriesTreeViewCommandGroup.searchCommand" value-ref="adminController"/>
          </map>
          </property>
          </bean>
          </beans>


          One thing I should mention is that I have my own LifeCycleAdvasior since I used Jide as a DockingManager. It is more or less identical with the DefaultLifeCycleAdvisor except for getStatusBarCommandGroup() which returns a Jide based statusbar. So I am following the directions on the page you redirected me to, thanks for that by the way, and still all my file menus are resolved to "commandLabel". Only the file menus are resolve like this the simple commands are not resolved.

          One other interesting thing is that in one panel I do this:

          CommandGroup commandGroup = new CommandGroup();
          for (AbstractCommand abstractCommand : getCommands()) {
          commandGroup.add(abstractCommand);
          }
          JComponent buttonBar = commandGroup.createButtonBar();
          GuiStandardUtils.attachDialogBorder(buttonBar);
          CommandConfigurer commandConfigurer = (CommandConfigurer) ApplicationServicesLocator.services()
          .getService(CommandConfigurer.class);
          commandConfigurer.configure(commandGroup);

          And it does not work, the command does not even get called when button is pressed

          Magnus

          Comment


          • #6
            Magnus,

            I just upgraded from Spring v0.1 to v0.2 and nothing changed with the commands in my application. I'm also using the JIDE integration so it has nothing to do with that.

            One thing I did notice in the config file you posted. The applicationServices bean does not have the messageSourceId property set. This specifies where the messages come from. My app config file:

            <bean id="applicationServices"
            class="org.springframework.richclient.application. support.DefaultApplicationServices">
            <property name="applicationObjectConfigurerId" value="applicationObjectConfigurer" />
            <property name="formComponentInterceptorFactoryId" value="formComponentInterceptorFactory"/>
            <property name="imageSourceId" value="imageSource"/>
            <property name="rulesSourceId" value="rulesSource"/>
            <property name="messageSourceId" value="messageSource"/>
            <property name="binderSelectionStrategyId" value="binderSelectionStrategy"/>
            <property name="applicationWindowFactoryId" value="applicationWindowFactory" />
            <property name="applicationPageFactoryId" value="applicationPageFactory" />
            </bean>
            <bean id="messageSource"
            class="org.springframework.context.support.Resourc eBundleMessageSource">
            <property name="basenames">
            <list>
            <value>net.fiveprime.workbench.messages.messages </value>
            <value>net.fiveprime.workbench.messages.cluster-tree-messages</value>
            <value>net.fiveprime.workbench.messages.editor-messages</value>
            <value>net.fiveprime.workbench.messages.form-messages</value>
            <value>net.fiveprime.workbench.messages.protocol-browser-messages</value>
            <value>net.fiveprime.workbench.messages.menu-messages</value>
            <value>net.fiveprime.workbench.messages.preference s-dialog-messages</value>
            <value>net.fiveprime.workbench.messages.statusba r-messages</value>
            <value>org.springframework.richclient.application. messages</value>
            </list>
            </property>
            </bean>

            hope that's your problem,
            Jonny

            Comment


            • #7
              Hi Jonny

              Noop, no differences...arrrrgh is kind of frustating?

              The problem is that I see my own defined commands, they get their label as long as they are not org.springframework.richclient.command.CommandGrou pFactoryBean but org.springframework.richclient.command.TargetableA ctionCommand.

              And I get the same result if I instead use the ApplicationDefaultLifeCyleAdvisor.

              How do the commands get their label resolved and what is the difference between how CommandGroupFactoryBean and TargetableActionCommand does it ?

              Where is the "commandLabel" string defined, it is the default ?


              Magnus

              Comment


              • #8
                So you're saying nothing is wrong if you use the default LifecycleAdvisor, but if you use your own there's a problem?

                What does your lifecycle advisor implementation do that the JideApplicationLifecycleAdvisor (which allows configuration of the jide status bar) does not?

                I'm using CommandGroupFactoryBean definitions all over without problems. I don't know the details of the command framework internals, I've never had to dig into them, they've always worked.

                Jonny

                Comment


                • #9
                  Sorry, ignore that previous message, I reread yours and realized you were saying the opposite. That the lifecycle advisor makes no difference.

                  Have you turned the logging level for org.springframework.richclient.command to INFO or DEBUG and seen what that gives you. It spits out a lot of information about command configuration that might help you track down the problem.

                  Sorry I can't be of more help.
                  Jonny

                  Comment


                  • #10
                    Hi Jonny

                    Theres one thing that seems strange

                    2006-10-12 21:37:10,859 DEBUG ework.util.CachingMapDecorator | Caching expensive value: [CommandFaceButtonManager@9b601d commandId = 'fileMenu', faceDescriptor = [null], attachedButtonCount = 0]

                    It says that the faceDescriptor is null, which cant be a good thing.

                    Magnus

                    Comment


                    • #11
                      Magus,

                      my debug log says the same, sorry. I do get the following line (searching for fileMenu) later on in the debug log:

                      DEBUG [org.springframework.util.CachingMapDecorator] - For key 'default', returning cached value: [CommandFaceButtonManager@1b48392 commandId = 'fileMenu', faceDescriptor = [CommandFaceDescriptor@158291 caption = 'File', description = [null], buttonLabelInfo = [CommandButtonLabelInfo@2f1e75], buttonIconInfo = [CommandButtonIconInfo@fd1810]], attachedButtonCount = 0]

                      Jonny

                      Comment


                      • #12
                        Dependency problem i think

                        Hi Jonny

                        I checked out the source Spring rcp and created idea modules , which I included in my own idea project. Then when I run it works. When I build the new jar fiels and put dependencies on them it does not work. So my conclusion is that it must be something that it depends on. I see now that Spring rcp has gone up to Spring 2.0 and a new Acegis release, which is the must likely cause.

                        I'll try ot out and fix it. By the way Spring 2.0 is backward compatible i guesss?

                        Magnus

                        Comment


                        • #13
                          Magnus,

                          that could be it I guess. I'm running against the release jars and Spring 1.2.8.

                          I know Spring 2 was supposed to be backwards compatible but there's always the possibility of errors. I'd be interested in what you find as I was planning to upgrade to Spring 2 soon.

                          Jonny

                          Comment


                          • #14
                            Same problem here, too. I have debugged a lot (about three hours now). But as I don't know much about the internas of Spring and as I was searching the error within my code/configuration, I did not succeed...
                            If anyone finds a solution - please post here...

                            Comment


                            • #15
                              Spring 2.0

                              Hi guys

                              We'll after a long time of debugging I gave up. I shifted to Spring 2.0 and Acegi 1.0.2 and It worked directly. So that was my solution, if you for some reason cant go up to Spring 2.0 I dont have a solution for you, sorry

                              Magnus

                              Comment

                              Working...
                              X