Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

Extending org.kuali.

...

kfs.kns.web.struts.action.KualiTransactionalDocumentActionBase
Anchor
action_base
action_base

For our own document's actions, we need to extend org.kuali.rice.kns.web.struts.action.KualiTransactionalDocumentActionBase or a descendant class. Again, the rules about parallel hierarchies are also in effect here. The class should be named {transactional document name}Action and should live in the org.kuali.kfs.module.{the module we're working in}.web.struts package.

...

KualiDocumentActionBase also has methods to handle adding and deleting ad hoc routing and the adding or deleting of notes and attachments. There are only two action methods defined in org.kuali.ricekfs.kns.web.struts.action.KualiTransactionalDocumentActionBase:

...

As promised, we needed to take a look at how rule events are generated by action methods. As you'll remember, we saw that events forced the rules validation framework to validate a certain set of rules on a document, but we said that we'd hold the last piece - the lynch-pin, if you will - until now, when we could see what action methods look like. Here is the addCheck method of the org.kuali.module.financial.web.struts.action.CashReceiptAction Action class:

...

Code Block
xml
xml
<form-bean name="KualiForm" type="org.kuali.ricekfs.kns.web.struts.form.KualiForm" />

<action path="/portal" name="KualiForm" type="org.kuali.ricekfs.kns.web.struts.action.KualiSimpleAction">
  <forward name="basic" path="/portal.jsp" />
</action>

...

Here, we can see that any URL with the path that starts with the word "financial" will have the portion of the path after "financial" held as a pattern. That pattern is then used to set the right form class, the correct view page for input, the Action class, and the "basic" forward, which simply goes to the JSP page for the document. Here, we see that if we've properly named our Form, Action, and page, everything goes together. For instance, for the URL "/financialAdvanceDeposit.do", this mapping will kick in, tying together the AdvanceDepositForm, the input page AdvanceDeposit.jsp, and the Action class org.kuali.kfs.fp.document.web.struts.AdvanceDepositAction and it will create a forward named "basic" which will point to AdvanceDeposit.jsp.

Naturally, for some pages, we won't want this basic a mapping scheme. In that case, we can set up a "basic" mapping, just like the example above. However, for the most part, it's typically a lot easier to let KFS take care of most of the mapping stuff for us by using the naming defaults.

Next

Include Page
Include Footer
Include Footer