本文整理汇总了Java中com.liferay.portal.kernel.portlet.PortletURLFactoryUtil类的典型用法代码示例。如果您正苦于以下问题:Java PortletURLFactoryUtil类的具体用法?Java PortletURLFactoryUtil怎么用?Java PortletURLFactoryUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PortletURLFactoryUtil类属于com.liferay.portal.kernel.portlet包,在下文中一共展示了PortletURLFactoryUtil类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSaveAndContinueRedirect
import com.liferay.portal.kernel.portlet.PortletURLFactoryUtil; //导入依赖的package包/类
protected String getSaveAndContinueRedirect(
ActionRequest actionRequest, TaskRecord taskRecord, 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", "editTaskRecord");
portletURL.setParameter(Constants.CMD, Constants.UPDATE, false);
portletURL.setParameter("redirect", redirect, false);
portletURL.setParameter(
"groupId", String.valueOf(taskRecord.getGroupId()), false);
portletURL.setParameter(
"taskRecordId", String.valueOf(taskRecord.getTaskRecordId()), false);
portletURL.setWindowState(actionRequest.getWindowState());
return portletURL.toString();
}
示例2: getSaveAndContinueRedirect
import com.liferay.portal.kernel.portlet.PortletURLFactoryUtil; //导入依赖的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();
}
示例3: getSaveAndContinueRedirect
import com.liferay.portal.kernel.portlet.PortletURLFactoryUtil; //导入依赖的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();
}
示例4: add
import com.liferay.portal.kernel.portlet.PortletURLFactoryUtil; //导入依赖的package包/类
public void add(
ActionRequest actionRequest, ActionResponse actionResponse) {
ThemeDisplay themeDisplay = (ThemeDisplay)actionRequest.getAttribute(
WebKeys.THEME_DISPLAY);
int firstParameter = ParamUtil.getInteger(
actionRequest, "firstParameter");
int secondParameter = ParamUtil.getInteger(
actionRequest, "secondParameter");
int result = _sampleService.add(firstParameter, secondParameter);
PortletURL portletURL = PortletURLFactoryUtil.create(
actionRequest, "arquillian_sample_portlet", themeDisplay.getPlid(),
PortletRequest.RENDER_PHASE);
portletURL.setParameter(
"firstParameter", String.valueOf(firstParameter));
portletURL.setParameter(
"secondParameter", String.valueOf(secondParameter));
portletURL.setParameter("result", String.valueOf(result));
actionRequest.setAttribute(WebKeys.REDIRECT, portletURL.toString());
}
示例5: render
import com.liferay.portal.kernel.portlet.PortletURLFactoryUtil; //导入依赖的package包/类
@Override
public void render(
RenderRequest renderRequest, RenderResponse renderResponse)
throws IOException, PortletException {
ThemeDisplay themeDisplay =
(ThemeDisplay) renderRequest.getAttribute(WebKeys.THEME_DISPLAY);
PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();
String portletId = portletDisplay.getId();
JSONObject urlObject = JSONFactoryUtil.createJSONObject();
JSONObject apiObject = JSONFactoryUtil.createJSONObject();
// url
PortletURL dossierInfoURL = PortletURLFactoryUtil.create(
renderRequest, portletId, themeDisplay.getPlid(),
PortletRequest.RENDER_PHASE);
dossierInfoURL.setPortletMode(PortletMode.VIEW);
dossierInfoURL.setWindowState(LiferayWindowState.EXCLUSIVE);
dossierInfoURL.setParameter(
"mvcPath", "/templates/lookup_dossier/dossierinfo.ftl");
urlObject.put("dossierinfo", dossierInfoURL.toString());
// api
apiObject.put("server", themeDisplay.getPortalURL() + "/o/rest/v2");
apiObject.put(
"portletNamespace",
themeDisplay.getPortletDisplay().getNamespace());
// set varible
renderRequest.setAttribute("ajax", urlObject);
renderRequest.setAttribute("api", apiObject);
super.render(renderRequest, renderResponse);
}
示例6: render
import com.liferay.portal.kernel.portlet.PortletURLFactoryUtil; //导入依赖的package包/类
@Override
public void render(
RenderRequest renderRequest, RenderResponse renderResponse)
throws IOException, PortletException {
ThemeDisplay themeDisplay =
(ThemeDisplay) renderRequest.getAttribute(WebKeys.THEME_DISPLAY);
PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();
String portletId = portletDisplay.getId();
JSONObject urlObject = JSONFactoryUtil.createJSONObject();
JSONObject apiObject = JSONFactoryUtil.createJSONObject();
// url
PortletURL registerResultURL = PortletURLFactoryUtil.create(
renderRequest, portletId, themeDisplay.getPlid(),
PortletRequest.RENDER_PHASE);
registerResultURL.setPortletMode(PortletMode.VIEW);
registerResultURL.setWindowState(LiferayWindowState.EXCLUSIVE);
registerResultURL.setParameter(
"mvcPath", "/templates/applicant/register_result.ftl");
urlObject.put("register_result", registerResultURL.toString());
// api
apiObject.put("server", themeDisplay.getPortalURL() + "/o/rest/v2");
apiObject.put(
"portletNamespace",
themeDisplay.getPortletDisplay().getNamespace());
// set varible
renderRequest.setAttribute("ajax", urlObject);
renderRequest.setAttribute("api", apiObject);
super.render(renderRequest, renderResponse);
}
示例7: render
import com.liferay.portal.kernel.portlet.PortletURLFactoryUtil; //导入依赖的package包/类
@Override
public void render(
RenderRequest renderRequest, RenderResponse renderResponse)
throws IOException, PortletException {
ThemeDisplay themeDisplay =
(ThemeDisplay) renderRequest.getAttribute(WebKeys.THEME_DISPLAY);
PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();
String portletId = portletDisplay.getId();
JSONObject urlObject = JSONFactoryUtil.createJSONObject();
JSONObject apiObject = JSONFactoryUtil.createJSONObject();
// url
PortletURL confirmPasswordURL = PortletURLFactoryUtil.create(
renderRequest, portletId, themeDisplay.getPlid(),
PortletRequest.RENDER_PHASE);
confirmPasswordURL.setPortletMode(PortletMode.VIEW);
confirmPasswordURL.setWindowState(LiferayWindowState.EXCLUSIVE);
confirmPasswordURL.setParameter(
"mvcPath", "/templates/applicant/confirm_password.ftl");
urlObject.put("confirm_password", confirmPasswordURL.toString());
// api
apiObject.put("server", themeDisplay.getPortalURL() + "/o/rest/v2");
apiObject.put(
"portletNamespace",
themeDisplay.getPortletDisplay().getNamespace());
// set varible
renderRequest.setAttribute("ajax", urlObject);
renderRequest.setAttribute("api", apiObject);
super.render(renderRequest, renderResponse);
}
示例8: render
import com.liferay.portal.kernel.portlet.PortletURLFactoryUtil; //导入依赖的package包/类
@Override
public void render(
RenderRequest renderRequest, RenderResponse renderResponse)
throws IOException, PortletException {
ThemeDisplay themeDisplay =
(ThemeDisplay) renderRequest.getAttribute(WebKeys.THEME_DISPLAY);
PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();
String portletId = portletDisplay.getId();
JSONObject urlObject = JSONFactoryUtil.createJSONObject();
JSONObject apiObject = JSONFactoryUtil.createJSONObject();
// url
PortletURL serviceInfoLookupURL = PortletURLFactoryUtil.create(
renderRequest, portletId, themeDisplay.getPlid(),
PortletRequest.RENDER_PHASE);
serviceInfoLookupURL.setPortletMode(PortletMode.VIEW);
serviceInfoLookupURL.setWindowState(LiferayWindowState.EXCLUSIVE);
serviceInfoLookupURL.setParameter(
"mvcPath", "/templates/homepage/serviceinfo_lookup.ftl");
urlObject.put("serviceinfo_lookup", serviceInfoLookupURL.toString());
// api
apiObject.put("server", themeDisplay.getPortalURL() + "/o/rest/v2");
apiObject.put(
"portletNamespace",
themeDisplay.getPortletDisplay().getNamespace());
// set varible
renderRequest.setAttribute("ajax", urlObject);
renderRequest.setAttribute("api", apiObject);
super.render(renderRequest, renderResponse);
}
示例9: render
import com.liferay.portal.kernel.portlet.PortletURLFactoryUtil; //导入依赖的package包/类
@Override
public void render(
RenderRequest renderRequest, RenderResponse renderResponse)
throws IOException, PortletException {
ThemeDisplay themeDisplay =
(ThemeDisplay) renderRequest.getAttribute(WebKeys.THEME_DISPLAY);
PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();
String portletId = portletDisplay.getId();
JSONObject urlObject = JSONFactoryUtil.createJSONObject();
JSONObject apiObject = JSONFactoryUtil.createJSONObject();
// url
PortletURL dossierLookupURL = PortletURLFactoryUtil.create(
renderRequest, portletId, themeDisplay.getPlid(),
PortletRequest.RENDER_PHASE);
dossierLookupURL.setPortletMode(PortletMode.VIEW);
dossierLookupURL.setWindowState(LiferayWindowState.EXCLUSIVE);
dossierLookupURL.setParameter(
"mvcPath", "/templates/homepage/dossier_lookup.ftl");
urlObject.put("dossier_lookup", dossierLookupURL.toString());
// api
apiObject.put("server", themeDisplay.getPortalURL() + "/o/rest/v2");
apiObject.put(
"portletNamespace",
themeDisplay.getPortletDisplay().getNamespace());
// set varible
renderRequest.setAttribute("ajax", urlObject);
renderRequest.setAttribute("api", apiObject);
super.render(renderRequest, renderResponse);
}
示例10: render
import com.liferay.portal.kernel.portlet.PortletURLFactoryUtil; //导入依赖的package包/类
public void render(RenderRequest renderRequest, RenderResponse renderResponse)
throws IOException, PortletException {
ThemeDisplay themeDisplay = (ThemeDisplay) renderRequest.getAttribute(WebKeys.THEME_DISPLAY);
PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();
String portletId = portletDisplay.getId();
JSONObject urlObject = JSONFactoryUtil.createJSONObject();
JSONObject apiObject = JSONFactoryUtil.createJSONObject();
// url
PortletURL dossierLookupURL = PortletURLFactoryUtil.create(renderRequest, portletId, themeDisplay.getPlid(),
PortletRequest.RENDER_PHASE);
dossierLookupURL.setPortletMode(PortletMode.VIEW);
dossierLookupURL.setWindowState(LiferayWindowState.EXCLUSIVE);
dossierLookupURL.setParameter("mvcPath", "/templates/homepage/search_serviceinfo.ftl");
urlObject.put("dossier_lookup", dossierLookupURL.toString());
// api
apiObject.put("server", themeDisplay.getPortalURL() + "/o/rest/v2");
apiObject.put("portletNamespace", themeDisplay.getPortletDisplay().getNamespace());
// set varible
renderRequest.setAttribute("ajax", urlObject);
renderRequest.setAttribute("api", apiObject);
super.render(renderRequest, renderResponse);
}
示例11: render
import com.liferay.portal.kernel.portlet.PortletURLFactoryUtil; //导入依赖的package包/类
@Override
public void render(RenderRequest renderRequest, RenderResponse renderResponse)
throws IOException, PortletException {
ThemeDisplay themeDisplay = (ThemeDisplay) renderRequest.getAttribute(WebKeys.THEME_DISPLAY);
PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();
String portletId = portletDisplay.getId();
JSONObject urlObject = JSONFactoryUtil.createJSONObject();
JSONObject apiObject = JSONFactoryUtil.createJSONObject();
// url
PortletURL dossierLookupURL = PortletURLFactoryUtil.create(renderRequest, portletId, themeDisplay.getPlid(),
PortletRequest.RENDER_PHASE);
dossierLookupURL.setPortletMode(PortletMode.VIEW);
dossierLookupURL.setWindowState(LiferayWindowState.EXCLUSIVE);
dossierLookupURL.setParameter("mvcPath", "/templates/homepage/dossier_lookup.ftl");
urlObject.put("dossier_lookup", dossierLookupURL.toString());
// api
apiObject.put("server", themeDisplay.getPortalURL() + "/o/rest/v2");
apiObject.put("portletNamespace", themeDisplay.getPortletDisplay().getNamespace());
// set varible
renderRequest.setAttribute("ajax", urlObject);
renderRequest.setAttribute("api", apiObject);
super.render(renderRequest, renderResponse);
}
示例12: _getOnclick
import com.liferay.portal.kernel.portlet.PortletURLFactoryUtil; //导入依赖的package包/类
private String _getOnclick()
{
PortletURL portletURL = PortletURLFactoryUtil.create(
request, "blade_document_action_portlet_BladeDocumentActionPortlet",
_themeDisplay.getPlid(), PortletRequest.RENDER_PHASE);
String fileName = fileVersion.getFileName();
String mimeType = fileVersion.getMimeType();
String version = fileVersion.getVersion();
String createdDate = fileVersion.getCreateDate().toString();
String createdUserName = fileVersion.getUserName();
String statusLabel = WorkflowConstants.getStatusLabel(
fileVersion.getStatus());
portletURL.setParameter("fileName", fileName);
portletURL.setParameter("mimeType", mimeType);
portletURL.setParameter("version", version);
portletURL.setParameter("statusLabel", statusLabel);
portletURL.setParameter("createdDate", createdDate);
portletURL.setParameter("createdUserName", createdUserName);
try {
portletURL.setWindowState(LiferayWindowState.POP_UP);
}
catch (WindowStateException wse) {
_log.error(wse);
}
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("Liferay.Util.openWindow({");
stringBuilder.append("dialog: {cache: false,width:800,modal: true},");
stringBuilder.append("title: 'basic information',id: ");
stringBuilder.append("'testPopupIdUnique',uri: '");
stringBuilder.append(portletURL.toString() + "'});");
return stringBuilder.toString();
}
示例13: getTaskRecords
import com.liferay.portal.kernel.portlet.PortletURLFactoryUtil; //导入依赖的package包/类
protected List<TaskRecord> getTaskRecords(PortletRequest request) throws Exception {
ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);
PortletURL iteratorURL = PortletURLFactoryUtil.create(request, PortletKeys.TIMETRACKER,
themeDisplay.getLayout(), PortletRequest.RENDER_PHASE);
String description = ParamUtil.getString(request, "description");
boolean advancedSearch = ParamUtil.getBoolean(request, "advancedSearch", false);
boolean andOperator = ParamUtil.getBoolean(request, "andOperator", true);
int end = ParamUtil.getInteger(request, "end");
boolean ignoreFromDate = ParamUtil.getBoolean(request, "ignoreFromDate");
Date fromDate = null;
if (!ignoreFromDate) {
int fromDateDay = ParamUtil.getInteger(request, "fromDateDay");
int fromDateMonth = ParamUtil.getInteger(request, "fromDateMonth");
int fromDateYear = ParamUtil.getInteger(request, "fromDateYear");
fromDate = PortalUtil.getDate(fromDateMonth, fromDateDay, fromDateYear);
}
String keywords = ParamUtil.getString(request, "keywords");
String orderByCol = ParamUtil.getString(request, "orderByCol", "modifiedDate");
String orderByType = ParamUtil.getString(request, "orderByType", "desc");
long ownerUserId = ParamUtil.getLong(request, "ownerUserId");
int start = ParamUtil.getInteger(request, "start");
int status = ParamUtil.getInteger(request, Field.STATUS);
TaskRecordSearch taskRecordSearch = new TaskRecordSearch(request, iteratorURL);
orderByCol = taskRecordSearch.getOrderByCol();
boolean ignoreUntilDate = ParamUtil.getBoolean(request, "ignoreUntilDate");
Date untilDate = null;
if (!ignoreUntilDate) {
int untilDateDay = ParamUtil.getInteger(request, "untilDateDay");
int untilDateMonth = ParamUtil.getInteger(request, "untilDateMonth");
int untilDateYear = ParamUtil.getInteger(request, "untilDateYear");
untilDate = PortalUtil.getDate(untilDateMonth, untilDateDay, untilDateYear);
}
String workPackage = ParamUtil.getString(request, "workPackage");
boolean reverse = "desc".equals(orderByType);
Sort sort = new Sort(orderByCol, reverse);
Hits hits = null;
if (advancedSearch) {
hits = TaskRecordServiceUtil.search(themeDisplay.getUserId(), themeDisplay.getScopeGroupId(), ownerUserId,
workPackage, description, status, fromDate, untilDate, null, andOperator, advancedSearch, start,
end, sort);
} else {
hits = TaskRecordServiceUtil.search(themeDisplay.getUserId(), themeDisplay.getScopeGroupId(), 0, keywords,
start, end, sort);
}
List<TaskRecord> taskRecords = TimetrackerUtil.getTaskRecords(hits);
return taskRecords;
}
示例14: render
import com.liferay.portal.kernel.portlet.PortletURLFactoryUtil; //导入依赖的package包/类
@Override
public void render(
RenderRequest renderRequest, RenderResponse renderResponse)
throws IOException, PortletException {
ThemeDisplay themeDisplay =
(ThemeDisplay) renderRequest.getAttribute(WebKeys.THEME_DISPLAY);
PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();
String portletId = portletDisplay.getId();
JSONObject urlObject = JSONFactoryUtil.createJSONObject();
JSONObject apiObject = JSONFactoryUtil.createJSONObject();
// url
PortletURL serviceInfoListURL = PortletURLFactoryUtil.create(
renderRequest, portletId, themeDisplay.getPlid(),
PortletRequest.RENDER_PHASE);
serviceInfoListURL.setPortletMode(PortletMode.VIEW);
serviceInfoListURL.setWindowState(LiferayWindowState.EXCLUSIVE);
serviceInfoListURL.setParameter(
"mvcPath", "/templates/serviceinfo/serviceinfomain_list.ftl");
PortletURL serviceinfoDetailURL = PortletURLFactoryUtil.create(
renderRequest, portletId, themeDisplay.getPlid(),
PortletRequest.RENDER_PHASE);
serviceinfoDetailURL.setPortletMode(PortletMode.VIEW);
serviceinfoDetailURL.setWindowState(LiferayWindowState.EXCLUSIVE);
serviceinfoDetailURL.setParameter(
"mvcPath", "/templates/serviceinfo/serviceinfo_detail.ftl");
urlObject.put("serviceinfo_detail", serviceinfoDetailURL.toString());
urlObject.put("serviceinfomain_list", serviceInfoListURL.toString());
// api
apiObject.put("server", themeDisplay.getPortalURL() + "/o/rest/v2");
apiObject.put(
"portletNamespace",
themeDisplay.getPortletDisplay().getNamespace());
// set varible
renderRequest.setAttribute("ajax", urlObject);
renderRequest.setAttribute("api", apiObject);
super.render(renderRequest, renderResponse);
}
示例15: getURL
import com.liferay.portal.kernel.portlet.PortletURLFactoryUtil; //导入依赖的package包/类
public String getURL(
PortletRequest portletRequest, PortletResponse portletResponse) {
HttpServletRequest servletRequest = _portal.getHttpServletRequest(
portletRequest);
ThemeDisplay themeDisplay = (ThemeDisplay)portletRequest.getAttribute(
WebKeys.THEME_DISPLAY);
FileEntry fileEntry = _retrieveFile(servletRequest);
PortletURL portletURL = PortletURLFactoryUtil.create(
servletRequest,
"blade_document_action_portlet_BladeDocumentActionPortlet",
themeDisplay.getPlid(), PortletRequest.RENDER_PHASE);
String fileName = fileEntry.getFileName();
String mimeType = fileEntry.getMimeType();
String version = fileEntry.getVersion();
String createdDate = fileEntry.getCreateDate().toString();
String createdUserName = fileEntry.getUserName();
String statusLabel = null;
try {
statusLabel = WorkflowConstants.getStatusLabel(
fileEntry.getLatestFileVersion().getStatus());
}
catch (PortalException pe) {
_log.error(pe);
}
portletURL.setParameter("fileName", fileName);
portletURL.setParameter("mimeType", mimeType);
portletURL.setParameter("version", version);
portletURL.setParameter("statusLabel", statusLabel);
portletURL.setParameter("createdDate", createdDate);
portletURL.setParameter("createdUserName", createdUserName);
try {
portletURL.setWindowState(LiferayWindowState.POP_UP);
}
catch (WindowStateException wse) {
_log.error(wse);
}
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("javascript:Liferay.Util.openWindow(");
stringBuilder.append("{dialog: {cache: false,width:800,modal: true},");
stringBuilder.append("title: 'basic information',id: ");
stringBuilder.append("'testPopupIdUnique',uri: '");
stringBuilder.append(portletURL.toString() + "'});");
return stringBuilder.toString();
}