本文整理汇总了Java中com.ibm.xsp.extlib.util.ExtLibUtil.getRequestScope方法的典型用法代码示例。如果您正苦于以下问题:Java ExtLibUtil.getRequestScope方法的具体用法?Java ExtLibUtil.getRequestScope怎么用?Java ExtLibUtil.getRequestScope使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.ibm.xsp.extlib.util.ExtLibUtil
的用法示例。
在下文中一共展示了ExtLibUtil.getRequestScope方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getNavigator
import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的package包/类
protected ViewNavigator getNavigator() {
final Map<String, Object> requestScope = ExtLibUtil.getRequestScope();
final String key = "viewnav-" + this.toString();
if (!requestScope.containsKey(key)) {
requestScope.put(key, getNewNavigator());
}
return (ViewNavigator) requestScope.get(key);
}
示例2: getEntries
import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的package包/类
protected ViewEntryCollection getEntries() {
final Map<String, Object> requestScope = ExtLibUtil.getRequestScope();
final String key = "viewentries-" + this.toString();
if (!requestScope.containsKey(key)) {
View view = getView();
if (getResortColumn() != null) {
view.FTSearchSorted(searchQuery_, 0, getResortColumn(), isAscending(), false, false, false);
} else {
view.FTSearch(searchQuery_);
}
requestScope.put(key, view.getAllEntries());
}
return (ViewEntryCollection) requestScope.get(key);
}
示例3: clearCache
import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的package包/类
public final void clearCache() {
getCache().clear();
getView().refresh();
final Map<String, Object> requestScope = ExtLibUtil.getRequestScope();
String thisToString = this.toString();
requestScope.remove("viewnav-" + thisToString);
requestScope.remove("viewentries-" + thisToString);
requestScope.remove("lastFetchedIndex-" + thisToString);
}
示例4: getCache
import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private Map<Integer, E> getCache() {
Map<String, Object> cacheScope = ExtLibUtil.getRequestScope();
String key = toString() + "_entrycache";
if (!cacheScope.containsKey(key)) {
cacheScope.put(key, new HashMap<Integer, E>());
}
return (Map<Integer, E>) cacheScope.get(key);
}
示例5: getEntries
import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的package包/类
protected ViewEntryCollection getEntries() {
final Map<String, Object> requestScope = ExtLibUtil.getRequestScope();
final String key = "viewentries-" + this.toString();
if (!requestScope.containsKey(key)) {
View view = getView();
if (sortColumn_ != null) {
view.FTSearchSorted(searchQuery_, 0, sortColumn_, ascending_, false, false, false);
} else {
view.FTSearch(searchQuery_);
}
requestScope.put(key, view.getAllEntries());
}
return (ViewEntryCollection) requestScope.get(key);
}
示例6: get
import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
public E get(final int index) {
if(invalid_) { return null; }
if (!getCache().containsKey(index)) {
try {
if (searchQuery_ == null || searchQuery_.isEmpty()) {
ViewNavigator nav = getNavigator();
// getNth is top-level only, so let's skip to what we need
int lastFetchedIndex = 0;
Map<String, Object> requestScope = ExtLibUtil.getRequestScope();
String key = "lastFetchedIndex-" + toString();
if (requestScope.containsKey(key)) {
lastFetchedIndex = (Integer) requestScope.get(key);
}
nav.skip(index - lastFetchedIndex);
requestScope.put(key, index);
// If we're in a collapsed category, we have to skip further
// TODO make this work with multi-level categories
try {
getCache().put(index, createFromViewEntry(nav.getCurrent(), columnInfo_));
} catch(NullPointerException npe) {
// Then we've probably hit an "Object has been removed or recycled" on the nav
if(!reset_) {
reset_ = true;
clearCache();
return get(index);
}
System.out.println("=============================== NPE in DominoModelList");
System.out.println("=============================== Current class: " + getClass().getName());
System.out.println("=============================== Desired index: " + index);
System.out.println("=============================== Current cache: " + getCache());
System.out.println("=============================== Current reported size: " + size());
throw npe;
}
} else {
ViewEntryCollection vec = getEntries();
getCache().put(index, createFromViewEntry(vec.getNthEntry(index + 1), columnInfo_));
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
return getCache().get(index);
}
示例7: get
import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
public E get(final int index) {
if(invalid_) { return null; }
if (!getCache().containsKey(index)) {
try {
if (searchQuery_ == null || searchQuery_.isEmpty()) {
ViewNavigator nav = getNavigator();
// getNth is top-level only, so let's skip to what we need
int lastFetchedIndex = 0;
Map<String, Object> requestScope = ExtLibUtil.getRequestScope();
String key = "lastFetchedIndex-" + toString();
if (requestScope.containsKey(key)) {
lastFetchedIndex = (Integer) requestScope.get(key);
}
nav.skip(index - lastFetchedIndex);
requestScope.put(key, index);
// If we're in a collapsed category, we have to skip further
// TODO make this work with multi-level categories
try {
// Test to see if the nav itself is the problem in the NPE
// @SuppressWarnings("unused")
//int count = nav.getCount();
ViewEntry current = nav.getCurrent();
String currentPosition = current.getPosition('.');
if (currentPosition.contains(".")) {
int topLevel = Integer.valueOf(ModelUtils.strLeft(currentPosition, "."));
for (String position : collapsedPositions_.keySet()) {
int collapseIndex = Integer.valueOf(position.contains(".") ? ModelUtils.strLeft(position, ".") : position);
if (currentPosition.startsWith(position + ".")) {
//int skipCount = current.getSiblingCount() - Integer.valueOf(ModelUtils.strRightBack(currentPosition, ".")) + 1;
//nav.skip(skipCount);
//break;
}
if (collapseIndex <= topLevel) {
nav.skip(collapsedPositions_.get(position));
}
}
}
//getCache().put(index, createFromViewEntry(nav.getNth(index + 1), columnInfo_));
getCache().put(index, createFromViewEntry(nav.getCurrent(), columnInfo_));
// System.out.println("fetched index " + index + ", which is pos " + nav.getCurrent().getPosition('.'));
// nav.skip(1);
} catch(NullPointerException npe) {
// Then we've probably hit an "Object has been removed or recycled" on the nav
System.out.println("=============================== NPE in DominoModelList");
System.out.println("=============================== Current class: " + getClass().getName());
System.out.println("=============================== Desired index: " + index);
System.out.println("=============================== Current cache: " + getCache());
System.out.println("=============================== Current reported size: " + size());
throw npe;
}
} else {
ViewEntryCollection vec = getEntries();
getCache().put(index, createFromViewEntry(vec.getNthEntry(index + 1), columnInfo_));
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
return getCache().get(index);
}