Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright 2005-2013 The Kuali Foundation Licensed under the Educational Community License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.opensource.org/licenses/ecl2.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
package org.kuali.rice.kew.impl.actionlist;
Reference implementation of the org.kuali.rice.kew.api.actionlist.ActionListService api.

Author(s):
Kuali Rice Team (rice.collab@kuali.org)
public class ActionListServiceNewImpl implements ActionListService {
    @Override
    public Integer getUserActionItemCount(String principalId) {
        incomingParamCheck(principalId"principalId");
        return Integer.valueOf(KEWServiceLocator.getActionListService().getCount(principalId));
    }
    @Override
    public List<ActionItemgetActionItemsForPrincipal(String principalId) {
        incomingParamCheck(principalId"principalId");
        Collection<ActionItemActionListExtensionactionItems
                = KEWServiceLocator.getActionListService().getActionList(principalIdnull);
        List<ActionItemactionItemVOs = new ArrayList<ActionItem>(actionItems.size());
        for (org.kuali.rice.kew.actionitem.ActionItem actionItem : actionItems) {
            actionItemVOs.add(org.kuali.rice.kew.actionitem.ActionItem.to(actionItem));
        }
        return actionItemVOs;
    }
    @Override
    public List<ActionItemgetAllActionItems(String documentId) {
        incomingParamCheck(documentId"documentId");
        Collection<ActionItemActionListExtensionactionItems
                = KEWServiceLocator.getActionListService().getActionListForSingleDocument(documentId);
        List<ActionItemactionItemVOs = new ArrayList<ActionItem>(actionItems.size());
        for (org.kuali.rice.kew.actionitem.ActionItem actionItem : actionItems) {
            actionItemVOs.add(org.kuali.rice.kew.actionitem.ActionItem.to(actionItem));
        }
        return actionItemVOs;
    }
    @Override
    public List<ActionItemgetActionItems(String documentIdList<StringactionRequestedCodes) {
        incomingParamCheck(documentId"documentId");
        List<ActionItemactionItems = getAllActionItems(documentId);
        List<ActionItemmatchingActionitems = new ArrayList<ActionItem>();
        for (ActionItem actionItemVO : actionItems) {
            if (actionRequestedCodes.contains(actionItemVO.getActionRequestCd())) {
                matchingActionitems.add(actionItemVO);
            }
        }
        return matchingActionitems;
    }
    private void incomingParamCheck(Object objectString name) {
        if (object == null) {
            throw new RiceIllegalArgumentException(name + " was null");
        } else if (object instanceof String
                && StringUtils.isBlank((Stringobject)) {
            throw new RiceIllegalArgumentException(name + " was blank");
        }
    }
New to GrepCode? Check out our FAQ X