本文整理匯總了Java中javax.portlet.PortletRequest類的典型用法代碼示例。如果您正苦於以下問題:Java PortletRequest類的具體用法?Java PortletRequest怎麽用?Java PortletRequest使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
PortletRequest類屬於javax.portlet包,在下文中一共展示了PortletRequest類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: TaskRecordDisplayTerms
import javax.portlet.PortletRequest; //導入依賴的package包/類
public TaskRecordDisplayTerms(PortletRequest portletRequest) {
super(portletRequest);
createDate = ParamUtil.getString(portletRequest, CREATE_DATE);
description = ParamUtil.getString(portletRequest, DESCRIPTION);
duration = ParamUtil.getLong(portletRequest, DURATION);
fromDate = ParamUtil.getString(portletRequest, FROM_DATE);
groupId = ParamUtil.getLong(portletRequest, GROUP_ID);
ownerUserId = ParamUtil.getLong(portletRequest, OWNER_USER_ID);
modifiedDate = ParamUtil.getString(portletRequest, MODIFIED_DATE);
String statusString = ParamUtil.getString(portletRequest, STATUS);
if (Validator.isNotNull(statusString)) {
status = GetterUtil.getInteger(statusString);
}
ticketURL = ParamUtil.getString(portletRequest, TICKET_URL);
taskRecordId = ParamUtil.getLong(portletRequest, TASKRECORDID);
untilDate = ParamUtil.getString(portletRequest, UNTIL_DATE);
userName = ParamUtil.getString(portletRequest, USER_NAME);
workPackage = ParamUtil.getString(portletRequest, WORK_PACKAGE);
}
示例2: ContactDisplayTerms
import javax.portlet.PortletRequest; //導入依賴的package包/類
public ContactDisplayTerms(PortletRequest portletRequest) {
super(portletRequest);
company = ParamUtil.getString(portletRequest, COMPANY);
contactId = ParamUtil.getString(portletRequest, CONTACT_ID);
createDate = ParamUtil.getString(portletRequest, CREATE_DATE);
email = ParamUtil.getString(portletRequest, EMAIL);
fax = ParamUtil.getString(portletRequest, FAX);
fullName = ParamUtil.getString(portletRequest, FULL_NAME);
// TODO: add default IMPP
name = ParamUtil.getString(portletRequest, NAME);
modifiedDate = ParamUtil.getString(portletRequest, MODIFIED_DATE);
String statusString = ParamUtil.getString(portletRequest, STATUS);
if (Validator.isNotNull(statusString)) {
status = GetterUtil.getInteger(statusString);
}
phone = ParamUtil.getString(portletRequest, PHONE);
userName = ParamUtil.getString(portletRequest, USER_NAME);
}
示例3: ContactSearchTerms
import javax.portlet.PortletRequest; //導入依賴的package包/類
public ContactSearchTerms(PortletRequest portletRequest) {
super(portletRequest);
company = DAOParamUtil.getString(portletRequest, COMPANY);
contactId = DAOParamUtil.getString(portletRequest, CONTACT_ID);
createDate = DAOParamUtil.getString(portletRequest, CREATE_DATE);
email = DAOParamUtil.getString(portletRequest, EMAIL);
fax = DAOParamUtil.getString(portletRequest, FAX);
fullName = DAOParamUtil.getString(portletRequest, FULL_NAME);
// TODO: set default impp
modifiedDate = DAOParamUtil.getString(portletRequest, MODIFIED_DATE);
name = DAOParamUtil.getString(portletRequest, NAME);
phone = DAOParamUtil.getString(portletRequest, PHONE);
status = DAOParamUtil.getInteger(portletRequest, STATUS);
userName = DAOParamUtil.getString(portletRequest, USER_NAME);
}
示例4: getSaveAndContinueRedirect
import javax.portlet.PortletRequest; //導入依賴的package包/類
protected String getSaveAndContinueRedirect(
ActionRequest actionRequest, Contact contact, Layout layout, String redirect)
throws Exception {
_log.info("getSaveAndContinueRedirect()");
PortletConfig portletConfig = (PortletConfig)actionRequest.getAttribute(
JavaConstants.JAVAX_PORTLET_CONFIG);
LiferayPortletURL portletURL = PortletURLFactoryUtil.create(actionRequest, portletConfig.getPortletName(), layout, PortletRequest.RENDER_PHASE);
portletURL.setParameter("mvcRenderCommandName", "editContact");
portletURL.setParameter(Constants.CMD, Constants.UPDATE, false);
portletURL.setParameter("redirect", redirect, false);
portletURL.setParameter(
"groupId", String.valueOf(contact.getGroupId()), false);
portletURL.setParameter(
"contactId", String.valueOf(contact.getContactId()), false);
portletURL.setWindowState(actionRequest.getWindowState());
return portletURL.toString();
}
示例5: MeasurementDisplayTerms
import javax.portlet.PortletRequest; //導入依賴的package包/類
public MeasurementDisplayTerms(PortletRequest portletRequest) {
super(portletRequest);
createDate = ParamUtil.getString(portletRequest, CREATE_DATE);
data = ParamUtil.getString(portletRequest, DATA);
from = ParamUtil.getLong(portletRequest, FROM);
groupId = ParamUtil.getLong(portletRequest, GROUP_ID);
id = ParamUtil.getString(portletRequest, ID);
measurementId = ParamUtil.getLong(portletRequest, MEASUREMENT_ID);
modifiedDate = ParamUtil.getString(portletRequest, MODIFIED_DATE);
name = ParamUtil.getString(portletRequest, NAME);
String statusString = ParamUtil.getString(portletRequest, STATUS);
if (Validator.isNotNull(statusString)) {
status = GetterUtil.getInteger(statusString);
}
until = ParamUtil.getLong(portletRequest, UNTIL);
userName = ParamUtil.getString(portletRequest, USER_NAME);
}
示例6: getSaveAndContinueRedirect
import javax.portlet.PortletRequest; //導入依賴的package包/類
protected String getSaveAndContinueRedirect(
ActionRequest actionRequest, Measurement measurement, Layout layout, String redirect)
throws Exception {
PortletConfig portletConfig = (PortletConfig)actionRequest.getAttribute(
JavaConstants.JAVAX_PORTLET_CONFIG);
LiferayPortletURL portletURL = PortletURLFactoryUtil.create(actionRequest, portletConfig.getPortletName(), layout, PortletRequest.RENDER_PHASE);
portletURL.setParameter("mvcRenderCommandName", "editMeasurement");
portletURL.setParameter(Constants.CMD, Constants.UPDATE, false);
portletURL.setParameter("redirect", redirect, false);
portletURL.setParameter(
"groupId", String.valueOf(measurement.getGroupId()), false);
portletURL.setParameter(
"measurementId", String.valueOf(measurement.getMeasurementId()), false);
portletURL.setWindowState(actionRequest.getWindowState());
return portletURL.toString();
}
示例7: getSuggestions
import javax.portlet.PortletRequest; //導入依賴的package包/類
/**
* {@inheritDoc}
*/
@Override
public JSONArray getSuggestions(
PortletRequest portletRequest)
throws Exception {
String[] suggestions = getSuggestionsAsStringArray(portletRequest);
// Build results JSON object.
JSONArray resultsArray = JSONFactoryUtil.createJSONArray();
if (suggestions != null) {
for (String s : suggestions) {
resultsArray.put(s);
}
}
return resultsArray;
}
示例8: getLayoutByFriendlyURL
import javax.portlet.PortletRequest; //導入依賴的package包/類
/**
* Get layout by friendlyurl.
*
* @param resourceRequest
* @return layout
* @throws PortalException if layout is not found
*/
public static Layout getLayoutByFriendlyURL(
PortletRequest portletRequest, String layoutFriendlyURL)
throws PortalException {
ThemeDisplay themeDisplay =
(ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY);
if (layoutFriendlyURL != null) {
return LayoutLocalServiceUtil.getFriendlyURLLayout(
themeDisplay.getScopeGroupId(),
themeDisplay.getLayout().isPrivateLayout(), layoutFriendlyURL);
}
throw new PortalException(
"Couldn't find asset publisher layout for " + layoutFriendlyURL +
". Please check configuration.");
}
示例9: getRedirectURL
import javax.portlet.PortletRequest; //導入依賴的package包/類
/**
* Get redirect url.
*
* @return redirect url
* @throws PortalException
*/
public static String getRedirectURL(PortletRequest portletRequest)
throws PortalException {
StringBundler sb = new StringBundler();
sb.append(GSearchUtil.getCurrentLayoutFriendlyURL(portletRequest));
sb.append("?");
sb.append(GSearchWebKeys.KEYWORDS).append("=").append(
ParamUtil.getString(portletRequest, GSearchWebKeys.KEYWORDS));
sb.append("&").append(GSearchWebKeys.FILTER_SCOPE).append("=").append(
ParamUtil.getString(portletRequest, GSearchWebKeys.FILTER_SCOPE));
sb.append("&").append(GSearchWebKeys.FILTER_TIME).append("=").append(
ParamUtil.getString(portletRequest, GSearchWebKeys.FILTER_TIME));
sb.append("&").append(GSearchWebKeys.FILTER_TYPE).append("=").append(
ParamUtil.getString(portletRequest, GSearchWebKeys.FILTER_TYPE));
sb.append("&").append(GSearchWebKeys.SORT_FIELD).append("=").append(
ParamUtil.getString(portletRequest, GSearchWebKeys.SORT_FIELD));
sb.append("&").append(GSearchWebKeys.SORT_DIRECTION).append("=").append(
ParamUtil.getString(portletRequest, GSearchWebKeys.SORT_DIRECTION));
sb.append("&").append(GSearchWebKeys.START).append("=").append(
ParamUtil.getString(portletRequest, GSearchWebKeys.START));
return HtmlUtil.escapeURL(sb.toString());
}
示例10: TaskRecordSearchTerms
import javax.portlet.PortletRequest; //導入依賴的package包/類
public TaskRecordSearchTerms(PortletRequest portletRequest) {
super(portletRequest);
description = DAOParamUtil.getString(portletRequest, DESCRIPTION);
fromDate = DAOParamUtil.getString(portletRequest, FROM_DATE);
groupId = DAOParamUtil.getLong(portletRequest, GROUP_ID);
ownerUserId = DAOParamUtil.getLong(portletRequest, OWNER_USER_ID);
status = DAOParamUtil.getInteger(portletRequest, STATUS);
untilDate = DAOParamUtil.getString(portletRequest, UNTIL_DATE);
workPackage = DAOParamUtil.getString(portletRequest, WORK_PACKAGE);
}
示例11: search
import javax.portlet.PortletRequest; //導入依賴的package包/類
@Override
public SearchResultsContainer search(PortletRequest request, PortletResponse response, String tabId, int pageOffset, boolean isLoadMore) throws ReadOnlyException, ValidatorException, IOException, SearchException {
FlashlightSearchConfiguration config = this.readConfiguration(request.getPreferences());
Map<String, FlashlightSearchConfigurationTab> tabs = config.getTabs();
FacetedSearcher searcher = this.facetedSearcherManager.createFacetedSearcher();
LinkedHashMap<FlashlightSearchConfigurationTab, SearchPage> resultMap = new LinkedHashMap<>(tabs.size());
for(FlashlightSearchConfigurationTab tab : tabs.values()) {
int pageSize;
int loadMoreSize;
if(tab.getId().equals(tabId)) {
pageSize = tab.getFullPageSize();
} else {
pageSize = tab.getPageSize();
}
if(isLoadMore) {
loadMoreSize = tab.getLoadMorePageSize();
} else {
loadMoreSize = 0;
}
resultMap.put(tab, this.search(request, response, config, tab, searcher, pageOffset, pageSize, loadMoreSize));
}
return new SearchResultsContainer(resultMap);
}
示例12: getAssetViewURL
import javax.portlet.PortletRequest; //導入依賴的package包/類
/**
* Gets the search result's view URL
*
* @param document The searched document
* @param request The request
* @param response The response
* @param currentLayout The current page
* @param tabId The search tab ID
*
* @return The search result URL
*/
private String getAssetViewURL(Document document, PortletRequest request, PortletResponse response, Layout currentLayout, String tabId, String keywords) {
String className = document.get(Field.ENTRY_CLASS_NAME);
long classPK = GetterUtil.getLong(document.get(Field.ENTRY_CLASS_PK));
String currentUrl = this.portal.getCurrentURL(request);
String returnedUrl;
if(ASSET_TYPE.equals(className) && classPK > 0) {
try {
String portletId = (String) request.getAttribute(WebKeys.PORTLET_ID);
PortletURL viewInPortletUrlObj = this.portletUrlFactory.create(request, portletId, currentLayout, LIFECYCLE_RENDER);
viewInPortletUrlObj.setParameter(PortletRequestParameter.VIEW_MODE.getName(), ViewMode.VIEW_JOURNAL.getParamValue());
viewInPortletUrlObj.setParameter(Field.ENTRY_CLASS_PK, Long.toString(classPK));
viewInPortletUrlObj.setParameter(PortletRequestParameter.TAB_ID.getName(), tabId);
viewInPortletUrlObj.setParameter(PortletRequestParameter.KEYWORDS.getName(), keywords);
String viewInPortletUrl = viewInPortletUrlObj.toString();
AssetRendererFactory<?> assetRendererFactory = AssetRendererFactoryRegistryUtil.getAssetRendererFactoryByClassName(className);
AssetRenderer<?> assetRenderer = assetRendererFactory.getAssetRenderer(classPK);
returnedUrl = assetRenderer.getURLViewInContext((LiferayPortletRequest) request, (LiferayPortletResponse) response, viewInPortletUrl);
} catch(Exception e) {
returnedUrl = currentUrl;
}
} else {
returnedUrl = currentUrl;
}
return returnedUrl;
}
示例13: enrichTemplateContext
import javax.portlet.PortletRequest; //導入依賴的package包/類
/**
* Puts commonly used variables in the template context
* @param request The request
* @param response The response
* @param template The template
*/
private void enrichTemplateContext(RenderRequest request, RenderResponse response, Template template) {
template.put(TemplateVariable.LOCALE.getVariableName(), request.getLocale());
template.put(TemplateVariable.PORTLET_CONTEXT.getVariableName(), this.getPortletContext());
template.put(TemplateVariable.REQUEST.getVariableName(), request);
template.put(TemplateVariable.RESPONSE.getVariableName(), response);
template.put(TemplateVariable.THEME_DISPLAY.getVariableName(), request.getAttribute(WebKeys.THEME_DISPLAY));
template.put(TemplateVariable.USER_INFO.getVariableName(), request.getAttribute(PortletRequest.USER_INFO));
}
示例14: setCharacterEncoding
import javax.portlet.PortletRequest; //導入依賴的package包/類
static public void setCharacterEncoding(
PortletRequest req,
String encoding)
{
UploadedFiles files = (UploadedFiles)
req.getAttribute(_UPLOADED_FILES_KEY);
_setCharacterEncoding(files, encoding);
}
示例15: doGetSummary
import javax.portlet.PortletRequest; //導入依賴的package包/類
@Override
protected Summary doGetSummary(Document document, Locale locale, String snippet, PortletRequest portletRequest,
PortletResponse portletResponse) throws Exception {
Summary summary = createSummary(document, Field.TITLE, Field.CONTENT);
return summary;
}