ssire / oppidum

Open source XML MVC framework for eXist-db
14 stars 9 forks source link

Support methods on actions #7

Open ssire opened 11 years ago

ssire commented 11 years ago

Oppidum command's analyser does not allow to declare methods on actions.

For instance if an item supports an action "administrate" (e.g. to bring up a form to administrate an item) :

    <action name="administrate" epilogue="standard">
      <model src="modules/company/administrate.xql"/>
      <view src="modules/company/administrate.xsl"/>
    </action>

It is not possible to define (e.g. to manage form submission) :

    <action name="administrate" method="POST" epilogue="standard">
      <model src="modules/company/administrate.xql"/>
      <view src="modules/company/administrate.xsl"/>
      <action name="POST">
        <model src="modules/company/administrate.xql"/>
        <view src="modules/company/administrate.xsl"/>
      </action>
    </action>

However that would be sound since that limitation imposes to create a "fake" item to receive submitted data or to explicitely retrieve and test the method with code such as let $m := request:get-method() inside the XQuery model script handling the action.

ssire commented 11 years ago

A complement to that issue is that it is also not possible to define at the mapping level the fact that an action is only compatible with a restricted set of HTTP VERBs (for instance an action that only accept POST requests).

A potential solution would be to support the supported attribute on the action element, with the same issue as Issue #17