Skip to content

Instantly share code, notes, and snippets.

View devendrasv's full-sized avatar

Devendra Velegandla devendrasv

View GitHub Profile
<?xml version="1.0" encoding="utf-8" ?>
<!--Created:cb85b80c-f585-40ff-8bfc-12ff4d0e34a9-->
<App xmlns="http://schemas.microsoft.com/sharepoint/2012/app/manifest"
Name="Search-Students"
ProductID="{3b9c0cc0-ae95-47cc-889c-450ff2646405}"
Version="1.0.0.0"
SharePointMinVersion="15.0.0.0"
>
<Properties>
<Title>Search-Students</Title>
#Example of getting site collection url based on feature Name
Add-PSSnapin Microsoft.SharePoint.PowerShell
$webapp= Get-SPWebApplication "http://www.sharepoint-journey.com/"
# looping through all sitecollections
foreach($site in $webApp.Sites)
{
Add-PSSnapin Microsoft.SharePoint.PowerShell
$webapp= Get-SPWebApplication "http://www.sharepoint-journey.com/"
# looping through all sitecollections
foreach($site in $webApp.Sites)
{
# looping through all sites
foreach($website in $site.allwebs)
{
@devendrasv
devendrasv / ECT-elements.xml
Created April 13, 2013 05:30
ECT Employees elements.xml
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<ListInstance Url="Lists/Employees" Description="Employees" OnQuickLaunch="TRUE" Title="Employees">
<DataSource>
<Property Name="LobSystemInstance" Value="Northwind" />
<Property Name="EntityNamespace" Value="NorthwindModel" />
<Property Name="Entity" Value="Employees" />
<Property Name="SpecificFinder" Value="ReadSpecificEmployee" />
<Property Name="MetadataCatalogFileName" Value="BDCMetadata.bdcm" />
</DataSource>
@devendrasv
devendrasv / ect-elements.xml
Created April 13, 2013 05:31
ECT-elements
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<BdcModel Path="External Content Types\BDCMetadata.bdcm" />
</Elements>
@devendrasv
devendrasv / employees-ect.xml
Created April 13, 2013 05:32
employees-ect.xml
<?xml version="1.0" encoding="utf-16"?>
<Model xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Name="NorthwindModel" xmlns="http://schemas.microsoft.com/windows/2007/BusinessDataCatalog">
<LobSystems>
<LobSystem Name="Northwind" Type="OData">
<Properties>
<Property Name="ODataServiceMetadataUrl" Type="System.String">http://services.odata.org/Northwind/Northwind.svc/$metadata</Property>
<Property Name="ODataServiceMetadataAuthenticationMode" Type="System.String">PassThrough</Property>
<Property Name="ODataServicesVersion" Type="System.String">2.0</Property>
</Properties>
<AccessControlList>
@devendrasv
devendrasv / Failed to initialize SPDistributedSecurityTokenCache Exception
Created April 13, 2013 05:57
Failed to initialize SPDistributedSecurityTokenCache Exception
Token Cache: Failed to initialize SPDistributedSecurityTokenCache Exception: 'System.InvalidOperationException: SPDistributedCachePointerWrapper::InitializeDataCacheFactory - No cache hosts are present or running in the farm.
at Microsoft.SharePoint.DistributedCaching.SPDistributedCachePointerWrapper.InitializeDataCacheFactory()
at Microsoft.SharePoint.DistributedCaching.SPDistributedCache..ctor(String name, TimeSpan timeToLive, SPDistributedCacheContainerType containerType, Boolean encryptData)
at Microsoft.SharePoint.IdentityModel.SPDistributedSecurityTokenCache..ctor(String name, TimeSpan timeToLive, SPDistributedCacheContainerType containerType, Boolean encrptyData, TimeSpan minimumTokenExpirationWindow)
at Microsoft.SharePoint.IdentityModel.SPDistributedSecurityTokenCacheInitializer.Init(Object state)'.
<script type="text/javascript">
if(typeof jQuery=="undefined"){
var jQPath="http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/";
document.write("<script src='",jQPath,"jquery.min.js' type='text/javascript'><\/script>");
}
</script>
<script>
jQuery.noConflict();
jQuery(document).ready(function(){
@devendrasv
devendrasv / webpart.ascx
Created May 31, 2013 01:07
visual webpart ascx
<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VisualWebPart1.ascx.cs" Inh
@devendrasv
devendrasv / webpart.cs
Created May 31, 2013 01:14
visual webpart cs
using System;
using System.ComponentModel;
using System.Web.UI.WebControls.WebParts;
using System.Data;
using Microsoft.SharePoint;
namespace First_VisualWebPart.VisualWebPart1
{
[ToolboxItemAttribute(false)]
public partial class VisualWebPart1 : WebPart
{