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;
}
java类javax.portlet.WindowStateException的实例源码
FrontendWebRegisterPortlet.java 文件源码
项目:opencps-v2
阅读 17
收藏 0
点赞 0
评论 0
modulePortlet.java 文件源码
项目:liferaylms-portlet
阅读 19
收藏 0
点赞 0
评论 0
@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");
}
}
ExceptionTests_WindowStateException_ApiRender.java 文件源码
项目:portals-pluto
阅读 17
收藏 0
点赞 0
评论 0
@Override
public void render(RenderRequest portletReq, RenderResponse portletResp)
throws PortletException, IOException {
long tid = Thread.currentThread().getId();
portletReq.setAttribute(THREADID_ATTR, tid);
PrintWriter writer = portletResp.getWriter();
JSR286ApiTestCaseDetails tcd = new JSR286ApiTestCaseDetails();
// Create result objects for the tests
/* TestCase: V2ExceptionTests_WindowStateException_ApiRender_getState */
/* Details: "Method getState(): Returns the WindowState object */
/* causing this exception" */
TestResult tr0 =
tcd.getTestResultFailed(V2EXCEPTIONTESTS_WINDOWSTATEEXCEPTION_APIRENDER_GETSTATE);
WindowState ws = new WindowState("teststate");
WindowStateException wse = new WindowStateException("Unsupported State Causing Exception", ws);
if (wse.getState().toString().equals("teststate")) {
tr0.setTcSuccess(true);
}
tr0.writeTo(writer);
}
MockPortletURL.java 文件源码
项目:spring4-understanding
阅读 22
收藏 0
点赞 0
评论 0
@Override
public void setWindowState(WindowState windowState) throws WindowStateException {
if (!CollectionUtils.contains(this.portalContext.getSupportedWindowStates(), windowState)) {
throw new WindowStateException("WindowState not supported", windowState);
}
this.windowState = windowState;
}
MockStateAwareResponse.java 文件源码
项目:spring4-understanding
阅读 23
收藏 0
点赞 0
评论 0
@Override
public void setWindowState(WindowState windowState) throws WindowStateException {
if (!CollectionUtils.contains(getPortalContext().getSupportedWindowStates(), windowState)) {
throw new WindowStateException("WindowState not supported", windowState);
}
this.windowState = windowState;
}
MockActionResponse.java 文件源码
项目:spring4-understanding
阅读 18
收藏 0
点赞 0
评论 0
@Override
public void setWindowState(WindowState windowState) throws WindowStateException {
if (this.redirectedUrl != null) {
throw new IllegalStateException("Cannot set WindowState after sendRedirect has been called");
}
super.setWindowState(windowState);
this.redirectAllowed = false;
}
MockPortletURL.java 文件源码
项目:spring4-understanding
阅读 21
收藏 0
点赞 0
评论 0
@Override
public void setWindowState(WindowState windowState) throws WindowStateException {
if (!CollectionUtils.contains(this.portalContext.getSupportedWindowStates(), windowState)) {
throw new WindowStateException("WindowState not supported", windowState);
}
this.windowState = windowState;
}
MockStateAwareResponse.java 文件源码
项目:spring4-understanding
阅读 20
收藏 0
点赞 0
评论 0
@Override
public void setWindowState(WindowState windowState) throws WindowStateException {
if (!CollectionUtils.contains(getPortalContext().getSupportedWindowStates(), windowState)) {
throw new WindowStateException("WindowState not supported", windowState);
}
this.windowState = windowState;
}
MockActionResponse.java 文件源码
项目:spring4-understanding
阅读 20
收藏 0
点赞 0
评论 0
@Override
public void setWindowState(WindowState windowState) throws WindowStateException {
if (this.redirectedUrl != null) {
throw new IllegalStateException("Cannot set WindowState after sendRedirect has been called");
}
super.setWindowState(windowState);
this.redirectAllowed = false;
}
BladeActionDisplayContext.java 文件源码
项目:liferay-blade-samples
阅读 19
收藏 0
点赞 0
评论 0
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();
}
BladeActionDisplayContext.java 文件源码
项目:liferay-blade-samples
阅读 19
收藏 0
点赞 0
评论 0
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();
}
BladeActionDisplayContext.java 文件源码
项目:liferay-blade-samples
阅读 24
收藏 0
点赞 0
评论 0
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();
}
LiferayViewUtil.java 文件源码
项目:liferaylms-portlet
阅读 18
收藏 0
点赞 0
评论 0
public static void setWindowStateRenderParameter(ActionResponse actionResponse,WindowState winState) throws WindowStateException
{
actionResponse.setWindowState(winState);
actionResponse.setRenderParameter("p_p_state", winState.toString());
// En teor�a el par�metro windowState del actionURL deber�a ser suficiente,
// y el setWindowState deber�a ser una in�til reiteraci�n, pero aun as�
// lo �nico que funciona es poner A PELO el p_p_state, o hago algo mal o es penoso en fin...
}
LiferayViewUtil.java 文件源码
项目:liferaylms-portlet
阅读 19
收藏 0
点赞 0
评论 0
public static String setPortletURLBack(ThemeDisplay themeDisplay,String backURL) throws WindowStateException
{
String jsBackURL;
if (backURL != null) jsBackURL = "window.location.href='" + backURL + "'";
else jsBackURL = "window.history.go(-1)";
themeDisplay.getPortletDisplay().setURLBack("javascript:" + jsBackURL);
return jsBackURL; // Como JavaScript
}
LmsActivitiesList.java 文件源码
项目:liferaylms-portlet
阅读 21
收藏 0
点赞 0
评论 0
public void deleteActivityBank(ActionRequest actionRequest, ActionResponse actionResponse)
throws PortalException, SystemException, IOException, WindowStateException{
long actId = ParamUtil.getLong(actionRequest, "resId", 0);
AssetEntry assetEntry = AssetEntryLocalServiceUtil.getEntry("com.liferay.lms.model.LearningActivity", actId);
assetEntry.setVisible(false);
AssetEntryLocalServiceUtil.updateAssetEntry(assetEntry);
}
modulePortlet.java 文件源码
项目:liferaylms-portlet
阅读 22
收藏 0
点赞 0
评论 0
@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");
}
MockPortletURL.java 文件源码
项目:class-guard
阅读 23
收藏 0
点赞 0
评论 0
@Override
public void setWindowState(WindowState windowState) throws WindowStateException {
if (!CollectionUtils.contains(this.portalContext.getSupportedWindowStates(), windowState)) {
throw new WindowStateException("WindowState not supported", windowState);
}
this.windowState = windowState;
}
MockStateAwareResponse.java 文件源码
项目:class-guard
阅读 21
收藏 0
点赞 0
评论 0
@Override
public void setWindowState(WindowState windowState) throws WindowStateException {
if (!CollectionUtils.contains(getPortalContext().getSupportedWindowStates(), windowState)) {
throw new WindowStateException("WindowState not supported", windowState);
}
this.windowState = windowState;
}
MockActionResponse.java 文件源码
项目:class-guard
阅读 19
收藏 0
点赞 0
评论 0
@Override
public void setWindowState(WindowState windowState) throws WindowStateException {
if (this.redirectedUrl != null) {
throw new IllegalStateException("Cannot set WindowState after sendRedirect has been called");
}
super.setWindowState(windowState);
this.redirectAllowed = false;
}
MockActionResponse.java 文件源码
项目:class-guard
阅读 21
收藏 0
点赞 0
评论 0
public void setWindowState(WindowState windowState) throws WindowStateException {
if (this.redirectedUrl != null) {
throw new IllegalStateException("Cannot set WindowState after sendRedirect has been called");
}
super.setWindowState(windowState);
this.redirectAllowed = false;
}
ActionResponseWrapperChecker.java 文件源码
项目:portals-pluto
阅读 19
收藏 0
点赞 0
评论 0
@Override
public void setWindowState(WindowState windowState) throws WindowStateException {
String meth = "setWindowState";
Object[] args = { windowState };
checkArgs(meth, args);
return;
}
EventResponseWrapperChecker.java 文件源码
项目:portals-pluto
阅读 20
收藏 0
点赞 0
评论 0
@Override
public void setWindowState(WindowState windowState) throws WindowStateException {
String meth = "setWindowState";
Object[] args = { windowState };
checkArgs(meth, args);
return;
}
StateAwareResponseImpl.java 文件源码
项目:portals-pluto
阅读 25
收藏 0
点赞 0
评论 0
public void setWindowState(WindowState windowState)
throws WindowStateException {
ArgumentUtility.validateNotNull("windowState", windowState);
if (isWindowStateAllowed(windowState)) {
checkSetStateChanged();
responseContext.setWindowState(windowState);
} else {
throw new WindowStateException("Can't set this WindowState",
windowState);
}
}
PortletURLImpl.java 文件源码
项目:portals-pluto
阅读 18
收藏 0
点赞 0
评论 0
public void setWindowState(WindowState windowState)
throws WindowStateException {
ArgumentUtility.validateNotNull("windowState", windowState);
if (isWindowStateAllowed(windowState)) {
urlProvider.setWindowState(windowState);
} else {
throw new WindowStateException("Can't set this WindowState",
windowState);
}
}
BladeActionConfigurationIcon.java 文件源码
项目:liferay-blade-samples
阅读 19
收藏 0
点赞 0
评论 0
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();
}
BladeActionConfigurationIcon.java 文件源码
项目:liferay-blade-samples
阅读 17
收藏 0
点赞 0
评论 0
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();
}
BladeActionConfigurationIcon.java 文件源码
项目:liferay-blade-samples
阅读 22
收藏 0
点赞 0
评论 0
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();
}
LiferayViewUtil.java 文件源码
项目:liferaylms-portlet
阅读 27
收藏 0
点赞 0
评论 0
public static void copyRequestToRenderParameters(ActionRequest actionRequest,ActionResponse actionResponse) throws WindowStateException
{
copyRequestToRenderParameters(actionRequest,null,null,actionResponse);
}
MockPortletURL.java 文件源码
项目:class-guard
阅读 20
收藏 0
点赞 0
评论 0
public void setWindowState(WindowState windowState) throws WindowStateException {
if (!CollectionUtils.contains(this.portalContext.getSupportedWindowStates(), windowState)) {
throw new WindowStateException("WindowState not supported", windowState);
}
this.windowState = windowState;
}
MockStateAwareResponse.java 文件源码
项目:class-guard
阅读 23
收藏 0
点赞 0
评论 0
public void setWindowState(WindowState windowState) throws WindowStateException {
if (!CollectionUtils.contains(getPortalContext().getSupportedWindowStates(), windowState)) {
throw new WindowStateException("WindowState not supported", windowState);
}
this.windowState = windowState;
}