本文整理汇总了Java中com.liferay.portal.kernel.portlet.LiferayWindowState类的典型用法代码示例。如果您正苦于以下问题:Java LiferayWindowState类的具体用法?Java LiferayWindowState怎么用?Java LiferayWindowState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LiferayWindowState类属于com.liferay.portal.kernel.portlet包,在下文中一共展示了LiferayWindowState类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: generateURLJsonObject
import com.liferay.portal.kernel.portlet.LiferayWindowState; //导入依赖的package包/类
private JSONObject generateURLJsonObject(RenderResponse renderResponse)
throws WindowStateException {
JSONObject urlObject = JSONFactoryUtil.createJSONObject();
PortletURL customerRegistrationsDetail = renderResponse.createRenderURL();
customerRegistrationsDetail.setWindowState(LiferayWindowState.EXCLUSIVE);
customerRegistrationsDetail.setParameter(
"mvcPath", "/templates/registrations_detail.ftl");
urlObject.put("registrations_detail", customerRegistrationsDetail);
PortletURL customerRegistrationsMenu = renderResponse.createRenderURL();
customerRegistrationsMenu.setWindowState(LiferayWindowState.EXCLUSIVE);
customerRegistrationsMenu.setParameter(
"mvcPath", "/templates/registrations_menu.ftl");
urlObject.put("registrations_menu", customerRegistrationsMenu);
return urlObject;
}
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:22,代码来源:FrontendWebRegisterPortlet.java
示例2: editmodule
import com.liferay.portal.kernel.portlet.LiferayWindowState; //导入依赖的package包/类
@ProcessAction(name = "editmodule")
public void editmodule(ActionRequest request, ActionResponse response)
throws Exception {
long key = ParamUtil.getLong(request, "resourcePrimKey");
if (Validator.isNotNull(key)) {
response.setRenderParameter("moduleId", Long.toString(key));
try {
response.setWindowState(LiferayWindowState.POP_UP);
} catch (WindowStateException e) {
if(log.isDebugEnabled())e.printStackTrace();
if(log.isErrorEnabled())log.error(e.getMessage());
}
response.setRenderParameter("view", "editmodule");
response.setRenderParameter("editType", "edit");
}
}
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:17,代码来源:modulePortlet.java
示例3: render
import com.liferay.portal.kernel.portlet.LiferayWindowState; //导入依赖的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);
}
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:39,代码来源:LookupDossierResult.java
示例4: render
import com.liferay.portal.kernel.portlet.LiferayWindowState; //导入依赖的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);
}
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:39,代码来源:RegisterPorltet.java
示例5: render
import com.liferay.portal.kernel.portlet.LiferayWindowState; //导入依赖的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);
}
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:39,代码来源:ForgottenAccount.java
示例6: render
import com.liferay.portal.kernel.portlet.LiferayWindowState; //导入依赖的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);
}
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:39,代码来源:ServiceInfoLookup.java
示例7: render
import com.liferay.portal.kernel.portlet.LiferayWindowState; //导入依赖的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);
}
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:39,代码来源:DossierLookup.java
示例8: render
import com.liferay.portal.kernel.portlet.LiferayWindowState; //导入依赖的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);
}
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:32,代码来源:ServiceSearchPortlet.java
示例9: render
import com.liferay.portal.kernel.portlet.LiferayWindowState; //导入依赖的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);
}
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:33,代码来源:DossierLookupPortlet.java
示例10: _getOnclick
import com.liferay.portal.kernel.portlet.LiferayWindowState; //导入依赖的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();
}
开发者ID:liferay,项目名称:liferay-blade-samples,代码行数:40,代码来源:BladeActionDisplayContext.java
示例11: getURLEdit
import com.liferay.portal.kernel.portlet.LiferayWindowState; //导入依赖的package包/类
@Override
public final PortletURL getURLEdit(LiferayPortletRequest liferayPortletRequest,
LiferayPortletResponse liferayPortletResponse) throws Exception {
PortletURL portletURL = null;
if((_editDetails)&&(GetterUtil.getBoolean(liferayPortletRequest.getAttribute(EDIT_DETAILS)))) {
portletURL = getURLEditDetails(liferayPortletRequest, liferayPortletResponse);
if(Validator.isNotNull(portletURL)) {
prepareRuntimePortlet(portletURL);
return portletURL;
}
}
ThemeDisplay themeDisplay = (ThemeDisplay)liferayPortletRequest.getAttribute(
WebKeys.THEME_DISPLAY);
if(_learningactivity.getModuleId()==0){
portletURL=
PortletURLFactoryUtil.create(liferayPortletRequest,"lmsactivitieslist_WAR_liferaylmsportlet",getControlPanelPlid(themeDisplay), PortletRequest.RENDER_PHASE);
portletURL.setWindowState(LiferayWindowState.POP_UP);
}else{
portletURL = PortletURLFactoryUtil.create(liferayPortletRequest,_portletId,getControlPanelPlid(themeDisplay),PortletRequest.RENDER_PHASE);
}
portletURL.setParameter("editing", StringPool.TRUE);
portletURL.setParameter("resId",Long.toString( _learningactivity.getActId()));
portletURL.setParameter("resModuleId",Long.toString( _learningactivity.getModuleId()));
return portletURL;
}
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:29,代码来源:LearningActivityBaseAssetRenderer.java
示例12: setBankTest
import com.liferay.portal.kernel.portlet.LiferayWindowState; //导入依赖的package包/类
public void setBankTest(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception{
long actId = ParamUtil.getLong(actionRequest, "actId", 0);
String redirect = actionRequest.getParameter("redirect");
String isMultiple = ParamUtil.getString(actionRequest, "banks-multipleselections", "false");
String isBank = ParamUtil.getString(actionRequest, "is-bank", "false");
String assetCategoryIds = ParamUtil.getString(actionRequest, "assetCategoryIds", StringPool.BLANK);
long[] longCategoryIds = GetterUtil.getLongValues(StringUtil.split(assetCategoryIds));
AssetEntryQuery entryQuery = new AssetEntryQuery();
entryQuery.setAllCategoryIds(longCategoryIds);
if(!Validator.equals(AssetEntryLocalServiceUtil.getEntries(entryQuery).size(), 0)){
LearningActivityLocalServiceUtil.setExtraContentValue(actId,"isBank", isBank);
LearningActivityLocalServiceUtil.setExtraContentValue(actId,"isMultiple", isMultiple);
if(!StringPool.BLANK.equals(assetCategoryIds)){
LearningActivityLocalServiceUtil.setExtraContentValue(actId,"categoriesId", assetCategoryIds);
SessionMessages.add(actionRequest,"data-exist-for-these-categories");
}else{
SessionErrors.add(actionRequest, "error-selector-categories-empty");
}
}else{
SessionErrors.add(actionRequest, "error-not-results");
}
WindowState windowState = actionRequest.getWindowState();
if (Validator.isNotNull(redirect)) {
if (!windowState.equals(LiferayWindowState.POP_UP)) {
actionResponse.sendRedirect(redirect);
}
else {
redirect = PortalUtil.escapeRedirect(redirect);
if (Validator.isNotNull(redirect)) {
actionResponse.sendRedirect(redirect);
}
}
}
}
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:40,代码来源:ExecActivity.java
示例13: newmodule
import com.liferay.portal.kernel.portlet.LiferayWindowState; //导入依赖的package包/类
@ProcessAction(name = "newmodule")
public void newmodule(ActionRequest request, ActionResponse response) {
response.setRenderParameter("view", "editmodule");
try {
response.setWindowState(LiferayWindowState.POP_UP);
} catch (WindowStateException e) {
if(log.isDebugEnabled())e.printStackTrace();
if(log.isErrorEnabled())log.error(e.getMessage());
}
response.setRenderParameter("moduleId", "0");
response.setRenderParameter("editType", "add");
}
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:13,代码来源:modulePortlet.java
示例14: getURLViewInContext
import com.liferay.portal.kernel.portlet.LiferayWindowState; //导入依赖的package包/类
@Override
public String getURLViewInContext(
LiferayPortletRequest liferayPortletRequest,
LiferayPortletResponse liferayPortletResponse,
String noSuchEntryRedirect) throws Exception {
PortletURL viewPortletURL = liferayPortletResponse.createRenderURL("taskactivity_WAR_liferaylmsportlet");
viewPortletURL.setWindowState(LiferayWindowState.NORMAL);
viewPortletURL.setParameter("jspPage", "/html/taskactivity/view.jsp");
viewPortletURL.setParameter("actId",Long.toString( _learningactivity.getActId()));
return viewPortletURL.toString();
}
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:12,代码来源:TaskAssetRenderer.java
示例15: redirectUpdateAccount
import com.liferay.portal.kernel.portlet.LiferayWindowState; //导入依赖的package包/类
protected void redirectUpdateAccount(
HttpServletRequest request, HttpServletResponse response, User user)
throws Exception {
ThemeDisplay themeDisplay = (ThemeDisplay)request.getAttribute(
WebKeys.THEME_DISPLAY);
PortletURL portletURL = PortletURLFactoryUtil.create(
request, PortletKeys.LOGIN, themeDisplay.getPlid(),
PortletRequest.RENDER_PHASE);
portletURL.setParameter("saveLastPath", Boolean.FALSE.toString());
portletURL.setParameter("struts_action", "/login/update_account");
PortletURL redirectURL = PortletURLFactoryUtil.create(
request, PortletKeys.FAST_LOGIN, themeDisplay.getPlid(),
PortletRequest.RENDER_PHASE);
redirectURL.setParameter("struts_action", "/login/login_redirect");
redirectURL.setParameter("emailAddress", user.getEmailAddress());
redirectURL.setParameter("anonymousUser", Boolean.FALSE.toString());
redirectURL.setPortletMode(PortletMode.VIEW);
redirectURL.setWindowState(LiferayWindowState.POP_UP);
portletURL.setParameter("redirect", redirectURL.toString());
portletURL.setParameter("userId", String.valueOf(user.getUserId()));
portletURL.setParameter("emailAddress", user.getEmailAddress());
portletURL.setParameter("firstName", user.getFirstName());
portletURL.setParameter("lastName", user.getLastName());
portletURL.setPortletMode(PortletMode.VIEW);
portletURL.setWindowState(LiferayWindowState.POP_UP);
response.sendRedirect(portletURL.toString());
}
开发者ID:sergiogonzalez,项目名称:google-login-hook,代码行数:35,代码来源:GoogleOAuth.java
示例16: render
import com.liferay.portal.kernel.portlet.LiferayWindowState; //导入依赖的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);
}
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:49,代码来源:ServiceInfoPortlet.java
示例17: getURL
import com.liferay.portal.kernel.portlet.LiferayWindowState; //导入依赖的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();
}
开发者ID:liferay,项目名称:liferay-blade-samples,代码行数:56,代码来源:BladeActionConfigurationIcon.java
示例18: deleteMyTries
import com.liferay.portal.kernel.portlet.LiferayWindowState; //导入依赖的package包/类
public void deleteMyTries(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
log.debug("***deleteMyTries***");
long actId = ParamUtil.getLong(actionRequest, "resId", 0);
String redirect = ParamUtil.getString(actionRequest, "redirect");
if(actId>0){
LearningActivity larn=LearningActivityLocalServiceUtil.getLearningActivity(actId);
ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
actionResponse.setRenderParameters(actionRequest.getParameterMap());
actionRequest.setAttribute("editing", "true");
LearningActivityTryLocalServiceUtil.deleteUserTries(actId, themeDisplay.getUserId());
if(P2pActivityLocalServiceUtil.existP2pAct(actId, themeDisplay.getUserId())){
P2pActivity p2pact=P2pActivityLocalServiceUtil.findByActIdAndUserId(actId, themeDisplay.getUserId());
P2pActivityLocalServiceUtil.deleteP2pActivity(p2pact.getP2pActivityId());
java.util.List<P2pActivityCorrections> p2pactcorrcs=P2pActivityCorrectionsLocalServiceUtil.findByP2pActivityId(p2pact.getP2pActivityId());
for(P2pActivityCorrections p2pactcorr:p2pactcorrcs){
P2pActivityCorrectionsLocalServiceUtil.deleteP2pActivityCorrections(p2pactcorr);
}
}
actionRequest.setAttribute("activity", larn);
}
WindowState windowState = actionRequest.getWindowState();
if (redirect != null && !"".equals(redirect)) {
if (!windowState.equals(LiferayWindowState.POP_UP)) {
actionResponse.sendRedirect(redirect);
}else {
redirect = PortalUtil.escapeRedirect(redirect);
if (Validator.isNotNull(redirect)) {
actionResponse.sendRedirect(redirect);
}
}
}
SessionMessages.add(actionRequest, "ok-deleting-tries");
}
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:43,代码来源:LmsActivitiesList.java
示例19: showViewDefault
import com.liferay.portal.kernel.portlet.LiferayWindowState; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public void showViewDefault(RenderRequest renderRequest,
RenderResponse renderResponse) throws IOException, PortletException {
ThemeDisplay themeDisplay = (ThemeDisplay) renderRequest
.getAttribute(WebKeys.THEME_DISPLAY);
long groupId = themeDisplay.getScopeGroupId();
PermissionChecker permissionChecker = themeDisplay
.getPermissionChecker();
boolean hasAddPermission = permissionChecker.hasPermission(groupId,
"com.liferay.lms.model", groupId, "ADD_MODULE");
List<Module> tempResults = Collections.EMPTY_LIST;
try {
tempResults = ModuleLocalServiceUtil.findAllInGroup(groupId);
} catch (Exception e) {
if(log.isDebugEnabled())e.printStackTrace();
if(log.isErrorEnabled())log.error(e.getMessage());
}
renderRequest.setAttribute("highlightRowWithKey", renderRequest.getParameter("highlightRowWithKey"));
renderRequest.setAttribute("containerStart", renderRequest.getParameter("containerStart"));
renderRequest.setAttribute("containerEnd", renderRequest.getParameter("containerEnd"));
renderRequest.setAttribute("tempResults", tempResults);
renderRequest.setAttribute("hasAddPermission", hasAddPermission);
LiferayPortletResponse liferayPortletResponse=(LiferayPortletResponse)renderResponse;
PortletURL addmoduleURL = liferayPortletResponse.createRenderURL();
addmoduleURL.setWindowState(LiferayWindowState.POP_UP);
addmoduleURL.setParameter("view", "editmodule");
//addmoduleURL.setParameter("moduleId", "0");
addmoduleURL.setParameter("editType", "add");
renderRequest.setAttribute("addmoduleURL", addmoduleURL.toString());
PortletURL moduleFilterURL = renderResponse.createRenderURL();
moduleFilterURL.setParameter("javax.portlet.action", "doView");
renderRequest.setAttribute("moduleFilterURL", moduleFilterURL.toString());
include(viewJSP, renderRequest, renderResponse);
}
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:46,代码来源:modulePortlet.java
示例20: getBlogLinks
import com.liferay.portal.kernel.portlet.LiferayWindowState; //导入依赖的package包/类
public static List<ContentLinks> getBlogLinks(
long groupId,
LiferayPortletRequest liferayPortletRequest,
LiferayPortletResponse liferayPortletResponse,
ThemeDisplay themeDisplay,
boolean getLinks,
boolean getImages)
throws Exception {
_log.debug("getBlogLinks for groupId " + String.valueOf(groupId));
List<ContentLinks> contentLinksList = new ArrayList<ContentLinks>();
List<BlogsEntry> blogsEntryList = BlogsEntryLocalServiceUtil.getGroupEntries(groupId, WorkflowConstants.STATUS_APPROVED, QueryUtil.ALL_POS, QueryUtil.ALL_POS);
PortletURL portletURL = liferayPortletResponse.createLiferayPortletURL(
PortalUtil.getControlPanelPlid(liferayPortletRequest),
PortletKeys.BLOGS_ADMIN,
PortletRequest.RENDER_PHASE);
portletURL.setWindowState(LiferayWindowState.POP_UP);
portletURL.setParameter("struts_action", "/blogs_admin/edit_entry");
for (BlogsEntry blogsEntry : blogsEntryList) {
if (!hasPermissionView(groupId, blogsEntry.getModelClassName(), blogsEntry.getPrimaryKey(), themeDisplay)) {
continue;
}
String content = blogsEntry.getContent();
if (content != null) {
List<String> links = parseLinks(content, getLinks, getImages);
if (links.size() > 0) {
portletURL.setParameter("entryId", String.valueOf(blogsEntry.getEntryId()));
ContentLinks contentLinks = new ContentLinks();
contentLinks.setClassName(blogsEntry.getModelClassName());
contentLinks.setClassPK(blogsEntry.getEntryId());
contentLinks.setContentTitle(blogsEntry.getTitle());
contentLinks.setContentEditLink(portletURL.toString());
contentLinks.setModifiedDate(blogsEntry.getModifiedDate());
contentLinks.setStatus(blogsEntry.getStatus());
_log.debug("Extracting links from blog entry " + blogsEntry.getEntryId() + " - " + blogsEntry.getTitle());
for (String link : links) {
contentLinks.addLink(link);
}
contentLinksList.add(contentLinks);
}
}
}
return contentLinksList;
}
开发者ID:craigvershaw,项目名称:link-scanner,代码行数:62,代码来源:LinkScannerUtil.java
注:本文中的com.liferay.portal.kernel.portlet.LiferayWindowState类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论