Zkoss with Cooliris Pluging

coolzkjv

Cooliris is a beautifull plugin for manage image galleries, and ZK (ZKoss) is my favorite RIA based on Java… so i want to try an integration of all those amazing tech…. About CoolIris exists a flash plugin named “Embedded Wall” that is an SWF that can be embed in you site or application.

Yuo can view an exaple at :  http://www.blu-blu.info/galleria_new.zul

The code of the example :

  1.  
  2.  
  3. <![CDATA[
  4.          int wh = 0;
  5.          int whd = 0;
  6.          void getClientInfo(ClientInfoEvent evt) throws InterruptedException {
  7.  
  8.                     session.setAttribute("CH",evt.getDesktopHeight());
  9.                         session.setAttribute("CW",evt.getDesktopWidth());
  10.  
  11.                     /* org.zkoss.zhtml.Messagebox.show(getClientHeight() + "pippo"); */
  12.             }
  13.  
  14.      void onResizeMe(Div dd)
  15.            {
  16.  
  17.         if (session.getAttribute("CH")!= null) {
  18.                 whd = Integer.parseInt(session.getAttribute("CH").toString());
  19.                         wh = whd - 80;
  20.  
  21.                         if (dd != null) {
  22.                                 dd.setHeight(wh + "px");
  23.                         }
  24.         }
  25.  
  26.            }
  27. ]]></zscript>
  28. <window title="album" border="normal" onClientInfo="getClientInfo(event);onResizeMe(div_mainContent);buildCool(html_flash_obj);">
  29. <div id="div_mainContent"  style="overflow:auto;" mce_style="overflow:auto;" >
  30. <html id="html_flash_obj"><![CDATA[
  31.  
  32.     ]]>
  33. <zscript><![CDATA[
  34.    public void buildCool(Html renderTo)
  35.    {
  36.                         String strFeedPhoto = "http%3A%2F%2Fwww.viadallufficio.eu%2Fwp-content%2Fplugins%2Fnextgen-gallery%2Fxml%2Fmedia-rss.php%3Fgid%3D4%26mode%3Dgallery";
  37.                         String strHeight = (Integer.parseInt(session.getAttribute("CH").toString()) - 100) + "";
  38.                         String strWidth =  (Integer.parseInt(session.getAttribute("CW").toString()) - 20) + "";
  39.  
  40.                         String str_Cooliris = "<span class="mceItemObject"  id=\"o\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" ";
  41.                         str_Cooliris += " width=\"" + strWidth + "\" height=\"" + strHeight + "\"> \n";
  42.                         //str_Cooliris += "<span  name=\"movie\" value=\"http://apps.cooliris.com/embed/cooliris.swf\" class="mceItemParam"></span>\n";
  43.                         str_Cooliris += "<span  name=\"movie\" value=\"http://localhost:7080/blublu/cooliris.swf\" class="mceItemParam"></span>\n";
  44.                         str_Cooliris += "<span  name=\"flashvars\" value=\"feed=" + strFeedPhoto + "\" class="mceItemParam"></span>\n";
  45.                         str_Cooliris += "<span  name=\"allowFullScreen\" value=\"true\" class="mceItemParam"></span>\n";
  46.                         str_Cooliris += "<span  name=\"allowScriptAccess\" value=\"always\" class="mceItemParam"></span>\n";
  47.                         // str_Cooliris += "<span class="mceItemEmbed"  type=\"application/x-shockwave-flash\" src="\" mce_src="\""http://apps.cooliris.com/embed/cooliris.swf\" \n";
  48.                         str_Cooliris += "<span class="mceItemEmbed"  type=\"application/x-shockwave-flash\" src="\" mce_src="\""http://localhost:7080/blublu/cooliris.swf\" \n";
  49.                         str_Cooliris += "width=\"" + strWidth + "\" height=\"" + strHeight + "\" ";
  50.                         str_Cooliris += "flashvars=\"feed=" + strFeedPhoto + "\" ";
  51.                         str_Cooliris += "allowFullScreen=\"true\" allowScriptAccess=\"always\"></span></span>";
  52.  
  53.                         renderTo.setContent(str_Cooliris);
  54.    }
  55.    //buildCool(html_flash_obj);
  56.                   ]]>

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>