Announcement Announcement Module
Collapse
No announcement yet.
Configuring ResponderCommandFactory with array of classes Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Configuring ResponderCommandFactory with array of classes

    I'd like to create a ResponderCommandFactory in the context, e.g.

    Code:
      <object id="aCommandFactory" class="org.springextensions.actionscript.cairngorm.commands.ResponderCommandFactory" scope="protoype">
        <method-invocation name="addBusinessDelegateFactory">
            <arg>
              <ref>aDelegateFactory</ref>
            </arg>
            <arg>
              <array>
                <value>com.example.Command1</value>
                <value>com.example.Command2</value>
              </array>
            </arg>
        </method-invocation>  
      </object>
    The issue is that the <array> XML results in an array of strings, and not an array of classes, as the function expects.

    Is there (concise) context XML syntax that would configure an array of classes?
    It looks like there isn't and the work-around for configuring a ResponderCommandFactory is to extend the Spring Cairngorm AS class with a custom class, and adding a method that accepts an array of strings, converting it into an array of classes.

    Should the ResponderCommandFactory provide such a method?

    In contrast, an object property value is conveniently type-converted into a Class if the object property is typed as Class, e.g.

    Code:
      <object id="aDelegateFactory" class="org.springextensions.actionscript.cairngorm.business.BusinessDelegateFactory" scope="protoype">
        <property name="delegateClass" value="com.example.Delegate"/>
      </object>
    Thoughts?

  • #2
    this'll do the trick

    All you need to do is add the type attribute and you're good to go:

    Code:
    <object id="aCommandFactory" class="org.springextensions.actionscript.cairngorm.commands.ResponderCommandFactory" scope="protoype">
        <method-invocation name="addBusinessDelegateFactory">
            <arg>
              <ref>aDelegateFactory</ref>
            </arg>
            <arg>
              <array>
                <value type="Class">com.example.Command1</value>
                <value type="Class">com.example.Command2</value>
              </array>
            </arg>
        </method-invocation>  
      </object>

    Comment


    • #3
      Related issue in SAS 1.1 (?)

      Hi,

      Sorry for resurrecting this oldie.

      We've been using SAS 0.8.1 successfully to date. I've just started to use SAS 1.1 instead, and ran into something weird: all <array> elements with more than one <value> fail schema validation. For example, the attached sample document fails validation in 1.1 at the second <value> in both <array>s:

      Code:
      cvc-complex-type.2.4.d: Invalid content was found starting with element 'value'. No child element is expected at this point.
      If I remove the second <value> elements, validation succeeds.

      This is weird - any ideas?

      Thanks,

      Comment


      • #4
        XSD change?

        Hey there,

        I guess somethign changed in the schema, we'll have to look into it. Can you add a JIRA issue for this?

        https://jira.springframework.org/bro...ACTIONSCRIPTAS

        thanks in advance!

        cheers,

        Roland

        Comment


        • #5
          See https://jira.springframework.org/bro...ONSCRIPTAS-126.

          Comment


          • #6
            Hi Jürgen,

            this should be fixed in SVN now.

            regards,
            Christophe

            Comment

            Working...
            X