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.krad.service.impl;
017    
018    import org.apache.commons.beanutils.PropertyUtils;
019    import org.apache.commons.lang.StringUtils;
020    import org.apache.log4j.Logger;
021    import org.kuali.rice.core.api.config.property.ConfigurationService;
022    import org.kuali.rice.coreservice.framework.CoreFrameworkServiceLocator;
023    import org.kuali.rice.coreservice.framework.parameter.ParameterService;
024    import org.kuali.rice.krad.bo.BusinessObject;
025    import org.kuali.rice.krad.bo.DataObjectRelationship;
026    import org.kuali.rice.krad.bo.ExternalizableBusinessObject;
027    import org.kuali.rice.krad.bo.ModuleConfiguration;
028    import org.kuali.rice.krad.datadictionary.BusinessObjectEntry;
029    import org.kuali.rice.krad.datadictionary.PrimitiveAttributeDefinition;
030    import org.kuali.rice.krad.datadictionary.RelationshipDefinition;
031    import org.kuali.rice.krad.service.BusinessObjectNotLookupableException;
032    import org.kuali.rice.krad.service.KRADServiceLocator;
033    import org.kuali.rice.krad.service.KRADServiceLocatorWeb;
034    import org.kuali.rice.krad.service.KualiModuleService;
035    import org.kuali.rice.krad.service.LookupService;
036    import org.kuali.rice.krad.service.ModuleService;
037    import org.kuali.rice.krad.uif.UifParameters;
038    import org.kuali.rice.krad.util.ExternalizableBusinessObjectUtils;
039    import org.kuali.rice.krad.util.KRADConstants;
040    import org.kuali.rice.krad.util.ObjectUtils;
041    import org.kuali.rice.krad.util.UrlFactory;
042    import org.springframework.beans.BeansException;
043    import org.springframework.beans.factory.NoSuchBeanDefinitionException;
044    import org.springframework.context.ApplicationContext;
045    
046    import java.lang.reflect.Modifier;
047    import java.util.HashMap;
048    import java.util.List;
049    import java.util.Map;
050    import java.util.Properties;
051    
052    
053    public abstract class RemoteModuleServiceBase implements ModuleService {
054        protected static final Logger LOG = Logger.getLogger(RemoteModuleServiceBase.class);
055    
056        protected ModuleConfiguration moduleConfiguration;
057        protected KualiModuleService kualiModuleService;
058        protected ApplicationContext applicationContext;
059        protected ConfigurationService kualiConfigurationService;
060        protected LookupService lookupService;
061    
062        /**
063         * @see org.kuali.rice.krad.service.ModuleService#isResponsibleFor(java.lang.Class)
064         */
065        public boolean isResponsibleFor(Class businessObjectClass) {
066            if (getModuleConfiguration() == null) {
067                throw new IllegalStateException("Module configuration has not been initialized for the module service.");
068            }
069    
070            if (getModuleConfiguration().getPackagePrefixes() == null || businessObjectClass == null) {
071                return false;
072            }
073            for (String prefix : getModuleConfiguration().getPackagePrefixes()) {
074                if (businessObjectClass.getPackage().getName().startsWith(prefix)) {
075                    return true;
076                }
077            }
078            if (ExternalizableBusinessObject.class.isAssignableFrom(businessObjectClass)) {
079                Class externalizableBusinessObjectInterface =
080                        ExternalizableBusinessObjectUtils.determineExternalizableBusinessObjectSubInterface(
081                                businessObjectClass);
082                if (externalizableBusinessObjectInterface != null) {
083                    for (String prefix : getModuleConfiguration().getPackagePrefixes()) {
084                        if (externalizableBusinessObjectInterface.getPackage().getName().startsWith(prefix)) {
085                            return true;
086                        }
087                    }
088                }
089            }
090            return false;
091        }
092    
093        /**
094         * @see org.kuali.rice.krad.service.ModuleService#isResponsibleFor(java.lang.Class)
095         */
096        public boolean isResponsibleForJob(String jobName) {
097            if (getModuleConfiguration() == null) {
098                throw new IllegalStateException("Module configuration has not been initialized for the module service.");
099            }
100    
101            if (getModuleConfiguration().getJobNames() == null || StringUtils.isEmpty(jobName)) {
102                return false;
103            }
104    
105            return getModuleConfiguration().getJobNames().contains(jobName);
106        }
107    
108    
109        public List listPrimaryKeyFieldNames(Class businessObjectInterfaceClass) {
110            Class clazz = getExternalizableBusinessObjectImplementation(businessObjectInterfaceClass);
111            return KRADServiceLocator.getPersistenceStructureService().listPrimaryKeyFieldNames(clazz);
112        }
113    
114        /**
115         * @see org.kuali.rice.krad.service.ModuleService#getExternalizableBusinessObjectDictionaryEntry(java.lang.Class)
116         */
117        public BusinessObjectEntry getExternalizableBusinessObjectDictionaryEntry(Class businessObjectInterfaceClass) {
118            Class boClass = getExternalizableBusinessObjectImplementation(businessObjectInterfaceClass);
119    
120            return boClass == null ? null : KRADServiceLocatorWeb.getDataDictionaryService().getDataDictionary()
121                    .getBusinessObjectEntryForConcreteClass(boClass.getName());
122        }
123    
124        /**
125         * @see org.kuali.rice.krad.service.ModuleService#getExternalizableDataObjectInquiryUrl(java.lang.Class,
126         * java.util.Properties)
127         */
128        public String getExternalizableDataObjectInquiryUrl(Class<?> inquiryDataObjectClass, Properties parameters) {
129            String baseUrl = getBaseInquiryUrl();
130    
131            // if external business object, replace data object in request with the actual impl object class
132            if (ExternalizableBusinessObject.class.isAssignableFrom(inquiryDataObjectClass)) {
133                Class implementationClass = getExternalizableBusinessObjectImplementation(inquiryDataObjectClass.asSubclass(
134                        ExternalizableBusinessObject.class));
135                if (implementationClass == null) {
136                    throw new RuntimeException("Can't find ExternalizableBusinessObject implementation class for "
137                            + inquiryDataObjectClass.getName());
138                }
139    
140                parameters.put(UifParameters.DATA_OBJECT_CLASS_NAME, implementationClass.getName());
141            }
142    
143            return UrlFactory.parameterizeUrl(baseUrl, parameters);
144        }
145    
146        /**
147         * Returns the base URL to use for inquiry requests to objects within the module
148         *
149         * @return String base inquiry URL
150         */
151        protected String getBaseInquiryUrl() {
152            return getKualiConfigurationService().getPropertyValueAsString(KRADConstants.KRAD_INQUIRY_URL_KEY);
153        }
154    
155        /**
156         * @see org.kuali.rice.krad.service.ModuleService#getExternalizableDataObjectLookupUrl(java.lang.Class,
157         * java.util.Properties)
158         */
159        public String getExternalizableDataObjectLookupUrl(Class<?> lookupDataObjectClass, Properties parameters) {
160            String baseUrl = getBaseLookupUrl();
161    
162            // if external business object, replace data object in request with the actual impl object class
163            if (ExternalizableBusinessObject.class.isAssignableFrom(lookupDataObjectClass)) {
164                Class implementationClass = getExternalizableBusinessObjectImplementation(lookupDataObjectClass.asSubclass(
165                        ExternalizableBusinessObject.class));
166                if (implementationClass == null) {
167                    throw new RuntimeException("Can't find ExternalizableBusinessObject implementation class for "
168                            + lookupDataObjectClass.getName());
169                }
170    
171                parameters.put(UifParameters.DATA_OBJECT_CLASS_NAME, implementationClass.getName());
172            }
173    
174            return UrlFactory.parameterizeUrl(baseUrl, parameters);
175        }
176    
177        /**
178         * Returns the base lookup URL for the Rice server
179         *
180         * @return String base lookup URL
181         */
182        protected String getRiceBaseLookupUrl() {
183            return BaseLookupUrlsHolder.remoteKradBaseLookupUrl;
184        }
185    
186        // Lazy initialization holder class idiom, see Effective Java item #71
187        protected static final class BaseLookupUrlsHolder {
188    
189            public static final String localKradBaseLookupUrl;
190            public static final String remoteKradBaseLookupUrl;
191    
192            static {
193                remoteKradBaseLookupUrl = KRADServiceLocator.getKualiConfigurationService().getPropertyValueAsString(KRADConstants.KRAD_SERVER_LOOKUP_URL_KEY);
194                localKradBaseLookupUrl = KRADServiceLocator.getKualiConfigurationService().getPropertyValueAsString(KRADConstants.KRAD_LOOKUP_URL_KEY);
195            }
196        }
197    
198        /**
199         * Returns the base URL to use for lookup requests to objects within the module
200         *
201         * @return String base lookup URL
202         */
203        protected String getBaseLookupUrl() {
204            return getRiceBaseLookupUrl();
205        }
206    
207        @Deprecated
208        public String getExternalizableBusinessObjectInquiryUrl(Class inquiryBusinessObjectClass,
209                Map<String, String[]> parameters) {
210            if (!isExternalizable(inquiryBusinessObjectClass)) {
211                return KRADConstants.EMPTY_STRING;
212            }
213            String businessObjectClassAttribute;
214    
215            Class implementationClass = getExternalizableBusinessObjectImplementation(inquiryBusinessObjectClass);
216            if (implementationClass == null) {
217                LOG.error("Can't find ExternalizableBusinessObject implementation class for " + inquiryBusinessObjectClass
218                        .getName());
219                throw new RuntimeException("Can't find ExternalizableBusinessObject implementation class for interface "
220                        + inquiryBusinessObjectClass.getName());
221            }
222            businessObjectClassAttribute = implementationClass.getName();
223            return UrlFactory.parameterizeUrl(getInquiryUrl(inquiryBusinessObjectClass), getUrlParameters(
224                    businessObjectClassAttribute, parameters));
225        }
226    
227        /**
228         * This overridden method ...
229         *
230         * @see org.kuali.rice.krad.service.ModuleService#getExternalizableBusinessObjectLookupUrl(java.lang.Class,
231         *      java.util.Map)
232         */
233        @Deprecated
234        @Override
235        public String getExternalizableBusinessObjectLookupUrl(Class inquiryBusinessObjectClass,
236                Map<String, String> parameters) {
237            Properties urlParameters = new Properties();
238    
239            String riceBaseUrl = KRADServiceLocator.getKualiConfigurationService().getPropertyValueAsString(
240                    KRADConstants.KUALI_RICE_URL_KEY);
241            String lookupUrl = riceBaseUrl;
242            if (!lookupUrl.endsWith("/")) {
243                lookupUrl = lookupUrl + "/";
244            }
245            if (parameters.containsKey(KRADConstants.MULTIPLE_VALUE)) {
246                lookupUrl = lookupUrl + KRADConstants.MULTIPLE_VALUE_LOOKUP_ACTION;
247            } else {
248                lookupUrl = lookupUrl + KRADConstants.LOOKUP_ACTION;
249            }
250            for (String paramName : parameters.keySet()) {
251                urlParameters.put(paramName, parameters.get(paramName));
252            }
253    
254            Class clazz = getExternalizableBusinessObjectImplementation(inquiryBusinessObjectClass);
255            urlParameters.put(KRADConstants.BUSINESS_OBJECT_CLASS_ATTRIBUTE, clazz == null ? "" : clazz.getName());
256    
257            return UrlFactory.parameterizeUrl(lookupUrl, urlParameters);
258        }
259    
260        /**
261         * @see org.kuali.rice.krad.service.ModuleService#getExternalizableBusinessObjectsListForLookup(java.lang.Class,
262         *      java.util.Map, boolean)
263         */
264        public <T extends ExternalizableBusinessObject> List<T> getExternalizableBusinessObjectsListForLookup(
265                Class<T> externalizableBusinessObjectClass, Map<String, Object> fieldValues, boolean unbounded) {
266            Class<? extends ExternalizableBusinessObject> implementationClass =
267                    getExternalizableBusinessObjectImplementation(externalizableBusinessObjectClass);
268            if (isExternalizableBusinessObjectLookupable(implementationClass)) {
269                Map<String, String> searchCriteria = new HashMap<String, String>();
270                for (Map.Entry<String, Object> fieldValue : fieldValues.entrySet()) {
271                    if (fieldValue.getValue() != null) {
272                        searchCriteria.put(fieldValue.getKey(), fieldValue.getValue().toString());
273                    } else {
274                        searchCriteria.put(fieldValue.getKey(), null);
275                    }
276                }
277                return (List<T>) getLookupService().findCollectionBySearchHelper(implementationClass, searchCriteria,
278                        unbounded);
279            } else {
280                throw new BusinessObjectNotLookupableException(
281                        "External business object is not a Lookupable:  " + implementationClass);
282            }
283        }
284    
285        /**
286         * This method assumes that the property type for externalizable relationship in the business object is an interface
287         * and gets the concrete implementation for it
288         *
289         * @see org.kuali.rice.krad.service.ModuleService#retrieveExternalizableBusinessObjectIfNecessary(org.kuali.rice.krad.bo.BusinessObject,
290         *      org.kuali.rice.krad.bo.BusinessObject, java.lang.String)
291         */
292        public <T extends ExternalizableBusinessObject> T retrieveExternalizableBusinessObjectIfNecessary(
293                BusinessObject businessObject, T currentInstanceExternalizableBO, String externalizableRelationshipName) {
294    
295            if (businessObject == null) {
296                return null;
297            }
298            Class clazz;
299            try {
300                clazz = getExternalizableBusinessObjectImplementation(PropertyUtils.getPropertyType(businessObject,
301                        externalizableRelationshipName));
302            } catch (Exception iex) {
303                LOG.warn("Exception:"
304                        + iex
305                        + " thrown while trying to get property type for property:"
306                        + externalizableRelationshipName
307                        + " from business object:"
308                        + businessObject);
309                return null;
310            }
311    
312            //Get the business object entry for this business object from data dictionary
313            //using the class name (without the package) as key
314            BusinessObjectEntry entry =
315                    KRADServiceLocatorWeb.getDataDictionaryService().getDataDictionary().getBusinessObjectEntries().get(
316                            businessObject.getClass().getSimpleName());
317            RelationshipDefinition relationshipDefinition = entry.getRelationshipDefinition(externalizableRelationshipName);
318            List<PrimitiveAttributeDefinition> primitiveAttributeDefinitions =
319                    relationshipDefinition.getPrimitiveAttributes();
320    
321            Map<String, Object> fieldValuesInEBO = new HashMap<String, Object>();
322            Object sourcePropertyValue;
323            Object targetPropertyValue = null;
324            boolean sourceTargetPropertyValuesSame = true;
325            for (PrimitiveAttributeDefinition primitiveAttributeDefinition : primitiveAttributeDefinitions) {
326                sourcePropertyValue = ObjectUtils.getPropertyValue(businessObject,
327                        primitiveAttributeDefinition.getSourceName());
328                if (currentInstanceExternalizableBO != null) {
329                    targetPropertyValue = ObjectUtils.getPropertyValue(currentInstanceExternalizableBO,
330                            primitiveAttributeDefinition.getTargetName());
331                }
332                if (sourcePropertyValue == null) {
333                    return null;
334                } else if (targetPropertyValue == null || (targetPropertyValue != null && !targetPropertyValue.equals(
335                        sourcePropertyValue))) {
336                    sourceTargetPropertyValuesSame = false;
337                }
338                fieldValuesInEBO.put(primitiveAttributeDefinition.getTargetName(), sourcePropertyValue);
339            }
340    
341            if (!sourceTargetPropertyValuesSame) {
342                return (T) getExternalizableBusinessObject(clazz, fieldValuesInEBO);
343            }
344            return currentInstanceExternalizableBO;
345        }
346    
347        /**
348         * This method assumes that the externalizableClazz is an interface
349         * and gets the concrete implementation for it
350         *
351         * @see org.kuali.rice.krad.service.ModuleService#retrieveExternalizableBusinessObjectIfNecessary(org.kuali.rice.krad.bo.BusinessObject,
352         *      org.kuali.rice.krad.bo.BusinessObject, java.lang.String)
353         */
354        @Override
355        public List<? extends ExternalizableBusinessObject> retrieveExternalizableBusinessObjectsList(
356                BusinessObject businessObject, String externalizableRelationshipName, Class externalizableClazz) {
357    
358            if (businessObject == null) {
359                return null;
360            }
361            //Get the business object entry for this business object from data dictionary
362            //using the class name (without the package) as key
363            String className = businessObject.getClass().getName();
364            String key = className.substring(className.lastIndexOf(".") + 1);
365            BusinessObjectEntry entry =
366                    KRADServiceLocatorWeb.getDataDictionaryService().getDataDictionary().getBusinessObjectEntries().get(
367                            key);
368            RelationshipDefinition relationshipDefinition = entry.getRelationshipDefinition(externalizableRelationshipName);
369            List<PrimitiveAttributeDefinition> primitiveAttributeDefinitions =
370                    relationshipDefinition.getPrimitiveAttributes();
371            Map<String, Object> fieldValuesInEBO = new HashMap<String, Object>();
372            Object sourcePropertyValue;
373            for (PrimitiveAttributeDefinition primitiveAttributeDefinition : primitiveAttributeDefinitions) {
374                sourcePropertyValue = ObjectUtils.getPropertyValue(businessObject,
375                        primitiveAttributeDefinition.getSourceName());
376                if (sourcePropertyValue == null) {
377                    return null;
378                }
379                fieldValuesInEBO.put(primitiveAttributeDefinition.getTargetName(), sourcePropertyValue);
380            }
381            return getExternalizableBusinessObjectsList(getExternalizableBusinessObjectImplementation(externalizableClazz),
382                    fieldValuesInEBO);
383        }
384    
385        /**
386         * @see org.kuali.rice.krad.service.ModuleService#getExternalizableBusinessObjectImplementation(java.lang.Class)
387         */
388        @Override
389        public <E extends ExternalizableBusinessObject> Class<E> getExternalizableBusinessObjectImplementation(
390                Class<E> externalizableBusinessObjectInterface) {
391            if (getModuleConfiguration() == null) {
392                throw new IllegalStateException("Module configuration has not been initialized for the module service.");
393            }
394            Map<Class, Class> ebos = getModuleConfiguration().getExternalizableBusinessObjectImplementations();
395            if (ebos == null) {
396                return null;
397            }
398            if (ebos.containsValue(externalizableBusinessObjectInterface)) {
399                return externalizableBusinessObjectInterface;
400            } else {
401                Class<E> implementationClass = ebos.get(externalizableBusinessObjectInterface);
402                int implClassModifiers = implementationClass.getModifiers();
403                if (Modifier.isInterface(implClassModifiers) || Modifier.isAbstract(implClassModifiers)) {
404                    throw new RuntimeException("Implementation class must be non-abstract class: ebo interface: "
405                            + externalizableBusinessObjectInterface.getName()
406                            + " impl class: "
407                            + implementationClass.getName()
408                            + " module: "
409                            + getModuleConfiguration().getNamespaceCode());
410                }
411                return implementationClass;
412            }
413    
414        }
415    
416        @Deprecated
417        protected Properties getUrlParameters(String businessObjectClassAttribute, Map<String, String[]> parameters) {
418            Properties urlParameters = new Properties();
419            for (String paramName : parameters.keySet()) {
420                String[] parameterValues = parameters.get(paramName);
421                if (parameterValues.length > 0) {
422                    urlParameters.put(paramName, parameterValues[0]);
423                }
424            }
425            urlParameters.put(KRADConstants.BUSINESS_OBJECT_CLASS_ATTRIBUTE, businessObjectClassAttribute);
426            urlParameters.put(KRADConstants.DISPATCH_REQUEST_PARAMETER, KRADConstants.CONTINUE_WITH_INQUIRY_METHOD_TO_CALL);
427            return urlParameters;
428        }
429    
430        @Deprecated
431        protected String getInquiryUrl(Class inquiryBusinessObjectClass) {
432            String riceBaseUrl = KRADServiceLocator.getKualiConfigurationService().getPropertyValueAsString(
433                    KRADConstants.KUALI_RICE_URL_KEY);
434            String inquiryUrl = riceBaseUrl;
435            if (!inquiryUrl.endsWith("/")) {
436                inquiryUrl = inquiryUrl + "/";
437            }
438            return inquiryUrl + KRADConstants.INQUIRY_ACTION;
439        }
440    
441        /**
442         * @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet()
443         */
444        public void afterPropertiesSet() throws Exception {
445            KualiModuleService kualiModuleService = null;
446            try {
447                kualiModuleService = KRADServiceLocatorWeb.getKualiModuleService();
448                if (kualiModuleService == null) {
449                    kualiModuleService = ((KualiModuleService) applicationContext.getBean(
450                            KRADServiceLocatorWeb.KUALI_MODULE_SERVICE));
451                }
452            } catch (NoSuchBeanDefinitionException ex) {
453                kualiModuleService = ((KualiModuleService) applicationContext.getBean(
454                        KRADServiceLocatorWeb.KUALI_MODULE_SERVICE));
455            }
456            kualiModuleService.getInstalledModuleServices().add(this);
457        }
458    
459        /**
460         * @return the moduleConfiguration
461         */
462        public ModuleConfiguration getModuleConfiguration() {
463            return this.moduleConfiguration;
464        }
465    
466        /**
467         * @param moduleConfiguration the moduleConfiguration to set
468         */
469        public void setModuleConfiguration(ModuleConfiguration moduleConfiguration) {
470            this.moduleConfiguration = moduleConfiguration;
471        }
472    
473        /**
474         * @see org.kuali.rice.krad.service.ModuleService#isExternalizable(java.lang.Class)
475         */
476        @Override
477        public boolean isExternalizable(Class boClazz) {
478            if (boClazz == null) {
479                return false;
480            }
481            return ExternalizableBusinessObject.class.isAssignableFrom(boClazz);
482        }
483    
484        public <T extends ExternalizableBusinessObject> T createNewObjectFromExternalizableClass(Class<T> boClass) {
485            try {
486                return (T) getExternalizableBusinessObjectImplementation(boClass).newInstance();
487            } catch (Exception e) {
488                throw new RuntimeException("Unable to create externalizable business object class", e);
489            }
490        }
491    
492        public DataObjectRelationship getBusinessObjectRelationship(Class boClass, String attributeName,
493                String attributePrefix) {
494            return null;
495        }
496    
497    
498        /**
499         * @return the kualiModuleService
500         */
501        public KualiModuleService getKualiModuleService() {
502            return this.kualiModuleService;
503        }
504    
505        /**
506         * @param kualiModuleService the kualiModuleService to set
507         */
508        public void setKualiModuleService(KualiModuleService kualiModuleService) {
509            this.kualiModuleService = kualiModuleService;
510        }
511    
512        protected ConfigurationService getKualiConfigurationService() {
513            if (this.kualiConfigurationService == null) {
514                this.kualiConfigurationService = KRADServiceLocator.getKualiConfigurationService();
515            }
516    
517            return this.kualiConfigurationService;
518        }
519    
520        public void setKualiConfigurationService(ConfigurationService kualiConfigurationService) {
521            this.kualiConfigurationService = kualiConfigurationService;
522        }
523    
524        /**
525         * @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
526         */
527        @Override
528        public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
529            this.applicationContext = applicationContext;
530        }
531    
532        /**
533         * This overridden method ...
534         *
535         * @see org.kuali.rice.krad.service.ModuleService#listAlternatePrimaryKeyFieldNames(java.lang.Class)
536         */
537        @Override
538        public List<List<String>> listAlternatePrimaryKeyFieldNames(Class businessObjectInterfaceClass) {
539            return null;
540        }
541    
542        /**
543         * This method determines whether or not this module is currently locked
544         *
545         * @see org.kuali.rice.krad.service.ModuleService#isLocked()
546         */
547        @Override
548        public boolean isLocked() {
549            ModuleConfiguration configuration = this.getModuleConfiguration();
550            if (configuration != null) {
551                String namespaceCode = configuration.getNamespaceCode();
552                String componentCode = KRADConstants.DetailTypes.ALL_DETAIL_TYPE;
553                String parameterName = KRADConstants.SystemGroupParameterNames.OLTP_LOCKOUT_ACTIVE_IND;
554                ParameterService parameterService = CoreFrameworkServiceLocator.getParameterService();
555                String shouldLockout = parameterService.getParameterValueAsString(namespaceCode, componentCode,
556                        parameterName);
557                if (StringUtils.isNotBlank(shouldLockout)) {
558                    return parameterService.getParameterValueAsBoolean(namespaceCode, componentCode, parameterName);
559                }
560            }
561            return false;
562        }
563    
564        /**
565         * Gets the lookupService attribute.
566         *
567         * @return Returns the lookupService.
568         */
569        protected LookupService getLookupService() {
570            return lookupService != null ? lookupService : KRADServiceLocatorWeb.getLookupService();
571        }
572        
573        @Override
574        public boolean goToCentralRiceForInquiry() { 
575            return false;
576        }
577    }