Sorry for the delay as i did postings months back as I m busy with my schedule in release of the project.
later with my sister marriage and next moving to Redmond.
Here are my pics in Redmond. :)
Soon Ill post some cool stuff in sharepoint.
About Me
I am a Software Engineer presently working in Microsoft as vendor.The main aim of this blog is to Share my knowledge in Sharepoint,AZURE and Silverlight.
Monday, 8 December 2008
Thursday, 28 August 2008
Getting new Tab instead of Development for our Custom Site Definition.
Hi ,
we have a custom site definition and one of the requirement is user should be able to see a seperate Tab for our Project rather than displaying the template under Development. for this we have 2 options.
1)if we are generating a sitedefintion using sharepoint solution Generator then open the solution and right click on project properties and select the “SharePoint Solution” tab.
Expand the Solution->Sitedefintion->Manifest.
give the Appropriate value in the Display Category as I gave “Sasi”.
2)if the solution is already deployed and you want to change then follow the steps.
Go to the folder in the SharePoint server:
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\1033\XML
Open the xml webtemp file of ur definition.
You will see the following xml :
<-Templates xmlns:ows="Microsoft SharePoint">
<-Template Name="ABC_Site_Definition_11eec25f-6951-462a-a8e5-63d5ae20211e" ID="10000" >
<-Configuration ID="1" Title="ABC_Site_Definition" Description="" Hidden="False" ImageUrl="/_layouts/images/stsprev.png" DisplayCategory="ABC" />
<-/Template>
<-/Templates>
(Remove '-' in the tags)
Change the display category to your project name. This gives the tab as per your requirement.
Hidden=”True” Solves the other requirement it hides the other sitedefinitions which you not required.
So the Output u see as below.
Cheers give a try.
we have a custom site definition and one of the requirement is user should be able to see a seperate Tab for our Project rather than displaying the template under Development. for this we have 2 options.
1)if we are generating a sitedefintion using sharepoint solution Generator then open the solution and right click on project properties and select the “SharePoint Solution” tab.
Expand the Solution->Sitedefintion->Manifest.
give the Appropriate value in the Display Category as I gave “Sasi”.
2)if the solution is already deployed and you want to change then follow the steps.
Go to the folder in the SharePoint server:
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\1033\XML
Open the xml webtemp file of ur definition.
You will see the following xml :
<-Templates xmlns:ows="Microsoft SharePoint">
<-Template Name="ABC_Site_Definition_11eec25f-6951-462a-a8e5-63d5ae20211e" ID="10000" >
<-Configuration ID="1" Title="ABC_Site_Definition" Description="" Hidden="False" ImageUrl="/_layouts/images/stsprev.png" DisplayCategory="ABC" />
<-/Template>
<-/Templates>
(Remove '-' in the tags)
Change the display category to your project name. This gives the tab as per your requirement.
Hidden=”True” Solves the other requirement it hides the other sitedefinitions which you not required.
So the Output u see as below.
Cheers give a try.
Sunday, 27 July 2008
Sending Mail in Sharepoint using code.
we should include the following namespace
for this Add reference of Microsoft.Sharepoint in references.
using Microsoft.SharePoint.Utilities;
Get the header information which contains To,Subject,CC...
System.Collections.Specialized.StringDictionary headers = new System.Collections.Specialized.StringDictionary();
headers["To"] = v-sasikp@microsoft.com;
headers["Subject"] = "This is test mail";
finally,
SPUtility.SendEmail(myweb, headers, emailMsg, false);
But this requires configuration of email server in central administration.
Simple Ex:
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Utilities;
namespace blogmail
{
class Program
{
static void Main(string[] args)
{
SPSite Site = new SPSite("http://sasikp-v:4008/");
SPWeb myweb = Site.OpenWeb();
SPUtility.SendEmail(myweb, false, false,"v-sasikp@microsoft.com", "This is test mail for blog","Pls dont reply to this mail this is testmail. ", false);
}
}
}
for this Add reference of Microsoft.Sharepoint in references.
using Microsoft.SharePoint.Utilities;
Get the header information which contains To,Subject,CC...
System.Collections.Specialized.StringDictionary headers = new System.Collections.Specialized.StringDictionary();
headers["To"] = v-sasikp@microsoft.com;
headers["Subject"] = "This is test mail";
finally,
SPUtility.SendEmail(myweb, headers, emailMsg, false);
But this requires configuration of email server in central administration.
Simple Ex:
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Utilities;
namespace blogmail
{
class Program
{
static void Main(string[] args)
{
SPSite Site = new SPSite("http://sasikp-v:4008/");
SPWeb myweb = Site.OpenWeb();
SPUtility.SendEmail(myweb, false, false,"v-sasikp@microsoft.com", "This is test mail for blog","Pls dont reply to this mail this is testmail. ", false);
}
}
}
Thursday, 10 July 2008
How to Read Url value.
Yesterday i m working on Url column of a list. My code has to read the Url value rather than Url.
and i wrote code simply like below.
foreach(Splistitem item in Allitems)
{
string urlvalue= item["Link"].tostring();
.......
}
as link is my column and item is splist item.
The above urlvalue is giving a url value which is converted to string.
to solve this i used SpFieldUrlValue.
SPFieldUrlValue linkField = new SPFieldUrlValue(item["Link"].tostring());
string linkname = linkField.Description;
Cheers i got the value finally.
and i wrote code simply like below.
foreach(Splistitem item in Allitems)
{
string urlvalue= item["Link"].tostring();
.......
}
as link is my column and item is splist item.
The above urlvalue is giving a url value which is converted to string.
to solve this i used SpFieldUrlValue.
SPFieldUrlValue linkField = new SPFieldUrlValue(item["Link"].tostring());
string linkname = linkField.Description;
Cheers i got the value finally.
Thursday, 3 July 2008
How Dates Played with me.
1)Last night i was writing some code for my project and my requirement is to pull some data from the list based on some condition and condition is linked with some date field.
And i thought of using U2U tool which makes my life happy. But U2U is working fine, when i copied the query into my code its not working :( .
So rather than depending on U2U i went with CAML Language and Dates. I came to know that CAML Language recognises dates which is in "yyyy-MM-ddTHH:mm:ssZ" this format.
So lets coming to my code i have one date field in my list where i have to filter the list items based on the condition and condition is
" If the list fields date is less than Today-24 hrs " then get the items.
here i m deleting one day from today.
so the code i written is
DateTime today;
today = DateTime.Now;
Int32 DurationArtworkWFHrs = 24;
TimeSpan s = new TimeSpan(DurationArtworkWFHrs, 0, 0);
DateTime result = today.Subtract(s);
string date = result.ToString("yyyy-MM-ddTHH:mm:ssZ");
And my CAML Query looks like below :
SPQuery query = new SPQuery();
query.Query = "<-Where><-And><-Eq><-FieldRef Name='Status' /><-Value Type='Choice'>In Progress<-/Value><-/Eq><-Lt><-FieldRef Name='ProjectedEndDate' /><-Value Type='DateTime'>" +date+ "<-/Lt><-/And><-/Where>";
(Remove "-" from the above tags to get it worked).
SPListItemCollection myItems = mylist.GetItems(query);
int Projectcount = myItems.Count;
In the above code myitems collection gives the items i required. The variable date contains the converted string which our CAML Language understands. :)
2)One more Date Played with me in infopath form.
my requirement is i have to capture the date and it should be appended to the infopath form when it is submitted.
So for this i created one field in infopath form called "Millisec" .
and assigned our custom date format to this field.
XPathNavigator xnDoc = this.MainDataSource.CreateNavigator();
XPathNavigator fldMilliseconds;
fldMilliseconds = xnDoc.SelectSingleNode("/my:myFields/my:Millisec", this.NamespaceManager);
DateTime dd;
dd = DateTime.Now;
//string[] s = dd.GetDateTimeFormats();
//string date = s[105].ToString();
//date = date.Replace(":", ""); This works but we are capturing 135 elements into arraywhich is not required.
string date = dd.ToString("yyyy-MM-ddTHHmmss");
int TimeMilli = dd.Millisecond;
string instancename = date + TimeMilli;
fldMilliseconds.SetValue(instancename);
and while submitting the form append the value in the field. :)
And i thought of using U2U tool which makes my life happy. But U2U is working fine, when i copied the query into my code its not working :( .
So rather than depending on U2U i went with CAML Language and Dates. I came to know that CAML Language recognises dates which is in "yyyy-MM-ddTHH:mm:ssZ" this format.
So lets coming to my code i have one date field in my list where i have to filter the list items based on the condition and condition is
" If the list fields date is less than Today-24 hrs " then get the items.
here i m deleting one day from today.
so the code i written is
DateTime today;
today = DateTime.Now;
Int32 DurationArtworkWFHrs = 24;
TimeSpan s = new TimeSpan(DurationArtworkWFHrs, 0, 0);
DateTime result = today.Subtract(s);
string date = result.ToString("yyyy-MM-ddTHH:mm:ssZ");
And my CAML Query looks like below :
SPQuery query = new SPQuery();
query.Query = "<-Where><-And><-Eq><-FieldRef Name='Status' /><-Value Type='Choice'>In Progress<-/Value><-/Eq><-Lt><-FieldRef Name='ProjectedEndDate' /><-Value Type='DateTime'>" +date+ "<-/Lt><-/And><-/Where>";
(Remove "-" from the above tags to get it worked).
SPListItemCollection myItems = mylist.GetItems(query);
int Projectcount = myItems.Count;
In the above code myitems collection gives the items i required. The variable date contains the converted string which our CAML Language understands. :)
2)One more Date Played with me in infopath form.
my requirement is i have to capture the date and it should be appended to the infopath form when it is submitted.
So for this i created one field in infopath form called "Millisec" .
and assigned our custom date format to this field.
XPathNavigator xnDoc = this.MainDataSource.CreateNavigator();
XPathNavigator fldMilliseconds;
fldMilliseconds = xnDoc.SelectSingleNode("/my:myFields/my:Millisec", this.NamespaceManager);
DateTime dd;
dd = DateTime.Now;
//string[] s = dd.GetDateTimeFormats();
//string date = s[105].ToString();
//date = date.Replace(":", ""); This works but we are capturing 135 elements into arraywhich is not required.
string date = dd.ToString("yyyy-MM-ddTHHmmss");
int TimeMilli = dd.Millisecond;
string instancename = date + TimeMilli;
fldMilliseconds.SetValue(instancename);
and while submitting the form append the value in the field. :)
Monday, 23 June 2008
How to Increase Performance of Sharepoint in all levels.
Tune your Sharepoint with following tips.Here are the tips given by me to our project Artcore.
Today i m going to blog how to increase the performance of our sharepoint portal in all the levels.
Performance of an application using MOSS framework can be increased by enhancing in either one or in all of the following areas.
1.0 Infrastructure.
2.0 IIS.
3.0 SharePoint portal.
4.0 Application.
5.0 Code Level
1.0 Infrastructure
SharePoint is an application that works best when it gets lots of memory and CPU resources. SharePoint’s Web role uses stateless connections. Using this as advantage, if we install the Web role on several servers, it is possible to divide the client load between them. However, for this we need to consider and solve two challenges first. One is to make sure all web servers have access to the same information which is done by using a common back-end database for all of them. The second thing to solve is that all of these web servers must look like one single SharePoint server which is done by using (NLB). SharePoint supports up to eight servers running the web service role.
1.1 Index server
Different activities in SharePoint require different extent of resources; for example, displaying a project Site normally generates a very light load on the server, whereas indexing the database generates much higher load.
The Index service including the crawling activity is very resource intensive regarding CPU and disk access. By separating this service from the Web, many more users will be supported in the SharePoint environment. The indexing activity can be split between up to four different SharePoint servers.
Note: Only one Index server can crawl on a given content source. If one index server goes down, no other server will take over the indexing crawling that server is configured to do.
With below topology we can double the performance, availability….,
Picture to be placed here.
1.2 Calculating the Number of Operations per Second (OPS) required
For computation of the load or the OPS, on the SharePoint server, the following formula is used
(http://blogs.technet.com/wbaer/archive/2007/07/06/requests-per-second-required-for-sharepoint-products-and-technologies.aspx)
A*B*C*D /360,000*E= OPS
Where,
❑ A = The number of users.
❑ B = The percentage of active users on a typical day.
❑ C = The number of operations per active user per day.(1-10)
❑ D = The peak factor.(1-10)
❑ E = The number of working hours per day.
For ArtCore
A= ~ 1000
B= ~ 100
C=~10
D= ~10
E= 12
1000*100*10*10/360,000*12=10000000/4320000 = 2.31 OPS.
By Redesign we can manage up to 20,000-40,000 of users.
1.3 Requests per second
The general rule is to plan for 1 Rps. While a small server farm serves about 60 RPS for 1000 users, a medium farm with 2 WFE servers can serve about 120 Rps.
1.4 Disk Space Needed
When planning for the required disk space, there is no need to worry about the SPS binary files, because they are small compared to other files. More important are the index and database files. Regardless of the database type, you still need to follow this important rule:
You must always have at least 50 percent free space on your database disk!
The reason for this is that some database troubleshooting utilities need to make a copy of the database to perform their tasks. If you don’t have the required space, you may get into a situation where you cannot fix a problem.
2.0 IIS
2.1
When creating a Web Application (and associated site collection) that the default is that a unique IIS application pool be used for each. This can have several benefits – should some unexpected error in a site cause a problem it will be localized to that site collection, additionally the worker process will be caching content related to those specific sites. Worker process sizes between 250-300MB on X86 WFE servers, and between 400-500MB on X64 WFE servers. There are also other application pools and related IIS processes to support Central Administration, SSP, and so on, on the various WFE servers. The best-practice approach will be to consider which Web Applications should share an application pool, and which should be unique. Using multiple application pools can be beneficial, but it is easy to over-do by always taking the default settings (use new pool). Each related process has to load an instance of the .NET runtime in memory, so un-needed (excessive) application pools can waste memory.
2.2
IIS Compression
HTTP Compression is a wonderful technology that accomplishes a lot of different things. It allows faster page serving to clients and lower server costs due to lowered bandwidth (these two being enough for me to implement).
HTTP Compression is when a Web server receives a request for a file and instead of just serving the file to the client, it checks to see if the client browser (or application) is "Compression Enabled". If so, the Web server does a check on what type of file is being requested (this is determined by the file’s extension). If the file is marked as a static file, such as an HTML file, IIS will check the Compression Cache Temporary Directory.
If a compressed version isn’t found, IIS will send an uncompressed version of the file to the client and a compressed version is placed in the temporary directory (IIS will only serve to the client from the temp directory). If the compressed version is found, IIS will send the file directly to the requesting client. If the requested file is a dynamic file, such as an ASP.NET Web form, then the response is dynamically compressed and sent to the requesting client (no temp directory access is ever done).
By running the below scripts we can achieve compression
cscript.exe adsutil.vbs set W3Svc/Filters/Compression/GZIP/HcScriptFileExtensions "asp" "dll" "exe" "aspx" "asmx" "ashx"
cscript.exe adsutil.vbs set W3Svc/Filters/Compression/DEFLATE/HcScriptFileExtensions "asp" "dll" "exe" "aspx" "asmx"
cscript.exe adsutil.vbs set W3Svc/Filters/Compression/GZIP/HcDynamicCompressionLevel "9"
cscript.exe adsutil.vbs set W3Svc/Filters/Compression/DEFLATE/HcDynamicCompressionLevel "9"
(http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/d52ff289-94d3-4085-bc4e-24eb4f312e0e.mspx?mfr=true)
3. 0 SharePoint level
3.1 Caching
SharePoint provides two types of caching.
3.1.1 Page output caching
3.1.2 Disk caching
Disk-based cache scheme can be enabled on a per-site basis, and should be set consistently on each WFE server. In a typical site there are likely several references to image files (BMP, JPG, and so on) or to CSS style sheets or JS script files. These can be cached to avoid repeated database access for what are essentially static objects, and thus improve page response times. The cache is disabled by default, and is enabled by editing a line in the site WEB.CONFIG file found in the IIS Inetpub folder structure related to the site on the server’s system disk. Edit the file and search for the second instance of “BLOB” to get to the right line, which looks like:
<(BlobCache location="E:\blobCache" path="\.(gif|jpg|png|css|js)$" maxSize="100" max-age="86400" enabled="false" )/>
Currently in production it is set to “false”.
The maxSize parameter is the maximum size of the disk cache in GB.
4.0 Application level
Our Project’s Key strength is InfoPath forms.
InfoPath Forms Services uses session state to store the large amount of transient data generated while filling out a form. As a result, front-end Web servers can remain stateless between round trips, and each post back is not burdened with carrying large amounts of session state information over narrow bandwidth pipes.
So if you are using infopath forms use formview state rather than session state.
5.0 Code Level
Many times we will delete or update list items in the lists by using Object oreiented code if these operations or doing on lists having bulk items then use
"ProcessBatchData" we can increase performance very much.
http://msdn.microsoft.com/en-us/library/cc404818.aspx
Advantages:
1) Performance
2) High availability(WFE & DB)
3) High Throughput
4) Scalability
5) No downtime
Today i m going to blog how to increase the performance of our sharepoint portal in all the levels.
Performance of an application using MOSS framework can be increased by enhancing in either one or in all of the following areas.
1.0 Infrastructure.
2.0 IIS.
3.0 SharePoint portal.
4.0 Application.
5.0 Code Level
1.0 Infrastructure
SharePoint is an application that works best when it gets lots of memory and CPU resources. SharePoint’s Web role uses stateless connections. Using this as advantage, if we install the Web role on several servers, it is possible to divide the client load between them. However, for this we need to consider and solve two challenges first. One is to make sure all web servers have access to the same information which is done by using a common back-end database for all of them. The second thing to solve is that all of these web servers must look like one single SharePoint server which is done by using (NLB). SharePoint supports up to eight servers running the web service role.
1.1 Index server
Different activities in SharePoint require different extent of resources; for example, displaying a project Site normally generates a very light load on the server, whereas indexing the database generates much higher load.
The Index service including the crawling activity is very resource intensive regarding CPU and disk access. By separating this service from the Web, many more users will be supported in the SharePoint environment. The indexing activity can be split between up to four different SharePoint servers.
Note: Only one Index server can crawl on a given content source. If one index server goes down, no other server will take over the indexing crawling that server is configured to do.
With below topology we can double the performance, availability….,
Picture to be placed here.
1.2 Calculating the Number of Operations per Second (OPS) required
For computation of the load or the OPS, on the SharePoint server, the following formula is used
(http://blogs.technet.com/wbaer/archive/2007/07/06/requests-per-second-required-for-sharepoint-products-and-technologies.aspx)
A*B*C*D /360,000*E= OPS
Where,
❑ A = The number of users.
❑ B = The percentage of active users on a typical day.
❑ C = The number of operations per active user per day.(1-10)
❑ D = The peak factor.(1-10)
❑ E = The number of working hours per day.
For ArtCore
A= ~ 1000
B= ~ 100
C=~10
D= ~10
E= 12
1000*100*10*10/360,000*12=10000000/4320000 = 2.31 OPS.
By Redesign we can manage up to 20,000-40,000 of users.
1.3 Requests per second
The general rule is to plan for 1 Rps. While a small server farm serves about 60 RPS for 1000 users, a medium farm with 2 WFE servers can serve about 120 Rps.
1.4 Disk Space Needed
When planning for the required disk space, there is no need to worry about the SPS binary files, because they are small compared to other files. More important are the index and database files. Regardless of the database type, you still need to follow this important rule:
You must always have at least 50 percent free space on your database disk!
The reason for this is that some database troubleshooting utilities need to make a copy of the database to perform their tasks. If you don’t have the required space, you may get into a situation where you cannot fix a problem.
2.0 IIS
2.1
When creating a Web Application (and associated site collection) that the default is that a unique IIS application pool be used for each. This can have several benefits – should some unexpected error in a site cause a problem it will be localized to that site collection, additionally the worker process will be caching content related to those specific sites. Worker process sizes between 250-300MB on X86 WFE servers, and between 400-500MB on X64 WFE servers. There are also other application pools and related IIS processes to support Central Administration, SSP, and so on, on the various WFE servers. The best-practice approach will be to consider which Web Applications should share an application pool, and which should be unique. Using multiple application pools can be beneficial, but it is easy to over-do by always taking the default settings (use new pool). Each related process has to load an instance of the .NET runtime in memory, so un-needed (excessive) application pools can waste memory.
2.2
IIS Compression
HTTP Compression is a wonderful technology that accomplishes a lot of different things. It allows faster page serving to clients and lower server costs due to lowered bandwidth (these two being enough for me to implement).
HTTP Compression is when a Web server receives a request for a file and instead of just serving the file to the client, it checks to see if the client browser (or application) is "Compression Enabled". If so, the Web server does a check on what type of file is being requested (this is determined by the file’s extension). If the file is marked as a static file, such as an HTML file, IIS will check the Compression Cache Temporary Directory.
If a compressed version isn’t found, IIS will send an uncompressed version of the file to the client and a compressed version is placed in the temporary directory (IIS will only serve to the client from the temp directory). If the compressed version is found, IIS will send the file directly to the requesting client. If the requested file is a dynamic file, such as an ASP.NET Web form, then the response is dynamically compressed and sent to the requesting client (no temp directory access is ever done).
By running the below scripts we can achieve compression
cscript.exe adsutil.vbs set W3Svc/Filters/Compression/GZIP/HcScriptFileExtensions "asp" "dll" "exe" "aspx" "asmx" "ashx"
cscript.exe adsutil.vbs set W3Svc/Filters/Compression/DEFLATE/HcScriptFileExtensions "asp" "dll" "exe" "aspx" "asmx"
cscript.exe adsutil.vbs set W3Svc/Filters/Compression/GZIP/HcDynamicCompressionLevel "9"
cscript.exe adsutil.vbs set W3Svc/Filters/Compression/DEFLATE/HcDynamicCompressionLevel "9"
(http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/d52ff289-94d3-4085-bc4e-24eb4f312e0e.mspx?mfr=true)
3. 0 SharePoint level
3.1 Caching
SharePoint provides two types of caching.
3.1.1 Page output caching
3.1.2 Disk caching
Disk-based cache scheme can be enabled on a per-site basis, and should be set consistently on each WFE server. In a typical site there are likely several references to image files (BMP, JPG, and so on) or to CSS style sheets or JS script files. These can be cached to avoid repeated database access for what are essentially static objects, and thus improve page response times. The cache is disabled by default, and is enabled by editing a line in the site WEB.CONFIG file found in the IIS Inetpub folder structure related to the site on the server’s system disk. Edit the file and search for the second instance of “BLOB” to get to the right line, which looks like:
<(BlobCache location="E:\blobCache" path="\.(gif|jpg|png|css|js)$" maxSize="100" max-age="86400" enabled="false" )/>
Currently in production it is set to “false”.
The maxSize parameter is the maximum size of the disk cache in GB.
4.0 Application level
Our Project’s Key strength is InfoPath forms.
InfoPath Forms Services uses session state to store the large amount of transient data generated while filling out a form. As a result, front-end Web servers can remain stateless between round trips, and each post back is not burdened with carrying large amounts of session state information over narrow bandwidth pipes.
So if you are using infopath forms use formview state rather than session state.
5.0 Code Level
Many times we will delete or update list items in the lists by using Object oreiented code if these operations or doing on lists having bulk items then use
"ProcessBatchData" we can increase performance very much.
http://msdn.microsoft.com/en-us/library/cc404818.aspx
Advantages:
1) Performance
2) High availability(WFE & DB)
3) High Throughput
4) Scalability
5) No downtime
Saturday, 14 June 2008
How to Integrate Silverlight in Smartpart.
can we integrate our smartpart with silverlight.(I say YES.)
People who are working with smartpart is in dilemma. how to use silverlight in smartparts then here is the solution jump and give a try.
This Post is continuation of my previous post so go through my previous post for creating silverlight webpart.
People who worked in asp.net feels uncomfort in sharepoint as we have to develop custom webpart from the scratch for them smart part is a good webpart which takes usercontrol and renders our usercontrol to webpart.
you will found the smart part in the below link.
http://www.codeplex.com/smartpart/Release/ProjectReleases.aspx?ReleaseId=10697
The latest release for smart part is v1.3. it is a good webpart developed by inheriting sharepoint webpart.This supports ajax also.
Now the Question is can we integrate our smartpart with silverlight.
I tried in multiple ways but i got succeded in Following way. (as usercontrol is .net controls we have to render our controls on top of the silverlight content)
To integrate Smart part and silverlight the procedure we have to follow is:
1) Create a web part with silverlight rendering.(silverlight web part)
2) Overlap Smart part on the silverlight web part.
Open the User Control and place your code in the div tag.
<-div style="position:absolute; width: 600px; height: 100px; z-index: 1; left: 24px; top: 95px" id="layer1">
This makes the control to Render at our required position. We can adjust the properties as per our requirement.
My user control looks like below in design mode.(Just adding two numbers)
Output of the user control after rendering on silverlight web part in my SharePoint site.
Output in the IE Browser.(As this differs very little in mozilla).
Cheers it worked for me i have some more options
1)rendering directly silverlight content in usercontrol it worked for me if it is .net application but it is not working for sharepoint i may miss some thing ill try soon and update.
2)inheriting the smartpart webpart and adding our code in Onprerendermethod and override rendermethod.(didnt gave a try.)
now you can give a try with this. :)
People who are working with smartpart is in dilemma. how to use silverlight in smartparts then here is the solution jump and give a try.
This Post is continuation of my previous post so go through my previous post for creating silverlight webpart.
People who worked in asp.net feels uncomfort in sharepoint as we have to develop custom webpart from the scratch for them smart part is a good webpart which takes usercontrol and renders our usercontrol to webpart.
you will found the smart part in the below link.
http://www.codeplex.com/smartpart/Release/ProjectReleases.aspx?ReleaseId=10697
The latest release for smart part is v1.3. it is a good webpart developed by inheriting sharepoint webpart.This supports ajax also.
Now the Question is can we integrate our smartpart with silverlight.
I tried in multiple ways but i got succeded in Following way. (as usercontrol is .net controls we have to render our controls on top of the silverlight content)
To integrate Smart part and silverlight the procedure we have to follow is:
1) Create a web part with silverlight rendering.(silverlight web part)
2) Overlap Smart part on the silverlight web part.
Open the User Control and place your code in the div tag.
<-div style="position:absolute; width: 600px; height: 100px; z-index: 1; left: 24px; top: 95px" id="layer1">
This makes the control to Render at our required position. We can adjust the properties as per our requirement.
My user control looks like below in design mode.(Just adding two numbers)
Output of the user control after rendering on silverlight web part in my SharePoint site.
Output in the IE Browser.(As this differs very little in mozilla).
Cheers it worked for me i have some more options
1)rendering directly silverlight content in usercontrol it worked for me if it is .net application but it is not working for sharepoint i may miss some thing ill try soon and update.
2)inheriting the smartpart webpart and adding our code in Onprerendermethod and override rendermethod.(didnt gave a try.)
now you can give a try with this. :)
How to Create a Silverlight Webpart.
Most of the people ask me how to integrate silverlight in sharepoint. In my previous post I explained about rendering silverlight content in a sharepoint page.
This time i'll explain you how we can render silverlight content in a sharepoint webpart where we can display individual silverlight content in a webpart rather than rendering silverlight for total Sharepointpage.
Here are the Steps for creating silverlight web part.
1) Open visual studio and create a new project by selecting web part template. As shown in the below figure.
2) Add the Silverlight files Scene.js, Scene.xaml, Silverlight.js to the project as shown below.
After adding the silverlight files to the project set the “Build Action” property of each file to “Embedded Resource”.
3) We added silverlight files in to the assembly by making the property to “embedded resource”. To expose the file to a web request we need to add the following code in .cs file .These entries expose the embedded resource to the “ Client Script Manager” can get the file and know what kind of file it is.
[assembly: WebResource("Otherswebpart.Silverlight.js", "text/javascript")]
[assembly: WebResource("Otherswebpart.Scene.js", "text/javascript")]
[assembly: WebResource("Otherswebpart.Scene.xaml", "text/xml")]
The code in my .cs file. I took Otherswebpart as my name space. We have to add assembly level information just above the name space as shown in the figure.
4) We said to the assembly by the above lines now we have to register the script files to the page before the files are used. So we need to add the following lines of code in the method called “OnPreRender”.
My method in the .cs file has the following code.
protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);
this.Page.ClientScript.RegisterClientScriptResource(GetType(), "Otherswebpart.Silverlight.js");
this.Page.ClientScript.RegisterClientScriptResource(GetType(), "Otherswebpart.Scene.js");
}
The above code explains registering of my script files to the page before rendering.
5) Finally we have to render the Silverlight content. So I added the code which we found in the default.html.js file. The reason I wrote the every line of default.html.js file instead of calling “CreateSilverlight()” method is we require the source of the ” page.xaml” which is embedded in the assembly.
So my render method looks like the following.
A) The text which is in yellow colour describes the source of our “Scene.xaml” file.
B) The property isWindowless:’True’ allows us to overlap our .net controls on to the silverlight content. (Add this property it doesn’t come by default.)
6) Finally we have to build and run the project.
Before that we have to set one more property. Go to the project properties and select the debug tab and set the property “start browser with URL” to your SharePoint site as shown in the below figure.
By doing this we should be able to see the output of the web part in our SharePoint site.
Check the Output in my site which is having “Otherswebpart webpart” which is having silverlight content and with one silverlight button.
Cheers Now Give a try with this. in my next post i'll explain how to integrate silverlight webpart with smartpart.
This time i'll explain you how we can render silverlight content in a sharepoint webpart where we can display individual silverlight content in a webpart rather than rendering silverlight for total Sharepointpage.
Here are the Steps for creating silverlight web part.
1) Open visual studio and create a new project by selecting web part template. As shown in the below figure.
2) Add the Silverlight files Scene.js, Scene.xaml, Silverlight.js to the project as shown below.
After adding the silverlight files to the project set the “Build Action” property of each file to “Embedded Resource”.
3) We added silverlight files in to the assembly by making the property to “embedded resource”. To expose the file to a web request we need to add the following code in .cs file .These entries expose the embedded resource to the “ Client Script Manager” can get the file and know what kind of file it is.
[assembly: WebResource("Otherswebpart.Silverlight.js", "text/javascript")]
[assembly: WebResource("Otherswebpart.Scene.js", "text/javascript")]
[assembly: WebResource("Otherswebpart.Scene.xaml", "text/xml")]
The code in my .cs file. I took Otherswebpart as my name space. We have to add assembly level information just above the name space as shown in the figure.
4) We said to the assembly by the above lines now we have to register the script files to the page before the files are used. So we need to add the following lines of code in the method called “OnPreRender”.
My method in the .cs file has the following code.
protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);
this.Page.ClientScript.RegisterClientScriptResource(GetType(), "Otherswebpart.Silverlight.js");
this.Page.ClientScript.RegisterClientScriptResource(GetType(), "Otherswebpart.Scene.js");
}
The above code explains registering of my script files to the page before rendering.
5) Finally we have to render the Silverlight content. So I added the code which we found in the default.html.js file. The reason I wrote the every line of default.html.js file instead of calling “CreateSilverlight()” method is we require the source of the ” page.xaml” which is embedded in the assembly.
So my render method looks like the following.
A) The text which is in yellow colour describes the source of our “Scene.xaml” file.
B) The property isWindowless:’True’ allows us to overlap our .net controls on to the silverlight content. (Add this property it doesn’t come by default.)
6) Finally we have to build and run the project.
Before that we have to set one more property. Go to the project properties and select the debug tab and set the property “start browser with URL” to your SharePoint site as shown in the below figure.
By doing this we should be able to see the output of the web part in our SharePoint site.
Check the Output in my site which is having “Otherswebpart webpart” which is having silverlight content and with one silverlight button.
Cheers Now Give a try with this. in my next post i'll explain how to integrate silverlight webpart with smartpart.
Thursday, 12 June 2008
How to Generate a WSP (solution package)
Hi ,
Today i m going to blog How to generate a WSP when we have individual Dll's to be deployed in to gac other than features,files to layout folder etc..,
Creation of WSP.
WSP is a SharePoint solution Package.
The WSPBuilder is a console application that creates SharePoint Solutions files
based on a folder structure. WSPBuilder will automatically traverse a "12" folder structure
and creates a SharePoint solution manifest.xml and the WSP file based on the files it finds.
Therefore you do not need the knowledge of how to create a solution manifest.xml
and WSP file any more.
Steps for Create WSP.
Step1: Create a Class Library Project.
Step2: Create a “12” folder Structure and paste the folder in to your project. The “12” folder Structure should contain all the required files to be deployed.
For example the entire feature files to be deployed in to Features folder. Custom files to be deployed to Layouts folder. Etc...
Step3: Make a strong name key. (Sign the Assembly)
This can be done by clicking on the properties of the project and select the “Signing”.
Check the check box “Sign the Assembly”.
Select “New” in the Choose a Strong name Key file section and give the name for strong name key.
Step4: Build the Project in Release Mode.
Step5:
Open the folder of your current project from file system. It looks like below.
Step6: Copy the files (WSPBuilder.exe, Cablib.dll, and makecab.exe) in to the folder. It should look like below
WSPBuilder.exe: Download the WSP builder.exe from the below link.
http://www.codeplex.com/wspbuilder/Release/ProjectReleases.aspx?ReleaseId=11603
makecab.exe: Copy the file from C:\WINNT\System32
Cablib.dll: you will found this in WSP tools folder which you downloaded
We have two Scenarios from here
1) No DLL’s
2) Are we having any DLL’s to be dropped in GAC?
If we are not Deploying any DLL’s into GAC just click on the WSPBuilder.exe.
This Generates 2 files.
1) solutionid.txt
2) WSP file (EX: ArtCoreFeatures.wsp)
If we are having DLL’s to be deployed in to GAC in part of WSP.
a) Drop the Dll’s in to the Release folder of the Project.
b) We have to write a manifest file.
This says what are the dll’s to be deployed into the GAC.
The manifest file contains SolutionID attribute which specifies the unique GUID assigned to the solution.
The manifest file is an xml file. Looks like the below.(Remove the - in the tags)
<-Solution SolutionId="63DD8533-9BAF-4ca8-8EFE-0846F0CD3CC1" xmlns="http://schemas.microsoft.com/sharepoint/">
<-FeatureManifests>
<-FeatureManifest Location="CreateProjectWorkSpace\feature.xml" />
<-/FeatureManifests>
<-TemplateFiles>
<-/TemplateFiles>
<-Assemblies>
<-Assembly DeploymentTarget="GlobalAssemblyCache" Location="ArtCoreFeatures.dll" />
<-Assembly DeploymentTarget="GlobalAssemblyCache" Location="Microsoft.EDD.ArtCore.GenericWorkflowWF.dll" />
<-Assembly DeploymentTarget="GlobalAssemblyCache" Location="CreateProjectWorkSpace.dll" />
<-/Assemblies>
<-/Assemblies>
<-/Solution>
After making necessary modifications place this manifest file in the Step6 folder structure. And click on WSPBuilder.exe.
This packs the Dll’s .
Today i m going to blog How to generate a WSP when we have individual Dll's to be deployed in to gac other than features,files to layout folder etc..,
Creation of WSP.
WSP is a SharePoint solution Package.
The WSPBuilder is a console application that creates SharePoint Solutions files
based on a folder structure. WSPBuilder will automatically traverse a "12" folder structure
and creates a SharePoint solution manifest.xml and the WSP file based on the files it finds.
Therefore you do not need the knowledge of how to create a solution manifest.xml
and WSP file any more.
Steps for Create WSP.
Step1: Create a Class Library Project.
Step2: Create a “12” folder Structure and paste the folder in to your project. The “12” folder Structure should contain all the required files to be deployed.
For example the entire feature files to be deployed in to Features folder. Custom files to be deployed to Layouts folder. Etc...
Step3: Make a strong name key. (Sign the Assembly)
This can be done by clicking on the properties of the project and select the “Signing”.
Check the check box “Sign the Assembly”.
Select “New” in the Choose a Strong name Key file section and give the name for strong name key.
Step4: Build the Project in Release Mode.
Step5:
Open the folder of your current project from file system. It looks like below.
Step6: Copy the files (WSPBuilder.exe, Cablib.dll, and makecab.exe) in to the folder. It should look like below
WSPBuilder.exe: Download the WSP builder.exe from the below link.
http://www.codeplex.com/wspbuilder/Release/ProjectReleases.aspx?ReleaseId=11603
makecab.exe: Copy the file from C:\WINNT\System32
Cablib.dll: you will found this in WSP tools folder which you downloaded
We have two Scenarios from here
1) No DLL’s
2) Are we having any DLL’s to be dropped in GAC?
If we are not Deploying any DLL’s into GAC just click on the WSPBuilder.exe.
This Generates 2 files.
1) solutionid.txt
2) WSP file (EX: ArtCoreFeatures.wsp)
If we are having DLL’s to be deployed in to GAC in part of WSP.
a) Drop the Dll’s in to the Release folder of the Project.
b) We have to write a manifest file.
This says what are the dll’s to be deployed into the GAC.
The manifest file contains SolutionID attribute which specifies the unique GUID assigned to the solution.
The manifest file is an xml file. Looks like the below.(Remove the - in the tags)
<-Solution SolutionId="63DD8533-9BAF-4ca8-8EFE-0846F0CD3CC1" xmlns="http://schemas.microsoft.com/sharepoint/">
<-FeatureManifests>
<-FeatureManifest Location="CreateProjectWorkSpace\feature.xml" />
<-/FeatureManifests>
<-TemplateFiles>
<-/TemplateFiles>
<-Assemblies>
<-Assembly DeploymentTarget="GlobalAssemblyCache" Location="ArtCoreFeatures.dll" />
<-Assembly DeploymentTarget="GlobalAssemblyCache" Location="Microsoft.EDD.ArtCore.GenericWorkflowWF.dll" />
<-Assembly DeploymentTarget="GlobalAssemblyCache" Location="CreateProjectWorkSpace.dll" />
<-/Assemblies>
<-/Assemblies>
<-/Solution>
After making necessary modifications place this manifest file in the Step6 folder structure. And click on WSPBuilder.exe.
This packs the Dll’s .
Steps for Service Account Change in Moss
The steps to change the service account is as follows,
1. Change the service account for all “Windows Service” and “Web application pool” through the Central Administrations->Operations Tab->Service Accounts link
2. stsadm –o updatefarmcredentials –userlogin -password
3. You must run IISReset /noforce to complete the action.
4. Wait for the "Administration Application Pool Credential Deployment" job definition to go away on the Timer Job Definitions central admin page
5. stsadm -o updateaccountpassword -userlogin -password –noadmin
6. stsadm -o spsearch -farmserviceaccount -farmservicepassword
7. stsadm -o editssp -title -ssplogin -ssppassword
8. stsadm -o osearch -farmserviceaccount -farmservicepassword
1. Change the service account for all “Windows Service” and “Web application pool” through the Central Administrations->Operations Tab->Service Accounts link
2. stsadm –o updatefarmcredentials –userlogin
3. You must run IISReset /noforce to complete the action.
4. Wait for the "Administration Application Pool Credential Deployment" job definition to go away on the Timer Job Definitions central admin page
5. stsadm -o updateaccountpassword -userlogin
6. stsadm -o spsearch -farmserviceaccount
7. stsadm -o editssp -title
8. stsadm -o osearch -farmserviceaccount
Sunday, 18 May 2008
Publishing Excel webpages for Sharepoint.
Requirement: user should be able to see the data of excel sheet in SharePoint without grid lines and in a single page scrolling(Rather than scrolling in excel web part and SharePoint pageview webpart).
Solution:
1) Create a SharePoint document library for excel.
2) Open Excel from your desktop or using new from SharePoint excel document library menu.
3) Paste the required data in to sheet or input some values which is required to display.
4) Format the excel sheet as per your requirement to Display. The formatting done in excel sheet gets effect in SharePoint page.(Ex: Numbers to show in left align or right align see in the below image I aligned numbers to left)
5) And click on Saveas button and Save the excel sheet as webpage which is having .htm extension in the SharePoint library EX: http://sasikp-v:720/MyEXcelsheets (easy way is to open library in windows explorer mode and copy the url and paste).
6) Go to the library of excel and click on the excel u saved it opens in SharePoint as webpage.
You can directly edit the excel sheet and save the changes. Here is the sample I done.
We can give Title also by clicking on Change title button while saving the sheet.
Solution:
1) Create a SharePoint document library for excel.
2) Open Excel from your desktop or using new from SharePoint excel document library menu.
3) Paste the required data in to sheet or input some values which is required to display.
4) Format the excel sheet as per your requirement to Display. The formatting done in excel sheet gets effect in SharePoint page.(Ex: Numbers to show in left align or right align see in the below image I aligned numbers to left)
5) And click on Saveas button and Save the excel sheet as webpage which is having .htm extension in the SharePoint library EX: http://sasikp-v:720/MyEXcelsheets (easy way is to open library in windows explorer mode and copy the url and paste).
6) Go to the library of excel and click on the excel u saved it opens in SharePoint as webpage.
You can directly edit the excel sheet and save the changes. Here is the sample I done.
We can give Title also by clicking on Change title button while saving the sheet.
Saturday, 26 April 2008
Setting our Custom Page as Default Page.
Hi,
I had a Landing Page which is a custom page designed by me for our portal i have to keep it as default page when customers type the address. so i did that in the following way try it if u had the same scenario.
Go to SiteActions->SiteSettings->Modify All Site Settings.
In Look and Feel section select Welcome page.
Browse the LandingPage(Required Custom Page). Click ok.
Click ok.
When you enter the address now you will find the new page as welcome page. :)
I had a Landing Page which is a custom page designed by me for our portal i have to keep it as default page when customers type the address. so i did that in the following way try it if u had the same scenario.
Go to SiteActions->SiteSettings->Modify All Site Settings.
In Look and Feel section select Welcome page.
Browse the LandingPage(Required Custom Page). Click ok.
Click ok.
When you enter the address now you will find the new page as welcome page. :)
Saturday, 19 April 2008
Microsoft Windows Server 2008.
Here are the links to find about Microsoft Windows Server 2008.
http://download.microsoft.com/download/c/6/1/c61f02dc-30ac-4d65-9fe5-277de9d13787/CoreInfrastructureImprovementsWS2008.pptx
http://download.microsoft.com/download/c/6/1/c61f02dc-30ac-4d65-9fe5-277de9d13787/CoreInfrastructureImprovementsWS2008.pptx
Thursday, 3 April 2008
How to Use stsadm.exe from any where in the commandprompt.
Some cool stuff i'm going to say which helps to every developer who plays with Features.
To install and activate a Feature we will use stsadm.exe where we found it in the bin folder of 12.
we write some batch files to install the features.
Other than that if i need to install a feature i used to go to the Feature folder and paste the stsadm.exe in the respective feature folder and executing from there.
Today ill say u one thing where we can execute stsadm.exe from any where that means we are going to make availiability of stsadm through out the folders.
just we are making it as environment variable to do that follow the steps below:
Goto Start->Settings-> Controlpanel->System.
Click on advanced tab.
Click on Environment Variables button
Select Path in the System variables section and click on edit and append the following in the variable path :
;C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN
and click ok and close all the windows.
now you can use the stsadm.exe from any where.
cheers. :)
To install and activate a Feature we will use stsadm.exe where we found it in the bin folder of 12.
we write some batch files to install the features.
Other than that if i need to install a feature i used to go to the Feature folder and paste the stsadm.exe in the respective feature folder and executing from there.
Today ill say u one thing where we can execute stsadm.exe from any where that means we are going to make availiability of stsadm through out the folders.
just we are making it as environment variable to do that follow the steps below:
Goto Start->Settings-> Controlpanel->System.
Click on advanced tab.
Click on Environment Variables button
Select Path in the System variables section and click on edit and append the following in the variable path :
;C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN
and click ok and close all the windows.
now you can use the stsadm.exe from any where.
cheers. :)
Wednesday, 2 April 2008
How to Deploy MasterPages.
Today i'll Blog how to deploy Masterpages after development.
I had this issue i developed Masterpage for my project and we need to deploy that to the different boxes like Sit(system integration testing),UAT(user acceptance testing)and Production.
So i got a chance to look in to this , because i done the masterpage development which is very interesting part but the question is how to deploy the developed one.
So here is the answers for this:
1)To create the Master page using sharepoint designer in each individual box.This makes the masterpage to be stored in the contentdatabase.(not supported as work is repetetion)
2)Creating the masterpage in 12 folder. and adding file tag in the module tag in the file provisionedFiles.xml
Using this approach the masterpages gets visible when we create new site collection.
3)Making a Feature.
I am going with Feature as we have already production site where we have to activate the feature once in the site collection.
I had this issue i developed Masterpage for my project and we need to deploy that to the different boxes like Sit(system integration testing),UAT(user acceptance testing)and Production.
So i got a chance to look in to this , because i done the masterpage development which is very interesting part but the question is how to deploy the developed one.
So here is the answers for this:
1)To create the Master page using sharepoint designer in each individual box.This makes the masterpage to be stored in the contentdatabase.(not supported as work is repetetion)
2)Creating the masterpage in 12 folder. and adding file tag in the module tag in the file provisionedFiles.xml
Using this approach the masterpages gets visible when we create new site collection.
3)Making a Feature.
I am going with Feature as we have already production site where we have to activate the feature once in the site collection.
Sunday, 30 March 2008
Sharepoint & Silverlight 1.0 Integration
Today i wana blog how we can integrate sharepoint and silverlight1.0.
Microsoft® Silverlight is a cross-browser, cross-platform, and cross-device plug-in for delivering the next generation of media experiences and rich interactive applications for the Web.
I learned silverlight offline in weekends and after office hours its cool and easy. I used the tool called Micrsoft Blend and visual studio 2008 for making silverlight project.
If you want to give a try start from here :http://www.silverlight.net/quickstarts/silverlight10/default.aspx
Now i am going to say how to integrate silverlight 1.0 with our sharepoint.
The experience sharing with you here is practically implemented in our project , got succeded and client Appreciations also so you can trust me before going through this :) .
Little introduction of our Homepage in the Sharepoint portal where i implemented silverlight.
we have Home page for our portal Where it contains Links to several portal pages these links are images and we have a background image for our Homepage.Our portal Home page displays links based on the roles of the enduser.
Here is our home page. You can see the links in red circle. You can observe the background image also a girl with umbrella. And two more images microsoft logo and Project Title "ArtCore".
Why i choose Silverlight?
I choosed silverlight to give rich webinterface with some animations and media effects as well as to make Zero dependency on development and testing team.
What I mean of Zero dependency is ?
After implementing My silver light with sharepoint end user who is having admin rights can change any picture on the screen with out help of developer in few minutes.
So lets give a try how i implemented ?
Assuming we have silverlight 1.0 project the main files in the silverlight project is Default_html.js,Page.xaml,Page.xaml.js.
if you observe the files here silverlight is got rendered by using the last two files 1)page.xaml contains the information how to render and wat to render and 2)Page.xaml.js file contains the events to be fired on the page.
So to integrate the silverlight with our sharepoint first we need to check the place of deployment for our files.
There are 2 ways of deployment one is in the pages directory(Library) of the sharepoint site and the other is Layouts folder of the sharepoint.
I went with Layouts folder as we can easily deploy the files with our solution package,we can easily deploy our .aspx page in different portal and availiability of asset(silverlight images and media) files is also easy when we deploy to different sitecollection.
Built a Custom master page using sharepoint designer and create a minimal master page.
you can find this in msdn :http://msdn2.microsoft.com/en-us/library/aa660698.aspx
Built a .aspx page in sharepoint designer and inherit the master page created in the above one.
And add the following tags after the contentplace holder tag:
script type="text/javascript" src="Silverlight.js" / script
script type="text/javascript" src="Default_html.js"/script
script type="text/javascript" src="Page.xaml.js" /script
Give the source of the files to layout folder.
ex: src="..\layouts\foldername\page.xaml.js"
and modify the source according to all asset files in the page.xaml.
After the script tags add one more script tag which calls the method createSilverlight()
div id="silverlightControlHost"> scrit type="text/javascript">div id="silverlightControlHost"> script type="text/javascript"> createSilverlight(); script /div
This is the method written in the default_html.js where we set the source in the above script tags.
And we have to call the script in a div tag where silverlight content is rendered in this div tag.
And after this you can find the silverlight rendering in the sharepoint page.
And the balance is how to change the background image,links.
Here is the solution for that if we move main image from layouts folder to page directory in the site now we can upload our required image with the samename mentioned in the page.xaml so the enduser who is having admin rights can easily upload the required background image on the page.
Here is the page after changing the homepage background image:
The final thing which makes interesting part how to play with links which is having links based on roles right.
Here is the solution for that sharepoint is having outofbox webpart called summary webpart.
Overlay that webpart on the silverlight page by using div tag.
For this you have to create a webpart zone in the .aspx page if you are starting with blank page like me.
And the roles part can be handled by the webpart propertie called Target audience.
where you have to create respective webpart for every type of audience.
Note: you can make the links as image click by uploading the required images to image library of the site and browsing them in summary link webpart.
The things are done from my side now you can give a try.
Cheers best of luck :).
Microsoft® Silverlight is a cross-browser, cross-platform, and cross-device plug-in for delivering the next generation of media experiences and rich interactive applications for the Web.
I learned silverlight offline in weekends and after office hours its cool and easy. I used the tool called Micrsoft Blend and visual studio 2008 for making silverlight project.
If you want to give a try start from here :http://www.silverlight.net/quickstarts/silverlight10/default.aspx
Now i am going to say how to integrate silverlight 1.0 with our sharepoint.
The experience sharing with you here is practically implemented in our project , got succeded and client Appreciations also so you can trust me before going through this :) .
Little introduction of our Homepage in the Sharepoint portal where i implemented silverlight.
we have Home page for our portal Where it contains Links to several portal pages these links are images and we have a background image for our Homepage.Our portal Home page displays links based on the roles of the enduser.
Here is our home page. You can see the links in red circle. You can observe the background image also a girl with umbrella. And two more images microsoft logo and Project Title "ArtCore".
Why i choose Silverlight?
I choosed silverlight to give rich webinterface with some animations and media effects as well as to make Zero dependency on development and testing team.
What I mean of Zero dependency is ?
After implementing My silver light with sharepoint end user who is having admin rights can change any picture on the screen with out help of developer in few minutes.
So lets give a try how i implemented ?
Assuming we have silverlight 1.0 project the main files in the silverlight project is Default_html.js,Page.xaml,Page.xaml.js.
if you observe the files here silverlight is got rendered by using the last two files 1)page.xaml contains the information how to render and wat to render and 2)Page.xaml.js file contains the events to be fired on the page.
So to integrate the silverlight with our sharepoint first we need to check the place of deployment for our files.
There are 2 ways of deployment one is in the pages directory(Library) of the sharepoint site and the other is Layouts folder of the sharepoint.
I went with Layouts folder as we can easily deploy the files with our solution package,we can easily deploy our .aspx page in different portal and availiability of asset(silverlight images and media) files is also easy when we deploy to different sitecollection.
Built a Custom master page using sharepoint designer and create a minimal master page.
you can find this in msdn :http://msdn2.microsoft.com/en-us/library/aa660698.aspx
Built a .aspx page in sharepoint designer and inherit the master page created in the above one.
And add the following tags after the contentplace holder tag:
script type="text/javascript" src="Silverlight.js" / script
script type="text/javascript" src="Default_html.js"/script
script type="text/javascript" src="Page.xaml.js" /script
Give the source of the files to layout folder.
ex: src="..\layouts\foldername\page.xaml.js"
and modify the source according to all asset files in the page.xaml.
After the script tags add one more script tag which calls the method createSilverlight()
div id="silverlightControlHost"> scrit type="text/javascript">div id="silverlightControlHost"> script type="text/javascript"> createSilverlight(); script /div
This is the method written in the default_html.js where we set the source in the above script tags.
And we have to call the script in a div tag where silverlight content is rendered in this div tag.
And after this you can find the silverlight rendering in the sharepoint page.
And the balance is how to change the background image,links.
Here is the solution for that if we move main image from layouts folder to page directory in the site now we can upload our required image with the samename mentioned in the page.xaml so the enduser who is having admin rights can easily upload the required background image on the page.
Here is the page after changing the homepage background image:
The final thing which makes interesting part how to play with links which is having links based on roles right.
Here is the solution for that sharepoint is having outofbox webpart called summary webpart.
Overlay that webpart on the silverlight page by using div tag.
For this you have to create a webpart zone in the .aspx page if you are starting with blank page like me.
And the roles part can be handled by the webpart propertie called Target audience.
where you have to create respective webpart for every type of audience.
Note: you can make the links as image click by uploading the required images to image library of the site and browsing them in summary link webpart.
The things are done from my side now you can give a try.
Cheers best of luck :).
Friday, 28 March 2008
How to Debug the Workflow.
Steps to Debug the workflow in visual studio.
Step 1: Keep some breakpoints in the code.
Step 2: Drop the Dll in to GAC.(check whether it is Strongly signed or not)
Step 3: Reset IIS.
Step 4: Open the site . If it is opened refresh the page. This enables the w3wp process.
Step 5:Attach the W3Wp process.This can be found in Tools or Debug.
Step 6:Run the workflow.
Note : W3wp process is a Dll so it runs under parent process so be carefull with this because it ends the parent process. here parent process is nothing but ur visualstudio.
Cheers now you can debug your workflow.
Step 1: Keep some breakpoints in the code.
Step 2: Drop the Dll in to GAC.(check whether it is Strongly signed or not)
Step 3: Reset IIS.
Step 4: Open the site . If it is opened refresh the page. This enables the w3wp process.
Step 5:Attach the W3Wp process.This can be found in Tools or Debug.
Step 6:Run the workflow.
Note : W3wp process is a Dll so it runs under parent process so be carefull with this because it ends the parent process. here parent process is nothing but ur visualstudio.
Cheers now you can debug your workflow.
Tuesday, 25 March 2008
How to access the site created in the server from other systems.
If we want to access the Sharepoint site created in the server from other systems we have to check for the following things:
1)Whether the User is having permissions are not.
This can be checked by looking into user permissions and groups of the site.
2)Check the firewall settings this can be done in the following way:
start->Controlpanel->Windowsfirewall->Select the tab Exceptions and click on addport give the servername and portnumber of the site you want to access.
Cheers now u can access ur site from any other machine in the lan.
3)if you want to access all the sites then you just turn off the firewall settings(Not recommended).
Monday, 24 March 2008
Link to Certification Details
we have 4 Certifications in Sharepoint.The following Links are the sharepoint certifications Links.
1)Technology Specialist: Microsoft Office SharePoint Server 2007, Application Development
2)Technology Specialist: Microsoft Office SharePoint Server 2007, Configuration
3)Technology Specialist: Windows SharePoint Services 3.0, Application Development
4)Technology Specialist: Windows SharePoint Services 3.0, Configuration
The other Certifications can be found in the following link.
http://www.microsoft.com/learning/mcp/mcts/default.mspx
1)Technology Specialist: Microsoft Office SharePoint Server 2007, Application Development
2)Technology Specialist: Microsoft Office SharePoint Server 2007, Configuration
3)Technology Specialist: Windows SharePoint Services 3.0, Application Development
4)Technology Specialist: Windows SharePoint Services 3.0, Configuration
The other Certifications can be found in the following link.
http://www.microsoft.com/learning/mcp/mcts/default.mspx
Saturday, 22 March 2008
Subscribe to:
Posts (Atom)