Tuesday, February 17, 2009

Cross browser pop up opener and select options for a Text box

Main.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!--
    function searchPopUp(idfield,nameField){
        document.getElementById('localIdfield').value = idfield;
        document.getElementById('localNameField').value  = nameField;
        window.open("popUp.html","Ratting", "width=550,height=170,left=150,top=200,toolbar=1,status=1,");
    }
//-->
</SCRIPT>
</HEAD>
<BODY>
<form method=post action='' name=f1>
    <INPUT TYPE="hidden" NAME="localIdfield" id="localIdfield">
    <INPUT TYPE="hidden" NAME="localNameField" id="localNameField">
    <table border=0 cellpadding=0 cellspacing=0 width=550>
    <tr>
        <td >
            <font size=2 face='Verdana'>Program Manager</font>
            <input type="text" disabled="true" name="programManagerContactId" id="programManagerContactId"  size='8'>
            <input type="hidden" name="programManagerName" id="programManagerName" size='8'>
            <a href="javascript:void(0);" NAME="My Window Name" title=" My title here " onClick="javascript:searchPopUp('programManagerContactId','programManagerName');">Search Program Manager</a>
        </td>
    </tr>
    <tr>
        <td >
            <font size=2 face='Verdana'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Auditor</font>
            <input type="text" disabled="true"  name="auditorContactId" id="auditorContactId" size='8'>
            <input type="hidden" name="auditorName" id="auditorName" size='8'>
            <a href="javascript:void(0);" NAME="My Window Name" title=" My title here " onClick="javascript:searchPopUp('auditorContactId','auditorName');">Search Auditor</a>
        </td>
    </tr>
</table>
</form>
</BODY>
</HTML>

popUp.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>

<script langauge="javascript">
    function return_values(local_id, local_name){
        var parentIdField = opener.document.getElementById('localIdfield').value;
        var parentNameField = opener.document.getElementById('localNameField').value;

        opener.document.getElementById(parentIdField).value = document.getElementById(local_id).value;
        opener.document.getElementById(parentNameField).value =document.getElementById(local_name).value;
        self.close();
    }
</script>

<title>(Type a title for your page here)</title>
</head>

<body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000">

<form name="frm" method=post action=''>
    <table border=0 cellpadding=0 cellspacing=0 width=250>
        <tr>
            <td align="center">
                Id to be set<input type="text" name="local_id" id="local_id" size="12">
            </td>
        </tr>
        <tr>
            <td align="center">
                Name to be set<input type="text" name="local_name" id="local_name" size="12">
            </td>
        </tr>
    </td></tr>
    </table>
    <input type=button value='Submit' onclick="return_values('local_id','local_name');">
</form>
</html>

Tuesday, February 10, 2009

Dot Net Installer download direct links

Ref from : http://www.msfn.org/board/lofiversion/index.php/t122149.html

.NET Frameworks 1.1, 1.1SP1, 2SP1 are full downloads

.NET Framework 3 and 3.5 from the general MSDN and windows update site are bootstrappers (installs, checks config, and then downloads what's needed).

Microsoft Dot Net Framework 3.0 Bootstrapper 2.8 MB
CODE
http://www.microsoft.com/downloads/details.aspx?familyid=10CC340B-F857-4A14-83F5-25634C3BF043&displaylang=en


Microsoft Dot Net Framework 3.0 SP1 is a full download

Microsoft Dot Net Framework 3.0 Redistributable 50.3 MB - Direct Link
CODE
http://go.microsoft.com/fwlink/?LinkId=70848

Microsoft Dot Net Framework 3.5 Bootstrapper 2.7 MB
CODE
http://www.microsoft.com/downloads/details.aspx?familyid=333325FD-AE52-4E35-B531-508D977D32A6&displaylang=en

Microsoft Dot Net Framework 3.5 Redistributable 33.3 MB
CODE
http://www.microsoft.com/downloads/details.aspx?FamilyID=e3821449-3c6b-42f1-9fd9-0041345b3385&DisplayLang=en


Microsoft Dot Net Framework 3.5 Full Package 197 MB Direct Link
CODE
http://download.microsoft.com/download/6/0/f/60fc5854-3cb8-4892-b6db-bd4f42510f28/dotnetfx35.exe

It's the last one - the 197 MB file that looks to contain all preceding Dot NET versions... It also looks like it contains the x64 architecture files as well - I'm just not too sure???



Tuesday, February 3, 2009

Spring Mail and Gmail SMTP server

Spring Mail and Gmail SMTP server

February 1, 2008 at 9:04 pm · Filed under open source, spring

In case you need to use Spring Mail with Gmail SMTP server, first of all configure a mail sender bean:

<!-- Mail Sender -->
<bean
id= "mailSender" class= "org.springframework.mail.javamail.JavaMailSenderImpl" >
  <property
name= "host" value= "${mail.host}" />
  <property
name= "port" value= "${mail.port}" />
  <property
name= "username" value= "${mail.username}" />
  <property
name= "password" value= "${mail.password}" />
  <property
name= "protocol" value= "${mail.protocol}" />
  <property
name= "javaMailProperties" >
    <props>
      <prop
key= "mail.smtps.auth" >true</prop>
      <prop
key= "mail.smtps.starttls.enable" >true</prop>
      <prop
key= "mail.smtps.debug" >true</prop>
    </props>
  </property>
</bean>

We could take to a property file the relevant properties:

mail.
host = smtp. googlemail . com
mail.
port = 465
mail.
username = yourUsername
mail.
password = yourPassword
mail.
protocol = smtps

Let’s see an integrational test for this:

public class SimpleMailSenderTest extends AbstractDependencyInjectionSpringContextTests {
  
protected MailSender mailSender ;
  
public SimpleMailSenderTest () {
    setPopulateProtectedVariables
( true );
  
}
  @
Override
  
protected String [] getConfigLocations () {
    
return new String [] { ”applicationContext. xml };
  
}
  
public void testSendEmail () throws Exception {
    SimpleMailMessage simpleMessage =
new SimpleMailMessage ();
    simpleMessage.
setFrom ( ”fromEmail” );
    simpleMessage.
setTo ( ”toEmail” );
    simpleMessage.
setText ( ”Testing text” );
    simpleMessage.
setSubject ( ”Testing subject” );
    mailSender.
send ( simpleMessage );
  
}
}

In case we have a template for sending these emails we could define a template message bean:

<bean
id= "templateMessage" class= "org.springframework.mail.SimpleMailMessage" >
  <property
name= "from" value= "fromAddress" />
  <property
name= "to" value= "toAddress" />
</bean>

Alternatively, we could also specify replyTo, cc, bcc, sentDate, subject and text.



Spring Mail and Gmail SMTP server

Spring Mail and Gmail SMTP server

February 1, 2008 at 9:04 pm · Filed under open source, spring

In case you need to use Spring Mail with Gmail SMTP server, first of all configure a mail sender bean:

<!-- Mail Sender -->
<bean
id= "mailSender" class= "org.springframework.mail.javamail.JavaMailSenderImpl" >
  <property
name= "host" value= "${mail.host}" />
  <property
name= "port" value= "${mail.port}" />
  <property
name= "username" value= "${mail.username}" />
  <property
name= "password" value= "${mail.password}" />
  <property
name= "protocol" value= "${mail.protocol}" />
  <property
name= "javaMailProperties" >
    <props>
      <prop
key= "mail.smtps.auth" >true</prop>
      <prop
key= "mail.smtps.starttls.enable" >true</prop>
      <prop
key= "mail.smtps.debug" >true</prop>
    </props>
  </property>
</bean>

We could take to a property file the relevant properties:

mail.
host = smtp. googlemail . com
mail.
port = 465
mail.
username = yourUsername
mail.
password = yourPassword
mail.
protocol = smtps

Let’s see an integrational test for this:

public class SimpleMailSenderTest extends AbstractDependencyInjectionSpringContextTests {
  
protected MailSender mailSender ;
  
public SimpleMailSenderTest () {
    setPopulateProtectedVariables
( true );
  
}
  @
Override
  
protected String [] getConfigLocations () {
    
return new String [] { ”applicationContext. xml };
  
}
  
public void testSendEmail () throws Exception {
    SimpleMailMessage simpleMessage =
new SimpleMailMessage ();
    simpleMessage.
setFrom ( ”fromEmail” );
    simpleMessage.
setTo ( ”toEmail” );
    simpleMessage.
setText ( ”Testing text” );
    simpleMessage.
setSubject ( ”Testing subject” );
    mailSender.
send ( simpleMessage );
  
}
}

In case we have a template for sending these emails we could define a template message bean:

<bean
id= "templateMessage" class= "org.springframework.mail.SimpleMailMessage" >
  <property
name= "from" value= "fromAddress" />
  <property
name= "to" value= "toAddress" />
</bean>

Alternatively, we could also specify replyTo, cc, bcc, sentDate, subject and text.