001 /**
002 * Copyright 2005-2012 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016 package org.kuali.rice.kim.inquiry;
017
018 import java.util.HashMap;
019 import java.util.Map;
020
021 import org.kuali.rice.kim.bo.impl.KimAttributes;
022 import org.kuali.rice.kim.impl.role.RoleBo;
023 import org.kuali.rice.kns.inquiry.KualiInquirableImpl;
024 import org.kuali.rice.krad.service.KRADServiceLocatorWeb;
025
026 /**
027 * This is a description of what this class does - bhargavp don't forget to fill this in.
028 *
029 * @author Kuali Rice Team (rice.collab@kuali.org)
030 *
031 */
032 public class RoleMemberInquirableImpl extends KualiInquirableImpl {
033
034 protected final String ROLE_ID = "id";
035 protected final String NAME = "name";
036 protected final String NAME_TO_DISPLAY = "nameToDisplay";
037 protected final String TEMPLATE_NAME = "template.name";
038 protected final String NAMESPACE_CODE = "namespaceCode";
039 protected final String TEMPLATE_NAMESPACE_CODE = "template.namespaceCode";
040 protected final String DETAIL_OBJECTS = "detailObjects";
041 protected final String ASSIGNED_TO_ROLES = "assignedToRolesToDisplay";
042 protected final String ATTRIBUTE_DATA_ID = "attributeDataId";
043
044 protected String getKimAttributeLabelFromDD(String attributeName){
045 return KRADServiceLocatorWeb.getDataDictionaryService().getAttributeLabel(KimAttributes.class, attributeName);
046 }
047
048 protected RoleBo getRoleImpl(String roleId){
049 Map<String, String> criteria = new HashMap<String, String>();
050 criteria.put("id", roleId);
051 return getBusinessObjectService().findByPrimaryKey(RoleBo.class, criteria);
052 }
053
054 }