View Javadoc

1   /*
2    * Copyright 2007-2009 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.kim.lookup;
17  
18  import java.util.Properties;
19  
20  import org.apache.commons.lang.StringUtils;
21  import org.kuali.rice.kew.util.KEWConstants;
22  import org.kuali.rice.kim.bo.impl.GenericPermission;
23  import org.kuali.rice.kim.bo.impl.GroupImpl;
24  import org.kuali.rice.kim.bo.types.impl.KimTypeImpl;
25  import org.kuali.rice.kim.util.KimCommonUtils;
26  import org.kuali.rice.kim.util.KimConstants;
27  import org.kuali.rice.kns.lookup.KualiLookupableImpl;
28  import org.kuali.rice.kns.util.KNSConstants;
29  import org.kuali.rice.kns.util.UrlFactory;
30  
31  /**
32   * This is a description of what this class does - shyu don't forget to fill this in. 
33   * 
34   * @author Kuali Rice Team (rice.collab@kuali.org)
35   *
36   */
37  public class GroupLookupableImpl extends KualiLookupableImpl {
38  
39      private static final long serialVersionUID = -7862240710174441633L;
40  
41      public String getCreateNewUrl() {
42          String url = "";
43          if((getLookupableHelperService()).allowsNewOrCopyAction(KimConstants.KimUIConstants.KIM_GROUP_DOCUMENT_TYPE_NAME)){
44              Properties parameters = new Properties();
45  	        parameters.put(KNSConstants.DISPATCH_REQUEST_PARAMETER, KNSConstants.DOC_HANDLER_METHOD);
46  	        parameters.put(KNSConstants.PARAMETER_COMMAND, KEWConstants.INITIATE_COMMAND);
47  	        parameters.put(KNSConstants.DOCUMENT_TYPE_NAME, KimConstants.KimUIConstants.KIM_GROUP_DOCUMENT_TYPE_NAME);
48  	        if (StringUtils.isNotBlank(getReturnLocation())) {
49  	        	parameters.put(KNSConstants.RETURN_LOCATION_PARAMETER, getReturnLocation());
50  	        	}
51              url = getCreateNewUrl(UrlFactory.parameterizeUrl(
52              		KimCommonUtils.getKimBasePath()+KimConstants.KimUIConstants.KIM_GROUP_DOCUMENT_ACTION, parameters));            		
53          }
54          return url;
55      }
56  
57  }