Getyear()

HI,
If i do:
java.sql.Date date1;
String year1;
year1=date1.getyear();
System.out.println(year);
I get year=80 whereas in my database i have 1980...
No problem to update or create records with the year complete..
But which method could i use to get then the date comple???

The getYear() method of the java.sql.Date class always returns the year which is 1900 less than the actual year. so if you do the same functionality for year 2001 the result will be 101, so while displaying year you can use :
System.out.println(year+1900);
and also As of JDK version 1.1 this method is deprecated and replaced by Calendar.get(Calendar.YEAR) - 1900.

Similar Messages

  • New Date() -- getYear() & getMonth() return strange/wrong values

    Hi,
    I am writing this Javascript under a text field initialize event of Livecycle:
    var date = new Date();
    xfa.host.messageBox("year "+date.getYear(),"Message",3);
    xfa.host.messageBox("month "+date.getMonth(),"Message",3);
    I get "113" for the first messageBox and "5" for the second.
    Shouldn't they be 13 (or 2013) and 6 as we are in June 2013 now??
    Thanks

    Apparently solved, sorry for rush-asking the forum. I am using date.getFullYear() to have 2013 and I found that months are 0-indexed. Therefore, January is 0.
    Thanks anyway

  • Problem with Date.getYear() !!!!!!!!!!

    I have a Date variable with the following format: yyyy-MM-d HH:mm:ss
    And I have a method that returns me the year:
    public int getPtYear(Date d){
    int y = d.getYear();
    return y;
    *d is the Date variable.
    But something is wrong because I keep getting the value '104' instead of '2004' that is the right year.
    Can anyone help me?
    Thanx in advance.

    read API, its deprecated... use calendar.year
    Calendar calendar = GregorianCalendar.getInstance();
    System.out.println("year: " + calendar.get( Calendar.YEAR ) );
    good luck!
    http://java.sun.com/j2se/1.4.2/docs/api/java/util/Date.html#getYear()

  • GetYear help for a complete noob

    Hey.
    I'm creating a sql data set for my data model that goes like this:
    select     "Credit Memo"."Cm Fecha Creacion" as "Cm Fecha Creacion",
         "Medidas CM (Nivel RF)"."Cm Monto Total" as "Cm Monto Total",
         "Medidas RF (Nivel RF)"."Rf Monto Total" as "Rf Monto Total"
    from     "SAG"."Medidas RF (Nivel RF)" "Medidas RF (Nivel RF)",
         "SAG"."Medidas CM (Nivel RF)" "Medidas CM (Nivel RF)",     
         "SAG"."Credit Memo" "Credit Memo"
    where YEAR("Credit Memo"."Cm Fecha Creacion") = YEAR(:p_year)
    but i get into 2 errors when doing this.
    1)When saving the data set The YEAR(:p_year) errors out
    2)If I put where YEAR("Credit Memo"."Cm Fecha Creacion") = :p_year (no year function on the right side)
    it saves but when running the xml data samle I get "parsing error"
    I've went thought this forum. And i got to post recommending function like <?xdoxslt:get_year(‘2000-04-08’, $_XDOLOCALE)?>.
    I have no clue where I can put them, its clear that SQL editor is not the place, right?.
    Is there any XML editor for my data sets. Is the "code" view intended for this? How could I use it in that case?
    Thanks!

    Hi LD.
    Thanks for the reply.  My MacBook won't even recognise the Time Capsule, I've messed about with the netowrk settings too much I think. 
    I'm really really stuck.

  • Error while saving date value in Java dictionary

    Hello Everybody,
    I got following error while saving date value in one of the fields of the Java table.
    Internal error occured in submit request: Error in method updateRequestContact : The object of type java.sql.Date with the value '2005-12-04 08:00:00.0' assigned to host variable 9 is not normalized. It must not contain time components in the time zone running the virtual machine.
    I can't find why it is taking time value in the date object.
    This value is coming from the RFC as a date value, and I am saving this value in Java dictionary table.
    Same code for this was working fine earlier. But, now suddenly it gives error like this.
    Even if I provide date on the screen from webdynpro application, this date value can't save in the Java dictionary and gives same error.
    What should be the problem behind this?
    Regards,
    Bhavik

    Hi Satyajit,
    I am getting date value from the screen of the webdynpro application from date picker control and passing this value in Java dictionary.
    More Information:
    I have dat value in the Date object: <b>target_date</b>
    But Now I have made new Date object as following:
    Date target_Date1 = new Date(target_date.getYear(),target_date.getMonth(),target_date.getDate());
    Then I am passing this object to Java dictionary. Still it gives same error.
    Then I have changed code as following:
              int l_year;
              int l_month;
              int l_days;
              l_year = target_Date.getYear();
              l_month = target_Date.getMonth();
              l_days = target_Date.getDate();
         Date target_Date1 = new Date(l_year,l_month,l_days);
    Now it works for me.
    But I guess this is not the perment solution. It looks very strange. I have used so many date objects at various palces. So, this solution is not the final for me.
    I want to findout the main cause of it.
    One more thing: This code was working for a mornth or two. But, now suddenly it is giving this error.
    Please help me if anybody knows.
    Regards,
    Bhavik

  • Remove space after text in table?

    Hello!
    I am hoping that someone can help me out with this issue. Basically I want the extra space in each row or the tabel to be gone. I cant seem to sort out how.
    Any ideas?
    http://www.glennbartley.com/photoworkshops/home.htm
    Thank you very much!
    Glenn
    CODE:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <meta name="verify-v1" content="KlxWeqA4VpyVuSC1GrV7bdzvgvpOjVtDQS/cjguScTg=" />
    <title>Bird Photography Workshops - Glenn Bartley Nature Photography</title>
    <meta name="description" content="Bird Photography Workshops and Nature Photography Workshops from Canada, Ecuador, Costa Rica and around the world focusing on birds">
    <meta name="keywords" content="Nature Photography Workshops, Bird Photography Workshops, Glenn Bartley, Canada, Ecuador, Costa Rica, birds, Bird photography tours, digital photography, photographic workshops, photographer, photographers, bird photo workshops, nature photography classes, bird photographs, bird photos, birds, photos, workshops, workshop, nature, Hummingbirds">
    <meta name="Classification" content="Nature Photography, Bird Photography, Wildlife Photography, Landscape Photography,Digital Photography.">
    <meta name="author/photographer" content="Glenn Bartley">
    <meta name="ROBOTS" content="index,follow">
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <script language="JavaScript" type="text/JavaScript">
    <!--
    function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    //-->
    </script>
    <script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
    <style type="text/css">
    <!--
    .style29 {
              font-weight: bold;
              font-family: Arial, Helvetica, sans-serif;
              font-size: small;
              color: #000000;
    .style36 {
              font-size: small;
              color: #000000;
              font-family: Arial, Helvetica, sans-serif;
    .style37 {
              color: #000000;
              font-size: small;
    .style38 {
              font-size: x-large;
              color: #CCCCCC;
              font-family: Arial, Helvetica, sans-serif;
    .style40 {
              font-family: Arial, Helvetica, sans-serif;
              font-weight: bold;
              color: #333333;
    .style45 {font-family: Arial, Helvetica, sans-serif}
    .style46 {font-family: Arial, Helvetica, sans-serif; font-size: small; }
    .style47 {
              color: #006600;
              font-size: 28px;
              font-family: Arial, Helvetica, sans-serif;
    a:link {
              text-decoration: none;
              color: #000000;
    a:visited {
              text-decoration: none;
              color: #000000;
    a:hover {
              text-decoration: underline;
              color: #000000;
    a:active {
              text-decoration: none;
              color: #000000;
    .style48 {color: #000000}
    .style49 {font-size: small}
    .style66 {
              font-family: Arial, Helvetica, sans-serif;
              font-weight: bold;
              color: #000000;
    .style67 {
              font-family: Arial, Helvetica, sans-serif;
              color: #FF0000;
    .style76 {
              color: #FF0000;
              font-family: Arial, Helvetica, sans-serif;
              font-size: 24px;
    .style79 {font-family: Arial, Helvetica, sans-serif; font-size: 16px; }
    .style80 {
              color: #0000FF
    .style85 {color: #0000FF}
    .style86 {font-size: 9px}
    .style87 {
              color: #006600;
              font-weight: bold;
    .style79 li strong {
              color: #006600;
    .GreenLarge {
              color: #006600;
    .style76 p .GreenLarge font {
              font-weight: bold;
    .style79 li strong .style80 {
              color: #0000FF;
    -->
    </style>
    </head>
    <p align="right"><font size="-2" face="Arial, Helvetica, sans-serif">
    <script language="JavaScript"><!--
    function makeArray() {
         for (i = 0; i<makeArray.arguments.length; i++)
              this[i + 1] = makeArray.arguments[i];
    var months = new makeArray('January','February','March',
        'April','May','June','July','August','September',
        'October','November','December');
    var date = new Date();
    var day  = date.getDate();
    var month = date.getMonth() + 1;
    var yy = date.getYear();
    var year = (yy < 1000) ? yy + 1900 : yy;
    document.write(day + " " + months[month] + " " + year);
    //--></script>
    <body bgcolor="#FFFFFF" text="#000000">
    <table width="100%" height="63" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td bordercolor="#FFFFFF" bgcolor="#FFFFFF"><div align="center"><img src="Text/GlennBartleysBirdPhotoWorkshops.jpg" width="980" height="110"></div></td>
      </tr>
    </table>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="10" bordercolor="#FFFFFF" bgcolor="#CCCCCC"><img src="Text/Spacer - gray 10px.jpg" width="250" height="10"></td>
      </tr>
    </table>
    <table width="1000" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td><div align="center"><img src="Text/Spacer - white 10px.jpg" width="250" height="10"></div></td>
      </tr>
    </table>
    <table width="1000" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td><a href="home.htm"><img src="Text/Home button-red.jpg" width="200" height="25" border="0"></a><a href="whoweare.htm"><img src="Text/Who we are button.jpg" width="200" height="25" border="0"></a><a href="photoworkshops.htm"><img src="Text/Photo Workshops button.jpg" width="200" height="25" border="0"></a><a href="portfolio.htm"><img src="Text/Portfolio button.jpg" width="200" height="25" border="0"></a><a href="contact.htm"><img src="Text/Contact button.jpg" width="200" height="25" border="0"></a></td>
      </tr>
    </table>
    <table width="1000" height="492" border="0" align="center" cellpadding="4">
      <tr>
        <td height="18" nowrap bordercolor="#FFFFFF" bgcolor="#FFFFFF"> </td>
        <td width="601" rowspan="8" bordercolor="#FFFFFF" bgcolor="#FFFFFF"><img src="Text/Spacer - white 10px.jpg" width="250" height="25">
          <script type="text/javascript">
    AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','wid th','600','height','400','hspace','0','vspace','0','align','middle','src','Images/Index slideshow/Slideshow','quality','high','flashvars','flashlet={imageLinkTarget:\'_blank\',c aptionFont:\'Verdana\',titleFont:\'Verdana\',showControls:false,frameShow:false,slideDelay :4,captionSize:10,captionColor:#333333,titleSize:10,transitionsType:\'Iris\',titleColor:#3 33333,slideAutoPlay:true,slideLoop:true,frameThickness:5,frameColor:#000000,bgColor:#FFFFF F,imageCaptions:[],imageURLs:[\'Images/Index slideshow/Andean Cock-of-the-Rock - 01.jpg\',\'Images/Index slideshow/Pacific Loon - 28.jpg\',\'Images/Index slideshow/American Golden Plover - 10.jpg\',\'Images/Index slideshow/Black-crested Coquette - 11.jpg\',\'Images/Index slideshow/Orange-eared Tanager - 02.jpg\',\'Images/Index slideshow/Common Eider - 22.jpg\',\'Images/Index slideshow/Fasciated Tiger-Heron - 01.jpg\',\'Images/Index slideshow/Red-necked Tanager - 01.jpg\',\'Images/Index slideshow/Mealy Amazon Parrot - 02.jpg\',\'Images/Index slideshow/Northern Waterthrush - 11.jpg\',\'Images/Index slideshow/Purple-crowned Fairy - 03.jpg\',\'Images/Index slideshow/Red-billed Tropicbird - 02.jpg\',\'Images/Index slideshow/Red-eyed Tree Frog - 01.jpg\',\'Images/Index slideshow/Ruby Topaz - 01.jpg\',\'Images/Index slideshow/Snowcap - 14.jpg\',\'Images/Index slideshow/Tufted Coquette - 01.jpg\',\'Images/Index slideshow/Varied Thrush - 15.jpg\',\'Images/Index slideshow/Violet Sabrewings - 07.jpg\',\'Images/Index slideshow/Whimbrel - 17.jpg\',\'Images/Index slideshow/Common Loon - 19.jpg\',\'Images/Index slideshow/Horned Grebe - 14.jpg\',\'Images/Index slideshow/Willow Ptarmigan - 01.jpg\',\'Images/Index slideshow/Cape May Warbler - 05.jpg\',\'Images/Index slideshow/Bartley - 01.jpg\',\'Images/Index slideshow/Bartley - 06.jpg\'],imageLinks:[\'http://www.glennbartley.com/photoworkshops/photoworkshops.htm\']}','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','flas h_component','ImageViewer.swc','movie','Images/Index slideshow/Slideshow' ); //end AC code
    </script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="600" height="400" hspace="0" vspace="0" align="middle">
      <param name="flash_component" value="ImageViewer.swc">
      <param name="movie" value="Images/Index slideshow/Slideshow.swf">
      <param name="quality" value="high">
      <param name="FlashVars" value="flashlet={imageLinkTarget:'_blank',captionFont:'Verdana',titleFont:'Verdana',showC ontrols:false,frameShow:false,slideDelay:4,captionSize:10,captionColor:#333333,titleSize:1 0,transitionsType:'Iris',titleColor:#333333,slideAutoPlay:true,slideLoop:true,frameThickne ss:5,frameColor:#000000,bgColor:#FFFFFF,imageCaptions:[],imageURLs:['Images/Index slideshow/Andean Cock-of-the-Rock - 01.jpg','Images/Index slideshow/Pacific Loon - 28.jpg','Images/Index slideshow/American Golden Plover - 10.jpg','Images/Index slideshow/Black-crested Coquette - 11.jpg','Images/Index slideshow/Orange-eared Tanager - 02.jpg','Images/Index slideshow/Common Eider - 22.jpg','Images/Index slideshow/Fasciated Tiger-Heron - 01.jpg','Images/Index slideshow/Red-necked Tanager - 01.jpg','Images/Index slideshow/Mealy Amazon Parrot - 02.jpg','Images/Index slideshow/Northern Waterthrush - 11.jpg','Images/Index slideshow/Purple-crowned Fairy - 03.jpg','Images/Index slideshow/Red-billed Tropicbird - 02.jpg','Images/Index slideshow/Red-eyed Tree Frog - 01.jpg','Images/Index slideshow/Ruby Topaz - 01.jpg','Images/Index slideshow/Snowcap - 14.jpg','Images/Index slideshow/Tufted Coquette - 01.jpg','Images/Index slideshow/Varied Thrush - 15.jpg','Images/Index slideshow/Violet Sabrewings - 07.jpg','Images/Index slideshow/Whimbrel - 17.jpg','Images/Index slideshow/Common Loon - 19.jpg','Images/Index slideshow/Horned Grebe - 14.jpg','Images/Index slideshow/Willow Ptarmigan - 01.jpg','Images/Index slideshow/Cape May Warbler - 05.jpg','Images/Index slideshow/Bartley - 01.jpg','Images/Index slideshow/Bartley - 06.jpg'],imageLinks:['http://www.glennbartley.com/photoworkshops/photoworkshops.htm']}">
      <embed src="Images/Index slideshow/Slideshow.swf" width="600" height="400" hspace="0" vspace="0" align="middle" quality="high" flashvars="flashlet={imageLinkTarget:'_blank',captionFont:'Verdana',titleFont:'Verdana',s howControls:false,frameShow:false,slideDelay:4,captionSize:10,captionColor:#333333,titleSi ze:10,transitionsType:'Iris',titleColor:#333333,slideAutoPlay:true,slideLoop:true,frameThi ckness:5,frameColor:#000000,bgColor:#FFFFFF,imageCaptions:[],imageURLs:['Images/Index slideshow/Andean Cock-of-the-Rock - 01.jpg','Images/Index slideshow/Pacific Loon - 28.jpg','Images/Index slideshow/American Golden Plover - 10.jpg','Images/Index slideshow/Black-crested Coquette - 11.jpg','Images/Index slideshow/Orange-eared Tanager - 02.jpg','Images/Index slideshow/Common Eider - 22.jpg','Images/Index slideshow/Fasciated Tiger-Heron - 01.jpg','Images/Index slideshow/Red-necked Tanager - 01.jpg','Images/Index slideshow/Mealy Amazon Parrot - 02.jpg','Images/Index slideshow/Northern Waterthrush - 11.jpg','Images/Index slideshow/Purple-crowned Fairy - 03.jpg','Images/Index slideshow/Red-billed Tropicbird - 02.jpg','Images/Index slideshow/Red-eyed Tree Frog - 01.jpg','Images/Index slideshow/Ruby Topaz - 01.jpg','Images/Index slideshow/Snowcap - 14.jpg','Images/Index slideshow/Tufted Coquette - 01.jpg','Images/Index slideshow/Varied Thrush - 15.jpg','Images/Index slideshow/Violet Sabrewings - 07.jpg','Images/Index slideshow/Whimbrel - 17.jpg','Images/Index slideshow/Common Loon - 19.jpg','Images/Index slideshow/Horned Grebe - 14.jpg','Images/Index slideshow/Willow Ptarmigan - 01.jpg','Images/Index slideshow/Cape May Warbler - 05.jpg','Images/Index slideshow/Bartley - 01.jpg','Images/Index slideshow/Bartley - 06.jpg'],imageLinks:['http://www.glennbartley.com/photoworkshops/photoworkshops.htm']}" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" flash_component="ImageViewer.swc"> </embed>
      </object>
      </noscript></td>
      </tr>
      <tr>
        <td width="393" align="center" valign="middle" bordercolor="#FFFFFF" bgcolor="#999999"><p align="center" class="style40 style47">2015 PHOTOGRAPHY WORKSHOPS</p>      </td>
      </tr>
      <tr bordercolor="#000002">
        <td bordercolor="#FFFFFF" bgcolor="#CCCCCC"><ul class="style79">
          <li><strong><span class="style48"><a href="Workshops/Ecuador.htm"> ECUADOR: HUMMINGBIRDS AND MORE!</a></span></strong></li>
          <li>JAN, 2015 <span class="style85">-<strong><span class="style80"><span class="style67">SOLD OUT</span></span></strong></span></li>
          <li> JAN, 2015 - <strong><span class="style67">SOLD OUT</span></strong></li>
        </ul></td>
      </tr>
      <tr bordercolor="#000002">
        <td height="64" bordercolor="#FFFFFF" bgcolor="#CCCCCC"><ul class="style79">
          <li><strong><a href="Workshops/VancouverIsland.htm">VANCOUVER ISLAND: WATERFOWL</a></strong></li>
          <li>MAR 9-13, 2015 -<strong><span class="style85"> </span><span class="style80">SIGN UP TODAY!</span></strong></li>
          <li>MAR 16-20, 2015  -<strong><span class="style85"> </span><span class="style80">SIGN UP TODAY!</span></strong></li>
        </ul></td>
      </tr>
      <tr bordercolor="#000002">
        <td height="64" bordercolor="#FFFFFF" bgcolor="#CCCCCC"><ul class="style79">
          <li><strong><a href="Workshops/CostaRica.html">COSTA RICA: NATURE PHOTOGRAPHY</a></strong></li>
          <li> APR, 2015 -<strong><span class="style85"> </span><a href="mailto:[email protected]"><u>EMAIL</u></a> TO JOIN WISH LIST</strong></li>
          <li>OCT, 2015  -<strong><span class="style85"> </span><a href="mailto:[email protected]"><u>EMAIL</u></a> TO JOIN WISH LIST</strong></li>
        </ul></td>
      </tr>
      <tr bordercolor="#000002">
        <td height="46" bordercolor="#FFFFFF" bgcolor="#CCCCCC"><ul class="style79">
          <li><strong><a href="Workshops/Manitoba-Churchill.htm">CHURCHILL: TUNDRA BIRDS &amp; WILDLIFE</a></strong></li>
          <li> JUNE, 2016 - <strong><a href="mailto:[email protected]"><u>EMAIL</u></a> TO JOIN WISH LIST</strong></li>
          </ul>
        </td>
      </tr>
      <tr bordercolor="#000002">
        <td height="46" bordercolor="#FFFFFF" bgcolor="#CCCCCC"><ul class="style79">
          <li><strong><a href="Workshops/Peru.html">PERU: MANU NATIONAL PARK</a></strong></li>
          <li>SEPT, 2015 -<strong><span class="style85"> </span><a href="mailto:[email protected]"><u>EMAIL</u></a> TO JOIN WISH LIST</strong></li>
          <li>SEPT, 2015 -<strong><span class="style85"> </span><a href="mailto:[email protected]"><u>EMAIL</u></a> TO JOIN WISH LIST</strong></li>
        </ul></td>
      </tr>
      <tr bordercolor="#000002">
        <td height="64" bordercolor="#FFFFFF" bgcolor="#CCCCCC"><ul class="style79">
          <li><strong><a href="Workshops/OneonOneWorkshops.htm">CUSTOM / PHOTOSHOP WORKSHOPS</a></strong></li>
          <li>PRIVATE LESSONS<span class="style85"><strong></strong></span></li>
          <li><strong><a href="Workshops/OneonOneWorkshops.htm">CLICK HERE</a></strong> FOR DETAILS</li>
        </ul></td>
      </tr>
    </table>
    <table width="1000" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td> </td>
      </tr>
      <tr>
        <td height="72"><div align="center" class="style76">
          <p><strong><font color="#FF0000" face="Arial, Helvetica, sans-serif"><a href="mailto:[email protected]"></a> </font></strong><font face="Arial, Helvetica, sans-serif">ALL 2014 TRIPS ARE SOLD OUT</font></p>
          <p><span class="GreenLarge"><font face="Arial, Helvetica, sans-serif">SOME 2015 DATES NOW AVAILABLE -</font><font face="Arial, Helvetica, sans-serif"></font></span><font face="Arial, Helvetica, sans-serif"> <strong><font color="#FF0000" face="Arial, Helvetica, sans-serif"><a href="mailto:[email protected]"><u>EMAIL GLENN</u> TO JOIN THE WISH LISTS</a></font></strong></font><span class="style87">.</span></p>
          <p><a href="../mailinglist.htm"><img src="../naturephotography/Text/newsletter Button3 - White.jpg" width="215" height="60" border="0"></a></p>
          <p class="style86"> </p>
        </div></td>
      </tr>
      <tr>
        <td><div align="right" class="style45">
          <p align="center"><span class="style37"><a href="Workshops/VancouverIsland.htm">VANCOUVER ISLAND</a> - <a href="Workshops/Ecuador.htm">ECUADOR</a> - <a href="Workshops/CostaRica.html">COSTA RICA</a> - <a href="Workshops/Manitoba-Churchill.htm">CHURCHILL</a> - PERU - <a href="Workshops/OneonOneWorkshops.htm">CUSTOM PHOTO WORKSHOPS</a></span></p>
        </div></td>
      </tr>
    </table>
    <table width="1000" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td><div align="center" class="style46">
          <p> </p>
          <p> </p>
        </div></td>
      </tr>
      <tr>
        <td height="14"><div align="center">
          <p align="right"><font color="#000000" size="-2" face="Arial, Helvetica, sans-serif">Site designed and created by Glenn Bartley. &copy; 2014 Glenn Bartley Nature Photography. All Rights Reserved</font></p>
          </div></td>
      </tr>
    </table>
    <p> </p>
    <p align="center"> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <table width="1000" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td height="367"><h1 class="style38"><span class="style48"><a href="photoworkshops.htm">BIRD PHOTOGRAPHY WORKSHOPS</a> - <a href="Workshops/VancouverIsland.htm">CANADA</a>, <a href="Workshops/Ecuador.htm">ECUADOR</a>, <a href="Workshops/CostaRica.html">COSTA RICA</a> AND MORE</span></h1>
        <p class="style36"><strong>Glenn  Bartley</strong> is a professional nature photographer from Victoria, British Columbia on Canada's west  coast.  He focuses on capturing intimate portraits of birds in their  natural surroundings. Glenn strives  for what he calls &ldquo;clean&rdquo; images &ndash; where the subject is clear, distracting  elements are kept to a minimum and the background is pleasingly blurred out of  focus. Glenn&rsquo;s  work has been published widely throughout North America in books and  magazines (such as Birder&rsquo;s World, Birding &amp; Bird Watchers Digest).  His most recent book is entitled &ndash; &ldquo;Birds in Ecuador: A Photographic  Journey.&rdquo; Glenn  loves to share his passion for photography and for the natural world with those  who attend his photographic workshops and with participants of www.naturescapes.net where he is a  moderator in the Birds forum.</p>
          <p align="left" class="style37"><font face="Arial, Helvetica, sans-serif">What  makes Glenn's <a href="photoworkshops.htm">photography workshops</a> different from the competitors?</font></p>
          <div align="left" class="style48">
            <ul>
              <li class="style49"><font face="Arial, Helvetica, sans-serif">Glenn focuses on more personalized attention,instruction  and guidance.</font></li>
              <li class="style49"><font face="Arial, Helvetica, sans-serif">Glenn is regarded one of the world&rsquo;s top  professional photographers in bird portrait  photography. Just go pick up a birding magazine and you will almost certainly find his images.</font></li>
              <li class="style49"><font face="Arial, Helvetica, sans-serif">Glenn  often utilizes local guides with years of  experience in their home areas. </font></li>
              <li class="style49"><font face="Arial, Helvetica, sans-serif">Glenn has more  experience.  He has been to the places that he will take you &ndash;  not for a week or two &ndash; but for months!!   Glenn knows where to get the best possible images and can show you how to  achieve them.  </font></li>
              <li class="style49"><font face="Arial, Helvetica, sans-serif">Having completed his Msc. in Environmental Studies Glenn is very environmentally and socially aware.  When we visit communities around the  world we give something back to these places and the people who live  there. </font></li>
              <li class="style49"><font face="Arial, Helvetica, sans-serif">Glenn's <a href="photoworkshops.htm">Photography Workshops</a> will be fun too!</font></li>
            </ul>
            <p align="center" class="style66">JOIN NATURE PHOTOGRAPHER GLENN BARTLEY FOR A BIRD PHOTOGRAPHY WORKSHOP TO:</p>
            <ul class="style48">
              <li class="style45"> <a href="Workshops/CostaRica.html"><strong>COSTA RICA PHOTOGRAPHY WORKSHOP</strong></a> - TROPICAL BIRD PHOTOGRAPHY AT ITS FINEST</li>
              <li class="style45"><a href="Workshops/Ecuador.htm"><strong>ECUADOR PHOTOGRAPHY WORKSHOP</strong></a> - HUMMINGBIRD PHOTOGRAPHY</li>
              <li class="style45"><a href="Workshops/VancouverIsland.htm"><strong>VANCOUVER   ISLAND PHOTOGRAPHY WORKSHOP</strong></a> - NATURE PHOTOGRAPHY OASIS</li>
              <li class="style45"><a href="Workshops/Manitoba-Churchill.htm"><strong>CHURCHILL BIRD PHOTOGRAPHY WORKSHOP</strong></a> - BIRDS OF THE HIGH ARCTIC</li>
              <li class="style45"><a href="../VictoriaBirdPhotoAcademy_Photoshop.html"><strong>ADOBE PHOTOSHOP WORKSHOPS</strong></a> - ONLINE OR IN PERSON I CAN TEACH YOU HOW TO USE ADOBE PHOTOSHOP</li>
              <li class="style45"><a href="Workshops/OneonOneWorkshops.htm"><strong>ONE ON ONE BIRD PHOTOGRAPHY WORKSHOPS</strong></a> - CONTACT ME TO DISCUSS THE OPTIONS FOR INDIVIDUAL OR SMALL GROUP BIRD PHOTOGRAPHY WORKSHOPS</li>
            </ul>
            <p align="center" class="style67"><strong>GLENNS CURRENT BIRD PHOTOGRAPHY PORTFOLIOS</strong>:</p>
            <ul class="style48">
              <li class="style45"><a href="../naturephotography/birdslist.htm"><strong>BIRDS OF NORTH AMERICA</strong></a> - 380 bird species from North America and counting...</li>
              <li class="style45"><a href="../naturephotography/Ecuador/ecuador birdslist.htm"><strong>BIRDS OF ECUADOR</strong></a> - Over 375 bird species from mainland Ecuador</li>
              <li class="style45"><a href="../naturephotography/costarica birdslist.htm"><strong>BIRDS OF COSTA RICA</strong></a> - Over 250 bird species from Costa Rica</li>
              <li class="style45"><a href="../naturephotography/Trinidad/trinidad birdslist.htm"><strong>BIRDS OF TRINIDAD AND TOBAGO</strong></a> - A sample of some of the exciting birds that call these Islands home...</li>
              <li class="style45"><a href="../naturephotography/articles/HummingbirdsoftheWorld.html"><strong>HUMMINGBIRD PHOTOGRAPHY</strong></a> - Over 100 species of Hummingbirds Photographed.</li>
              <li class="style45"><a href="../naturephotography/North American Warblers.html"><strong>WARBLERS OF NORTH AMERICA</strong></a> - Nearly all of the Wood Warblers that live in Canada.</li>
            </ul>
            <p align="center" class="style66">BIRD PHOTOGRAPHY EQUIPMENT:</p>
            <p align="left" class="style67">I currently use Canon Digital Photography equipment. My primary camera is the Canon 7D and I use lenses including the 500mm f/4 L IS, 300mm f/4 L IS, 400mm f/5.6 L, and 17-40mm f/4 L. To find out more about the bird photography equipment that I use visit my <a href="naturephotography/articles/gear.htm">nature photography equipment page</a>.</p>
            <p align="center" class="style67"><strong>PHOTOGRAPHER BIOGRAPHY</strong>:</p>
            <div align="left" class="style48">
              <p class="style45">I have
                been enchanted by nature, birds and wildlife for as long as I can remember.
                Growing up in Toronto, Canada I can recall countless hours spent
                glued to National Geographic magazines, natural history books or watching
                David Suzuki's &quot;The Nature of Things&quot; on TV. Those days
                I took any opportunity I had to study and learn about animals of all
                kinds. Nowadays
                I often find myself up at the crack of dawn, knee-deep in mud or covered
                in mosquitoes all in pursuit of capturing just a glimpse of natures
                beauty. Although I enjoy photographing all of mother natures fascinating
                creatures. I tend to focus on birds. Why birds? I think it's because
                there are so many species of birds, they can be found almost anywhere, they are
                challenging to photograph and they are beautiful to watch. I love birds!</p>
            </div>
            <p align="left" class="style67">I
              will continue to strive to improve my craft of bird photography, and capture some part of
              the beauty that surrounds us all. Along the way I look forward to sharing
              my passion for nature photography, birds and the natural world with each and every
              one of you. Thanks
              for visiting. I hope you enjoy my site.</p>
            <p align="center" class="style67"><strong>RECENT BOOK PROJECTS:</strong></p>
            <ul>
              <li class="style67"><strong><a href="../VancouverIslandBook.html">BIRDS OF VANCOUVER ISLAND</a></strong> - GLENN BARTLEY</li>
              <li class="style67"><strong><a href="../Ecuador book.html">BIRDS IN ECUADOR</a></strong> - GLENN BARTLEY</li>
              <li class="style67"><strong>BIRD COLORATION</strong> - NATIONAL GEOGRAPHIC SOCIETY</li>
              <li class="style67"><strong>GLOBAL BIRDING</strong> - NATIONAL GEOGRAPHIC SOCIETY</li>
            </ul>
            <p> </p>
          </div>
          <p class="style36"> </p>
          <h2 align="center" class="style29">KEYWORDS: BIRD, PHOTOGRAPHY, <a href="photoworkshops.htm">PHOTOGRAPHY WORKSHOPS</a>, PHOTOGRAPHY TOURS, NATURE, NATURE PHOTOGRAPHY, CANADA, COSTA RICA, ECUADOR, CHURCHILL, WILDLIFE, CANON, HUMMINGBIRDS</h2></td>
      </tr>
    </table>
    <p align="center">
      <!-- Start of StatCounter Code -->
      <script type="text/javascript">
    var sc_project=4985648;
    var sc_invisible=0;
    var sc_partition=57;
    var sc_click_stat=1;
    var sc_security="92a3aba2";
    var sc_text=2;
      </script>
      <script type="text/javascript"
    src="http://www.statcounter.com/counter/counter.js"></script>
      <noscript>
      </noscript><noscript></noscript>
      <noscript>
      </noscript>
    </p>
    <noscript><div
    class="statcounter">
      <div align="center"></div>
    </div></noscript>
    <!-- Start of StatCounter Code -->
    <script type="text/javascript">
    var sc_project=4985648;
    var sc_invisible=0;
    var sc_partition=57;
    var sc_click_stat=1;
    var sc_security="92a3aba2";
    var sc_text=2;
    </script>
    <!-- Start of StatCounter Code -->
    <script type="text/javascript">
    var sc_project=6201502;
    var sc_invisible=1;
    var sc_security="65bdf721";
    </script>
    <script type="text/javascript"
    src="http://www.statcounter.com/counter/counter.js"></script><noscript><div
    class="statcounter"><a title="weebly analytics"
    href="http://www.statcounter.com/weebly/"
    target="_blank"><img class="statcounter"
    src="http://c.statcounter.com/6201502/0/65bdf721/1/"
    alt="weebly analytics" ></a></div></noscript>
    <!-- End of StatCounter Code -->
        <p> </p>
        <p> </p>
        <p> </p>
      </div>
    </div></noscript>
    <!-- End of StatCounter Code -->
    </body>
    </html>
    <table style="border-style:none;border-bottom-width:0;border-top-width:0;border-left-width:0;bor der-right-width:0;border-bottom-color:#99CCFF;border-top-color:#99CCFF;border-right-color: #99CCFF;border-left-color:#99CCFF;" cellpadding=4><tr><td>
    <font color="#CCCCCC" face="arial">

    Line 88 in your source, add this into your .style79...
    margin-bottom:0;
    So from...
    .style79 {font-family: Arial, Helvetica, sans-serif; font-size: 16px; }
    to
    .style79 {font-family: Arial, Helvetica, sans-serif; font-size: 16px; margin-bottom:0; }
    That should do the trick.

  • Is there a way to change the LUt extension form .CUBE to .cube. on export. TX

    Is there a way to change the LUt extension form .CUBE to .cube. on export with this script in photoshop For MAC:
    Chris Cox wrote:
    The file extensions are written by the export plugin.  (which incidentally has a comment that two studios wanted all caps extensions, but I failed to write down which ones in the comments)
    To change the filenames, you'd want to add something at the end of doExportLUTs() that uses the supplied path and substitutes the desired extensions, then renames the file.
    Thank you
    // Export Color Lookup Tables automation in JavaScript
    // IN_PROGRESS - why can't ColorSync Utility open any profile with a grid of 160 or larger?
    // 150 works, 160 fails -- sent samples in email to Apple on Nov 8, 2013; they are investigating
    // DEFERRED - right to left filenames (Arabic) come out wrong because of appending "RGB" and file extensions
    // This seems to be a bug in JavaScript's handing of strings, not sure we can solve it easily.
    // It might possibly be handled by checking bidi markers in UTF8 stream and adding custom handling for appending text/extensions.
    @@@BUILDINFO@@@ ExportColorLookupTables.jsx 1.0.0.0
    // BEGIN__HARVEST_EXCEPTION_ZSTRING
    <javascriptresource>
    <name>$$$/JavaScripts/ExportColorLookupTables/Menu=Color Lookup Tables...</name>
    <menu>export</menu>
    <enableinfo>true</enableinfo>
    <eventid>9AA9D7D6-C209-494A-CC01-4E7D926DA642</eventid>
    </javascriptresource>
    // END__HARVEST_EXCEPTION_ZSTRING
    #target photoshop
    const appUIState = app.displayDialogs;
    app.displayDialogs = DialogModes.NO; // suppress all app dialogs
    app.bringToFront(); // make Photoshop the frontmost app, just in case
    // on localized builds we pull the $$$/Strings from a .dat file
    $.localize = true;
    // from Terminology.jsx
    const classApplication = app.charIDToTypeID('capp');
    const classProperty = app.charIDToTypeID('Prpr');
    const enumTarget = app.charIDToTypeID('Trgt');
    const eventGet = app.charIDToTypeID('getd');
    const eventSet = app.charIDToTypeID('setd');
    const kcolorSettingsStr = app.stringIDToTypeID("colorSettings");
    const kDither = app.charIDToTypeID('Dthr');
    const keyTo = app.charIDToTypeID('T   ');
    const typeNULL = app.charIDToTypeID('null');
    const typeOrdinal = app.charIDToTypeID('Ordn');
    const kFloatWindowStr = app.stringIDToTypeID("floatWindow");
    const typePurgeItem = app.charIDToTypeID('PrgI');
    const enumClipboard = app.charIDToTypeID('Clpb');
    const eventPurge = app.charIDToTypeID('Prge');
    const keyExportLUT = app.charIDToTypeID( "lut " );
    const keyFilePath = app.charIDToTypeID( 'fpth' );
    const keyDescription = app.charIDToTypeID( 'dscr' );
    const keyCopyright = app.charIDToTypeID( 'Cpyr' );
    const keyDataPoints = app.charIDToTypeID( 'gPts' );
    const keyWriteICC = app.charIDToTypeID( 'wICC' );
    const keyWrite3DL = app.charIDToTypeID( 'w3DL' );
    const keyWriteCUBE = app.charIDToTypeID( 'wCUB' );
    const keyWriteCSP = app.charIDToTypeID( 'wCSP' );
    const kScriptOptionsKey = "9AA9D7D6-C209-494A-CC01-4E7D926DA642"; // same as eventID above
    const sGridMin = 7; // these must match the slider range defined in the dialog layout
    const sGridMax = 256;
    const sGridDefault = 32;
    // our baseline UI configuration info
    var gSaveFilePath = ""; // overwritten by document path
    var gDescription = ""; // overwritten by document name
    var gCopyright = ""; // "Adobe Systems Inc., All Rights Reserved";
    var gGridPoints = sGridDefault;
    var gDoSaveICCProfile = true;
    var gDoSave3DL = true;
    var gDoSaveCUBE = true;
    var gDoSaveCSP = true;
    gScriptResult = undefined;
    // start doing the work...
    main();
    app.displayDialogs = appUIState; // restore original dialog state
    gScriptResult; // must be the last thing - this is returned as the result of the script
    function readOptionsFromDescriptor( d )
      if (!d)
      return;
      if (d.hasKey(keyFilePath))
      gSaveFilePath = d.getString( keyFilePath ); // will be overridden by UI
      if (d.hasKey(keyDescription))
      gDescription = d.getString( keyDescription ); // will be overridden always
      if (d.hasKey(keyCopyright))
      gCopyright = d.getString( keyCopyright );
      if (d.hasKey(keyDataPoints))
      var temp = d.getInteger( keyDataPoints );
      if (temp >= sGridMin && temp <= sGridMax)
      gGridPoints = temp;
      if (d.hasKey(keyWriteICC))
      gDoSaveICCProfile = d.getBoolean( keyWriteICC );
      if (d.hasKey(keyWrite3DL))
      gDoSave3DL = d.getBoolean( keyWrite3DL );
      if (d.hasKey(keyWriteCUBE))
      gDoSaveCUBE = d.getBoolean( keyWriteCUBE );
      if (d.hasKey(keyWriteCSP))
      gDoSaveCSP = d.getBoolean( keyWriteCSP );
    function createDescriptorFromOptions()
      var desc = new ActionDescriptor();
      desc.putString( keyFilePath, gSaveFilePath ); // will be overridden by UI
      desc.putString( keyDescription, gDescription ); // will always be overridden by document name
      desc.putString( keyCopyright, gCopyright );
      desc.putInteger( keyDataPoints, gGridPoints );
      desc.putBoolean( keyWriteICC, gDoSaveICCProfile );
      desc.putBoolean( keyWrite3DL, gDoSave3DL );
      desc.putBoolean( keyWriteCUBE, gDoSaveCUBE );
      desc.putBoolean( keyWriteCSP, gDoSaveCSP );
      return desc;
    function doExportUI()
      // DEFERRED - it might be nice to be able to run without UI
      //  Right now we can't, but someone could modify the script if they so desire
      const sDescription = localize("$$$/AdobeScript/Export3DLUT/Description=Description:");
      const sCopyright = localize("$$$/AdobeScript/Export3DLUT/Copyright=Copyright:");
      const sQuality = localize("$$$/AdobeScript/Export3DLUT/Quality=Quality");
      const sGridPoints = localize("$$$/AdobeScript/Export3DLUT/GridPoints=Grid Points:");
      const sFormatsToSave = localize("$$$/AdobeScript/Export3DLUT/Formats=Formats");
      const sOpenButton = localize("$$$/JavaScripts/psx/OK=OK");
      const sCancelButton = localize("$$$/JavaScripts/psx/Cancel=Cancel");
      const strTextInvalidType = localize("$$$/JavaScripts/Export3DLUT/InvalidType=Invalid numeric value. Default value inserted.");
      const strTextInvalidNum = localize("$$$/JavaScripts/Export3DLUT/InvalidNum=A number between 7 and 256 is required. Closest value inserted.");
      const strNoExportsSelected = localize("$$$/JavaScripts/Export3DLUT/NoExportTypesSelected=No export types were selected.");
      const strExportPrompt = localize("$$$/JavaScripts/Export3DLUT/ExportColorLookup=Export Color Lookup");
      const strUntitledLUT = localize("$$$/JavaScripts/Export3DLUT/UntitledLUTFilename=untitled.lut");
      const sSaveICC = localize("$$$/AdobeScript/Export3DLUT/ICCProfile=ICC Profile");
      // these are not localized, since they refer to file format extensions
      const sSave3DL = "3DL";
      const sSaveCUBE = "CUBE";
      const sSaveCSP = "CSP";
      // strings similar to JPEG quality
      const sPoor = localize("$$$/AdobeScript/Export3DLUT/Poor=Poor");
      const sLow = localize("$$$/AdobeScript/Export3DLUT/Low=Low");
      const sMedium = localize("$$$/AdobeScript/Export3DLUT/Medium=Medium");
      const sHigh = localize("$$$/AdobeScript/Export3DLUT/High=High");
      const sMaximum = localize("$$$/AdobeScript/Export3DLUT/Maximum=Maximum");
      const ui = // dialog resource object
      "dialog { \
      orientation: 'row', \
      gp: Group { \
      orientation: 'column', alignment: 'fill', alignChildren: 'fill', \
      description: Group { \
      orientation: 'row', alignment: 'fill', alignChildren: 'fill', \
      st: StaticText { text:'Description:' }, \
      et: EditText { characters: 30, properties:{multiline:false}, text:'<your description here>' } \
      copyright: Group { \
      orientation: 'row', alignment: 'fill', alignChildren: 'fill', \
      st: StaticText { text:'Copyright:' }, \
      et: EditText { characters: 30, properties:{multiline:false}, text:'<your copyright here>' } \
      qual: Panel { \
      text: 'Quality', \
      orientation: 'column', alignment: 'fill', alignChildren: 'fill', \
      g2: Group { \
      st: StaticText { text:'Grid Points:' }, \
      et: EditText { characters:4, justify:'right' } \
      drp: DropDownList {alignment:'right'} \
      sl: Slider { minvalue:7, maxvalue:256, value: 32 }, \
      options: Panel { \
      text: 'Formats', \
      orientation: 'column', alignment: 'fill', alignChildren: 'left', \
      ck3DL: Checkbox { text:'3DL', value:true }, \
      ckCUBE: Checkbox { text:'CUBE', value:true } \
      ckCSP: Checkbox { text:'CSP', value:true } \
      ckICC: Checkbox { text:'ICC Profile', value:true } \
      gButtons: Group { \
      orientation: 'column', alignment: 'top', alignChildren: 'fill', \
      okBtn: Button { text:'Ok', properties:{name:'ok'} }, \
      cancelBtn: Button { text:'Cancel', properties:{name:'cancel'} } \
      const titleStr = localize("$$$/AdobeScript/Export3DLUT/DialogTitle/ExportColorLookupTables=Export Color Lookup Tables");
      var win = new Window (ui, titleStr ); // new window object with UI resource
        // THEORETICALLY match our dialog background color to the host application
        win.graphics.backgroundColor = win.graphics.newBrush (win.graphics.BrushType.THEME_COLOR, "appDialogBackground");
      // poor, low, medium, high, max
      var MenuQualityToGridPoints = [ 8, 16, 32, 64, 256 ];
      function GridPointsToQualityMenuIndex( num )
      var menu = MenuQualityToGridPoints;
      var menuItems = menu.length;
      if (num <= menu[0])
      return 0;
      if (num >= menu[ menuItems-1 ])
      return (menuItems-1);
      for (var i = 0; i < (menuItems-1); ++i)
      if ((num >= menu[i]) && (num < menu[i+1]))
      return i;
      return 0; // just in case of a logic failure
      // insert our localized strings
      var drop = win.gp.qual.g2.drp; // for easier typing
      drop.add('item', sPoor ); // 0
      drop.add('item', sLow ); // 1
      drop.add('item', sMedium ); // 2
      drop.add('item', sHigh ); // 3
      drop.add('item', sMaximum ); // 4
      drop.selection = drop.items[2]; // Medium
      win.gp.description.st.text = sDescription;
      win.gp.copyright.st.text = sCopyright;
      win.gp.qual.text = sQuality;
      win.gp.qual.g2.st.text = sGridPoints;
      win.gp.options.text = sFormatsToSave;
      win.gp.options.ck3DL.text = sSave3DL;
      win.gp.options.ckCUBE.text = sSaveCUBE;
      win.gp.options.ckCSP.text = sSaveCSP;
      win.gp.options.ckICC.text = sSaveICC;
      win.gButtons.okBtn.text = sOpenButton;
      win.gButtons.cancelBtn.text = sCancelButton;
      // set starting parameters
      win.gp.description.et.text = gDescription;
      win.gp.copyright.et.text = gCopyright;
      win.gp.options.ckICC.value = gDoSaveICCProfile;
      win.gp.options.ck3DL.value = gDoSave3DL;
      win.gp.options.ckCUBE.value = gDoSaveCUBE;
      win.gp.options.ckCSP.value = gDoSaveCSP;
      // global flag/hack to keep the UI pretty
      var gGlobalPreventChanges = false;
      with (win.gp.qual)
      sl.value = gGridPoints;
      g2.et.text = gGridPoints;
      drop.selection = drop.items[ GridPointsToQualityMenuIndex(gGridPoints) ];
      // global flag is ugly, but recursive change calls are uglier
      g2.et.onChange = function () {  if (gGlobalPreventChanges) { return; }
      gGlobalPreventChanges = true;
      var val = Number(this.text);
      this.parent.parent.sl.value = val;
      drop.selection = drop.items[ GridPointsToQualityMenuIndex(val) ];
      gGlobalPreventChanges = false; };
      sl.onChanging = function () {   if (gGlobalPreventChanges) { return; }
      gGlobalPreventChanges = true;
      var val = Math.floor(this.value);
      this.parent.g2.et.text = val;
      drop.selection = drop.items[ GridPointsToQualityMenuIndex(val) ];
      gGlobalPreventChanges = false; };
      // DEFERRED - we should also set the value if the same menu item is selected again (reset)
      // but the JSX toolkit doesn't support that
      drop.onChange = function()
      if (gGlobalPreventChanges) { return; }
      gGlobalPreventChanges = true;
      var theSelection = this.selection.text;
      if (theSelection != null) { // only change if selection made
      var theSelectionIndex = this.selection.index;
      var newGridPoints = MenuQualityToGridPoints[ theSelectionIndex ];
      win.gp.qual.g2.et.text = newGridPoints;
      win.gp.qual.sl.value = newGridPoints;
      gGlobalPreventChanges = false;
      win.onShow = function ()
      this.qual.sl.size.width = 128;
      this.layout.layout(true);
      win.gButtons.cancelBtn.onClick = function () { this.window.close(2); };
      // validate inputs when the user hits OK
        var gInAlert = false;
      win.gButtons.okBtn.onClick = function ()
      if (gInAlert == true)
      gInAlert = false;
      return;
      var gridText = win.gp.qual.g2.et.text;
      var w = Number(gridText);
      var inputErr = false;
      if ( isNaN( w ) )
      if ( DialogModes.NO != app.playbackDisplayDialogs )
      gInAlert = true;
      alert( strTextInvalidType );
      gInAlert = false;
      win.gp.qual.g2.et.text = sGridDefault;
      win.gp.qual.sl.value = sGridDefault;
      drop.selection = drop.items[ GridPointsToQualityMenuIndex(sGridDefault) ];
      return false;
      if ( (w < sGridMin) || (w > sGridMax) )
      if ( DialogModes.NO != app.playbackDisplayDialogs )
      gInAlert = true;
      alert( strTextInvalidNum );
      gInAlert = false;
      if ( w < sGridMin)
      inputErr = true;
      drop.selection = drop.items[ GridPointsToQualityMenuIndex(sGridMin) ];
      win.gp.qual.g2.et.text = sGridMin;
      win.gp.qual.sl.value = sGridMin;
      return false;
      if ( w > sGridMax)
      inputErr = true;
      drop.selection = drop.items[ GridPointsToQualityMenuIndex(sGridMax) ];
      win.gp.qual.g2.et.text = sGridMax;
      win.gp.qual.sl.value = sGridMax;
      return false;
      if (inputErr == false)
      win.close(true);
      return;
      win.center(); // move to center the dialog
      var ret = win.show();  // dialog display
      if (2 == ret)
      return false; // user cancelled
      // user hit OK, copy values from dialog
      gDescription = win.gp.description.et.text;
      gCopyright = win.gp.copyright.et.text;
      gGridPoints = win.gp.qual.sl.value;
      gDoSave3DL = win.gp.options.ck3DL.value;
      gDoSaveCUBE = win.gp.options.ckCUBE.value;
      gDoSaveCSP = win.gp.options.ckCSP.value;
      gDoSaveICCProfile = win.gp.options.ckICC.value;
      // if no files are going to be saved, then we have zero work to do
      if ((false == gDoSaveICCProfile) && (false == gDoSave3DL) &&
      (false == gDoSaveCUBE) && (false == gDoSaveCSP) )
      // tell the user that no formats were selected
      alert( strNoExportsSelected );
      gScriptResult = 'cancel'; // quit, returning 'cancel' (dont localize) makes the actions palette not record our script
      return false;
      // prompt user for directory and output base filename
      // default to directory and filename of current document
      var currentDocumentPath
      try
      // if the file has no path (not saved), then this throws
      var documentPath = app.activeDocument.fullName.fsName; // Get the OS friendly file path and name
      documentPath = documentPath.replace(/\....$/,''); // remove extension, if there is one
      documentPath = documentPath + ".lut"; // add dummy extension
      currentDocumentPath = File ( documentPath );
      catch (e)
      // if there was no document path, default to user's home directory
      var defaultName = "~/" + strUntitledLUT;
      currentDocumentPath = File(defaultName);
      var fname = currentDocumentPath.saveDlg(strExportPrompt);
      if (fname == null)
      return false;
      gSaveFilePath = fname.fsName;
      return true;
    function doExportLUTs( path )
      const keyUsing     = charIDToTypeID( 'Usng' );
      const eventExport = charIDToTypeID( 'Expr' );
      var desc = new ActionDescriptor();
      var desc2 = new ActionDescriptor();
      desc2.putString( keyFilePath, path );
      desc2.putString( keyDescription, gDescription );
      desc2.putInteger( keyDataPoints, gGridPoints );
      // assemble the full copyright string, if needed
      var copyrightAssembled = gCopyright;
      if (gCopyright != "")
      var theDate = new Date();
      // the year is from 1900 ????
      var theYear = (theDate.getYear() + 1900).toString();
      // Localization team says to just use the year
      var dateString = theYear;
      copyrightAssembled = localize("$$$/JavaScripts/Export3DLUT/Copyright=(C) Copyright ") + dateString + " " + gCopyright;
      desc2.putString( keyCopyright, copyrightAssembled );
      // select output format
      desc2.putBoolean( keyWriteICC, gDoSaveICCProfile );
      desc2.putBoolean( keyWrite3DL, gDoSave3DL );
      desc2.putBoolean( keyWriteCUBE, gDoSaveCUBE );
      desc2.putBoolean( keyWriteCSP, gDoSaveCSP );
        desc.putObject( keyUsing, keyExportLUT, desc2 );
      try
      var resultDesc = executeAction( eventExport, desc, DialogModes.NO );
      catch (e)
      if ( e.number != 8007 ) { // don't report error on user cancel
      var str = localize("$$$/JavaScripts/Export3DLUT/ExportLUTFailed=Unable to run the Export Color Lookup plugin because ");
      alert( str + e + " : " + e.line );
      gScriptResult = 'cancel'; // quit, returning 'cancel' (dont localize) makes the actions palette not record our script
      return false;
      return true;
    function doRenderGrid( points )
      // call the grid rendering plugin to do the work
        const keyRenderGrid = charIDToTypeID( "3grd" );
      const keyDataPoints2 = charIDToTypeID( 'grdP' );
      var args = new ActionDescriptor();
        args.putInteger( keyDataPoints2, points);
      try
      var result = executeAction( keyRenderGrid, args, DialogModes.NO );
      catch (e)
      if ( e.number != 8007 ) { // don't report error on user cancel
      var str = localize("$$$/JavaScripts/Export3DLUT/RenderGridFailed=Unable to render color grid because ");
      alert( str + e + " : " + e.line );
      gScriptResult = 'cancel'; // quit, returning 'cancel' (dont localize) makes the actions palette not record our script
      return false;
      return true;
    function resizeDocumentInPixels( width, height )
      var myDocument = app.activeDocument;
      var originalRulerUnits = app.preferences.rulerUnits;
      app.preferences.rulerUnits = Units.PIXELS;
      myDocument.resizeCanvas( width, height, AnchorPosition.MIDDLECENTER)
      app.preferences.rulerUnits = originalRulerUnits;
    function GetColorSettings()
      var desc1 = new ActionDescriptor();
      var ref1 = new ActionReference();
      ref1.putProperty( classProperty, kcolorSettingsStr );
      ref1.putEnumerated( classApplication, typeOrdinal, enumTarget );
      desc1.putReference( typeNULL, ref1 );
      var result = executeAction( eventGet, desc1, DialogModes.NO );
      var desc2 = result.getObjectValue( kcolorSettingsStr );
      return desc2;
    function GetColorConversionDitherState()
      var settings = GetColorSettings();
      if (settings.hasKey(kDither))
      return settings.getBoolean( kDither );
      else
      return null;
    function ConvertTo16Bit()
      const eventConvertMode = charIDToTypeID( 'CnvM' );
      const keyDepth = charIDToTypeID( 'Dpth' );
      var modeDesc16Bit = new ActionDescriptor();
      modeDesc16Bit.putInteger( keyDepth, 16 );
      var result = executeAction( eventConvertMode, modeDesc16Bit, DialogModes.NO );
    // state = true or false
    function SetColorConversionDither( state )
      var desc1 = new ActionDescriptor();
      var ref1 = new ActionReference();
      ref1.putProperty( classProperty, kcolorSettingsStr );
      ref1.putEnumerated( classApplication, typeOrdinal, enumTarget );
      desc1.putReference( typeNULL, ref1 );
      var desc2 = new ActionDescriptor();
      desc2.putBoolean( kDither, state );
      desc1.putObject( keyTo, kcolorSettingsStr, desc2 );
      executeAction( eventSet, desc1, DialogModes.NO );
    function PurgeClipboard()
      var desc1 = new ActionDescriptor();
      desc1.putEnumerated( typeNULL, typePurgeItem, enumClipboard );
      var result = executeAction( eventPurge, desc1, DialogModes.NO );
    // This helps us avoid resizing existing document views in tabbed document mode.
    // This is new functionality, and will not work in older Photoshop versions.
    function MoveDocumentToNewWindow()
      var desc1 = new ActionDescriptor();
      var result = executeAction( kFloatWindowStr, desc1, DialogModes.NO );
    function main()
      try
      var tempDoc = null;
      var tempDoc2 = null;
      // do basic troubleshooting first
      // make sure there is a document
      if (!app.activeDocument)
        gScriptResult = 'cancel'; // quit, returning 'cancel' (dont localize) makes the actions palette not record our script
      return;
      // check the document mode
      var mode = app.activeDocument.mode;
      if (mode != DocumentMode.RGB
      && mode != DocumentMode.LAB
      && mode != DocumentMode.CMYK)
      var str = localize("$$$/JavaScripts/Export3DLUT/UnsupportedColorMode=Could not export Color Lookup Tables because only RGB, LAB, and CMYK color modes are supported.");
      alert(str);
        gScriptResult = 'cancel'; // quit, returning 'cancel' (dont localize) makes the actions palette not record our script
      return;
      // check the document depth, for safety
      var depth = app.activeDocument.bitsPerChannel; // an object, not a number - why? I have no idea...
      var bitsPerChannel = 1;
      if (depth == BitsPerChannelType.EIGHT)
      bitsPerChannel = 8;
      else if (depth == BitsPerChannelType.SIXTEEN)
      bitsPerChannel = 16;
      else if (depth == BitsPerChannelType.THIRTYTWO)
      bitsPerChannel = 32;
      else
      var str = localize("$$$/JavaScripts/Export3DLUT/UnsupportedImageDepth=Could not export Color Lookup Tables because only 8, 16, and 32 bits/channel are supported.");
      alert(str);
        gScriptResult = 'cancel'; // quit, returning 'cancel' (dont localize) makes the actions palette not record our script
      return;
      // Check layer types: background plus adjustments only
      // For now, don't check each layer - a multiply solid layer still works as a color adjustment, as does selective blending
      // Users will get odd results from other layer types (layer masks, pixel layers, etc.)
      try
      app.activeDocument.backgroundLayer.visible = true;
      catch (e)
      if (activeDocument.layers.length == 1)
      alert( localize("$$$/JavaScripts/Export3DLUT/NoAdjustmentLayers=Could not export Color Lookup Tables because this document has no adjustment layers.") );
      else
      alert( localize("$$$/JavaScripts/Export3DLUT/NoBackground=Could not export Color Lookup Tables because this document has no background.") );
        gScriptResult = 'cancel'; // quit, returning 'cancel' (dont localize) makes the actions palette not record our script
      return;
      // look for last used params via Photoshop registry, getCustomOptions will throw if none exist
      try
      var desc = app.getCustomOptions(kScriptOptionsKey);
      readOptionsFromDescriptor( desc );
      catch(e)
      // it's ok if we don't have any existing options, continue with defaults
      // set some values from the document
      gDescription = app.activeDocument.name;
      // ask the user for options, bail if they cancel at any point
      if ( doExportUI() == false)
        gScriptResult = 'cancel'; // quit, returning 'cancel' (dont localize) makes the actions palette not record our script
      return;
      // we're good to go, so save our parameters for next time
      app.putCustomOptions(kScriptOptionsKey, createDescriptorFromOptions() );
      // remove file extension from filePath, if there is one
      gSaveFilePath = gSaveFilePath.replace(/\....$/,'');
      // calculate the size of image we need
      var width = gGridPoints * gGridPoints;
      var height = gGridPoints;
      if (mode == DocumentMode.CMYK)
      height = gGridPoints*gGridPoints;
      // duplicate the user document so we don't mess it up in any way
      tempDoc = app.activeDocument.duplicate("temporary");
      // make the temporary document active
      app.activeDocument.name = tempDoc;
      // to avoid resizing existing document views in tabbed mode
      MoveDocumentToNewWindow();
      // convert 8 bit documents to 16 bit/channel for improved quality of merged adjustments
      if (bitsPerChannel == 8)
      ConvertTo16Bit();
      depth = BitsPerChannelType.SIXTEEN;
      // resize the temporary canvas to our target size
      resizeDocumentInPixels( width, height )
      // select background layer
      tempDoc.activeLayer = tempDoc.backgroundLayer;
      // render lookup base grid
      var worked = doRenderGrid( gGridPoints );
      if (worked != true)
      tempDoc.close( SaveOptions.DONOTSAVECHANGES );
      return; // error should have already been shown, and there is not much we can do
      // do not flatten here -- the export automatically gets flattened data
      // and we may need layers for LAB->RGB conversion below
      // export the chosen formats
      worked = doExportLUTs( gSaveFilePath );
      if (worked != true)
      tempDoc.close( SaveOptions.DONOTSAVECHANGES );
      return; // error should have already been shown, and there is not much we can do
      // for LAB documents to export 3DLUT (which are inherently RGB), we have to do additional work
      // As a bonus, this works for CMYK as well!
      if ( mode != DocumentMode.RGB )
      var filePath = gSaveFilePath + "RGB";
      var oldDitherState = GetColorConversionDitherState();
      try
      SetColorConversionDither(false);
      const targetProfileName = "sRGB IEC61966-2.1";
      // new document temp2 in sRGB, matching depth of original
      var originalRulerUnits = app.preferences.rulerUnits;
      app.preferences.rulerUnits = Units.PIXELS;
      tempDoc2 = app.documents.add( width, gGridPoints, 72, "temp2",
      NewDocumentMode.RGB, DocumentFill.WHITE,
      1.0, depth, targetProfileName );
      app.preferences.rulerUnits = originalRulerUnits;
      // make the new doc active
      app.activeDocument.name = tempDoc2;
      // to avoid resizing existing document views in tabbed mode
      MoveDocumentToNewWindow();
      // insert grid
      worked = doRenderGrid( gGridPoints );
      if (worked == true)
      tempDoc2.selection.selectAll();
      tempDoc2.activeLayer = tempDoc2.backgroundLayer;
      tempDoc2.selection.copy();
      tempDoc2.close( SaveOptions.DONOTSAVECHANGES );
      tempDoc2 = null;
      // make sure temp1 is active
      app.activeDocument.name = tempDoc;
      // resize for RGB grid
      resizeDocumentInPixels( width, gGridPoints );
      tempDoc.selection.selectAll();
      tempDoc.paste(true);
      PurgeClipboard(); // so we don't leave an odd, large item on the clipboard
      tempDoc.selection.deselect();
      tempDoc.flatten();
      // convert temp1 to sRGB
      tempDoc.convertProfile( targetProfileName, Intent.RELATIVECOLORIMETRIC, true, false );
      // export the chosen formats
      worked = doExportLUTs( filePath );
      // at this point we still have to clean up, even if the call failed, so fall through
      else
      tempDoc2.close( SaveOptions.DONOTSAVECHANGES );
      catch (e)
      if ( e.number != 8007 ) { // don't report error on user cancel
      var str = localize("$$$/JavaScripts/Export3DLUT/UnableToConvertRGB=Unable to convert image to RGB because ");
      alert( str + e + " : " + e.line );
      if (tempDoc2 != null) tempDoc2.close( SaveOptions.DONOTSAVECHANGES );
      gScriptResult = 'cancel'; // quit, returning 'cancel' (dont localize) makes the actions palette not record our script
      // always reset the dither state
      SetColorConversionDither( oldDitherState );
      PurgeClipboard(); // so we don't leave an odd, large item on the clipboard
      } // if not RGB
      // always close temp document without saving
      tempDoc.close( SaveOptions.DONOTSAVECHANGES );
      catch (e)
      if ( e.number != 8007 ) { // don't report error on user cancel
      var str = localize("$$$/JavaScripts/Export3DLUT/UnableToExport=Unable to export LUT because ");
      alert( str + e + " : " + e.line );
      // always close temp document without saving
      if (tempDoc != null) tempDoc.close( SaveOptions.DONOTSAVECHANGES );
      gScriptResult = 'cancel'; // quit, returning 'cancel' (dont localize) makes the actions palette not record our script

    Hi blabla12345,
    (untested and without warranty)
    replace this line:
    const sSaveCUBE = "CUBE";
    with this:
    const sSaveCUBE = "cube";
    Have fun

  • Template is nested inside itself (directly or indirectly)

    Hello helpful folks of the Forum.  
    I had a template (test.dwt) based on which 60 of my pages are built and I dont know what happened now that whenever I try to update, all the editable contents of the 60 pages gets deleted.  I was getting an error "template is nested inside itself (directly or indirectly)
    Can someone please take a look at the template and let me know what is wrong and how I can fix it.   If I create a similar tempalte and name it test.dwt, will it work ?    Thanks for your help.
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!-- TemplateBeginEditable name="doctitle" -->
    <title>Welcome to Sringeri Vidya Bharati Foundation (Canada)</title>
    <!-- TemplateEndEditable -->
    <!-- TemplateBeginEditable name="head" --><!-- TemplateEndEditable -->
    <meta name="SVBF" content="SVBF, Sringeri Temple, Sringeri Vidya Bharati Foundation, Sharadamba Temple, Ganesha, Hanuman, Hanuman Chalisa, Sathyanarayana Pooja, Shasti Bhajans, Brydon Drive, Sringeri, " />
    <title></title>
    <style type="text/css">
    <!--
    .style28 {
              font-size: 36px;
              font-weight: bold;
    .style49 {
              font-weight: normal;
              font-family: Cambria;
              font-size: 14px;
    -->
    </style>
    <style type="text/css">
    <!--
    p.MsoNormal {
    margin-top:0cm;
    margin-right:0cm;
    margin-bottom:10.0pt;
    margin-left:0cm;
    line-height:115%;
    font-size:11.0pt;
    font-family:"Calibri","sans-serif";
    -->
    </style>
    <script language="javascript" type="text/javascript">
    <!--
         Author: Eric King
         Url: http://redrival.com/eak/index.shtml
         This script is free to use as long as this info is left in
         Featured on Dynamic Drive script library (http://www.dynamicdrive.com)
    var win=null;
    function NewWindow(mypage,myname,w,h,scroll,pos){
    if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):1 00;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
    if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.h eight)?(screen.height-h)/2:100;}
    else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
    settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+ scroll+',location=yes,directories=no,status=yes,menubar=no,toolbar=no,resizable=yes';
    win=window.open(mypage,myname,settings);}
    // -->
    </script>
    <script type="text/javascript" src="http://svbfcanada.com/SVBF/jsmenu/stmenu.js"></script>
    <style type="text/css">
    <!--
    .style1 {
              color: #FFFFFF;
              font-size: 12px;
              font-family: Cambria;
              font-weight: bold;
    .style2 {
              color: #FFFFFF;
              font-size: 14px;
              font-family: Cambria;
              font-weight: bold;
    .style3 {color: #CCCCCC}
    body {
              background-color: #FFFFCC;
    .style6 {
              font-size: 12px;
              font-family: Verdana, Arial, Helvetica, sans-serif;
    .border1 {
              border: 1px solid #000000;
    .style11 {color: #000000}
    .style12 {color: #FFFFFF}
    .style13 {font-weight: bold}
    .style14 {font-size: 14px}
    .BG1 {
              background-image: url(http://www.svbfcanada.com/SVBF/images/BG1.jpg);
              background-repeat: no-repeat;
    .style15 {font-size: 12px}
    .style17 {
              font-size: 16px;
              font-weight: bold;
              font-family: Cambria;
    .style19 {font-size: 16px}
    .style21 {font-weight: bold}
    -->
    </style>
    </script>
    <script src="../Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
    <script language="JavaScript1.1">
    <!--
    //Pixelating Image slideshow
    //Copyright Dynamic Drive 2001
    //Visit http://www.dynamicdrive.com for this script
    //specify interval between slide (in mili seconds)
    var slidespeed=3000
    //specify images
    var slideimages=new Array("http://www.svbfcanada.com/SVBF/images/Navara2012.jpg","http://www.svbfcanada.com/SVBF/images/diwalidance.JPG","http://www.svbfcanada.com/SVBF/images/sivarathri.jpg","http://www.svbfcanada.com/SVBF/images/navarathri2011.JPG", "http://www.svbfcanada.com/SVBF/images/AbdulKalam.JPG","http://www.svbfcanada.com/SVBF/images/narasimhajayanti.JPG")
    //specify corresponding links
    var slidelinks=new Array("http://www.svbfcanada.com/SVBF/photogallery.html")
    var imageholder=new Array()
    var ie55=window.createPopup
    for (i=0;i<slideimages.length;i++){
    imageholder[i]=new Image()
    imageholder[i].src=slideimages[i]
    function gotoshow(){
    window.location=slidelinks[whichlink]
    //-->
    </script>
    <style type="text/css">
    .menutitle{
              cursor:pointer;
              margin-bottom: 5px;
              background-color:#ECECFF;
              color:#000000;
              width:306px;
              padding:2px;
              text-align:center;
              font-weight:bold;
              /*/*/border:1px solid #000000;/* */
    .submenu{
    margin-bottom: 0.5em;
    .style22 {font-weight: bold}
    .style23 {font-family: Cambria}
    .style28 {
              font-size: 18px;
              font-weight: bold;
              font-family: Cambria;
    </style>
    <script type="text/javascript">
    * Switch Menu script- by Martial B of http://getElementById.com/
    * Modified by Dynamic Drive for format & NS4/IE4 compatibility
    * Visit http://www.dynamicdrive.com/ for full source code
    var persistmenu="yes" //"yes" or "no". Make sure each SPAN content contains an incrementing ID starting at 1 (id="sub1", id="sub2", etc)
    var persisttype="sitewide" //enter "sitewide" for menu to persist across site, "local" for this page only
    if (document.getElementById){ //DynamicDrive.com change
    document.write('<style type="text/css">\n')
    document.write('.submenu{display: none;}\n')
    document.write('</style>\n')
    function SwitchMenu(obj){
              if(document.getElementById){
              var el = document.getElementById(obj);
              var ar = document.getElementById("masterdiv").getElementsByTagName("span"); //DynamicDrive.com change
                        if(el.style.display != "block"){ //DynamicDrive.com change
                                  for (var i=0; i<ar.length; i++){
                                            if (ar[i].className=="submenu") //DynamicDrive.com change
                                            ar[i].style.display = "none";
                                  el.style.display = "block";
                        }else{
                                  el.style.display = "none";
    function get_cookie(Name) {
    var search = Name + "="
    var returnvalue = "";
    if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    if (offset != -1) {
    offset += search.length
    end = document.cookie.indexOf(";", offset);
    if (end == -1) end = document.cookie.length;
    returnvalue=unescape(document.cookie.substring(offset, end))
    return returnvalue;
    function onloadfunction(){
    if (persistmenu=="yes"){
    var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
    var cookievalue=get_cookie(cookiename)
    if (cookievalue!="")
    document.getElementById(cookievalue).style.display="block"
    function savemenustate(){
    var inc=1, blockid=""
    while (document.getElementById("sub"+inc)){
    if (document.getElementById("sub"+inc).style.display=="block"){
    blockid="sub"+inc
    break
    inc++
    var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
    var cookievalue=(persisttype=="sitewide")? blockid+";path=/" : blockid
    document.cookie=cookiename+"="+cookievalue
    if (window.addEventListener)
    window.addEventListener("load", onloadfunction, false)
    else if (window.attachEvent)
    window.attachEvent("onload", onloadfunction)
    else if (document.getElementById)
    window.onload=onloadfunction
    if (persistmenu=="yes" && document.getElementById)
    window.onunload=savemenustate
    </script>
    </head>
    <body>
    <center>
    <script language=JavaScript>
    <!--
    //Disable right click script III- By Renigade ([email protected])
    //For full source code, visit http://www.dynamicdrive.com
    var message="";
    function clickIE() {if (document.all) {(message);return false;}}
    function clickNS(e) {if
    (document.layers||(document.getElementById&&!document.all)) {
    if (e.which==2||e.which==3) {(message);return false;}}}
    if (document.layers)
    {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
    else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
    document.oncontextmenu=new Function("return false")
    // -->
    </script>
    <table width="1092" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
      <!--DWLayoutTable-->
      <tr>
        <td height="57" colspan="8" valign="top" bgcolor="D69306"><p align="right"><script language="JavaScript">
    var now = new Date();
    var days = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
    var months = new Array('January','February','March','April','May','June','July','August','September','Octo ber','November','December');
    var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();
    function fourdigits(number)          {
              return (number < 1000) ? number + 1900 : number;
    today =  days[now.getDay()] + ", " +
                  months[now.getMonth()] + " " +
                   date + ", " +
                    (fourdigits(now.getYear())) ;
    document.write("" +today+ ".");
    </script> </p>      <p align="center"><script type="text/javascript" src="http://www.svbfcanada.com/SVBF/jsmenu/svbfcanada.js"></script>
          </p></td>
        </tr>
      <tr>
        <td height="210" colspan="8" valign="top" bgcolor="#d69306"><img src="http://www.svbfcanada.com/SVBF/images/SVBFBanner2.jpg" width="1092" height="210" /></td>
        </tr>
      <tr>
        <td width="43" rowspan="8" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="44" height="1181"> </td>
              </tr>
        </table></td>
        <td width="4" height="17"></td>
        <td colspan="2" rowspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
          <!--DWLayoutTable-->
          <tr>
            <td width="321" height="1150" valign="top" bgcolor="#CC9933"><div style="margin-top: -25px;  "Important days at the temple this month.">
              <p align="center" class="style19" style="background: #CC9933; color: #2D251E; margin: 5px 0px 0px 0px; padding: 5px; border: solid #75614F; border-width: 1px 1px 1px 1px;"><br />
                <strong><span class="style21"><u>            TEMPLE TIMINGS</u></span><BR/>
                  <span class="style22">WEEKDAYS</span></strong><br />
                8.30 am to 11.30 am<br />
                4.30 pm to 8.30 pm<br/>
                <strong>WEEKENDS</span></strong><br />
                8.30 am to 8.30 pm<br />
                <span class="style14"><br />
                </span></p>
              <div style="margin-top: -25px;  "important="Important" days="days" at="at" the="the" temple="temple" this="this" month.="month."">
                      <p align="center" class="style14" style="background: #CC3333; color: #FFFFFF; margin: 5px 0px 0px 0px; padding: 5px; border: solid #75614F; border-width: 1px 1px 1px 1px;"><u><strong>IMPORTANT DATES THIS MONTH</strong></u></p>
                      <p align="left" class="style23 style19" style="background: #CC9933; color: #2D251E; margin: 0px 0px 0px 0px; padding: 5px; border: solid #75614F; border-width: 1px 1px 1px 1px;"><strong>
                      05</strong> Papa Vimochana Ekadasi<br />
                       <strong>06 </strong>Pradosham<br />
                       <strong>10</strong> Vaisaka Masam Begins<br />
                      <strong>
                      12</strong> Akshaya Truteya<br />
                      <strong>14</strong> Ramanuja Jayanthi<br />
                      <strong>15</strong> Shankara Jayanthi<br>
                       <strong>18</strong> Hanuman Chalisa<br />
                        <strong>21</strong> Mohini Ekadasi<br>
                        <strong>22</strong> Pradosham<br />
                        <strong>23</strong> Narasimha Jayanthi<br />
                        <strong>24</strong> Sathyanarayana Pooja<br />
                        <strong>27 </strong>Sankatahara Chaturthi</p>
                      <p align="center" class="style28" style="background: #CC9933; color: #2D251E; margin: 0px 0px 0px 0px; padding: 5px; border: solid #75614F; border-width: 1px 1px 1px 1px;"><a href="http://www.svbfcanada.com/SVBF/SearchSVBF.html"><img src="http://www.svbfcanada.com/SVBF/images/SearchSVBF.jpg" width="200" height="70" border="0" /></a></p>
                      <p align="center" class="style15" style="background: #CC9933; color: #2D251E; margin: 0px 0px 0px 0px; padding: 5px; border: solid #75614F; border-width: 1px 1px 1px 1px;"><span class="style19"><a href="http://www.svbfcanada.com/SVBF/Support.html"><img src="http://www.svbfcanada.com/SVBF/images/donate.jpg" width="285" height="140" Border="0"/></a></span></p>
                      <p align="left" class="style15" style="background: #CC9933; color: #2D251E; margin: 0px 0px 0px 0px; padding: 5px; border: solid #75614F; border-width: 1px 1px 1px 1px;"><a href="http://www.svbfcanada.com/SVBF/Directions.html"><img src="http://www.svbfcanada.com/SVBF/images/Directions.jpg" width="305" height="60" border="0" /></a></p>
                      <p align="center" class="style19" style="background: #CC9933; color: #2D251E; margin: 0px 0px 0px 0px; padding: 5px; border: solid #75614F; border-width: 1px 1px 1px 1px;"><span class="style17 style23 style22"><span class="style11">Visit our</span> <a href="http://www.svbfcanada.com/SVBF/photogallery.html" class="style6">Photo Gallery</a></span>
                        <script language="JavaScript1.1" type="text/javascript">
    <!--
    var whichlink=0
    var whichimage=0
    var pixeldelay=(ie55)? document.images.slide.filters[0].duration*1000 : 0
    function slideit(){
    if (!document.images) return
    if (ie55) document.images.slide.filters[0].apply()
    document.images.slide.src=imageholder[whichimage].src
    if (ie55) document.images.slide.filters[0].play()
    whichlink=whichimage
    whichimage=(whichimage<slideimages.length-1)? whichimage+1 : 0
    setTimeout("slideit()",slidespeed+pixeldelay)
    slideit()
    //-->
                            </script>
                      </p>
                      <div align="center"></div>
                      <div align="center"></div>
                      <p align="left" class="style15" style="background: #CC9933; color: #2D251E; margin: 0px 0px 0px 0px; padding: 5px; border: solid #75614F; border-width: 1px 1px 1px 1px;"><a href="http://www.svbfcanada.com/SVBF/photogallery.html"><img src="http://www.svbfcanada.com/SVBF/images/diwalidance.JPG" name="slide" width="306" height="200" border="0" style="filter:progid:DXImageTransform.Microsoft.Pixelate(MaxSquare=15,Duration=1)" color="Black" /></a></p>
    <form id="form3" action="../SVBF/response.php" method="post" onsubmit="return checkform(this);">
                                         <fieldset>
                                         <legend><span class="style23 style12"><strong>Subscribe to our Newslette</strong></span><span class="style12">r</span></legend>
          <p class="first">
            <label for="name">Name</label>
            <input type="text" name="name" id="name" size="30" />
            </p>
          <p>
            <label for="email">Email </label>
            <input type="text" name="email" id="email" size="30" />
          </p>
          <p>
              <label for="code">Enter code below > <span class="style19" id="txtCaptchaDiv" style="color:#000066"><strong></strong></span><!-- this is where the script will place the generated code -->
                <input type="hidden" id="txtCaptcha" /></label><!-- this is where the script will place a copy of the code for validation: this is a hidden field -->
              <input type="text" name="txtInput" id="txtInput" size="30" />
              </p>
              <p class="submit">
                <button type="submit">Send</button>
              </p>
              <div align="center"></div>
              <div align="center">
                <script type="text/javascript">
              function checkform(theform){
                        var why = "";
                        if(theform.txtInput.value == ""){
                                  why += "- Security code should not be empty.\n";
                        if(theform.txtInput.value != ""){
                                  if(ValidCaptcha(theform.txtInput.value) == false){
                                            why += "- Security code did not match.\n";
                        if(why != ""){
                                  alert(why);
                                  return false;
    //Generates the captcha function   
              var a = Math.ceil(Math.random() * 9)+ '';
              var b = Math.ceil(Math.random() * 9)+ '';      
              var c = Math.ceil(Math.random() * 9)+ ''; 
              var d = Math.ceil(Math.random() * 9)+ ''; 
              var e = Math.ceil(Math.random() * 9)+ ''; 
              var code = a + b + c + d + e;
              document.getElementById("txtCaptcha").value = code;
              document.getElementById("txtCaptchaDiv").innerHTML = code;
    // Validate the Entered input aganist the generated security code function  
    function ValidCaptcha(){
              var str1 = removeSpaces(document.getElementById('txtCaptcha').value);
              var str2 = removeSpaces(document.getElementById('txtInput').value);
              if (str1 == str2){
                        return true;
              }else{
                        return false;
    // Remove the spaces from the entered and generated code
    function removeSpaces(string){
              return string.split(' ').join('');
              </script>
                <span class="style12 style23 style15">Subscribe to our Newsletter to   receive updates on happenings at the Temple and the Community Hall </span><br />
              </div>
              <div align="center" class="style12"><small style="text-align:center">reload the page to change the code</small></div>
              </fieldset>
        </form>
                    </div>
                </div></td>
              </tr>
          <tr>
            <td height="152" valign="top" bgcolor="cc9933"><div align="center">
              <p><a href="http://www.tattvaloka.com/"><img src="http://www.svbfcanada.com/SVBF/images/Tattvaloka.jpg" width="306" height="160" border="0" /></a></p>
              <p><a href="http://www.svbfcanada.com/SVBF/TouristToronto.html"><img src="http://www.svbfcanada.com/SVBF/images/TORONTO.jpg" width="306" height="200" border="0" /></a></p>
            </div></td>
          </tr>
        </table></td>
        <td width="43"></td>
        <td width="635"></td>
        <td width="9"></td>
        <td width="37"></td>
      </tr>
      <tr>
        <td height="1410"></td>
        <td></td>
        <td rowspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="640" height="1471" valign="top">
              <div align="center"></div>          <div align="center" class="style49">
                <p> </p>
                  <p><a href="http://www.svbfcanada.com/SVBF/SathyanarayanaPooja.html"></a></p>
                <a href="http://www.svbfcanada.com/SVBF/SathyanarayanaPooja.html"><a href="http://www.svbfcanada.com/SVBF/SathyanarayanaPooja.html"><a href="http://www.svbfcanada.com/SVBF/SathyanarayanaPooja.html"></a></div></td>
              </tr>
          <tr>
            <td height="106"></td>
            </tr>
        </table></td>
        <td></td>
        <td></td>
      </tr>
      <tr>
        <td height="167"></td>
        <td colspan="2" rowspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="318" height="159" valign="top"><div align="center">
              <p><a href="http://www.sringeri.net"><img src="http://www.svbfcanada.com/SVBF/images/sringerinet.jpg" width="306" height="92" border="0" /></a><a href="http://www.svbf.org"><img src="http://www.svbfcanada.com/SVBF/images/svbfusa.jpg" width="306" height="49" border="0" /></a>
                <iframe src="https://www.google.com/calendar/embed?title=SVBF%20Canada%20Calendar&mode=AGENDA&height=30 0&wkst=1&bgcolor=%23cccccc&src=calendarsvbf%40gmail.com&color=%232952A3&ctz=America%2FToro nto" style=" border:solid 1px #777 " width="310" height="300" frameborder="0" scrolling="yes"></iframe>
                <!-- AddThis Button BEGIN -->
    </p>
              <p></p></td>
              </tr>
        </table></td>
        <td></td>
        <td></td>
        <td></td>
      </tr>
      <tr>
        <td height="319"></td>
        <td></td>
        <td> </td>
        <td></td>
        <td></td>
      </tr>
      <tr>
        <td height="19"></td>
        <td width="312"> </td>
        <td width="9"></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
      </tr>
      <tr>
        <td height="20"></td>
        <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="311" height="19" valign="top"><div align="center">
              <p><span class="style17 style23 style22 style3">Visit our Photo Gallery</span>
                <span class="style3">
                  <script language="JavaScript1.1">
    <!--
    var whichlink=0
    var whichimage=0
    var pixeldelay=(ie55)? document.images.slide.filters[0].duration*1000 : 0
    function slideit(){
    if (!document.images) return
    if (ie55) document.images.slide.filters[0].apply()
    document.images.slide.src=imageholder[whichimage].src
    if (ie55) document.images.slide.filters[0].play()
    whichlink=whichimage
    whichimage=(whichimage<slideimages.length-1)? whichimage+1 : 0
    setTimeout("slideit()",slidespeed+pixeldelay)
    slideit()
    //-->
                      </script>
                  </span></p>
                </div></td>
              </tr>
          <tr>
            <td height="1"></td>
              </tr>
        </table></td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
      </tr>
      <tr>
        <td height="3"></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
      </tr>
      <tr>
        <td height="113" colspan="6" valign="top" bgcolor="#6C0F17"><div align="center">
                  <p class="style11 style2"><span class="style12">Sringeri Vidya Bharati Foundation (Canada)<br />
                  80 Brydon Dr., Etobicoke, ON, M9W 4N6 Phone: 416-745-1010<br />
                  Questions or Comments about this website ?
            Email the</span><span class="style12"> <a href="mailto:[email protected]" class="style14 style3">Web Master</a><br />
                    <a href="http://www.svbfcanada.com/SVBF/Disclaimer.php" class="style13 style3">Disclaimer</a> </span></p>
                  <p class="style11"><span class="style1">Copyright © 2008 – 2012 by Sringeri Vidya Bharati Foundation (Canada) All Rights   Reserved.</span><br />
                        <a href="http://www.copyscape.com/plagiarism-finder/"><img src="http://www.svbfcanada.com/SVBF/images/cs-ye-234x16.gif" width="234" height="16" border="0" /></a><br />
            </p>
          </div></td>
      <td> </td>
      </tr>
    </table>
    </td></center>
    </body>
    </html>

    This will happen if you mistakenly save a Child page as a Template.dwt and overwrite your original Template file. Do you have a backup of your original Template stored some place safe?
    In the future, when you have questions related to Dreamweaver, use the Dreamweaver Forum. You'll get better, quicker answers there.
    http://forums.adobe.com/community/dreamweaver?view=discussions
    Nancy O.

  • Problem with ArrayList

    Hello,
    I am having a problem with a program I am trying to write. The idea of the program is to:
    A) read a list of movies list from a text file
    B) create an object for each movie using the information from the text file
    C) place the objects into an arrayList
    My problem is that when I check my arrayList it seems to only contain multiple copies of the first movie read from the text file. Here is my code
    import java.io.BufferedReader;
    import java.io.BufferedWriter;
    import java.io.FileReader;
    import java.io.FileWriter;
    import java.io.IOException;
    import java.io.PrintWriter;
    import java.io.FileOutputStream;
    import java.io.FileNotFoundException;
    import java.util.ArrayList;
    public class MovieReader
         PrintWriter outputStream = null;
         public void readFile()
              try
                      BufferedReader in = new BufferedReader(new FileReader("movie.txt"));
                      String str;
                      while ((str = in.readLine()) != null)
                           process(str);
                      in.close();
              catch (IOException e)
                  e.printStackTrace();
         ArrayList <ValidMovie> movieList = new ArrayList<ValidMovie>();
         private void process(String line)
              String[] array = line.split("\t");
              int i = 0;
              for ( i = 0; i < array.length; i++)
                   String tempTitle = array[0];
                   String tempYear = array [1];
                   String tempRating = array [2];
                   String tempFormat = array [3];
                   ValidMovie uuj = new ValidMovie(tempTitle, tempYear, tempRating, tempFormat);
                   movieList.add(uuj);
              System.out.println("item at index 1 is:   " + movieList.get(1));
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         private void writeFile(String [] arrayL)
              String [] arrayWrite = arrayL;
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     
    //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
         public static void main(String[] args)
              MovieReader mv = new MovieReader();
              mv.readFile();
    //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
    }This is the code that creates an object for each movie:
    import java.io.Serializable;
    public class ValidMovie implements Serializable
         private String title;
         private String year;
         private String rating;
         private String format;
         public ValidMovie()
         public ValidMovie(String tTitle, String tYear, String tRating, String tFormat)
              title = tTitle;
              year = tYear;
              rating = tRating;
              format = tFormat;
         //Getters for title, year, rating and format
         public String getTitle ()
              return title;
         public String getYear ()
              return year;
         public String getRating ()
              return rating;
         public String getFormat ()
              return format;
         public String toString ()
              return title + "\t" + year + "\t" + rating + "\t" + format;
    }The following is what I have in the movie.txt file:
    Bamboozled     2000     2     DVD
    What Lies Beneath     2000     1.5     DVD
    Beneath the Planet of the Apes     1970     1     DVD
    You Can Count On Me     2000     3.5     Theater
    And finally this is the result when I run the code:
    item at index 1 is: Bamboozled     2000     2     DVD
    item at index 1 is: Bamboozled     2000     2     DVD
    item at index 1 is: Bamboozled     2000     2     DVD
    item at index 1 is: Bamboozled     2000     2     DVD
    I am sure that it is something simple that I am overlooking but I cannot figure it out. When I change the index in the code:
    System.out.println("item at index 1 is:   " + movieList.get(1));to 0 or 2 or 3 then result is the same, it will just show the first movie in the text file. Any help would be greatly appreciated. Thanks

    Thanks for the reply, it helped but I am now getting 4 of each of the movies after adding you suggestion. This is much better now I just need to figure out why the loop is causing the extra copies. Thanks again :)
    Item 0: Bamboozled     2000     2     DVD
    Item 1: Bamboozled     2000     2     DVD
    Item 2: Bamboozled     2000     2     DVD
    Item 3: Bamboozled     2000     2     DVD
    Item 4: What Lies Beneath     2000     1.5     DVD
    Item 5: What Lies Beneath     2000     1.5     DVD
    Item 6: What Lies Beneath     2000     1.5     DVD
    Item 7: What Lies Beneath     2000     1.5     DVD
    Item 8: Beneath the Planet of the Apes     1970     1     DVD
    Item 9: Beneath the Planet of the Apes     1970     1     DVD
    Item 10: Beneath the Planet of the Apes     1970     1     DVD
    Item 11: Beneath the Planet of the Apes     1970     1     DVD
    Item 12: You Can Count On Me     2000     3.5     Theater
    Item 13: You Can Count On Me     2000     3.5     Theater
    Item 14: You Can Count On Me     2000     3.5     Theater
    Item 15: You Can Count On Me     2000     3.5     Theater

  • Need your help on performance issue please

    Hello everyone!
    I need your help to understand an effect I notice with a Thread class I built. I currently work on enhancement of my application Playlist Editor (see http://www.lightdev.com/page74.htm) and a new release will be available soon.
    Among other extensions the new release will have a title filter function which is based on audio data that is recursively read from ID3 tags of files found in a given root directory. The data collection is done by a CollectionThread class which reads into a data model class AudioDataModel and the entire process works fine, no problem with that.
    However, when my application is started for the first time the CollectionThread runs approximately 3 minutes to collect data from approximately 4300 audio files on an Intel Pentium M 1,4 GHz, 512 MB RAM, Windows XP SP2. When the application is shut down and started again, it takes only a few seconds to do the same task for all subsequent launches.
    I already tried to start the application with java option -Xms40m to increase initial heap size. This increases performance in general but the effect is still the same, i.e. first run lasts significantly longer than subsequent runs.
    I also tried to build a pool mechanism which creates many empty objects in the data model and then releases them to contain the actual data at is being read in but this did not lead to better performance.
    It must have to do with how Java (or Windows?) allocates and caches memory. I wonder whether there is a way to pre-allocate memory or if there are any other ideas to improve performance so that the process always only takes seconds instead of minutes?
    I attach the key classes to this message. Any help or ideas is much appreciated!
    Thanks a lot a best regards
    Ulrich
    PS: You can use the news subscription service at
    http://www.lightdev.com/dynTemplate.php4?id=80&dynPage=subscribe.php4 to be informed when the new release of Playlist Editor is available.
    All classes posted here do not need debugging, they already have proven to run error free. The classes are only posted for information for the interested reader - no need to go through all the stuff in detail - only if it interests you.
    My application calls class CollectionThread wich is a subclass of InfoThread. CollectionThread recursively goes through a directory and file structure and stores found ID3 tag information in instances of class ID3v11Tag which in turn gets stored in one instance of class AudioDataModel. All classes are shown below.
    This is the mentioned CollectionThread
    * Light Development Playlist Editor
    * Copyright (C) 2004 Ulrich Hilger
    * This program is free software; you can redistribute it and/or
    * modify it under the terms of the GNU General Public License
    * as published by the Free Software Foundation; either version 2
    * of the License, or (at your option) any later version.
    * This program is distributed in the hope that it will be useful,
    * but WITHOUT ANY WARRANTY; without even the implied warranty of
    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    * GNU General Public License for more details.
    * You should have received a copy of the GNU General Public License
    * along with this program; if not, write to the Free Software
    * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
    package com.lightdev.app.playlisteditor.data;
    import com.lightdev.lib.util.InfoThread;
    import java.io.File;
    * A class to collect audio data from a given storage location.
    * <p>
    * <code>CollectionThread</code> uses ID3 tag information to gain data.
    * </p>
    * <p>See <a href="http://www.id3.org">http://www.id3.org</a> for details about
    * ID3 tags.</p>
    * @author Ulrich Hilger
    * @author Light Development
    * @author <a href="http://www.lightdev.com">http://www.lightdev.com</a>
    * @author <a href="mailto:[email protected]">[email protected]</a>
    * @author published under the terms and conditions of the
    *      GNU General Public License,
    *      for details see file gpl.txt in the distribution
    *      package of this software as well as any licensing notes
    *      inside this documentation
    * @version 1, October 13, 2004
    public class CollectionThread extends InfoThread {
       * constructor
       * @param model  AudioDataModel  the data model to collect data to
      public CollectionThread(AudioDataModel model) {
        this.model = model;
       * constructor, creates a new empty AudioDataModel
      public CollectionThread() {
        this(new AudioDataModel());
       * set the data model to collect data to
       * @param model AudioDataModel  the model to collect data to
      public void setModel(AudioDataModel model) {
        this.model = model;
       * get the data model associated to this thread
       * @return AudioDataModel  the data model
      public AudioDataModel getModel() {
        return model;
       * set the directory to collect data from
       * @param rootDir File  the directory to collect data from
      public void setRootDirectory(File rootDir) {
        this.rootDir = rootDir;
       * do te actual work of this thread, i.e. iterate through a given directory
       * structure and collect audio data
       * @return boolean  true, if work is left
      protected boolean work() {
        boolean workIsLeft = true;
        maxValue = -1;
        filesProcessed = 0;
        if(getStatus() < STATUS_HALT_PENDING) {
          countElements(rootDir.listFiles());
        if(getStatus() < STATUS_HALT_PENDING) {
          workIsLeft = collect(rootDir.listFiles());
        return workIsLeft;
       * count the elements in a given file array including its subdirectories
       * @param files File[]
      private void countElements(File[] files) {
        int i = 0;
        while (i < files.length && getStatus() < STATUS_HALT_PENDING) {
          File file = files;
    if (file.isDirectory()) {
    countElements(file.listFiles());
    i++;
    maxValue++;
    * recursively read data into model
    * @param files File[] the file array representing the content of a given directory
    private boolean collect(File[] files) {
    int i = 0;
    while(i < files.length && getStatus() < STATUS_HALT_PENDING) {
    File file = files[i];
    if(file.isDirectory()) {
    collect(file.listFiles());
    else if(file.getName().toLowerCase().endsWith("mp3")) {
    try {
    model.addTrack(file);
    catch(Exception e) {
    fireThreadException(e);
    i++;
    filesProcessed++;
    fireThreadProgress(filesProcessed);
    return (i<files.length);
    /** the directory to collect data from */
    private File rootDir;
    /** the data model to collect data to */
    private AudioDataModel model;
    /** the number of files this thread processed so far while it is running */
    private long filesProcessed = 0;
    This is class InfoThread
    * Light Development Java Library
    * Copyright (C) 2003, 2004 Ulrich Hilger
    * This program is free software; you can redistribute it and/or
    * modify it under the terms of the GNU General Public License
    * as published by the Free Software Foundation; either version 2
    * of the License, or (at your option) any later version.
    * This program is distributed in the hope that it will be useful,
    * but WITHOUT ANY WARRANTY; without even the implied warranty of
    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    * GNU General Public License for more details.
    * You should have received a copy of the GNU General Public License
    * along with this program; if not, write to the Free Software
    * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
    package com.lightdev.lib.util;
    import java.util.Vector;
    import java.util.Enumeration;
    * Abstract class <code>InfoThread</class> implements a status and listener concept.
    * An <code>InfoThread</code> object actively informs all objects registered as listeners about
    * status changes, progress and possible exceptions. This way the status of a running
    * thread does not require a polling mechanism to be monitored.
    * <p>
    * <code>InfoThread</code> implements the following working scheme
    * </p>
    * @author Ulrich Hilger
    * @author Light Development
    * @author <a href="http://www.lightdev.com">http://www.lightdev.com</a>
    * @author <a href="mailto:[email protected]">[email protected]</a>
    * @author published under the terms and conditions of the
    *      GNU General Public License,
    *      for details see file gpl.txt in the distribution
    *      package of this software
    * @version Version 1, October 13, 2004
    public abstract class InfoThread extends Thread {
       * construct an <code>InfoThread</code> object
       * <p>This class is meant to be used when a <code>Thread</code> object is needed that actively
       * informs other objects about its status</code>. It is a good idea therefore to register
       * one or more listeners with instances of this class before doing anything
       * else.</p>
       * @see addInfoThreadListener
      public InfoThread() {
       * set the amount of time this thread shall idle after it is through with one
       * work cycle and before a next work cycle is started. This influences the time
       * other threads have for their work.
       * @param millis long  the number of milliseconds to idle after one work cycle
      public void setIdleMillis(long millis) {
        idleMillis = millis;
       * Causes this thread to begin execution; the Java Virtual Machine calls the <code>run</code>
       * method of this thread. Calls method <code>prepareThread</code> before calling
       * <code>run</code>.
       * @see run
       * @see prepareThread
      public synchronized void start() {
        setStatus(STATUS_INITIALIZING);
        prepareThread();
        setStatus(STATUS_READY);
        super.start();
       * call method <code>start</code> instead of this method.
       * calling this method directly will lead to an exception
       * @see start
      public void run() {
        //System.out.println("InfoThread.run");
        if (status == STATUS_READY) {
          boolean workIsLeft = true;
          setStatus(STATUS_RUNNING);
          while (status < STATUS_STOP_PENDING && workIsLeft) {
            if (status < STATUS_HALT_PENDING) {
              workIsLeft = work();
              if(!workIsLeft) {
                setStatus(STATUS_WORK_COMPLETE);
            if (status == STATUS_HALT_PENDING) {
              setStatus(STATUS_HALTED);
            else if (status == STATUS_STOP_PENDING) {
              setStatus(STATUS_STOPPED);
            else {
              try {
                sleep(idleMillis);
              catch (InterruptedException e) {
                fireThreadException(e);
        else {
          // error: Thread is not ready to run
        setStatus(STATUS_THREAD_FINISHED);
       * stop this thread. This will terminate the thread irrevokably. Use method
       * <code>haltThread</code> to pause a thread with the possiblity to resume work later.
       * @see haltThread
      public void stopThread() {
        switch (status) {
          case STATUS_RUNNING:
            setStatus(STATUS_STOP_PENDING);
            break;
          case STATUS_HALT_PENDING:
            // exception: the thread already is about to halt
            break;
          case STATUS_STOP_PENDING:
            // exception: the thread already is about to stop
            break;
          default:
            // exception: a thread can not be stopped, when it is not running
            break;
       * halt this thread, i.e. pause working allowing to resume later
       * @see resumeThread
      public void haltThread() {
        switch (status) {
          case STATUS_RUNNING:
            setStatus(STATUS_STOP_PENDING);
            break;
          case STATUS_HALT_PENDING:
            // exception: the thread already is about to halt
            break;
          case STATUS_STOP_PENDING:
            // exception: the thread already is about to stop
            break;
          default:
            // exception: a thread can not be halted, when it is not running
            break;
       * resume this thread, i.e. resume previously halted work
       * @see haltThread
      public void resumeThread() {
        if(status == STATUS_HALTED || status == STATUS_HALT_PENDING) {
          setStatus(STATUS_RUNNING);
        else {
          // exception: only halted threads or threads that are about to halt can be resumed
       * this is the method to prepare a thread to run. It is not implemented in this abstract
       * class. Subclasses of <code>InfoThread</code> can implement this method to do anything
       * that might be required to put their thread into STATUS_READY. This method is called
       * automatically by method <code>start</code>.  When implementing this method, it should
       * call method <code>fireThreadException</code> accordingly.
       * @see start
       * @see fireThreadException
      protected void prepareThread() {
        // does nothing in this abstract class but might be needed in subclasses
       * this is the main activity method of this object. It is not implemented in this abstract
       * class. Subclasses of <code>InfoThread</code> must implement this method to do something
       * meaningful. When implementing this method, it should call methods
       * <code>fireThreadProgress</code> and <code>fireThreadException</code> accordingly.
       * @return boolean true, if work is left, false if not
       * @see fireThreadProgress
       * @see fireTreadException
      protected abstract boolean work();
       * add an <code>InfoTreadListener</code> to this instance of <code>InfoThread</code>
       * @param l InfoThreadListener  the listener to add
       * @see removeInfoThreadListener
      public void addInfoThreadListener(InfoThreadListener l) {
        listeners.add(l);
       * remove an <code>InfoTreadListener</code> from this instance of <code>InfoThread</code>
       * @param l InfoThreadListener  the listener to remove
      public void removeInfoThreadListener(InfoThreadListener l) {
        listeners.remove(l);
       * notify all <code>InfoThreadListener</code>s of a status change
       * @param fromStatus int  the status tis thread had before the change
       * @param toStatus int  the status this thread has now
      protected void fireThreadStatusChanged(int fromStatus, int toStatus) {
        Enumeration e = listeners.elements();
        while(e.hasMoreElements()) {
          Object l = e.nextElement();
          if(l instanceof InfoThreadListener) {
            ((InfoThreadListener) l).threadStatusChanged(this, fromStatus, toStatus);
       * notify all <code>InfoThreadListener</code>s of an exception in this thread
       * @param ex Exception  the exception that occurred
      protected void fireThreadException(Exception ex) {
        Enumeration e = listeners.elements();
        while(e.hasMoreElements()) {
          Object l = e.nextElement();
          if(l instanceof InfoThreadListener) {
            ((InfoThreadListener) l).threadException(this, ex);
       * notify all <code>InfoThreadListener</code>s of the progress of this thread
       * @param progressValue long  a value indicating the current thread progress
      protected void fireThreadProgress(long progressValue) {
        Enumeration e = listeners.elements();
        while(e.hasMoreElements()) {
          Object l = e.nextElement();
          if(l instanceof InfoThreadListener) {
            ((InfoThreadListener) l).threadProgress(this, progressValue, maxValue);
       * set the status of this thread and notify all listeners
       * @param newStatus int  the status this thread is to be changed to
      private void setStatus(int newStatus) {
        //System.out.println("InfoThread.setStatus oldStatus=" + status + ", newStatus=" + newStatus);
        int fromStatus = status;
        status = newStatus;
        fireThreadStatusChanged(fromStatus, newStatus);
       * get the current status of this thread
       * @return int  the status
      public int getStatus() {
        return status;
       * cleanup before actual destruction.
      public void destroy() {
        //System.out.println("InfoThread.destroy");
        cleanup();
        super.destroy();
       * cleanup all references this thread maintains
      private void cleanup() {
        //System.out.println("InfoThread.cleanup");
        listeners.removeAllElements();
        listeners = null;
      /* ----------------------- class fields start ------------------------ */
      /** storage for the objects this thread notifies about status changes and progress */
      private Vector listeners = new Vector();
      /** indicator for the status of this thread */
      private int status = STATUS_NONE;
      /** maximum value for threadProgress */
      protected long maxValue = -1;
      /** the idle time inside one work cycle in milliseconds */
      protected long idleMillis = 1;
      /* ----------------------- class fields end -------------------------- */
      /* ----------------------- constants start --------------------------- */
      /** constant value indicating that no status has been set so far */
      public static final int STATUS_NONE = 0;
      /** constant value indicating that the thread is currently initializing */
      public static final int STATUS_INITIALIZING = 1;
      /** constant value indicating that the thread is ready to run */
      public static final int STATUS_READY = 2;
      /** constant value indicating that the thread is running */
      public static final int STATUS_RUNNING = 3;
      /** constant value indicating that the thread is about to halt */
      public static final int STATUS_HALT_PENDING = 4;
      /** constant value indicating that the thread is halted */
      public static final int STATUS_HALTED = 5;
      /** constant value indicating that the work of this thread is complete */
      public static final int STATUS_WORK_COMPLETE = 6;
      /** constant value indicating that the thread is about to stop */
      public static final int STATUS_STOP_PENDING = 7;
      /** constant value indicating that the thread is stopped */
      public static final int STATUS_STOPPED = 8;
      /** constant value indicating that the thread is finished */
      public static final int STATUS_THREAD_FINISHED = 9;
      /* ----------------------- constants end --------------------------- */
    }this is the InfoThreadListener interface
    * Light Development Java Library
    * Copyright (C) 2003, 2004 Ulrich Hilger
    * This program is free software; you can redistribute it and/or
    * modify it under the terms of the GNU General Public License
    * as published by the Free Software Foundation; either version 2
    * of the License, or (at your option) any later version.
    * This program is distributed in the hope that it will be useful,
    * but WITHOUT ANY WARRANTY; without even the implied warranty of
    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    * GNU General Public License for more details.
    * You should have received a copy of the GNU General Public License
    * along with this program; if not, write to the Free Software
    * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
    package com.lightdev.lib.util;
    * An interface classes interested to receive events from objects
    * of class <code>InfoThread</code> need to implement.
    * @author Ulrich Hilger
    * @author Light Development
    * @author <a href="http://www.lightdev.com">http://www.lightdev.com</a>
    * @author <a href="mailto:[email protected]">[email protected]</a>
    * @author published under the terms and conditions of the
    *      GNU General Public License,
    *      for details see file gpl.txt in the distribution
    *      package of this software
    * @version Version 1, October 13, 2004
    public interface InfoThreadListener {
       * method to receive a status change notification from a thread
       * @param thread InfoThread  the thread which status changed
       * @param fromStatus int  the status which the thread had before the change
       * @param toStatus int  the status which the thread has now
      public void threadStatusChanged(InfoThread thread, int fromStatus, int toStatus);
       * method to receive a notification about the progress of a thread
       * @param thread InfoThread  the thread which notified about its progress
       * @param progressValue long  the value (e.g. 10 if 100 percent completed, 20 of 1 million files processed, etc.)
      public void threadProgress(InfoThread thread, long progressValue, long maxValue);
       * method to receive a notifiaction about the fact that an exception occurred in a thread
       * @param thread InfoThread  the thread for which an exception occurred
       * @param e Exception  the exception that occurred
      public void threadException(InfoThread thread, Exception e);
    }This is class AudioFileDescriptor
    * Light Development Java Library
    * Copyright (C) 2004 Ulrich Hilger
    * This program is free software; you can redistribute it and/or
    * modify it under the terms of the GNU General Public License
    * as published by the Free Software Foundation; either version 2
    * of the License, or (at your option) any later version.
    * This program is distributed in the hope that it will be useful,
    * but WITHOUT ANY WARRANTY; without even the implied warranty of
    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    * GNU General Public License for more details.
    * You should have received a copy of the GNU General Public License
    * along with this program; if not, write to the Free Software
    * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
    package com.lightdev.lib.audio;
    import java.io.FileNotFoundException;
    import java.io.IOException;
    import java.io.RandomAccessFile;
    import java.io.Serializable;
    import java.text.DecimalFormat;
    * This class models characteristics of an audio file such as the absolute path
    * of the file, its tag contents (if any) and the play duration, etc.
    * <p>See <a href="http://www.id3.org">http://www.id3.org</a> for details about
    * ID3 tags.</p>
    * @author Ulrich Hilger
    * @author Light Development
    * @author <a href="http://www.lightdev.com">http://www.lightdev.com</a>
    * @author <a href="mailto:[email protected]">[email protected]</a>
    * @author published under the terms and conditions of the
    *      GNU General Public License,
    *      for details see file gpl.txt in the distribution
    *      package of this software
    * @version Version 1, October 13, 2004
    public class AudioFileDescriptor implements Serializable, Comparable {
      public AudioFileDescriptor(String absolutePath) throws FileNotFoundException, IOException {
        load(absolutePath);
      public boolean equals(Object o) {
        if(o != null && o instanceof AudioFileDescriptor) {
          return ((AudioFileDescriptor) o).getAbsolutePath().equalsIgnoreCase(this.getAbsolutePath());
        else {
          return false;
      public void load(String absolutePath) throws FileNotFoundException, IOException {
        this.absolutePath = absolutePath;
        RandomAccessFile rf = new RandomAccessFile(absolutePath, "r");
        if(id3v11Tag == null) {
          id3v11Tag = new ID3v11Tag(rf, false);
        else {
          id3v11Tag.readTag(rf, rf.length() - 128);
        rf.close();
      public String getAbsolutePath() {
        return absolutePath;
      public ID3v11Tag getID3v11Tag() {
        return id3v11Tag;
      public void setID3v11Tag(ID3v11Tag tag) {
        this.id3v11Tag = tag;
      public String toString() {
        DecimalFormat df = new DecimalFormat("00");
        return id3v11Tag.getArtist() + ", " + id3v11Tag.getAlbum() + " - " +
            df.format(id3v11Tag.getTrackNumber()) + " " + id3v11Tag.getTitle();
       * Compares this object with the specified object for order.
       * @param o the Object to be compared.
       * @return a negative integer, zero, or a positive integer as this object is less than, equal to,
       *   or greater than the specified object.
       * @todo Implement this java.lang.Comparable method
      public int compareTo(Object o) {
        return toString().compareTo(o.toString());
      private String absolutePath;
      private ID3v11Tag id3v11Tag;
      private transient long duration = -1;
      private transient int type = TYPE_UNKNOWN;
      public static final transient int TYPE_UNKNOWN = 0;
      public static final transient int TYPE_MP3 = 1;
    }This is class ID3V11Tag into which the data is actually stored
    * Light Development Java Library
    * Copyright (C) 2004 Ulrich Hilger
    * This program is free software; you can redistribute it and/or
    * modify it under the terms of the GNU General Public License
    * as published by the Free Software Foundation; either version 2
    * of the License, or (at your option) any later version.
    * This program is distributed in the hope that it will be useful,
    * but WITHOUT ANY WARRANTY; without even the implied warranty of
    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    * GNU General Public License for more details.
    * You should have received a copy of the GNU General Public License
    * along with this program; if not, write to the Free Software
    * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
    package com.lightdev.lib.audio;
    import java.io.File;
    import java.io.RandomAccessFile;
    import java.io.IOException;
    import java.io.Serializable;
    import java.text.DecimalFormat;
    * This class is a very simple implementation of an ID3v11Tag. It models an ID3 tag
    * pretty much the same way as it is physically stored inside an audio file.
    * <p>See <a href="http://www.id3.org">http://www.id3.org</a> for details about
    * ID3 tags.</p>
    * @author Ulrich Hilger
    * @author Light Development
    * @author <a href="http://www.lightdev.com">http://www.lightdev.com</a>
    * @author <a href="mailto:[email protected]">[email protected]</a>
    * @author published under the terms and conditions of the
    *      GNU General Public License,
    *      for details see file gpl.txt in the distribution
    *      package of this software
    * @version Version 1, October 13, 2004
    public class ID3v11Tag implements Serializable, Comparable {
       * construct an ID3v11Tag and read tag content from a given file
       * <p>This constructor can be used for cases where a RandomAccessFile has already
       * been opened and will be closed elsewhere</p>
       * @param rf RandomAccessFile  the open file to read from
       * @param isAtTagStartPos boolean  true, if the file pointer is at the
       * position where the ID3 tag starts; when false, the pointer is positioned accordingly here
       * @throws IOException
      public ID3v11Tag(RandomAccessFile rf, boolean isAtTagStartPos) throws IOException {
        if(isAtTagStartPos) {
          readTag(rf);
        else {
          readTag(rf, rf.length() - 128);
       * construct an ID3v11Tag and read tag content from a file at a given location
       * <p>This constructor opens and closes the audio file for reading</p>
       * @param absolutePath String  the absolute path to the audio file to open
       * @throws IOException
      public ID3v11Tag(String absolutePath) throws IOException {
        RandomAccessFile rf = new RandomAccessFile(absolutePath, "r");
        readTag(rf, rf.length() - 128);
        rf.close();
       * construct an ID3v11Tag and read tag content from a given file
       * <p>This constructor opens and closes the audio file for reading</p>
       * @param audioFile File  the audio file to read from
       * @throws IOException
      public ID3v11Tag(File audioFile) throws IOException {
        this(audioFile.getAbsolutePath());
       * get a string representation of this object
       * @return String
      public String toString() {
        DecimalFormat df = new DecimalFormat("00");
        return getArtist() + ", " + getAlbum() + " - " + df.format(getTrackNumber()) + " " + getTitle();
       * position to file pointer and read the tag
       * @param rf RandomAccessFile  the file to read from
       * @param jumpPos long  the position to jump to (the tag start position)
       * @throws IOException
      public void readTag(RandomAccessFile rf, long jumpPos) throws IOException {
        rf.seek(jumpPos);
        readTag(rf);
       * read the tag from a given file, assuming the file pointer to be at the tag start position
       * @param rf RandomAccessFile  the file to read from
       * @throws IOException
      public void readTag(RandomAccessFile rf) throws IOException {
        rf.read(tagBuf);
        if(tag.equalsIgnoreCase(new String(tagBuf))) {
          rf.read(title);
          rf.read(artist);
          rf.read(album);
          rf.read(year);
          rf.read(comment);
          rf.read(trackNo);
          rf.read(genre);
      public String getTitle() {
        return new String(title).trim();
      public String getArtist() {
        return new String(artist).trim();
      public String getAlbum() {
        return new String(album).trim();
      public String getYear() {
        return new String(year).trim();
      public String getComment() {
        return new String(comment).trim();
      public int getGenreId() {
        try {
          int id = new Byte(genre[0]).intValue();
          if(id < GENRE_ID_MIN || id > GENRE_ID_MAX) {
            return GENRE_ID_OTHER;
          else {
            return id;
        catch(Exception ex) {
          return GENRE_ID_OTHER;
      public String getGenreName() {
        return genreNames[getGenreId()];
      public int getTrackNumber() {
        try {
          return (int) trackNo[0];
        catch(Exception e) {
          return 0;
       * Compares this object with the specified object for order.
       * @param o the Object to be compared.
       * @return a negative integer, zero, or a positive integer as this object is less than, equal to,
       *                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Hi Franck,
    thank you, mate. I did what you suggested (changed class attached) but that did not change the mentioned behaviour.
    The first run is approximately 75 seconds with Java option -Xms40m and approx. double without, the second run and all subsequent runs are only 2-3 seconds each (!!!) even when terminating and re-starting the application between thread runs.
    I'm pretty clueless about that, any more help on this anyone?
    Thanks a lot and best regards
    Ulrich
    PS: BTW, I forgot to post the class that is filled with data by class CollectionThread, so here it is
    * Light Development Playlist Editor
    * Copyright (C) 2004 Ulrich Hilger
    * This program is free software; you can redistribute it and/or
    * modify it under the terms of the GNU General Public License
    * as published by the Free Software Foundation; either version 2
    * of the License, or (at your option) any later version.
    * This program is distributed in the hope that it will be useful,
    * but WITHOUT ANY WARRANTY; without even the implied warranty of
    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    * GNU General Public License for more details.
    * You should have received a copy of the GNU General Public License
    * along with this program; if not, write to the Free Software
    * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
    package com.lightdev.app.playlisteditor.data;
    import java.io.File;
    import com.lightdev.lib.audio.ID3v11Tag;
    import javax.sound.sampled.UnsupportedAudioFileException;
    import java.io.IOException;
    import java.io.Serializable;
    import com.lightdev.lib.audio.AudioFileDescriptor;
    import com.lightdev.lib.ui.SortListModel;
    import java.util.Iterator;
    * Storage model for audio data.
    * <p>
    * <code>AudioDataModel</code> can be used to store ID3 tag data collected from
    * a directory with audio files to perform queries and reports on the found data.
    * </p>
    * <p>See <a href="http://www.id3.org">http://www.id3.org</a> for details about
    * ID3 tags.</p>
    * @author Ulrich Hilger
    * @author Light Development
    * @author <a href="http://www.lightdev.com">http://www.lightdev.com</a>
    * @author <a href="mailto:[email protected]">[email protected]</a>
    * @author published under the terms and conditions of the
    *      GNU General Public License,
    *      for details see file gpl.txt in the distribution
    *      package of this software as well as any licensing notes
    *      inside this documentation
    * @version 1, October 15, 2004
    public class AudioDataModel extends SortListModel implements Serializable {
       * constructor
      public AudioDataModel() {
       * add an audio track from a given audio file
       * <p>This will attempt to read ID3 tag data from the file.</p>
       * @param audioFile File  the file to add audio data for
       * @throws IOException
      public void addTrack(File audioFile) throws IOException {
        AudioFileDescriptor afd = new AudioFileDescriptor(audioFile.getAbsolutePath());
        if (!data.contains(afd)) {
          data.add(afd);
       * get all tracks for agiven combination of genre name, artist name and album name. Any of
       * the parameters may be null or AudioDataModel.FILTER_ALL
       * <p>Ugly code, I know, but it simply hard codes all combinations of the the mentioned
       * parameters. Any more elegant implementations welcome.</p>
       * @param genreName String  a genre name to get tracks for
       * @param artistName String  an artist name to get tracks for
       * @param albumName String  an album name to get tracks for
       * @return SortListModel   the found tracks in a list model
      public SortListModel getTracks(String genreName, String artistName, String albumName) {
        SortListModel foundTracks = new SortListModel();
        Iterator e = data.iterator();
        while(e.hasNext()) {
          AudioFileDescriptor afd = (AudioFileDescriptor) e.next();
          ID3v11Tag tag = afd.getID3v11Tag();
          if(genreName == null || genreName.equalsIgnoreCase(FILTER_ALL)) {
            if(artistName == null || artistName.equalsIgnoreCase(FILTER_ALL)) {
              if (tag.getAlbum().equalsIgnoreCase(albumName))
                foundTracks.add(afd);
            else {
              if(albumName == null || albumName.equalsIgnoreCase(FILTER_ALL)) {
                if (tag.getArtist().equalsIgnoreCase(artistName))
                  foundTracks.add(afd);
              else {
                if (tag.getArtist().equalsIgnoreCase(artistName) &&
                    tag.getAlbum().equalsIgnoreCase(albumName))
                  foundTracks.add(afd);
          else {
            if(artistName == null || artistName.equalsIgnoreCase(FILTER_ALL)) {
              if(albumName == null || albumName.equalsIgnoreCase(FILTER_ALL)) {
                if (tag.getGenreName().equalsIgnoreCase(genreName))
                  foundTracks.add(afd);
              else {
                if (tag.getGenreName().equalsIgnoreCase(genreName) &&
                    tag.getAlbum().equalsIgnoreCase(albumName))
                  foundTracks.add(afd);
            else {
              if(albumName == null || albumName.equalsIgnoreCase(FILTER_ALL)) {
                if (tag.getGenreName().equalsIgnoreCase(genreName) &&
                    tag.getArtist().equalsIgnoreCase(artistName))
                  foundTracks.add(afd);
              else {
                if (tag.getGenreName().equalsIgnoreCase(genreName) &&
                    tag.getArtist().equalsIgnoreCase(artistName) &&
                    tag.getAlbum().equalsIgnoreCase(albumName))
                  foundTracks.add(afd);
        foundTracks.sort();
        return foundTracks;
       * list all artists in this model
       * @return SortListModel
      public SortListModel listArtists() {
        SortListModel artists = new SortListModel();
        artists.add(FILTER_ALL);
        Iterator e = data.iterator();
        while (e.hasNext()) {
          ID3v11Tag tag = ((AudioFileDescriptor) e.next()).getID3v11Tag();
          String artistName = tag.getArtist();
          if (artists.indexOf(artistName) < 0) {
            artists.add(artistName);
        artists.sort();
        return artists;
       * list all artists in this model having titles belonging to a given genre
       * @param genreName String  name of the genre artists are searched for
       * @return SortListModel
      public SortListModel listArtists(String genreName) {
        SortListModel artists = new SortListModel();
        artists.add(FILTER_ALL);
        Iterator e = data.iterator();
        while (e.hasNext()) {
          ID3v11Tag tag = ((AudioFileDescriptor) e.next()).getID3v11Tag();
          String artistName = tag.getArtist();
          String genre = tag.getGenreName();
          if (artists.indexOf(artistName) < 0 && genre.equalsIgnoreCase(genreName)) {
            artists.add(artistName);
        artists.sort();
        return artists;
       * list all genres in this model
       * @return SortListModel
      public SortListModel listGenres() {
        SortListModel genres = new SortListModel();
        genres.add(FILTER_ALL);
        Iterator e = data.iterator();
        while (e.hasNext()) {
          ID3v11Tag tag = ((AudioFileDescriptor) e.next()).getID3v11Tag();
          String genreName = tag.getGenreName();
          if (genres.indexOf(genreName) < 0) {
            genres.add(genreName);
        genres.sort();
        return genres;
       * list all albums in this model
       * @return SortListModel
      public SortListModel listAlbums() {
        SortListModel albums = new SortListModel();
        albums.add(FILTER_ALL);
        Iterator e = data.iterator();
        while (e.hasNext()) {
          ID3v11Tag tag = ((AudioFileDescriptor) e.next()).getID3v11Tag();
          String albumName = tag.getAlbum();
          if (albums.indexOf(albumName) < 0) {
            albums.add(albumName);
        albums.sort();
        return albums;
       * list all albums in this model having titles belonging to a given genre
       * @param genreName String  name of the genre albums are searched for
       * @return SortListModel
      public SortListModel listAlbums(String genreName) {
        SortListModel albums = new SortListModel();
        albums.add(FILTER_ALL);
        Iterator e = data.iterator();
        while (e.hasNext()) {
          ID3v11Tag tag = ((AudioFileDescriptor) e.next()).getID3v11Tag();
          String albumName = tag.getAlbum();
          String genre = tag.getGenreName();
          if (albums.indexOf(albumName) < 0 && genre.equalsIgnoreCase(genreName)) {
            albums.add(albumName);
        albums.sort();
        return albums;
       * list all albums in this model having titles belonging to a given genre and artist
       * @param genreName String  name of the genre albums are searched for
       * @param artistName String  name of the artist albums are searched for
       * @return SortListModel
      public SortListModel listAlbums(String genreName, String artistName) {
        SortListModel albums = new SortListModel();
        albums.add(FILTER_ALL);
        Iterator e = data.iterator();
        while (e.hasNext()) {
          ID3v11Tag tag = ((AudioFileDescriptor) e.next()).getID3v11Tag();
          String albumName = tag.getAlbum();
          String genre = tag.getGenreName();
          String artist = tag.getArtist();
          if(genreName == null || genreName.equalsIgnoreCase(FILTER_ALL)) {
            if (albums.indexOf(albumName) < 0 &&
                artist.equalsIgnoreCase(artistName))
              albums.add(albumName);
          else {
            if (albums.indexOf(albumName) < 0 &&
                genre.equalsIgnoreCase(genreName) &&
                artist.equalsIgnoreCase(artistName))
              albums.add(albumName);
        albums.sort();
        return albums;
       * get the number of audio tracks stored in this data model
       * @return int  the number of tracks
      public int getTrackCount() {
        return data.size();
      /** constant to select all items of a given part */
      public static final String FILTER_ALL = "    all";
    }...and here the changed CollectionThread now caching found File objects in a vector
    * Light Development Playlist Editor
    * Copyright (C) 2004 Ulrich Hilger
    * This program is free software; you can redistribute it and/or
    * modify it under the terms of the GNU General Public License
    * as published by the Free Software Foundation; either version 2
    * of the License, or (at your option) any later version.
    * This program is distributed in the hope that it will be useful,
    * but WITHOUT ANY WARRANTY; without even the implied warranty of
    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    * GNU General Public License for more details.
    * You should have received a copy of the GNU General Public License
    * along with this program; if not, write to the Free Software
    * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
    package com.lightdev.app.playlisteditor.data;
    import com.lightdev.lib.util.InfoThread;
    import java.io.File;
    import java.util.Vector;
    import java.util.Enumeration;
    * A class to collect audio data from a given storage location.
    * <p>
    * <code>CollectionThread</code> uses ID3 tag information to gain data.
    * </p>
    * <p>See <a href="http://www.id3.org">http://www.id3.org</a> for details about
    * ID3 tags.</p>
    * @author Ulrich Hilger
    * @author Light Development
    * @author <a href="http://www.lightdev.com">http://www.lightdev.com</a>
    * @author <a href="mailto:[email protected]">[email protected]</a>
    * @author published under the terms and conditions of the
    *      GNU General Public License,
    *      for details see file gpl.txt in the distribution
    *      package of this software as well as any licensing notes
    *      inside this documentation
    * @version 1, October 13, 2004
    public class CollectionThread extends InfoThread {
       * constructor
       * @param model  AudioDataModel  the data model to collect data to
      public CollectionThread(AudioDataModel model) {
        this.model = model;
       * constructor, creates a new empty AudioDataModel
      public CollectionThread() {
        this(new AudioDataModel());
       * set the data model to collect data to
       * @param model AudioDataModel  the model to collect data to
      public void setModel(AudioDataModel model) {
        this.model = model;
       * get the data model associated to this thread
       * @return AudioDataModel  the data model
      public AudioDataModel getModel() {
        return model;
       * set the directory to collect data from
       * @param rootDir File  the directory to collect data from
      public void setRootDirectory(File rootDir) {
        this.rootDir = rootDir;
       * this is the method to prepare a thread to run.
      protected void prepareThread() {
        maxValue = -1;
        filesProcessed = 0;
        innerCount = 0;
        fileList = new Vector();
       * do the actual work of this thread, i.e. iterate through a given directory
       * structure and collect audio data
       * @return boolean  true, if work is left
      protected boolean work() {
        boolean workIsLeft = true;
        if(getStatus() < STATUS_HALT_PENDING) {
          countElements(rootDir.listFiles());
        if(getStatus() < STATUS_HALT_PENDING) {
          workIsLeft = collect(); //collect(rootDir.listFiles());
          fileList.clear();
          fileList = null;
        return workIsLeft;
       * count the elements in a given file array including its subdirectories
       * @param files File[]
      private void countElements(File[] files) {
        int i = 0;
        while (i < files.length && getStatus() < STATUS_HALT_PENDING) {
          File file = files;
    if (file.isDirectory()) {
    countElements(file.listFiles());
    else {
    fileList.add(file);
    i++;
    maxValue++;
    * read data into model
    * @param files File[] the file array representing the content of a given directory
    * @return boolean true, if work is left
    private boolean collect(/*File[] files*/) {
    Enumeration files = fileList.elements();
    while(files.hasMoreElements() && getStatus() < STATUS_HALT_PENDING) {
    File file = (File) files.nextElement();
    try {
    model.addTrack(file);
    catch(Exception e) {
    fireThreadException(e);
    filesProcessed++;
    if(++innerCount > 99) {
    innerCount = 0;
    fireThreadProgress(filesProcessed);
    return false;
    int i = 0;
    while(i < files.length && getStatus() < STATUS_HALT_PENDING) {
    File file = files[i];
    if(file.isDirectory()) {
    collect(file.listFiles());
    else if(file.getName().toLowerCase().endsWith("mp3")) {
    try {
    model.addTrack(file);
    catch(Exception e) {
    fireThreadException(e);
    i++;
    filesProcessed++;
    fireThreadProgress(filesProcessed);
    return (i<files.length);
    /** the directory to collect data from */
    private File rootDir;
    /** the data model to collect data to */
    private AudioDataModel model;
    /** the number of files this thread processed so far while it is running */
    private long filesProcessed = 0;
    /** a list to temporary store found files */
    private Vector fileList;
    /** counter to determine when to fire progress messages */
    private int innerCount = 0;

  • Why iam unable to get the valu from combobox

    when i run this code
    everytime iam getting blank alert
    y iam unable to get the selected item from combo box
    thank u
    <%@ page import="java.util.Date"%>
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
        pageEncoding="ISO-8859-1"%><%@page import="java.sql.*,java.util.*,java.text.*,java.util.ArrayList, java.util.List,org.joda.time.DateTimeConstants,org.joda.time.LocalDate,
    org.joda.time.Weeks"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <HTML>
      <HEAD>
      <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
        <TITLE>Reading Data From Text Fields</TITLE>
      </HEAD><BODY onload=Datevalue()>
         <form name="form1" action ="" method="post" onSubmit="update();">
        <img src="nendrasys_logo.gif" align="right"></img>
      <b><font color="669900"><h4 align="left">UserName:</font> 
    <jsp:useBean id="user" scope="session" class="nendrasys.User" />
    <jsp:getProperty name="user" property= "name"/>
    &nbsp&nbsp&nbsp&nbsp
    <b><font color="90be00"><h4 align="left">Designation:</font>
      <jsp:getProperty name="user" property= "designation"/>
      <br><font color="669900"><h4 align="right">Project:</font>
        <select name="Projects">
         <option>Project:1</option>
         <option>Project:2</option>
         <option>Project:3</option>
         <option>Project:4</option>
         <option>Project:5</option>
    </select>
    <%! String s; %>
    <% DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd");
            Date date = new Date();
            //out.println(dateFormat.format(date));
                s=  dateFormat.format(date);
    %>
    <select name="Dates" sizes=1 id="dates" onchange="Datevalue(this.value)">
    <script type="text/javascript">
    <!--//
    var begDate = new Date("10/01/2008");
    var endDate = new Date();
    var previousDate =new Date();
    var presentDate =new Date("<%=s %>");
    endDate.setDate(presentDate.getDate()+14);
    begDate.setDate(begDate.getDate()+(6-begDate.getDay()));
    while (begDate <= endDate) {
    var datestring=[begDate.getDate(),(begDate.getMonth()+1),begDate.getFullYear()].join('/');
    //  var datestring=[begDate.getDate().padZero(2),(begDate.getMonth()+1).padZero(2),begDate.getFullYear()].join('/');
    if(previousDate < presentDate && presentDate <= begDate )
        document.writeln('<option selected>'+(datestring)+'</option>')}
    else   
    document.writeln('<option>'+(datestring)+'</option>')};
         previousDate.setDate(begDate.getDate());
        previousDate.setMonth(begDate.getMonth());
         previousDate.setYear(begDate.getYear());
        begDate.setDate(begDate.getDate()+7);
    document.writeln('</select>');
    //-->
    </script>
    <br><br>
    <TABLE BORDER="2" BORDERCOLOR="#336699" CELLPADDING="2" CELLSPACING="2" WIDTH="100%">
    <TR>
    <TD>&nbsp&nbsp&nbsp</TD>
    <TD bgcolor="669900"><label  id="sun"></label></TD>
    <TD bgcolor="90be00"><label for="mon" id="Mon">Mon</label></TD>
    <TD bgcolor="669900"><label for="tue" id="tue">Tue</label></TD>
    <TD bgcolor="90be00"><label for="wed" id="wed">Wed</label></TD>
    <TD bgcolor="669900"><label for="thu" id="thu">Thu</label></TD>
    <TD bgcolor="90be00"><label for="fri" id="fri">Fri</label></TD>
    <TD bgcolor="669900"><label for="sat" id="sat">Sat</label></TD>
    <TD bgcolor="90be00"><label for="tot" id="tot">Total</label></TD>
    </TR>
    <tr>
    <th>Project Work</th>
    <td bgcolor="669900"><input type="text" name="c11" size="2" value="7" onBlur="javascript:document.frm.c12.value = document.frm.c11.value"></td>
    <td bgcolor="90be00"><input type="text" name="c12" size="2" value="3"></td>
    <td bgcolor="669900"><input type="text" name="c13" size="2"></td>
    <td bgcolor="90be00"><input type="text" name="c14" size="2"></td>
    <td bgcolor="669900"><input type="text" name="c15" size="2"></td>
    <td bgcolor="90be00"><input type="text" name="c16" size="2"></td>
    <td bgcolor="669900"><input type="text" name="c17" size="2"></td>
    <td bgcolor="90be00"><input type="text" name="c18" size="4"></td>
    </tr>
    <tr>
    <th>Internal N/C</th>
    <td bgcolor="669900"><input type="text" name="c21" size="2"></td>
    <td bgcolor="90be00"><input type="text" name="c22" size="2"></td>
    <td bgcolor="669900"><input type="text" name="c23" size="2"></td>
    <td bgcolor="90be00"><input type="text" name="c24" size="2"></td>
    <td bgcolor="669900"><input type="text" name="c25" size="2"></td>
    <td bgcolor="90be00"><input type="text" name="c26" size="2"></td>
    <td bgcolor="669900"><input type="text" name="c27" size="2"></td>
    <td bgcolor="90be00"><input type="text" name="c28" size="4"></td>
    </tr>
    <tr>
    <th>Public Holidays</th>
    <td bgcolor="669900"><input type="text" name="c31" size="2"></td>
    <td bgcolor="90be00"><input type="text" name="c32" size="2"></td>
    <td bgcolor="669900"><input type="text" name="c33" size="2"></td>
    <td bgcolor="90be00"><input type="text" name="c34" size="2"></td>
    <td bgcolor="669900"><input type="text" name="c35" size="2"></td>
    <td bgcolor="90be00"><input type="text" name="c36" size="2" ></td>
    <td bgcolor="669900"><input type="text" name="c37" size="2"></td>
    <td bgcolor="90be00"><input type="text" name="c38" size="4"></td>
    </tr>
    <tr>
    <th>Holidays Taken</th>
    <td bgcolor="669900"><input type="text" name="c41" size="2"></td>
    <td bgcolor="90be00"><input type="text" name="c42" size="2"></td>
    <td bgcolor="669900"><input type="text" name="c43" size="2"></td>
    <td bgcolor="90be00"><input type="text" name="c44" size="2"></td>
    <td bgcolor="669900"><input type="text" name="c45" size="2"></td>
    <td bgcolor="90be00"><input type="text" name="c46" size="2"></td>
    <td bgcolor="669900"><input type="text" name="c47" size="2"></td>
    <td bgcolor="90be00"><input type="text" name="c48" size="4"></td>
    </tr>
    </TABLE>
    <br>
    <center><input type="submit"  value="Submit" /> </center>
    <%
    String username   = request.getParameter("userid");
    String pwd  = request.getParameter("pwd");
    String connectionURL = "jdbc:mysql://localhost:3306/timestamp";
    Connection connection = null;
    Statement statement = null;
    ResultSet rs = null;
    String sql=null;
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    connection = DriverManager.getConnection(connectionURL, "root","nendrasys");
    statement = connection.createStatement();
    //rs=statement.executeQuery(sql); %>
    </form>
    <SCRIPT language='Javascript'>
    function update()
        alert("ciaoooooo");
        <%
            try
                String value=request.getParameter("c11");
                String value1=request.getParameter("c12");
             //   if(value!=null)
              //  System.out.println(value);             
               // System.out.println(value1);
            catch(NullPointerException n)
        %>
    </script>
    <SCRIPT language='Javascript'>
    function Datevalue(date)
           //  document.getElementById("dates").innerHTML=document.getElementById("sun").value;
      alert(date);
             //  alert( document.getElementById("dates"))
                <% System.out.println("bye");%>
    </SCRIPT>
    </BODY>
    </HTML>

    You mixed Java and Javascript in the expectation that they runs simultaneously.
    You are Wrong.
    You need to distinguish between the server side languages and client side languages. Java/JSP runs at the server side and produces a HTML page with other client side stuff in it like CSS and Javascript. When the HTML page is finished, it will be sent to the client and then Java/JSP stops. Once the HTML page is arrived at the client, there is no one line Java code in it, only its output/result. Do a View Source in your favourite web browser to see it. Only from that moment on, Javascript runs and/or can be invoked.
    Whenever you want to use Java variables in Javascript, you need to print them out as a Javascript variable. Whenever you want to use Javascript variables in Java, you need to invoke a request to the server and pass them as parameters. The request can be either synchronous (a link or a form submit) or asynchronous (ajaxical).

  • Problem with isValid() in leap year program

    My problem is the method isValid(). I am not supposed to pass anything into the parameters or call any methods beside daysInMonth(). How am I supposed to check if it is a valid day. Here is my code.
    public class Date
    {private Integer month;     //instance variables
         private Integer day;
         private Integer year;
         private Integer a,b,c;
         public static final int BAD_MONTH = 0;
         public static final int BAD_DAY = 0;
         public static final int BAD_YEAR = 0;
         public Date(int copyMonth, int copyDay, int copyYear)
         {     setMonth(copyMonth);     //calling set methods()
              setDay(copyDay);
              setYear(copyYear);
         }//Date(Integer, Integer, Integer)
         public int getMonth()
              return month;     //returning month
         }//getMonth()
         private void setMonth(int copyMonth)
              if (copyMonth <= 0 || copyMonth > 12)
                        month = BAD_MONTH;
              else
                   month = copyMonth;     //setting month
         }//setMonth
         public int getDay()
              return day;     //returning day
         }//getDay()
         private void setDay(int copyDay)
              if (copyDay > 31 || copyDay < 1)
                        day = BAD_DAY;
              else
                   day = copyDay;     //setting day
         }//setDay
         public int getYear()
              return year;     //returning year
         }//getYear()
         private void setYear(int copyYear)
              if (copyYear < 0 || copyYear > 9999 || copyYear < 1000)
                        year = BAD_YEAR;
              else
                   year = copyYear;     //setting year
         }//setYear
         private String monthName()
              String a;
              int b = getMonth();
              switch(b)
                   case 1:
                        a = "January";break;
                   case 2:
                        a = "February";break;
                   case 3:
                        a = "March";break;
                   case 4:
                        a = "April";break;
                   case 5:
                        a = "May";break;
                   case 6:
                        a = "June";break;
                   case 7:
                        a = "July";break;
                   case 8:
                        a =  "August";break;
                   case 9:
                        a ="September";break;
                   case 10:
                        a = "October";break;
                   case 11:
                        a = "November";break;
                   case 12:
                        a = "December";break;
                   default:
                        a ="Month not valid";
              }//switch()
         return a;     //returning month words
         }//monthName()
         private boolean isLeapYear(int in)
              boolean a;
              if(in%4 == 0)
                   a = true;
              if(in%100 == 0)
                   if(in%400 == 0)
                        a = true;
              a = false;
              else
                   a = false;
         return a;
         }//isLeapYear()
         private Integer daysInFebruary(int in)
              if(isLeapYear(in) == true)
                   return 29;
              else
                   return 28;
         }//daysInFebruary()
         private Integer daysInMonth(int m, int y)
              Integer r;
              if(m == 1)
                   r = 31;
              if(m == 2)
                   if(isLeapYear(y) == true)
                        r = 29;
                   else if (isLeapYear(y) == false)
                        r = 28;
              if(m == 3)
                   r = 31;
              if(m == 4)
                   r = 30;
              if(m == 5)
                   r = 31;
              if(m == 6)
                   r = 30;
              if(m == 7)
                   r = 31;
              if(m == 8)
                   r = 31;
              if(m == 9)
                   r = 30;
              if(m == 10)
                   r = 31;
              if(m == 11)
                   r = 30;
              if(m == 12)
                   r = 31;
         return a;
         }//daysInMonth()
         private boolean isValid()
              daysInMonth();
         }//isValid()
         public String toString()
              if (getMonth() == BAD_MONTH || getYear() == BAD_YEAR || getDay() == BAD_DAY)
                   return "**Invalid Date**";
              else
                   return monthName() + " " + getDay() + ", " + getYear();
         }//toString()
    }//Date

    Use java.util.GregorianCalendar I think it will have all the tools you need see doc at http://java.sun.com/j2se/1.5.0/docs/api/java/util/GregorianCalendar.html
    cheers mait ..

  • I cant see why it is not working please help

    Hello all,
    I am practicing JSP by developing a site of my own.. I have come across a problem that I could not figure out.. I will appreciate all your hints please.. If I am posting this question in a wrong forum please be kind enough to route me to an appropriate forum please.
    I have a JSP that works fine in Firefox but will not load on any other browsers...like IE 8, Chrome, Safari
    I do not know if it is a problem with JSP or not I will greatly appreciate your input please. I stick the code below
    <%@ page contentType="text/html" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>
    <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
    <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
    <%@ page language="Java"%> 
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>joblet.lk</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" type="text/css" href="styles.css" />
    <script language="javascript" src="/test/DisableRightClick.js"></script>
    <script language="javascript" src="/test/newPopWindow.js"></script>
    <link rel="shortcut icon" href="/test/Images/favicon.gif">
    </head>
    <body bgcolor='#ffffdc'>
    <!-- Begin Wrapper -->
    <div id="wrapper">
    <!-- Begin Header -->
      <!--div id="header"><h1><a href="http://www.test/index.html">test</a></h1></div-->
      <div id="header">
      <!--p class="header">test</p-->
              <div id='logo'><img src="/test/Images/test.jpg"></div>            
              <div id="banner">
              <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
          codebase="http://download.macromedia.com/pub/shockwave/cabs
                    /flash/swflash.cab#version=6,0,29,0"
            width="475" height="81">
          <param name="quality" value="high">
          <embed src="myFlashMovie.SWF" quality="high" pluginspage=
           "http://www.macromedia.com/go/getflashplayer"
              type="application/x-shockwave-flash" width="475"
                       height="81">
          </embed>
        </object>
              </div>
    <div id='time'>
    <script>
    var mydate=new Date()
    var year=mydate.getYear()
    if (year < 1000)
    year+=1900
    var day=mydate.getDay()
    var month=mydate.getMonth()
    var daym=mydate.getDate()
    if (daym<10)
    daym="0"+daym
    var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
    var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")
    document.write("<small><font color='000000' face='Arial'><b>"+dayarray[day]+", "+montharray[month]+" "+daym+", "+year+"</b></font></small>")
    </script>
    </div>
      </div>
      <!-- End Header -->
      <!-- Begin Navigation -->
      <div id="navitop"> </div>
      <!-- End Navigation -->
      <!-- Begin Navigation -->
      <div id="navigation">
          <div class="rollover"><a href="/test/">Home</a></div> 
             <div class="rollover"><a href="/test/servlet/jController?empid='12345610'">Recruit</a></div>
          <div class="rollover"><a href="#">History</a></div>
          <div class="rollover"><a href="#">Location</a></div> 
             <div class="rollover"><a href="#">FAQ</a></div>
          <div class="rollover"><a href="#">Contact</a></div>
    </div>
      <!-- End Navigation -->
    <!--Check if list available in the session else route to the index.jsp  -- >
         <script>
         function doit(){
         window.print()
         </script>
         <script>
         function didit(){
         window.close()
         </script>
    <%
    if (session.getAttribute("validEmployer")==null)
    {%>
    <form method="post" action="/test/recauthentication.jsp">
    <div><span id ='count1'> <a href="reclogin.jsp">    logout</a></span> </div>
    <div id='content_small'>
    <table border = '0'>
    <tr>
    <td align = right width = '15%'></td>
    <td align = left><h5>Authentication</h5></td>
    </tr>
    <tr>
    <td align = right width = '15%'>e-mail:</td>
    <td align = left width = '20%'>
    <input type=text name="email"><br>                                                             
    </td>
    </tr>
    <tr>                                        
    <td align = right width = '15%'>password:</td>
    <td align = left width = '20%'>
    <input type=password name="password"><br><p>
    </td>                                                           
    </tr>
    <tr>
    <td align = right width = '15%'><span id ='count1'>. </span><br><p></td>
    <td align = left width = '20%'>${fn:escapeXml(param.errorMsg)}
    <br><p></td>
    </tr>
    <tr>
    <td align = right width = '15%'></td>
    <td align = left width = '20%'>
    <input type="submit" value="Login">
    </form>
    <a href=JavaScript:newPopWindow('../test/recregister.jsp',470,310,'c');window.close();><span id='count'>  Not Registered ?</span></a>
    </td>
    </tr>
    </table>
    </div>
         <%}
    else      {
    response.sendRedirect("/test/recruiter.jsp");
    %>
    </div>
    <!-- End Wrapper -->
    </body>
    </html> A Million Thanks in Advance

    Too much code to review in depth.
    Couple of things that jumped out at me
    1 - request.sendRedirect sent at the end. You should do any request forward/redirects as soon as possible in the jsp - before your response gets committed. It is illegal to forward/redirect after a response has been committed. That might explain the errors.
    2 - As a suggestion, view source on the page, and save the file as html. Or use the functionality to "save a webpage" to your local computer. Try loading that HTML page in all the browsers. That should help you diagnose is it the HTML code, or is it the JSP side of things that is broken.
    hope this helps,
    evnafets

  • I made a new Date object

    See, here's the thing with dates in java, the way i see it. We used to have Date, but Date wasn't international so we got Calendar. But some things, like SimpleDateFormat, still expect java.util.Date. java.sql.Date is out there somewhere, too. None of them have direct support for date differences (i.e. dateA - dateB = 8 days, or whatever). Now you're probably reading this thinking "Java supports all of this" and you're right. Calendar has a getTime method that returns a Date, and i can just pass THAT to SimpleDateFormat. With a little math, getTimeInMillis can be used to find the difference in two Calendars. But i got to thinking, "There should only be one Date object i need to think about," and since i don't ever have enough to do at work i put one together. I don't know if any of you are going to care enough to use it, mostly i'm just looking for advice on features i should add to it, inefficiencies in the design, stuff that's hard to understand, or whatever.
    This is it:
    *This catastrophe brought to you by SrA Meyerin.
    *Proximo Satis pro administatio.
    package awesomedate;
    //The following are imported for the toFormattedString(), toUtilDate(), toSQLDate, and toCalendar() methods, respectively.
    import java.text.SimpleDateFormat;
    import java.util.Date;
    import java.util.GregorianCalendar;
    import java.sql.*;
    import java.util.TimeZone;
    *This class is designed to be the ultimate date object. It stores dates accurate to the millisecond, has the ability to do date
    *arithmetic (adding/subtracting days/months/whatever), date comparison, and date formatting. Also it can, at will, be used as any
    *of the other date objects in the standard java API.
    public class AwesomeDate
         *Milliseconds from the epoch. This field is where everything starts.
        private long millis;
         * The current year. This is the only aspect of the current date that is stored in addition to the milliseconds. Everything else
         * is calculated as needed.
        private int year;
        //The following six variables are fairly self explanatory. I'll explain them anyway.
         *Milliseconds in one non-leap year. This can be passed to the "adjustDate()" method
         * but mostly it is used to make my code more readable.
        public final static long MILLIS_IN_YEAR = 31536000000L;
         *Milliseconds in one leap year. This can be passed to the "adjustDate()" method
         * but mostly it is used to make my code more readable.
        public static final long MILLIS_IN_LEAP_YEAR = 31622400000L;
         *Milliseconds in one day. This can be passed to the "adjustDate()" method
         * but mostly it is used to make my code more readable.
        public static final long MILLIS_IN_DAY = 86400000;
         *Milliseconds in one hour. This can be passed to the "adjustDate()" method
         * but mostly it is used to make my code more readable.
        public static final long MILLIS_IN_HOUR = 3600000;
         *Milliseconds in one minute. This can be passed to the "adjustDate()" method
         * but mostly it is used to make my code more readable.
        public static final long MILLIS_IN_MINUTE = 60000;
         *Milliseconds in one second. This can be passed to the "adjustDate()" method
         * but mostly it is used to make my code more readable.
        public static final long MILLIS_IN_SECOND = 1000;
         *The number of days in each month.
        private int[] daysInMonth = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
         *The timezone offset. GMT is 0, and the default, however, CST (where i live), is -6.
        private int timeZoneOffset = -6;
         *As the name would indicate, this is the number of milliseconds beyond 00:00 of jan 1 of the current year.
        private long millisAfterYear;
         *Basic constructor. Defaults to the current date and time. Works on Greenwich Mean Time, so it may seem off. To avoid this, multiply
         *add your time zone offset * MILLIS_IN_HOUR to the time in milliseconds.
        public AwesomeDate()
            setTimeInMillis(System.currentTimeMillis());
         *Fairly simple constructor. Sets time to the the number of milliseconds passed past the epoch.
        public AwesomeDate(long millis)
            setTimeInMillis(millis);
         *This constructor sets the date to the year/month/day passed.
        public AwesomeDate(int year, int month, int day)
            setDate(year, month, day);
         *This constructor sets the date time to the year/month/day/minute/hour/second passed.
        public AwesomeDate(int year, int month, int day, int hour, int minute, int second)
            setDate(year, month, day, hour, minute, second);
         *When you have the number of milliseconds, the first thing you must calculate is year. Because the number of milliseconds in a
         *year may vary, this is also the most difficult to calculate. This is the method that does it, though.
        private void setYearAfter1970()
            //I don't want to alter the actual number of milliseconds, so i make this variable and perform calculations on it.
            long theseMillis = this.millis;
            //Start at 1970 (the epoch) and work from there.
            year = 1970;
            long nextYear = MILLIS_IN_YEAR;
            //In this loop i subtract the number of millis in whatever year. The condition is if i have enough millis to make it through
                //another year.
            while (theseMillis >= nextYear)
                if (isLeapYear(year))
                    theseMillis = theseMillis - MILLIS_IN_LEAP_YEAR;
                    nextYear = MILLIS_IN_YEAR;
                else
                    theseMillis = theseMillis - MILLIS_IN_YEAR;
                    if (isLeapYear(year + 1))
                        nextYear = MILLIS_IN_LEAP_YEAR;
                year++;
            millisAfterYear = theseMillis;
            this.year = year;
         *Calculating the year from before 1970 must be done differently. It's pretty much just inverted.
        private void setYearBefore1970()
            long theseMillis = this.millis;
            year = 1970;
            long nextYear = MILLIS_IN_YEAR;
            while (theseMillis <= 0)
                if (isLeapYear(year))
                    theseMillis = theseMillis + MILLIS_IN_LEAP_YEAR;
                    nextYear = MILLIS_IN_YEAR;
                else
                    theseMillis = theseMillis + MILLIS_IN_YEAR;
                    if (isLeapYear(year - 1))
                        nextYear = MILLIS_IN_LEAP_YEAR;
                year--;
            millisAfterYear = theseMillis * -1;
            this.year = year;
         *Just what it sounds like. Pass it the number of milliseconds past the epoch and it will calculate the date based on that.
        public void setTimeInMillis(long millis)
            this.millis = millis;
            if (millis >= 0)
                setYearAfter1970();
            else
                setYearBefore1970();
         *Returns the number of milliseconds from the epoch.
        public long getTimeInMillis()
            return this.millis;
         *Returns the current year.
        public int getYear()
            return this.year;
         *Sets the date to 00:00 of Jan 1 of the passed year.
        public void setYear(int year)
            this.year = year;
            long theseMillis = 0;
            if (year > 1970)
                //Kind of like setYearAfter1970 method, except it's adding instead of subtracting. So actually it's the opposite.
                for (int cntr = 1970; cntr < this.year; cntr++)
                    if (isLeapYear(cntr))
                        theseMillis = theseMillis + MILLIS_IN_LEAP_YEAR;
                    else
                        theseMillis = theseMillis + MILLIS_IN_YEAR;
            else
                for (int cntr = 1970; cntr > this.year; cntr--)
                    if (isLeapYear(cntr))
                        theseMillis = theseMillis - MILLIS_IN_LEAP_YEAR;
                    else
                        theseMillis = theseMillis - MILLIS_IN_YEAR;
            //On a leap year there are 29 days in February. If not, there's 28.
            if (isLeapYear(year))
                daysInMonth[1] = 29;
            else
                daysInMonth[1] = 28;
            //This variable helps me calculate denominations of time that are below year.
            millisAfterYear = 0;
            setTimeInMillis(theseMillis);
         *Sets the month to the one that you passed, 0 being January and 11 being December.
        public void setMonth(int month)
            if (month < 0 || month > 11)
                throw new ArrayIndexOutOfBoundsException(month);
            long theseMillis = getTimeInMillis();
            int days = 0;
            setYear(this.year);
            if (getTimeInMillis() > 0)
                theseMillis = theseMillis - getTimeInMillis();
            else
                theseMillis = theseMillis + getTimeInMillis();
            for (int cntr = 0; cntr < month; cntr++)
                days = days + daysInMonth[cntr];
            millisAfterYear = days * MILLIS_IN_DAY + 1;
            setTimeInMillis(getTimeInMillis() + millisAfterYear);
         *Returns the month stored in this object. With this object 0 represents January and 11 represents December.
        public int getMonth()
            long theseMillis = millisAfterYear;
            int cntr = 0;
            while (theseMillis > (MILLIS_IN_DAY * daysInMonth[cntr]))
                theseMillis = theseMillis - MILLIS_IN_DAY * daysInMonth[cntr];
                cntr++;
            return cntr;
         *Set the day of month to the one passed.
        public void setDayOfMonth(int day)
            if (day < 1 || day > daysInMonth[getMonth()])
                throw new ArrayIndexOutOfBoundsException(day);
            setMonth(getMonth());
            //Internally, this actually works starting at zero, however to anyone using this class it appears to start at 1. Therefore
                //i must subtract one here.
            long addMillis = MILLIS_IN_DAY * (day - 1);
            millisAfterYear = millisAfterYear + addMillis;
            setTimeInMillis(getTimeInMillis() + addMillis + 1);
         *Returns the day of month.
        public int getDayOfMonth()
            int days = (int)(millisAfterYear / MILLIS_IN_DAY);
            int cntr = 0;
            while (days >= daysInMonth[cntr])
                days = days - daysInMonth[cntr];
                cntr++;
            //Internally this class stores dates starting at zero, but i want it to look like it starts at 1.
            return days + 1;
         *Sets the time to the currently selected day at the passed hour on the hour. uses 24 hour clock.
        public void setHour(int hour)
            if (hour < 0 || hour > 23)
                throw new ArrayIndexOutOfBoundsException(hour);
            setDayOfMonth(getDayOfMonth());
            long addMillis = MILLIS_IN_HOUR * hour;
            millisAfterYear = millisAfterYear + addMillis;
            setTimeInMillis(getTimeInMillis() + addMillis);
         *Returns the hour (but not how many minutes past the hour).
        public int getHour()
            long millisAfterDay = millisAfterYear % MILLIS_IN_DAY;
            return (int)(millisAfterDay / MILLIS_IN_HOUR);
         *Set the minutes past the hour. Works 0-59.
        public void setMinute(int minute)
            if (minute < 0 || minute > 59)
                throw new ArrayIndexOutOfBoundsException(minute);
            setHour(getHour());
            long addMillis = MILLIS_IN_MINUTE * minute;
            millisAfterYear = millisAfterYear + addMillis;
            setTimeInMillis(getTimeInMillis() + addMillis);
         *Returns the minutes past the hour, 0-59.
        public int getMinute()
            long millisAfterHour = millisAfterYear % MILLIS_IN_HOUR;
            return (int)(millisAfterHour / MILLIS_IN_MINUTE);
         *Sets the seconds past the minute, 0-59.
        public void setSecond(int second)
            if (second < 0 || second > 59)
                throw new ArrayIndexOutOfBoundsException(second);
            setMinute(getMinute());
            long addMillis = MILLIS_IN_SECOND * second;
            millisAfterYear = millisAfterYear + addMillis;
            setTimeInMillis(getTimeInMillis() + addMillis);
         *Returns the seconds past the minute, 0-59.
        public int getSecond()
            long millisAfterMinute = millisAfterYear % MILLIS_IN_MINUTE;
            return (int)(millisAfterMinute / MILLIS_IN_SECOND);
         *The more commonly seen set method of other date objects. Sets the date/time to 00:00 of the year/month/day passed. Convenience method
         *for setDate(int year, int month, int day, int hour, int minute, int second).
        public void setDate(int year, int month, int day)
            setDate(year, month, day, 0 , 0 , 0);
         *Sets every date/time field.
        public void setDate(int year, int month, int day, int hour, int minute, int second)
            setYear(year);
            setMonth(month);
            setDayOfMonth(day);
            setHour(hour);
            setMinute(minute);
            setSecond(second);
         *Returns yes if the stored date is a leap year. A leap year is every year that is divisible by four unless it is divisible by 100
         *unless it is also divisible by 400.
        public boolean isLeapYear()
            return isLeapYear(this.year);
         *For internal use. Returns if the passed year meets the criteria for a leap year.
        private boolean isLeapYear(int year)
            boolean leapYear = false;
            if (year % 4 == 0)
                if (year % 100 != 0)
                    leapYear = true;
                else if (year % 400 == 0)
                    leapYear = true;
            return leapYear;
         *Returns the difference in milliseconds between the time stored in this object and the millis passed to this method.
        public long getDifferenceInMillis(long millis)
            return getTimeInMillis() - millis;
         *Returns the difference in milliseconds between this date and the date passed to this method.
        public long getDifferenceInMillis(AwesomeDate otherDate)
            return getDifferenceInMillis(otherDate.getTimeInMillis());
         *Designed to be a wrapper method for the getDifferenceInMillis method. This method changes millis into years/days/whatever. Pass
         *the number of milliseconds you have to convert in the first parameter. The second parameter should be the type of denomination you
         *want (year, day, whatever). Use the MILLIS_IN_* fields associated with this object. Also bear in mind when workin with years that
         *some years are leap years, so in extreme cases of differences of 365+ years you may gain/lose a year.
        public static int toGreaterDenom(long millis, long denom)
            return (int)(millis / denom);
         * The first argument is how many of whatever (days, months, years, etc.) to add (use negative numbers to subtract). For the second
         * argument pass one of the MILLIS_IN_* fields. Thus, to add two hours would be
         * <code>
         *      AwesomeDate.adjustDate(2, AwesomeDate.MILLIS_IN_HOUR);
         * </code>
        public void adjustDate(int amount, long typeMillis)
            setTimeInMillis(this.millis + amount * typeMillis);
         *Returns an object of type java.util.Date set to the date/time stored here.
        public java.util.Date toUtilDate()
            long offset = TimeZone.getDefault().getRawOffset();
            return new java.util.Date(getTimeInMillis() +  -1 * offset);
    //        return new java.util.Date(getTimeInMillis());
         *Returns an object of type GregorianCalendar set to the date/time stored here.
        public GregorianCalendar toGregorianCalendar()
            long offset = TimeZone.getDefault().getRawOffset();
            GregorianCalendar cal = new GregorianCalendar();
            cal.setTimeInMillis(getTimeInMillis() - offset);
            return cal;
         *Returns an object of type java.sql.Date set to the date/time stored here.
        public java.sql.Date toSQLDate()
            long offset = TimeZone.getDefault().getRawOffset();
            return new java.sql.Date(getTimeInMillis() - offset);
        /** Format the date  using the string that you pass. Works just like the SimpleDateFormat object. Infact, it uses one! Heres
         *how it works:
         *Letter  Date or Time Component  Presentation  Examples  <br>
         *G  Era designator  Text  AD  <br>
         *y  Year  Year  1996; 96  <br>
         *M  Month in year  Month  July; Jul; 07<br> 
         *w  Week in year  Number  27  <br>
         *W  Week in month  Number  2  <br>
         *D  Day in year  Number  189  <br>
         *d  Day in month  Number  10  <br>
         *F  Day of week in month  Number  2<br> 
         *E  Day in week  Text  Tuesday; Tue  <br>
         *a  Am/pm marker  Text  PM  <br>
         *H  Hour in day (0-23)  Number  0<br> 
         *k  Hour in day (1-24)  Number  24  <br>
         *K  Hour in am/pm (0-11)  Number  0  <br>
         *h  Hour in am/pm (1-12)  Number  12  <br>
         *m  Minute in hour  Number  30  <br>
         *s  Second in minute  Number  55  <br>
         *S  Millisecond  Number  978  <br>
         *z  Time zone  General time zone  Pacific Standard Time; PST; GMT-08:00<br> 
         *Z  Time zone  RFC 822 time zone  -0800  <br>
        public String toFormattedString(String format)
            SimpleDateFormat formattage = new SimpleDateFormat(format);
            return formattage.format(toUtilDate());
         *I overrode the toString method. Now it tells everyone how awesome my AwesomeDate is.
        public String toString()
            String output = "John's Awesome Date!";
            output = output + " Millis: " + getTimeInMillis();
            output = output + " Year: " + getYear();
            output = output + " Month: " + getMonth();
            output = output + " Date: " + getDayOfMonth();
            output = output + " Time: ";
            if (getHour() < 10)
                output = output + "0" + getHour();
            else
                output = output + getHour();
            if (getMinute() < 10)
                output = output + "0" + getMinute();
            else
                output = output + getMinute();
            output = output + " Seconds: " + getSecond();
            return output;
        public static void main(String[] psvm)
            AwesomeDate blah = new AwesomeDate();
            GregorianCalendar blah1 = new GregorianCalendar();
            GregorianCalendar blah2 = new GregorianCalendar();
    }

    The reason Callendar is so complicated is that it is trying to solve a very complicated problem.
    You don't appear to support leap seconds (of which there can be upto 2 in any time interval)
    http://www.timeanddate.com/time/leapseconds.html
    Some of your code will not work for large dates very well (seems to iterate over the years). Try using your date class for astronomical or geological calculations. them big numbers will make your code slow at the moment.
    You don't seem to support timezones or transitory offsets (BST vs GMT). You most definately don't handle changes to timezone offsets that have occured in the past or historical daylight savings time offsets (they have not always been the same)
    The difference between two calendars is a "duration" a duration means nothing unless it is applied to a caledar/date (although you may be able to get away with it if the duration is always stored in millis)

  • Error with HeaderiView.jsp file

    Hi there,
    I took the masthead par file from the portal and I did some changes in the HeaderiView.jsp. When I try the iview in the preview I see the next error:
    Portal Runtime Error
    An exception occurred while processing a request for :
    iView : pcd:portal_content/pruebasjanet/ZiwImage/zprueba54
    Component Name : prueba1701.default
    Error occurs during the rendering of jsp component.
    Exception id: 10:14_06/09/07_0075_33099350
    See the details for the exception ID in the log file
    I already added the com.sap.portal.navigation.mastheadapi.jar in \PORTAL-INF\lib
    and com.sap.portal.navigation.masthead_core.jar \PORTAL-INF\private\lib.
    Any help would be greatly appreciated!
    Jeanette

    Hi Malini,
    Yes, I did some changes in Jsp file. I'm trying to make a copy of the Help Link. I copied all the components in the portalapp.xml (only changes, for example, <property name="ShowHelpLink" value="true">    <property name="ShowSiteLink" value="true">)
    Would you please help me checking the code?
    Thanks.
    Jeanette
    With the jsp file I have problems:
    <%@ page import = "java.util.ResourceBundle" %>
    <%@ page import = "com.sapportals.htmlb.*" %>
    <%@ page import = "com.sapportals.portal.prt.session.IUserContext" %>
    <%@ page import = "com.sapportals.portal.prt.component.*" %>
    <%@ page import = "com.sapportals.portal.prt.service.laf.*" %>
    <%@ page import = "com.sap.security.api.UMFactory" %>
    <%@ page import = "com.sapportals.portal.prt.service.license.ILicenseService"%>
    <%@ page import = "com.sapportals.portal.navigation.*" %>
    <%@ page import = "com.sapportals.portal.prt.runtime.PortalRuntime" %>
    <%@ page import = "com.sapportals.portal.prt.util.StringUtils" %>
    <%@ taglib uri="prt:taglib:tlhtmlb" prefix="hbj" %>
    <%!
    final String PERSONALIZE_PAGE_EVENT_URN = "urn:com.sapportals:navigation";
    final String PERSONALIZE_PAGE_EVENT_NAME = "PersonalizePage";
    final String PERSONALIZE_PAGE_EVENT_PARAMS = "";
    final String PERSONALIZE_PORTAL_EVENT_URN = "urn:com.sapportals:navigation";
    final String PERSONALIZE_PORTAL_EVENT_NAME = "PersonalizePortal";
    final String PERSONALIZE_PORTAL_EVENT_PARAMS = "";
    final String LOGOFF_CONFIRM_MSG_COMPONENT = "logoffConfirmMsg";
    final String LOGON_REDIRECT_COMPONENT = "logInComponent";
    final String LOGOFF_REDIRECT_COMPONENT = "LogOutComponent";
    final String LOGOFF_CONFIRM_MSG_ARGS_IE = "dialogHeight: 170px; dialogWidth: 350px; edge: Raised; center: Yes; help: No; resizable: No; status: No";
    final String LOGOFF_CONFIRM_MSG_ARGS_NS = "Height=170,Width=350";
    final String LOGOFF_CONFIRM_WINDOW_NAME = "LOG_OFF_WINDOW";
    final String HELP_URL = "HelpUrl";
    final String SITE_URL = "SiteUrl";
    final String HELP_WINDOW_NAME = "HELP_WINODW";
    final String SITE_WINDOW_NAME = "SITE_WINODW";
    final String SHOW_PERSONALIZE_LINK = "ShowPersonalizeLink";
    final String SHOW_HELP_LINK = "ShowHelpLink";
    final String SHOW_SITE_LINK = "ShowSiteLink";
    final String SHOW_NEW_WINDOW_LINK = "ShowNewWindowLink";
    final String SHOW_LOG_OFF_LOG_ON_LINK = "ShowLogInLogOffLink";
    //String constants for NLS
    final String WELCOME_CLAUSE = "WELCOME_CLAUSE";
    final String HELP_TEXT = "HELP_TEXT";
    final String SITE_TEXT = "SITE_TEXT";
    final String LOG_OFF_TEXT = "LOG_OFF_TEXT";
    final String LOG_ON_TEXT = "LOG_ON_TEXT";
    final String PERSONALIZE_TEXT = "PERSONALIZE_TEXT";
    final String PERSONALIZE_PORTAL_TEXT = "PERSONALIZE_PORTAL_TEXT";
    final String NEW_WINDOW_TEXT = "NEW_WINDOW_TEXT";
    final String HELP_TOOLTIP = "HELP_TOOLTIP";
    final String SITE_TOOLTIP = "SITE_TOOLTIP";
    final String LOG_OFF_TOOLTIP = "LOG_OFF_TOOLTIP";
    final String LOG_ON_TOOLTIP = "LOG_ON_TOOLTIP";
    final String PERSONALIZE_TOOLTIP = "PERSONALIZE_TEXT";
    final String PERSONALIZE_PORATL_TOOLTIP = "PERSONALIZE_PORATL_TOOLTIP";
    final String NEW_WINDOW_TOOLTIP = "NEW_WINDOW_TOOLTIP";
    final String BEGINNING_OF_PAGE = "BEGINNING_OF_PAGE";
    final String MASTHEAD_ENTER_TOOLTIP = "MASTHEAD_ENTER_TOOLTIP";
    final String MASTHEAD_EXIT_TOOLTIP = "MASTHEAD_EXIT_TOOLTIP";
    final String UNLOAD_MSG = "UNLOAD_MSG";
    private String GetWelcomeMsg(IPortalComponentRequest request, String welcomeClause)
    IUserContext userContext = request.getUser();
    if (userContext != null)
    String firstName = userContext.getFirstName();
    String lastName = userContext.getLastName();
    String salutation = userContext.getSalutation();
    if ((firstName != null) && (lastName != null))
    if(salutation != null)
    return java.text.MessageFormat.format(welcomeClause, new Object[] {firstName, lastName, salutation}).toString();
    else
    return java.text.MessageFormat.format(welcomeClause, new Object[] {firstName, lastName, " "}).toString();
    else
    return java.text.MessageFormat.format(welcomeClause, new Object[] {userContext.getDisplayName()," ", " "}).toString();
    return "";
    private String GetLicenseText(IPortalComponentRequest request){
    ILicenseService license = (ILicenseService)request.getService(ILicenseService.KEY);
    if (license.sapInternalUsageOnly())
    return "<FONT color=orangeRed size=4><STRONG> Licensed For SAP Internal Usage</STRONG></FONT>";
    else
    return " ";
    private boolean getParameter(IPortalComponentRequest request, String param)
    String value = (String)request.getNode().getValue(param);
    return new Boolean(value).booleanValue();
    private String getHelpUrl(IPortalComponentRequest request)
    String value = (String)request.getNode().getValue(HELP_URL);
    return value;
    private String getSiteUrl(IPortalComponentRequest request)
    String value = (String)request.getNode().getValue(SITE_URL);
    return value;
    private String GetLogoffConfirmMsgURL(IPortalComponentRequest request)
    String componentName = request.getComponentContext().getComponentName();
    componentName = componentName.substring(0, componentName.lastIndexOf(".") + 1);
    IPortalComponentURI msgURI = request.createPortalComponentURI();
    msgURI.setContextName(componentName + LOGOFF_CONFIRM_MSG_COMPONENT);
    return msgURI.toString();
    // Attaching the "UnsavedData=true" flag to the Confirm logoff message
    private String GetLogoffConfirmUnsavedMsgURL(IPortalComponentRequest request)
    String basicUrl = GetLogoffConfirmMsgURL(request);
    String separator = (basicUrl.indexOf("?") >=0) ? "&" : "?";
    return basicUrl + separator + "UnsavedData=true";
    private String GetLogoffURL(IPortalComponentRequest request)
    /*IPortalComponentURI logoffURI = request.createPortalComponentURI();
    return logoffURI.toString();*/
    String componentName = request.getComponentContext().getComponentName();
    componentName = componentName.substring(0, componentName.lastIndexOf(".") + 1);
    IPortalComponentURI msgURI = request.createPortalComponentURI();
    msgURI.setContextName(componentName + LOGOFF_REDIRECT_COMPONENT);
    return msgURI.toString();
    private boolean isAccessabilityOn(IPortalComponentRequest request)
    //End: Temporary, till there's a way to set the accessibility for a user
    IUserContext user = request.getUser();
    //if((user.getAccessibilityLevel() != IUserContext.DEFAULT_ACCESSIBILITY_LEVEL) ||(isAccessibility == true) ) // 508 is on
    if (user.getAccessibilityLevel() != IUserContext.DEFAULT_ACCESSIBILITY_LEVEL) // 508 is on
    return true;
    return false;
    private String GetLoginURL(IPortalComponentRequest request)
    INavigationGenerator navigationService = (INavigationGenerator)PortalRuntime.getRuntimeResources().getService(INavigationService.KEY);
    StringBuffer URL = new StringBuffer(200).append(navigationService.getPortalURL(request , null));
    return URL.append("/login").toString();
    private String GetPortalUrl(IPortalComponentRequest request)
    INavigationGenerator navigationService = (INavigationGenerator)PortalRuntime.getRuntimeResources().getService(INavigationService.KEY);
    return navigationService.getPortalURL(request , null);
    private String getNLSString(IPortalComponentRequest request, String resource_key)
    try
    ResourceBundle bundle = request.getResourceBundle();
    if(bundle != null)
    return bundle.getString(resource_key);
    return resource_key;
    catch(MissingResourceException e)
    return resource_key;
    private String GetThemeURLPath(IPortalComponentRequest request)
    ILAFService iLAFService = (ILAFService)request.getService(ILAFService.KEY);
    String currentTheme = iLAFService.getCurrentTheme(request).getThemeName();
    String url = iLAFService.getRelativeThemeRootURLPath(request, ILAFService.PORTAL_THEME) + "/" + currentTheme + "/prtl";
    return url;
    //Get the external logoff URL
    private String getExternalLogOffUrl()
    return UMFactory.getProperties().get("ume.logoff.redirect.url");
    //Get the external logoff Mode (silent / not silent)
    private boolean getExternalLogOffMode()
    return UMFactory.getProperties().getBoolean("ume.logoff.redirect.silent" , false);
    private boolean isAnonymous(IPortalComponentRequest request)
    NavigationEventsHelperService helperService = (NavigationEventsHelperService)
    PortalRuntime.getRuntimeResources().getService(NavigationEventsHelperService.KEY);
    return helperService.isAnonymousUser(request);
    %>
    <%
    boolean isPreview = false;
    // initializaing the labels with the localized labels
    String welcomeClauseStr = getNLSString(componentRequest, WELCOME_CLAUSE);
    String helpTextStr = getNLSString(componentRequest, HELP_TEXT);
    String siteTextStr = getNLSString(componentRequest, SITE_TEXT);
    String logOffTextStr = getNLSString(componentRequest, LOG_OFF_TEXT);
    String logInTextStr = getNLSString(componentRequest, LOG_ON_TEXT);
    String personalizeTextStr = getNLSString(componentRequest, PERSONALIZE_TEXT);
    String newWindowTextStr = getNLSString(componentRequest, NEW_WINDOW_TEXT);
    String helpTooltipStr = getNLSString(componentRequest, HELP_TOOLTIP);
    String siteTooltipStr = getNLSString(componentRequest, SITE_TOOLTIP);
    String logOffTooltipStr = getNLSString(componentRequest, LOG_OFF_TOOLTIP);
    String logInTooltipStr = getNLSString(componentRequest, LOG_ON_TOOLTIP);
    String personalizeTooltipStr = getNLSString(componentRequest, PERSONALIZE_TOOLTIP);
    String personalizePortalTooltipStr = getNLSString(componentRequest, PERSONALIZE_PORATL_TOOLTIP);
    String beginningOfPageStr = getNLSString(componentRequest, BEGINNING_OF_PAGE);
    String newWindowStr = getNLSString(componentRequest, NEW_WINDOW_TOOLTIP);
    String mastheadEnterTable = getNLSString(componentRequest, MASTHEAD_ENTER_TOOLTIP);
    String mastheadExitTable = getNLSString(componentRequest, MASTHEAD_EXIT_TOOLTIP);
    String unLoadMsg = getNLSString(componentRequest, UNLOAD_MSG);
    boolean showPersonalizeLink = getParameter(componentRequest, SHOW_PERSONALIZE_LINK);
    boolean showHelpLink = getParameter(componentRequest, SHOW_HELP_LINK);
    boolean showSiteLink = getParameter(componentRequest, SHOW_SITE_LINK);
    boolean showNewWindowLink = getParameter(componentRequest, SHOW_NEW_WINDOW_LINK);
    boolean ShowLogInLogOffLink = getParameter(componentRequest, SHOW_LOG_OFF_LOG_ON_LINK);
    String mode = (String)componentRequest.getNode().getValue("mode");
    if ((mode != null) && (mode.equals("preview")))
    isPreview = true;
    String themeRootURLPath = GetThemeURLPath(componentRequest);
    boolean isAnonymous = isAnonymous(componentRequest);
    boolean isAccessabilityOn = isAccessabilityOn(componentRequest);
    if (isAccessabilityOn)
    helpTooltipStr = helpTextStr", "helpTooltipStr;
    siteTooltipStr = siteTextStr", "siteTooltipStr;
    logOffTooltipStr = logOffTextStr", "logOffTooltipStr;
    logInTooltipStr = logInTextStr", "logInTooltipStr;
    newWindowStr = newWindowTextStr", "newWindowStr;
    personalizePortalTooltipStr = personalizeTextStr", "personalizePortalTooltipStr;
    %>
    <script>
    function openLogoffMsg()
    <%if (!isPreview){%>
    if (EPCM.getUAType() == EPCM.MSIE)
    releaseProducerSessions();
    if(EPCM.getGlobalDirty())
    // unsaved data on the page, display modified dialog
    var val = window.showModalDialog('<%=GetLogoffConfirmUnsavedMsgURL(componentRequest)%>', '', '<%=LOGOFF_CONFIRM_MSG_ARGS_IE%>');
    if (val == 'logoff')
    disableWorkProtectCheck = true;
    logoff();
    else //no unsaved data
    // data saved, nothing get lost on the page, display normal dialog
    var val = window.showModalDialog('<%=GetLogoffConfirmMsgURL(componentRequest)%>', '', '<%=LOGOFF_CONFIRM_MSG_ARGS_IE%>');
    if (val == 'logoff')
    logoff();
    else
    if(EPCM.getGlobalDirty())
    window.open('<%=GetLogoffConfirmUnsavedMsgURL(componentRequest)%>', '<%=LOGOFF_CONFIRM_WINDOW_NAME%>', '<%=LOGOFF_CONFIRM_MSG_ARGS_NS%>');
    else
    window.open('<%=GetLogoffConfirmMsgURL(componentRequest)%>', '<%=LOGOFF_CONFIRM_WINDOW_NAME%>', '<%=LOGOFF_CONFIRM_MSG_ARGS_NS%>');
    <%}%>
    var isLogoffFinalAllowed = true;
    var logoffStartTime = (new Date).getTime();
    function logoff()
    EPCM.raiseEvent("urn:com.sapportals.portal:user", "logoff", "");
    logoffStartTime = (new Date).getTime();
    window.setTimeout("logoffDelay()", "50");
    function logoffDelay()
    var isLogoffDelayElapsed = ((new Date).getTime() - logoffStartTime) > (60*1000);
    if(isLogoffFinalAllowed || isLogoffDelayElapsed) {
    logoffFinalCall();
    } else {
    window.setTimeout("logoffDelay()","50");
    function logoffFinalCall()
    logoffThirdParty();
    document.forms["logoffForm"].submit();
    function logIn()
    location.replace("<%=GetLoginURL(componentRequest)%>");
    function runPersonalizePage()
    EPCM.raiseEvent("<%=PERSONALIZE_PAGE_EVENT_URN%>", "<%=PERSONALIZE_PAGE_EVENT_NAME%>", "<%=PERSONALIZE_PAGE_EVENT_PARAMS%>");
    function runPersonalizePortal()
    <%if (!isPreview){%>
    EPCM.raiseEvent("<%=PERSONALIZE_PORTAL_EVENT_URN%>", "<%=PERSONALIZE_PORTAL_EVENT_NAME%>", "<%=PERSONALIZE_PORTAL_EVENT_PARAMS%>");
    <%}%>
    function onPersonalizePortalDisable()
    var linkElem = document.getElementById("personalizePortal");
    var linkSepElem = document.getElementById("personalizePortalSep");
    var linkLogoffSepElem = document.getElementById("logoffsep1");
    if(linkElem != null)
    linkElem.style.display = "none";
    if(linkSepElem != null)
    linkSepElem.style.display = "none";
    if(linkLogoffSepElem != null)
    linkLogoffSepElem.style.display = "none";
    EPCM.subscribeEvent("urn:com.sapportals:navigation", "PersonalizePortalDisable", onPersonalizePortalDisable);
    function openNewPortalWindow()
    <%if (!isPreview){%>
    var navTarget = EPCM.getSAPTop().gHistoryFrameworkObj.GetActiveTrackingEntryValue().URL;
    var context = EPCM.getSAPTop().gHistoryFrameworkObj.GetActiveTrackingEntryValue().context;
    if (context != null && context.length > 0)
    EPCM.doNavigate(navTarget, 2, null, null, null, null, context);
    else
    EPCM.doNavigate(navTarget, 2);
    <%}%>
    function openHelp()
    <%if (!isPreview){%>
    window.open('<%=getHelpUrl(componentRequest)%>', '<%=HELP_WINDOW_NAME%>');
    <%}%>
    function openSite()
    <%if (!isPreview){%>
    window.open('<%=getSiteUrl(componentRequest)%>', '<%=SITE_WINDOW_NAME%>');
    <%}%>
    function setFocusOnHeader() {
    var melcomeMessage = document.getElementById("welcome_message");
    var headerNotch = document.getElementById("header_notch");
    if(EPCM.getUAType()==EPCM.MOZILLA) {
    // No focus
    } else {
    if(melcomeMessage!=null && melcomeMessage.currentStyle.display!="none") {
    melcomeMessage.focus();
    } else if(headerNotch!=null && headerNotch.currentStyle.display!="none") {
    headerNotch.focus();
    function logoffThirdParty()
    <% if(getExternalLogOffUrl()!= null){ %>
    var logOffUrl = '<%=getExternalLogOffUrl()%>';
    var silent = <%=getExternalLogOffMode()%>;
    if(silent)
    var newIFrame = document.getElementById("externalLogOffIframe");
    if(newIFrame == null)
    newIFrame = document.createElement("IFRAME");
    newIFrame.style.visibility = "hidden";
    newIFrame.width=0;
    newIFrame.height=0;
    newIFrame.id = "externalLogOffIframe";
    newIFrame.src = logOffUrl;
    document.body.appendChild(newIFrame);
    else
    newIFrame.src = "javascript:void(0)";
    newIFrame.src = logOffUrl;
    <% } %>
    </script>
    <hbj:content id="PageContext">
    <hbj:page title="Header Area">
    <hbj:form id="HeaderForm" >
    <!--<a href="#" tabindex=0 title= "<%=beginningOfPageStr%>" accesskey="m">
    <img src="<%=themeRootURLPath%>/../common/1x1.gif" border="0" style="display:none">
    </a>-->
    <% if (isAccessabilityOn)
    {%>
    <TABLE width="100%" border="0" id="myTable" ti="0" tabindex="0" title="<%=mastheadEnterTable%>" onkeydown="nav_skip('myTable',event)" ct="PortalMasthead" cellspacing="0" cellpadding="0" ><% if (isPreview) {%>ondragover="window.event.cancelBubble = true;" ondragleave="window.event.cancelBubble = true;"<%}%>>
    <%} else
    {%>
    <TABLE width="100%" border="0" cellspacing="0" cellpadding="0" class="prtlHdrWhl" id="myTable" ti="0" tabindex="0" onkeydown="nav_skip('myTable',event)" ><% if (isPreview) {%>ondragover="window.event.cancelBubble = true;" ondragleave="window.event.cancelBubble = true;"<%}%>>
    <%}%>
    <tbody>
    <TR>
    <TD width="1%" nowrap class="prtlHeaderNotch" id="header_notch"> </TD>
          <TD width="5%" nowrap class="prtlHdrWelcome" id="welcome_message" ti="0" tabIndex="0"><%=StringUtils.escapeToHTML(GetWelcomeMsg(componentRequest, welcomeClauseStr))%></TD>
    <TD width="3%" nowrap class="prtlHdrWelcome" id="welcome_message" ti="1" tabIndex="1">
    <SCRIPT LANGUAGE="JavaScript">
    var months=new Array(13);
    months[1]="January";
    months[2]="February";
    months[3]="March";
    months[4]="April";
    months[5]="May";
    months[6]="June";
    months[7]="July";
    months[8]="August";
    months[9]="September";
    months[10]="October";
    months[11]="November";
    months[12]="December";
    var time=new Date();
    var lmonth=months[time.getMonth() + 1];
    var date=time.getDate();
    var year=time.getYear();
    if ((navigator.appName == "Microsoft Internet Explorer") && (year < 2000))
    year="19" + year;
    if (navigator.appName == "Netscape")
    year=1900 + year;
    document.write("<center>" + lmonth + " ");
    document.write(date + ", " + year + "</center>");
    </SCRIPT>
    </TD>
    <% if (showSiteLink || showHelpLink || showPersonalizeLink || showNewWindowLink || ShowLogInLogOffLink)
    {%>
    <TD width="79%" class="prtlHeaderFunctionsTable">
    <TABLE border="0" cellspacing="0" cellpadding="0"
    class="prtlHeaderFunctionsContainer" height="100%">
    <TR>
    <TD nowrap >
    <!--<hbj:link id="SiteLink" tooltip="<%=siteTooltipStr%>" linkDesign="FUNCTION" reference="javascript:openSite();"><hbj:textView nested="true" text="<%=siteTextStr%>"/></hbj:link> -->
    <hbj:link id="SiteLink" tooltip="<%=siteTooltipStr%>"
    linkDesign="FUNCTION" reference="#">
    <% if (!isPreview) { SiteLink.setOnClientClick("javascript:openSite();");} %>
    <hbj:textView nested="true" text="<%=siteTextStr%>"/>
    </hbj:link>
    </TD>
                <TD nowrap>
                  <%}%>
    <%
    if (showHelpLink)
    { %>
    <TD nowrap >
    <!--<hbj:link id="HelpLink" tooltip="<%=helpTooltipStr%>" linkDesign="FUNCTION" reference="javascript:openHelp();"><hbj:textView nested="true" text="<%=helpTextStr%>"/></hbj:link> -->
    <hbj:link id="HelpLink" tooltip="<%=helpTooltipStr%>"
    linkDesign="FUNCTION" reference="#">
    <% if (!isPreview) { HelpLink.setOnClientClick("javascript:openHelp();");} %>
    <hbj:textView nested="true" text="<%=helpTextStr%>"/>
    </hbj:link>
    </TD>
                <TD nowrap>
                  <%}%>
                  <%
    if (!isAnonymous)
    if (showPersonalizeLink)
    if (showHelpLink)
    { %>
                <TD nowrap id="personalizePortalSep" class="prtlHdrSep"></TD>
    <%} %>
    <TD nowrap id="personalizePortal">
    <hbj:link id="PersonalizeLink"
    tooltip="<%=personalizePortalTooltipStr%>"
    linkDesign="FUNCTION"
    reference="#">
    <% if (!isPreview) {PersonalizeLink.setOnClientClick("javascript:runPersonalizePortal();");}%>
    <hbj:textView nested="true" text="<%=personalizeTextStr%>"/>
    </hbj:link>
    </TD>
    <TD nowrap></TD>
    <%}
    if (showNewWindowLink)
    if (showHelpLink || showPersonalizeLink)
    { %>
    <TD nowrap id="newWindowSep" class="prtlHdrSep"> </TD>
    <%}
    else
    {%>
    <TD nowrap> </TD>
    <%}%>
    <TD nowrap id="newWindow">
    <hbj:link id="newWindowLink" tooltip="<%=newWindowStr%>"
    linkDesign="FUNCTION"
    reference="#">
    <% if (!isPreview) {newWindowLink.setOnClientClick("javascript:openNewPortalWindow();");}%>
    <hbj:textView nested="true" text="<%=newWindowTextStr%>"/>
    </hbj:link>
    </TD>
    <%}%>
    <%}%>
    <TD>
    <%if (ShowLogInLogOffLink)
    {%>
    <TABLE cellspacing="0" cellpadding="0" border="0" class="prtlHeaderFunctionsContainer" height="100%">
    <TR><%
    if (showHelpLink || showPersonalizeLink || showNewWindowLink)
    {%>
    <%
    if(!showHelpLink && !showNewWindowLink)
    {%>
    <TD nowrap id="logoffsep1" class="prtlHdrSep"> </TD>
    <%
    }else
    {%>
    <TD nowrap id="logoffsep2" class="prtlHdrSep"> </TD>
    <%}%>
                      <TD nowrap>
                        <%
    }else
    {%>
                      <TD nowrap >  </TD>
    <%
    if (isAnonymous)
    {%>
                      <TD nowrap>
                        <!<hbj:link id="LoginLink" tooltip="<%=logInTooltipStr%>" linkDesign="FUNCTION" reference="javascript:logIn();"><hbj:textView nested="true" text="<%=logInTextStr%>"/></hbj:link>>
                        <hbj:link id="LoginLink"
    tooltip="<%=logInTooltipStr%>"
    linkDesign="FUNCTION"
    reference="#">
                        <% LoginLink.setOnClientClick("javascript:logIn();"); %>
                        <hbj:textView nested="true" text="<%=logInTextStr%>"/> </hbj:link>
                      </TD>
    <%}
    else
    {%>
                      <TD nowrap>
                        <!<hbj:link id="LogoffLink" tooltip="<%=logOffTooltipStr%>" linkDesign="FUNCTION" reference="javascript:openLogoffMsg();"><hbj:textView nested="true" text="<%=logOffTextStr%>"/></hbj:link>>
                        <hbj:link id="LogoffLink"
    tooltip="<%=logOffTooltipStr%>"
    linkDesign="FUNCTION"
    reference="#">
                        <%if (!isPreview) { LogoffLink.setOnClientClick("javascript:openLogoffMsg();");} %>
                        <hbj:textView nested="true" text="<%=logOffTextStr%>"/> </hbj:link>
                      </TD>
    <%}%>
    </TR>
    </TABLE>
    <%} %>
    </TD>
    </TR>
    </TABLE>
    </TD>
    <%}%>
          <TD width="12%" nowrap class="prtlHdrLogoContainer">
            <% if (isAccessabilityOn)
    {%>
            <%}%>
          </TD>
    </TR>
    </tbody>
    </TABLE>
    </hbj:form>
    </hbj:page>
    </hbj:content>
    <form name="logoffForm" style="display:none;position:absolute;top:-5000;left:-5000" action="<%=GetLogoffURL(componentRequest)%>" method="POST">
      <input type="hidden" name="logout_submit" value="true">
    </form>
    <script>
    <% if (!isPreview) {%>
    if (disablePersonalize) {
    EPCM.raiseEvent("urn:com.sapportals:navigation", "PersonalizePortalDisable", "");
    <%}%>
    setFocusOnHeader();
    EPCM.subscribeEvent("urn:com.sapportals.portal:browser","load",setFocusOnHeader);
    </script>

Maybe you are looking for

  • How to Make Letterbox

    I have a Canon GL1 camera that records in SD 4:3 format. When I make a DVD my DVD player coupled with my 16:9 HDTV stretches the video to fill the screen and distorts everyone (they look broader). I think a letterbox format would present a more norma

  • Issue with Contract Replication from SRM to MDM  - XML structure

    Hi We are having an issue with trnsfering a contract to MDM. We have released the contract for update to MDM in the contract through the distribute to catalog option. An XML is generated in SRM that gets sucessfully passed to PI through Catalogupdate

  • How do you change Site/Root Folder?

    How do you change Site/Root Folder? I have looked for ages, but i can't find how to change the root folder, it keeps trying to put everything in my first websites folder. Please Help.

  • Photoshop CS5 crashes with wierd report

    Hi all, My pc is: i7 3770 ASUS Mother board 16 RAM (8x2 Kingston) 1600 Intel SSD 120 GB 520 NVIDIA Quadro 2000D (1GB DDR5) Win 7 64Bit (Updated) I am running Photoshop CS5 32 Bit and Premiere CS6 64 Bit They both crash couple times a day with the sam

  • To get unicode errors for each and every program

    hi,      I have written a program to retrieve all the custom programs and user exits. Now I want to pass all these programs to UCCHECK tcode to get all the errors of each program separately by writing it implicitely.      Is there any function module