本文整理汇总了Java中org.ofbiz.minilang.MiniLangException.getMessage方法的典型用法代码示例。如果您正苦于以下问题:Java MiniLangException.getMessage方法的具体用法?Java MiniLangException.getMessage怎么用?Java MiniLangException.getMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.ofbiz.minilang.MiniLangException
的用法示例。
在下文中一共展示了MiniLangException.getMessage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSubContentCache
import org.ofbiz.minilang.MiniLangException; //导入方法依赖的package包/类
public static GenericValue getSubContentCache(Delegator delegator, String contentId, String mapKey, GenericValue userLogin, List<String> assocTypes, Timestamp fromDate, Boolean nullThruDatesOnly, String contentAssocPredicateId) throws GenericEntityException {
//GenericValue content = null;
GenericValue view = null;
if (contentId == null) {
Debug.logError("ContentId is null", module);
return view;
}
Map<String, Object> results = null;
List<String> contentTypes = null;
try {
// NOTE DEJ20060610: Changed "From" to "To" because it makes the most sense for sub-content renderings using a root-contentId and mapKey to determine the sub-contentId to have the ContentAssoc go from the root to the sub, ie try to determine the contentIdTo from the contentId and mapKey
// This shouldn't be changed from "To" to "From", but if desired could be parameterized to make this selectable in higher up calling methods
results = ContentServicesComplex.getAssocAndContentAndDataResourceCacheMethod(delegator, contentId, mapKey, "To", fromDate, null, assocTypes, contentTypes, nullThruDatesOnly, contentAssocPredicateId, null);
} catch (MiniLangException e) {
throw new RuntimeException(e.getMessage());
}
List<GenericValue> entityList = UtilGenerics.checkList(results.get("entityList"));
if (UtilValidate.isEmpty(entityList)) {
//throw new IOException("No subcontent found.");
} else {
view = entityList.get(0);
}
return view;
}
示例2: selectKids
import org.ofbiz.minilang.MiniLangException; //导入方法依赖的package包/类
public static void selectKids(Map<String, Object> currentNode, Map<String, Object> ctx) {
Delegator delegator = (Delegator) ctx.get("delegator");
GenericValue parentContent = (GenericValue) currentNode.get("value");
String contentAssocTypeId = (String) ctx.get("contentAssocTypeId");
String contentTypeId = (String) ctx.get("contentTypeId");
String mapKey = (String) ctx.get("mapKey");
String parentContentId = (String) parentContent.get("contentId");
//if (Debug.infoOn()) Debug.logInfo("traverse, contentAssocTypeId:" + contentAssocTypeId,null);
Map<String, Object> whenMap = UtilGenerics.checkMap(ctx.get("whenMap"));
List<Map<String, Object>> kids = FastList.newInstance();
currentNode.put("kids", kids);
String direction = (String) ctx.get("direction");
if (UtilValidate.isEmpty(direction)) {
direction = "From";
}
// Timestamp fromDate = (Timestamp) ctx.get("fromDate");
// Timestamp thruDate = (Timestamp) ctx.get("thruDate");
List<String> assocTypeList = StringUtil.split(contentAssocTypeId, " ");
List<String> contentTypeList = StringUtil.split(contentTypeId, " ");
String contentAssocPredicateId = null;
Boolean nullThruDatesOnly = Boolean.TRUE;
Map<String, Object> results = null;
try {
results = ContentServicesComplex.getAssocAndContentAndDataResourceCacheMethod(delegator, parentContentId, mapKey, direction, null, null, assocTypeList, contentTypeList, nullThruDatesOnly, contentAssocPredicateId, null);
} catch (GenericEntityException e) {
throw new RuntimeException(e.getMessage());
} catch (MiniLangException e2) {
throw new RuntimeException(e2.getMessage());
}
List<GenericValue> relatedViews = UtilGenerics.checkList(results.get("entityList"));
//if (Debug.infoOn()) Debug.logInfo("traverse, relatedViews:" + relatedViews,null);
for (GenericValue assocValue : relatedViews) {
Map<String, Object> thisNode = ContentWorker.makeNode(assocValue);
checkConditions(delegator, thisNode, null, whenMap);
// boolean isReturnBeforePick = booleanDataType(thisNode.get("isReturnBeforePick"));
// boolean isReturnAfterPick = booleanDataType(thisNode.get("isReturnAfterPick"));
// boolean isFollow = booleanDataType(thisNode.get("isFollow"));
boolean isPick = booleanDataType(thisNode.get("isPick"));
kids.add(thisNode);
if (isPick) {
Integer count = (Integer) currentNode.get("count");
if (count == null) {
count = Integer.valueOf(1);
} else {
count = Integer.valueOf(count.intValue() + 1);
}
currentNode.put("count", count);
}
}
}