Class IlxWPort
- java.lang.Object
-
- ilog.webui.dhtml.IlxWPort
-
- All Implemented Interfaces:
IlxWConstants
@Deprecated public class IlxWPort extends Object implements IlxWConstants
Deprecated.IlxWPortrepresents a port for printing web components to an HTML page.Overview
A port encapsulates the writer of the servlet response given in theIlxWPortconstructor.When you display components on an HTML page through an
IlxWPort, component deployers must always call theopen()method before printing any components, and theclose()method after having printed all components they want to display on the page.Code example
The following code example shows how to do a print operation using a
IlxWPortinstance.public void doPrint(IlxWPort port,boolean readonly,HttpSession session, HttpServletResponse response, IlrBusinessRule element) throws Exception { port.open(); if (readonly) { IlrSession rtsSession = element.getSession(); String html = getHTMLDefinition(rtsSession,(IlrDecisionTable)element); port.getXmlWriter().print(html); } else { DTableEditor tableEditor = new DTableEditor(element.getSession(), session, (IlrDecisionTable)element); tableEditor.print(port); } port.close(); }
-
-
Field Summary
Fields Modifier and Type Field Description static StringPARENT_WINDOW_NOT_IN_SAME_DOMAINDeprecated.-
Fields inherited from interface ilog.webui.dhtml.IlxWConstants
ATTR_CONFIG_RESNAME, ATTR_EXCEPTION, ATTR_IE5UPDATE, ATTR_MODIFIERS, ATTR_OPENPORT, ATTR_REQUESTPATH, ATTR_UPDATEREQUEST_LIST, ATTRIBUTE_SERVICE, CID_PREFIX, DATE_FORMAT_DATE, DATE_FORMAT_DATETIME, DATE_FORMAT_TIME, HTML_ESCAPE, ILRIFRAME, IMGID_PREFIX, MIME_APPLICATION_JAVASCRIPT, MIME_IMAGE_GIF, MIME_IMAGE_JPG, MIME_TEXT_HTML, NO_ESCAPE, PARAM_CONTROLLER_PATH, PARAM_DATA, PARAM_PORT, PARAM_RESOURCE_MANAGER_PATH, PARAM_SERVICE, PARAM_SERVLET_CONTEXT_DELEGATE, PARAM_VIEW_PATH, PROP_ACTION, PROP_AFTER, PROP_ALIGN, PROP_BACKGROUND_COLOR, PROP_BEFORE, PROP_BORDER, PROP_BORDER_BOTTOM, PROP_BORDER_COLOR, PROP_BORDER_LEFT, PROP_BORDER_RIGHT, PROP_BORDER_STYLE, PROP_BORDER_TOP, PROP_BORDER_WIDTH, PROP_BOTTOM_RIGHT_ICON, PROP_CELL_PADDING, PROP_CELL_SPACING, PROP_CHECKMENU_ICON, PROP_COLOR, PROP_COLS, PROP_COLUMNS, PROP_CURSOR, PROP_DATE_FORMAT, PROP_DHTML, PROP_EMPTY_TEXT, PROP_ENABLED, PROP_FILTER, PROP_FONT, PROP_FONT_FAMILY, PROP_FONT_SIZE, PROP_FONT_STYLE, PROP_FONT_WEIGHT, PROP_HEIGHT, PROP_ICON, PROP_ICON_TEXT_GAP, PROP_INNER_HTML, PROP_ITEM_HEIGHT, PROP_LINE_HEIGHT, PROP_MIME_TYPE, PROP_MINUS_SQUARE_ICON, PROP_NOWRAP, PROP_ONMOUSEOUT, PROP_ONMOUSEOVER, PROP_OVERFLOW, PROP_PADDING, PROP_PATH, PROP_PLUS_SQUARE_ICON, PROP_POSTPONED, PROP_RIGHT_ICON, PROP_ROOT_VISIBLE, PROP_ROWS, PROP_SELECTED, PROP_SELECTED_INDEX, PROP_SELECTION_BACKGROUND_COLOR, PROP_SELECTION_COLOR, PROP_SHOW_HORIZONTAL_LINES, PROP_SHOW_VERTICAL_LINES, PROP_SHOWS_ROOT_HANDLES, PROP_SQUARE_ICON, PROP_SUBMENU_ICON, PROP_TAB_PLACEMENT, PROP_TEXT, PROP_TEXT_DECORATION, PROP_TEXT_POSITION, PROP_TOOLTIP, PROP_TOP_BOTTOM_ICON, PROP_TOP_BOTTOM_RIGHT_ICON, PROP_TOP_RIGHT_ICON, PROP_TOP_ROW, PROP_TOTAL_ROW_COUNT, PROP_VALIGN, PROP_VISIBLE_ROW_COUNT, PROP_WIDTH, SERVICE_BLANKPAGE, SERVICE_BLANKPAGE_INT, SERVICE_COMMAND, SERVICE_COMMAND_INT, SERVICE_FORWARD, SERVICE_FORWARD_INT, SERVICE_SERIALIZE, SERVICE_SERIALIZE_INT, TARGET_IFRAME, TARGET_SELF, VAR_PREFIX, WEB_ALREADY_ATTACHED, WEB_MISSING_OPENPORT, WEB_NULL_MANAGER, XML_ESCAPE
-
-
Constructor Summary
Constructors Constructor Description IlxWPort(javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Writer out)Deprecated.Constructs a new port.IlxWPort(javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.ServletOutputStream out)Deprecated.Constructs a new port.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddDependency(IlxWDependencyProvider user, IlxWDependencyProvider used)Deprecated.voidaddUpdatingRequest(IlxWRequestDesc desc)Deprecated.Adds an updating request descriptor to the manager's updating request list.voidclose()Deprecated.Ends printing to the port.voidcloseForm()Deprecated.Closes a form.StringdisableOnload(String jsCode)Deprecated.Gets the given Javascript code and wraps it in an if-then block which will execute the given code only if the page is not locked.voidgenerateIFrames(int portNumber)Deprecated.ObjectgetAttribute(String string)Deprecated.Returns the object bound with the specified name in this port, ornullif no object is bound under that name.IlxWBrowserInfogetBrowserInfo()Deprecated.Gets the browser information object associated with this port.javax.servlet.ServletContextgetContext()Deprecated.Gets the servlet context associated with this port.static IlxWPortgetCurrentPort()Deprecated.Gets the current port.booleangetEncloseInForm()Deprecated.Gets theEncloseInFormflag.StringgetFloatingWindowName()Deprecated.javax.servlet.http.HttpServletRequestgetRequest()Deprecated.Gets the servlet request associated with this port.javax.servlet.http.HttpServletResponsegetResponse()Deprecated.Gets the servlet response associated with this port.StringgetServletPath()Deprecated.Gets the path of the controller servlet on the server.StringgetViewServletPath()Deprecated.PrintWritergetWriter()Deprecated.Gets the writer encapsulated by this port.protected voidinitResponse()Deprecated.Initializes the response.voidinvalidatePage()Deprecated.Invalidates the whole page.voidinvokeLater(Runnable doRun)Deprecated.CausesdoRun.run()to be executed asynchronously.booleanisGenerateIFramesInClose()Deprecated.voidopen()Deprecated.Opens the port.voidopenForm()Deprecated.Opens a form.voidsetAttribute(String string, Object value)Deprecated.Binds an object to this port, using the specified name.voidsetEncloseInForm(boolean b)Deprecated.Sets theEncloseInFormflag.voidsetFloatingWindowName(String floatingWindowName)Deprecated.voidsetGenerateIFramesInClose(boolean flag)Deprecated.
-
-
-
Field Detail
-
PARENT_WINDOW_NOT_IN_SAME_DOMAIN
public static final String PARENT_WINDOW_NOT_IN_SAME_DOMAIN
Deprecated.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
IlxWPort
public IlxWPort(javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Writer out)Deprecated.Constructs a new port.- Parameters:
context- The current servlet context.request- The current request.response- The current response.out- The writer where the HTML page will be printed. Typically, this is either the writer given by the response passed in thedoGet/doPostmethod of a servlet, or theoutvariable of a JSP page.- Since:
- JRules 3.5
-
IlxWPort
public IlxWPort(javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.ServletOutputStream out)Deprecated.Constructs a new port.- Parameters:
context- The current servlet context.request- The current request.response- The current response.out- TheServletOutputStreamwhere the HTML page will be printed. Typically, this is either the stream given by the response passed in thedoGet/doPostmethod of a servlet, or theoutvariable of a JSP page.- Since:
- JRules 3.5
-
-
Method Detail
-
setAttribute
public void setAttribute(String string, Object value)
Deprecated.Binds an object to this port, using the specified name. If an object of the same name is already bound to the container, the object is replaced.- Parameters:
string- The name to which the object is bound; cannot benull.value- The object to be bound; cannot benull.
-
getAttribute
public Object getAttribute(String string)
Deprecated.Returns the object bound with the specified name in this port, ornullif no object is bound under that name.- Parameters:
string- A string specifying the name of the object.- Returns:
- The object with the specified name.
-
getWriter
public PrintWriter getWriter()
Deprecated.Gets the writer encapsulated by this port.
This method encapsulates the writer passed to the port constructor. ThisPrintWriterhas itsautoflushproperty set totrue. Do not forget to call one of theprintlnmethod in order to flush the underlying buffer.- Returns:
- The writer encapsulated by this port.
- See Also:
PrintWriter
-
setGenerateIFramesInClose
public void setGenerateIFramesInClose(boolean flag)
Deprecated.
-
isGenerateIFramesInClose
public boolean isGenerateIFramesInClose()
Deprecated.
-
getBrowserInfo
public IlxWBrowserInfo getBrowserInfo()
Deprecated.Gets the browser information object associated with this port. This object is computed according to the request initially passed to the port constructor.
-
getServletPath
public String getServletPath()
Deprecated.Gets the path of the controller servlet on the server.- Returns:
- The path of the controller servlet servlet.
- See Also:
IlxWController
-
getFloatingWindowName
public String getFloatingWindowName()
Deprecated.
-
setFloatingWindowName
public void setFloatingWindowName(String floatingWindowName)
Deprecated.
-
getViewServletPath
public String getViewServletPath()
Deprecated.
-
open
public void open() throws IOExceptionDeprecated.Opens the port. Component deployers must call this method before printing any components to the port. Calling this method generates a JavaScript code block on the current writer, which is used by the web components on the client side.- Throws:
IOException- See Also:
close(),IlxWComponent.print(ilog.webui.dhtml.IlxWPort)
-
addDependency
public void addDependency(IlxWDependencyProvider user, IlxWDependencyProvider used)
Deprecated.
-
close
public void close() throws IOExceptionDeprecated.Ends printing to the port. Component deployers must call this method after having printed all components to the port. This method generates a JavaScript code block on the current writer, which is used by the web components on the client side.- Throws:
IOException- See Also:
open(),IlxWComponent.print(ilog.webui.dhtml.IlxWPort)
-
generateIFrames
public void generateIFrames(int portNumber) throws IOExceptionDeprecated.- Throws:
IOException
-
getRequest
public javax.servlet.http.HttpServletRequest getRequest()
Deprecated.Gets the servlet request associated with this port. This is the request passed to the port constructor.- Returns:
- The servlet request associated with this port
-
getResponse
public javax.servlet.http.HttpServletResponse getResponse()
Deprecated.Gets the servlet response associated with this port. This is the response passed to the port constructor.- Returns:
- The servlet response associated with this port
-
getContext
public javax.servlet.ServletContext getContext()
Deprecated.Gets the servlet context associated with this port. This is the context passed to the port constructor.- Returns:
- The servlet context associated with this port.
-
initResponse
protected void initResponse()
Deprecated.Initializes the response. This method is called by theopen()method and initializes the headers of the current response, asking the page not to be cached on the web browser and setting the content type of the page to text/html. Usually, you do not have to change this behavior. Nevertheless, if you wish to initialize headers in a different way, you may write your ownIlxWPortclass and redefine theinitResponsemethod.
-
openForm
public void openForm() throws IOExceptionDeprecated.Opens a form. This will print an opening form tag on this port's writer. This may be useful if you wish to print some components using <input> tags (button, text field, text area, and so on).- Throws:
IOException
-
closeForm
public void closeForm() throws IOExceptionDeprecated.Closes a form.- Throws:
IOException- See Also:
openForm()
-
getCurrentPort
public static IlxWPort getCurrentPort()
Deprecated.Gets the current port. This port is local to the current thread and should have been set by the framework as aThreadLocalvariable. This method is intended to be used in order to retrieve the current port in a context where the port is not directly accessible through the current scope (as a parameter of the current method, for instance). Under certain circumstances, you may need to retrieve the current port through this method.Suppose for instance you want to add a tree model listener (
javax.swing.tree.TreeModelListener) on the tree component (ilog.webui.dhtml.components.IlxWTree), and need the value of a request parameter in one of the listener method.
As the port is not directly accessible from thetreeXXX(TreeModel)methods, you will have to retrieve the port withgetCurrentPort. Here is the code you will typically write:class MyTreeModelListener implements TreeModelListener { public void treeNodesChanged(TreeModelEvent e) { IlxWPort port = IlxWPort.getCurrentPort(); if (port!=null) { String myParam = port.getRequest().getParameter("myParam"); System.err.println("myParam: "+myParam); ... } } }When usingIlxWPort.getCurrentPortyou should always test if the returned port isnullin case the current execution context is outside a web components request/response context.- Returns:
- the current port, if it exists. Otherwise returns
null.
-
invalidatePage
public void invalidatePage()
Deprecated.Invalidates the whole page. On browsers supporting incremental update (IE5), it means that the page must be fully re-printed in the response, instead of only refreshing invalidated components.
On older browsers, this method has no effect, as the page is always re-printed by the framework.IMPLEMENTATION NOTE: Calling this method has the same effect than calling:
port.addUpdatingRequest(IlxWRequestDesc("myjsp.jsp", "_self"))but this is much more efficient as the page is directly forwarded in the current response instead of being requested from the client.
-
addUpdatingRequest
public void addUpdatingRequest(IlxWRequestDesc desc)
Deprecated.Adds an updating request descriptor to the manager's updating request list. Typically, component deployers will add an updating request when working with multiple frames. In fact, it may happen that a component is modified on the server while a request is being processed but the request is not the one that will redisplay the modified component. Therefore, if the modified component belongs to another frame than the one used as the target of the the current send request, the component has no chance to be refreshed, unless you add an updating request to the manager.The updating request list is sent to the client the next time a port associated with the manager's session is closed (by @{link IlxWPort#close}): a JavaScript code block is appended to the end of the HTML page to ask the specified requests to be sent to the server. Once is has been printed, the updating request list is cleared.
- Parameters:
desc- The request descriptor giving the path of the request to send and the name of the target frame where the response will be displayed.
-
setEncloseInForm
public void setEncloseInForm(boolean b)
Deprecated.Sets theEncloseInFormflag. By default, this flag is true, meaning that theopen()andclose()methods respectively generate the <form> and </form> HTML tags.
Actually, most of the existing web components generate form elements (<input type="submit">, <input type="text">, etc.) Those form elements are not used by the framework as the parameters of a request sent by an enclosing form, but simply as gadgets whose interaction is managed by JavaScript handlers. However, with old generation browsers (for example, Netscape Navigator 3/4), an enclosing form tag is needed, otherwise those gadgets are not displayed at all on the browser.
This is the reason why, by default, a port encloses the printed components in a form tag (using theopenForm()andcloseForm()methods). However, in some cases, you may not want this HTML form to be printed. For instance, you may already have printed a<form>opening tag in your HTML page and because nested forms are usually not supported by web browsers, you may experience some problems. In those cases, you must set theencloseInFormflag tofalse.- See Also:
open(),close(),openForm(),closeForm()
-
getEncloseInForm
public boolean getEncloseInForm()
Deprecated.Gets theEncloseInFormflag.- See Also:
setEncloseInForm(boolean)
-
invokeLater
public void invokeLater(Runnable doRun)
Deprecated.CausesdoRun.run()to be executed asynchronously. This will happen after all pending events of the current incoming request have been processed, and just before sending the response.
-
disableOnload
public String disableOnload(String jsCode)
Deprecated.Gets the given Javascript code and wraps it in an if-then block which will execute the given code only if the page is not locked. A page is considered as locked by the client-side of the web components framework, when a request has been sent to the controller and a response is waited.If, in the implementation of a web component proxy, you want to perform a client interaction which manipulates the client side of the framework, for instance call the JavaScript method IlxWPort.sendData() when a link is clicked, you should always protect your call with this method.
- Since:
- JRules 7.0
-
-