Posts

Showing posts from January, 2017

Build a RESTtful Application using C#

Image
Hello Everyone,

we will build a Restful application with C#,
First of all , we should have :
-Visual Studio
-A WebBrowser

-Create a new solution with C#
-Create a new Library project and create an Interface.
IRESTDemoServices.cs

[ServiceContract(Name = "RESTDemoServices")] // specifiy the name of the services in this WS ...
[WebGet(UriTemplate = Routing.GetClientRoute, // the root BodyStyle = WebMessageBodyStyle.Bare // the body style ( encapsulate) ,RequestFormat =WebMessageFormat.Json) // output type JSON ] -create a new Rooting class :
Routing.cs
publicstaticclassRouting{public const stringGetClientRoute = "/Client/{id}";public const stringHelloWorld = "/hello/{value}";

SharePoint 2013 Autocomplete textbox using the term store and CSOM

Image
Hello Everyone,


you don't have sometimes the idea to customise the textbox by getting the terms from the termstore ?
if yes, continue reading this post,
ok it's very easy let's start:
you need  jQuery UI Autocomplete.  
The code loads the terms from the term store and then sets the source.
  This implementation is really only ideal for a small amount of terms, but it’s enough to get you started.
For this example, I am going to use a simple set of terms using state names in the United States.  My terms are included in a group named Jobs and a Term Set named Persons.  Here is what my term store looks like.

In this example, we’re going to build our code inside a Client Web Part.  Take a look at that post if you are not familiar with the process yet.  We then need to add a heap of JavaScript references.  Some of these are included already, but specifically we need to load SP.Taxonomy.js.  We also need to include init.js as I mentioned in an earlier blog post. <scripttype="…

Create an OTB SharePoint notification

Image
Hello,

Today i will show you how we can create a sharePoint notification  using the SP.UI.Notify.addNotification with javaScript :

var nid = SP.UI.Notify.addNotification("<img src='/_layouts/15/images/loadingcirclests16.gif?rev=23' style='vertical-align:bottom; display:inline-block; margin-" + (document.documentElement.dir == "rtl" ? "left" : "right") + ":2px;' />&nbsp;<span style='vertical-align:top;'>your custom message.</span>", false);

this is the result:






Set custom level permission SharePoint PowerShell

Image
Hello,


Some time we need to apply a script on all the web application, today we can set the permission level for a specific group.

for the base permission you can use:
ViewListItems
AddListItems
EditListItems
DeleteListItems
ApproveItems
OpenItems
ViewVersions
DeleteVersions
CancelCheckout
ManagePersonalViews
ManageLists
ViewFormPages
Open
ViewPages
AddAndCustomizePages
ApplyThemeAndBorder
ApplyStyleSheets
ViewUsageData
ManageSubwebs
CreateGroups
ManagePermissions
BrowseDirectories
BrowseUserInfo
AddDelPrivateWebParts
UpdatePersonalWebParts
ManageWeb
UseClientIntegration
UseRemoteAPIs
ManageAlerts
CreateAlerts
EditMyUserInfo
EnumeratePermissions
CreateSSCSite

below the script :


$sites = get-spsite -Limit ALL –webapplication [webapp url]
ForEach ($spSite in $Sites)       
{        

$spWeb = $spSite.RootWeb

# Enter the Name of the Permission Level to Change
if ($PermissionLevel=$spWeb.RoleDefinitions["custom deinifition"])
{
Write-Host "working with : " $spSite -ForegroundColor Green
$bps = $PermissionLevel.…