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

  • Common Action classes behaviour

    Hi,

    Most of the Action classes we are developing get or set an object from/to one of the two scopes, request or flow. Also, we like to be able to configure the name of the attribute and which scope to use, much like the FormAction.

    First we were going to move this common code to a parent Action class which inherited from AbstractAction, but as we also have MultiActions, we created a separated helper class. Then, we define our actions like this:

    Code:
      
    <bean id="MyAction" 
            class="com.disid.MyAction">
        <property name="attributeName">
          <value>MyObject</value>
        </property>
        <property name="objectScopeAsString">
          <value>flow</value>
        </property>
    </bean>
    And then, from my action class, I can get or set the object from the scope like this:

    Code:
    Object object = getScopeHelper&#40;&#41;.getScopeObject&#40;context&#41;;
    getScopeHelper&#40;&#41;.storeScopeObject&#40;element, context&#41;;
    Maybe this functionality could be moved to the AbstractAction class, as I think it is going to be very common in general. What do you think?


    Cèsar

  • #2
    Cesar,

    Create a JIRA issue and attach the code and we'll take a look at it and see how we can integrate it.

    Thanks,
    Keith

    Comment


    • #3
      Jira issue SPR-901 created

      Hi Keith,

      I have created the Jira issue SPR-901 with the related code. I hope you find it useful.

      Thanks!

      Cèsar

      Comment

      Working...
      X