1 /*
2 * Copyright 2006 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.ole.gl.businessobject.inquiry;
17
18 import java.util.List;
19 import java.util.Map;
20 import java.util.Properties;
21
22 import org.kuali.ole.gl.businessobject.Encumbrance;
23 import org.kuali.ole.sys.OLEPropertyConstants;
24 import org.kuali.rice.kns.lookup.HtmlData;
25 import org.kuali.rice.krad.bo.BusinessObject;
26
27 /**
28 * Builds an inquirable to build inquiry links for fields in the encumbrance lookup. That lookup
29 * has no drill downs outside of chart attributes, so this class returns null for many classes.
30 */
31 public class EncumbranceInquirableImpl extends AbstractGeneralLedgerInquirableImpl {
32 private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(EncumbranceInquirableImpl.class);
33
34 /**
35 * Since there are no user defined attributes, returns null
36 * @return null - no user defined attributes
37 * @see org.kuali.ole.gl.businessobject.inquiry.AbstractGeneralLedgerInquirableImpl#buildUserDefinedAttributeKeyList()
38 */
39 @Override
40 protected List buildUserDefinedAttributeKeyList() {
41 return null;
42 }
43
44 /**
45 * Returns null as the map, as there are no drill downs here
46 * @return null for the map of attributes
47 * @see org.kuali.ole.gl.businessobject.inquiry.AbstractGeneralLedgerInquirableImpl#getUserDefinedAttributeMap()
48 */
49 @Override
50 protected Map getUserDefinedAttributeMap() {
51 return null;
52 }
53
54 /**
55 * Returns null for any attribute
56 * @param attributeName the name of an attribute for the inquiry
57 * @return null, no matter what
58 * @see org.kuali.ole.gl.businessobject.inquiry.AbstractGeneralLedgerInquirableImpl#getAttributeName(java.lang.String)
59 */
60 @Override
61 protected String getAttributeName(String attributeName) {
62 return null;
63 }
64
65 /**
66 * Returns null for any name/value pair its handed
67 * @param keyName the name of the key to lookup
68 * @param keyValue the value of the key to lookup
69 * @return null, every time
70 * @see org.kuali.ole.gl.businessobject.inquiry.AbstractGeneralLedgerInquirableImpl#getKeyValue(java.lang.String, java.lang.Object)
71 */
72 @Override
73 protected Object getKeyValue(String keyName, Object keyValue) {
74 return null;
75 }
76
77 /**
78 * Given a key name, returns null
79 * @param keyName the key name to change on the fly
80 * @return null, every time
81 * @see org.kuali.ole.gl.businessobject.inquiry.AbstractGeneralLedgerInquirableImpl#getKeyName(java.lang.String)
82 */
83 @Override
84 protected String getKeyName(String keyName) {
85 return null;
86 }
87
88 /**
89 * Returns null as the lookupable impl for this inquiry
90 * @return null, there isn't a lookupable impl
91 * @see org.kuali.ole.gl.businessobject.inquiry.AbstractGeneralLedgerInquirableImpl#getLookupableImplAttributeName()
92 */
93 @Override
94 protected String getLookupableImplAttributeName() {
95 return null;
96 }
97
98 /**
99 * Returns the base inquiry url to search...in this case, nothing
100 * @return null, as there's no URL to go to
101 * @see org.kuali.ole.gl.businessobject.inquiry.AbstractGeneralLedgerInquirableImpl#getBaseUrl()
102 */
103 @Override
104 protected String getBaseUrl() {
105 return null;
106 }
107
108 /**
109 * The class name of the business object that should be inquired on for the attribute
110 * @param the attribute name to build an inquiry for
111 * @return null, as there are no inquiries
112 * @see org.kuali.ole.gl.businessobject.inquiry.AbstractGeneralLedgerInquirableImpl#getInquiryBusinessObjectClass(java.lang.String)
113 */
114 @Override
115 protected Class getInquiryBusinessObjectClass(String attributeName) {
116 return null;
117 }
118
119 /**
120 * Adds no parameters at all
121 * @param parameter the parameter map to add new properties
122 * @param attributeName the name of the attribute being inquired on
123 * @see org.kuali.ole.gl.businessobject.inquiry.AbstractGeneralLedgerInquirableImpl#addMoreParameters(java.util.Properties, java.lang.String)
124 */
125 @Override
126 protected void addMoreParameters(Properties parameter, String attributeName) {
127 }
128
129 /*
130 * Add inquiry url for encumbrance document type code
131 *
132 * @see org.kuali.ole.gl.businessobject.inquiry.AbstractGeneralLedgerInquirableImpl#getInquiryUrl(org.kuali.rice.krad.bo.BusinessObject,
133 * java.lang.String)
134 */
135 @Override
136 public HtmlData getInquiryUrl(BusinessObject businessObject, String attributeName) {
137 HtmlData url = null;
138 if (OLEPropertyConstants.ENCUMBRANCE_DOCUMENT_TYPE_CODE.equals(attributeName)) {
139 String docTypeCode = ((Encumbrance)businessObject).getDocumentTypeCode();
140 url = getDocTypeInquiryUrl(docTypeCode);
141 }else{
142 url = super.getInquiryUrl(businessObject, attributeName);
143 }
144 return url;
145 }
146
147 }