Friday, 26 October 2012

Import CSV(excel) file to SharePoint list

Here the import the more than documents to add the lists using the Power Shell  Commands.

1.we have to add the title of the list  and body of contents and expire date.its like this

and save as .csv format.

2.After that using this code in Notepad



Add-PsSnapin Microsoft.SharePoint.Powershell –ErrorAction SilentlyContinue
$csv = Import-Csv 'csv file path'

$web = Get-SPWeb -identity "Domin Name"

$list = $web.Lists["ListName"]

foreach ($row in $csv) {
$item = $list.Items.Add();
$item["Title"] =$row.Title
$item["Body"] =$row.Body
$item["Expires"] =$row.Expires
$item.Update()
}
Write-Host "Finished! Press enter key to exit." -ForegroundColor Green
Read-Host


and save as filename.ps1 format.
3.finally exect that file

Automatically created the contents on the particular list.


Wednesday, 17 October 2012

Only JavaScript and html slide show in Share Point


You Have to add the scrip in your Master Page .
 <script type="text/javascript">

var slideimages=new Array()
var slidelinks=new Array()
function slideshowimages(){
for (i=0;i<slideshowimages.arguments.length;i++){
slideimages[i]=new Image()
slideimages[i].src=slideshowimages.arguments[i]
}
}

function slideshowlinks(){
for (i=0;i<slideshowlinks.arguments.length;i++)
slidelinks[i]=slideshowlinks.arguments[i]
}

function gotoshow(){
if (!window.winslide||winslide.closed)
winslide=window.open(slidelinks[whichlink])
else
winslide.location=slidelinks[whichlink]
winslide.focus()
}
    </script>

How to configure the target audience for a web part in SharePoint 2010 sites?


Microsoft Office SharePoint Server 2010 enables custom audience targeting for content and sites. The purpose is to define audiences and content that are relevant to a user or a group. As server or site administrator, you can define audiences and content for a specific set of users or group.
The following steps will teach you how to complete the configuration.
Step 1. Create two users in Active Directory which names are “test1″ and “test2″.







Step 2. Log in SharePoint site with the administrator.
Step3. Go to Site Settings>Site collection features, start the “SharePoint Server Publishing Infrastructure” feature, then go to “Site collection navigation” to check if “Enable audience targeting” is selected.




















Step 4. Go to Site Settings>Site Permission>Create Group, create a group named “testinggroup” whose permission level is Full control, then add “test1″ to this group.















Step 5. Go to Settings>Site Permission >Grant permissions, create a user named “test2″ whose permission level is Full control.








Step 6. Now let me take our product SharePointBoost Password Reset web part as an example. In the web part zone click Edit web part. In the Advanced section of the web part tool pane add the “testinggroup” into the Target Audiences box and click OK.















Step 7. Log in SharePoint with “test1″ and “test 2″ respectively. You will see the difference as below.










When you log in SharePoint with “test1″, you will see the Password Reset web part, and when you log inSharePoint with “test2″, you will not see the web part. This shows we have set the target audience successfully.

Thursday, 11 October 2012

Toggle in Picture Sliding Webpart and Video Webpart in Sharepoint 2010

In this toggle the Video webpart and Sliding webpart in sharepoint using the simple jquery.

1)First add the two webparts in sharepoint site and save it.
2)And than go to the SP designer.
3)Open the Particular Page and find the webpart(Video webpart and Sliding webpart) place.its like below


4)And arranged the with in the <td> tag.(img below)

5)After that create a hyper links on top of div tag.

6)Add the jquery coding on the bottom of the page and also refer the jquery-1.4.1.js.



 <script type="text/javascript">
        $(document).ready(function () {
            $('#slide_toggle').hide();
        });

        $(function () {
            $('#slide_toggle').click(function () {
                $('#slideWebpart').toggle();
                $('#videoWebpart').hide();

                $('#slide_toggle').hide();
                $('#video_toggle').show();
            });
        });

        $(function () {
            $('#video_toggle').click(function () {
                $('#videoWebpart').toggle();
                $('#slideWebpart').hide();

                $('#video_toggle').hide();
                $('#slide_toggle').show();
            });
        });
    </script>

6)finally save the page and see the output.



Tuesday, 9 October 2012

Expand and Collapse the SharePoint Web parts


1. Click on the Edit page Under "Site Actions".
2.Add Content Editor Web part any Zone.
3.Click on the Web part. "Click here to add content"
4.Click On "Edit Html Source" on the Ribbon.
5.Add following code.


<script type="text/javascript">
// Add the Web Part Titles here to have them opened by default
var wpsToSkip = ['Tasks','sandbox'];

function wpExpander() {
 var theTDs = document.getElementsByTagName("TD");
 for (var t=0;t<theTDs.length;t++) {
  var id = theTDs[t].id;
  if (id.match("WebPartTitleWPQ")) {
   id = id.substr(id.indexOf("WPQ"));
   var title = (theTDs[t].innerText || theTDs[t].textContent).replace(/[\n\r]/,'');
   var strImg = "<img style='margin:6px 5px 0px 2px;cursor:hand;float:left;' ";
   if (wpsToSkip.join().match(title)) {
    strImg += "onClick='showHide(\""+id+"\",this)' src='/_layouts/images/minus.gif'>";
   } else {
    strImg += "onClick='showHide(\""+id+"\",this)' src='/_layouts/images/plus.gif'>";
    document.getElementById("WebPart"+id).style.display = "none";
   }
   theTDs[t].innerHTML = strImg + theTDs[t].innerHTML;
  }
 }
}

function showHide(i,o) {
 var wp = document.getElementById("WebPart"+i);
 wp.style.display = (wp.style.display=="") ? "none" : "";
 o.src = (o.src.match(/plus.gif/)) ? "/_layouts/images/minus.gif" : "/_layouts/images/plus.gif";
}

_spBodyOnLoadFunctionNames.push("wpExpander()");
</script>



6.Make this Web part as Hidden.
7.Save and Close the web part.

or

As usual,  put this code into a Content Editor Web Part at the bottom of the page.

Monday, 8 October 2012

Hide the Picture WebPart Frame Layout and Titlebar

We have hide and Enable the Picture Web Parts Library.
since Picture Library was like that

And than we have to remove the From and icon from the Picture Library
First we
1)Go to SP Designer and Open the Particular Page.
2)Fine this Picture Library Part in designer code view.like this



3)After that in this Picture Library WebPartZone set the FrameType="None" for like blow fig
 4)and the set Franetype="none".
5) finally save and Refersh the page the Picture Library like...




Friday, 5 October 2012

Enabling or Disabling Classic or Claims Based Authentication

First, make sure your site (web application) does not have the CBA enabled.

Go to Central Administration >> Manage web applications and click on the site you’re planning to enable CBA.
Under Web Applications tab click on the Authentication Providers icon and a small window will pop-up. Under Default you should see Windows.


Claims Based Authentication


Claims Based Authentication

Next, create a PowerShell (.ps1) file using Notepad and paste the following code into it:


$setcba = Get-SPWebApplication "http://YourSiteURL"
$setcba.UseClaimsAuthentication = 1;
$setcba.Update()

Give it a name, like SetCB.ps1 and save in under C: on your SharePoint 2010 server.


Claims Based Authentication


Open SharePoint 2010 Management Shell, make sure you’re under C: (use CD.. to move under C:)and type or Copy and right-click Paste this command ./SetCB.ps1

Claims Based Authentication


Hit Enter and after few seconds your SharePoint site should have Claims Based Authentication enabled.
Repeat the previous steps to check if your site has CBA enabled, Central Administration >> Manage web applications and click on the site, click on the Authentication Providers icon and under Default you should see now Claims Based Authentication.

Claims Based Authentication


To revert back to Classic mode authentication (disabled Claims Based Authentication) just change the 1 to a 0:

$setcba = Get-SPWebApplication "http://YourSiteURL"
$setcba.UseClaimsAuthentication = 0;
$setcba.Update()

Thursday, 4 October 2012

Adding and Deploying SharePoint 2010 Solution with using PowerShell


PowerShell command are,

Backup a Site Collection with PowerShell command
Backup-SPSite -Identity http://myserver -Path "c:\......bak"

Restore a Site Collection with PowerShell command
Restore-SPSite -Identity http://myserver -Path "c:\........bak"
Note: To restore site collection you’ll use the following command. Use –Force if you want to overwrite the existing site collection

WSP Solutions in PowerShell
Add-SPSolution “D:\Deploy\MySharePointSolution.wsp“

Install-SPSolution –Identity MySharePointSolution.wsp –WebApplication http://myspwebapp –GACDeployment

If you would like to add the solution as sandboxed, you would use the Install-SPUserSolution command instead. To upgrade a solution, we specify which solution is to be updated and with which new solution file:
Update-SPSolution –Identity MySharePointSolution.wsp –LiteralPath 
“D:\Deploy\MySharePointSolution.wsp” –GacDeployment

To retract and remove a solution, we use the following commands:
Uninstall-SPSolution –Identity MySharePointSolution.wsp –WebApplication http://myspwebapp
Remove-SPSolution–Identity MySharePointSolution.wsp

KendoUI Chart using in AngularJS with Dynamic data

Here i'm going to do the KendoUI Chart using AngularJS  and getting dynamic data from angular services. First need to down-lode the r...