Results 1 to 6 of 6

Thread: Configuring ResponderCommandFactory with array of classes

  1. #1
    Join Date
    Feb 2009
    Location
    California
    Posts
    9

    Default 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?
    Jürgen

  2. #2
    Join Date
    Dec 2008
    Location
    Brussels
    Posts
    407

    Default 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>

  3. #3
    Join Date
    Feb 2009
    Location
    California
    Posts
    9

    Default 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,
    Attached Files Attached Files
    Jürgen

  4. #4
    Join Date
    Dec 2008
    Location
    Brussels
    Posts
    407

    Default 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

  5. #5
    Join Date
    Feb 2009
    Location
    California
    Posts
    9

  6. #6
    Join Date
    Oct 2008
    Location
    Belgium
    Posts
    160

    Default

    Hi Jürgen,

    this should be fixed in SVN now.

    regards,
    Christophe
    Christophe Herreman
    Spring ActionScript Founder
    http://www.herrodius.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •