Live Cricket Scores in SharePoint Site

Cricinfo.com site provides RSS feeds of live cricket scores. This can be accessed from the URL http://www.cricinfo.com/rss/livescores.xml. Using this feed and Sharepoint designer live cricket scores can be displayed in Sharepoint sites within a jiffy. For using the RSS feed we will have to create a data source. Following are the steps to create a data sources to the live scores RSS feed

1. Fire up Sharepoint designer.
2. Open the page in which you want to place the cricket scores.
3. Open the Data Source Library pane by selecting Data Source Library menu under Task Panes menu.
4. Expand the Server-side Scripts section.
5. Click on Connect to a script or RSS Feed link.
6. Paste the URL http://www.cricinfo.com/rss/livescores.xml in the Enter URL to a server-side script text box.
7. Click the OK button.

Once a data source is created, it can be bound to a data view web part as explained in below steps

1. Drag and drop the new RSS Feed data source into the page.
2. Click the Common Data View Tasks arrow button and select Edit Columns.
3. Remove all columns except the title.
4. In the page select one of the values of the title field.
5. Click on Common xsl:value-of Tasks arrow button.
6. For the Format as the dropdown, change it from Text to Hyperlink.
7. Click Yes to the confirmation dialog.
8. In the Edit Hyperlink dialog box enter {link} in Address field and {title} in Text to display field
9. Click the OK button.
10. Change the heading from title to Cricinfo live scores

Cheers 

Add Flash File to SharePoint Rich Text Field Editor

SharePoint Rich-Text filed editor allows us to write the HTML code, but it doesn’t allow us to embed Flash files.

So, I have searched on this issue and come with a solution.  For that, I’m using swfobject.js file and adding some script lines to the page where we want to embed this flash file. Following are the procedures used to embed Flash file into SharePoint

Step 1: Upload the swfobject.js file to SharePoint library

Step 2: Include the JavaScript file to the SharePoint page,

<script type=”text/javascript” src=”swfobject.js”></script>

Step 3: Add the following javascript lines at the end of the page, before the end of the <asp:content>,
<script type=”text/javascript”>
function EmbedFlash()
{
    //Get the div tag from the file
    var divLayer = document.getElementsByTagName(‘div’);
    //Check the div tag’s classname equal to flashcontent
    if (divLayer.length>0)
    {
        var myFlash = new Array()
        for (i=0; i<divLayer.length; i++)
        {        
            if (divLayer[i].className == ‘flashcontent’)
            {
                myFlash.push(divLayer[i].id)
            }
        }
        var so = new Array()
        for (j=0; j<myFlash.length; j++)
        {
        //split the div tag based on ::
            tempParam = myFlash[j].split(‘::’)
        //Following method used to display the flash file, swfobject.embedSWF([URL],[div Id],[Height], [Width], [Flash Version], [Background Colour], [Alternative flash or image]);
            swfobject.embedSWF(tempParam[0], tempParam[1], tempParam[2], tempParam[3], tempParam[4], tempParam[5],”expressInstall.swf”);
        }
    }
}
EmbedFlash()
</script>

EmbedFlash method gets all the div elements in current page and filters those elements based on classname=’flashcontent’. If div’s calssname is flashcontent, then it split the id of the div tag based on ::  and it call the embedSWF method from swfobject.js to embed the flash file.

Step 4: This is the main step, including the tags to sharepoint Rich-Text Field editor. Add Two div tags in editor as follows,
<div id=”video1″ />

<div class=”flashcontent” id=”flash_video.swf::video1::425::355::9::#FFFFFF”></div>

 

First div tag used to display the image and other div tag used to give the information to javascript about the flash file.
Div tag is in format as follows,

 id=”[Flash URL]::[div id]::[Height]::[Width]::[FlashVersion]::[Background Colour]

Step 5: After publishing the page, it dispalys the flash conetnt.
Shantha Kumar .T

Smoke Testing Vs Sanity Testing

Smoke Test:

When a build is received, a smoke test is run to ascertain if the build is stable and it can be considered for further testing.

Smoke testing can be done for testing the stability of any interim build.

Smoke testing can be executed for platform qualification tests.

Sanity testing:

Once a new build is obtained with minor revisions, instead of doing a thorough regression, a sanity is performed so as to ascertain the build has indeed rectified the issues and no further issue has been introduced by the fixes.  Its generally a subset of regression testing and a group of test cases are executed that are related with the changes made to the app.

Generally, when multiple cycles of testing are executed, sanity testing may be done during the later cycles after through regression cycles.

 

 

Smoke

Sanity


1

Smoke testing originated in the hardware testing practice of turning on a new piece of hardware for the first time and considering it a success if it does not catch fire and smoke.  In the software industry, smoke testing is a shallow and wide approach whereby all areas of the application without getting into too deep, is tested.

A sanity test is a narrow regression test that focuses on one or a few areas of functionality. Sanity testing is usually narrow and deep.

2

A Smoke test is designed to touch every part of the application in a cursory way. It’s is shallow and wide.

A Sanity test is used to determine a small section of the application is still working after a minor change.

3

Smoke testing will be conducted to ensure whether the most crucial functions of a program work, but not bothering with finer details. (Such as build verification).

Sanity testing is a cursory testing; it is performed whenever a cursory testing is sufficient to prove the application is functioning according to specifications. This level of testing is a subset of regression testing.

4

Smoke testing is normal health check up to a build of an application before taking it to test in depth.

 

sanity testing is to verify whether requirements are met or not,

checking all features breadth-first.

 

Cheers,

Javed Nehal

Enabling Email Functionality in the Team System Web Access (TSWA)

By default, the email functionality in Team System Web Access (TSWA) is disabled and users will receive the following message when trying to use it:

“Sending email is not enabled. Please contact your administrator.”

Email Functionality

To enable you to need to change TSWA’s web.config file, which can be found following path: \Program Files\Microsoft Visual Studio 2005/2008 Team System Web Access\Web.

  • Change the setting “sendingEmailEnabled” to true.
  • And specify your SMTP server name under “host”.

 <emailSettingssendingEmailEnabled=”true”enableSsl=”false” />

     <jscriptConfig>
      <addname=”showBrowserToolbar”value=”true”/>
    jscriptConfig>
 webAccessSettings>
 <system.net>
    <mailSettings>
      <smtpdeliveryMethod=”network”from=”[email protected]”>
       
        <networkhost=”192.168.1.12″port=”25″defaultCredentials=”true” />

Optionally you can specify which account to use when authenticating with the SMTP server and if SSL should be enabled as well as the default email address for the sender.

Where can you use the email functionality?

 You can send… 
  • single work items (from the work item form)
  • multiple work items, i.e. the result of a work item query

The email function can be found in the “Tools” menu.

Email Functionality 01

The “Send Email” window allows you to specify the sender’s (“From”) and receiver’s (“To”) email address, as well as subject and message.

Email Functionality 02

After hitting send a message box confirms that the mail was successfully routed to the email server.

Mail Delivery Failed

This is how the receiver will see the message if it’s about a single work item:
Mail Error
Configure SMTP Server and E-mail Notification Settings in the Services Web.Config File

You can configure Team Foundation Server to use an existing SMTP server to send e-mail alerts. Users can configure alerts for various projects, work item, and build event notifications. Although you can specify the SMTP server during Team Foundation Server installation, you might want to change the STMP server later. Similarly, if you to change the application pool service account by using the TFSAdminUtil ChangeAccount command, you must manually change the sender account e-mail address to the new service account’s e-mail address.

Note

The content of Team Foundation Server alert e-mails is not customizable. The content of the e-mails is automatically generated from the TeamFoundation.xsl file. Modifying this file is not recommended. If you do modify the contents of this file, be sure to thoroughly test your modifications. Incorrect modifications of this file can result in the failure of Team Foundation Server e-mail alerts and the inability to view Team Foundation work items, changesets, or files in a Web browser.

Required Permissions

To perform this procedure, you must be a member of the Administrators group on the Team Foundation application-tier server. For more information, see Team Foundation Server Permissions.

Note

Don’t use the ASP.Net tab of the IIS Manager (inetmgr) to edit a configuration file. If you use this tab, an attribute is added to the configuration element of the configuration file. This attribute interferes with normal functioning

To designate or change the SMTP server for sending e-mail alerts
  1. On the application-tier server for Team Foundation, locate the installation directory for the application tier.
  2. Open the Web Services directory, and then open the Services subdirectory.
  3. In a text or XML editor, open the Web.Config file, and locate the element.
  4. Update the element by typing the fully qualified domain name of the SMTP server. For example, type the following string:
  5. Save and close the Web.Config file.
You must close and restart the Web services application for Team Foundation before your changes will take effect.

To designate or change the sender e-mail address for e-mail alerts

  1. On the application-tier server for Team Foundation, locate the installation directory for the application tier.
  2. Open the Web Services directory, and then open the Services subdirectory.
  3. In a text or XML editor, open the Web.Config file, and locate the element.
  4. Update the element by typing the e-mail address that is associated with the service account (for example,Domain/TFSService). That is used for the application pool identity for Team Foundation. For example, type the following string:
  5. Save and close the file.

You must close and restart the Web services application for Team Foundation before your changes will take effect.

 

Custom Document Property as Page Title

When a new webpart page is added to a SharePoint document library the title of the page appears as Library Name – Page Name. For instance, if the document library name is WebPages and the page name is Page1 the title would appear as WebPages – Page1. This is the title that would be displayed on the title bar of the browser, but more importantly, this will be the text displayed by search engines.

In order to give a more meaningful title for the webpart pages we will have to open the page in SharePoint designer and replace the content of ContentPlaceHolder with the id PlaceHolderPageTitle. Below is the default content of PlaceHolderPageTitle

<asp:Content ContentPlaceHolderId=”PlaceHolderPageTitle” runat=”server”>

                <SharePoint:ListProperty Property=”Title” runat=”server”/> –

                <SharePoint:ListItemProperty Property=”BaseName” MaxLength=40 runat=”server”/>

</asp:Content>

You can give a meaningful title by replacing the content as something below

<asp:Content ContentPlaceHolderId=”PlaceHolderPageTitle” runat=”server”>

                MyWebsite ::: A meaningful title

</asp:Content>

A more neat approach would be to add a custom field to the document library and use that field information for the title. For instance, if we a add text field by the name of WebPageTitle to the document library we can use it as the title as shown below

<asp:Content ContentPlaceHolderId=”PlaceHolderPageTitle” runat=”server”>

<SharePoint:ListItemProperty Property=”WebPageTitle” MaxLength=40 runat=”server”/>

</asp:Content>

Cheers JJ

Including Custom JavaScript Files & Adding Events on Fly in MSCRM 3.0

Including custom JavaScript files in MSCRM 3.0
While working with MS CRM, you will find a lot of client-side coding in JavaScript. MS CRM has exposed onLoad, onSave & onChanged event. Once you add javascript, you could save the form followed by publishing it. The whole process is time-consuming and again publishing entity calls for resetting IIS, which it may not be permissible.
 In a development scenario, we always use common methods, which are placed in common files. In most programming languages, there is a concept of “INCLUDE files”. Includes files are referenced at the start of your program & Interpreter or the Compiler will add that to your program.
I.e. Includes files are easy to maintain /modify.
How can we use it in MS CRM?
Say we need to calculate total amount in the below example, i.e. Add Freight amt and Total Tax.
Total Tax
Create the .js file:
Open Notepad and copy the following Javascript into it
function CalculateTotal()
{
    crmForm.all.TotalAmout.DataValue =  crmForm.all.TotalTax.DataValue  + crmForm.all.FreightAmount.DataValue  
}
Save this file as CommonFunction.js and place it in a directory below your MSCRM web directory called myscripts.
Reference your .js file:
In the OnLoad event of your Form, include the following code:
var script = document.createElement(’script’);
script.language = ‘javascript’;
script.src = ‘/myscripts/CommonFunction.js’;
document.getElementsByTagName(’head’)[0].appendChild(script);
Now you can call CalculateTotal () wherever you want;
Using Included Functions in the Form OnLoad Event:
It is possible to run into a timing issue because the include file has not yet finished appending to the CRM Form. This is really only a problem if you need to access a function from your include file from within the OnLoad event. 
To work around with this issue, we need to wait for the script’s state to change to “loaded” before any functions in the include file can be accessed:??
var script = document.createElement(’script’);
script.language = ‘javascript’;
script.src = ‘/myscripts/CommonFunction.js’;
document.getElementsByTagName(’head’)[0].appendChild(script);
var f = function()
{
if (event.srcElement.readyState == “loaded”)
CalculateTotal() // some function from MyFunctions.js
}
script.attachEvent(”onreadystatechange”, f);
 Points To Ponder:
This solution will not work if you have the CRM 3.0 Outlook Laptop Client deployed. This is because the Laptop client utilizes a local Web server and if physically disconnected from the main CRM web server, the JavaScript file will be unavailable and a script error on the page will result.
Few more javascript.
Adding events on the fly.
 
In Javascript, there are quite a few events for each field. Unfortunately, MS CRM only exposed onchange event of a field.
No problem with few lines of code you can attached event on the fly. The only place where you can add your code is onLoad() event of the entity and here is the way to do it:
crmForm.all.fieldname.eventname = function() {
//event handling code goes here
}
A commonly used event is onclick. Surpisingly it fires whenever you click the field:
crmForm.all.fieldname.onclick = function() {
alert(“fieldname clicked!”);
}
Accordingly, we can use more events as we require.