Sunday, February 1, 2015

Twitter in SharePoint CEWP

Hi,
To get the twitter tweets/feeds in to your sharepoint do this simple work. Open your site and add a CEWP (Content Editor Webpart) to the page. And add the following java script in to that

script src="http://widgets.twimg.com/j/2/widget.js">< /script ( Here I have missed open brace'<' and closed brace '>'  to show script to you )
And write the below in the script tags
new TWTR.Widget({
version: 2,
type: 'profile',
rpp: 5,
interval: 6000,
width: 200,
height: 500,
theme: {
shell: {
background: '#F45C00',
color: '#ffffff'
},
tweets: {
background: '#000000',
color: '#ffffff',
links: '#4aed05'
}
},
features: {
scrollbar: true,
loop: false,
live: true,
hashtags: true,
timestamp: true,
avatars: true,
behavior: 'all'
}
}).render().setUser('SharePoint2010').start();

The source of the java script file taken from http://widgets.twimg.com/j/2/widget.js.
Note : Here the type of the display is Profile. And also u can show the list . HereI have set the value of the setUser property is Sharepoint2010(http://twitter.com/SharePoint2010) .Instead you can display your own feeds/tweets by giving your twitter account over there(ex:.render().setUser('purnamadugula').start();).Also you can show  the list and customize the user interface...
Here is the more information on this:
Source Links :
http://www.readwriteweb.com/archives/10_twitter_list_widgets_you_can_grab_embed_right_n.php
http://bombshelter.org/TweetCode.txt

Document ID Feature in Sharepoint 2010

Document ID:

This is a new feature in Sharepoint 2010.
There is some inconsistency in Sharepoint 2007 Document Management which are resolved by Sharepoint 2010.
In Moss
------------
1.There is no Unique ID for the Documents.
2.The Documents are referred by the location where they present(i.e if we want to retrieve the document in a library we need to give the path of the library and rootfolder etc etc).
So If we move this document to another location we need to change the path/code to retrieve it.
In Sharepoint 2010
--------------------------
1.Docuement contains Unique number.We can assign numbering in differnt formats.
2. Document keeps its UniqueId across sites,sitecollections and Webapplications too.
Implementation Steps:
1.Site Actions--> Site Settings--->Select Site Collection Features under Site Collection Administration category:
2.You will be able to see a Feature called Document ID Service. Activate it. Ref figue below.


3.Upload a document to the Document Libary and then you will find a new unique Document Id(Not the Id which reference to library). Refer below fig( I uploaded a document named TestMPC.docx to the Shared Documents)
 
 

 

Here the generated Document Id is : FZTVS7J5YPAK-1-30

4.Now you can get the document by using this Id instead giving the total path like(http://yoursite/xyz/Shared%20Documents/TestMPC.docx)
http://Yoursite/xyz/_layouts/DocIdRedir.aspx?ID=FZTVS7J5YPAK-1-30
5.Even if this Document moved to any other Folder or library we can retrieve this by using this URL only.
6.For Docuement ID setttings
 
Site Actions--> Site Settings--->Select Documnet ID settings under Site Collection Administration category:
 

 

You will find these options here
Assign Document ID's:- If we chek this All Existing and new Documents will get an Id.
Begin Id's with the following characters :- This is a 4-12 Id u can give here so that sharepoint will add this no at end . like -1,-2 etc
Document Id Look Up Search Scope:   If you provide a search scope here, If you search the docuement by entering its Document Id it will directly open the document instead showing search results.( Here In my site search is not configured)

Hope you liked !!

Getting the URL parameter in Javascript

Sample URL : http://mysite/sites/Demos/Training/PCM.aspx?ID=429
var paramID=GetValue('ID');
alert('Result ID '+paramID)
function GetValue(name)
{
   name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
   var regexS = "[\\?&]"+name+"=([^&#]*)";
   var regex = new RegExp( regexS );
   var results = regex.exec( unescape(window.location.href) );
   if( results == null )
     return "";
  else
    return results[1];
}

Developer Dashboard in Sharepoint 2010

What is Developer Dashboard ?
Developer dashboard in SharePoint gives developers the ability to monitor how well their code base is performing – on a page by page basis.
For instance – when enabled, at the bottom of every page you'll see a report of all the custom code that has ran on that page, as well as how long it took to run.
This becomes very valuable information especially when querying SharePoint content. You may have several web parts on one page all querying information from across your Farm, and the SharePoint developer dashboard helps you know how well each performs, which can help you identify if one is becoming a bottle neck for your whole page
The report shows the following information:
1. What controls loaded and how long each took to load
2. What specific database queries executed and the execution time of each
3. Events that were fired during the page load
4. Order of the page lifecycle and time during each stage
5. Requests with timings for each one.
6. Database queries and their response times.
7. Load times for each Web Part on the page and Pre-render time.
8.Number of Web server SPRequest(s) and their timing.
9. Any critical events.
There are two methods to initialize this tool to work on your sites. You can do this with your handy old stsadm.exe or with PowerShell.
Stsadm.exe (either set your path statement to read in the Bin Directory or navigate to c:\program files\common files\microsoft shared\web server extensions\14\bin)
Enter the following command
stsadm –o setproperty –pn developer-dashboard –pv OnDemand
In PowerShell
(Get-SPFarm).PerformanceMonitor.DeveloperDashboardLevel = "OnDemand"

The results will show you the following little icon on the top right corner of your page
Clicking on the icon circled with either display or hide the results. Scrolling down your page you will see the following results:



Ref links: http://www.spfoxhole.com/Blog/Lists/Posts/Post.aspx?ID=131

Imp Points SharePoint 2010 Server

Imp Points SharePoint 2010 Server

• SharePoint foundation 2010 is the replacement of wss.
• SharePoint server 2010 is the replacement of moss.
• In 2010 there is a web part separately for Silverlight.
• Server ribbon in SharePoint 2010 site is developed using Ms-office 2007.
• SharePoint 2010 is using .Net Framework 3.5.
• SharePoint server 2010 will be installed on 64 bit operating system
• The operating systems we can install SharePoint 2010 was Windows server r2 for development or production. We can use windows vista or windows 7 only for development.
• Version of IIS we use was iis7.0.
• Developer dashboard can be enabled using stsadm or power shell.
• Using developer dashboard you can identify which web part is taking how much time to render and you can find issues within your code.
• SharePoint 2007 requires additional configurations to work with Silverlight and Ajax.
• We can create a multiple lookups at one attempt.
• We can restrict a lookup that the user should not delete the item from parent list.
• Lists are rendered using xslt in SharePoint 2010.
• Xslt web part provides a better performance of rendering data.
• Xslt is the default rendering option for SharePoint lists as well as external lists.
• Client object model provides a subset of server object model.
• Visual studio 2010 helps people to retrieve SharePoint lists which are in remote place.
• BCS is used to populate data from external data sources to SharePoint lists which we call as external lists.
• Message apis have been introduced to better understanding of the end user.
• Dialog framework has been introduced for the end user sake to go to next level.
• When you create SharePoint ui to a template it generates as a wsp file.
• We can create a new sitecollection using power shell.
• We can directly open the site within a spd using site actions at the right side of the site.
• We will have all files folder where you can find all files including master pages.
• For a list you create columns using spd.
• You can set the general setting of the site using spd.
• We can create a workflow at the site level.
• Workflow can be seen using Visio services.
• We can reuse spd workflow to visual studio workflow.
• Client object model is of 3 types
• Dotnet.
• Silver Light.
• JavaScript.

• Benefits of Microsoft SharePoint server 2010
• Connect & empower people.
• Cut costs with a unified infrastructure.
• Rapidly respond to business needs.
• SharePoint terminology overview
• First you will have farm.
• After you will have one or more servers.
• Server consists of site collections.
• A site collection consists of various sites.
• Under site collection you will have a TopSite.
• Under TopSite you will have subsite.
• Under subsite you will have one more subsite.
• Under subsite you will have lists or document libraries.
• Under list or documents you will have fields.
• Under fields you will have listitems.
• Improvements with in a workflow.
• Visual studio 2010 initiation and association forms.
• New workflow design surface in spd.
• Import spd workflows into visual studio.
• Build spd actions in visual studio.
• Visio 2010 workflow design.
• Browser based visualization.
• High privilege workflows.
• Control where service runs.
• Site workflows.
• Reusable declarative workflows.
• List workflow event receivers.
• Pluggable workflow services.
• Performance and scale.
• Fully customizable OOB workflow.
• Approval designer.
• Visual studio 2010 developer tools for SharePoint.
• Develop deploy & Debug.
• Web part BCS and workflow designers.
• Package and deploy SharePoint projects.

How to get the logged in user name in Sharepoint site using javascript

Place a asp login control in Master page and give id(here im giving id as LoginCtrl)
Open your site in sharepoint designer and select the masterpage.Select a placeholder(for eg PlaceHolderTitleAreaClass)and place the Asp.Net LoginName control by selecting Insert tab from Menu.
Insert-->ASP.Net controls-->More Asp.NetControls select LoginName control from Login categroy.(If u want to make invisible assign proprty visible='false').
In your page get it by writing javscript:
var sLoginUserName ="";
if(document.getElementById('ctl00_LoginCtrl')!=null)
sLoginUserName =document.getElementById('ctl00_LoginCtrl').innerText; //IE

Simple way to hide Quick Launch in Home Page(using CEWP)

This is a simpleway to Hide the QuickLaunch in Home page using a Content Editor Webpart(CEWP).
Step 1:Go to Sharepoint site Homepage.
Step 2: SiteActions-->EditPage-->Add Webpart--->Select Content Editor Webpart from Miscellaneous section.
Step 3: Click on edit of now added CEWP and select modify shared webpart and select Source Editor section.
Step 4: Write the below script in Source Editor in
style tag

.ms-navframe
{
display:none;
}

Step:5 And say Apply then OK