本文整理了Java中org.dspace.app.util.Util.getIntParameter()
方法的一些代码示例,展示了Util.getIntParameter()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.getIntParameter()
方法的具体详情如下:
包路径:org.dspace.app.util.Util
类名称:Util
方法名:getIntParameter
[英]Obtain a parameter from the given request as an int. -1
is returned if the parameter is garbled or does not exist.
[中]以int形式从给定请求获取参数。-1
在参数被篡改或不存在时返回。
代码示例来源:origin: org.dspace/dspace-xmlui-api
private XmlWorkflowItem retrieveWorkflowItem(Request request, Context context) throws SQLException, AuthorizeException, IOException {
int workflowItemId = Util.getIntParameter(request, "wfiId");
return XmlWorkflowItem.find(context, workflowItemId);
}
}
代码示例来源:origin: org.dspace/dspace-discovery-xmlui-api
private String getPreviousPageURL(SearchFilterParam browseParams, Request request) {
//If our offset should be 0 then we shouldn't be able to view a previous page url
if (0 == queryArgs.getFacetOffset() && Util.getIntParameter(request, "offset") == -1)
{
return null;
}
int offset = Util.getIntParameter(request, SearchFilterParam.OFFSET);
if(offset == -1 || offset == 0)
{
return null;
}
Map<String, String> parameters = new HashMap<String, String>();
parameters.putAll(browseParams.getCommonBrowseParams());
parameters.putAll(browseParams.getControlParameters());
parameters.put(SearchFilterParam.OFFSET, String.valueOf(offset - DEFAULT_PAGE_SIZE));
//TODO: correct comm/collection url
// Add the filter queries
String url = generateURL("search-filter", parameters);
url = addFilterQueriesToUrl(url);
return url;
}
代码示例来源:origin: org.dspace/dspace-discovery-xmlui-api
private String getNextPageURL(SearchFilterParam browseParams, Request request) {
int offSet = Util.getIntParameter(request, SearchFilterParam.OFFSET);
if (offSet == -1)
{
offSet = 0;
}
Map<String, String> parameters = new HashMap<String, String>();
parameters.putAll(browseParams.getCommonBrowseParams());
parameters.putAll(browseParams.getControlParameters());
parameters.put(SearchFilterParam.OFFSET, String.valueOf(offSet + DEFAULT_PAGE_SIZE));
//TODO: correct comm/collection url
// Add the filter queries
String url = generateURL("search-filter", parameters);
url = addFilterQueriesToUrl(url);
return url;
}
代码示例来源:origin: DSpace/DSpace
@Override
public ActionResult execute(Context c, XmlWorkflowItem wfi, Step step, HttpServletRequest request)
throws SQLException, AuthorizeException, IOException {
int page = Util.getIntParameter(request, "page");
switch (page) {
case MAIN_PAGE:
return processMainPage(c, wfi, step, request);
case REJECT_PAGE:
return processRejectPage(c, wfi, step, request);
default:
return new ActionResult(ActionResult.TYPE.TYPE_CANCEL);
}
}
代码示例来源:origin: DSpace/DSpace
@Override
public ActionResult execute(Context c, XmlWorkflowItem wfi, Step step, HttpServletRequest request)
throws SQLException, AuthorizeException, IOException {
int page = Util.getIntParameter(request, "page");
switch (page) {
case MAIN_PAGE:
return processMainPage(c, wfi, step, request);
case REJECT_PAGE:
return processRejectPage(c, wfi, step, request);
default:
return new ActionResult(ActionResult.TYPE.TYPE_CANCEL);
}
}
代码示例来源:origin: DSpace/DSpace
@Override
public ActionResult execute(Context c, XmlWorkflowItem wfi, Step step, HttpServletRequest request)
throws SQLException, AuthorizeException, IOException {
int page = Util.getIntParameter(request, "page");
switch (page) {
case MAIN_PAGE:
return processMainPage(c, wfi, step, request);
case REJECT_PAGE:
return processRejectPage(c, wfi, step, request);
default:
return new ActionResult(ActionResult.TYPE.TYPE_CANCEL);
}
}
代码示例来源:origin: DSpace/DSpace
@Override
public ActionResult execute(Context c, XmlWorkflowItem wfi, Step step, HttpServletRequest request)
throws SQLException, AuthorizeException, IOException, WorkflowException {
if (request.getParameter("submit_score") != null) {
int score = Util.getIntParameter(request, "score");
//Add our score to the metadata
itemService.addMetadata(c, wfi.getItem(), WorkflowRequirementsService.WORKFLOW_SCHEMA, "score", null, null,
String.valueOf(score));
itemService.update(c, wfi.getItem());
return new ActionResult(ActionResult.TYPE.TYPE_OUTCOME, ActionResult.OUTCOME_COMPLETE);
} else {
//We have pressed the leave button so return to our submission page
return new ActionResult(ActionResult.TYPE.TYPE_SUBMISSION_PAGE);
}
}
}
代码示例来源:origin: DSpace/DSpace
int page = Util.getIntParameter(request, "result-page");
if (page == -1) {
page = 0;
代码示例来源:origin: org.dspace/dspace-jspui-api
int start = Util.getIntParameter(request, "start");
int rpp = Util.getIntParameter(request, "rpp");
int sort = Util.getIntParameter(request, "sort_by");
String order = request.getParameter("order");
String sortOrder = (order == null || order.length() == 0 || order.toLowerCase().startsWith("asc")) ?
代码示例来源:origin: org.dspace/dspace-jspui-api
int order = Util.getIntParameter(request, "order_" + bitstream.getID());
代码示例来源:origin: org.dspace/dspace-xmlui-api
int order = Util.getIntParameter(request, "order_" + bitstream.getID());
代码示例来源:origin: org.dspace/dspace-xmlui-api
protected void buildSearchControls(Division div)
throws WingException, SQLException {
Request request = ObjectModelHelper.getRequest(objectModel);
Table controlsTable = div.addTable("search-controls", 1, 3);
Row controlsRow = controlsTable.addRow(Row.ROLE_DATA);
// Create a control for the number of records to display
Cell rppCell = controlsRow.addCell();
rppCell.addContent("pagesize");
Select rppSelect = rppCell.addSelect("rpp");
for (int i : RESULTS_PER_PAGE_PROGRESSION) {
rppSelect.addOption((i == getParameterRpp()), i, Integer.toString(i));
}
Cell filterCell = controlsRow.addCell();
// Create a drop down of the different sort columns available
int selectedCollectionId = Util.getIntParameter(request, "filter_collection");
filterCell.addContent("Collection filter:");
Select sortSelect = filterCell.addSelect("filter_collection");
sortSelect.addOption(-1 == selectedCollectionId,-1, "None");
Collection[] collections = Collection.findAll(context);
for (Collection collection : collections) {
sortSelect.addOption(collection.getID() == selectedCollectionId, collection.getID(), collection.getName());
}
controlsRow.addCell().addButton("submit_search_controls").setValue(T_go);
}
代码示例来源:origin: org.dspace/dspace-xmlui-api
try {
Request request = ObjectModelHelper.getRequest(objectModel);
int collectionIdFilter = Util.getIntParameter(request, "filter_collection");
内容来源于网络,如有侵权,请联系作者删除!