Search in sources :

Example 1 with HtmlData

use of org.kuali.kfs.kns.lookup.HtmlData in project cu-kfs by CU-CommunityApps.

the class CuOrganizationRoutingModelNameLookupableHelperServiceImplTest method testGetReturnUrl.

public void testGetReturnUrl() {
    BusinessObjectRestrictionsBase businessObjectRestrictions = new BusinessObjectRestrictionsBase();
    Map<String, String> fieldConversions = new HashMap<String, String>();
    fieldConversions.put("organizationCode", "modelOrganizationCode");
    fieldConversions.put("chartOfAccountsCode", "modelChartOfAccountsCode");
    fieldConversions.put("accountDelegateModelName", "modelName");
    lookupableHelperServiceImpl.setFieldConversions(fieldConversions);
    lookupableHelperServiceImpl.setBusinessObjectClass(AccountDelegateModel.class);
    LookupForm lookupForm = new LookupForm();
    lookupForm.setFieldConversions(fieldConversions);
    lookupForm.setLookupableImplServiceName("organizationRoutingModelLookupable");
    AccountDelegateModel accountDelegateModel = new AccountDelegateModel();
    accountDelegateModel.setAccountDelegateModelName("Stuff");
    accountDelegateModel.setChartOfAccountsCode("IT");
    accountDelegateModel.setOrganizationCode("1000");
    List<String> returnKeys = new ArrayList<String>();
    returnKeys.add("chartOfAccountsCode");
    returnKeys.add("organizationCode");
    returnKeys.add("accountDelegateModelName");
    String befoerBackLocation = lookupForm.getBackLocation();
    HtmlData results = lookupableHelperServiceImpl.getReturnUrl(accountDelegateModel, lookupForm, returnKeys, businessObjectRestrictions);
    assertEquals("return value", results.getDisplayText());
    assertEquals(befoerBackLocation, lookupForm.getBackLocation());
}
Also used : HashMap(java.util.HashMap) LookupForm(org.kuali.kfs.kns.web.struts.form.LookupForm) AccountDelegateModel(org.kuali.kfs.coa.businessobject.AccountDelegateModel) ArrayList(java.util.ArrayList) BusinessObjectRestrictionsBase(org.kuali.kfs.kns.document.authorization.BusinessObjectRestrictionsBase) HtmlData(org.kuali.kfs.kns.lookup.HtmlData)

Example 2 with HtmlData

use of org.kuali.kfs.kns.lookup.HtmlData in project cu-kfs by CU-CommunityApps.

the class CreateDoneBatchFileLookupableHelperServiceImpl method getCustomActionUrls.

@Override
public List<HtmlData> getCustomActionUrls(BusinessObject businessObject, List pkNames) {
    List<HtmlData> links = new ArrayList<HtmlData>();
    BatchFile batchFile = (BatchFile) businessObject;
    if (canCreateDoneFile(batchFile)) {
        links.add(getCreateDoneUrl(batchFile));
    }
    return links;
}
Also used : BatchFile(org.kuali.kfs.sys.batch.BatchFile) ArrayList(java.util.ArrayList) HtmlData(org.kuali.kfs.kns.lookup.HtmlData) AnchorHtmlData(org.kuali.kfs.kns.lookup.HtmlData.AnchorHtmlData)

Aggregations

ArrayList (java.util.ArrayList)2 HtmlData (org.kuali.kfs.kns.lookup.HtmlData)2 HashMap (java.util.HashMap)1 AccountDelegateModel (org.kuali.kfs.coa.businessobject.AccountDelegateModel)1 BusinessObjectRestrictionsBase (org.kuali.kfs.kns.document.authorization.BusinessObjectRestrictionsBase)1 AnchorHtmlData (org.kuali.kfs.kns.lookup.HtmlData.AnchorHtmlData)1 LookupForm (org.kuali.kfs.kns.web.struts.form.LookupForm)1 BatchFile (org.kuali.kfs.sys.batch.BatchFile)1