Package org.kuali.rice.krad.bo

Examples of org.kuali.rice.krad.bo.DataObjectRelationship


                }
            }
        }

        // if not title, then get primary relationship
        DataObjectRelationship relationship = null;
        if (inquiryObjectClass == null) {
            relationship = getDataObjectMetaDataService().getDataObjectRelationship(dataObject, objectClass,
                    propertyName, "", true, false, true);
            if (relationship != null) {
                inquiryObjectClass = relationship.getRelatedClass();
                inquiryDataObject = ObjectUtils.getNestedValue(dataObject, propertyName);
            }
        }

        // if haven't found inquiry class, then no inquiry can be rendered
        if (inquiryObjectClass == null) {
            inquiry.setRender(false);

            return;
        } else if (inquiryDataObject != null) {
          if (Matter.class.isAssignableFrom(inquiryDataObject.getClass())) {
            try {
              final String concreteClass = ((Matter)inquiryDataObject).getConcreteClass();
              if (!StringUtils.isEmpty(concreteClass)) {
                inquiryObjectClass = Class.forName(concreteClass);
              }
        } catch (ClassNotFoundException e) {
          log.error(e.getMessage());
        }
          }
        }

        if (DocumentHeader.class.isAssignableFrom(inquiryObjectClass)) {
            String documentNumber = (String) ObjectUtils.getPropertyValue(dataObject, propertyName);
            if (StringUtils.isNotBlank(documentNumber)) {
                inquiry.getInquiryLink().setHref(getConfigurationService().getPropertyValueAsString(
                        KRADConstants.WORKFLOW_URL_KEY)
                        + KRADConstants.DOCHANDLER_DO_URL
                        + documentNumber
                        + KRADConstants.DOCHANDLER_URL_CHUNK);
                inquiry.getInquiryLink().setLinkText(documentNumber);
                inquiry.setRender(true);
            }

            return;
        }

        synchronized (SUPER_CLASS_TRANSLATOR_LIST) {
            for (Class<?> clazz : SUPER_CLASS_TRANSLATOR_LIST) {
                if (clazz.isAssignableFrom(inquiryObjectClass)) {
                    inquiryObjectClass = clazz;
                    break;
                }
            }
        }

        if (!inquiryObjectClass.isInterface() && ExternalizableBusinessObject.class.isAssignableFrom(
                inquiryObjectClass)) {
            inquiryObjectClass = ExternalizableBusinessObjectUtils.determineExternalizableBusinessObjectSubInterface(
                    inquiryObjectClass);
        }

        // listPrimaryKeyFieldNames returns an unmodifiable list. So a copy is necessary.
        List<String> keys = new ArrayList<String>(getDataObjectMetaDataService().listPrimaryKeyFieldNames(
                inquiryObjectClass));

        if (keys == null) {
            keys = Collections.emptyList();
        }

        // build inquiry parameter mappings
        Map<String, String> inquiryParameters = new HashMap<String, String>();
        for (String keyName : keys) {
            String keyConversion = keyName;
            if (relationship != null) {
                keyConversion = relationship.getParentAttributeForChildAttribute(keyName);
            } else if (ObjectUtils.isNestedAttribute(propertyName)) {
                String nestedAttributePrefix = ObjectUtils.getNestedAttributePrefix(propertyName);
                keyConversion = nestedAttributePrefix + "." + keyName;
            }
View Full Code Here

TOP

Related Classes of org.kuali.rice.krad.bo.DataObjectRelationship

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.