本文整理汇总了Java中javax.portlet.WindowStateException类的典型用法代码示例。如果您正苦于以下问题:Java WindowStateException类的具体用法?Java WindowStateException怎么用?Java WindowStateException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WindowStateException类属于javax.portlet包,在下文中一共展示了WindowStateException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generateURLJsonObject
import javax.portlet.WindowStateException; //导入依赖的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;
}
示例2: editmodule
import javax.portlet.WindowStateException; //导入依赖的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");
}
}
示例3: render
import javax.portlet.WindowStateException; //导入依赖的package包/类
@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);
}
示例4: setWindowState
import javax.portlet.WindowStateException; //导入依赖的package包/类
@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;
}
示例5: setWindowState
import javax.portlet.WindowStateException; //导入依赖的package包/类
@Override
public void setWindowState(WindowState windowState) throws WindowStateException {
if (!CollectionUtils.contains(getPortalContext().getSupportedWindowStates(), windowState)) {
throw new WindowStateException("WindowState not supported", windowState);
}
this.windowState = windowState;
}
示例6: setWindowState
import javax.portlet.WindowStateException; //导入依赖的package包/类
@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;
}
示例7: _getOnclick
import javax.portlet.WindowStateException; //导入依赖的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();
}
示例8: setWindowStateRenderParameter
import javax.portlet.WindowStateException; //导入依赖的package包/类
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...
}
示例9: setPortletURLBack
import javax.portlet.WindowStateException; //导入依赖的package包/类
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
}
示例10: deleteActivityBank
import javax.portlet.WindowStateException; //导入依赖的package包/类
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);
}
示例11: newmodule
import javax.portlet.WindowStateException; //导入依赖的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");
}
示例12: setWindowState
import javax.portlet.WindowStateException; //导入依赖的package包/类
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;
}
示例13: setWindowState
import javax.portlet.WindowStateException; //导入依赖的package包/类
@Override
public void setWindowState(WindowState windowState) throws WindowStateException {
String meth = "setWindowState";
Object[] args = { windowState };
checkArgs(meth, args);
return;
}
示例14: setWindowState
import javax.portlet.WindowStateException; //导入依赖的package包/类
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);
}
}
示例15: setWindowState
import javax.portlet.WindowStateException; //导入依赖的package包/类
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);
}
}