本文整理汇总了Java中org.kuali.rice.krad.util.KRADUtils.getPropertyKeyValuesFromDataObject方法的典型用法代码示例。如果您正苦于以下问题:Java KRADUtils.getPropertyKeyValuesFromDataObject方法的具体用法?Java KRADUtils.getPropertyKeyValuesFromDataObject怎么用?Java KRADUtils.getPropertyKeyValuesFromDataObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.krad.util.KRADUtils
的用法示例。
在下文中一共展示了KRADUtils.getPropertyKeyValuesFromDataObject方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMaintenanceActionUrl
import org.kuali.rice.krad.util.KRADUtils; //导入方法依赖的package包/类
@Override
protected String getMaintenanceActionUrl(LookupForm lookupForm, Object dataObject, String methodToCall,
List<String> pkNames) {
Properties props = new Properties();
props.put(KRADConstants.DISPATCH_REQUEST_PARAMETER, methodToCall);
Map<String, String> primaryKeyValues = KRADUtils.getPropertyKeyValuesFromDataObject(pkNames, dataObject);
for (String primaryKey : primaryKeyValues.keySet()) {
String primaryKeyValue = primaryKeyValues.get(primaryKey);
props.put(primaryKey, primaryKeyValue);
props.put(KRADConstants.OVERRIDE_KEYS, primaryKey);
}
if (StringUtils.isNotBlank(lookupForm.getReturnLocation())) {
props.put(KRADConstants.RETURN_LOCATION_PARAMETER, lookupForm.getReturnLocation());
}
props.put(UifParameters.DATA_OBJECT_CLASS_NAME, PropositionBo.class.getName());
props.put(UifParameters.VIEW_TYPE_NAME, UifConstants.ViewType.MAINTENANCE.name());
return UrlFactory.parameterizeUrl(org.kuali.rice.krms.impl.util.KrmsImplConstants.WebPaths.PROPOSITION_PATH, props);
}
示例2: getMaintenanceActionUrl
import org.kuali.rice.krad.util.KRADUtils; //导入方法依赖的package包/类
@Override
protected String getMaintenanceActionUrl(LookupForm lookupForm, Object dataObject, String methodToCall,
List<String> pkNames) {
Properties props = new Properties();
props.put(KRADConstants.DISPATCH_REQUEST_PARAMETER, methodToCall);
Map<String, String> primaryKeyValues = KRADUtils.getPropertyKeyValuesFromDataObject(pkNames, dataObject);
for (String primaryKey : primaryKeyValues.keySet()) {
String primaryKeyValue = primaryKeyValues.get(primaryKey);
props.put(primaryKey, primaryKeyValue);
props.put(KRADConstants.OVERRIDE_KEYS, primaryKey);
}
if (StringUtils.isNotBlank(lookupForm.getReturnLocation())) {
props.put(KRADConstants.RETURN_LOCATION_PARAMETER, lookupForm.getReturnLocation());
}
props.put(UifParameters.DATA_OBJECT_CLASS_NAME, AgendaEditor.class.getName());
props.put(UifParameters.VIEW_TYPE_NAME, UifConstants.ViewType.MAINTENANCE.name());
return UrlFactory.parameterizeUrl(org.kuali.rice.krms.impl.util.KrmsImplConstants.WebPaths.AGENDA_EDITOR_PATH, props);
}
示例3: getReturnKeyValues
import org.kuali.rice.krad.util.KRADUtils; //导入方法依赖的package包/类
/**
* Returns a map of the configured return keys with their selected values.
*
* @param lookupView lookup view instance containing lookup configuration
* @param lookupForm lookup form instance containing the data
* @param dataObject data object instance
* @return Map<String, String> map of return key/value pairs
*/
protected Map<String, String> getReturnKeyValues(LookupView lookupView, LookupForm lookupForm, Object dataObject) {
List<String> returnKeys;
if (lookupForm.getFieldConversions() != null && !lookupForm.getFieldConversions().isEmpty()) {
returnKeys = new ArrayList<String>(lookupForm.getFieldConversions().keySet());
} else {
returnKeys = getLegacyDataAdapter().listPrimaryKeyFieldNames(getDataObjectClass());
}
List<String> secureReturnKeys = lookupView.getAdditionalSecurePropertyNames();
return KRADUtils.getPropertyKeyValuesFromDataObject(returnKeys, secureReturnKeys, dataObject);
}
示例4: getMaintenanceActionUrl
import org.kuali.rice.krad.util.KRADUtils; //导入方法依赖的package包/类
/**
* Generates a URL to perform a maintenance action on the given result data object.
*
* <p>Will build a URL containing keys of the data object to invoke the given maintenance action method
* within the maintenance controller</p>
*
* @param lookupForm lookup form
* @param dataObject data object instance for the line to build the maintenance action link for
* @param methodToCall method name on the maintenance controller that should be invoked
* @param pkNames list of primary key field names for the data object whose key/value pairs will be added to
* the maintenance link
* @return String URL link for the maintenance action
*/
protected String getMaintenanceActionUrl(LookupForm lookupForm, Object dataObject, String methodToCall,
List<String> pkNames) {
LookupView lookupView = (LookupView) lookupForm.getView();
Properties props = new Properties();
props.put(KRADConstants.DISPATCH_REQUEST_PARAMETER, methodToCall);
Map<String, String> primaryKeyValues = KRADUtils.getPropertyKeyValuesFromDataObject(pkNames, dataObject);
for (String primaryKey : primaryKeyValues.keySet()) {
String primaryKeyValue = primaryKeyValues.get(primaryKey);
props.put(primaryKey, primaryKeyValue);
}
if (StringUtils.isNotBlank(lookupForm.getReturnLocation())) {
props.put(KRADConstants.RETURN_LOCATION_PARAMETER, lookupForm.getReturnLocation());
}
props.put(UifParameters.DATA_OBJECT_CLASS_NAME, lookupForm.getDataObjectClassName());
props.put(UifParameters.VIEW_TYPE_NAME, UifConstants.ViewType.MAINTENANCE.name());
String maintenanceMapping = KRADConstants.Maintenance.REQUEST_MAPPING_MAINTENANCE;
if (lookupView != null && StringUtils.isNotBlank(lookupView.getMaintenanceUrlMapping())) {
maintenanceMapping = lookupView.getMaintenanceUrlMapping();
}
return UrlFactory.parameterizeUrl(maintenanceMapping, props);
}
示例5: buildMaintenanceActionLink
import org.kuali.rice.krad.util.KRADUtils; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void buildMaintenanceActionLink(Link actionLink, Object model, String maintenanceMethodToCall) {
LookupForm lookupForm = (LookupForm) model;
Map<String, Object> actionLinkContext = actionLink.getContext();
Object dataObject = actionLinkContext == null ? null : actionLinkContext.get(
UifConstants.ContextVariableNames.LINE);
List<String> pkNames = getLegacyDataAdapter().listPrimaryKeyFieldNames(getDataObjectClass());
// build maintenance link href if needed
if (StringUtils.isBlank(actionLink.getHref())) {
String href = getMaintenanceActionUrl(lookupForm, dataObject, maintenanceMethodToCall, pkNames);
if (StringUtils.isBlank(href)) {
actionLink.setRender(false);
return;
}
actionLink.setHref(href);
}
// build action title if not set
if (StringUtils.isBlank(actionLink.getTitle())) {
List<String> linkLabels = new ArrayList<String>();
// get the link text
String linkText = actionLink.getLinkText();
// if the link text is available, then add it to the link label
if (StringUtils.isNotBlank(linkText)) {
linkLabels.add(linkText);
}
// get the data object label
DataObjectEntry dataObjectEntry = getDataDictionaryService().getDataDictionary().getDataObjectEntry(
getDataObjectClass().getName());
String dataObjectLabel = dataObjectEntry != null ? dataObjectEntry.getObjectLabel() : null;
// if the data object label is available, then add it to the link label
if (StringUtils.isNotBlank(dataObjectLabel)) {
linkLabels.add(dataObjectLabel);
}
// get the prepend text
String titleActionUrlPrependText = getConfigurationService().getPropertyValueAsString(
KRADConstants.Lookup.TITLE_ACTION_URL_PREPENDTEXT_PROPERTY);
// get the primary keys for the object
Map<String, String> primaryKeyValues = KRADUtils.getPropertyKeyValuesFromDataObject(pkNames, dataObject);
// if the prepend text is available and there are primary key values, then add it to the link label
if (StringUtils.isNotBlank(titleActionUrlPrependText) && !primaryKeyValues.isEmpty()) {
linkLabels.add(titleActionUrlPrependText);
}
String linkLabel = StringUtils.defaultIfBlank(StringUtils.join(linkLabels, " "), StringUtils.EMPTY);
String title = KRADUtils.buildAttributeTitleString(linkLabel, getDataObjectClass(), primaryKeyValues);
actionLink.setTitle(title);
}
}