<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
   <channel>
      <title>SpiderLogic</title>
      <link>http://blogs.oracle.com/slc/</link>
      <description>.. useful blog on java and middleware technologies. </description>
      <language>en</language>
      <copyright>Copyright 2009</copyright>
      <lastBuildDate>Mon, 06 Jul 2009 11:40:54 +0100</lastBuildDate>
      <generator>http://www.sixapart.com/movabletype/</generator>
      <docs>http://blogs.law.harvard.edu/tech/rss</docs> 

            <item>
         <title>The annotation @WebServiceRef</title>
         <description><![CDATA[<blockquote>   <h5>……… posted by </em><a href="mailto:d.pisano79@gmail.com"><em>Davide Pisano</em></a></em></h5> </blockquote>  <p>To invoke a method on a session bean, a client does not directly instantiate the bean using the new operator. It use the <i>Dependency Injection</i> (DI) to references the session bean<em>.</em> It is a powerful mechanism used from JavaEE 6 to obtain a resource reference on an object field. It is possible to inject various type of resource, as shown in the next picture.</p>  <p><a href="http://blogs.oracle.com/slc/WindowsLiveWriter/TheannotationWebServiceRef_AA50/di_6.jpg"><img title="di" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="188" alt="di" src="http://blogs.oracle.com/slc/WindowsLiveWriter/TheannotationWebServiceRef_AA50/di_thumb_2.jpg" width="450" border="0" /></a> </p>  <p>A DI example Using @EJB annotation could be:</p>  <blockquote>Server Code <font face="Courier New" color="#444444">     <br />@Stateless       <br />public class ItemEJB{       <br />......... </font>    <br />Client Code <font face="Courier New" color="#444444">     <br />.........       <br />@EJB ItemEJB itemEJB       <br />..........</font></blockquote>  <p></p>  <p>Now Shift attention to the annotation <b>WebServiceRef</b>. It provide to injects a reference to a web service. Having a WSDL, is possible write a java proxy (stub) to invoke a Web Service (WS). There are any tools (<i>wsimport </i>or<i> JDeveloper</i> for example) that provide to generate from a WSDL Java classes and interfaces that make possible the WS execution by a client program. Made interfaces&#160; are called &quot;<b>Service End-Point interface</b>&quot; (SEI) because it is a Java representation of a WS end-point. the SEI is a proxy that provide to a local java call to the remote WS via HTTP.</p>  <p>&#160;<a href="http://blogs.oracle.com/slc/WindowsLiveWriter/TheannotationWebServiceRef_AA50/ws.jpg"><img title="ws" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="142" alt="ws" src="http://blogs.oracle.com/slc/WindowsLiveWriter/TheannotationWebServiceRef_AA50/ws_thumb.jpg" width="348" border="0" /></a></p>  <p>The Client can get an instance of the proxy through DI using WebServiceRef. Applying this annotation, the container will injects an instance of the WS. As example if MyService is the service proxy produced by the WSDL using one of the tools mentioned above, it is possible to have: </p>  <blockquote><font face="Courier New" color="#444444">.............      <br />@WebServiceRef       <br />private MyService myService;       <br />...........       <br />MyItem myItem=myService.getMyItemPort();       <br />//use of myItem</font></blockquote> MyService is the SEI and not the WS. The <em>MyService</em> Object MUST extends <em>javax.xml.ws.Service</em> and generaly The Service object is generated by the tool as part of the SEI.   <p></p>  <p>If there aren’t containers in our execution environment (it is not a Servlet container, EJB Container or any other that support this annotation), the service class generated by a tool can't be references by the <em>@WebServiceRef</em> annotation but by the new key-word, as in the next example:</p>  <blockquote><font face="Courier New" color="#444444">.........      <br />MyService myService = new MyService();       <br />MyItem myItem=myService.getMyItemPort();       <br />.........</font></blockquote>  <blockquote>   <h5>……… posted by </em><a href="mailto:d.pisano79@gmail.com"><em>Davide Pisano</em></a></em></h5> </blockquote>  <div class="wlWriterEditableSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:17b82a8c-8a42-4618-85f1-910d9eb06a96" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">Technorati Tag: <a href="http://technorati.com/tags/Java" rel="tag">Java</a>,<a href="http://technorati.com/tags/WebServiceRef" rel="tag">WebServiceRef</a>,<a href="http://technorati.com/tags/dependency+injection" rel="tag">dependency injection</a></div>]]></description>
         <link>http://blogs.oracle.com/slc/2009/07/the_annotation_webserviceref.html</link>
         <guid>http://blogs.oracle.com/slc/2009/07/the_annotation_webserviceref.html</guid>
        
        
         <pubDate>Mon, 06 Jul 2009 11:40:54 +0100</pubDate>
      </item>
            <item>
         <title>Servlet Reveal</title>
         <description><![CDATA[<blockquote>   <h5>……… posted by </em><a href="mailto:d.pisano79@gmail.com"><em>Davide Pisano</em></a></em></h5> </blockquote>  <p align="justify">The Servlet version 2.5, introduces new&#160; feature, the most important of which is annotation. The following two sections provide a view on the difference between 2.4 and 2.5 versions and&#160; between 2.5 and 3.0 versions.</p> ]]></description>
         <link>http://blogs.oracle.com/slc/2009/06/servlet_reveal.html</link>
         <guid>http://blogs.oracle.com/slc/2009/06/servlet_reveal.html</guid>
        
        
         <pubDate>Sun, 28 Jun 2009 18:23:59 +0100</pubDate>
      </item>
            <item>
         <title>Java.nio vs Java.io</title>
         <description><![CDATA[<div style="width: 500px">   <blockquote>     <h5>……… posted by </em><a href="mailto:d.pisano79@gmail.com"><em>Davide Pisano</em></a></em></h5>   </blockquote>    <p>This document is not a Java.io or a Java.nio manual, or a technical document about Java.io and Java.nio use. It only attempts to compare these two packages, highlighting differences and features in the most simple way. Java.nio presents new stream communication aspects and inserts new buffer, file streaming and socket features.</p> <div id='extendedEntryBreak' name='extendedEntryBreak'></div>    <h2>java.io overview</h2>    <p>This package is used for system input and output through data streams, and serialization. Streams support many different kinds of data, including simple bytes, primitive data types, localized characters, and objects. A stream is a sequence of data: a program uses an <i>input stream</i> to read data from a source. <a href="http://blogs.oracle.com/slc/WindowsLiveWriter/Java.niovsJava.io_8CFE/ds-prog_4.gif"><img title="ds-prog" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; margin-left: 0px; margin-right: 0px; border-right-width: 0px" height="86" alt="ds-prog" src="http://blogs.oracle.com/slc/WindowsLiveWriter/Java.niovsJava.io_8CFE/ds-prog_thumb_1.gif" width="244" align="left" border="0" /></a> </p>    <p>&#160;</p>    <p>&#160;</p>    <p>A program uses an <i>output stream</i> to write and send data to a destination:<a href="http://blogs.oracle.com/slc/WindowsLiveWriter/Java.niovsJava.io_8CFE/prog-ds_2.gif"><img title="prog-ds" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="84" alt="prog-ds" src="http://blogs.oracle.com/slc/WindowsLiveWriter/Java.niovsJava.io_8CFE/prog-ds_thumb.gif" width="244" border="0" /></a>&#160;</p>    <p align="justify">Programs use <i>byte streams</i> to perform byte input and output. All byte stream classes extends <u><a href="http://java.sun.com/javase/6/docs/api/java/io/InputStream.html">InputStream</a></u> and <u><a href="http://java.sun.com/javase/6/docs/api/java/io/OutputStream.html">OutputStream</a></u>.</p>    <h3>About InputStream and OutputStream</h3>    <p align="justify">Performing InputStream operations or OutputStream operations means generally having a loop that reads the input stream and writes the output stream one byte at a time. You can use <i>buffered</i> I/O streams for an overhead reduction (overhead generated by each such request often triggers disk access, network activity, or some other operation that is relatively expensive). Buffered input streams read data from a memory area known as a <i>buffer</i>; the native input API is called only when the buffer is empty. Similarly, buffered output streams write data to a buffer, and the native output API is called only when the buffer is full. Those buffered API wrap the unbuffered streams: <a href="http://java.sun.com/javase/6/docs/api/java/io/BufferedInputStream.html"><u>BufferedInputStream</u></a> and <a href="http://java.sun.com/javase/6/docs/api/java/io/BufferedOutputStream.html"><u>BufferedOutputStream</u></a>.</p>    <h3>File I/O</h3>    <p>The above section focuses on streams, which provide a simple model for reading and writing data. Streams work with a large variety of data sources and destinations, including disk files. However, streams don't support all the operations that are common with disk files.The following links give information on non-stream file I/O. There are two topics:</p>    <ul>     <li>       <p><a href="http://java.sun.com/docs/books/tutorial/essential/io/file.html"><u>File</u></a> is a class that helps to write platform independent code for examining and manipulating files and directories.</p>     </li>      <li>       <p><u><a href="http://java.sun.com/docs/books/tutorial/essential/io/rafs.html">Random access files</a></u> support non sequential access to disk file data.</p>     </li>   </ul>    <h3>java.net socket</h3>    <p align="justify">A socket is one endpoint of a two-way communication link between two programs running on the network. Socket classes are used to represent the connection between a client program and a server program. The java.net package provides two classes: Socket and ServerSocket. These implement the client side of the connection and the server side of the connection, respectively.</p>    <p align="justify">The client knows the host-name of the machine on which the server is running ,and the port number on which the server is listening. Clients try to connect to the server and if everything goes well, the server accepts the connection. Upon acceptance, the server gets a new socket bound to the same local port and also has its remote endpoint set to the address and port of the client. It needs a new socket so that it can continue to listen to the original socket for connection requests while tending to the needs of the connected client.</p>    <p align="justify">The server waits for a client connection in blocking mode: <b>serverSocket.accept() is a blocking instruction, the server waits for a connection </b>and no other operation can be executed by the thread which runs the server. Because of this, the server can work in multitasking only by implementing a multi-thread server: having to create a thread for every new socket created by the server.</p>    <h2>NIO API</h2>    <p align="justify">The I/O performance, often, is a modern application critical aspect. Operative Systems (OS) continuously improve the I/O performance. JVM provides a uniform operating environment that helps the Java programmer in most of the differences between operating-system environments. This makes it faster and easier to write, but the OS feature becomes hidden. To increase IO performance you could write a specific code to access the OS feature directly, but this isn’t the best solution - your code could be OS dependent. Java.nio provides new equipment to address this problem. It provides high-performance I/O features to perform operations on commonly available commercial operating systems today.</p>    <p align="justify">The NIO packages of JDK 1.4 introduce a new set of abstractions for doing I/O. </p>    <h3>java.nio overview</h3>    <p>Java.nio is the new package that implements the <b>New I/O APIs for the Java Platform. </b>The NIO APIs include the following features:</p>    <ul>     <li>       <p>Buffers for data of primitive types</p>     </li>      <li>       <p>Character-set encoders and decoders</p>     </li>      <li>       <p>A pattern-matching facility based on Perl-style regular expressions</p>     </li>      <li>       <p>Channels, a new primitive I/O abstraction</p>     </li>      <li>       <p>A file interface that supports locks and memory mapping</p>     </li>      <li>       <p>A multiplexed, non-blocking I/O facility for writing scalable servers</p>     </li>   </ul>    <p align="justify">At the sun site is it possible to find exhaustive technical documentation about java.nio. Now I’ll explain some of nio's aspects to show the difference betwen the old library java.io. and java.nio. Be advised, java.nio is not a java.io substitute, rather it is a java.io ‘expansion’. Nio's birth has caused a revision of Io's class and interface (<u><a href="http://java.sun.com/j2se/1.4.2/docs/guide/nio/">look at this link</a></u>).</p>    <p align="justify">One of the most important aspects of NIO is the ability to operate in non-blocking mode, denied to the traditional java I/O library. But what is non-blocking mode?</p>    <h3>Non blocking mode</h3>    <p align="justify">The bytes of an I/O stream must be accessed sequentially. Devices, printer ports, and network connections are common examples of streams.</p>    <p align="justify">Streams are generally, but not necessarily, slower than block devices, and are often the source of intermittent input. Most operating systems allow streams to be placed into non-blocking mode, which permits a process to check if input is available on the stream, without getting stuck if none is available at a given moment. Such a capability allows a process to handle input as it arrives but perform other functions while the input stream is idle. The operating system can be told to watch a collection of streams and indicate which of those streams are ready. This ability permits a process to multiplex many active streams using common code and a single thread by leveraging the readiness information returned by the operating system. This is widely used in network servers to handle large numbers of network connections.</p>    <h3>Buffers</h3>    <p align="justify">Starting from the simplest and building up to the most complex, the first improvement to mention is the set of Buffer classes found in the java.nio package. These buffers provide a mechanism to store a set of primitive data elements in an <i>in-memory container</i>. A <i>Buffer </i>object is a container for a fixed amount of data, a container where data can be read and written.</p>    <p align="justify">All buffers are readable, but not all are writable. Each buffer class implements <i>isReadOnly() </i>to indicate whether it will allow the buffer content to be modified.</p>    <h3>Channels</h3>    <p align="justify">Buffers work with channels. Channels are portals through which I/O transfers take place, and buffers are the sources or targets of those data transfers. Data you want to send is placed in a buffer, which is passed to a channel; otherwise, a channel deposits data in a buffer you provide.</p>    <p align="justify">A Channel is like a tube that transports data efficiently between byte buffers and the entity on the other end of the channel. Channels are gateways through which the native I/O services of the operating system can be accessed with a minimum of overhead, and buffers are the internal endpoints used by channels to send and receive data.</p>    <p align="justify">Channels can operate in <i>blocking </i>or <i>non-blocking </i>modes. A channel in non-blocking mode never puts the invoking thread to sleep. The requested operation either completes immediately or returns a result indicating that nothing was done. Only stream-orientated channels, such as sockets can be placed in nonblocking mode. In the java.nio channel family there are <i>FileChannel</i>, <i>ServerSocketChannel</i> and <i>SocketChannel</i>; these are specific channels created for file and socket management.</p>    <h3>FileChannel</h3>    <p align="justify">FileChannels are read/write channels, they are always blocking and cannot be placed into nonblocking mode. The nonblocking paradigm of stream-oriented I/O doesn't make as much sense for file-oriented operations because of the fundamentally different nature of file I/O.</p>    <p align="justify">FileChannel objects cannot be created directly. A FileChannel instance can be obtained only by calling <i>getChannel() </i>on an open file object (<i>RandomAccessFile</i>, <i>FileInputStream</i>, or F<i>ileOutputStream</i>). <i>GetChannel() </i>method returns a <i>FileChannel </i>object connected to the same file, with the same access permissions as the file object.<i> FileChannel </i>objects are thread-safe. Multiple threads can concurrently call methods on the same instance without causing any problems, but not all operations are multi-thread. Operations that affect the channel's position or the file size are single-threaded.</p>    <p align="justify">Using FileChannel, operations like file copy become a channel to channel trasfer (<i>transferTo() </i>and <i>transferFrom()</i>)and read/write operations become easy using buffers.</p>    <h3>SocketChannel</h3>    <p align="justify">SocketChannel is different to FileChannel: The new socket channels can operate in nonblocking mode and are selectable. It's no longer necessary to dedicate a thread to each socket connection, Using the new NIO classes, one or a few threads can manage hundreds or even thousands of active socket connections with little or no performance loss. It's possible to perform readiness selection of socket channels using a <i>Selector </i>object.</p>    <p align="justify">There are three socket channel type: <i>SocketChannel</i>, <i>ServerSocketChannel</i>, and <i>DatagramChannel</i>; SocketChannel and DatagramChannel are able to read and write, ServerSocketChannel listens for incoming connects and creates new SocketChannel objects. All the socket channels create a peer socket object when they are instantiated (java.net sockets). The peer socket can be obtained from a channel by invoking its <i>socket() </i>method. While every socket channel (in java.nio.channels) has an associated java.net socket object, not all sockets have an associated channel. If you create a <i>Socket </i>object in the traditional way, by instantiating it directly, it will not have an associated <i>SocketChannel</i>, and its <i>getChannel() </i>method will always return null.</p>    <p align="justify">Socket channels can operate in nonblocking mode. The blocking nature of traditional Java sockets has traditionally been one of the most significant limitations to Java application scalability. Non-blocking I/O is the basis upon which many sophisticated, high-performance applications are built. Setting or resetting a channel's blocking mode is easy. Simply call <i>configureBlocking().</i></p>    <p align="justify">Nonblocking sockets are usually thought of for server-side use because they make it easier to manage many sockets simultaneously.</p>    <h3>Selector</h3>    <p align="justify">Selectors provide the ability to have a channel readiness selection, which enables multiplexed I/O. To understand selector feature, I can explain selector advantage using the following example.</p>    <p align="justify">Imagine you are in a train station (<i>non-selector</i>), and there are three platforms (<i>channels</i>), and on each platform a train arrives (<i>buffer</i>). On each platform there is a controller for each arrived train (<i>worker </i><i>thread</i>). That is non-selector.&#160; Now imagine selector.&#160; There are three platforms (<i>channel</i>), on each platform arrives a train (buffer), and each platform has an indicator (a bell for example) that says “Train arrived” (<em>selection key</em>). In this instance there is only one controller for all three platforms.&#160; He looks at the indicator (<i>selector.select()</i>) to find out if a train has arrived and goes to meet that train.</p>    <p align="justify">It's simple to understand the advantages of using selector: with a single thread you can obtain a multitasking application. As well as this, you can obtain more advantages using non-blocking selector! Imagine that the train controller looks at the indicator: he can wait for a new train and not do any other thing (blocking mode using <i>selector.select()</i>). But he can instead control tickets, for example, while waiting for a new train (non-blocking mode using <i>selector.selectNow()</i>).&#160; In this way selector returns null and continue to execute code.</p>    <h2>IO vs. NIO</h2>    <p align="justify">NIO construction makes I/O faster than traditional I/O. In a program where the I/O operations constitute a significant amount of the processing, expect to see some difference. For example if an application has to copy files or transfer bytes using sockets, using Nio is possible to obtain a faster performance because it is closer to the OS than the I/O API. Increasing the byte size, the difference becomes&#160; more appreciable. Nio also provides other features not in io API, for streaming operations. However, it is not possible to substitute IO with NIO because NIO API adds functionalities to the java.io. NIO extends the native IO API introducing new possibilities for the developer to manipulate stream data in a powerful way.</p>    <h2>References</h2>    <ul>     <li>       <h3><a href="http://java.sun.com/javase/6/docs/">JDK 6 Documentation</a></h3>     </li>      <li>       <h3>“JAVA NIO” - Ron Hitchens - Publisher: O'Reilly</h3>     </li>   </ul>    <blockquote>     <p>&#160;</p>   </blockquote> </div>  <blockquote>   <h5>……… posted by </em><a href="mailto:d.pisano79@gmail.com"><em>Davide Pisano</em></a></em></h5> <br/><br/> </blockquote>  <div class="wlWriterEditableSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:778e7e5f-6862-428a-914c-06f815f5de37" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">Technorati Tag: <a href="http://technorati.com/tags/java" rel="tag">java</a>,<a href="http://technorati.com/tags/java.nio" rel="tag">java.nio</a>,<a href="http://technorati.com/tags/java.io" rel="tag">java.io</a></div>]]></description>
         <link>http://blogs.oracle.com/slc/2009/06/javanio_vs_javaio.html</link>
         <guid>http://blogs.oracle.com/slc/2009/06/javanio_vs_javaio.html</guid>
        
        
         <pubDate>Thu, 18 Jun 2009 09:11:00 +0100</pubDate>
      </item>
            <item>
         <title>Introduction to Bayeux Protocol (HTTP Publish-Subscribe)</title>
         <description><![CDATA[<p><strong><font color="#ff0000">Attention:</font></strong> <u>This is a short overview presentation showed at JavaDay Rome in 24 January 2009 on the form of slideshow. </u></p>  <p><u></u></p>  <table bordercolor="#c0c0c0" cellspacing="0" cellpadding="2" width="600" border="1"><tbody>     <tr>       <td valign="top" width="598">         <p align="right"><i><font color="#ff0000"><u>Beginning HTTP</u></font></i></p>          <ul>           <li>HTTP was designed as a protocol for retriving documents from remote servers              <ul>               <li>Communication between the client and the server is always initiated by the client and never by the server </li>                <li>Connections between the client and the server are transient and the server do not maintain any long-term state information regarding the client </li>             </ul>           </li>         </ul>          <table cellspacing="0" cellpadding="2" width="496" border="0"><tbody>             <tr>               <td valign="top" width="140">&#160;</td>                <td valign="top" width="153">&#160;</td>                <td valign="top" align="right" width="201"><a href="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_4.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="69" alt="image" src="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_thumb_1.png" width="74" border="0" /></a> </td>             </tr>           </tbody></table>       </td>     </tr>      <tr>       <td valign="top" width="598">         <p align="right"><i><font color="#ff0000"><u>Twist the Formula</u></font></i></p>          <ul>           <li>Why, then, should you want the server to be able to contact the client, and maintain persistent connections? </li>         </ul>          <p align="center"><strong><i>- There</i><i> </i><i>are</i><i> </i><i>several</i><i> suitable </i></strong></p>          <p align="center"><strong><i>common</i><i> use </i><i>case</i></strong><i><strong> -</strong> </i></p>          <p align="left"></p>       </td>     </tr>      <tr>       <td valign="top" width="598">         <p align="right"><i><font color="#ff0000"><u>use cases: AdviceME</u></font></i></p>          <ul>           <li>Monitoring and Data Feeds              <ul>               <li>Client as a Dashboard or Monitor </li>                <li>Demand for monitoring applications </li>                <li>Market data feeds </li>                <li>Security Alerting </li>                <li>SLA Violation Advisor </li>             </ul>           </li>         </ul>          <p align="right"><a href="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_8.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="172" alt="image" src="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_thumb_3.png" width="219" border="0" /></a> </p>       </td>     </tr>      <tr>       <td valign="top" width="598">         <p align="right"><i><font color="#ff0000"><u>use cases: Please Wait</u></font></i></p>          <ul>           <li>Progress Updates              <ul>               <li>Communicating progress on long-running server-side activities </li>                <li>Report progress on long running server task </li>             </ul>           </li>         </ul>          <p>&#160;</p>          <p align="center"><a href="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_10.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="81" alt="image" src="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_thumb_4.png" width="416" border="0" /></a> </p>       </td>     </tr>      <tr>       <td valign="top" width="598">         <p align="right"><i><font color="#ff0000"><u>use cases: Share with me</u></font></i></p>          <ul>           <li>Chat and Collaboration              <ul>               <li>Chat System </li>                <li>Photo sharing </li>                <li>On-Line Gaming </li>                <li>Collaborative Tools </li>             </ul>           </li>         </ul>          <p align="right"><a href="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_12.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="106" alt="image" src="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_thumb_5.png" width="335" border="0" /></a> </p>       </td>     </tr>      <tr>       <td valign="top" width="598">         <p align="right"><i><font color="#ff0000"><u>Actual Approachs</u></font></i></p>          <ul>           <li><b>Push Using Poling </b>              <ul>               <li>Collaborative ability by pooling the server with client regular request asking for update.                  <ul>                   <li>Network wasteful </li>                    <li>Server resource exhaustion </li>                    <li>Client repeatedly contact the server to check for change </li>                    <li>Pooling schedule not affected </li>                 </ul>               </li>             </ul>           </li>         </ul>          <p align="center"><a href="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_14.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="211" alt="image" src="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_thumb_6.png" width="350" border="0" /></a> </p>       </td>     </tr>      <tr>       <td valign="top" width="598">         <p align="right"><i><font color="#ff0000"><u>Actual Approachs</u></font></i></p>          <ul>           <li><b>Piggybacking </b>              <ul>               <li>The contents of the response aren&#8217;t strictly related to the nature of the request </li>                <li>Response will also contain any changes to the domain model </li>                <li>Pooling schedule reset </li>             </ul>           </li>         </ul>          <p align="center"><a href="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_16.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="205" alt="image" src="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_thumb_7.png" width="341" border="0" /></a> </p>       </td>     </tr>      <tr>       <td valign="top" width="598">         <p align="right"><i><font color="#ff0000"><u>&lt;&lt;COMET&gt;&gt;</u></font></i></p>          <ul>           <li>Comet techniques              <ul>               <li>Keep the response stream open for a significantly longer time </li>                <li>Server send several pieces of data back in the response </li>                <li>Comet request is held open on the server for a while, multiple discrete changes are communicated </li>                <li><b><i>Long Polling</i></b> </li>             </ul>           </li>         </ul>          <p align="center"><a href="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_18.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="193" alt="image" src="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_thumb_8.png" width="336" border="0" /></a> </p>       </td>     </tr>      <tr>       <td valign="top" width="598">         <p align="right"><i><font color="#ff0000"><u>&lt;&lt;COMET&gt;&gt;</u></font></i></p>          <ul>           <li>Comet techniques              <ul>               <li>Most modern web browser, permit only 2 concurrent HTTP connection to the given domain. </li>                <li>If more than one request is being held open against the same server, ordinary request will be blocked                  <p>(same for different <b><i>browser-tab</i></b>) </p>                  <p align="center"><a href="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_20.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="192" alt="image" src="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_thumb_9.png" width="316" border="0" /></a> </p>               </li>             </ul>           </li>         </ul>       </td>     </tr>      <tr>       <td valign="top" width="598">         <p align="right"><i><font color="#ff0000"><u>&lt;&lt;COMET&gt;&gt;</u></font></i></p>          <ul>           <li>Comet techniques              <ul>               <li>Traditional servers allocate a thread to each incoming request </li>                <li>Design work well when serving large volume of short lived request </li>                <li>Long polls are held open request for a considerable length of time. </li>                <li>Thread-per-Request model is generally unable to scale to large numbers of clients. </li>                <li>Java servlet model itself is inherently a thread-per-request </li>             </ul>           </li>         </ul>          <p align="center"><a href="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_22.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="231" alt="image" src="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_thumb_10.png" width="324" border="0" /></a> </p>       </td>     </tr>      <tr>       <td valign="top" width="598">         <p align="right"><i><font color="#ff0000"><u>&lt;&lt;Java COMET&gt;&gt;</u></font></i></p>          <ul>           <li>Comet techniques              <ul>               <li>Java servlet model was developed to serve a very different traffic profile. </li>                <li>A large number of simultaneous request from Comet clients would exhaust the server&#8217;s thread pool. (<i>doesn&#8217;t scale well</i>) </li>                <li>More Comet-Friendly server architectures from the java-community:                  <ul>                   <li>Continuations (Jetty 6) </li>                    <li>Grizzly </li>                    <li>Tomcat 6 </li>                    <li>JSR 315 Servlet 3.0 </li>                 </ul>               </li>             </ul>           </li>         </ul>          <p align="center"><a href="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_24.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="121" alt="image" src="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_thumb_11.png" width="170" border="0" /></a>&#160; </p>       </td>     </tr>      <tr>       <td valign="top" width="598">         <p align="right"><i><font color="#ff0000"><u></u></font></i></p>          <p align="right"><em><u><font color="#ff0000"></font></u></em></p>          <p>Bayeux provides a very nice abstraction on <b>top of Comet</b> transport, by casting the <i>transfer</i> data in terms of channels, to which <b>clients</b> can publish and <b>subscribe</b><b> </b></p>          <br />          <p align="right"><font size="2"><em><strong><u>Comet and Reverse Ajax </u></strong></em></font></p>          <p align="right"><em><strong><font size="1">Dave Crane and Phil McCarthy (2008)</font></strong></em></p>          <p align="right"><strong><em><font size="1">&#160;</font></em></strong></p>       </td>     </tr>      <tr>       <td valign="top" width="598">         <p align="right"><i><font color="#ff0000"><u>Bayeux --&gt; CometD</u></font></i></p>          <ul>           <li>Bayeux              <ul>               <li>Emerging de facto standard for Comet </li>                <li>Existing reference implementation:                  <ul>                   <li><b>COMETD </b>                      <ul>                       <li>Provided by the people at Sitepen:                          <ul>                           <li><b>(the same as)</b><b> Dojo Javascript Toolkit </b></li>                         </ul>                       </li>                     </ul>                   </li>                 </ul>               </li>             </ul>           </li>         </ul>          <p align="right"><a href="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_26.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="53" alt="image" src="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_thumb_12.png" width="111" border="0" /></a> </p>       </td>     </tr>      <tr>       <td valign="top" width="598">         <p align="right"><i><font color="#ff0000"><u>Bayeux --&gt; CometD</u></font></i></p>          <ul>           <li>Bayeux              <ul>               <li>Adopts exactly the same approach and provides a flexible, scalable API based around a publish-subscribe model </li>                <li>Data sent through, is always assigned a notional &#8220;channel&#8221; </li>             </ul>           </li>         </ul>          <p align="center"><a href="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_28.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="160" alt="image" src="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_thumb_13.png" width="351" border="0" /></a> </p>       </td>     </tr>      <tr>       <td valign="top" width="598">         <p align="right"><i><font color="#ff0000"><u>Bayeux --&gt; CometD</u></font></i></p>          <ul>           <li>Bayeux              <ul>               <li>Channels allows multiple decoupled conversations on top of a single HTTP connection. </li>                <li>The <i>client-side</i> CometD and the <i>server-side</i> Bayeux implementation communicate over several notional channels, all bundled within a single HTTP request-response. </li>             </ul>           </li>         </ul>          <p align="center"><a href="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_28.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="62" alt="image" src="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_thumb_13.png" width="131" border="0" /></a> </p>          <p align="center"></p>       </td>     </tr>      <tr>       <td valign="top" width="598">         <p align="right"><i><font color="#ff0000"><u>Purpose</u></font></i></p>          <ul>           <li><b><u>Cometd</u></b> is a project by the Dojo Fundation to implement Bayeux specification. </li>            <li><b><u>Bayeux</u></b> is a purpose to implement responsive user interaction for web clients using Ajax and server-push technique called Comet </li>         </ul>          <p>&#160;</p>          <ul>           <li>The messages are routed via named <b><u>channels</u></b> and can be delivered:               <ul>               <li><b><i>server2client </i></b></li>                <li><b><i>client2server </i></b></li>                <li><b><i>client2client</i></b><i> (via server) </i></li>             </ul>           </li>         </ul>       </td>     </tr>      <tr>       <td valign="top" width="598">         <p align="right"><i><font color="#ff0000"><u>JSON Messages</u></font></i></p>          <p>Bayeux message are specified in JSON notation </p>          <p>&#160;</p>          <p>&#160;&#160;&#160;&#160; { </p>          <p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &quot;channel&quot;: &quot;/some/name&quot;, </p>          <p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &quot;clientId&quot;: &quot;83js73jsh29sjd92&quot;, </p>          <p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &quot;data&quot;: { &quot;myapp&quot; : &quot;specific data&quot;, value: 100 } </p>          <p>&#160;&#160;&#160;&#160; } </p>          <p>&#160;</p>          <p>&#160;</p>          <p align="center"><i><strong>JavaScript Object Notation is a lightweight data-interchange format</strong></i></p>          <p align="center"><strong><em>&#160;</em></strong></p>       </td>     </tr>      <tr>       <td valign="top" width="598">         <p align="right"><i><font color="#ff0000"><u>Channels Style</u></font></i></p>          <ul>           <li>Channels are by default broadcast publish subscribe. </li>            <li>Channels are identified by names and always starts with &#8220;/&#8221; </li>            <li>Channel pattern support trailing wildcards of either &#8220;*&#8221; or &#8220;**&#8221; : </li>         </ul>          <p>&#160;</p>          <ul>           <li><b>/news/* </b>              <ul>               <li>Valid channels : /news/italy , /news/uk .... </li>             </ul>           </li>         </ul>          <p>&#160;</p>          <ul>           <li><b>/news/** </b>              <ul>               <li>Valid channels : /news/italy , /news/italy/lazio ... </li>             </ul>           </li>         </ul>          <p></p>       </td>     </tr>      <tr>       <td valign="top" width="598">         <p align="right"><i><font color="#ff0000"><u>Bayeux approach</u></font></i></p>          <ul>           <li>Bayeux event is sent from the server to the client via HTTP response to a HTTP request sent in anticipation:              <ul>               <li>Polling Transport                  <ul>                   <li>On receipt of the HTTP response, the bayeux client issues a new bayeux message. </li>                 </ul>               </li>                <li>Streaming Transport                  <ul>                   <li>Use streaming technique (forever response), allowing multiple message to be sent over the same response </li>                 </ul>               </li>             </ul>           </li>         </ul>          <p align="center">&#160;</p>          <p align="center"></p>       </td>     </tr>      <tr>       <td valign="top" width="598">         <p align="right"><i><font color="#ff0000"><u>Bi-Direction</u></font></i></p>          <ul>           <li>To solve the issue of bi-directional communications, Bayeux client <b><i>will</i></b> use two HTTP connections:               <ul>               <li>Messaging may occur asynchronously </li>             </ul>           </li>         </ul>          <p align="center"><a href="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_30.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="207" alt="image" src="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_thumb_14.png" width="334" border="0" /></a></p>          <p align="center">&#160;</p>          <p align="center">&#160;</p>       </td>     </tr>      <tr>       <td valign="top" width="598">         <p align="right"><i><font color="#ff0000"><u>Handshake Connect</u></font></i></p>          <ul>           <li>Bayeux connection are negotiated between client and server with handshake messages that allow to define:              <ul>               <li>Connection Type </li>                <li>Authentication </li>                <li>Persistence subscription </li>                <li>Identification ..... </li>             </ul>           </li>         </ul>          <p>&#160;</p>          <p align="center"><a href="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_32.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="244" alt="image" src="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_thumb_15.png" width="326" border="0" /></a> </p>       </td>     </tr>      <tr>       <td valign="top" width="598">         <p align="right"><i><font color="#ff0000"><u>Interactions</u></font></i></p>          <ul>           <li>Bayeux client may send publish and subscribe messages to register interest in a channel: </li>         </ul>          <p align="center"><a href="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_34.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="215" alt="image" src="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_thumb_16.png" width="415" border="0" /></a> </p>       </td>     </tr>      <tr>       <td valign="top" width="598">         <p align="right"><i><font color="#ff0000"><u>Server APIs</u></font></i></p>          <ul>           <li>Web application developers can optionally use server-side pub-sub APIs in their servlets or Java classes to get the Bayeux server context, manage channels, and the incoming and outgoing messages </li>         </ul>          <p>&#160;</p>          <p align="center"><a href="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_36.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="215" alt="image" src="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_thumb_17.png" width="532" border="0" /></a> </p>          <p align="center"></p>       </td>     </tr>      <tr>       <td valign="top" width="598">         <p align="right"><i><font color="#ff0000"><u>WebLogic Stock Demo</u></font></i></p>          <ul>           <li>There is a useful sample in the WebLogic 10.3 installation about this technology:              <ul>               <li>Can find it in the folder :                  <ul>                   <li><u>{ORACLE_HOME}\wlserver_10.3\samples\server\examples\src\examples\webapp\pubsub\stock</u> </li>                 </ul>               </li>             </ul>           </li>         </ul>          <p>&#160;</p>          <ul>           <li>The demo describes a real-world scenario based on <b>stock </b><b>trading</b>, and makes extensive use of the Bayeux APIs in both the server and client components               <ul>               <li>The Demo uses :                  <ul>                   <li>Dojo as its client-side library </li>                    <li>WebLogic Bayeux implementation as server APIs </li>                 </ul>               </li>             </ul>           </li>         </ul>          <p>&#160;</p>          <table cellspacing="0" cellpadding="2" width="491" border="0"><tbody>             <tr>               <td align="right" width="218"><a href="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_38.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="141" alt="image" src="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_thumb_18.png" width="138" border="0" /></a> </td>                <td align="right" width="50">&#160;</td>                <td align="right" width="224"><a href="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_40.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="92" alt="image" src="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_thumb_19.png" width="213" border="0" /></a> </td>             </tr>           </tbody></table>       </td>     </tr>      <tr>       <td valign="top" width="598">         <p align="right"><i><font color="#ff0000"><u>Web XML-Configuration</u></font></i></p>          <ul>           <li>Server dedicated file-based configuration environment </li>         </ul>          <p>&#160;</p>          <p align="center"><a href="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_42.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="249" alt="image" src="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_thumb_20.png" width="502" border="0" /></a> </p>       </td>     </tr>      <tr>       <td valign="top" width="598">         <p align="right"><i><font color="#ff0000"><u>Security Model</u></font></i></p>          <ul>           <li>JEE security configuration based (ssl support) </li>         </ul>          <p>&#160;</p>          <p align="center"><a href="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_44.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="233" alt="image" src="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_thumb_21.png" width="459" border="0" /></a> </p>       </td>     </tr>      <tr>       <td valign="top" width="598">         <p align="right"><i><font color="#ff0000"><u>JMS-Bayeux</u></font></i></p>          <ul>           <li>Durable subscriber and persistence support, based on JMS architecture </li>         </ul>          <p>&#160;</p>          <p align="center"><a href="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_46.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="170" alt="image" src="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_thumb_22.png" width="472" border="0" /></a> </p>       </td>     </tr>      <tr>       <td valign="top" width="598">         <p align="right"><i><font color="#ff0000"><u>Message Persistance</u></font></i></p>          <ul>           <li>Persistent Channels and session-message failover support </li>         </ul>          <p>&#160;</p>          <p align="center"><a href="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_48.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="102" alt="image" src="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_thumb_23.png" width="453" border="0" /></a> </p>       </td>     </tr>      <tr>       <td valign="top" width="598">         <p align="right"><i><font color="#ff0000"><u>JS Client APIs</u></font></i></p>          <ul>           <li>Dojo JS Cometd library (Init and Publish) </li>         </ul>          <p>&#160;</p>          <ul>           <ul>             <li><b>Initialize the Dojo cometd environment</b>. </li>           </ul>         </ul>          <p align="center"><i>dojo.io.cometd.init({}, &quot;/servletContextMapping/cometd&quot;); </i></p>          <br />          <ul>           <ul>             <li><b>Publish a message to a channel</b>. </li>           </ul>         </ul>          <p align="center"><em>dojo.io.cometd.publish(&quot;/a/channel&quot;, &quot;message content&quot;); </em></p>          <ul>           <ul>             <li><b>or JSON message: </b></li>           </ul>         </ul>          <p><b></b></p>          <p align="center"><em>dojo.io.cometd.publish(&quot;/a/channel&quot;, {&quot;data&quot;: &quot;content&quot;});</em></p>       </td>     </tr>      <tr>       <td valign="top" width="598">         <p align="right"><i><font color="#ff0000"><u>JS Client APIs</u></font></i></p>          <ul>           <li>Dojo JS Cometd library (Subscribe) </li>         </ul>          <p>&#160;</p>          <p><b>Subscribe to a channel </b></p>          <p><b></b></p>          <p>&#160; <em>dojo.io.cometd.subscribe(&quot;/a/channel&quot;, null, &quot;onUpdate&quot;); </em></p>          <p><b><em></em></b></p>          <p><em>&#160; function onUpdate(message) {              <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (!message.data) {               <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; alert(&quot;bad message format &quot;+message);               <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return;               <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; } </em></p>          <p><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var data = message.data;              <br />&#160;&#160; } </em></p>       </td>     </tr>      <tr>       <td valign="top" width="598">         <p align="right"><i><font color="#ff0000"><u>JS Dinamic Demo</u></font></i></p>          <ul>           <li>Dynamic Channel sub &amp; unsubscription </li>         </ul>          <p>&#160;</p>          <p>&#160;<em> function subscribe(symbol) { </em></p>          <p><em><b>&#160;&#160;&#160;&#160;&#160;&#160;&#160; dojo.io.cometd.subscribe</b>(&quot;/stock/&quot;+symbol, null, &quot;onUpdate&quot;); </em></p>          <p><em>&#160; } </em></p>          <p><em>&#160; </em></p>          <p><em>&#160; function unsubscribe(symbol) { </em></p>          <p><em><b>&#160;&#160;&#160;&#160;&#160;&#160; dojo.io.cometd.unsubscribe</b>(&quot;/stock/&quot;+symbol, null, &quot;onUpdate&quot;); </em></p>          <p><em>&#160; } </em></p>          <p><em></em></p>          <p><em>&#160; function subscribeAll() { </em></p>          <p><em>&#160;&#160;&#160;&#160;&#160;&#160; var count = itemsStore.get().length; </em></p>          <p><em>&#160;&#160;&#160;&#160;&#160;&#160; for (var i=0; i&lt;count; i++) { </em></p>          <p><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; subscribe(itemsStore.getDataByIndex(i).symbol); </em></p>          <p><em>&#160;&#160;&#160;&#160;&#160;&#160;&#160; } </em></p>          <p><em>&#160; } </em></p>       </td>     </tr>      <tr>       <td valign="top" width="598">         <p align="right"><i><font color="#ff0000"><u>Web Publisher</u></font></i></p>          <ul>           <li>Simple web-based client publisher (stock publisher) </li>         </ul>          <p>&#160;</p>          <p align="center"><a href="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_50.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="259" alt="image" src="http://blogs.oracle.com/slc/WindowsLiveWriter/BayeuxProtocolIntroductionHTTPPublishSub_FE2E/image_thumb_24.png" width="444" border="0" /></a> </p>          <p align="center">&#160;</p>          <p align="center"></p>       </td>     </tr>      <tr>       <td valign="top" width="598">         <p align="right"><i><font color="#ff0000"><u>Some useful link</u></font></i></p>          <ul>           <li><b>Bayeux</b> specification provides only a protocol definition               <ul>               <li><u><a href="http://svn.cometd.org/trunk/bayeux/bayeux.html">http://svn.cometd.org/trunk/bayeux/bayeux.html</a></u><u> </u></li>             </ul>           </li>         </ul>          <p><u></u></p>          <ul>           <li><b>Cometd</b> is a project by the <b>Dojo Foundation</b> to produce a specification (Bayeux) and a set of implementations of that specification (Cometd)               <ul>               <li><u><a href="http://dojofoundation.org/#tab-cometD">http://dojofoundation.org/#tab-cometD</a> </u></li>             </ul>           </li>         </ul>          <p><u></u></p>          <p><u>&#160;</u><u>&#160;</u></p>       </td>     </tr>      <tr>       <td valign="top" width="598">         <p align="right"><i><font color="#ff0000"><u>Some useful link</u></font></i></p>          <ul>           <li>Bayeux Java server-side implementation </li>         </ul>          <p>&#160;</p>          <ul>           <ul>             <li><b>CometdJetty</b><b> </b></li>           </ul>            <li><u><a href="http://code.google.com/p/cometd/wiki/CometdJetty"><font size="1">http://code.google.com/p/cometd/wiki/CometdJetty</font></a></u>               <ul>               <li><b>Oracle WebLogic Server </b></li>             </ul>           </li>            <li><u><a href="http://download.oracle.com/docs/cd/E12840_01/wls/docs103/webapp/pubsub.html"><font size="1">http://download.oracle.com/docs/cd/E12840_01/wls/docs103/webapp/pubs</font></a><u><font size="1">ub.html</font></u></u>               <ul>               <li><b>IBM WebSphere</b> </li>             </ul>           </li>            <li><u><a href="http://www.ibm.com/developerworks/websphere/techjournal/0802_haverloc"><font size="1">http://www.ibm.com/developerworks/websphere/techjournal/0802_haverloc</font></a><u><font size="1">k/0802_haverlock.html</font></u> </u></li>         </ul>          <p><u>&#160;</u></p>       </td>     </tr>      <tr>       <td valign="top" width="598">         <p align="right"><i><font color="#ff0000"><u>Some useful link</u></font></i></p>          <ul>           <li>Bayeux others-server side implementation </li>         </ul>          <p>&#160;</p>          <ul>           <ul>             <li>Flash <b>FlexComet </b>                <ul>                 <li><u><a href="http://code.google.com/p/flexcomet/"><font size="1">http://code.google.com/p/flexcomet/</font></a> </u></li>               </ul>             </li>              <li>Perl <b>CometdPerl </b>                <ul>                 <li><u><a href="http://code.google.com/p/cometd/wiki/CometdPerl"><font size="1">http://code.google.com/p/cometd/wiki/CometdPerl</font></a></u> </li>               </ul>             </li>              <li>Python <b>CometdTwist</b>                 <ul>                 <li><u><a href="http://code.google.com/p/cometd/wiki/CometdTwisted"><font size="1">http://code.google.com/p/cometd/wiki/CometdTwisted</font></a> </u></li>               </ul>             </li>           </ul>         </ul>          <p><u>&#160;</u><u>&#160;</u></p>       </td>     </tr>      <tr>       <td valign="top" width="598">&#160;</td>     </tr>      <tr>       <td valign="top" width="598">         <p align="center"><font size="2"><strong><em>Nino Guarnacci</em></strong>&#160;&#160;&#160; </font></p>          <p align="center"><font size="1"><em>nino.guarnacci (AT) oracle.com</em></font></p>       </td>     </tr>   </tbody></table>]]></description>
         <link>http://blogs.oracle.com/slc/2009/02/introduction_to_bayeux_protoco.html</link>
         <guid>http://blogs.oracle.com/slc/2009/02/introduction_to_bayeux_protoco.html</guid>
        
        
         <pubDate>Thu, 05 Feb 2009 09:56:11 +0100</pubDate>
      </item>
            <item>
         <title>The Bookmark Portlet Locator</title>
         <description><![CDATA[<table cellspacing="0" cellpadding="2" width="490" border="0"><tbody>     <tr>       <td valign="top" align="center" width="488">         <p align="right"><font color="#0000ff"><strong><a href="http://blogs.oracle.com/slc/Bookmark-Portlet-Locator_1.0.1.war" target="_blank">Download BookmarkPortletLocator.war</a></strong></font></p>          <p align="right"><font color="#0000ff"><strong><a href="http://blogs.oracle.com/slc/PortletLocator_1.0.1.pdf" target="_blank">Download&#160; BookmarkPortletLocator.pdf</a></strong></font></p>       </td>     </tr>      <tr>       <td valign="top" width="488">         <h3><a name="_Toc191966186">Summary</a></h3>          <p>This <i><a href="http://edocs.bea.com/wls/docs103/programming/libraries.html"><strong>WLS JEE Shared Library</strong></a></i> has been developed in the context of&#160;&#160; a customer portal engagement that use <a href="http://www.oracle.com/technology/products/weblogic/portal/index.html"><strong>WebLogic Portal 10.x (WLP).</strong></a></p>          <p>&#160;</p>          <p>Basically we needed a solution to address the recurring problem of plumbing into content html properties some content portal hyperlinks, </p>          <ul>           <li>As plain standard http urls, not as server side scriptlets / custom tags; </li>            <li>Shortened, simplified and portable but yet interpretable by (any) wlp portal instance &#8216;s navigation context (more on this later); </li>            <li>The <i>map</i> of such friendly portal urls had also to be exposed to external clients ; </li>         </ul>          <p>We than implemented a portal url <i>pattern</i> based on generic portlet instances&#8217; <i>bookmarks, </i>instead of on pageLabels<i>:</i> any portlet instance (besides of its parent netuix control) can be administratively labelled via a specific portlet preference, and from that moment on, reachable via a simplified, shortened http url:</p>          <p align="center"><i><u><strong>http://host:port/&lt;portalWebAppName&gt;/portletlocator/&lt;bookmark_value&gt;</strong></u></i></p>          <p align="center"><strong><em><u></u></em></strong></p>          <p>Secondly, more project-scoped, we had also to get an easy way to p<i>rofile</i> 3.rd party CMS items, when no VCR &#8216;s SPI were at disposal (in our case we dealt with Interwoven&#8217;s TeamSite, still lacking of a fully fledged VCR connector implementation: the only choice was bulk loading), using entities acknowledged by wlp&#8217;s UserInteraction API and Tools: those values had to be exposed from portal, retrieved and included in IW forms and then resubmitted to portal, as content item&#8217;s metadata.</p>       </td>     </tr>      <tr>       <td valign="top" width="488">         <br />          <br /></td>     </tr>      <tr>       <td valign="top" width="488">         <h3><a name="_Toc191966187">Disclaimer</a></h3>          <p>This solution has not been &#8211;yet- tested in a production environment. </p>          <p>We did some internal performance tests using <a href="http://www.oracle.com/technology/products/jrockit/index.html"><strong>jrockit</strong></a> &#8216;s MC tools (basically to get an idea of latency gain in custom cache usage) that showed reassuring results (the overhead of url computing / decoding is in terms of milliseconds&#8230;&#8230;.)</p>          <p>We lend to consider the solution &#8211; at this stage &#8211;more likely to be wlp code <i>hacking</i> than a real world solution, but yet hope that the underlying idea can be leveraged to develop a similar feature in future wlp releases (we do need it&#8230;..)</p>          <p>Following, see comparative results among tests with disabled / enabled url resolution caches</p>          <br /></td>     </tr>      <tr>       <td valign="top" align="center" width="488">         <p align="center"><a href="http://blogs.oracle.com/slc/WindowsLiveWriter/116cea475301_F9C6/clip_image002_2.jpg"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="215" alt="clip_image002" src="http://blogs.oracle.com/slc/WindowsLiveWriter/116cea475301_F9C6/clip_image002_thumb.jpg" width="390" border="0" /></a></p>       </td>     </tr>      <tr>       <td valign="top" width="488">         <br />          <br /></td>     </tr>      <tr>       <td valign="top" width="488">         <h3><a name="_Toc191966188">Objectives</a></h3>          <p>In our solution, those urls should also can carry / support a (unpredictable) number of further additional parameters (as querystring params), eventually parsed by the portlet instance&#8217;s jsp, to further parameterize &#8211;on <i>user request</i> basis - the behaviour of the target jsp portlet&#8217;s algorithms (more on this hint on next sections): in our case we needed to customize cm query logic with some external CMS item&#8217;s properties.</p>          <p>Another requisite we had to address (which is somehow out of scope for the Locator itself, but still useful set of methods) was also to define and expose (towards 3.rd party CMS), some WLP personalization entities used by WLP Framework and/or WLP UserInteraction personalization engines (i.e. we decided respectively to use <i>streaming Portals / Desktops</i> name-paths, or <i>UserSegments</i>&#8217; rulesets names), so that personalization reasoning logic externally defined could work inside WLP User Interaction engines, even in absence of any VCR SPI implementation.</p>          <p>As said, we than ought to design &#8211;on Locator- some logic to </p>          <ul>           <li>Intercept, parse and <i>interpret</i> back the friendly, shortened urls, and redirect user to the right portal&#8217;s page <i>currently</i><i><a href="#_ftn1_6810" name="_ftnref1_6810"><b>[1]</b></a></i> embedding the specific portlet instance, and to forward it also any further CM-specific additional parameters eventually found in friendly url&#8217;s querystring. </li>         </ul>          <p>&#160;</p>          <ul>           <li>Use portals&#8217; <i>p13n</i> or <i>PortalFrameworks</i> API to apply any further personalization / interaction logic to the imported (=bulk loaded&#8230;..) CM items. </li>         </ul>          <p>Last but not least, the solution should grant </p>          <ul>           <li>Portability (i.e. moving the target portlet instance to a new portal definition, or promoting it to a different portal instance should not break the semantics and related interpretation of the friendly urls since they had previously loaded and stored into CMS provider&#8230;..), considered that no assumption should be done on any <i>sync</i> capabilities between both CM&#8217;s metadata repositories (WLP dbms repository and the external one): i.e. the friendly urls should work also when changing portal web <i>context url</i>, or book/pages/portlet instance graph from original.) </li>         </ul>          <p>&#160;</p>          <ul>           <li>Simplicity: a solution <i><u>really</u></i> ready to plug-and-use (both <i>dummy </i>proof but at same time usable without a master degree in wlp / wls): it&#8217;s not a &#8220;<i>convention over configuration</i>&#8221; approach, just we try not to waste time on understanding the syntax of the <i>nth</i> custom xml based configuration file. ;-) </li>         </ul>          <h6>&#160;</h6>          <h6><a href="#_ftnref1_6810" name="_ftn1_6810">[1]</a> The frendlyUrl-to-pageUrl resolution must be dynamic and based on a indirection entity (<i>bookmark)</i> not on portlet instance id, because portlet instance could reasonably get moved among different pages/desktops/portals in the interval the information is exposed and the item is bulkloaded back to portal&#8230;..</h6>       </td>     </tr>      <tr>       <td valign="top" width="488">         <br />          <br />          <br /></td>     </tr>      <tr>       <td valign="top" width="488">         <h3><a name="_Toc191966189">Architecture and Components</a></h3>          <p>As said, the Locator consists in a WebLogic <i>JEE Shared Library</i> (<strong>PortletLocator.war</strong>)</p>          <p>As you link this library, you will find basically three kinds of components:</p>          <ul>           <li><u>2 web services</u> (&#8230;.yes, Nino was able to include web services in a web library, can you believe it?)               <ul>               <li><i><strong>PortalStructureService</strong></i> and <i><strong>UserSegmentService</strong></i> </li>             </ul>           </li>         </ul>          <p><em></em></p>          <p>The interfaces that export wlp-related information towards external clients</p>          <ul>           <li><u>1 ServletFilter</u>               <ul>               <li>The object that parse and interpret portlet instance&#8217;s &#8220;friendly&#8221; url </li>             </ul>           </li>         </ul>          <p>&#160;</p>          <ul>           <li><u>1 Custom Control</u>:               <ul>               <li><i>ExposureCoordinatorControl</i> (we warmly hope that Beehive will survive next release of PortletLocator&#8230;&#8230;) , which is the <i>delegator</i> of webservices&#8217;s methods, and also a useful interface to some specific computation logic eventually needed from wlp webapp </li>                <li>i.e. it can answer questions like: &#8220;which usersegment list is current user in?&#8221; or &#8220;which streaming portal path am currently in?&#8221;, etc </li>             </ul>           </li>         </ul>          <p>&#160;</p>          <p>All the further supporting / helper / cache logic is packaged in a .jar in the WEB-INF/lib</p>       </td>     </tr>      <tr>       <td valign="top" width="488">&#160;</td>     </tr>      <tr>       <td valign="top" width="488">         <p align="center"><a href="http://blogs.oracle.com/slc/WindowsLiveWriter/116cea475301_F9C6/clip_image002%5B12%5D.jpg"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="317" alt="clip_image002[12]" src="http://blogs.oracle.com/slc/WindowsLiveWriter/116cea475301_F9C6/clip_image002%5B12%5D_thumb.jpg" width="420" border="0" /></a></p>       </td>     </tr>      <tr>       <td valign="top" width="488">         <br />          <br />          <br />          <br /></td>     </tr>      <tr>       <td valign="top" width="488">         <h3><a name="_Toc191966190">Installation</a></h3>          <p>Just proceed as a normal shared lib:</p>          <p>1) install the web library in your wlp server / cluster </p>       </td>     </tr>      <tr>       <td valign="top" width="488">         <p align="center"><a href="http://blogs.oracle.com/slc/WindowsLiveWriter/116cea475301_F9C6/clip_image002%5B14%5D.jpg"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="206" alt="clip_image002[14]" src="http://blogs.oracle.com/slc/WindowsLiveWriter/116cea475301_F9C6/clip_image002%5B14%5D_thumb.jpg" width="467" border="0" /></a></p>       </td>     </tr>      <tr>       <td valign="top" width="488">         <p>1) then, add the standard library reference tags in <strong>weblogic.xml</strong> of your portal web app:</p>          <p>&#160;</p>          <p><em>&lt;wls:library-ref&gt;</em></p>          <p><em>&lt;wls:library-name&gt;BookmarkPortletLocator&lt;/wls:library-name&gt;</em></p>          <p><em>&lt;wls:specification-version&gt;1.0&lt;/wls:specification-version&gt;</em></p>          <p><em>&lt;wls:implementation-version&gt;1.0&lt;/wls:implementation-version&gt;</em></p>          <p><em>&lt;wls:exact-match&gt;false&lt;/wls:exact-match&gt;</em></p>          <p><em>&lt;/wls:library-ref&gt;</em></p>          <p>&#160;</p>          <p><em><a href="http://m-button.blogspot.com/2008/08/how-to-use-deployment-plan.html">(or use a Deployment Plan)</a></em></p>          <p>&#160;</p>          <p>3) Congratulations! You&#8217;re done.</p>          <p></p>       </td>     </tr>      <tr>       <td valign="top" width="488">         <p>Of course, in a DEV environment, you can include it in the WLS JEE Library list:</p>       </td>     </tr>      <tr>       <td valign="top" width="488">         <p align="center"><a href="http://blogs.oracle.com/slc/WindowsLiveWriter/116cea475301_F9C6/clip_image002%5B16%5D.jpg"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="306" alt="clip_image002[16]" src="http://blogs.oracle.com/slc/WindowsLiveWriter/116cea475301_F9C6/clip_image002%5B16%5D_thumb.jpg" width="476" border="0" /></a></p>       </td>     </tr>      <tr>       <td valign="top" width="488">         <br />          <br />          <br /></td>     </tr>      <tr>       <td valign="top" width="488">         <h3><a name="_Toc191966191">Configuration</a></h3>          <p>The library has a complete <i>default</i> configuration: if you don&#8217;t have special requirements, it&#8217;s all there. You can skip to <i>Usage</i> section. </p>          <p>If you <i>really</i> have to, you can still configure a bunch of parameters (read <i>Usage</i> section to understand the underlying semantics in there; for now just pick up the list):</p>          <p>We didn&#8217;t use any new, <i>nth</i> xml configuration file: to override the default configuration you just work on</p>          <ol>           <li><i><strong>web.xml</strong></i> (context-params)               <ol>               <li><u>exposure-scheme</u>                   <ul>                   <li>this optional parameter is used to set the scheme used to generate the pageurl that the Locator computes before a portal redirect : i.e. <b><i><u>https</u></i></b><u>://www.domain.com/myPortalWebApp/appmanager</u>...... </li>                    <li>accepted values: http | https </li>                 </ul>               </li>                <li><u>exposure-host</u>                   <ul>                   <li>this optional parameter is used to set the hostname part of the pageurl that the Locator generates before a portal redirect : i.e. https://<b><u>www.domain.com</u></b>//myPortalWebApp/appmanager...... </li>                    <li>accepted values: an ip address or a hostname </li>                    <li>if this param is not set, the Locator retrieve it from:                      <ul>                       <li>wls frontend cluster value, OR </li>                        <li>wls frontend server host value, OR </li>                        <li>value returned from <i>getServerName</i> method invoked by Locator filter on current http request </li>                     </ul>                   </li>                 </ul>               </li>                <li><u>exposure-port</u>                   <ul>                   <li>this optional parameter is used to set the <i>port</i> part of the pageUrl generated by Locator: needs to be set if specified &#8220;exposure-host&#8221; </li>                    <li>accepted values: any valid tcp port </li>                 </ul>               </li>                <li><u>exposure-log-enabled</u>                   <ul>                   <li>this optional parameter is used to set the log of the Locator framework </li>                    <li>log file defaults to <i>PortletLocator.log</i> and is placed on domain root folder (this behaviour can be overridden by a proper log configuration on weblogic.xml of referencing portal app &#8211;see below). </li>                    <li>accepted values: true (default) OR false </li>                 </ul>               </li>                <li><u>exposure-production-mode</u>                   <ul>                   <li>accepted values: true OR false </li>                    <li>this param defaults to domain&#8217;s current runtime mode (production vs. development) being retrieved straight from domain configuration itself. </li>                    <li>IF explicitly set to false in a production environment, enables DEBUG trace level on log file (viceversa on prod configuration, debug level is disabled for performance reason </li>                    <li>exposure-log-enabled param needs to be enabled and set to true. </li>                 </ul>               </li>                <li><u>exposure-portal-servlet-mapping</u>                   <ul>                   <li>anybody should have changed the /<i>appmanager</i> url pattern of wlp portal servlet, this parameter allows to configure PortletLocator accordingly about the new PortalServlet &#8216;s servlet url mapping. </li>                    <li>defaults to <i>/appmanager</i> </li>                    <li>accepts any string value </li>                 </ul>               </li>                <li><u>exposure-portlet-preference-name</u>                   <ul>                   <li>the preference <i>name</i> of the portlet preference that &#8211; on a portlet instance - identify the <i>bookmark</i> itself </li>                    <li>defaults to: &#8220;bookmark&#8221; </li>                    <li>accepted values: any string </li>                 </ul>               </li>                <li><u>exposure-cache-enabled</u>                   <ul>                   <li>accepted values: true (default) OR false </li>                    <li>this parameter enables Locator&#8217;s url resolution caches: EXPOSURE_CACHE and EXPOSURE_CACHE_URL, administerable from Portal Admin Console </li>                 </ul>               </li>                <li><a name="OLE_LINK1">                   <p><font color="#000000"><u>exposure-redirect-request-enabled</u></font></p>                 </a>                  <ul>                   <li>                     <p>accepted values: true (default) OR false</p>                   </li>                    <li>this parameter enables Locator to redirect&#160; users to target portlet&#160; via a http 302&#160; status code send-redirect (when landing on target portlet, the browser address url is the portal one); choosing false enables servlet container internal forwarding mechanism (when landing on target portlet, the browser address url is the locator one) </li>                 </ul>               </li>                <li>you can also modify url pattern value of Locator&#8217;s servlet filter                  <ul>                   <li>default: &#8220;portletlocator&#8221; </li>                    <li>this values can be overridden by adding in web.xml of portalWebApp these lines: </li>                    <li>i.e. . http://www.domain.com/<b><u>runtimeservices</u></b>/simple1 </li>                 </ul>               </li>             </ol>           </li>         </ol>          <p><em>&#160;&#160;&#160; &lt;filter&gt;</em></p>          <p><em>&#160;&#160;&#160;&#160;&#160;&#160; &lt;filter-name&gt;ContentLocatorFilter&lt;/filter-name&gt;</em></p>          <p><em>&#160;&#160;&#160;&#160;&#160;&#160; &lt;filter-class&gt;<strong>it.javac.bea.portal.exposure.filter.ContentLocatorFilter</strong>&lt;/filter-class&gt;</em></p>          <p><em>&#160;&#160; &lt;/filter&gt;</em></p>          <p><em>&#160;&#160; &lt;filter-mapping&gt;</em></p>          <p><em>&#160;&#160;&#160;&#160;&#160;&#160; &lt;filter-name&gt;ContentLocatorFilter&lt;/filter-name&gt;</em></p>          <p><em>&#160;&#160;&#160;&#160;&#160;&#160; &lt;url-pattern&gt;/<b><u>runtimeservices</u></b>/*&lt;/url-pattern&gt;</em></p>          <p><em>&#160;&#160;&#160;&#160;&#160;&#160; &lt;dispatcher&gt;FORWARD&lt;/dispatcher&gt;</em></p>          <p><em>&#160;&#160;&#160;&#160;&#160;&#160; &lt;dispatcher&gt;REQUEST&lt;/dispatcher&gt;</em></p>          <p><em>&#160;&#160;&#160;&#160;&#160; &lt;dispatcher&gt;INCLUDE&lt;/dispatcher&gt;</em></p>          <p><em>&#160;&#160; &lt;/filter-mapping&gt;</em></p>          <p>&#160;</p>          <p>&#160;</p>          <p>&#160;&#160;&#160;&#160;&#160;&#160; 2&#160; <strong>weblogic.xml</strong></p>          <p>&#160;</p>          <p>&#160; &lt;wls:logging&gt;</p>          <p>&#160;&#160;&#160;&#160;&#160; &lt;wls:log-filename&gt;PortletLocator.log&lt;/wls:log-filename&gt;</p>          <p>&#160;&#160;&#160;&#160;&#160; &lt;wls:logging-enabled&gt;true&lt;/wls:logging-enabled&gt;</p>          <p>&#160;&#160;&#160;&#160;&#160; &lt;wls:file-count&gt;3&lt;/wls:file-count&gt;</p>          <p>&#160;&#160;&#160;&#160;&#160; &lt;wls:file-size-limit&gt;5000&lt;/wls:file-size-limit&gt;</p>          <p>&#160;&#160;&#160;&#160;&#160; &lt;wls:rotate-log-on-startup&gt;true&lt;/wls:rotate-log-on-startup&gt;</p>          <p>&#160;&#160;&#160;&#160;&#160; &lt;wls:log-file-rotation-dir&gt;logs&lt;/wls:log-file-rotation-dir&gt;</p>          <p>&#160; &lt;/wls:logging&gt;</p>          <p>&#160;</p>          <p>Defaults, the PortletLocator creates 2 new portal caches with 1h TTL:</p>          <ul>           <li><strong>EXPOSURE_CACHE</strong> with max entries 100 </li>            <li><strong>EXPOSURE_CACHE_URL</strong> with max Entries 500 </li>         </ul>       </td>     </tr>      <tr>       <td valign="top" width="488">         <br />          <br />          <br /></td>     </tr>      <tr>       <td valign="top" width="488">         <h3><a name="_Toc191966192">Usage</a></h3>          <p>Let&#8217;s distinguish Locator&#8217;s usage into 2 different context / use cases: </p>          <ul>           <li>Implementation of portal friendly url, </li>            <li>External content item&#8217;s personalization </li>         </ul>       </td>     </tr>      <tr>       <td valign="top" width="488">&#160;</td>     </tr>      <tr>       <td valign="top" width="488">         <h4><a name="_Toc191966193">Friendly urls implementation</a></h4>          <h5><a name="_Toc191966194">Phase 1 : create friendly urls</a></h5>          <p><i>(WLP Portal side; role: PortalAdministrator; tool: PortalAdminTool)</i></p>          <ol>           <li>Configure your 1-n streaming portal(s), each with related desktops / books / etc </li>            <li>For each portlet instance (among those eligible as friendly url&#8221; &#8216;s target, i.e. to CM display views),              <ul>               <li>Add a portlet instance. </li>                <li>Add a portlet <u>preference</u> named &#8220;bookmark&#8221; (this is default but can be customized), with a <i>unique</i> value <a href="#_ftn1_8685" name="_ftnref1_8685">[1]</a> </li>                <li>i.e. : <i>simple1</i> </li>                <li>Add a preference description </li>                <li>i.e.: &#8220;upper left portlet, 3<sup>rd</sup> column, new articles annoncements&#8230;.&#8221; Etc </li>             </ul>           </li>         </ol>          <h6>&#160;</h6>          <h6><a href="#_ftnref1_8685" name="_ftn1_8685">[1]</a> By now no control is made on bookmark&#8217;s preference value uniqueness: we didn&#8217;t find an efficient solution to automate this control on portal lifecycle stages (i.e. web app deployment time, new preference insertion, etc)</h6>       </td>     </tr>      <tr>       <td valign="top" width="488">&#160;</td>     </tr>      <tr>       <td valign="top" width="488">         <p align="center"><a href="http://blogs.oracle.com/slc/WindowsLiveWriter/116cea475301_F9C6/clip_image001_2.gif"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="368" alt="clip_image001" src="http://blogs.oracle.com/slc/WindowsLiveWriter/116cea475301_F9C6/clip_image001_thumb.gif" width="426" border="0" /></a></p>       </td>     </tr>      <tr>       <td valign="top" width="488">&#160;</td>     </tr>      <tr>       <td valign="top" width="488">         <p>From this moment on, with PortletLocator deployed and configured, you can reach this portlet instance by composing this url on a browser:</p>          <h4>http://&lt;my_portal_instance&gt;:&lt;myport&gt;/&lt;myWebContenxtPath&gt;/<b>portletlocator/simple1</b></h4>          <p align="center"><strong></strong></p>          <p>&#160;</p>          <p>When you hit a non existing bookmark, the filter send back a Http Error Code 436 (to let you customize error handling with a friendly page / error handler)</p>       </td>     </tr>      <tr>       <td valign="top" width="488">         <br /></td>     </tr>      <tr>       <td valign="top" width="488">         <h5><a name="_Toc191966195">Phase 2 : exposition of portlet instances friendly url map to third party consumer</a></h5>          <p>Navigate to Web Service &#8216;s <i>PortalStructureService</i> WSDL and test operation <i>availablePortletsBookmark</i>: an invocation returns the full map of bookmarked portlets: a list of following key/values</p>          <ul>           <li>bookmark&#8217;s preference <i>description</i> </li>            <li>bookmark&#8217;s preference <i>values</i> associated with each bookmarked portlet </li>         </ul>          <p>following an example of returned values:</p>       </td>     </tr>      <tr>       <td valign="top" width="488">&#160;</td>     </tr>      <tr>       <td valign="top" width="488">         <p align="center"><a href="http://blogs.oracle.com/slc/WindowsLiveWriter/116cea475301_F9C6/clip_image002%5B18%5D.jpg"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="165" alt="clip_image002[18]" src="http://blogs.oracle.com/slc/WindowsLiveWriter/116cea475301_F9C6/clip_image002%5B18%5D_thumb.jpg" width="444" border="0" /></a></p>       </td>     </tr>      <tr>       <td valign="top" width="488">&#160;</td>     </tr>      <tr>       <td valign="top" width="488">         <h5><a name="_Toc191966196">Phase 3: inclusion of bookmark map into CM contribution tool</a></h5>          <p>This key/value list can then be easily embedded in external CM contribution tool (in our case, into TeamSite&#8217;s forms) in the form of a combo box: the options <i>key</i> being the bookmark value, while the options <i>value</i> being the portlet instance description. </p>          <p>The redactor, when he needs to plumb an hyperlink on an html body of a cm item, can than select a bookmark&#8217;s value by selecting his description. </p>          <p>Note that any duplicated entry of bookmark_value / portlet instance description has to be handled manually with a fix in wlp&#8217;s portal admin tool.</p>          <p>Just store this picked value (the bookmark&#8217;s preference value) in a cm specific item property / metadata (i.e. WLP_BOOKMARK)</p>       </td>     </tr>      <tr>       <td valign="top" width="488">         <br /></td>     </tr>      <tr>       <td valign="top" width="488">         <h5><a name="_Toc191966197">Phase 4: hyperlink compilation</a></h5>          <p><i>(CM side; role: CM developer)</i></p>          <p>At export time (i.e when preparing content item for wlp&#8217;s bulkloading) in our solution, Interwoven developers just parsed html content for any CM proprietary hyperlinks; </p>          <p>If present, they queried the target&#8217;s item WLP_BOOKMARK property with that value, they invoked again Locator&#8217;s <i>PortalStructureService</i> , just a different operation: <i>getContextUrlFromBookmark<a href="#_ftn1_1260" name="_ftnref1_1260"><b>[1]</b></a></i>: </p>          <ul>           <li>this operation returns the (relative) <i>context path</i> of a given bookmark (es. <i>/myportalWeb/portletlocator/p1</i>). </li>         </ul>          <p>In this way the <i>bookmark definition</i> itself is decoupled from current portalweb-scoped configuration, that can differ among different <i>environments</i>, <i>deployments</i>, <i>evolutions</i>, etc), use the result to compose href attribute of resulting anchor tag inside cm item html property.</p>          <p>At this stage the CM developer can choose to add further querystring parameters(as the result of additional target cm metadata enquiry, i.e. <i>ITEM_ID</i>, <i>Locale</i>, <i>WLP_PortalPath,</i> <i>WLP_UserSegments, </i>more on that following)</p>          <p>The resulting url could be: </p>          <p align="center"><i>/myportalWeb/portletlocator/p1?item_id=2323123&amp;Locale=it&amp;wlp_portal_path=pmi</i></p>          <p><i></i></p>          <hr align="left" width="33%" size="1" />          <h6><a href="#_ftnref1_1260" name="_ftn1_1260">[1]</a> In next release the bookmark-to-webcontext url resolution could be moved inside the portal itself, using some Ajax feature at click time</h6>       </td>     </tr>      <tr>       <td valign="top" width="488">&#160;</td>     </tr>      <tr>       <td valign="top" width="488">         <h5><a name="_Toc191966198">Phase 5: url parsing (WLP side)</a></h5>          <p>After bulkloaded the item(s), and CM display temaplates / jsp implemented and deployed, any /portletlocator links get intercepted by PortletLocator&#8217;s ServletFilter;</p>          <p>This filter picks up the bookmark value in servletpath and compute the actual and current pageUrl on which target portlet instance is &#8211; currently &#8211; instantiated in. </p>          <p>&#160;</p>          <p>The user is <em>redirected</em> or <em>forwarded (based on </em><a name="OLE_LINK1"><font color="#000000"><u>exposure-redirect-request-enabled</u></font></a> configuration parameter<em>)</em> to portal&#8217;s page url .</p>          <p>Should any additional <em>querystring</em> parameters be present in url, the filter copies them in (Outer)Request scope (or Sessione scope, if configured), so that target portlet can take advantage of them to further customize the default behaviour of i.e. content display logic: for instance you can use item_id request parameter to select a specific content item (given you provided a corresponding cm property / metadata and that this id is really unique across the CM Repository).</p>       </td>     </tr>      <tr>       <td valign="top" width="488">         <br />          <br /></td>     </tr>      <tr>       <td valign="top" width="488">         <h4><a name="_Toc191966199">Content items personalization</a></h4>       </td>     </tr>      <tr>       <td valign="top" width="488">         <h5><a name="_Toc191966200">Phase 1 : define and implement your personalization entities</a></h5>          <p><i>(WLP side)</i></p>          <p>First you had to identify which portal entities you will use to as personalization discriminating data useful to <i>profile</i> your cm item: you can decide to &#8220;tag&#8221; target user segments using both</p>          <ul>           <li>wlp user segments, or </li>            <li>wlp streaming portal path(s) </li>         </ul>          <p>&#160;</p>          <p>Locator expose those two list in two different web services:</p>          <ol>           <li>in <strong>PortalStructureService</strong>               <ul>               <li><em><u>availablePortalPath</u></em> : returns a key/value list of currently configured streaming portals&#8217; <i>path/name</i> </li>                <li><em><u>availableDesktopPath</u></em> : given an (optional) portal path, returns a key/value list of currently configured desktops&#8217; <i>path/name</i> </li>             </ul>           </li>            <li>in <strong>UserSegmentService</strong>               <ul>               <li><em><u>availableSegments</u></em> : returns the list of currently configured <i>user segments</i> </li>             </ul>           </li>         </ol>          <p><em>&#160;</em></p>       </td>     </tr>      <tr>       <td valign="top" width="488">         <h5><a name="_Toc191966201">Phase 2: inclusion of portal path list / user segments list into CM contribution tool</a></h5>          <p>You can follow same guidelines to include to external CM tool those lists: the redactor would than just pickup the current usersegment / current portal that specific item is targeted to, and store it this value in a specific cm item property / metadata (i.e. WLP_USERSEGMENTS, or WLP_PORTAL_PATH).</p>          <p></p>       </td>     </tr>      <tr>       <td valign="top" width="488">         <h5><a name="_Toc191966202">Phase 3: cm personalization property evaluation</a></h5>          <p>(WLP side) </p>          <p>On wlp side, when implementing cm display templates or jsps, you can select the cm item to show by comparing:</p>          <ul>           <li>current item / node &#8216;s personalization property (i.e. WLP_USERSEGMENTS, or WLP_PORTAL_PATH) </li>            <li>with current user &#8216;s user segment or current portal path </li>         </ul>          <p>The latter being a portlet instance&#8217;s preference while the former the result of a dynamic evaluation leveraging Locator&#8217;s custom control API:</p>          <p><strong>ExposureCoordinatorControl</strong>. </p>          <p>String[] <em><u>segmentOfUserFromRequest</u></em>(HttpServletRequest request)</p>          <ul>           <li>Given an instance of HttpRequest, returns the list of usersegments this current user (both anonymous or logged) is in. </li>            <li>NB: this latter method makes no use of any cache. Use it with awareness&#8230;.. </li>         </ul>       </td>     </tr>      <tr>       <td valign="top" width="488">         <br /></td>     </tr>      <tr>       <td valign="top" width="488">Furthermore there are many specific features that can be used, we suggest to consult this <a href="http://blogs.oracle.com/slc/PortletLocator_1.0.1.pdf" target="_blank">pdf documentation</a>.</td>     </tr>      <tr>       <td valign="top" width="488">         <br />          <br />Enjoy ...           <br /></td>     </tr>      <tr>       <td valign="top" width="488">         <h6><em></em></h6>          <h6><em></em></h6>          <h4><em></em></h4>          <h5 align="center"><em>Nino Guarnacci &amp; Gabriele Folchi</em></h5>          <h5 align="center"><a href="mailto:nino.guarnacci@oracle.com">nino.guarnacci@oracle.com</a> <a href="mailto:gabriele.folchi@oracle.com">gabriele.folchi@oracle.com</a></h5>       </td>     </tr>   </tbody></table>  <p>&#160;</p>  <p></p>  <div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:89881e9e-cad7-4eb9-b311-12dba5967231" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px">Technorati Tags: <a href="http://technorati.com/tags/portal" rel="tag">portal</a>,<a href="http://technorati.com/tags/weblogic" rel="tag">weblogic</a>,<a href="http://technorati.com/tags/portlet" rel="tag">portlet</a>,<a href="http://technorati.com/tags/presentation%20services" rel="tag">presentation services</a>,<a href="http://technorati.com/tags/web%20services" rel="tag">web services</a>,<a href="http://technorati.com/tags/friendly%20url" rel="tag">friendly url</a></div>  <p></p>  <p><a href="mailto:gabriele.folchi@oracle.com"></a></p>]]></description>
         <link>http://blogs.oracle.com/slc/2008/12/the_bookmark_portlet_locator.html</link>
         <guid>http://blogs.oracle.com/slc/2008/12/the_bookmark_portlet_locator.html</guid>
                  <category domain="http://www.sixapart.com/ns/types#category">Integration Solution</category>
                  <category domain="http://www.sixapart.com/ns/types#category">Portal and Portlet</category>
                  <category domain="http://www.sixapart.com/ns/types#category">Presentation Services</category>
        
                  <category domain="http://www.sixapart.com/ns/types#tag">portal</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">portlet</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">presentation services</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">web services</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">weblogic</category>
        
         <pubDate>Fri, 05 Dec 2008 17:47:28 +0100</pubDate>
      </item>
      
   </channel>
</rss>
