Maintenance Document Initiation Link

A business object's lookup page automatically determines if a maintenance document exists for the given business object and displays a "create new" button accordingly. Still, for fun, let's take a look at how to create lookup links in the portal and how to create other links on the lookup page itself.

Let's take a look at the link to the lookup for a business object, which just happens to have an associated maintenance framework. Here's what, for instance, the account lookup looks like:

<portal:portalLink displayTitle="true" title="Account"
url="kr/lookup.do?methodToCall=start&businessObjectClassName=org.kuali.kfs.coa.businessobject.Account&docFormKey=88888888
&returnLocation=${ConfigProperties.application.url}/portal.do&hideReturnLink=true"
/>

Whoa! Let's break this up a bit. First, we're using the portal:portalLink tag. The text that is clickable will be "Account", and it the link will show up in the portal (because displayTitle="true"). Then we've got the url...

kr/lookup.do?methodToCall=start

This is the start, and all it says is that we want to defer to the embedded Kuali Rice part of the application, which has the lookup page - lookup.do. Then we start our parameters, which begins, as always, with a methodToCall - the method in the action class to call when the page is rendered, which for lookups is always "start".

&businessObjectClassName=org.kuali.kfs.coa.businessobject.Account

This makes much sense: the lookup needs a parameter to tell it what the class name of the business object it deals with is. In this case, it's org.kuali.kfs.coa.businessobject.Account

&docFormKey=88888888

This key is basically a dummy, used to initialize the "docFormKey." The "docFormKey" parameter is used by the maintenance document framework, and basically holds the key of a maintenance document in the current user's session. So, for instance, when the user is editing a maintenance document form and performs a lookup on a field and then returns to the maintenance document form, that form has been held in the session for quick retrieval, and docFormKey holds the key to that form in the session. And it needs to be initialized; hence passing in this parameter.

&returnLocation=${ConfigProperties.application.url}/portal.do

We also need to return the url for the return location that the lookup would use. Here, we just return to the main portal page, using the preset variable "ConfigProperties.application.url"

&hideReturnLink=true

This is actually a parameter to the returnLocation url! It just says that the lookup screen itself shouldn't show a return link...because at initialization of the lookup, there's not really anything (besides the portal) to return to.

Once we're on a lookup page, the Kuali Rice framework will figure out if there's a maintenance document associated with the given lookup, based on the class that is being looked up on. If there is, it automatically shows the "create new" button, as well as shows us the "edit" and "copy" links in search results once we've gotten values from a search.

 

 

Kuali documentation is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License. 

Kuali software is licensed for use pursuant to the Affero General Public License, version 3.

 Copyright © 2014 Kuali, Inc. All rights reserved. 

Portions of Kuali are copyrighted by other parties as described in the Acknowledgments screen. 

Kuali ® is a registered trademark of the Trustees of Indiana University.